|
|
|
|
|
|
constant contenttypes = ({ }); |
|
constant tmp_filename = .TmpFile.tmp_filename; |
|
|
class Output |
{ |
|
|
|
mapping(string:string) fields=([]); |
|
|
|
int document_size; |
|
|
mapping(string:string) uri_anchors=([]); |
|
|
|
|
array(Standards.URI|string) links=({}); |
|
|
void fix_relative_links(Standards.URI base_uri) |
{ |
for(int i=0; i<sizeof(links); i++) |
{ |
links[i]=Standards.URI(links[i], base_uri); |
if(links[i]->fragment) |
links[i]->fragment=0; |
} |
} |
} |
|
|
Output filter(Standards.URI uri, string|Stdio.File data, |
string content_type, mixed ... more); |
|
string my_popen(array(string) args) |
|
{ |
Stdio.File pipe0 = Stdio.File(); |
Stdio.File pipe1 = pipe0->pipe(Stdio.PROP_IPC); |
if(!pipe1) |
if(!pipe1) error("my_popen failed (couldn't create pipe).\n"); |
Process.create_process(args, ([ "env":getenv(), "stdout":pipe1 ])); |
pipe1->close(); |
string result = pipe0->read(); |
if(!result) |
error("my_popen failed with error "+pipe0->errno()+".\n"); |
pipe0->close(); |
return result; |
} |
|
|