Changeset 5001a3d for variable.c


Ignore:
Timestamp:
Feb 19, 2013, 8:29:04 PM (9 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master
Children:
897fc1c
Parents:
353719a
git-author:
David Benjamin <davidben@mit.edu> (06/09/12 22:09:03)
git-committer:
David Benjamin <davidben@mit.edu> (02/19/13 20:29:04)
Message:
g_strdup validsettings

This'll allow perl to set it too.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    r353719a r5001a3d  
    623623    newvar->summary = g_strdup(init_params->summary);
    624624    newvar->description = g_strdup(init_params->description);
    625     newvar->validsettings = init_params->validsettings;
     625    newvar->validsettings = g_strdup(init_params->validsettings);
    626626    GCallback fn = NULL;
    627627    switch (init_params->type) {
     
    719719    owl_variable * var = owl_variable_newvar(name, summ, desc);
    720720    var->type = OWL_VARIABLE_STRING;
    721     var->validsettings = "<string>";
     721    var->validsettings = g_strdup("<string>");
    722722    g_value_init(&var->val, G_TYPE_STRING);
    723723    OWL_VARIABLE_SETUP_DEFAULT_FUNCS(var, string, STRING);
     
    743743    owl_variable * var = owl_variable_newvar(name, summ, desc);
    744744    var->type = OWL_VARIABLE_INT;
    745     var->validsettings = "<int>";
     745    var->validsettings = g_strdup("<int>");
    746746    g_value_init(&var->val, G_TYPE_INT);
    747747    OWL_VARIABLE_SETUP_DEFAULT_FUNCS(var, int, INT);
     
    767767    owl_variable * var = owl_variable_newvar(name, summ, desc);
    768768    var->type = OWL_VARIABLE_BOOL;
    769     var->validsettings = "on,off";
     769    var->validsettings = g_strdup("on,off");
    770770    g_value_init(&var->val, G_TYPE_BOOLEAN);
    771771    OWL_VARIABLE_SETUP_DEFAULT_FUNCS(var, bool, BOOLEAN);
     
    795795  g_free(v->description);
    796796  g_free(v->default_str);
     797  g_free(v->validsettings);
    797798  g_value_unset(&(v->val));
    798799  g_closure_unref(v->get_tostring_fn);
Note: See TracChangeset for help on using the changeset viewer.