|
|
@@ -254,99 +254,3 @@ var_type_is_settable(const var_type_def_t *def)
|
|
|
{
|
|
|
return ! def->is_unsettable;
|
|
|
}
|
|
|
-
|
|
|
-/* =====
|
|
|
- * The functions below take a config_type_t instead of a var_type_def_t.
|
|
|
- * I'd like to deprecate them eventually and use var_type_def_t everywhere,
|
|
|
- * but for now they make migration easier.
|
|
|
- * ===== */
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_assign_ex(), but look up the definition of the configuration
|
|
|
- * type from a provided config_type_t enum.
|
|
|
- */
|
|
|
-int
|
|
|
-typed_var_assign(void *target, const char *value, char **errmsg,
|
|
|
- config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_assign_ex(target, value, errmsg, def);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_kvassign_ex(), but look up the definition of the configuration
|
|
|
- * type from a provided config_type_t enum.
|
|
|
- */
|
|
|
-int
|
|
|
-typed_var_kvassign(void *target, const config_line_t *line, char **errmsg,
|
|
|
- config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_kvassign_ex(target, line, errmsg, def);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_free_ex(), but look up the definition of the configuration
|
|
|
- * type from a provided config_type_t enum.
|
|
|
- */
|
|
|
-void
|
|
|
-typed_var_free(void *target, config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_free_ex(target, def);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_encode_ex(), but look up the definition of the configuration
|
|
|
- * type from a provided config_type_t enum.
|
|
|
- */
|
|
|
-char *
|
|
|
-typed_var_encode(const void *value, config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_encode_ex(value, def);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_kvencode_ex(), but look up the definition of the configuration
|
|
|
- * type from a provided config_type_t enum.
|
|
|
- */
|
|
|
-config_line_t *
|
|
|
-typed_var_kvencode(const char *key, const void *value, config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_kvencode_ex(key, value, def);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_copy_ex(), but look up the definition of the configuration type
|
|
|
- * from a provided config_type_t enum.
|
|
|
- */
|
|
|
-int
|
|
|
-typed_var_copy(void *dest, const void *src, config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_copy_ex(dest, src, def);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_eq_ex(), but look up the definition of the configuration type
|
|
|
- * from a provided config_type_t enum.
|
|
|
- */
|
|
|
-bool
|
|
|
-typed_var_eq(const void *a, const void *b, config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_eq_ex(a, b, def);
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * As typed_var_ok_ex(), but look up the definition of the configuration type
|
|
|
- * from a provided config_type_t enum.
|
|
|
- */
|
|
|
-bool
|
|
|
-typed_var_ok(const void *value, config_type_t type)
|
|
|
-{
|
|
|
- const var_type_def_t *def = lookup_type_def(type);
|
|
|
- return typed_var_ok_ex(value, def);
|
|
|
-}
|