pike.git / bin / extract.pike

version» Context lines:

pike.git/bin/extract.pike:1:   #!/usr/local/bin/pike   // By Martin Nilsson and Andreas Lange   // - // $Id: extract.pike,v 1.12 2002/01/16 03:12:32 nilsson Exp $ + // $Id: extract.pike,v 1.13 2002/01/17 01:54:59 nilsson Exp $   //         // The arguments given to the program   mapping args = ([]);   // All the files to gather strings from   array(string) files = ({});   // All ids used, id:mapping(info)   mapping ids = ([]);   // Reversed id mapping, text:id
pike.git/bin/extract.pike:18:   // Code to add to xml outfile, id:code   mapping(string:string) add = ([]);   // List of ids already in the xml outfile   multiset(string) added = (<>);   // The highest int with all lower ids set; see make_id()   int high_int_id = 0;         int make_id() {    // Returns the next unused unique id -  while ( has_value(id_xml_order, ++high_int_id) ); +  // while ( has_value(id_xml_order, ++high_int_id) ); +  if(high_int_id) +  return ++high_int_id; +  high_int_id = max( @map(id_xml_order, +  lambda(string|int in) { +  return intp(in)?in:0; +  }) ) + 1;    return high_int_id;   }         string get_first_string(string in) {    // Merges parts, compiles and returns the first string in a line from cpp    // ie '"a\\n" "b: " "%s!", string' --> "a\nb: %s!"    string ret = "";    int instr = 0;    for(int i = 0; i<sizeof(in); i++) {
pike.git/bin/extract.pike:1033:    configname = args->project+".xml";    string filename = parse_config(configname);    if(!xml_name || xml_name=="")    if(filename!="")    xml_name = filename;    else if(args->xmlpath && args->baselang)    xml_name = replace(args->xmlpath, "%L", args->baselang);       if( (!(xml_name && args->sync && args->xmlpath && args->baselang)) &&    (!sizeof(files) || args->help) ) { -  sscanf("$Revision: 1.12 $", "$"+"Revision: %s $", string v); +  sscanf("$Revision: 1.13 $", "$"+"Revision: %s $", string v);    werror("\n Locale Extractor Utility "+v+"\n\n");    werror(" Syntax: extract.pike [arguments] infile(s)\n\n");    werror(" Arguments: --project=name default: first found in infile\n");    werror(" --config=file default: [project].xml\n");    werror(" --out=file default: [project]_eng.xml\n");    werror(" --nocopy update infile instead of infile.new\n");    werror(" --notime don't include dump time in xml files\n");    werror(" --wipe remove unused ids from xml\n");    werror(" --sync synchronize all locale projects\n");    werror(" --encoding=enc default: ISO-8859-1\n");