Teonet library
0.4.7
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ev_mgr.h"
#include "modules/teodb_com.h"
Macros | |
#define | TDB_VERSION "0.0.1" |
#define | APPNAME _ANSI_MAGENTA "teodb_ex" _ANSI_NONE |
#define | TEODB_PEER ke->teo_cfg.app_argv[1] |
#define | TEODB_EX_KEY "teo_db_ex" |
#define | TEST_KEY "test" |
#define | TEST_VALUE "{ \"name\": \"1\" }" |
#define | ke cqd->ke |
#define | NUM_RECORDS_TO_SHOW "25" |
#define | ke cqd->ke |
#define | KEY "teo_db_ex." |
Typedefs | |
typedef struct get_cq_data | get_cq_data |
Functions | |
void | list_cb (uint32_t id, int type, void *data) |
Callback Queue callback (the same as callback queue event). More... | |
void | get_cb (uint32_t id, int type, void *data) |
Callback Queue callback (the same as callback queue event). More... | |
void | event_cb (ksnetEvMgrClass *ke, ksnetEvMgrEvents event, void *data, size_t data_len, void *user_data) |
Teonet Events callback. More... | |
int | main (int argc, char **argv) |
Main Teonet Database example function. More... | |
#define APPNAME _ANSI_MAGENTA "teodb_ex" _ANSI_NONE |
Referenced by main().
#define ke cqd->ke |
Referenced by cli_init(), event_cb(), get_cb(), host_cb(), hotkeys_cb(), kq_connect_cb(), ksnCommandCheck(), ksnCommandEchoBuffer(), ksnCommandInit(), ksnCommandSendCmdEcho(), ksnCoreCheckNewPeer(), ksnCoreDestroy(), ksnCoreInit(), ksnCoreProcessPacket(), ksnCoreSendCmdto(), ksnCQueInit(), ksnCryptInit(), ksnet_configInit(), ksnetArpAddHost(), ksnetArpInit(), ksnetArpRemoveAll(), ksnetEvMgrInitPort(), ksnetEvMgrRun(), ksnetHotkeysDestroy(), ksnetHotkeysInit(), ksnHTTPInit(), ksnLNullInit(), ksnModulesDestroy(), ksnModulesInit(), ksnMultiInit(), ksnMultiSetNumNets(), ksnMultiShowListStr(), ksnStreamInit(), ksnTCPProxyInit(), ksnTDBinit(), main(), peer_type_cb(), stream_in_cb(), stream_out_cb(), tcp_read_cb(), teoAsyncInit(), teoBroadcastSend(), teoLNullPacketCheckMiscrypted(), teoLoggingClientInit(), teoLoggingServerInit(), teoLogReaderDestroy(), teoLogReaderInit(), teoMetricInit(), teoMultiGetByNetwork(), teoMultiGetByNumber(), teoMultiIsNetworkExist(), teoMultiRemoveNet(), teoMultiSendCmdToNet(), teonet_t(), teoSScrInit(), test2(), test_3_1(), test_3_2(), test_3_3(), test_3_4(), test_3_5(), test_3_template(), test_4_1(), test_4_2(), test_4_3(), test_5_1(), test_5_2(), test_6_1(), and test_6_2().
#define ke cqd->ke |
#define KEY "teo_db_ex." |
Referenced by get_cb().
#define NUM_RECORDS_TO_SHOW "25" |
Referenced by event_cb(), and list_cb().
#define TDB_VERSION "0.0.1" |
Referenced by main().
#define TEODB_EX_KEY "teo_db_ex" |
Referenced by event_cb().
#define TEODB_PEER ke->teo_cfg.app_argv[1] |
Referenced by event_cb(), and get_cb().
#define TEST_KEY "test" |
Referenced by event_cb().
#define TEST_VALUE "{ \"name\": \"1\" }" |
Referenced by event_cb().
typedef struct get_cq_data get_cq_data |
void event_cb | ( | ksnetEvMgrClass * | ke, |
ksnetEvMgrEvents | event, | ||
void * | data, | ||
size_t | data_len, | ||
void * | user_data | ||
) |
Teonet Events callback.
ke | Pointer to ksnetEvMgrClass |
event | Teonet Event (ksnetEvMgrEvents) |
data | Events data |
data_len | Data length |
user_data | Some user data (may be set in ksnetEvMgrInitPort()) |
References ksnCorePacketData::cmd, CMD_D_GET, CMD_D_GET_ANSWER, CMD_D_LIST_ANSWER, CMD_D_SET, cq, data, ksnCorePacketData::data, EV_K_CONNECTED, EV_K_RECEIVED, free(), get_cb(), ksnCQueData::id, teo_db_data::id, ksnetEvMgrClass::kc, ke, teo_db_data::key_data, teo_db_data::key_length, ksnetEvMgrClass::kq, ksnCoreSendCmdto(), ksnCQueAdd(), ksnCQueExec(), malloc(), prepare_request_data(), rd, TEODB_EX_KEY, TEODB_PEER, TEST_KEY, and TEST_VALUE.
Referenced by main().
void get_cb | ( | uint32_t | id, |
int | type, | ||
void * | data | ||
) |
Callback Queue callback (the same as callback queue event).
This function calls at timeout or after ksnCQueExec calls
id | Calls ID |
type | Type: 0 - timeout callback; 1 - successful callback |
data | User data |
References CMD_D_LIST, cq, data, free(), ksnCQueData::id, ke, KEY, ksnCoreSendCmdto(), ksnCQueAdd(), list_cb(), memdup(), prepare_request_data(), and TEODB_PEER.
Referenced by event_cb().
void list_cb | ( | uint32_t | id, |
int | type, | ||
void * | data | ||
) |
Callback Queue callback (the same as callback queue event).
This function calls at timeout or after ksnCQueExec calls
id | Calls ID |
type | Type: 0 - timeout callback; 1 - successful callback |
data | User data |
References data, free(), and NUM_RECORDS_TO_SHOW.
Referenced by get_cb().
int main | ( | int | argc, |
char ** | argv | ||
) |
Main Teonet Database example function.
argc | Number of arguments |
argv | Arguments array |
References ksnetEvMgrAppParam::app_argc, ksnetEvMgrAppParam::app_argv, ksnetEvMgrAppParam::app_descr, APP_PARAM, APPNAME, event_cb(), ke, ksn_puts, ksnetEvMgrInitPort(), ksnetEvMgrRun(), MESSAGE, READ_CONFIGURATION, READ_OPTIONS, TDB_VERSION, teoSetAppType(), and VERSION.