ini.h (1990B)
1/** 2 * WinPR: Windows Portable Runtime 3 * .ini config file 4 * 5 * Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com> 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20#ifndef WINPR_UTILS_INI_H 21#define WINPR_UTILS_INI_H 22 23#include <winpr/winpr.h> 24#include <winpr/wtypes.h> 25 26typedef struct _wIniFile wIniFile; 27 28#ifdef __cplusplus 29extern "C" 30{ 31#endif 32 33 WINPR_API int IniFile_ReadBuffer(wIniFile* ini, const char* buffer); 34 WINPR_API int IniFile_ReadFile(wIniFile* ini, const char* filename); 35 36 WINPR_API char* IniFile_WriteBuffer(wIniFile* ini); 37 WINPR_API int IniFile_WriteFile(wIniFile* ini, const char* filename); 38 39 WINPR_API char** IniFile_GetSectionNames(wIniFile* ini, int* count); 40 WINPR_API char** IniFile_GetSectionKeyNames(wIniFile* ini, const char* section, int* count); 41 42 WINPR_API const char* IniFile_GetKeyValueString(wIniFile* ini, const char* section, 43 const char* key); 44 WINPR_API int IniFile_GetKeyValueInt(wIniFile* ini, const char* section, const char* key); 45 46 WINPR_API int IniFile_SetKeyValueString(wIniFile* ini, const char* section, const char* key, 47 const char* value); 48 WINPR_API int IniFile_SetKeyValueInt(wIniFile* ini, const char* section, const char* key, 49 int value); 50 51 WINPR_API wIniFile* IniFile_New(void); 52 WINPR_API void IniFile_Free(wIniFile* ini); 53 54#ifdef __cplusplus 55} 56#endif 57 58#endif /* WINPR_UTILS_INI_H */