19 lines
586 B
C
19 lines
586 B
C
#ifndef READ_CONFIG_H
|
|
#define READ_CONFIG_H
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "type_define.h"
|
|
typedef struct {
|
|
FILE *fp;
|
|
} simp_config_t;
|
|
#define MAX_CONFIG_LINE_LEN 1024
|
|
|
|
|
|
int open_config_file(simp_config_t *config, const char *filename);
|
|
void close_config_file(simp_config_t *config);
|
|
int read_config_file_u32(simp_config_t *config, const char *key, u32 *value);
|
|
int read_config_file_string(simp_config_t *config, const char *key, char *value, u32 len);
|
|
int read_config_file_float(simp_config_t *config, const char *key, float *value);
|
|
|
|
#endif /* READ_CONFIG_H */
|