2021-09-24 19:57:15 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "config.h"
|
2022-02-03 16:24:36 +01:00
|
|
|
#include "stdint.h"
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigItem_Create(WUPSConfigItemHandle *out, const char *configID, const char *displayName, WUPSConfigCallbacks_t callbacks, void *context);
|
2022-09-18 22:05:44 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigItem_Destroy(WUPSConfigItemHandle handle);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfig_Destroy(WUPSConfigHandle handle);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigItem_SetDisplayName(WUPSConfigItemHandle handle, const char *displayName);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigItem_GetDisplayName(WUPSConfigItemHandle handle, char *out_buf, int32_t out_len);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigItem_SetConfigID(WUPSConfigItemHandle handle, const char *configID);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigItem_GetConfigID(WUPSConfigItemHandle handle, char *out_buf, int32_t out);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfig_Create(WUPSConfigHandle *out, const char *name);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigCategory_Destroy(WUPSConfigCategoryHandle handle);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfig_GetName(WUPSConfigHandle handle, char *out_buf, int32_t out_len);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfig_AddCategoryByName(WUPSConfigHandle handle, const char *categoryName, WUPSConfigCategoryHandle *out);
|
|
|
|
|
|
|
|
int32_t WUPSConfig_AddCategory(WUPSConfigHandle handle, WUPSConfigCategoryHandle category);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
|
|
|
/*
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfig_GetCategoryCount(WUPSConfigHandle handle, int32_t *category_count);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfig_GetCategories(WUPSConfigHandle handle, WUPSConfigCategoryHandle *categories_out, int32_t categories_out_size);
|
2021-09-24 19:57:15 +02:00
|
|
|
*/
|
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigCategory_Create(WUPSConfigCategoryHandle *out, const char *name);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigCategory_GetName(WUPSConfigCategoryHandle handle, char *out_buf, int32_t out_len);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2023-01-24 21:42:04 +01:00
|
|
|
int32_t WUPSConfigCategory_AddItem(WUPSConfigCategoryHandle handle, WUPSConfigItemHandle item_Handle);
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2022-02-03 16:24:36 +01:00
|
|
|
#define WUPSConfig_AddCategoryByNameHandled(__config__, __categoryName__, __out__) \
|
|
|
|
do { \
|
2021-09-24 19:57:15 +02:00
|
|
|
if (WUPSConfig_AddCategoryByName(__config__, __categoryName__, __out__) < 0) { \
|
2022-02-03 16:24:36 +01:00
|
|
|
WUPSConfig_Destroy(__config__); \
|
|
|
|
return 0; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2021-09-24 19:57:15 +02:00
|
|
|
|
2022-02-03 16:24:36 +01:00
|
|
|
#define WUPSConfig_CreateHandled(__config__, __configName__) \
|
|
|
|
do { \
|
2021-09-24 19:57:15 +02:00
|
|
|
if (WUPSConfig_Create(__config__, __configName__) < 0) { \
|
2022-02-03 16:24:36 +01:00
|
|
|
return 0; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2023-01-24 21:42:04 +01:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|