![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Network messages , serialization tools. More...
Include dependency graph for n_network_msg.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | NETW_MSG |
| network message, array of char and int More... | |
Macros | |
| #define | NETMSG_BOX 8 |
| Network Message is box retrieving reply: (int x , int y , int z , N_STR *data ) | |
| #define | NETMSG_GET_BOX 7 |
| Network Message is box retrieve: int x , int y , int z. | |
| #define | NETMSG_IDENT_REPLY_NOK 2 |
| Network Message is identification reply NON OK: (int)type , (int)id , (N_STR *)name , (N_STR *)password. | |
| #define | NETMSG_IDENT_REPLY_OK 1 |
| Network Message is identification reply OK : (int)type , (int)id , (N_STR *)name , (N_STR *)password. | |
| #define | NETMSG_IDENT_REQUEST 0 |
| Network Message is identification request: (int)type , (int)id , (N_STR *)name , (N_STR *)password. | |
| #define | NETMSG_PING_REPLY 6 |
| Network Message is ping reply: (int)type , (int)id_from , (int)id_to. | |
| #define | NETMSG_PING_REQUEST 5 |
| Network Message is ping request: (int)type , (int)id_from , (int)id_to. | |
| #define | NETMSG_POSITION 4 |
| Network Message position: (int)type , (int)id , (int)X , (int)Y , (int)x_shift , (int)y_shift ,(int)vx ,(int)vy , (int)speed , (int)acceleration , (int)time_stamp. | |
| #define | NETMSG_QUIT 9 |
| Network asking for exit. | |
| #define | NETMSG_STRING 3 |
| Network Message is string: (int)type , (int)id , (N_STR *)name , (N_STR *)chan , (N_STR *)text , (int)color. | |
Functions | |
| int | add_int_to_msg (NETW_MSG *msg, int value) |
| Add an int to the int list int the message. | |
| int | add_nb_to_msg (NETW_MSG *msg, double value) |
| Add an float to the message. | |
| int | add_nstrdup_to_msg (NETW_MSG *msg, N_STR *str) |
| Add a copy of str to the string list in the message. | |
| int | add_nstrptr_to_msg (NETW_MSG *msg, N_STR *str) |
| Add a string to the string list in the message. | |
| int | add_strdup_to_msg (NETW_MSG *msg, const char *str) |
| Add a copy of char *str to the string list in the message. | |
| int | create_msg (NETW_MSG **msg) |
| Create a NETW_MSG *object. | |
| int | delete_msg (NETW_MSG **msg) |
| Delete a NETW_MSG *object. | |
| double | double_swap (double value) |
| Swap bytes endiannes for a double. | |
| int | empty_msg (NETW_MSG **msg) |
| Empty a NETW_MSG *object. | |
| int | get_int_from_msg (NETW_MSG *msg, int *value) |
| Get a number from a message number list. | |
| int | get_nb_from_msg (NETW_MSG *msg, double *value) |
| Get a number from a message number list. | |
| int | get_nstr_from_msg (NETW_MSG *msg, N_STR **str) |
| Get a string from a message string list. | |
| int | get_str_from_msg (NETW_MSG *msg, char **str) |
| Get a string from a message string list. | |
| double | htond (double value) |
| If needed swap bytes for a double. | |
| NETW_MSG * | make_msg_from_str (N_STR *str) |
| Make a single message of the string. | |
| N_STR * | make_str_from_msg (NETW_MSG *msg) |
| Make a single string of the message. | |
| N_STR * | netmsg_make_ident (int type, int id, N_STR *name, N_STR *passwd) |
| Add a formatted NETWMSG_IDENT message to the specified network. | |
| N_STR * | netmsg_make_ping (int type, int id_from, int id_to, int time) |
| Make a ping message to send to a network. | |
| N_STR * | netmsg_make_position_msg (int id, double X, double Y, double vx, double vy, double acc_x, double acc_y, int time_stamp) |
| make a network NETMSG_POSITION message with given parameters | |
| N_STR * | netmsg_make_quit_msg (void) |
| make a generic network NETMSG_QUIT message | |
| N_STR * | netmsg_make_string_msg (int id_from, int id_to, N_STR *name, N_STR *chan, N_STR *txt, int color) |
| make a network NETMSG_STRING message with given parameters | |
| int | netw_get_ident (N_STR *msg, int *type, int *ident, N_STR **name, N_STR **passwd) |
| Retrieves identification from netwmsg. | |
| int | netw_get_ping (N_STR *msg, int *type, int *from, int *to, int *time) |
| Retrieves a ping travel elapsed time. | |
| int | netw_get_position (N_STR *msg, int *id, double *X, double *Y, double *vx, double *vy, double *acc_x, double *acc_y, int *time_stamp) |
| Retrieves position from netwmsg. | |
| int | netw_get_quit (N_STR *msg) |
| get a formatted NETWMSG_QUIT message from the specified network | |
| int | netw_get_string (N_STR *msg, int *id, N_STR **name, N_STR **chan, N_STR **txt, int *color) |
| Retrieves string from netwmsg. | |
| int | netw_msg_get_type (N_STR *msg) |
| Get the type of message without killing the first number. Use with netw_get_XXX. | |
| double | ntohd (double value) |
| If needed swap bytes for a double. | |
Network messages , serialization tools.
Definition in file n_network_msg.h.