pike.git / bin / pikedoc2.pike

version» Context lines:

pike.git/bin/pikedoc2.pike:1:   #!/usr/local/bin/pike   /* -  * $Id: pikedoc2.pike,v 1.2 1999/07/09 17:10:06 grubba Exp $ +  * $Id: pikedoc2.pike,v 1.3 2000/10/08 18:16:35 grubba Exp $    *    * Pike-doc extractor mk II    *    * Henrik Grubbström 1999-07-08    */      /* Load spider. */   #if constant(spider)   #endif /* constant(spider) */   
pike.git/bin/pikedoc2.pike:100:    case "txt":    s = txt_to_wmml(s);    break;    }       res->res += s*"\n" + "\n";       return("");   }    - string extract_pikedoc(string input) + string extract_pikedoc(string input, mapping|void res)   { -  mapping res = (["res":""]); +  res = res || (["res":""]);       parse_html(input, ([]), (["pikedoc":_extract_pikedoc]), res);       return(res->res);   }      int main(int argc, array(string) argv)   { -  +  if (argc == 1) {    string raw = Stdio.stdin->read();       write(extract_pikedoc(raw)); -  +  } else { +  foreach(argv[1..], string fname) { +  string raw = Stdio.File(fname, "r")->read(); +  mapping res = ([]); +  extract_pikedoc(raw, res);    -  +  foreach(indices(raw), string group) { +  // Do something interresting. +  } +  } +  }    return(0);   }