testing section logic

This commit is contained in:
jonathan santis
2025-05-13 11:04:13 +02:00
parent 6e73734672
commit f4d2c3f101
2 changed files with 41 additions and 8 deletions

View File

@@ -1,14 +1,20 @@
#define NO_SECTION 0
#define FOUND_SECTION 10
#define ERROR_STR 1
#define ERROR_MAX_LEN 2
#define NO_ERROR 0
//State Machine
#define ST_INIT 0
#define ST_FOUND_LEFT_DELIMITER 1
#define ST_FOUND_RIGHT_DELIMITER 2
#define ST_ERROR_NOT_FOUND_RIGHT_DELIMITER 3
#define ST_FINISH 20
//state machine ERROR
#define ST_ERROR_GETSTRATPOS 30
//LIMITS
#define MAX_LEN_SECTIONNAME 128
@@ -17,4 +23,4 @@
int loadConfig(char *file, char **str_entry,char **host,int *intervall,int size);
int checkSection(char *str,char delimiterLeft,char delimiterRight,char **sectionName);
int getStrAtPos(char *str,int fromPos,int toPos, char **name);
int getStrAtPos(char *str,int fromPos,int toPos, char **name,int sizeName);