30 static GHashTable *qof_choice_table = NULL;
35 qof_choice_is_initialized (
void)
37 if (!qof_choice_table)
38 qof_choice_table = g_hash_table_new (g_str_hash, g_str_equal);
39 if (!qof_choice_table)
47 gpointer value, check;
51 if (!qof_choice_is_initialized ())
53 g_return_val_if_fail (type != NULL, FALSE);
54 value = g_hash_table_lookup (qof_choice_table, type);
55 if ((GHashTable *) value)
63 GHashTable *param_table;
65 g_return_val_if_fail (type != NULL, FALSE);
66 g_return_val_if_fail (qof_choice_is_initialized () == TRUE, FALSE);
68 param_table = g_hash_table_new (g_str_hash, g_str_equal);
69 g_hash_table_insert (qof_choice_table, type, param_table);
77 GHashTable *param_table;
82 g_return_val_if_fail (select != NULL, FALSE);
85 (GHashTable *) g_hash_table_lookup (qof_choice_table, select);
86 g_return_val_if_fail (param_table, FALSE);
87 option_list = (GList *) g_hash_table_lookup (param_table, param_name);
88 option_list = g_list_append (option_list, option);
89 g_hash_table_insert (param_table, param_name, option_list);
97 GHashTable *param_table;
99 g_return_val_if_fail (type != NULL, NULL);
100 g_return_val_if_fail (qof_choice_is_initialized () == TRUE, FALSE);
102 param_table = g_hash_table_lookup (qof_choice_table, type);
103 choices = g_hash_table_lookup (param_table, param->param_name);
110 GList *choices, *result;
111 GHashTable *param_table;
113 choices = result = NULL;
115 param_table = g_hash_table_lookup (qof_choice_table, choice_obj);
116 choices = g_hash_table_lookup (param_table, param_name);
117 result = g_list_find (choices, choice);