|
|
| version 1.6, 2025/03/09 15:20:18 | version 1.11, 2025/03/24 19:25:48 |
|---|---|
| Line 1 | Line 1 |
| /* | /* |
| * * | * $Id$ |
| * * * | |
| * * * | |
| * *************** | |
| * * * * * | |
| * * MUMPS * | |
| * * * * * | |
| * *************** | |
| * * * | |
| * * * | |
| * * | |
| * | |
| * fmadm.c | |
| * FreeM Administration Tool | * FreeM Administration Tool |
| * | * |
| * | * |
| * Author: Serena Willis <snw@coherent-logic.com> | * Author: Serena Willis <snw@coherent-logic.com> |
| * Copyright (C) 1998 MUG Deutschland | * Copyright (C) 1998 MUG Deutschland |
| * Copyright (C) 2020, 2023 Coherent Logic Development LLC | * Copyright (C) 2020, 2023, 2025 Coherent Logic Development LLC |
| * | * |
| * | * |
| * This file is part of FreeM. | * This file is part of FreeM. |
| Line 35 | Line 23 |
| * You should have received a copy of the GNU Affero Public License | * You should have received a copy of the GNU Affero Public License |
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
| * | * |
| * $Log$ | |
| * 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 | |
| * Make STRLEN 255 chars and add BIGSTR macro for larger buffers | |
| * | |
| * Revision 1.7 2025/03/09 19:14:25 snw | |
| * First phase of REUSE compliance and header reformat | |
| * | |
| * | |
| * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC | |
| * SPDX-License-Identifier: AGPL-3.0-or-later | |
| **/ | **/ |
| #include <sys/types.h> | #include <sys/types.h> |
| Line 91 extern int read_history (); | Line 98 extern int read_history (); |
| /* namespace configuration */ | /* namespace configuration */ |
| char fma_environment[STRLEN]; | char fma_environment[STRLEN]; |
| char fma_namespace[STRLEN]; | char fma_namespace[STRLEN]; |
| char fma_routine_path[STRLEN]; | char fma_routine_path[PATHLEN]; |
| char fma_global_path[STRLEN]; | char fma_global_path[PATHLEN]; |
| char fma_journal_path[STRLEN]; | char fma_journal_path[PATHLEN]; |
| char fma_pct_global_path[STRLEN]; | char fma_pct_global_path[PATHLEN]; |
| char fma_pct_routine_path[STRLEN]; | char fma_pct_routine_path[PATHLEN]; |
| char fma_journal_cut_threshold[STRLEN]; | char fma_journal_cut_threshold[STRLEN]; |
| char fma_locktab[STRLEN]; | char fma_locktab[PATHLEN]; |
| short fma_base_opt = 1; | short fma_base_opt = 1; |
| short fma_min_args = 2; | short fma_min_args = 2; |
| short fma_explicit_namespace = FALSE; | short fma_explicit_namespace = FALSE; |
| Line 1139 void fm_configure (void) | Line 1146 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 (cp (dstfile, srcfile) != 0) { | |
| fprintf (stderr, "fmadm: fatal error copying %s to %s\n", srcfile, dstfile); | |
| exit (1); | |
| } | |
| } | |
| #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) { |