aboutsummaryrefslogtreecommitdiff
path: root/analyzer/parser/parser_defs.h
diff options
context:
space:
mode:
authorMosder <xmosder12@gmail.com>2026-07-20 15:48:51 +0200
committerMosder <xmosder12@gmail.com>2026-07-20 15:48:51 +0200
commitc182f2f4f850589c23b2241e11dab143e1003ff2 (patch)
tree45d9ba272af2ffdeec55af31b63591790ac4342f /analyzer/parser/parser_defs.h
parente0bf82fe2af66ef55872569ae15733f70b4913d4 (diff)
refactor: changed #ifndef guards, so that there is one per file
Diffstat (limited to 'analyzer/parser/parser_defs.h')
-rw-r--r--analyzer/parser/parser_defs.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/analyzer/parser/parser_defs.h b/analyzer/parser/parser_defs.h
index 6af6059..aa39a4c 100644
--- a/analyzer/parser/parser_defs.h
+++ b/analyzer/parser/parser_defs.h
@@ -3,18 +3,13 @@
#include "utils/tcp.h"
-#ifndef TYPE_ENUM_DEFINED
-#define TYPE_ENUM_DEFINED
+#ifndef PARSER_DEFS_H
+#define PARSER_DEFS_H
+
typedef enum { INT, FLOAT, DOUBLE, STRING } TypeEnum;
-#endif
-#ifndef RESULTS_ENUM_DEFINED
-#define RESULTS_ENUM_DEFINED
typedef enum { TYPE_FIGHT_RESULTS } ResultsEnum;
-#endif
-#ifndef PARSED_DATA_DEFINED
-#define PARSED_DATA_DEFINED
// "generic" type for parsed data
typedef struct {
ResultsEnum data_type; // type of data represented by an enum
@@ -22,7 +17,6 @@ typedef struct {
void (*data_cleanup)(void *data); // function to cleanup internal allocations inside data
// if no internal allocations - this should be NULL
} ParsedData;
-#endif
// find the first results data of specific type in stream
// params:
@@ -42,10 +36,9 @@ typedef byte_t *find_function_t(TCPStream *stream, int offset, int *length);
typedef ParsedData parse_function_t(byte_t *data, size_t length);
// struct for holding the find and parse function for every result type
-#ifndef FIND_PARSE_FUNCTIONS_DEFINED
-#define FIND_PARSE_FUNCTIONS_DEFINED
typedef struct {
find_function_t *find_fn;
parse_function_t *parse_fn;
} FindParseFunctions;
+
#endif