Changeset f57a106 for stubgen.pl
- Timestamp:
- Jun 1, 2010, 8:04:56 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 43e3061
- Parents:
- f3a9d4d
- git-author:
- David Benjamin <davidben@mit.edu> (06/01/10 20:00:08)
- git-committer:
- David Benjamin <davidben@mit.edu> (06/01/10 20:04:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stubgen.pl
rd7cc50b rf57a106 12 12 my $altvarname = $2; 13 13 $altvarname = $3 if ($3); 14 my $detailname = $altvarname; 15 $detailname =~ s/[^a-zA-Z0-9]/-/g; 14 16 if ($vartype =~ /^BOOL/) { 15 print "void owl_global_set_${altvarname}_on(owl_global *g) {\n"; 16 print " owl_variable_set_bool_on(&g->vars, \"$varname\");\n}\n"; 17 print "void owl_global_set_${altvarname}_off(owl_global *g) {\n"; 18 print " owl_variable_set_bool_off(&g->vars, \"$varname\");\n}\n"; 19 print "int owl_global_is_$altvarname(const owl_global *g) {\n"; 20 print " return owl_variable_get_bool(&g->vars, \"$varname\");\n}\n"; 17 print <<EOT; 18 void owl_global_set_${altvarname}_on(owl_global *g) { 19 g_object_set(G_OBJECT(g->gn), "$detailname", TRUE, NULL); 20 } 21 void owl_global_set_${altvarname}_off(owl_global *g) { 22 g_object_set(G_OBJECT(g->gn), "$detailname", FALSE, NULL); 23 } 24 int owl_global_is_$altvarname(const owl_global *g) { 25 return owl_variable_get_bool(&g->vars, "$varname"); 26 } 27 EOT 21 28 } elsif ($vartype =~ /^PATH/ or $vartype =~ /^STRING/) { 22 print "void owl_global_set_$altvarname(owl_global *g, const char *text) {\n"; 23 print " owl_variable_set_string(&g->vars, \"$varname\", text);\n}\n"; 24 print "const char *owl_global_get_$altvarname(const owl_global *g) {\n"; 25 print " return owl_variable_get_string(&g->vars, \"$varname\");\n}\n"; 29 print <<EOT; 30 void owl_global_set_${altvarname}(owl_global *g, const char *text) { 31 g_object_set(G_OBJECT(g->gn), "$detailname", text, NULL); 32 } 33 const char *owl_global_get_$altvarname(const owl_global *g) { 34 return owl_variable_get_string(&g->vars, "$varname"); 35 } 36 EOT 26 37 } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) { 27 print "void owl_global_set_$altvarname(owl_global *g, int n) {\n"; 28 print " owl_variable_set_int(&g->vars, \"$varname\", n);\n}\n"; 29 print "int owl_global_get_$altvarname(const owl_global *g) {\n"; 30 print " return owl_variable_get_int(&g->vars, \"$varname\");\n}\n"; 38 print <<EOT; 39 void owl_global_set_${altvarname}(owl_global *g, int n) { 40 g_object_set(G_OBJECT(g->gn), "$detailname", n, NULL); 41 } 42 int owl_global_get_$altvarname(const owl_global *g) { 43 return owl_variable_get_int(&g->vars, "$varname"); 44 } 45 EOT 31 46 } 32 47 }
Note: See TracChangeset
for help on using the changeset viewer.