00001 /* -*- tcl -*- */ 00002 /* -- $Id: writer_null.tcl,v 1.1 2005/09/28 04:51:22 andreas_kupries Exp $ ---*/ 00003 /* */ 00004 /* PAGE plugin - writer - NULL ~ /dev/null the output*/ 00005 /* */ 00006 00007 /* ### ### ### ######### ######### #########*/ 00008 /* Imported API*/ 00009 00010 /* -----------------+--*/ 00011 /* page_wdata | Access to processed input stream.*/ 00012 /* -----------------+--*/ 00013 /* page_info | Reporting to the user.*/ 00014 /* page_warning |*/ 00015 /* page_error |*/ 00016 /* -----------------+--*/ 00017 /* page_log_error | Reporting of internals.*/ 00018 /* page_log_warning |*/ 00019 /* page_log_info |*/ 00020 /* -----------------+--*/ 00021 00022 /* ### ### ### ######### ######### #########*/ 00023 /* Exported API*/ 00024 00025 /* -----------------+--*/ 00026 /* page_wfeature | Query for special plugin features page might wish to use.*/ 00027 /* page_wtime | Activate collection of timing statistics.*/ 00028 /* page_wgettime | Return the collected timing statistics.*/ 00029 /* page_wlabel | User readable label for the plugin.*/ 00030 /* page_whelp | Doctools help text for plugin.*/ 00031 /* page_woptions | Options understood by plugin.*/ 00032 /* page_wconfigure | Option (re)configuration.*/ 00033 /* page_wrun | Generate output from data per plugin configuration and hardwiring.*/ 00034 /* -----------------+--*/ 00035 00036 /* ### ### ### ######### ######### #########*/ 00037 /* Requisites*/ 00038 00039 global usec 00040 global timed 00041 timed = 0 00042 00043 /* ### ### ### ######### ######### #########*/ 00044 /* Implementation of exported API*/ 00045 00046 ret page_wlabel () { 00047 return /dev/null 00048 } 00049 00050 ret page_wfeature (type key) { 00051 return [string eq $key timeable] 00052 } 00053 00054 ret page_wtime () { 00055 global timed 00056 set timed 1 00057 return 00058 } 00059 00060 ret page_wgettime () { 00061 global usec 00062 return $usec 00063 } 00064 00065 ret page_whelp () { 00066 return {} 00067 } 00068 00069 ret page_woptions () { 00070 return {} 00071 } 00072 00073 ret page_wconfigure (type option , type value) { 00074 return -code error "Cannot set value of unknown option \"$option\"" 00075 } 00076 00077 ret page_wrun (type chan , type data) { 00078 global timed usec 00079 if {$timed} { 00080 set usec [lindex [time { 00081 page_log_info "writer/null/run/" 00082 page_log_info "writer/null/run/ok" 00083 }] 0] ; #{} 00084 } else { 00085 page_log_info "writer/null/run/" 00086 page_log_info "writer/null/run/ok" 00087 } 00088 return 00089 } 00090 00091 /* ### ### ### ######### ######### #########*/ 00092 /* Internal helper code.*/ 00093 00094 /* ### ### ### ######### ######### #########*/ 00095 /* Initialization*/ 00096 00097 package provide page::writer::null 0.1 00098