libamxrt  0.4.2
Ambiorix Run Time Library
amxrt.h File Reference
#include <getopt.h>
#include <amxc/amxc_macros.h>
#include <amxc/amxc.h>
#include <amxp/amxp.h>
#include <amxd/amxd_dm.h>
#include <amxo/amxo.h>
#include <amxo/amxo_mibs.h>
#include <amxb/amxb.h>

Go to the source code of this file.

Macros

#define AMXRT_COPT_URIS   "uris"
 
#define AMXRT_COPT_DATA_URIS   "data-uris"
 
#define AMXRT_COPT_BACKENDS   "backends"
 
#define AMXRT_COPT_AUTO_DETECT   "auto-detect"
 
#define AMXRT_COPT_AUTO_CONNECT   "auto-connect"
 
#define AMXRT_COPT_INCDIRS   "include-dirs"
 
#define AMXRT_COPT_LIBDIRS   "import-dirs"
 
#define AMXRT_COPT_MIBDIRS   "mib-dirs"
 
#define AMXRT_COPT_ODL   "ODL"
 
#define AMXRT_COPT_DAEMON   "daemon"
 
#define AMXRT_COPT_PRIORITY   "priority"
 
#define AMXRT_COPT_PID_FILE   "pid-file"
 
#define AMXRT_COPT_NAME   "name"
 
#define AMXRT_COPT_PREFIX_PATH   "prefix"
 
#define AMXRT_COPT_PLUGIN_DIR   "plugin-dir"
 
#define AMXRT_COPT_CFG_DIR   "cfg-dir"
 
#define AMXRT_COPT_LISTEN   "listen"
 
#define AMXRT_COPT_EVENT   "dm-eventing-enabled"
 
#define AMXRT_COPT_DUMP_CONFIG   "dump-config"
 
#define AMXRT_COPT_DUMP_CAPS   "dump-caps"
 
#define AMXRT_COPT_BACKENDS_DIR   "backend-dir"
 
#define AMXRT_COPT_RW_DATA_PATH   "rw_data_path"
 
#define AMXRT_COPT_STORAGE_DIR   "storage-path"
 
#define AMXRT_COPT_STORAGE_TYPE   "storage-type"
 
#define AMXRT_COPT_ODL_CONFIG   "odl"
 
#define AMXRT_COPT_LOG   "log"
 
#define AMXRT_COPT_REQUIRES   "requires"
 
#define AMXRT_COPT_HANDLE_EVENTS   "dm-events-before-start"
 
#define AMXRT_COPT_SUSPEND   "dm-events-suspend-when-requires"
 
#define AMXRT_COPT_EXT_DIR   "extensions-dir"
 
#define AMXRT_COPT_DIRECTORY   "odl.directory"
 
#define AMXRT_COPT_DEFAULTS   "odl.dm-defaults"
 
#define AMXRT_COPT_EVENTS   "odl.load-dm-events"
 
#define AMXRT_COPT_OBJECTS   "odl.dm-objects"
 
#define AMXRT_COPT_LOAD   "odl.dm-load"
 
#define AMXRT_COPT_SAVE   "odl.dm-save"
 
#define AMXRT_COPT_ON_CHANGED   "odl.dm-save-on-changed"
 
#define AMXRT_COPT_DELAY   "odl.dm-save-delay"
 
#define AMXRT_COPT_INIT_DELAY   "odl.dm-save-init-delay"
 
#define AMXRT_COPT_STORAGE   "storage-type"
 

Typedefs

typedef int(* amxrt_arg_fn_t) (amxc_var_t *config, int arg_id, const char *value)
 

Functions

amxc_var_t * amxrt_get_config (void)
 Gets the htable variant containing the configuration options. More...
 
amxo_parser_t * amxrt_get_parser (void)
 Gets runtime odl parser. More...
 
amxd_dm_t * amxrt_get_dm (void)
 Gets the runtime data model storage. More...
 
void amxrt_new (void)
 Create the ambiorix runtime. More...
 
int amxrt (int argc, char *argv[], amxrt_arg_fn_t fn)
 This function can create full ambiorix application (data model provider or client). More...
 
int amxrt_init (int argc, char *argv[], amxrt_arg_fn_t fn)
 Initializes the ambiorix runtime. More...
 
int amxrt_register_or_wait (void)
 Register the data model or wait for required data model objects. More...
 
int amxrt_run (void)
 Starts the event loop. More...
 
void amxrt_stop (void)
 Stops the runtime. More...
 
void amxrt_delete (void)
 Clean-up ambiorix runtime. More...
 
int amxrt_load_odl_files (int argc, char *argv[], int index)
 Load odls files mentioned on the command line or the default odl file. More...
 
int amxrt_connect (void)
 Connects to all bus sockets. More...
 
void amxrt_enable_syssigs (amxc_var_t *syssigs)
 Enables system signals that should be monitored by the eventloop. More...
 
void amxrt_cmd_line_options_reset (void)
 Removes all default options. More...
 
int amxrt_cmd_line_add_option (int id, char short_option, const char *long_option, int has_args, const char *doc, const char *arg_doc)
 Adds a command line option definition. More...
 
void amxrt_cmd_line_set_usage_doc (const char *usage)
 Set the overall usage documentation string. More...
 
int amxrt_cmd_line_parse (int argc, char *argv[], amxrt_arg_fn_t fn)
 Starts parsing the command line options. More...
 
void amxrt_cmd_line_parse_assignment (const char *option, bool force)
 Parses an command line option or an argument with an assignment. More...
 
void amxrt_print_usage (void)
 Prints the usage information and all available options to stdout. More...
 
int amxrt_config_init (int argc, char *argv[], int *index, amxrt_arg_fn_t fn)
 Initializes the default runtime configuration. More...
 
void amxrt_config_scan_backend_dirs (void)
 Scan backend directories for available backends. More...
 
void amxrt_config_read_env_var (const char *var_name, const char *config_name, int32_t var_type)
 Helper function to read an environment variable and add it's value to the runtime configuration. More...
 
int amxrt_el_create (void)
 Creates and initializes all needed event loop components. More...
 
int amxrt_el_start (void)
 Starts the event loop. More...
 
int amxrt_el_stop (void)
 Stops the event loop. More...
 
int amxrt_el_destroy (void)
 Cleans-up the event loop components. More...
 
int amxrt_dm_save_load_main (int reason, amxd_dm_t *dm, amxo_parser_t *parser)
 The data model auto load and save module. More...
 
int amxrt_caps_apply (void)
 Apply the user, group and capabilities as defined in the configuration. More...
 
void amxrt_caps_dump (void)
 Dumps the capabilities of the process. More...
 

Macro Definition Documentation

◆ AMXRT_COPT_AUTO_CONNECT

#define AMXRT_COPT_AUTO_CONNECT   "auto-connect"

Definition at line 77 of file amxrt.h.

◆ AMXRT_COPT_AUTO_DETECT

#define AMXRT_COPT_AUTO_DETECT   "auto-detect"

Definition at line 76 of file amxrt.h.

◆ AMXRT_COPT_BACKENDS

#define AMXRT_COPT_BACKENDS   "backends"

Definition at line 75 of file amxrt.h.

◆ AMXRT_COPT_BACKENDS_DIR

#define AMXRT_COPT_BACKENDS_DIR   "backend-dir"

Definition at line 93 of file amxrt.h.

◆ AMXRT_COPT_CFG_DIR

#define AMXRT_COPT_CFG_DIR   "cfg-dir"

Definition at line 88 of file amxrt.h.

◆ AMXRT_COPT_DAEMON

#define AMXRT_COPT_DAEMON   "daemon"

Definition at line 82 of file amxrt.h.

◆ AMXRT_COPT_DATA_URIS

#define AMXRT_COPT_DATA_URIS   "data-uris"

Definition at line 74 of file amxrt.h.

◆ AMXRT_COPT_DEFAULTS

#define AMXRT_COPT_DEFAULTS   "odl.dm-defaults"

Definition at line 105 of file amxrt.h.

◆ AMXRT_COPT_DELAY

#define AMXRT_COPT_DELAY   "odl.dm-save-delay"

Definition at line 111 of file amxrt.h.

◆ AMXRT_COPT_DIRECTORY

#define AMXRT_COPT_DIRECTORY   "odl.directory"

Definition at line 104 of file amxrt.h.

◆ AMXRT_COPT_DUMP_CAPS

#define AMXRT_COPT_DUMP_CAPS   "dump-caps"

Definition at line 92 of file amxrt.h.

◆ AMXRT_COPT_DUMP_CONFIG

#define AMXRT_COPT_DUMP_CONFIG   "dump-config"

Definition at line 91 of file amxrt.h.

◆ AMXRT_COPT_EVENT

#define AMXRT_COPT_EVENT   "dm-eventing-enabled"

Definition at line 90 of file amxrt.h.

◆ AMXRT_COPT_EVENTS

#define AMXRT_COPT_EVENTS   "odl.load-dm-events"

Definition at line 106 of file amxrt.h.

◆ AMXRT_COPT_EXT_DIR

#define AMXRT_COPT_EXT_DIR   "extensions-dir"

Definition at line 102 of file amxrt.h.

◆ AMXRT_COPT_HANDLE_EVENTS

#define AMXRT_COPT_HANDLE_EVENTS   "dm-events-before-start"

Definition at line 100 of file amxrt.h.

◆ AMXRT_COPT_INCDIRS

#define AMXRT_COPT_INCDIRS   "include-dirs"

Definition at line 78 of file amxrt.h.

◆ AMXRT_COPT_INIT_DELAY

#define AMXRT_COPT_INIT_DELAY   "odl.dm-save-init-delay"

Definition at line 112 of file amxrt.h.

◆ AMXRT_COPT_LIBDIRS

#define AMXRT_COPT_LIBDIRS   "import-dirs"

Definition at line 79 of file amxrt.h.

◆ AMXRT_COPT_LISTEN

#define AMXRT_COPT_LISTEN   "listen"

Definition at line 89 of file amxrt.h.

◆ AMXRT_COPT_LOAD

#define AMXRT_COPT_LOAD   "odl.dm-load"

Definition at line 108 of file amxrt.h.

◆ AMXRT_COPT_LOG

#define AMXRT_COPT_LOG   "log"

Definition at line 98 of file amxrt.h.

◆ AMXRT_COPT_MIBDIRS

#define AMXRT_COPT_MIBDIRS   "mib-dirs"

Definition at line 80 of file amxrt.h.

◆ AMXRT_COPT_NAME

#define AMXRT_COPT_NAME   "name"

Definition at line 85 of file amxrt.h.

◆ AMXRT_COPT_OBJECTS

#define AMXRT_COPT_OBJECTS   "odl.dm-objects"

Definition at line 107 of file amxrt.h.

◆ AMXRT_COPT_ODL

#define AMXRT_COPT_ODL   "ODL"

Definition at line 81 of file amxrt.h.

◆ AMXRT_COPT_ODL_CONFIG

#define AMXRT_COPT_ODL_CONFIG   "odl"

Definition at line 97 of file amxrt.h.

◆ AMXRT_COPT_ON_CHANGED

#define AMXRT_COPT_ON_CHANGED   "odl.dm-save-on-changed"

Definition at line 110 of file amxrt.h.

◆ AMXRT_COPT_PID_FILE

#define AMXRT_COPT_PID_FILE   "pid-file"

Definition at line 84 of file amxrt.h.

◆ AMXRT_COPT_PLUGIN_DIR

#define AMXRT_COPT_PLUGIN_DIR   "plugin-dir"

Definition at line 87 of file amxrt.h.

◆ AMXRT_COPT_PREFIX_PATH

#define AMXRT_COPT_PREFIX_PATH   "prefix"

Definition at line 86 of file amxrt.h.

◆ AMXRT_COPT_PRIORITY

#define AMXRT_COPT_PRIORITY   "priority"

Definition at line 83 of file amxrt.h.

◆ AMXRT_COPT_REQUIRES

#define AMXRT_COPT_REQUIRES   "requires"

Definition at line 99 of file amxrt.h.

◆ AMXRT_COPT_RW_DATA_PATH

#define AMXRT_COPT_RW_DATA_PATH   "rw_data_path"

Definition at line 94 of file amxrt.h.

◆ AMXRT_COPT_SAVE

#define AMXRT_COPT_SAVE   "odl.dm-save"

Definition at line 109 of file amxrt.h.

◆ AMXRT_COPT_STORAGE

#define AMXRT_COPT_STORAGE   "storage-type"

Definition at line 113 of file amxrt.h.

◆ AMXRT_COPT_STORAGE_DIR

#define AMXRT_COPT_STORAGE_DIR   "storage-path"

Definition at line 95 of file amxrt.h.

◆ AMXRT_COPT_STORAGE_TYPE

#define AMXRT_COPT_STORAGE_TYPE   "storage-type"

Definition at line 96 of file amxrt.h.

◆ AMXRT_COPT_SUSPEND

#define AMXRT_COPT_SUSPEND   "dm-events-suspend-when-requires"

Definition at line 101 of file amxrt.h.

◆ AMXRT_COPT_URIS

#define AMXRT_COPT_URIS   "uris"

Definition at line 73 of file amxrt.h.

Typedef Documentation

◆ amxrt_arg_fn_t

typedef int(* amxrt_arg_fn_t) (amxc_var_t *config, int arg_id, const char *value)

Definition at line 115 of file amxrt.h.