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