Confparse: Improve stuff and add wmfsrc_new, the next wmfs configuration file.

This commit is contained in:
Martin Duquesnoy
2009-08-10 23:50:18 +02:00
parent 3b18a3937e
commit 20d247438c
7 changed files with 365 additions and 106 deletions

View File

@@ -33,15 +33,23 @@
#ifndef CONFPARSE_H
#define CONFPARSE_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "../wmfs.h"
/* Section delimiter */
#define SEC_DEL_S '['
#define SEC_DEL_E ']'
/* List delimiter */
#define LIST_DEL_S '{'
#define LIST_DEL_E '}'
/* Comment character */
#define COMMENT_CHAR '#'
typedef struct
{
long int num;
@@ -59,7 +67,7 @@ opt_type str_to_opt(char *str);
char *clean_value(char *str);
/* confparse.c */
char *file_to_str(FILE *f);
char *file_to_str(char *path);
char *get_sec(char *src, char *name);
char *get_nsec(char *src, char *name, int n);
int get_size_sec(char *src, char *name);