Changeset 963 for trunk/gsdl/src/recpt/librarymain.cpp
- Timestamp:
- 2000-02-22T11:01:02+13:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/librarymain.cpp
r937 r963 28 28 /* 29 29 $Log$ 30 Revision 1.23 2000/02/21 21:59:37 sjboddie 31 gsdlhome now comes from gsdlsite.cfg 32 30 33 Revision 1.22 2000/02/17 02:35:48 sjboddie 31 34 tidied up a bit … … 138 141 #include "htmlbrowserclass.h" 139 142 140 #include " gsdlhome.h"143 #include "recptconfig.h" 141 144 142 145 int main () { 143 146 receptionist recpt; 144 147 nullproto nproto; 145 146 148 text_tarray collections; 147 if (!read_dir (GSDL_GSDLHOME "/collect", collections)) exit (1); 149 150 // get gsdlhome (if we fail the error will be picked up later -- in 151 // cgiwrapper) 152 text_t gsdlhome; 153 if (site_cfg_read (gsdlhome)) { 154 text_t collectdir = filename_cat (gsdlhome, "collect"); 155 if (!read_dir (collectdir, collections)) exit (1); 156 } 148 157 149 158 text_tarray::const_iterator thiscol = collections.begin(); 150 159 text_tarray::const_iterator endcol = collections.end(); 151 160 152 161 while (thiscol != endcol) { 153 162 154 163 // ignore the modelcol 155 if (*thiscol == "modelcol") { 156 thiscol ++; 157 continue; 158 } 159 164 if (*thiscol == "modelcol") {thiscol ++; continue;} 165 160 166 // this memory is created but never destroyed 161 167 // we're also not doing any error checking to make sure we didn't … … 168 174 filterclass *filter = new filterclass (); 169 175 cserver->add_filter (filter); 170 176 171 177 // add a browse filter 172 178 browsefilterclass *browsefilter = new browsefilterclass(); … … 179 185 queryfilter->set_mgsearchptr (mgsearch); 180 186 cserver->add_filter (queryfilter); 181 187 182 188 // add a mg and gdbm source 183 189 mggdbmsourceclass *mggdbmsource = new mggdbmsourceclass (); … … 196 202 // add the protocol to the receptionist 197 203 recpt.add_protocol (&nproto); 198 204 199 205 // add other converters 200 206 utf8inconvertclass utf8inconvert; … … 202 208 recpt.add_converter ("u", &utf8inconvert, &utf8outconvert); 203 209 204 mapinconvertclass gbinconvert; 205 gbinconvert.setmapfile (GSDL_GSDLHOME, "gbku", 0x25a1); 206 mapoutconvertclass gboutconvert; 207 gboutconvert.setmapfile (GSDL_GSDLHOME, "ugbk", 0xa1f5); 208 recpt.add_converter ("g", &gbinconvert, &gboutconvert); 210 if (!gsdlhome.empty()) { 211 mapinconvertclass gbinconvert; 212 gbinconvert.setmapfile (gsdlhome, "gbku", 0x25a1); 213 mapoutconvertclass gboutconvert; 214 gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5); 215 recpt.add_converter ("g", &gbinconvert, &gboutconvert); 216 } 209 217 210 218 // the list of actions. Note: these actions will become invalid
Note:
See TracChangeset
for help on using the changeset viewer.