mirror of
https://github.com/troglobit/libite.git
synced 2026-11-10 16:31:15 +00:00
Add UNIX lfile_t parser API to lite.h
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
c4eb5cb124
commit
a7b5c240c1
2 files changed
+10
-1
No files matched your search
@@ -21,7 +21,7 @@
|
|||||||
#include <string.h> /* strlen(), strncmp(), strtok_r() */
|
#include <string.h> /* strlen(), strncmp(), strtok_r() */
|
||||||
#include <sys/param.h> /* MAX() */
|
#include <sys/param.h> /* MAX() */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct lfile {
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char buf[256];
|
char buf[256];
|
||||||
char *sep, *save;
|
char *sep, *save;
|
||||||
|
|||||||
@@ -34,6 +34,8 @@
|
|||||||
#include <sys/param.h> /* MAX(), isset(), setbit(), TRUE, FALSE, et consortes. :-) */
|
#include <sys/param.h> /* MAX(), isset(), setbit(), TRUE, FALSE, et consortes. :-) */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
typedef struct lfile lfile_t;
|
||||||
|
|
||||||
char *chomp (char *str);
|
char *chomp (char *str);
|
||||||
|
|
||||||
int fexist (char *file);
|
int fexist (char *file);
|
||||||
@@ -48,6 +50,13 @@ size_t fsendfile (FILE *src, FILE *dst, size_t len);
|
|||||||
|
|
||||||
int ifconfig (char *ifname, char *addr, char *mask, int up);
|
int ifconfig (char *ifname, char *addr, char *mask, int up);
|
||||||
|
|
||||||
|
lfile_t*lfopen (char *file, char *sep);
|
||||||
|
void lfclose (lfile_t *lf);
|
||||||
|
char *lftok (lfile_t *lf);
|
||||||
|
char *lfgetkey (lfile_t *lf, char *key);
|
||||||
|
int lfgetint (lfile_t *lf, char *key);
|
||||||
|
int fgetint (char *file, char *sep, char *key);
|
||||||
|
|
||||||
int mkpath (char *dir, mode_t mode);
|
int mkpath (char *dir, mode_t mode);
|
||||||
int makepath (char *dir);
|
int makepath (char *dir);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user