55 #if !defined(__AMXO_H__)
63 #if !defined(USE_DOXYGEN)
64 #define AMXO_INLINE static inline
74 #include <amxs/amxs.h>
287 amxd_object_t*
object);
334 const char* file_path,
335 amxd_object_t*
object);
375 amxd_object_t*
object);
415 return parser == NULL ? amxd_status_ok : parser->
status;
459 return parser == NULL ? NULL : amxc_string_get(&parser->
msg, 0);
485 return parser == NULL ? NULL : parser->
file;
506 return parser == NULL ? 0 : parser->
line;
678 const char* object_a,
679 const char* object_b);
#define amxo_connection_t
int(* amxo_entry_point_t)(int reason, amxd_dm_t *dm, amxo_parser_t *parser)
enum _amxo_con_type amxo_con_type_t
void(* amxo_fd_cb_t)(int fd, void *priv)
amxc_var_t * amxo_parser_get_config(amxo_parser_t *parser, const char *path)
Gets a configuration option.
int amxo_parser_set_config(amxo_parser_t *parser, const char *path, amxc_var_t *value)
Sets a configuration option.
amxc_var_t * amxo_parser_claim_config(amxo_parser_t *parser, const char *path)
Gets or creates a configuration option.
amxo_connection_t * amxo_connection_get(amxo_parser_t *parser, int fd)
Gets the connection data for a file descriptor.
amxo_connection_t * amxo_connection_get_next(amxo_parser_t *parser, amxo_connection_t *con, amxo_con_type_t type)
Gets the next connection data for a file descriptor.
int amxo_connection_set_el_data(amxo_parser_t *parser, int fd, void *el_data)
Sets event-loop data.
amxo_connection_t * amxo_connection_get_first(amxo_parser_t *parser, amxo_con_type_t type)
Gets the first connection of the given type.
int amxo_connection_remove(amxo_parser_t *parser, int fd)
Removes the fd from the connection list.
int amxo_connection_add(amxo_parser_t *parser, int fd, amxo_fd_cb_t reader, const char *uri, amxo_con_type_t type, void *priv)
Adds a file descriptor (fd) to the list of fds that must be watched.
int amxo_connection_wait_write(amxo_parser_t *parser, int fd, amxo_fd_cb_t writer)
Adds a watcher to check if a fd is ready for write.
int amxo_parser_parse_fd(amxo_parser_t *parser, int fd, amxd_object_t *object)
Parses an odl file.
int amxo_parser_start_synchronize(amxo_parser_t *parser)
Start all object and parameter synchronizations that were declared in the loaded odl files.
static const char * amxo_parser_get_message(amxo_parser_t *parser)
Get the failure message in human readable form.
int amxo_parser_parse_string(amxo_parser_t *parser, const char *text, amxd_object_t *object)
Parses a string containing a valid ODL part.
void amxo_parser_clean(amxo_parser_t *parser)
Cleans up the odl parser instance.
const char * amxo_lib_version(void)
Returns the version of lib amxo.
amxc_llist_t * amxo_parser_get_listeners(amxo_parser_t *parser)
Get of the current listen sockets of the application.
int amxo_parser_parse_file(amxo_parser_t *parser, const char *file_path, amxd_object_t *object)
Parses an odl file.
amxc_llist_t * amxo_parser_get_connections(amxo_parser_t *parser)
Get a list of the current connections of the application.
int amxo_parser_add_entry_point(amxo_parser_t *parser, amxo_entry_point_t fn)
Adds an entry point function.
int amxo_parser_new(amxo_parser_t **parser)
Allocates memory for a new parser instance on the heap and initializes the odl parser.
amxs_sync_ctx_t * amxo_parser_new_sync_ctx(const char *sync_template, const char *object_a, const char *object_b)
Create a new synchronization context from a synchronization template.
static amxd_status_t amxo_parser_get_status(amxo_parser_t *parser)
Get the status of the odl parser.
int amxo_parser_init(amxo_parser_t *parser)
Initializes a new odl parser instance.
int amxo_parser_rinvoke_entry_points(amxo_parser_t *parser, amxd_dm_t *dm, int reason)
Invokes all registered entry points in reversed order.
static const char * amxo_parser_get_file(amxo_parser_t *parser)
Get the current file name that is being parsed.
static uint32_t amxo_parser_get_line(amxo_parser_t *parser)
Get the current line number that is being parsed.
void amxo_parser_delete(amxo_parser_t **parser)
Cleans the odl parser content and frees the allocated memory.
void amxo_parser_stop_synchronize(amxo_parser_t *parser)
Stop all object and parameter synchronizations that were declared in odl files.
int amxo_parser_invoke_entry_points(amxo_parser_t *parser, amxd_dm_t *dm, int reason)
Invokes all registered entry points.
The ODL parser structure.