Ignore:
Timestamp:
2000-02-22T11:01:02+13:00 (24 years ago)
Author:
sjboddie
Message:

gsdlhome now comes from gsdlsite.cfg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/librarymain.cpp

    r937 r963  
    2828/*
    2929   $Log$
     30   Revision 1.23  2000/02/21 21:59:37  sjboddie
     31   gsdlhome now comes from gsdlsite.cfg
     32
    3033   Revision 1.22  2000/02/17 02:35:48  sjboddie
    3134   tidied up a bit
     
    138141#include "htmlbrowserclass.h"
    139142
    140 #include "gsdlhome.h"
     143#include "recptconfig.h"
    141144
    142145int main () {
    143146  receptionist recpt;
    144147  nullproto nproto;
    145 
    146148  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  }
    148157
    149158  text_tarray::const_iterator thiscol = collections.begin();
    150159  text_tarray::const_iterator endcol = collections.end();
    151 
     160 
    152161  while (thiscol != endcol) {
    153 
     162   
    154163    // ignore the modelcol
    155     if (*thiscol == "modelcol") {
    156       thiscol ++;
    157       continue;
    158     }
    159 
     164    if (*thiscol == "modelcol") {thiscol ++; continue;}
     165   
    160166    // this memory is created but never destroyed
    161167    // we're also not doing any error checking to make sure we didn't
     
    168174    filterclass *filter = new filterclass ();
    169175    cserver->add_filter (filter);
    170    
     176     
    171177    // add a browse filter
    172178    browsefilterclass *browsefilter = new browsefilterclass();
     
    179185    queryfilter->set_mgsearchptr (mgsearch);
    180186    cserver->add_filter (queryfilter);
    181 
     187   
    182188    // add a mg and gdbm source
    183189    mggdbmsourceclass *mggdbmsource = new mggdbmsourceclass ();
     
    196202  // add the protocol to the receptionist
    197203  recpt.add_protocol (&nproto);
    198 
     204 
    199205  // add other converters
    200206  utf8inconvertclass utf8inconvert;
     
    202208  recpt.add_converter ("u", &utf8inconvert, &utf8outconvert);
    203209
    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  }
    209217
    210218  // the list of actions. Note: these actions will become invalid
Note: See TracChangeset for help on using the changeset viewer.