pike.git / src / post_modules / GLUT / gen.pike

version» Context lines:

pike.git/src/post_modules/GLUT/gen.pike:131:    int a=1;    for(int i=1; i<sizeof(ty); i++)    {    switch(ty[i]) {       case 'C':    string internal_args;    sscanf(ty[i..],"C(%s)",internal_args);    if(!args)    error("First character after C must be '(' (%s).",ty); -  +     callback=    "struct svalue "+name+"_fun;\n\n"    "void "+name+"_cb_wrapper(";    int n;    array a1=({}),a2=({});;    if(!sizeof(internal_args))    a1+=({"void"});    else    foreach(internal_args/"",string s)    switch(s) {
pike.git/src/post_modules/GLUT/gen.pike:303:    got += " check_img_arg(Pike_sp["+(a-1)+"-args].u.object, &img, "+a+    ", \""+name+"\");\n";    }       if(after_variables)    res+=after_variables;       prot = (argt*",")+prot;       if(sizeof(argt)) -  res += "\n check_all_args(\""+name+"\", args, "+ +  res += "\n check_all_args(NULL, args, "+    ((Array.map((argt_cut<0?argt:argt[..argt_cut-1]),    lambda(string t) {    return Array.map(t/"|",    lambda(string t) {    return "BIT_"+upper_case(t);    })*"|";    }))+    (r234?({"BIT_MANY|BIT_MIXED|BIT_VOID"}):({}))+({"0"}))*", "+");\n";       if(sizeof(got))
pike.git/src/post_modules/GLUT/gen.pike:434:    sort(fn);    foreach(fn, string f) {    array(string) r = gen_func(f, ty[f]);    res += sprintf("#ifndef MISSING_%s\n", upper_case(f)) +    r[0] +    sprintf("#endif /* MISSING_%s */\n\n", upper_case(f));    prot[f]=r[1];    }    res += "void add_auto_funcs_glut()\n{\n";    res += " pre_init();\n"; +  string dres = "/*! @module GLUT\n *!\n";    foreach(fn, string f) -  +  {    res +=    sprintf("#ifndef MISSING_%s\n", upper_case(f)) +    " add_function_constant(\""+f+"\", f_"+f+",\n\t\t\t\"function("+    prot[f]+")\", OPT_SIDE_EFFECT);\n"    "#endif\n"; -  +  string ret, args; +  sscanf( reverse(prot[f]), "%[^:]:%s", ret,args); +  dres += " *! @decl "+reverse(ret)+" "+f+"("+reverse(args)+")\n *!\n"; +  }    foreach(sort(indices(constants)), string co) -  +  { +  dres += " *! @decl constant "+co+"\n*!\n";    res += " add_integer_constant(\""+co+"\", "+constants[co]+", ID_FINAL);\n"; -  +  }    res += " post_init();\n";    res += "}\n"; -  +  dres += " *! @endmodule\n"; +  dres += " */\n"; +  if( Stdio.read_file( combine_path(__DIR__,"autodoc.c") ) != dres ) +  { +  werror("Updating autodoc.c\n"); +  Stdio.write_file( combine_path(__DIR__,"autodoc.c"), dres ); +  }    return res;   }      void main(int argc, array(string) argv)   {    array(string) f = Stdio.File("stdin")->read()/"@@";    write(({f[0],gen(),@f[1..]})*"");   }