etisserant@1: /* etisserant@1: * (c) 2000 Jiri Baum etisserant@1: * Mario de Sousa etisserant@1: * etisserant@1: * Offered to the public under the terms of the GNU General Public License etisserant@1: * as published by the Free Software Foundation; either version 2 of the etisserant@1: * License, or (at your option) any later version. etisserant@1: * etisserant@1: * This program is distributed in the hope that it will be useful, but etisserant@1: * WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@1: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General etisserant@1: * Public License for more details. etisserant@1: * etisserant@1: * This code is made available on the understanding that it will not be etisserant@1: * used in safety-critical situations without a full and competent review. etisserant@1: */ etisserant@1: etisserant@1: etisserant@1: #ifndef __PLC_H etisserant@1: #define __PLC_H etisserant@1: etisserant@1: #include /* required for declaration of FILE */ etisserant@1: etisserant@1: #ifdef __cplusplus etisserant@1: extern "C" { etisserant@1: #endif etisserant@1: etisserant@1: etisserant@1: #include "types.h" etisserant@1: #include "log/log.h" etisserant@1: #include "conffile/conffile.h" etisserant@1: #include "cmm/cmm.h" etisserant@1: #include "gmm/gmm.h" etisserant@1: #include "synch/synch.h" etisserant@1: #include "period/period.h" etisserant@1: #include "state/state.h" etisserant@1: #include "rt/rt.h" etisserant@1: etisserant@1: etisserant@1: #define PLC_PT_NAME_MAX_LEN CMM_NAME_MAX_LEN etisserant@1: etisserant@1: /*** GENERAL ***/ etisserant@1: int plc_init(char const *module_name, int argc, char **argv); etisserant@1: int plc_done(void); etisserant@1: etisserant@1: /*** SYNCHING ***/ etisserant@1: int plc_scan_beg(void); etisserant@1: int plc_scan_end(void); etisserant@1: etisserant@1: /* memory must be de-allocated with free() */ etisserant@1: const char *plc_module_name(void); etisserant@1: etisserant@1: /* etisserant@1: * UTIL functions; etisserant@1: */ etisserant@1: int plc_print_usage(FILE *output); etisserant@1: /* prints the command line arguments the plc_init() function accepts */ etisserant@1: etisserant@1: /* not to be used by general plc modules. This function is used by the etisserant@1: * plc_shutdown() function. etisserant@1: */ etisserant@1: int plc_init_try(char const *module_name, int argc, char **argv); etisserant@1: etisserant@1: etisserant@1: /* plc command line options leader */ etisserant@1: #define CLO_LEADER "--PLC" etisserant@1: etisserant@1: /* plc command line options */ etisserant@1: #define CLO_plc_id CLO_LEADER "plc_id=" etisserant@1: #define CLO_loc_local CLO_LEADER "local" etisserant@1: #define CLO_loc_isolate CLO_LEADER "isolate" etisserant@1: #define CLO_loc_shared CLO_LEADER "shared" etisserant@1: #define CLO_privmap_key CLO_LEADER "local_map_key=" etisserant@1: #define CLO_log_level CLO_LEADER "debug=" etisserant@1: #define CLO_log_file CLO_LEADER "logfile=" etisserant@1: #define CLO_config_file CLO_LEADER "conf=" etisserant@1: #define CLO_module_name CLO_LEADER "module=" etisserant@1: #define CLO_force_init CLO_LEADER "force-init" etisserant@1: etisserant@1: etisserant@1: #ifdef __cplusplus etisserant@1: } etisserant@1: #endif etisserant@1: etisserant@1: #endif /* __PLC_H */