87e9262001-06-22Martin Nilsson // This file is part of Roxen Search // Copyright © 2001 Roxen IS. All rights reserved. //
8c5dc62001-08-01Johan Schön // $Id: Base.pike,v 1.9 2001/08/01 15:52:24 js Exp $
87e9262001-06-22Martin Nilsson 
e1d7152000-11-24Johan Schön //! The MIME content types this class can filter.
df57a22001-01-02Johan Schön constant contenttypes = ({ });
e1d7152000-11-24Johan Schön 
300e4c2001-05-17Johan Schön class Output { // Wide strings here mapping(string:string) fields=([]);
8c5dc62001-08-01Johan Schön  // body, title, description, keywords
feb96a2001-05-31Johan Schön  int document_size;
300e4c2001-05-17Johan Schön  mapping(string:string) uri_anchors=([]); // Maps un-normalized URLs to raw text // ([ "http://www.roxen.com": "the Roxen web-server" ]) array(Standards.URI|string) links=({}); void fix_relative_links(Standards.URI base_uri) { for(int i=0; i<sizeof(links); i++)
34df362001-05-29Johan Schön  {
300e4c2001-05-17Johan Schön  links[i]=Standards.URI(links[i], base_uri);
34df362001-05-29Johan Schön  if(links[i]->fragment) links[i]->fragment=0; }
300e4c2001-05-17Johan Schön  } } Output filter(Standards.URI uri, string|Stdio.File data,
e262e52001-06-05Per Hedbor  string content_type, mixed ... more);
32e8b52001-06-28Johan Schön  string tmp_filename() { return sprintf("../var/tmp/search.tmp.%d.%d",random(0x7fffffff),getpid()); }