1: /*
2: * $Id: fmadm.h,v 1.8 2025/04/02 03:02:42 snw Exp $
3: * FreeM Administrative Tool
4: *
5: *
6: * Author: Serena Willis <snw@coherent-logic.com>
7: * Copyright (C) 1998 MUG Deutschland
8: * Copyright (C) 2020, 2025 Coherent Logic Development LLC
9: *
10: *
11: * This file is part of FreeM.
12: *
13: * FreeM is free software: you can redistribute it and/or modify
14: * it under the terms of the GNU Affero Public License as published by
15: * the Free Software Foundation, either version 3 of the License, or
16: * (at your option) any later version.
17: *
18: * FreeM is distributed in the hope that it will be useful,
19: * but WITHOUT ANY WARRANTY; without even the implied warranty of
20: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: * GNU Affero Public License for more details.
22: *
23: * You should have received a copy of the GNU Affero Public License
24: * along with FreeM. If not, see <https://www.gnu.org/licenses/>.
25: *
26: * $Log: fmadm.h,v $
27: * Revision 1.8 2025/04/02 03:02:42 snw
28: * Stop requiring users to pass -e to fmadm when -u or -g are passed
29: *
30: * Revision 1.7 2025/04/02 02:16:27 snw
31: * Add fmadm status environment command and move journals to a better location
32: *
33: * Revision 1.6 2025/04/01 20:11:46 snw
34: * Further work on fmadm
35: *
36: * Revision 1.5 2025/03/22 18:43:54 snw
37: * Make STRLEN 255 chars and add BIGSTR macro for larger buffers
38: *
39: * Revision 1.4 2025/03/15 03:19:34 snw
40: * Fix broken build and update to 0.62.1
41: *
42: * Revision 1.3 2025/03/09 19:14:25 snw
43: * First phase of REUSE compliance and header reformat
44: *
45: *
46: * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
47: * SPDX-License-Identifier: AGPL-3.0-or-later
48: **/
49:
50: #if !defined(_FMADM_H)
51: #define _FMADM_H
52:
53: #include "mpsdef0.h"
54:
55: #include "fma_globals.h"
56: #include "fma_journals.h"
57: #include "fma_locks.h"
58: #include "fma_routines.h"
59: #include "fma_jobs.h"
60:
61: #define FMA_MAXARGS 30
62:
63: #define FMAC_SELECT 0
64: #define FMAC_LIST 1
65: #define FMAC_EXAMINE 2
66: #define FMAC_VERIFY 3
67: #define FMAC_COMPACT 4
68: #define FMAC_REPAIR 5
69: #define FMAC_CREATE 6
70: #define FMAC_REMOVE 7
71: #define FMAC_IMPORT 8
72: #define FMAC_EXPORT 9
73: #define FMAC_BACKUP 10
74: #define FMAC_RESTORE 11
75: #define FMAC_MIGRATE 12
76: #define FMAC_EDIT 13
77: #define FMAC_SET 14
78: #define FMAC_SHOW 15
79: #define FMAC_EXIT 100
80: #define FMAC_INVALID 255
81:
82: #define ACT_LIST 0
83: #define ACT_EXAMINE 1
84: #define ACT_VERIFY 2
85: #define ACT_COMPACT 3
86: #define ACT_REPAIR 4
87: #define ACT_CREATE 5
88: #define ACT_REMOVE 6
89: #define ACT_IMPORT 7
90: #define ACT_EXPORT 8
91: #define ACT_BACKUP 9
92: #define ACT_RESTORE 10
93: #define ACT_MIGRATE 11
94: #define ACT_EDIT 12
95: #define ACT_START 13
96: #define ACT_STOP 14
97: #define ACT_RESTART 15
98: #define ACT_STATUS 16
99:
100: #define OBJ_LOCK 0
101: #define OBJ_JOURNAL 2
102: #define OBJ_NAMESPACE 3
103: #define OBJ_GLOBAL 4
104: #define OBJ_ROUTINE 5
105: #define OBJ_HARDCOPY 6
106: #define OBJ_RGAPROTOCOL 7
107: #define OBJ_JOB 8
108: #define OBJ_DAEMON 9
109:
110: #define UNSIGN(A) ((A)&0377)
111:
112: #if !defined(PATH_MAX)
113: # define PATH_MAX 1024
114: #endif
115:
116: int fmadm_usage (void);
117: void fmadm_exit (int retval);
118: int fm_list (short object, int optc, char **options);
119: int fm_examine (short object, int optc, char **options);
120: int fm_verify (short object, int optc, char **options);
121: int fm_compact (short object, int optc, char **options);
122: int fm_repair (short object, int optc, char **options);
123: int fm_create (short object, int optc, char **options);
124: int fm_remove (short object, int optc, char **options);
125: int fm_import (short object, int optc, char **options);
126: int fm_export (short object, int optc, char **options);
127: int fm_backup (short object, int optc, char **options);
128: int fm_restore (short object, int optc, char **options);
129: int fm_migrate (short object, int optc, char **options);
130: int fm_edit (short object, int optc, char **options);
131:
132: void fm_sig_attach (int sig, void *handler);
133: void fm_sig_init (void);
134: void fm_on_sigint (void);
135: void fm_on_sigterm (void);
136:
137: extern char fma_environment[STRLEN];
138: extern char fma_namespace[STRLEN];
139: extern char fma_routine_path[PATHLEN];
140: extern char fma_global_path[PATHLEN];
141: extern char fma_journal_path[PATHLEN];
142: extern char fma_pct_global_path[PATHLEN];
143: extern char fma_pct_routine_path[PATHLEN];
144: extern char fma_journal_cut_threshold[STRLEN];
145: extern char fma_locktab[PATHLEN];
146:
147: extern char gloplib[PATHLEN];
148: extern char glopath[PATHLEN];
149:
150: extern pid_t pid;
151:
152: extern short fma_base_opt;
153: extern short fma_min_args;
154:
155: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>