/* * FTP/HTTP daemon * configargs.cc Copyright (C) 1995, 96 Alex Belits * * This source/code is public free; you can distribute it and/or modify * it under terms of the GNU General Public License (published by the * Free Software Foundation) either version two of this License, or any * later version. * */ #ifdef AIX4 #include #else #include #endif #include #include "configargs.h" TypeArgs::TypeArgs(char *xpattern,char *xtypeline,char *xdirprefix,char *xdirpostfix,int abs){ absolute=abs; pattern=(char*)malloc(strlen(xpattern)+1); if(pattern) strcpy(pattern,xpattern); typeline=(char*)malloc(strlen(xtypeline)+1); if(typeline) strcpy(typeline,xtypeline); dirprefix=(char*)malloc(strlen(xdirprefix)+1); if(dirprefix) strcpy(dirprefix,xdirprefix); dirpostfix=(char*)malloc(strlen(xdirpostfix)+1); if(dirpostfix) strcpy(dirpostfix,xdirpostfix); } TypeArgs::~TypeArgs(void){ if(pattern) free(pattern); if(typeline) free(typeline); if(dirprefix) free(dirprefix); if(dirpostfix) free(dirpostfix); } ConfigArgs::ConfigArgs(int argc,char **args,int abs):Item(){ absolute=abs; params=(char**)malloc((argc+1)*sizeof(char*)); if(params){ for(paramc=0;paramc=0;paramc--){ if(params[paramc]) free(params[paramc]); } free(params); } } ConfigArgs *findargs(List *list,char *string){ if(list){ return (ConfigArgs*)list->Find(string); } return NULL; }