3 #include "../core/settings.h"
4 #include "settings_str.h"
6 BOOL freerdp_settings_clone_keys(rdpSettings* dst,
const rdpSettings* src)
11 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
16 case FREERDP_SETTINGS_TYPE_BOOL:
23 case FREERDP_SETTINGS_TYPE_UINT16:
31 case FREERDP_SETTINGS_TYPE_INT16:
38 case FREERDP_SETTINGS_TYPE_UINT32:
46 case FREERDP_SETTINGS_TYPE_INT32:
53 case FREERDP_SETTINGS_TYPE_UINT64:
61 case FREERDP_SETTINGS_TYPE_INT64:
68 case FREERDP_SETTINGS_TYPE_STRING:
75 if (!freerdp_settings_set_string_copy_(dst, (FreeRDP_Settings_Keys_String)cur->id,
80 case FREERDP_SETTINGS_TYPE_POINTER:
97 const rdpSettings* other)
102 WINPR_ASSERT(settings);
105 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
110 case FREERDP_SETTINGS_TYPE_BOOL:
118 WLog_Print(log, level,
"%s [BOOL]: %s -> %s", cur->str, sval ?
"TRUE" :
"FALSE",
119 cval ?
"TRUE" :
"FALSE");
123 case FREERDP_SETTINGS_TYPE_UINT16:
132 WLog_Print(log, level,
"%s [UINT16]: %" PRIu16
" -> %" PRIu16, cur->str, sval,
137 case FREERDP_SETTINGS_TYPE_INT16:
146 WLog_Print(log, level,
"%s [INT16]: %" PRId16
" -> %" PRId16, cur->str, sval,
151 case FREERDP_SETTINGS_TYPE_UINT32:
160 WLog_Print(log, level,
"%s [UINT32]: %" PRIu32
" -> %" PRIu32, cur->str, sval,
165 case FREERDP_SETTINGS_TYPE_INT32:
174 WLog_Print(log, level,
"%s [INT32]: %" PRId32
" -> %" PRId32, cur->str, sval,
179 case FREERDP_SETTINGS_TYPE_UINT64:
188 WLog_Print(log, level,
"%s [UINT64]: %" PRIu64
" -> %" PRIu64, cur->str, sval,
193 case FREERDP_SETTINGS_TYPE_INT64:
202 WLog_Print(log, level,
"%s [INT64]: %" PRId64
" -> %" PRId64, cur->str, sval,
207 case FREERDP_SETTINGS_TYPE_STRING:
215 if (!sval || !cval || (strcmp(sval, cval) != 0))
218 WLog_Print(log, level,
"%s [STRING]: '%s' -> '%s'", cur->str, sval, cval);
223 case FREERDP_SETTINGS_TYPE_POINTER:
231 if ((sval && !cval) || (!sval && cval))
234 WLog_Print(log, level,
"%s [POINTER]: '%p' -> '%p'", cur->str, sval, cval);
249 WINPR_ASSERT(settings);
251 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
256 case FREERDP_SETTINGS_TYPE_BOOL:
260 WLog_Print(log, level,
"%s [BOOL]: %s", cur->str, sval ?
"TRUE" :
"FALSE");
263 case FREERDP_SETTINGS_TYPE_UINT16:
267 WLog_Print(log, level,
"%s [UINT16]: %" PRIu16, cur->str, sval);
270 case FREERDP_SETTINGS_TYPE_INT16:
274 WLog_Print(log, level,
"%s [INT16]: %" PRId16, cur->str, sval);
277 case FREERDP_SETTINGS_TYPE_UINT32:
281 WLog_Print(log, level,
"%s [UINT32]: %" PRIu32, cur->str, sval);
284 case FREERDP_SETTINGS_TYPE_INT32:
288 WLog_Print(log, level,
"%s [INT32]: %" PRId32, cur->str, sval);
291 case FREERDP_SETTINGS_TYPE_UINT64:
295 WLog_Print(log, level,
"%s [UINT64]: %" PRIu64, cur->str, sval);
298 case FREERDP_SETTINGS_TYPE_INT64:
302 WLog_Print(log, level,
"%s [INT64]: %" PRId64, cur->str, sval);
305 case FREERDP_SETTINGS_TYPE_STRING:
309 WLog_Print(log, level,
"%s [STRING]: '%s'", cur->str, sval);
312 case FREERDP_SETTINGS_TYPE_POINTER:
316 WLog_Print(log, level,
"%s [POINTER]: '%p'", cur->str, sval);
325 void freerdp_settings_free_keys(rdpSettings* dst, BOOL cleanup)
329 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
334 case FREERDP_SETTINGS_TYPE_STRING:
335 (void)freerdp_settings_set_string_copy_(dst, (FreeRDP_Settings_Keys_String)cur->id,
338 case FREERDP_SETTINGS_TYPE_POINTER:
352 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
355 if (strcmp(value, cur->str) == 0)
365 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
368 if (strcmp(value, cur->str) == 0)
384 case FREERDP_SETTINGS_TYPE_BOOL:
385 return "FREERDP_SETTINGS_TYPE_BOOL";
386 case FREERDP_SETTINGS_TYPE_UINT16:
387 return "FREERDP_SETTINGS_TYPE_UINT16";
388 case FREERDP_SETTINGS_TYPE_INT16:
389 return "FREERDP_SETTINGS_TYPE_INT16";
390 case FREERDP_SETTINGS_TYPE_UINT32:
391 return "FREERDP_SETTINGS_TYPE_UINT32";
392 case FREERDP_SETTINGS_TYPE_INT32:
393 return "FREERDP_SETTINGS_TYPE_INT32";
394 case FREERDP_SETTINGS_TYPE_UINT64:
395 return "FREERDP_SETTINGS_TYPE_UINT64";
396 case FREERDP_SETTINGS_TYPE_INT64:
397 return "FREERDP_SETTINGS_TYPE_INT64";
398 case FREERDP_SETTINGS_TYPE_STRING:
399 return "FREERDP_SETTINGS_TYPE_STRING";
400 case FREERDP_SETTINGS_TYPE_POINTER:
401 return "FREERDP_SETTINGS_TYPE_POINTER";
403 return "FREERDP_SETTINGS_TYPE_UNKNOWN";
409 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
420 for (
size_t x = 0; x < ARRAYSIZE(settings_map); x++)
437 case FREERDP_SETTINGS_TYPE_BOOL:
442 case FREERDP_SETTINGS_TYPE_INT16:
447 case FREERDP_SETTINGS_TYPE_INT32:
452 case FREERDP_SETTINGS_TYPE_INT64:
457 case FREERDP_SETTINGS_TYPE_UINT16:
462 case FREERDP_SETTINGS_TYPE_UINT32:
467 case FREERDP_SETTINGS_TYPE_UINT64:
472 case FREERDP_SETTINGS_TYPE_STRING:
477 case FREERDP_SETTINGS_TYPE_POINTER:
void freerdp_settings_dump(wLog *log, DWORD level, const rdpSettings *settings)
Dumps the contents of a settings struct to a WLog logger.
FREERDP_API UINT32 freerdp_settings_get_uint32(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id)
Returns a UINT32 settings value.
FREERDP_API BOOL freerdp_settings_set_string(rdpSettings *settings, FreeRDP_Settings_Keys_String id, const char *param)
Sets a string settings value. The param is copied.
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.
FREERDP_API const void * freerdp_settings_get_pointer(const rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id)
Returns a immutable pointer settings value.
FREERDP_API INT64 freerdp_settings_get_int64(const rdpSettings *settings, FreeRDP_Settings_Keys_Int64 id)
Returns a INT64 settings value.
BOOL freerdp_settings_print_diff(wLog *log, DWORD level, const rdpSettings *settings, const rdpSettings *other)
Dumps the difference between two settings structs to a WLog.
const char * freerdp_settings_get_type_name_for_type(SSIZE_T type)
Returns the type name for a type.
SSIZE_T freerdp_settings_get_type_for_name(const char *value)
Get a key type for the name string of that key.
SSIZE_T freerdp_settings_get_type_for_key(SSIZE_T key)
Get a key type for the key index.
FREERDP_API UINT64 freerdp_settings_get_uint64(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id)
Returns a UINT64 settings value.
SSIZE_T freerdp_settings_get_key_for_name(const char *value)
Get a key index for the name string of that key.
FREERDP_API const char * freerdp_settings_get_string(const rdpSettings *settings, FreeRDP_Settings_Keys_String id)
Returns a immutable string settings value.
FREERDP_API BOOL freerdp_settings_set_pointer_len(rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data, size_t len)
Set a pointer to value data.
FREERDP_API BOOL freerdp_settings_set_int32(rdpSettings *settings, FreeRDP_Settings_Keys_Int32 id, INT32 param)
Sets a INT32 settings value.
BOOL freerdp_settings_copy_item(rdpSettings *dst, const rdpSettings *src, SSIZE_T id)
copies one setting identified by id from src to dst
FREERDP_API UINT16 freerdp_settings_get_uint16(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt16 id)
Returns a UINT16 settings value.
FREERDP_API BOOL freerdp_settings_set_uint64(rdpSettings *settings, FreeRDP_Settings_Keys_UInt64 id, UINT64 param)
Sets a UINT64 settings value.
FREERDP_API BOOL freerdp_settings_set_int16(rdpSettings *settings, FreeRDP_Settings_Keys_Int16 id, INT16 param)
Sets a INT16 settings value.
FREERDP_API BOOL freerdp_settings_set_int64(rdpSettings *settings, FreeRDP_Settings_Keys_Int64 id, INT64 param)
Sets a INT64 settings value.
FREERDP_API BOOL freerdp_settings_set_pointer(rdpSettings *settings, FreeRDP_Settings_Keys_Pointer id, const void *data)
Set a pointer to value data.
FREERDP_API INT32 freerdp_settings_get_int32(const rdpSettings *settings, FreeRDP_Settings_Keys_Int32 id)
Returns a INT32 settings value.
FREERDP_API BOOL freerdp_settings_set_uint32(rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id, UINT32 param)
Sets a UINT32 settings value.
FREERDP_API BOOL freerdp_settings_set_uint16(rdpSettings *settings, FreeRDP_Settings_Keys_UInt16 id, UINT16 param)
Sets a UINT16 settings value.
FREERDP_API INT16 freerdp_settings_get_int16(const rdpSettings *settings, FreeRDP_Settings_Keys_Int16 id)
Returns a INT16 settings value.
const char * freerdp_settings_get_type_name_for_key(SSIZE_T key)
Returns the type name for a key.
FREERDP_API BOOL freerdp_settings_set_bool(rdpSettings *settings, FreeRDP_Settings_Keys_Bool id, BOOL param)
Sets a BOOL settings value.
const char * freerdp_settings_get_name_for_key(SSIZE_T key)
Returns the type name for a key.