From a22163cbe74e267bbe307c39c815dbb781acc83a Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Tue, 21 May 2019 22:21:21 +0100 Subject: Added buffer check function --- netbytes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'netbytes.h') diff --git a/netbytes.h b/netbytes.h index 6e008bc..685b68a 100644 --- a/netbytes.h +++ b/netbytes.h @@ -1,6 +1,10 @@ #ifndef __NETBYTES_H #define __NETBYTES_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -167,6 +171,8 @@ int nb_count( netbyte_store *store ); int nb_type( netbyte_store *store, int count, __NBT_TYPED **type ); int nb_val( netbyte_store *store, int count, __nb_type **type ); int nb_fread( netbyte_store *store, int fd); +/*check if data may contain full netbyte buffer*/ +int nb_check_buf(uint8_t *data, int len, int *detected_size); //print all all values in netbyte string int nb_print(netbyte_store *store); @@ -188,4 +194,8 @@ void nb_tok_destroy(nb_tok_arr *arr); int nb_parse(char *str, nb_tok_arr *arr); +#ifdef __cplusplus +} +#endif + #endif \ No newline at end of file -- cgit v1.2.3