Changeset fd03b12 for stubgen.pl


Ignore:
Timestamp:
Aug 2, 2010, 11:38:19 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
5ca3fb7
Parents:
e0022d2
git-author:
David Benjamin <davidben@mit.edu> (08/02/10 12:18:09)
git-committer:
David Benjamin <davidben@mit.edu> (08/02/10 23:38:19)
Message:
Properly revert globalnotifier changes to stubgen.pl

Apparently I made some typoes and didn't do the obvious thing of
checking out the old copy when punting the experiment. Variables with
different varname and altvarname got slightly confused.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • stubgen.pl

    rea7daa8 rfd03b12  
    1212    my $altvarname = $2;
    1313    $altvarname = $3 if ($3);
    14     my $detailname = $altvarname;
    15     $detailname =~ s/[^a-zA-Z0-9]/-/g;
    16     $detailname =~ s/^[^a-zA-Z]+//;
    1714    if ($vartype =~ /^BOOL/) {
    18         print <<EOT;
    19 void owl_global_set_${altvarname}_on(owl_global *g) {
    20   owl_variable_set_bool_on(&g->vars, "$altvarname");
    21 }
    22 void owl_global_set_${altvarname}_off(owl_global *g) {
    23   owl_variable_set_bool_off(&g->vars, "$altvarname");
    24 }
    25 int owl_global_is_$altvarname(const owl_global *g) {
    26   return owl_variable_get_bool(&g->vars, "$varname");
    27 }
    28 EOT
     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";
    2921    } elsif ($vartype =~ /^PATH/ or $vartype =~ /^STRING/) {
    30         print <<EOT;
    31 void owl_global_set_${altvarname}(owl_global *g, const char *text) {
    32   owl_variable_set_string(&g->vars, "$altvarname", text);
    33 }
    34 const char *owl_global_get_$altvarname(const owl_global *g) {
    35   return owl_variable_get_string(&g->vars, "$varname");
    36 }
    37 EOT
     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";
    3826    } elsif ($vartype =~ /^INT/ or $vartype =~ /^ENUM/) {
    39         print <<EOT;
    40 void owl_global_set_${altvarname}(owl_global *g, int n) {
    41   owl_variable_set_int(&g->vars, "$altvarname", n);
    42 }
    43 int owl_global_get_$altvarname(const owl_global *g) {
    44   return owl_variable_get_int(&g->vars, "$varname");
    45 }
    46 EOT
     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";
    4731    }
    4832    }
Note: See TracChangeset for help on using the changeset viewer.