123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /*
- * category: [config]
- * apply status:
- * edit status:
- * build status:
- * description: to read .ini format file
- * TODO: multi thread and multi process test.
- */
- #ifndef __LOGINI_H__
- #define __LOGINI_H__
- #pragma once
- #include "config.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdarg.h>
- #include "array.h"
- /** return length of retval*/
- TOOLKIT_API int inifile_read_str_s(const char* section, const char* key, const char* defval, char* retval, int val_size, const char* file);
- /** please remember to FREE the returned char*-type value if not null*/
- TOOLKIT_API char *inifile_read_str(const char *file, const char *section, const char *key, const char *defval);
- TOOLKIT_API int inifile_read_int(const char *file, const char *section, const char *key, int defval);
- TOOLKIT_API array_header_t* inifile_read_section_all(const char *file);
- TOOLKIT_API array_header_t* inifile_read_section_key_all(const char *file, const char *section);
- TOOLKIT_API int inifile_format_readv(const char *file, const char *section, const char *key, const char *fmt, va_list arg);
- TOOLKIT_API int inifile_format_read(const char *file, const char *section, const char *key, const char *fmt, ...);
- /*0:suc, -1:failed*/
- TOOLKIT_API int inifile_write_str(const char *file, const char *section, const char *key, const char *value);
- TOOLKIT_API int inifile_write_int(const char *file, const char *section, const char *key, int value);
- TOOLKIT_API int inifile_format_writev(const char *file, const char *section, const char *key, const char *fmt, va_list arg);
- TOOLKIT_API int inifile_format_write(const char *file, const char *section, const char *key, const char *fmt, ...);
- #ifdef __cplusplus
- } // extern "C" {
- #endif
- #endif //__LOGINI_H__
|