summaryrefslogtreecommitdiffstats
path: root/netbytes.h
diff options
context:
space:
mode:
Diffstat (limited to 'netbytes.h')
-rw-r--r--netbytes.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/netbytes.h b/netbytes.h
index 8b332b5..a73dcc6 100644
--- a/netbytes.h
+++ b/netbytes.h
@@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdint.h>
#include <string.h>
+#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
@@ -156,6 +157,28 @@ int nb_fread( netbyte_store *store, int fd);
int nb_print(netbyte_store *store);
//check if netbyte matches particular format
-int nb_match(netbyte_store *store, char *frmt);
+int nb_match(netbyte_store *store, int size);
+
+#define SIGN_UNSIGNED 1
+#define SIGN_SIGNED 2
+
+typedef struct nb_tok
+{
+ int sign;
+ int type_size;
+ int len;
+ int arr;
+} nb_tok;
+
+typedef struct nb_tok_arr
+{
+ int size;
+ int len;
+ nb_tok *tok;
+} nb_tok_arr;
+
+nb_tok_arr *nb_tok_create(int size);
+int nb_tok_add(nb_tok_arr *arr, int sign, int type_size, int len, int farr);
+void nb_tok_destroy(nb_tok_arr *arr);
#endif \ No newline at end of file