1 /* ***********************************************************
  2    *                                                         *
  3    * Copyright, (C) Honeywell Bull Inc., 1987                *
  4    *                                                         *
  5    * Copyright, (C) Honeywell Information Systems Inc., 1986 *
  6    *                                                         *
  7    *********************************************************** */
  8 
  9 /* HISTORY COMMENTS:
 10   1) change(86-08-22,Lee), approve(87-07-13,MCR7580), audit(87-07-13,Leskiw),
 11      install(87-08-07,MR12.1-1072):
 12      Created.
 13                                                    END HISTORY COMMENTS */
 14 
 15 /* : PROCEDURE FUNCTION (proc_op)
 16 
 17 Processes options in the emulator, depending on the key pressed.  The value
 18 of the terminate flag passed will always be FALSE unless the 'exit emulator'
 19 key was pressed.  This routine is called the MOWSE dumb emulator in the
 20 debug version.
 21 */
 22 
 23 
 24 #include <ctype.h>
 25 #include <ws.h>
 26 #include <ws_dcls.h>
 27 #include <wsmincap.h>
 28 #include <keydefs.h>
 29 #include <emulator.h>
 30 
 31 #if EM_DEBUG                           /* Do NOT compile if !EM_DEBUG */
 32 
 33 extern char *print_mode_type[];
 34 extern char *on_off_status[];
 35 extern int em_print_mode;
 36 extern int em_tab_size;
 37 extern int local_edit;
 38 extern int fg_data_only;
 39 extern int bg_sender_in;
 40 extern int bg_sender_out;
 41 extern int bg_sender_buff[];
 42 extern int dbgpkts;                    /* Debug packet flag */
 43 extern int dbgrejs;                    /* Debug rejected packetsflag */
 44 extern int dbgxchr;                    /* Debug extra chars flag */
 45 extern char *buff;
 46 
 47 db_process_options(option,terminate_flag)
 48 
 49 /* INPUT */
 50    int option;
 51 
 52 /* OUTPUT */
 53    int *terminate_flag;
 54 {
 55 
 56 /* : process special options */
 57 
 58    switch(option) {
 59 
 60 /* : - sit in a tight loop until any key is pressed */
 61 
 62       case F1:
 63          freeze();
 64          break;
 65 
 66 /* : - select a different display mode; the flag em_print_mode is used by
 67        the em_put and em_print_str routines */
 68 
 69       case F2:
 70          em_print_mode = (em_print_mode + 1) % 3;
 71          printf ("$$ print mode = %s $$\n",
 72          print_mode_type[em_print_mode]);
 73          break;
 74 
 75 /* : - display summary of function key functions */
 76 
 77       case F3:
 78          menu();
 79          break;
 80 
 81 /* : - toggle local_edit option flag; local_edit flag is used by get_kb_line */
 82 
 83       case F4:
 84          local_edit = !local_edit;
 85          printf ("$$ local edit = %s $$\n", on_off_status[local_edit]);
 86          break;
 87 
 88 /* : - toggle foreground terminal data only/any foreground data;
 89        fg_data_only flag is used in the main emulator routine */
 90 
 91       case F5:
 92          fg_data_only = !fg_data_only;
 93          printf ("$$ terminal data only = %s $$\n", on_off_status[fg_data_only]);
 94          break;
 95 
 96 /* : - display the status of the background query queue */
 97 
 98       case F6:
 99          sender_query_status();
100          break;
101 
102 /* : - display or set a new tab size; used by em_print_str and
103        get_kb_line routines */
104 
105       case F7:
106          set_tab_size();
107          break;
108 
109 /* : - pass a command to the command interpreter */
110 
111       case F8:
112          execute_dos_cmd();
113          break;
114 
115 /* : - send a foreground break */
116 
117       case F9:
118          puttdata(FG_BREAK,0,0);
119          break;
120 
121 /* : - set flag to exit the emulator */
122 
123       case F10:
124          *terminate_flag = FALSE;
125          break;
126 
127 /* : - toggle debug packets */
128 
129       case ALT_F1:
130          dbgpkts = !dbgpkts;
131          printf ("$$ DBG Show Packets = %s $$\n", on_off_status[dbgpkts]);
132          break;
133 
134 /* : - toggle reject packets */
135 
136       case ALT_F2:
137          dbgrejs = !dbgrejs;
138          printf ("$$ DBG Diagnose Rejects = %s $$\n", on_off_status[dbgrejs]);
139          break;
140 
141 /* : - toggle extra character debug */
142 
143       case ALT_F3:
144          dbgxchr = !dbgxchr;
145          printf ("$$ DBG Show Extraneous Receive Characters = %s $$\n", on_off_status[dbgxchr]);
146          break;
147    }
148 }
149 
150 #else
151 db_process_options()
152 {}
153 #endif
154 ^Z