Posted By

lalzy on 05/18/14


Tagged


Versions (?)

MTU-Changing program - Main.lisp


 / Published in: Lisp
 

The Main-loop and other main-functions.

  1. ;;;; Start-up, use and compilation
  2.  
  3. ;;; Global-Imports
  4. (ql:quickload "cl-utilities")
  5. (load "mtu_settings.lisp")
  6. (load "mtu_menus.lisp")
  7. (load "mtu_input.lisp")
  8.  
  9. ;;; Global variables
  10. (defvar *mtu* nil)
  11. (defvar *mtub* nil) ; backup
  12. (defvar *interface* nil)
  13.  
  14. (defun main_menu (preset)
  15. "The Main Menu"
  16. (show_main_menu preset)
  17. (let ((input (input_loop #'menu_input_check `(,preset))))
  18. (cond ((equal input 'settings)
  19. (show_settings_menu)
  20. (setf input (input_loop #'settings_input_check nil))
  21. (if (equal input 'exit)
  22. (main_menu preset)
  23. (format t "Selected: ~a" input)))
  24. ((equal input 'exit)
  25. (exit))
  26. ((equal input 'showmtu)
  27. (format t "Current MTU Value: ~a~%" *mtu*))
  28. ((equal input 'editMtu)
  29. (edit_mtu))
  30. ((equal input 'createpmtu)
  31. (create_preset_mtu))
  32. ((equal input 'loadpmtu)
  33. (load_preset_mtu))
  34. ((equal input 'editpmtu)
  35. (edit_preset_mtu))
  36. ((equal input 'deletepmtu)
  37. (delete_preset_mtu))
  38. (t (format t "Selected: ~a" input))))
  39. (main_menu preset))
  40.  
  41.  
  42. (defun main (&optional preset)
  43. "Main Loop"
  44. (when (equal (load_settings) 'None)
  45. (show_interface_selection (get_interface_list))
  46. (let ((interface (input_loop #'interface_input_check (get_interface_list))))
  47. (create_settings interface))
  48. (main_menu preset)))
  49.  
  50.  
  51. (defun start ()
  52. "Start-up function"
  53. (main)
  54. )
  55.  
  56. #|
  57.  
  58. (Ext:saveinitmem "W:\\Lisp\\rel-dir\\MTU\\mtu.exe"
  59. :init-function #'start
  60. :NORC t
  61. :script t
  62. :executable t
  63. :quiet t)
  64. #|

Report this snippet  

You need to login to post a comment.