aboutsummaryrefslogtreecommitdiffstats
path: root/src/lightconfini.h
diff options
context:
space:
mode:
authorM.Gergő2020-05-20 00:20:53 +0200
committerM.Gergő2020-05-20 00:20:53 +0200
commitee15e1da29eea49057ea3b87ac861e6a2f1fea96 (patch)
treeb508bd3ac8a8143fa9a8d9c5e4ebc16358c9c021 /src/lightconfini.h
parent2ad766df8f2bd45b7c0feff2fe19fc5f67b80842 (diff)
downloadlightconfini-ee15e1da29eea49057ea3b87ac861e6a2f1fea96.tar.gz
lightconfini-ee15e1da29eea49057ea3b87ac861e6a2f1fea96.zip
New function: lciniReadOutOwn() + Clarifying numeric types
Diffstat (limited to 'src/lightconfini.h')
-rw-r--r--src/lightconfini.h45
1 files changed, 17 insertions, 28 deletions
diff --git a/src/lightconfini.h b/src/lightconfini.h
index 7bbe918..e2b4e2d 100644
--- a/src/lightconfini.h
+++ b/src/lightconfini.h
@@ -7,33 +7,32 @@ typedef struct lcini_data {
int32_t lineNum;
int32_t lineLen;
- char *section;
+ uint8_t *section;
int32_t sectionLen;
int32_t sectionStartPos;
- char *param;
+ uint8_t *param;
int32_t paramLen;
int32_t paramStartPos;
- char *value;
+ uint8_t *value;
int32_t valueLen;
int32_t valueStartPos;
enum valueDraw {lcini_EMPTYVAL, lcini_SIMPLEVAL, lcini_MULTILINEVAL, lcini_DQUOTEDVAL} valueDraw;
- char *comment;
+ uint8_t *comment;
int32_t commentLen;
int32_t commentStartPos;
- char commentSign;
- char *errorMsg;
+ uint8_t commentSign;
+ uint8_t *errorMsg;
int32_t errorMsgLen;
struct lcini_data *next;
} lcini_data;
-typedef struct lcini_retdata{
- char *value;
- int32_t vallen;
- char *error;
- int32_t errorlen;
-} lcini_retdata;
+typedef struct lcini_shortret{
+ uint8_t *ret;
+ int32_t retlen;
+ enum retType{lcini_shortretOK, lcini_shortretERROR, lcini_shortretEMPTY} retType;
+} lcini_shortret;
/* Ha maga függvény van átpakolva, nevestül, testestül */
/* extern void (mylciniReadOutFunct)(int line, int linelen, char *section, int sectionlen, char *param, int paramlen, char *value, int valuelen, char *comment, int commentlen, char *error, int errorlen ) ; */
@@ -45,27 +44,17 @@ extern lcinimyReadFunc mylciniReadOutFunct;
struct lcini_data *lciniReadOut(const char *filename);
int lciniReadOutOwn(const char *filename);
-char *lciniGet(const char *filename, const char *section, const char *parameter, int32_t bufflen);
-lcini_retdata *lciniGet2(const char *filename, const char *section, const char *parameter);
+lcini_data *lciniGet(lcini_data *head, const char *section, const char *parameter); /* FETCH requested value TO an lcini_data object, FROM lcini_data list*/
+char *lciniGetStr(lcini_data *head, const char *section, const char *parameter, char *dst, int dstlen); /* FETCH requested value TO null-terminated-string, FROM lcini_data list */
+lcini_shortret *lciniGetShort(lcini_data *head, const char *section, const char *parameter); /* FETCH requested value TO shortret object, FROM lcini_data list*/
+lcini_shortret *lciniGetFromFileShort(const char *filename, const char *section, const char *parameter); /* FETCH requested value TO shortret object FROM file */
+char *lciniGetFromFileStr(const char *filename, const char *section, const char *parameter, char *buff, int len);
-
-char *lciGETtoStr( const char *section, const char *param, char *dest, size_t dstlen );
-/*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);
-int64_t lciGETtoInt64(const char *filename, const char *section, const char *param);
-
-double lciGETtoDlb(const char *filename, const char *section, const char *param);
-float lciGETtoFlt(const char *filename, const char *section, const char *param);
-long int lciGETtoLng(const char *filename, const char *section, const char *param);
-
-char *lciniStrResize(char *ptr, size_t oldsize, size_t newsize);
lcini_data *lciniDestroyNodes( lcini_data *head);
-lcini_data *lciniCreateNode( lcini_data *head, int64_t lineLen );
+lcini_data *lciniCreateNode( lcini_data *head, int lineLen );
size_t lciniFileMaxLineLen(FILE *tfd);
#endif /* LIGHTCONFINI_H_INCLUDED */