aboutsummaryrefslogtreecommitdiffstats
path: root/src/ini_rw.h
diff options
context:
space:
mode:
authorM.Gergő2020-05-15 04:15:18 +0200
committerM.Gergő2020-05-15 04:15:18 +0200
commit93f237d71e080512442399b444357dfa7b6f1822 (patch)
tree6fe87499f38970cf100b42a1a956c651fd5e5e74 /src/ini_rw.h
parent286199e71f65b44d16e3684501935ec5b9556e9a (diff)
downloadlightconfini-93f237d71e080512442399b444357dfa7b6f1822.tar.gz
lightconfini-93f237d71e080512442399b444357dfa7b6f1822.zip
Backported to c89
Diffstat (limited to 'src/ini_rw.h')
-rw-r--r--src/ini_rw.h43
1 files changed, 22 insertions, 21 deletions
diff --git a/src/ini_rw.h b/src/ini_rw.h
index 0a594c7..7894eef 100644
--- a/src/ini_rw.h
+++ b/src/ini_rw.h
@@ -1,31 +1,32 @@
#ifndef INI_READ_H_INCLUDED
#define INI_READ_H_INCLUDED
-// #include "deftypes.h"
+/* #include "deftypes.h" */
#include <stdint.h> /* int64_t*/
-
+
typedef struct lci_data {
enum nodeState {lci_EMPTY, lci_READY, lci_CONTINUE, lci_MULTILINE, lci_ERROR } nodeState;
- int64_t lineNum;
- int64_t lineLen;
+ int32_t lineNum;
+ int32_t lineLen;
char *section;
- int64_t sectionLen;
- int64_t sectionStartPos;
+ int32_t sectionLen;
+ int32_t sectionStartPos;
char *param;
- int64_t paramLen;
- int64_t paramStartPos;
+ int32_t paramLen;
+ int32_t paramStartPos;
char *value;
- int64_t valueLen;
- int64_t valueStartPos;
+ int32_t valueLen;
+ int32_t valueStartPos;
enum valueDraw {lci_EMPTYVAL, lci_SIMPLEVAL, lci_MULTILINEVAL, lci_DQUOTEDVAL} valueDraw;
char *comment;
- int64_t commentLen;
- int64_t commentStartPos;
+ int32_t commentLen;
+ int32_t commentStartPos;
+ char commentSign;
char *errorMsg;
- int64_t errorMsgLen;
+ int32_t errorMsgLen;
struct lci_data *next;
} lci_data;
@@ -33,31 +34,31 @@ typedef struct lci_data {
struct lci_data *iniReadOut(const char *filename);
-//int64_t getFileMaxLineLen(FILE *tfd);
+/* int64_t getFileMaxLineLen(FILE *tfd); */
char *strResize(char *ptr, size_t oldsize, size_t newsize);
lci_data *destroyNodes( lci_data *head);
lci_data *createNode( lci_data *head, int64_t lineLen );
-int64_t getFileMaxLineLen(FILE *tfd);
+size_t getFileMaxLineLen(FILE *tfd);
#if defined(ini_read_c) || defined(ini_write_c)
enum ini_states {Start, BgnSp, CommEndW, SectEndW, SectEndD, EqW1, EqW2, ValPSP, ValW, ValFSP, DqmW, Bslsh, Error, Stop };
size_t strNullLen(const char *str);
-struct lci_data *iniFSM(struct lci_data *data, const char *in, int64_t len);
+struct lci_data *iniFSM(struct lci_data *data, const int *in, int32_t len);
char eescape(char c);
#ifdef ini_read_c
char unescape(char c);
-#endif // ini_read_c
+#endif /* ini_read_c */
#ifdef ini_write_c
//static const char* komment = ";#";
-#endif //ini_write_c
-#endif // ini_read_c, ini_write_c
+#endif /*ini_write_c*/
+#endif /* ini_read_c, ini_write_c*/
char *lciGETtoStr( const char *section, const char *param, char *dest, size_t dstlen );
-//int lciGETtoStrlen(const char *section, const char *param, ...);
+/*int lciGETtoStrlen(const char *section, const char *param, ...); */
int8_t lciGETtoInt8( const char *filename, const char *section, const char *param);
int16_t lciGETtoInt16(const char *filename, const char *section, const char *param);
int32_t lciGETtoInt32(const char *filename, const char *section, const char *param);
@@ -70,5 +71,5 @@ long int lciGETtoLng(const char *filename, const char *section, const char *para
-#endif // INI_READ_H_INCLUDED
+#endif /* INI_READ_H_INCLUDED */