summaryrefslogtreecommitdiff
path: root/src/main/print-vars.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/print-vars.c')
-rw-r--r--src/main/print-vars.c315
1 files changed, 196 insertions, 119 deletions
diff --git a/src/main/print-vars.c b/src/main/print-vars.c
index c2b1d27..e3d4195 100644
--- a/src/main/print-vars.c
+++ b/src/main/print-vars.c
@@ -1,5 +1,5 @@
/*
- * "$Id: print-vars.c,v 1.75 2006/06/25 00:25:14 rlk Exp $"
+ * "$Id: print-vars.c,v 1.75.8.1 2007/05/29 01:47:29 rlk Exp $"
*
* Print plug-in driver utility functions for the GIMP.
*
@@ -86,18 +86,14 @@ static int standard_vars_initialized = 0;
static stp_vars_t default_vars;
-static void
-null_vars(void)
-{
- stp_erprintf("Null stp_vars_t! Please report this bug.\n");
- stp_abort();
-}
-
static inline void
check_vars(const stp_vars_t *v)
{
if (v == NULL)
- null_vars();
+ {
+ stp_erprintf("Null stp_vars_t! Please report this bug.\n");
+ stp_abort();
+ }
}
static const char *
@@ -345,38 +341,40 @@ stp_vars_destroy(stp_vars_t *v)
stp_free(v);
}
-#define DEF_STRING_FUNCS(s, pre) \
-void \
-pre##_set_##s(stp_vars_t *v, const char *val) \
-{ \
- check_vars(v); \
- if (val) \
- stp_dprintf(STP_DBG_VARS, v, "set %s to %s\n", #s, val); \
- else \
- stp_dprintf(STP_DBG_VARS, v, "clear %s\n", #s); \
- if (v->s == val) \
- return; \
- STP_SAFE_FREE(v->s); \
- v->s = stp_strdup(val); \
- v->verified = 0; \
-} \
- \
-void \
-pre##_set_##s##_n(stp_vars_t *v, const char *val, int n) \
-{ \
- check_vars(v); \
- if (v->s == val) \
- return; \
- STP_SAFE_FREE(v->s); \
- v->s = stp_strndup(val, n); \
- v->verified = 0; \
-} \
- \
-const char * \
-pre##_get_##s(const stp_vars_t *v) \
-{ \
- check_vars(v); \
- return v->s; \
+#define DEF_STRING_FUNCS(s, pre) \
+void \
+pre##_set_##s(stp_vars_t *v, const char *val) \
+{ \
+ check_vars(v); \
+ if (val) \
+ stp_deprintf(STP_DBG_VARS, "set %s to %s (0x%p)\n", #s, val, \
+ (const void *) v); \
+ else \
+ stp_deprintf(STP_DBG_VARS, "clear %s (0x%p)\n", #s, \
+ (const void *) v); \
+ if (v->s == val) \
+ return; \
+ STP_SAFE_FREE(v->s); \
+ v->s = stp_strdup(val); \
+ v->verified = 0; \
+} \
+ \
+void \
+pre##_set_##s##_n(stp_vars_t *v, const char *val, int n) \
+{ \
+ check_vars(v); \
+ if (v->s == val) \
+ return; \
+ STP_SAFE_FREE(v->s); \
+ v->s = stp_strndup(val, n); \
+ v->verified = 0; \
+} \
+ \
+const char * \
+pre##_get_##s(const stp_vars_t *v) \
+{ \
+ check_vars(v); \
+ return v->s; \
}
#define DEF_FUNCS(s, t, pre) \
@@ -473,11 +471,11 @@ stp_set_string_parameter_n(stp_vars_t *v, const char *parameter,
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_STRING_LIST];
if (value)
- stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s, %s)\n",
- parameter, value);
+ stp_deprintf(STP_DBG_VARS, "stp_set_string_parameter(0x%p, %s, %s)\n",
+ (const void *) v, parameter, value);
else
- stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_string_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
set_raw_parameter(list, parameter, value, bytes,
STP_PARAMETER_TYPE_STRING_LIST);
stp_set_verified(v, 0);
@@ -489,14 +487,9 @@ stp_set_string_parameter(stp_vars_t *v, const char *parameter,
{
int byte_count = 0;
if (value)
- {
byte_count = strlen(value);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s, %s)\n",
- parameter, value);
- }
- else
- stp_dprintf(STP_DBG_VARS, v, "stp_set_string_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_string_parameter(0x%p, %s, %s)\n",
+ (const void *) v, parameter, value ? value : "NULL");
stp_set_string_parameter_n(v, parameter, value, byte_count);
stp_set_verified(v, 0);
}
@@ -506,12 +499,8 @@ stp_set_default_string_parameter_n(stp_vars_t *v, const char *parameter,
const char *value, size_t bytes)
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_STRING_LIST];
- if (value)
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_string_parameter(%s, %s)\n",
- parameter, value);
- else
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_string_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_string_parameter(0x%p, %s, %s)\n",
+ (const void *) v, parameter, value ? value : "NULL");
set_default_raw_parameter(list, parameter, value, bytes,
STP_PARAMETER_TYPE_STRING_LIST);
stp_set_verified(v, 0);
@@ -597,12 +586,8 @@ stp_set_file_parameter(stp_vars_t *v, const char *parameter,
size_t byte_count = 0;
if (value)
byte_count = strlen(value);
- if (value)
- stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s, %s)\n",
- parameter, value);
- else
- stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_file_parameter(0x%p, %s, %s)\n",
+ (const void *) v, parameter, value ? value : "NULL");
set_raw_parameter(list, parameter, value, byte_count,
STP_PARAMETER_TYPE_FILE);
stp_set_verified(v, 0);
@@ -613,12 +598,8 @@ stp_set_file_parameter_n(stp_vars_t *v, const char *parameter,
const char *value, size_t byte_count)
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_FILE];
- if (value)
- stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s, %s)\n",
- parameter, value);
- else
- stp_dprintf(STP_DBG_VARS, v, "stp_set_file_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_file_parameter(0x%p, %s, %s)\n",
+ (const void *) v, parameter, value ? value : "NULL");
set_raw_parameter(list, parameter, value, byte_count,
STP_PARAMETER_TYPE_FILE);
stp_set_verified(v, 0);
@@ -632,12 +613,8 @@ stp_set_default_file_parameter(stp_vars_t *v, const char *parameter,
size_t byte_count = 0;
if (value)
byte_count = strlen(value);
- if (value)
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s, %s)\n",
- parameter, value);
- else
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_file_parameter(0x%p, %s, %s)\n",
+ (const void *) v, parameter, value ? value : "NULL");
set_default_raw_parameter(list, parameter, value, byte_count,
STP_PARAMETER_TYPE_FILE);
stp_set_verified(v, 0);
@@ -648,12 +625,8 @@ stp_set_default_file_parameter_n(stp_vars_t *v, const char *parameter,
const char *value, size_t byte_count)
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_FILE];
- if (value)
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s, %s)\n",
- parameter, value);
- else
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_file_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_file_parameter(0x%p, %s, %s)\n",
+ (const void *) v, parameter, value ? value : "NULL");
set_default_raw_parameter(list, parameter, value, byte_count,
STP_PARAMETER_TYPE_FILE);
stp_set_verified(v, 0);
@@ -686,7 +659,8 @@ stp_set_curve_parameter(stp_vars_t *v, const char *parameter,
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_CURVE];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_curve_parameter(%s)\n", parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_curve_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (curve)
{
value_t *val;
@@ -719,8 +693,8 @@ stp_set_default_curve_parameter(stp_vars_t *v, const char *parameter,
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_CURVE];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_curve_parameter(%s)\n",
- parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_curve_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (!item)
{
if (curve)
@@ -764,6 +738,8 @@ stp_set_array_parameter(stp_vars_t *v, const char *parameter,
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_ARRAY];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_array_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (array)
{
value_t *val;
@@ -795,7 +771,8 @@ stp_set_default_array_parameter(stp_vars_t *v, const char *parameter,
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_ARRAY];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_array_parameter(%s)\n", parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_array_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (!item)
{
if (array)
@@ -824,8 +801,6 @@ stp_get_array_parameter(const stp_vars_t *v, const char *parameter)
const stp_list_t *list = v->params[STP_PARAMETER_TYPE_ARRAY];
const value_t *val;
const stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_array_parameter(%s)\n",
- parameter);
if (item)
{
val = (const value_t *) stp_list_item_get_data(item);
@@ -841,8 +816,8 @@ stp_set_int_parameter(stp_vars_t *v, const char *parameter, int ival)
stp_list_t *list = v->params[STP_PARAMETER_TYPE_INT];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_int_parameter(%s, %d)\n",
- parameter, ival);
+ stp_deprintf(STP_DBG_VARS, "stp_set_int_parameter(0x%p, %s, %d)\n",
+ (const void *) v, parameter, ival);
if (item)
{
val = (value_t *) stp_list_item_get_data(item);
@@ -867,8 +842,8 @@ stp_set_default_int_parameter(stp_vars_t *v, const char *parameter, int ival)
stp_list_t *list = v->params[STP_PARAMETER_TYPE_INT];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_int_parameter(%s, %d)\n",
- parameter, ival);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_int_parameter(0x%p, %s, %d)\n",
+ (const void *) v, parameter, ival);
if (!item)
{
val = stp_malloc(sizeof(value_t));
@@ -886,7 +861,8 @@ stp_clear_int_parameter(stp_vars_t *v, const char *parameter)
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_INT];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_clear_int_parameter(%s)\n", parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_clear_int_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (item)
stp_list_item_destroy(list, item);
stp_set_verified(v, 0);
@@ -929,8 +905,8 @@ stp_set_boolean_parameter(stp_vars_t *v, const char *parameter, int ival)
stp_list_t *list = v->params[STP_PARAMETER_TYPE_BOOLEAN];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_boolean_parameter(%s, %d)\n",
- parameter, ival);
+ stp_deprintf(STP_DBG_VARS, "stp_set_boolean_parameter(0x%p, %s, %d)\n",
+ (const void *) v, parameter, ival);
if (item)
{
val = (value_t *) stp_list_item_get_data(item);
@@ -959,8 +935,8 @@ stp_set_default_boolean_parameter(stp_vars_t *v, const char *parameter,
stp_list_t *list = v->params[STP_PARAMETER_TYPE_BOOLEAN];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_boolean_parameter(%s, %d)\n",
- parameter, ival);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_boolean_parameter(0x%p, %s, %d)\n",
+ (const void *) v, parameter, ival);
if (!item)
{
val = stp_malloc(sizeof(value_t));
@@ -981,7 +957,8 @@ stp_clear_boolean_parameter(stp_vars_t *v, const char *parameter)
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_BOOLEAN];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_clear_boolean_parameter(%s)\n", parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_clear_boolean_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (item)
stp_list_item_destroy(list, item);
stp_set_verified(v, 0);
@@ -1024,8 +1001,8 @@ stp_set_dimension_parameter(stp_vars_t *v, const char *parameter, int ival)
stp_list_t *list = v->params[STP_PARAMETER_TYPE_DIMENSION];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_dimension_parameter(%s, %d)\n",
- parameter, ival);
+ stp_deprintf(STP_DBG_VARS, "stp_set_dimension_parameter(0x%p, %s, %d)\n",
+ (const void *) v, parameter, ival);
if (item)
{
val = (value_t *) stp_list_item_get_data(item);
@@ -1050,8 +1027,8 @@ stp_set_default_dimension_parameter(stp_vars_t *v, const char *parameter, int iv
stp_list_t *list = v->params[STP_PARAMETER_TYPE_DIMENSION];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_dimension_parameter(%s, %d)\n",
- parameter, ival);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_dimension_parameter(0x%p, %s, %d)\n",
+ (const void *) v, parameter, ival);
if (!item)
{
val = stp_malloc(sizeof(value_t));
@@ -1069,7 +1046,8 @@ stp_clear_dimension_parameter(stp_vars_t *v, const char *parameter)
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_DIMENSION];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_clear_dimension_parameter(%s)\n", parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_clear_dimension_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (item)
stp_list_item_destroy(list, item);
stp_set_verified(v, 0);
@@ -1112,8 +1090,8 @@ stp_set_float_parameter(stp_vars_t *v, const char *parameter, double dval)
stp_list_t *list = v->params[STP_PARAMETER_TYPE_DOUBLE];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_float_parameter(%s, %f)\n",
- parameter, dval);
+ stp_deprintf(STP_DBG_VARS, "stp_set_float_parameter(0x%p, %s, %f)\n",
+ (const void *) v, parameter, dval);
if (item)
{
val = (value_t *) stp_list_item_get_data(item);
@@ -1139,8 +1117,8 @@ stp_set_default_float_parameter(stp_vars_t *v, const char *parameter,
stp_list_t *list = v->params[STP_PARAMETER_TYPE_DOUBLE];
value_t *val;
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_set_default_float_parameter(%s, %f)\n",
- parameter, dval);
+ stp_deprintf(STP_DBG_VARS, "stp_set_default_float_parameter(0x%p, %s, %f)\n",
+ (const void *) v, parameter, dval);
if (!item)
{
val = stp_malloc(sizeof(value_t));
@@ -1158,7 +1136,8 @@ stp_clear_float_parameter(stp_vars_t *v, const char *parameter)
{
stp_list_t *list = v->params[STP_PARAMETER_TYPE_DOUBLE];
stp_list_item_t *item = stp_list_get_item_by_name(list, parameter);
- stp_dprintf(STP_DBG_VARS, v, "stp_clear_float_parameter(%s)\n", parameter);
+ stp_deprintf(STP_DBG_VARS, "stp_clear_float_parameter(0x%p, %s)\n",
+ (const void *) v, parameter);
if (item)
stp_list_item_destroy(list, item);
stp_set_verified(v, 0);
@@ -1214,6 +1193,8 @@ stp_scale_float_parameter(stp_vars_t *v, const char *parameter,
val = desc.deflt.dbl;
stp_parameter_description_destroy(&desc);
}
+ stp_deprintf(STP_DBG_VARS, "stp_scale_float_parameter(%p, %s, %f*%f)\n",
+ (const void *) v, parameter, val, scale);
stp_set_float_parameter(v, parameter, val * scale);
}
@@ -1289,12 +1270,15 @@ set_parameter_active_generic(const stp_vars_t *v, stp_parameter_type_t p_type,
((value_t *) stp_list_item_get_data(item))->active = active;
}
-#define SET_PARAMETER_ACTIVE_FUNCTION(type, index) \
-void \
+#define SET_PARAMETER_ACTIVE_FUNCTION(type, index) \
+void \
stp_set_##type##_parameter_active(const stp_vars_t *v, const char *parameter, \
- stp_parameter_activity_t active) \
-{ \
- set_parameter_active_generic(v, index, parameter, active); \
+ stp_parameter_activity_t active) \
+{ \
+ stp_deprintf(STP_DBG_VARS, \
+ "stp_set_%s_parameter_active(0x%p, %s, %d)\n", \
+ #type, (const void *) v, parameter, active); \
+ set_parameter_active_generic(v, index, parameter, active); \
}
SET_PARAMETER_ACTIVE_FUNCTION(string, STP_PARAMETER_TYPE_STRING_LIST)
@@ -1322,9 +1306,9 @@ stp_fill_parameter_settings(stp_parameter_t *desc,
desc->verify_this_parameter = param->verify_this_parameter;
desc->read_only = param->read_only;
desc->name = param->name;
- desc->text = param->text;
- desc->category = param->category;
- desc->help = param->help;
+ desc->text = _(param->text);
+ desc->category = _(param->category);
+ desc->help = _(param->help);
return;
}
}
@@ -1419,6 +1403,86 @@ stp_parameter_list_add_param(stp_parameter_list_t list,
stp_list_item_create(ilist, NULL, item);
}
+static void
+debug_print_parameter_description(const stp_parameter_t *desc, const char *who,
+ const stp_vars_t *v)
+{
+ int i;
+ char *curve;
+ if (! (stp_get_debug_level() & STP_DBG_VARS))
+ return;
+ stp_deprintf(STP_DBG_VARS, "Describe %s: vars 0x%p from %s type %d class %d level %d\n",
+ desc->name, (const void *) v, who,
+ desc->p_type, desc->p_class, desc->p_level);
+ stp_deprintf(STP_DBG_VARS, " driver %s mandatory %d active %d channel %d verify %d ro %d\n",
+ stp_get_driver(v), desc->is_mandatory, desc->is_active,
+ desc->channel, desc->verify_this_parameter, desc->read_only);
+ switch (desc->p_type)
+ {
+ case STP_PARAMETER_TYPE_STRING_LIST:
+ stp_deprintf(STP_DBG_VARS,
+ " String default: %s\n",
+ desc->deflt.str ? desc->deflt.str : "(null)");
+ if (desc->bounds.str)
+ for (i = 0; i < stp_string_list_count(desc->bounds.str); i++)
+ {
+ if (i == 0)
+ stp_deprintf(STP_DBG_VARS, " Choices: %s\n",
+ stp_string_list_param(desc->bounds.str, i)->name);
+ else
+ stp_deprintf(STP_DBG_VARS, " : %s\n",
+ stp_string_list_param(desc->bounds.str, i)->name);
+ }
+ break;
+ case STP_PARAMETER_TYPE_INT:
+ stp_deprintf(STP_DBG_VARS,
+ " Integer default: %d Bounds: %d %d\n",
+ desc->deflt.integer,
+ desc->bounds.integer.lower, desc->bounds.integer.upper);
+ break;
+ case STP_PARAMETER_TYPE_DIMENSION:
+ stp_deprintf(STP_DBG_VARS,
+ " Dimension default: %d Bounds: %d %d\n",
+ desc->deflt.dimension,
+ desc->bounds.dimension.lower, desc->bounds.dimension.upper);
+ break;
+ case STP_PARAMETER_TYPE_BOOLEAN:
+ stp_deprintf(STP_DBG_VARS,
+ " Boolean default: %d\n", desc->deflt.boolean);
+ break;
+ case STP_PARAMETER_TYPE_DOUBLE:
+ stp_deprintf(STP_DBG_VARS,
+ " Double default: %f Bounds: %f %f\n",
+ desc->deflt.dbl,
+ desc->bounds.dbl.lower, desc->bounds.dbl.upper);
+ break;
+ case STP_PARAMETER_TYPE_FILE:
+ stp_deprintf(STP_DBG_VARS, " File (no default)\n");
+ break;
+ case STP_PARAMETER_TYPE_RAW:
+ stp_deprintf(STP_DBG_VARS, " Raw (no default)\n");
+ break;
+ case STP_PARAMETER_TYPE_CURVE:
+ curve = stp_curve_write_string(desc->deflt.curve);
+ stp_deprintf(STP_DBG_VARS,
+ " Curve default: %s\n", curve);
+ stp_free(curve);
+ curve = stp_curve_write_string(desc->bounds.curve);
+ stp_deprintf(STP_DBG_VARS,
+ " bounds: %s\n", curve);
+ stp_free(curve);
+ break;
+ case STP_PARAMETER_TYPE_ARRAY:
+ stp_deprintf(STP_DBG_VARS, " Array\n");
+ break;
+ case STP_PARAMETER_TYPE_INVALID:
+ stp_deprintf(STP_DBG_VARS, " *** Invalid ***\n");
+ break;
+ default:
+ stp_deprintf(STP_DBG_VARS, " Unknown type!\n");
+ }
+}
+
void
stp_describe_parameter(const stp_vars_t *v, const char *name,
stp_parameter_t *description)
@@ -1429,14 +1493,27 @@ stp_describe_parameter(const stp_vars_t *v, const char *name,
description->deflt.str = NULL;
stp_printer_describe_parameter(v, name, description);
if (description->p_type != STP_PARAMETER_TYPE_INVALID)
- return;
+ {
+ debug_print_parameter_description(description, "driver", v);
+ return;
+ }
stp_color_describe_parameter(v, name, description);
if (description->p_type != STP_PARAMETER_TYPE_INVALID)
- return;
+ {
+ debug_print_parameter_description(description, "color", v);
+ return;
+ }
stp_dither_describe_parameter(v, name, description);
if (description->p_type != STP_PARAMETER_TYPE_INVALID)
- return;
+ {
+ debug_print_parameter_description(description, "dither", v);
+ return;
+ }
stpi_describe_generic_parameter(v, name, description);
+ if (description->p_type != STP_PARAMETER_TYPE_INVALID)
+ debug_print_parameter_description(description, "generic", v);
+ else
+ stp_deprintf(STP_DBG_VARS, "Describing invalid parameter %s\n", name);
}
void