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)
50 if (!qof_choice_is_initialized ())
52 g_return_val_if_fail (type != NULL, FALSE);
53 value = g_hash_table_lookup (qof_choice_table, type);
54 if ((GHashTable *) value)
62 GHashTable *param_table;
64 g_return_val_if_fail (type != NULL, FALSE);
65 g_return_val_if_fail (qof_choice_is_initialized () == TRUE, FALSE);
67 param_table = g_hash_table_new (g_str_hash, g_str_equal);
68 g_hash_table_insert (qof_choice_table, type, param_table);
76 GHashTable *param_table;
81 g_return_val_if_fail (select != NULL, FALSE);
84 (GHashTable *) g_hash_table_lookup (qof_choice_table, select);
85 g_return_val_if_fail (param_table, FALSE);
86 option_list = (GList *) g_hash_table_lookup (param_table, param_name);
87 option_list = g_list_append (option_list, option);
88 g_hash_table_insert (param_table, param_name, option_list);
96 GHashTable *param_table;
98 g_return_val_if_fail (type != NULL, NULL);
99 g_return_val_if_fail (qof_choice_is_initialized () == TRUE, FALSE);
101 param_table = g_hash_table_lookup (qof_choice_table, type);
102 choices = g_hash_table_lookup (param_table, param->param_name);
109 GList *choices, *result;
110 GHashTable *param_table;
112 choices = result = NULL;
114 param_table = g_hash_table_lookup (qof_choice_table, choice_obj);
115 choices = g_hash_table_lookup (param_table, param_name);
116 result = g_list_find (choices, choice);
gboolean qof_choice_create(gchar *type)
Set an object as using QOF_TYPE_CHOICE.
#define LEAVE(format, args...)
GList * qof_object_get_choices(QofIdType type, QofParam *param)
Return the list of all object types usable with this parameter.
Linking one entity to other entities of many possible types.
gboolean qof_object_is_choice(QofIdType type)
Does this object contain a choice parameter?
gboolean qof_choice_add_class(gchar *select, gchar *option, gchar *param_name)
Add the choices for this parameter to the object.
gboolean qof_choice_check(gchar *choice_obj, gchar *param_name, gchar *choice)
Is the choice valid for this param_name?
#define ENTER(format, args...)
const gchar * QofLogModule