aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ini_read.c16
-rw-r--r--src/ini_write.c13
-rw-r--r--src/inirw_internal.h16
3 files changed, 29 insertions, 16 deletions
diff --git a/src/ini_read.c b/src/ini_read.c
index 854625c..66799a1 100644
--- a/src/ini_read.c
+++ b/src/ini_read.c
@@ -13,7 +13,7 @@
-static size_t strNullLen(const uint8_t *str){
+size_t strNullLen(const uint8_t *str){
if(str == NULL){
return 0;
} else {
@@ -22,7 +22,7 @@ static size_t strNullLen(const uint8_t *str){
}
-static size_t strLcpy(uint8_t *dst, size_t dstlen, const uint8_t *src, size_t srclen){ /* Safe strncpy() */
+size_t strLcpy(uint8_t *dst, size_t dstlen, const uint8_t *src, size_t srclen){ /* Safe strncpy() */
uint8_t *tdst=dst;
const uint8_t *tsrc=src;
size_t i=dstlen, j=srclen;
@@ -39,7 +39,7 @@ static size_t strLcpy(uint8_t *dst, size_t dstlen, const uint8_t *src, size_t sr
}
-static uint8_t *lciniStrResize(uint8_t *ptr, size_t oldsize, size_t newsize){
+uint8_t *lciniStrResize(uint8_t *ptr, size_t oldsize, size_t newsize){
uint8_t *tmp=NULL;
if(newsize <= 0){ /* deleting */
@@ -67,7 +67,7 @@ static uint8_t *lciniStrResize(uint8_t *ptr, size_t oldsize, size_t newsize){
}
-static uint8_t unescape(uint8_t c){
+uint8_t unescape(uint8_t c){
if(c == 'n'){ /* Newline */
return '\n';
} else if(c == 'a'){ /* Bell */
@@ -92,7 +92,7 @@ static uint8_t unescape(uint8_t c){
}
#ifdef ini_write_c
-static uint8_t eescape(uint8_t c){
+uint8_t eescape(uint8_t c){
if(c == '\n'){ /* Newline */
return 'n';
} else if(c == '\a'){ /* Bell */
@@ -115,7 +115,7 @@ static uint8_t eescape(uint8_t c){
}
#endif
-static uint8_t isascalnum(uint8_t c){ /* Check if input is ASCII Alpha-numeric */
+uint8_t isascalnum(uint8_t c){ /* Check if input is ASCII Alpha-numeric */
if( 0x30 <= c && c <= 0x39){ /* Numeric */
return 1;
} else if (0x41 <= c && c <= 0x5a){ /* UPPER */
@@ -127,7 +127,7 @@ static uint8_t isascalnum(uint8_t c){ /* Check if input is ASCII Alpha-numeric *
}
}
-static uint8_t checkspace(uint8_t c){ /* Only for ASCII characters */
+uint8_t checkspace(uint8_t c){ /* Only for ASCII characters */
switch (c) {
case 0x20: /* space (SPC) */
return 1;
@@ -171,7 +171,7 @@ size_t lciniFileMaxLineLen(FILE *tfd){
}
}
-static struct lcini_data *iniFSM(struct lcini_data *data, const uint8_t *in, int32_t len){
+struct lcini_data *iniFSM(struct lcini_data *data, const uint8_t *in, int32_t len){
int32_t i,j, vallen=len;
enum lcini_states pstate=Start, state=Start;
diff --git a/src/ini_write.c b/src/ini_write.c
new file mode 100644
index 0000000..785f35f
--- /dev/null
+++ b/src/ini_write.c
@@ -0,0 +1,13 @@
+/* INI fájl olvasás */
+
+#include <stdio.h>
+#include <string.h> /* strncpy + strerror */
+#include <stdlib.h> /* malloc(), atoi(), exit(EXIT_FALIURE) */
+#include <errno.h> /* errno */
+#include <stdarg.h>
+#include <stdint.h> /* int64_t */
+
+#define ini_write_c
+#include "inirw_internal.h"
+#include "lightconfini.h"
+
diff --git a/src/inirw_internal.h b/src/inirw_internal.h
index f698f29..8bab129 100644
--- a/src/inirw_internal.h
+++ b/src/inirw_internal.h
@@ -42,20 +42,20 @@ size_t getFileMaxLineLen(FILE *tfd);
#if defined(ini_read_c) || defined(ini_write_c)
enum lcini_states {Start, BgnSp, CommEndW, SectEndW, SectEndD, EqW1, EqW2, ValPSP, ValW, ValFSP, DqmW, Bslsh, Error, Stop };
- static size_t strNullLen(const uint8_t *str);
- static struct lcini_data *iniFSM(struct lcini_data *data, const uint8_t *in, int32_t len);
+ size_t strNullLen(const uint8_t *str);
+ struct lcini_data *iniFSM(struct lcini_data *data, const uint8_t *in, int32_t len);
- static uint8_t isascalnum(uint8_t c); /* Check if input is ASCII Alpha-numeric */
- static uint8_t checkspace(uint8_t c); /* Only for ASCII characters */
- static size_t strLcpy(uint8_t *dst, size_t dstlen, const uint8_t *src, size_t srclen);
- static uint8_t *lciniStrResize(uint8_t *ptr, size_t oldsize, size_t newsize);
- static uint8_t unescape(uint8_t c);
+ uint8_t isascalnum(uint8_t c); /* Check if input is ASCII Alpha-numeric */
+ uint8_t checkspace(uint8_t c); /* Only for ASCII characters */
+ size_t strLcpy(uint8_t *dst, size_t dstlen, const uint8_t *src, size_t srclen);
+ uint8_t *lciniStrResize(uint8_t *ptr, size_t oldsize, size_t newsize);
+ uint8_t unescape(uint8_t c);
#ifdef ini_read_c
/* int unescape(int c); */
#endif /* ini_read_c */
#ifdef ini_write_c
- static uint8_t eescape(uint8_t c);
+ uint8_t eescape(uint8_t c);
#endif /*ini_write_c*/
#endif /* ini_read_c, ini_write_c*/