Tchatator413
TripEnArvor instant messaging protocol - JSON-based
Loading...
Searching...
No Matches
tchatator413.h
Go to the documentation of this file.
1
5
6#ifndef TCHATATOR_413_H
7#define TCHATATOR_413_H
8
9#include "action.h"
10#include "cfg.h"
11#include "db.h"
12#include "server.h"
13#include <json-c.h>
14
16typedef void (*fn_on_action_t)(const action_t *action, void *ctx);
18typedef void (*fn_on_response_t)(const response_t *response, void *ctx);
19
29json_object *tchatator413_interpret(json_object *input, cfg_t *cfg, db_t *db, server_t *server, fn_on_action_t on_action, fn_on_response_t on_response, void *on_ctx);
30
38int tchatator413_run_interactive(cfg_t *cfg, db_t *db, server_t *server, int argc, char **argv);
39
46
47#endif // TCHATATOR_413_H
Tchatator413 request parsing and interpretation - Interface.
Tchatator413 server configuration - Interface.
struct cfg cfg_t
An opaque handle to a configuration object.
Definition cfg.h:14
DAL - Interface.
void db_t
An opaque handle to a database connection.
Definition db.h:14
json-c wrapper. Include this instead of JSON-C (compile time error mechanisms)
Tchatator413 dynamic server state - Interface.
struct server server_t
Opaque type handle representing a server instance.
Definition server.h:23
An action. Actions represent the commands the protocol implements.
Definition action.h:98
int tchatator413_run_interactive(cfg_t *cfg, db_t *db, server_t *server, int argc, char **argv)
Run the server in interactive mode.
json_object * tchatator413_interpret(json_object *input, cfg_t *cfg, db_t *db, server_t *server, fn_on_action_t on_action, fn_on_response_t on_response, void *on_ctx)
Interpret a request.
int tchatator413_run_socket(cfg_t *cfg, db_t *db, server_t *server)
Run the server in socket mode.
void(* fn_on_action_t)(const action_t *action, void *ctx)
An event handler for when the server has parsed an action.
void(* fn_on_response_t)(const response_t *response, void *ctx)
An event handler for when the server has interpeted an action.