iniutil.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * category: [config]
  3. * apply status:
  4. * edit status:
  5. * build status:
  6. * description: to read .ini format file
  7. * TODO: multi thread and multi process test.
  8. */
  9. #ifndef __LOGINI_H__
  10. #define __LOGINI_H__
  11. #pragma once
  12. #include "config.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #include <stdarg.h>
  17. #include "array.h"
  18. TOOLKIT_API char *inifile_read_str(const char *file, const char *section, const char *key, const char *defval);
  19. TOOLKIT_API int inifile_read_int(const char *file, const char *section, const char *key, int defval);
  20. TOOLKIT_API array_header_t* inifile_read_section_all(const char *file);
  21. TOOLKIT_API array_header_t* inifile_read_section_key_all(const char *file, const char *section);
  22. TOOLKIT_API int inifile_format_readv(const char *file, const char *section, const char *key, const char *fmt, va_list arg);
  23. TOOLKIT_API int inifile_format_read(const char *file, const char *section, const char *key, const char *fmt, ...);
  24. TOOLKIT_API int inifile_write_str(const char *file, const char *section, const char *key, const char *value);
  25. TOOLKIT_API int inifile_write_int(const char *file, const char *section, const char *key, int value);
  26. TOOLKIT_API int inifile_format_writev(const char *file, const char *section, const char *key, const char *fmt, va_list arg);
  27. TOOLKIT_API int inifile_format_write(const char *file, const char *section, const char *key, const char *fmt, ...);
  28. #ifdef __cplusplus
  29. } // extern "C" {
  30. #endif
  31. #endif //__LOGINI_H__