mirror of
git://git.psyc.eu/libpsyc
synced 2024-08-15 03:19:02 +00:00
packet id
This commit is contained in:
parent
07901658f3
commit
30351302bc
9 changed files with 137 additions and 1 deletions
|
@ -26,6 +26,7 @@ typedef enum PsycMethod {
|
|||
PSYC_MC_NOTICE,
|
||||
PSYC_MC_NOTICE_CONTEXT_ENTER,
|
||||
PSYC_MC_NOTICE_CONTEXT_LEAVE,
|
||||
PSYC_MC_NOTICE_HELLO,
|
||||
PSYC_MC_REQUEST,
|
||||
PSYC_MC_REQUEST_CONTEXT_ENTER,
|
||||
PSYC_MC_REQUEST_CONTEXT_LEAVE,
|
||||
|
|
|
@ -68,6 +68,15 @@ typedef enum {
|
|||
PSYC_STATE_RESYNC = '?',
|
||||
} PsycStateOp;
|
||||
|
||||
typedef enum {
|
||||
PSYC_PACKET_ID_CONTEXT = 0,
|
||||
PSYC_PACKET_ID_SOURCE = 1,
|
||||
PSYC_PACKET_ID_TARGET = 2,
|
||||
PSYC_PACKET_ID_COUNTER = 3,
|
||||
PSYC_PACKET_ID_FRAGMENT = 4,
|
||||
PSYC_PACKET_ID_ELEMS = 5,
|
||||
} PsycPacketId;
|
||||
|
||||
/** Structure for a modifier. */
|
||||
typedef struct {
|
||||
char oper;
|
||||
|
@ -209,6 +218,11 @@ psyc_packet_init_raw (PsycPacket *packet,
|
|||
char *content, size_t contentlen,
|
||||
PsycPacketFlag flag);
|
||||
|
||||
/** Get the total length of a packet ID when rendered. */
|
||||
size_t
|
||||
psyc_packet_id_length (size_t contextlen, size_t sourcelen, size_t targetelen,
|
||||
size_t counterlen, size_t fragmentlen);
|
||||
|
||||
/** @} */ // end of packet group
|
||||
|
||||
#endif
|
||||
|
|
|
@ -63,6 +63,14 @@ psyc_render_list (PsycList *list, char *buffer, size_t buflen);
|
|||
PsycRenderRC
|
||||
psyc_render_table (PsycTable *table, char *buffer, size_t buflen);
|
||||
|
||||
PsycRenderRC
|
||||
psyc_render_packet_id (char *context, size_t contextlen,
|
||||
char *source, size_t sourcelen,
|
||||
char *target, size_t targetlen,
|
||||
char *counter, size_t counterlen,
|
||||
char *fragment, size_t fragmentlen,
|
||||
char *buffer, size_t buflen);
|
||||
|
||||
/** @} */ // end of render group
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue