Commit c79272ac authored by Seth Burgess's avatar Seth Burgess

Added improved querying for gimprc. Can now return just about anything as

a string, with only a few exceptions.

	ChangeLog app/gimprc.c app/gimprc.h app/gimprc_cmds.c
parent 05fd826e
Thu May 20 16:38:05 BST 1999 Austin Donnelly <austin@gimp.org
Fri May 21 10:39:00 CST 1999 Seth Burgess <sjburges@gimp.org>
* app/gimprc.c
* app/gimprc.h
* app/gimprc_cmds.c : wrapped up value_to_str and added it to
the gimprc_query function. Now most values will be queryable,
but there are still a few exceptions (generally structure info
not really stored in gimprc anyway).
Thu May 20 16:38:05 BST 1999 Austin Donnelly <austin@gimp.org>
* app/curves.c: colour in the previously greyscale bars to the
left and below the curve itself. Might want to take alpha and
......
......@@ -182,6 +182,7 @@ static int parse_proc_def (PlugInProcDef **proc_def);
static int parse_proc_arg (ProcArg *arg);
static int parse_unknown (char *token_sym);
char* gimprc_value_to_str (char *name);
static char* value_to_str (char *name);
static inline char* string_to_str (gpointer val1p, gpointer val2p);
......@@ -2258,11 +2259,18 @@ parse_unknown (char *token_sym)
return OK;
}
char*
gimprc_value_to_str (char *name)
{
return value_to_str (name); /* had a namespace collision */
}
static char *
value_to_str (char *name)
{
int i;
printf(" STRING = %s", name);
for (i = 0; i < nfuncs; i++)
if (! strcmp (funcs[i].name, name))
switch (funcs[i].type)
......@@ -2551,6 +2559,7 @@ open_backup_file (char *filename,
return NULL;
}
char*
gimprc_find_token (char *token)
{
......
......@@ -85,6 +85,7 @@ void parse_gimprc (void);
void parse_gimprc_file (char *filename);
void save_gimprc (GList **updated_options, GList **conflicting_options);
char * gimprc_find_token (char *token);
char * gimprc_value_to_str (char *name);
void save_gimprc_strings (gchar *token, gchar *value);
#endif /* __GIMPRC_H__ */
......@@ -44,9 +44,12 @@ gimprc_query_invoker (Argument *args)
if (token == NULL)
success = FALSE;
if (success)
if (success) /* tests the custom tokens only */
success = (value = gimprc_find_token (token)) != NULL;
if (!success) /* try the standard ones, and do necessary conversions */
success = (value = gimprc_value_to_str(token)) != NULL;
return_args = procedural_db_return_args (&gimprc_query_proc, success);
if (success)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment