|
|
| version 1.9, 2025/03/24 04:13:12 | version 1.13, 2025/04/10 01:24:39 |
|---|---|
| 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.13 2025/04/10 01:24:39 snw | |
| * Remove C++ style comments | |
| * | |
| * Revision 1.12 2025/04/09 19:52:02 snw | |
| * Eliminate as many warnings as possible while building with -Wall | |
| * | |
| * Revision 1.11 2025/04/02 03:02:42 snw | |
| * Stop requiring users to pass -e to fmadm when -u or -g are passed | |
| * | |
| * Revision 1.10 2025/03/27 03:27:35 snw | |
| * Install init scripts to share/freem/examples/init and fix regression in method dispatch | |
| * | |
| * Revision 1.9 2025/03/24 04:13:12 snw | * Revision 1.9 2025/03/24 04:13:12 snw |
| * Replace action macro dat with fra_dat to avoid symbol conflict on OS/2 | * Replace action macro dat with fra_dat to avoid symbol conflict on OS/2 |
| * | * |
| Line 898 set0: | Line 910 set0: |
| if (isalpha (vn[0]) && *(codptr + 1) == ':') { | if (isalpha (vn[0]) && *(codptr + 1) == ':') { |
| char sc_string[255]; | char sc_string[255]; |
| register int sci; | |
| codptr += 2; | codptr += 2; |
| expr (NAME); | expr (NAME); |
| Line 935 set0: | Line 946 set0: |
| if (*++codptr != '=') { | if (*++codptr != '=') { |
| /* SET A++ or SET A-- equivalent to SET A+=1 SET A-=1 currently disabled */ | /* unary ++/-- */ |
| //#ifdef NEVER | |
| if ((ch == '+' || ch == '-') && ch == *codptr) { | if ((ch == '+' || ch == '-') && ch == *codptr) { |
| codptr++; | codptr++; |
| setop = ch; | setop = ch; |
| Line 945 set0: | Line 955 set0: |
| goto set2; | goto set2; |
| } | } |
| //#endif /* NEVER */ | |
| merr_raise (ASSIGNER); | merr_raise (ASSIGNER); |
| break; | break; |
| Line 1031 set2: | Line 1040 set2: |
| if (new_and_set == TRUE) new_and_set = FALSE; | if (new_and_set == TRUE) new_and_set = FALSE; |
| if (new_object == TRUE) new_object = FALSE; | if (new_object == TRUE) new_object = FALSE; |
| /* | |
| set1: | set1: |
| */ | |
| if (*codptr != ',') break; | if (*codptr != ',') break; |
| if (*++codptr == '@') goto again; | if (*++codptr == '@') goto again; |
| Line 1595 set10: | Line 1606 set10: |
| } | } |
| if (stcat (tmp2, &tmp3[arg4]) == 0) { | if (stcat (tmp2, &tmp3[arg4]) == 0) { |
| merr_raise (M56); //JPW | merr_raise (M56); /* snw */ |
| goto err; | goto err; |
| } | } |
| Line 2374 s_end: | Line 2385 s_end: |
| #ifdef DEBUG_NEWSTACK | #ifdef DEBUG_NEWSTACK |
| printf ("EXTRINSIC\r\n"); | printf ("EXTRINSIC\r\n"); |
| #endif | #endif |
| //printf (" extr_types[%d] = '%d'\r\n", nstx, extr_types[nstx]); | |
| if (*codptr == EOL || *codptr == SP) { | if (*codptr == EOL || *codptr == SP) { |
| #ifdef DEBUG_NEWSTACK | #ifdef DEBUG_NEWSTACK |
| Line 3760 off3: | Line 3770 off3: |
| break; | break; |
| case KILL: | case KILL: |
| /* argumentless: KILL all local variables */ | /* argumentless: KILL all local variables */ |
| if (((ch = *codptr) == SP) || ch == EOL) { | if (((ch = *codptr) == SP) || ch == EOL) { |
| symtab (kill_all, "", ""); | symtab (kill_all, "", ""); |
| Line 3794 off3: | Line 3804 off3: |
| if (destructor_ct) { | if (destructor_ct) { |
| for (cd = 0; cd < destructor_ct; cd++) { | for (cd = 0; cd < destructor_ct; cd++) { |
| strcat (destc, destructors[cd]); | if (strlen (destructors[cd]) > 0) { |
| strcat (destc, ","); | strcat (destc, destructors[cd]); |
| strcat (destc, ","); | |
| } | |
| } | } |
| destructor_ct = 0; | destructor_ct = 0; |
| Line 3997 off3: | Line 4009 off3: |
| goto set2; | goto set2; |
| } | } |
| /* | |
| post_new: | post_new: |
| */ | |
| ch = nstx; | ch = nstx; |
| while (nestc[ch] == FOR) ch--; /* FOR does not define a NEW level */ | while (nestc[ch] == FOR) ch--; /* FOR does not define a NEW level */ |
| Line 5087 open_socket: | Line 5100 open_socket: |
| #endif | #endif |
| if (nestc[nstx] == BREAK) { | if (nestc[nstx] == BREAK) { |
| // printf ("nestc[nstx] was BREAK\r\n"); | |
| if (repQUIT) continue; | if (repQUIT) continue; |
| merr_raise (OK - CTRLB); | merr_raise (OK - CTRLB); |
| goto zgo; /*cont. single step */ | goto zgo; /*cont. single step */ |
| } | } |
| // else { | |
| // printf ("nestc[nstx] was _not_ BREAK\r\n"); | |
| // } | |
| if (nestc[nstx] == FOR) { | if (nestc[nstx] == FOR) { |
| Line 5671 zgo: | Line 5680 zgo: |
| } | } |
| case ZWRITE: | case ZWRITE: |
| zwrite: | |
| { | { |
| short k; | short k; |
| char w_tmp[512]; | char w_tmp[512]; |
| Line 5797 zwritep: | Line 5803 zwritep: |
| expr (NAME); | expr (NAME); |
| //if (varnam[0] == '^') merr_raise (GLOBER); | |
| if (merr () > OK) goto err; | if (merr () > OK) goto err; |
| codptr++; | codptr++; |
| Line 6039 zwritep: | Line 6044 zwritep: |
| break; | break; |
| case ZALLOCATE: | /* user defined Z-COMMAND */ |
| /* argumentless is not permitted */ | |
| if (*codptr == SP || *codptr == EOL) { | |
| merr_raise (ARGLIST); | |
| break; | |
| } | |
| expr (NAME); | |
| if (merr () > OK) goto err; | |
| tmp[0] = SP; | |
| stcpy (&tmp[1], varnam); | |
| stcat (tmp, "\001\201"); | |
| frm_timeout = (-1L); /* no timeout */ | |
| if (*++codptr == ':') { | |
| codptr++; | |
| expr (STRING); | |
| frm_timeout = intexpr (argptr); | |
| if (merr () > OK) goto err; | |
| if (frm_timeout < 0L) frm_timeout = 0L; | |
| } | |
| lock (tmp, frm_timeout, ZALLOCATE); | |
| break; | |
| case ZDEALLOCATE: | |
| tmp[0] = SP; | |
| if (*codptr == SP || *codptr == EOL) { | |
| tmp[1] = EOL; | |
| } | |
| else { | |
| expr (NAME); | |
| if (merr () > OK) goto err; | |
| stcpy (&tmp[1], varnam); | |
| codptr++; | |
| } | |
| lock (tmp, -1L, ZDEALLOCATE); /* -1: no timeout */ | |
| break; | |
| /* user defined Z-COMMAND */ | |
| case PRIVATE: | case PRIVATE: |
| private: /* for in-MUMPS defined commands */ | private: /* for in-MUMPS defined commands */ |
| Line 6633 evthandler: /* for event hand | Line 6583 evthandler: /* for event hand |
| /* run the next iteration of GTK's event loop */ | /* run the next iteration of GTK's event loop */ |
| //TODO: replace with libXt event loop | /* TODO: replace with libXt event loop */ |
| //gtk_main_iteration_do (TRUE); | /* gtk_main_iteration_do (TRUE); */ |
| /* dequeue any events */ | /* dequeue any events */ |
| evt_count = mwapi_dequeue_events (syn_handlers); | evt_count = mwapi_dequeue_events (syn_handlers); |
| if (evt_count) { | if (evt_count) { |
| /* write them out */ | /* write them out */ |
| //printf ("event handlers = '%s'\r\n", syn_handlers); | /* printf ("event handlers = '%s'\r\n", syn_handlers); */ |
| syn_event_entry_nstx = nstx; | syn_event_entry_nstx = nstx; |
| Line 7086 restart: | Line 7036 restart: |
| DSW &= ~BIT0; /* enable ECHO */ | DSW &= ~BIT0; /* enable ECHO */ |
| // print here | /* print here */ |
| { | { |
| char *t_rtn; | char *t_rtn; |
| char *t_nsn = (char *) malloc (STRLEN * sizeof (char)); | char *t_nsn = (char *) malloc (STRLEN * sizeof (char)); |
| Line 7424 direct_mode: | Line 7374 direct_mode: |
| #endif | #endif |
| if (merr () > OK) goto err; | if (merr () > OK) goto err; |
| // printf ("zbflag = %d\r\n", zbflag); | |
| if (code[0] == EOL && zbflag && nestc[nstx] == BREAK) { | if (code[0] == EOL && zbflag && nestc[nstx] == BREAK) { |
| //printf ("cont single step\r\n"); | |
| debug_mode = TRUE; | debug_mode = TRUE; |
| merr_raise (OK - CTRLB); | merr_raise (OK - CTRLB); |
| //printf ("ierr now '%d'\r\n", ierr); | |
| goto zgo; | goto zgo; |
| } /* single step */ | } /* single step */ |
| } | } |
| Line 7500 void rbuf_dump(void) | Line 7445 void rbuf_dump(void) |
| for (i = 0; i < NO_OF_RBUF; i++) { | for (i = 0; i < NO_OF_RBUF; i++) { |
| sprintf (flgs, ""); | flgs[0] = '\0'; |
| if (ages[i] == 0) { | if (ages[i] == 0) { |
| sprintf (rnam, "---------"); | sprintf (rnam, "---------"); |