Diff for /freem/src/fmadm.c between versions 1.8 and 1.18

version 1.8, 2025/03/22 18:43:54 version 1.18, 2025/03/31 16:33:56
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.18  2025/03/31 16:33:56  snw
    *   Work on fmadm edit global
    *
    *   Revision 1.17  2025/03/30 01:36:58  snw
    *   Make it easier to bring back fma_gedit, fix double-free in global handler, limit $CHAR to 7-bit ASCII
    *
    *   Revision 1.16  2025/03/24 20:59:58  snw
    *   Try using DosCopy API instead of built-in cp function on OS/2
    *
    *   Revision 1.15  2025/03/24 20:58:05  snw
    *   Try using DosCopy API instead of built-in cp function on OS/2
    *
    *   Revision 1.14  2025/03/24 20:57:06  snw
    *   Try using DosCopy API instead of built-in cp function on OS/2
    *
    *   Revision 1.13  2025/03/24 20:15:09  snw
    *   Set file permissions on freemd.exe on OS/2 in fmadm configure
    *
    *   Revision 1.12  2025/03/24 20:13:34  snw
    *   Set file permissions on freemd.exe on OS/2 in fmadm configure
    *
    *   Revision 1.11  2025/03/24 19:25:48  snw
    *   Make fmadm configure copy freem.exe to freemd.exe for daemon operation on OS/2 systems
    *
    *   Revision 1.10  2025/03/24 19:22:16  snw
    *   Make fmadm configure copy freem.exe to freemd.exe for daemon operation on OS/2 systems
    *
    *   Revision 1.9  2025/03/24 19:19:42  snw
    *   Make fmadm configure copy freem.exe to freemd.exe for daemon operation on OS/2 systems
    *
  *   Revision 1.8  2025/03/22 18:43:54  snw   *   Revision 1.8  2025/03/22 18:43:54  snw
  *   Make STRLEN 255 chars and add BIGSTR macro for larger buffers   *   Make STRLEN 255 chars and add BIGSTR macro for larger buffers
  *   *
Line 50 Line 80
 #include "namespace.h"  #include "namespace.h"
 #include "fs.h"  #include "fs.h"
   
   #if defined(__OS2__)
   # include <os2.h>
   #endif
   
 #ifdef HAVE_LIBREADLINE  #ifdef HAVE_LIBREADLINE
 #  if defined(HAVE_READLINE_READLINE_H)  #  if defined(HAVE_READLINE_READLINE_H)
 #    include <readline/readline.h>  #    include <readline/readline.h>
Line 1024  int fm_edit (short object, int optc, cha Line 1058  int fm_edit (short object, int optc, cha
         case OBJ_ROUTINE:          case OBJ_ROUTINE:
             return fma_routines_edit (optc, options);              return fma_routines_edit (optc, options);
   
         /*  
         case OBJ_GLOBAL:          case OBJ_GLOBAL:
             return fma_globals_edit (optc, options);              return fma_globals_edit (optc, options);
         */                          
               
         default:          default:
             fprintf (stderr, "fmadm:  'edit' is an invalid action for '%s'\n", obj_str);              fprintf (stderr, "fmadm:  'edit' is an invalid action for '%s'\n", obj_str);
             return 1;              return 1;
Line 1063  void fm_reconfigure(void) Line 1095  void fm_reconfigure(void)
     retval = rename (config_file, config_backup);      retval = rename (config_file, config_backup);
   
     if (retval == 0) {      if (retval == 0) {
         fprintf (stderr, "[OK]\n\n");          fprintf (stderr, "[OK]\n");
                   
         fm_configure ();          fm_configure ();
   
Line 1122  void fm_configure (void) Line 1154  void fm_configure (void)
     }      }
           
     if (file_exists (config_file)) {      if (file_exists (config_file)) {
         fprintf (stderr, "fmadm:  '%s' already exists.\n\n", config_file);          fprintf (stderr, "fmadm:  '%s' already exists; running fmadm reconfigure instead\n", config_file);
         fprintf (stderr, "'fmadm configure' may only be used on a fresh installation of FreeM.\n");          fm_reconfigure ();
         exit (1);          return;
     }      }
   
   
Line 1137  void fm_configure (void) Line 1169  void fm_configure (void)
     snprintf (envbase, 4095, "%s/freem/%s", SYSCONFDIR, fma_environment);       snprintf (envbase, 4095, "%s/freem/%s", SYSCONFDIR, fma_environment); 
     snprintf (nsbase, 4095, "%s/freem/%s", LOCALSTATEDIR, fma_environment);      snprintf (nsbase, 4095, "%s/freem/%s", LOCALSTATEDIR, fma_environment);
   
   #if defined(__OS2__)
       {
           char srcfile[PATHLEN];
           char dstfile[PATHLEN];        
           
           snprintf (srcfile, PATHLEN, "%s/bin/freem.exe", PREFIX);
           snprintf (dstfile, PATHLEN, "%s/bin/freemd.exe", PREFIX);
   
           unlink (dstfile);
           
           fprintf (stderr, "fmadm:  running on OS/2; will copy %s to %s\n", srcfile, dstfile);
           
           if (DosCopy (srcfile, dstfile, 1) != 0) {
               fprintf (stderr, "fmadm:  fatal error copying %s to %s\n", srcfile, dstfile);
               exit (1);
           }
   
           chmod (dstfile, 0755);
       }
   #else
       fprintf (stderr, "fmadm:  not running on OS/2\n");
   #endif
       
     printf ("\nFreeM Initial Configuration\n");      printf ("\nFreeM Initial Configuration\n");
     printf ("---------------------------\n\n");      printf ("---------------------------\n\n");
   
     printf ("This utility will create the initial configuration file for ");      printf ("This utility will create the initial configuration file for ");
     printf ("FreeM environment '%s' in %s.\n\n", fma_environment, config_file);          printf ("FreeM environment '%s' in %s.\n\n", fma_environment, config_file);    
   
           
     /* check for existence of needed directories */      /* check for existence of needed directories */
     if (stat (SYSCONFDIR, &etcstat) == -1) {      if (stat (SYSCONFDIR, &etcstat) == -1) {

Removed from v.1.8  
changed lines
  Added in v.1.18


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>