--- freem/src/symtab_bltin.c 2025/05/14 12:22:04 1.14 +++ freem/src/symtab_bltin.c 2025/05/18 18:15:38 1.15 @@ -1,5 +1,5 @@ /* - * $Id: symtab_bltin.c,v 1.14 2025/05/14 12:22:04 snw Exp $ + * $Id: symtab_bltin.c,v 1.15 2025/05/18 18:15:38 snw Exp $ * FreeM local system table and user-defined special variable table * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: symtab_bltin.c,v $ + * Revision 1.15 2025/05/18 18:15:38 snw + * Add ZEDIT command for editing routines + * * Revision 1.14 2025/05/14 12:22:04 snw * Further work on shared memory * @@ -141,19 +144,18 @@ void symtab_init (void) shm_config->hdr->argptr = mbpartition; - fprintf (stderr, "symtab_init: initializing memory-backed globals\r\n"); + logprintf (FM_LOG_INFO, "symtab_init: initializing memory-backed globals"); semid_symtab = semget (symtab_sk, 1, 0666 | IPC_CREAT); if (semid_symtab == -1) { - fprintf (stderr, "symtab_init: failed to create symbol table semaphore\r\n"); - exit (1); + logprintf (FM_LOG_FATAL, "symtab_init: failed to create symbol table semaphore"); } else { - fprintf (stderr, "symtab_init: symbol table semaphore created with semid %d\r\n", semid_symtab); + logprintf (FM_LOG_INFO, "symtab_init: symbol table semaphore created with semid %d", semid_symtab); } #if defined(__sun__) - fprintf (stderr, "symtab_init: falling back to global-backed structured system variables\r\n"); + logprintf (FM_LOG_WARNING, "symtab_init: falling back to global-backed structured system variables"); shm_config->hdr->use_mb_globals = FALSE; return; #endif @@ -161,14 +163,13 @@ void symtab_init (void) arg.val = 1; if (semctl (semid_symtab, 0, SETVAL, arg) == -1) { - fprintf (stderr, "symtab_init: failed to initialize symbol table semaphore\r\n"); - exit (1); + logprintf (FM_LOG_FATAL, "symtab_init: failed to initialize symbol table semaphore"); } else { - fprintf (stderr, "symtab_init: symbol table semaphore initialized\r\n"); + logprintf (FM_LOG_INFO, "symtab_init: symbol table semaphore initialized"); } - fprintf (stderr, "symtab_init: allocating partition for memory-backed globals\r\n"); + logprintf (FM_LOG_INFO, "symtab_init: allocating partition for memory-backed globals"); mbpartition = (char *) shm_alloc ((size_t) PSIZE + 2); if (mbpartition != NULL) { @@ -176,7 +177,7 @@ void symtab_init (void) shm_config->hdr->partition = mbpartition; } else { - fprintf (stderr, "symtab_init: falling back to global-backed structured system variables\r\n"); + logprintf (FM_LOG_WARNING, "symtab_init: falling back to global-backed structured system variables"); shm_config->hdr->use_mb_globals = FALSE; } @@ -190,7 +191,7 @@ void symtab_init (void) semid_symtab = semget (symtab_sk, 1, 0); if (semid_symtab == -1) { - fprintf (stderr, "symtab_init: could not attach to symbol table semaphore\r\n"); + logprintf (FM_LOG_FATAL, "symtab_init: could not attach to symbol table semaphore"); exit (1); } @@ -250,8 +251,10 @@ void symtab_shm (short action, char *key register int i; char *old_partition = partition; + /* global (action, key, data); return; + */ if (shm_config->hdr->use_mb_globals == FALSE) { symtab_bltin (action, key, data); @@ -310,7 +313,7 @@ void symtab_shm (short action, char *key } else { - fprintf (stderr, "symtab_shm: failed to acquire symbol table sempahore\r\n"); + logprintf (FM_LOG_FATAL, "symtab_shm: failed to acquire symbol table sempahore"); } writing_mb = FALSE;