mirror of
https://oauth2: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@github.com/m1ngsama/TNT.git
synced 2026-06-26 04:34:38 +08:00
Add validated input buffering, shared JSON helpers, the tnt.module.v1 protocol helpers, and an opt-in external-process module runtime behind TNT_MODULE_PATHS. Closes #52
24 lines
837 B
C
24 lines
837 B
C
#ifndef MODULE_PROTOCOL_H
|
|
#define MODULE_PROTOCOL_H
|
|
|
|
#include "message.h"
|
|
|
|
#define TNT_MODULE_PROTOCOL_VERSION "tnt.module.v1"
|
|
#define TNT_MODULE_EVENT_MESSAGE_CREATED "message.created"
|
|
#define TNT_MODULE_RESPONSE_MESSAGE_CREATE "message.create"
|
|
|
|
typedef struct {
|
|
char plain_text[MAX_MESSAGE_LEN];
|
|
} tnt_module_message_create_t;
|
|
|
|
int tnt_module_append_handshake(char *buffer, size_t buf_size, size_t *pos,
|
|
const char *server_version);
|
|
|
|
int tnt_module_append_message_created(char *buffer, size_t buf_size,
|
|
size_t *pos, const char *message_id,
|
|
const message_t *msg);
|
|
|
|
bool tnt_module_parse_message_create(const char *line,
|
|
tnt_module_message_create_t *out);
|
|
|
|
#endif /* MODULE_PROTOCOL_H */
|