pike.git / src / post_modules / GTK2 / output / split.pike

version» Context lines:

pike.git/src/post_modules/GTK2/output/split.pike:156:    res += " "+line+"\n";    return res;   }   void post_class_build()   {   }      array(string) output( mapping(string:Class) classes,    mapping(string:Constant) constants,    array(Node) global_code, -  mapping(string:string) strings) +  mapping(string:int) strings)   {    head = Stdio.read_bytes( combine_path( sdir, "../pgtk.c.head" ) );    if(!head) error("Failed to load ../pgtk.c.head\n");    sfhead = replace( head, "PROTOTYPES", "#include \"prototypes.h\"" );    traverse_class_tree( classes, output_class );    post_class_build();    traverse_class_tree( classes, build_protos );    write_file( dir + "prototypes.h", protos );    write_file( dir + "time_stamp", (string)time() );   
pike.git/src/post_modules/GTK2/output/split.pike:200:    foreach( c->signals; string n; object s )    if( !done[n] )    done[n] = s;       q = sort(indices( done )); sort(map(q,sizeof),q);    foreach( reverse(q), string w ) S("s_"+w,1);       foreach( sort(indices( done )), string w )    initfun += done[w]->pike_add();    -  foreach( strings; string name; string str ) +  if(sizeof(strings))    { -  pre += "struct pike_string *" + name + ";\n"; -  initfun += " " + name + " = make_shared_binary_string(" + S(str,0,2) + -  "," + sizeof(str) + ");\n"; -  exitfun += " free_string(" + name + ");\n"; +  pre += "struct pike_string * pstr_vector["+sizeof(strings)+"];\n\n"; +  foreach( strings; string str; int idx ) +  { +  initfun += sprintf("\n /* %O */\n", str); +  initfun += " pstr_vector[" + idx + "] = make_shared_binary_string(" + +  S(str,0,2) + "," + sizeof(str) + ");\n";    } -  +  exitfun += #" +  { +  int i; +  for( i=0; i<NELEM(pstr_vector); i++ ) +  free_string( pstr_vector[i] ); +  } + "; +  }       pre += get_string_data()+"\n\n";    files = ({ "pgtk.c" }) + files;       write_file( dir+"pgtk.c",    pre + toplevel +    "PIKE_MODULE_INIT {\n"+make_initfun()+initfun+"}\n\n"    "PIKE_MODULE_EXIT {\n"+exitfun+"}\n\n"    "struct program *pgtk_type_to_program(GObject *widget)\n"    "{\n"