|
1 /* |
|
2 * (c) 2000 Jiri Baum |
|
3 * Mario de Sousa |
|
4 * |
|
5 * Offered to the public under the terms of the GNU General Public License |
|
6 * as published by the Free Software Foundation; either version 2 of the |
|
7 * License, or (at your option) any later version. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, but |
|
10 * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
12 * Public License for more details. |
|
13 * |
|
14 * This code is made available on the understanding that it will not be |
|
15 * used in safety-critical situations without a full and competent review. |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __PLC_H |
|
20 #define __PLC_H |
|
21 |
|
22 #include <stdio.h> /* required for declaration of FILE */ |
|
23 |
|
24 #ifdef __cplusplus |
|
25 extern "C" { |
|
26 #endif |
|
27 |
|
28 |
|
29 #include "types.h" |
|
30 #include "log/log.h" |
|
31 #include "conffile/conffile.h" |
|
32 #include "cmm/cmm.h" |
|
33 #include "gmm/gmm.h" |
|
34 #include "synch/synch.h" |
|
35 #include "period/period.h" |
|
36 #include "state/state.h" |
|
37 #include "rt/rt.h" |
|
38 |
|
39 |
|
40 #define PLC_PT_NAME_MAX_LEN CMM_NAME_MAX_LEN |
|
41 |
|
42 /*** GENERAL ***/ |
|
43 int plc_init(char const *module_name, int argc, char **argv); |
|
44 int plc_done(void); |
|
45 |
|
46 /*** SYNCHING ***/ |
|
47 int plc_scan_beg(void); |
|
48 int plc_scan_end(void); |
|
49 |
|
50 /* memory must be de-allocated with free() */ |
|
51 const char *plc_module_name(void); |
|
52 |
|
53 /* |
|
54 * UTIL functions; |
|
55 */ |
|
56 int plc_print_usage(FILE *output); |
|
57 /* prints the command line arguments the plc_init() function accepts */ |
|
58 |
|
59 /* not to be used by general plc modules. This function is used by the |
|
60 * plc_shutdown() function. |
|
61 */ |
|
62 int plc_init_try(char const *module_name, int argc, char **argv); |
|
63 |
|
64 |
|
65 /* plc command line options leader */ |
|
66 #define CLO_LEADER "--PLC" |
|
67 |
|
68 /* plc command line options */ |
|
69 #define CLO_plc_id CLO_LEADER "plc_id=" |
|
70 #define CLO_loc_local CLO_LEADER "local" |
|
71 #define CLO_loc_isolate CLO_LEADER "isolate" |
|
72 #define CLO_loc_shared CLO_LEADER "shared" |
|
73 #define CLO_privmap_key CLO_LEADER "local_map_key=" |
|
74 #define CLO_log_level CLO_LEADER "debug=" |
|
75 #define CLO_log_file CLO_LEADER "logfile=" |
|
76 #define CLO_config_file CLO_LEADER "conf=" |
|
77 #define CLO_module_name CLO_LEADER "module=" |
|
78 #define CLO_force_init CLO_LEADER "force-init" |
|
79 |
|
80 |
|
81 #ifdef __cplusplus |
|
82 } |
|
83 #endif |
|
84 |
|
85 #endif /* __PLC_H */ |