|
|
| version 1.26, 2025/05/19 02:03:31 | version 1.32, 2026/03/19 19:03:58 |
|---|---|
| Line 24 | Line 24 |
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
| * | * |
| * $Log$ | * $Log$ |
| * Revision 1.32 2026/03/19 19:03:58 snw | |
| * Attempt to rectify terminal corruption problem when the user performs a gracious exit | |
| * | |
| * Revision 1.31 2025/05/20 18:07:41 snw | |
| * Add completion to debugger | |
| * | |
| * Revision 1.30 2025/05/20 16:20:42 snw | |
| * Update ROUTINE SSVN after ZEDIT and ZSAVE | |
| * | |
| * Revision 1.29 2025/05/20 14:56:56 snw | |
| * Fix direct-mode interface to online help | |
| * | |
| * Revision 1.28 2025/05/20 14:36:06 snw | |
| * Documentation updates; raise ZCMMND instead of NOSTAND for restricted_mode restrictions | |
| * | |
| * Revision 1.27 2025/05/19 21:29:29 snw | |
| * Add basic tab completion to direct mode | |
| * | |
| * Revision 1.26 2025/05/19 02:03:31 snw | * Revision 1.26 2025/05/19 02:03:31 snw |
| * Reverse-engineer and document argumented ZPRINT (thanks to D. Wicksell) | * Reverse-engineer and document argumented ZPRINT (thanks to D. Wicksell) |
| * | * |
| Line 183 void rbuf_dump(void); | Line 201 void rbuf_dump(void); |
| short rbuf_slot_from_name(char *); | short rbuf_slot_from_name(char *); |
| short is_standard(void); | short is_standard(void); |
| #ifdef HAVE_LIBREADLINE | |
| char *m_commands[] = { | |
| "?", | |
| "@", | |
| "!<", | |
| "!>", | |
| "!!", | |
| "ablock", | |
| "astart", | |
| "astop", | |
| "aunblock", | |
| "break", | |
| "close", | |
| "do", | |
| "else", | |
| "events", | |
| "for", | |
| "goto", | |
| "halt", | |
| "hang", | |
| "history", | |
| "if", | |
| "job", | |
| "jobtab", | |
| "kill", | |
| "ksubscripts", | |
| "kvalue", | |
| "lock", | |
| "locktab", | |
| "merge", | |
| "new", | |
| "open", | |
| "quit", | |
| "rbuf", | |
| "rcl", | |
| "read", | |
| "set", | |
| "shmpages", | |
| "shmstat", | |
| "tcommit", | |
| "then", | |
| "trantab", | |
| "trollback", | |
| "tstart", | |
| "use", | |
| "view", | |
| "wh", | |
| "write", | |
| "xecute", | |
| "zassert", | |
| "zbreak", | |
| "zconst", | |
| "zedit", | |
| "zgoto", | |
| "zhalt", | |
| "zinsert", | |
| "zjob", | |
| "zload", | |
| "zmap", | |
| "znew", | |
| "zprint", | |
| "zquit", | |
| "zremove", | |
| "zsave", | |
| "zthrow", | |
| "ztrap", | |
| "zunmap", | |
| "zwatch", | |
| "zwith", | |
| "zwrite", | |
| "ABLOCK", | |
| "ASTART", | |
| "ASTOP", | |
| "AUNBLOCK", | |
| "BREAK", | |
| "CLOSE", | |
| "DO", | |
| "ELSE", | |
| "FOR", | |
| "GOTO", | |
| "HALT", | |
| "HANG", | |
| "IF", | |
| "JOB", | |
| "KILL", | |
| "KSUBSCRIPTS", | |
| "KVALUE", | |
| "LOCK", | |
| "MERGE", | |
| "NEW", | |
| "OPEN", | |
| "QUIT", | |
| "READ", | |
| "SET", | |
| "TCOMMIT", | |
| "THEN", | |
| "TROLLBACK", | |
| "TSTART", | |
| "USE", | |
| "VIEW", | |
| "WRITE", | |
| "XECUTE", | |
| "ZASSERT", | |
| "ZBREAK", | |
| "ZCONST", | |
| "ZEDIT", | |
| "ZGOTO", | |
| "ZHALT", | |
| "ZINSERT", | |
| "ZJOB", | |
| "ZLOAD", | |
| "ZMAP", | |
| "ZNEW", | |
| "ZPRINT", | |
| "ZQUIT", | |
| "ZREMOVE", | |
| "ZSAVE", | |
| "ZTHROW", | |
| "ZTRAP", | |
| "ZUNMAP", | |
| "ZWATCH", | |
| "ZWITH", | |
| "ZWRITE", | |
| NULL | |
| }; | |
| char **command_completion(const char *, int, int); | |
| char *command_generator(const char *, int); | |
| char **command_completion(const char *text, int start, int end) | |
| { | |
| if (start > 0) return NULL; | |
| rl_attempted_completion_over = 1; | |
| return rl_completion_matches (text, command_generator); | |
| } | |
| char *command_generator(const char *text, int state) | |
| { | |
| static int list_index, len; | |
| char *name; | |
| if (!state) { | |
| list_index = 0; | |
| len = strlen (text); | |
| } | |
| while ((name = m_commands[list_index++])) { | |
| if (strncmp (name, text, len) == 0) { | |
| return strdup (name); | |
| } | |
| } | |
| return NULL; | |
| } | |
| #endif | |
| /* | /* |
| * xecline(): | * xecline(): |
| * typ (where to go on function entry): 1 = restart | * typ (where to go on function entry): 1 = restart |
| Line 543 next0: | Line 717 next0: |
| if (ch == '!') { /* UNIXCALL */ | if (ch == '!') { /* UNIXCALL */ |
| if (restricted_mode) { | if (restricted_mode) { |
| merr_raise (NOSTAND); | merr_raise (CMMND); |
| goto err; | goto err; |
| } | } |
| Line 4546 use_socket: | Line 4720 use_socket: |
| if (k > MAXSEQ) goto open_socket; | if (k > MAXSEQ) goto open_socket; |
| if (restricted_mode) { | if (restricted_mode) { |
| merr_raise (NOSTAND); | merr_raise (CMMND); |
| goto err; | goto err; |
| } | } |
| Line 4982 halt: | Line 5156 halt: |
| i = 0; | i = 0; |
| } | } |
| set_io (UNIX); | |
| cleanup (); | cleanup (); |
| if (father) { /* advertise death to parent *//* make sure father is waiting !!! */ | if (father) { /* advertise death to parent *//* make sure father is waiting !!! */ |
| Line 5460 zgo: | Line 5635 zgo: |
| } | } |
| zsave (varnam); | zsave (varnam); |
| ssvn_routine_update (); | |
| break; | break; |
| Line 5691 zgo: | Line 5867 zgo: |
| } | } |
| if ((*(beg + 1)) == EOL) break; | if ((*(beg + 1)) == EOL) break; |
| write_m (beg + 1); | write_m (beg + 1); |
| if (merr () > OK) break; | if (merr () > OK) break; |
| } | } |
| Line 7293 direct_mode: | Line 7469 direct_mode: |
| int hist_idx; | int hist_idx; |
| HIST_ENTRY *hist_ent; | HIST_ENTRY *hist_ent; |
| rl_attempted_completion_function = command_completion; | |
| if (quiet_mode == FALSE) { | if (quiet_mode == FALSE) { |
| if (tp_level == 0) { | if (tp_level == 0) { |
| snprintf (fmrl_prompt, sizeof (fmrl_prompt) - 1, "\r\n%s.%s> ", shm_env, nsname); | snprintf (fmrl_prompt, sizeof (fmrl_prompt) - 1, "\r\n%s.%s> ", shm_env, nsname); |
| Line 7330 direct_mode: | Line 7508 direct_mode: |
| char kb[20]; | char kb[20]; |
| char db[STRLEN]; | char db[STRLEN]; |
| snprintf (kb, sizeof (kb) - 1, "%%SYS.HLP\201"); | snprintf (kb, sizeof (kb) - 1, "%%SYSHLP\201"); |
| snprintf (db, STRLEN - 1, "\201"); | snprintf (db, STRLEN - 1, "\201"); |
| symtab (kill_sym, kb, db); | symtab (kill_sym, kb, db); |