Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

flt_tplmode.c

Go to the documentation of this file.
00001 
00008 /* {{{ Initial comments */
00009 /*
00010  * $LastChangedDate: 2004-04-01 18:34:17 +0200 (Thu, 01 Apr 2004) $
00011  * $LastChangedRevision: 50 $
00012  * $LastChangedBy: ckruse $
00013  *
00014  */
00015 /* }}} */
00016 
00017 /* {{{ Includes */
00018 #include "config.h"
00019 #include "defines.h"
00020 
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <ctype.h>
00024 #include <string.h>
00025 #include <sys/types.h>
00026 
00027 #include <time.h>
00028 
00029 #include "readline.h"
00030 #include "hashlib.h"
00031 #include "utils.h"
00032 #include "configparser.h"
00033 #include "cfcgi.h"
00034 #include "template.h"
00035 #include "clientlib.h"
00036 /* }}} */
00037 
00038 static u_char *TPLMode = NULL;
00039 
00040 int flt_tplmode_execute(t_cf_hash *head,t_configuration *dc,t_configuration *vc) {
00041   t_name_value *v;
00042 
00043   if(TPLMode) {
00044     v = cfg_get_value(dc,"TemplateMode");
00045     free(v->values[0]);
00046     v->values[0] = strdup(TPLMode);
00047 
00048     return FLT_OK;
00049   }
00050 
00051   return FLT_DECLINE;
00052 }
00053 
00054 int flt_tplmode_handle(t_configfile *cfile,t_conf_opt *opt,u_char **args,int argnum) {
00055   if(TPLMode) free(TPLMode);
00056   TPLMode = strdup(args[0]);
00057 
00058   return 0;
00059 }
00060 
00061 void flt_tplmode_finish(void) {
00062   if(TPLMode) free(TPLMode);
00063 }
00064 
00065 t_conf_opt flt_tplmode_config[] = {
00066   { "TPLMode",        flt_tplmode_handle, NULL },
00067   { NULL, NULL, NULL }
00068 };
00069 
00070 t_handler_config flt_tplmode_handlers[] = {
00071   { INIT_HANDLER, flt_tplmode_execute },
00072   { 0, NULL }
00073 };
00074 
00075 t_module_config flt_tplmode = {
00076   flt_tplmode_config,
00077   flt_tplmode_handlers,
00078   NULL,
00079   NULL,
00080   NULL,
00081   flt_tplmode_finish
00082 };
00083 
00084 /* eof */

Generated on Sun Apr 25 16:37:39 2004 for Classic Forum by doxygen 1.3.5