Changeset 1203


Ignore:
Timestamp:
2000-06-12T14:49:06+12:00 (24 years ago)
Author:
sjboddie
Message:

Made a few minor changes to get the local library compiling under VC++ 6.0
using the built-in STL (i.e. without the GSDL_USE_IOS_H pre-processor
definition set).

Location:
trunk/gsdl/src/w32server
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/w32server/cgiwrapper.cpp

    r1193 r1203  
     1#include "text_t.h"
     2
    13#include <windows.h>
    24#include <string.h>
     
    7779  RequestInfoT *RInfo;
    7880  ostream *casostr;
     81#if !defined (GSDL_USE_IOS_H)
     82  char buffer[256];
     83#endif
    7984};
    8085
    8186textstreambuf::textstreambuf() {
    8287  tsbreset();
     88#if !defined (GSDL_USE_IOS_H)
     89  setp (&buffer[0], &buffer[255]);
     90#else
    8391  if (base() == ebuf()) allocate();
    8492  setp (base(), ebuf());
     93#endif
    8594};
    8695
    8796int textstreambuf::sync () {
    8897  if ((RInfo != NULL) &&
    89       (Send_String_N(pbase(), out_waiting(), RInfo) < 0)) {
     98      (Send_String_N(pbase(), pptr()-pbase(), RInfo) < 0)) {
    9099    RInfo = NULL;
    91100  }
     
    93102  if (casostr != NULL) {
    94103    char *thepbase=pbase();
    95         for (int i=0;i<out_waiting();i++) (*casostr).put(thepbase[i]);
     104    for (int i=0;i<(pptr()-pbase());i++) (*casostr).put(thepbase[i]);
    96105  }
    97106 
     
    117126  int overflow (int ch);
    118127  int underflow () {return EOF;}
     128
     129#if !defined (GSDL_USE_IOS_H)
     130private:
     131  char buffer[256];
     132#endif
    119133};
    120134
    121135logstreambuf::logstreambuf () {
     136#if !defined (GSDL_USE_IOS_H)
     137  setp (&buffer[0], &buffer[255]);
     138#else
    122139  if (base() == ebuf()) allocate();
    123140  setp (base(), ebuf());
     141#endif
    124142}
    125143
     
    127145  if (gsdl_keep_log || gsdl_show_console) {
    128146    log_message ("LOCAL LIB MESSAGE: ");
    129         log_message_N (pbase(), out_waiting());
     147        log_message_N (pbase(), pptr()-pbase());
    130148  }
    131149
     
    304322// returns 1 if successful, 0 if unsuccessful
    305323int gsdl_init () {
    306   cerr = &logstream;
    307   cout = &textstream;
     324  cerr.rdbuf(&logstream);
     325  cout.rdbuf(&textstream);
    308326
    309327  // collection should be set to "" unless in
  • trunk/gsdl/src/w32server/fnord.cpp

    r1156 r1203  
    1818The author can be contacted via Email at [email protected]
    1919*/
     20#include "text_t.h"
    2021#include <windows.h>
    2122#include <stdlib.h>
     
    165166  if (coltitledc == NULL) {
    166167    coltitledc = CreateCompatibleDC(pdc);
    167     defcoltitlebitmap = SelectObject (coltitledc, coltitlebitmap);
     168    defcoltitlebitmap = (HBITMAP)SelectObject (coltitledc, coltitlebitmap);
    168169  }
    169170 
    170171  if (logodc == NULL) {
    171172    logodc = CreateCompatibleDC(pdc);
    172     deflogobitmap = SelectObject (logodc, logobitmap);
     173    deflogobitmap = (HBITMAP)SelectObject (logodc, logobitmap);
    173174  }
    174175 
     
    219220      statusRect.right = STATUSX+STATUSWIDTH;
    220221      statusRect.bottom = STATUSY+STATUSHEIGHT;
    221       FillRect(pdc, &statusRect, GetStockObject(WHITE_BRUSH));
     222      FillRect(pdc, &statusRect, (HBRUSH)GetStockObject(WHITE_BRUSH));
    222223     
    223224      int cury = STATUSY;
     
    259260    infoRect.right = INFOX+INFOWIDTH;
    260261    infoRect.bottom = INFOY+INFOHEIGHT;
    261     FillRect(pdc, &infoRect, GetStockObject(WHITE_BRUSH));
     262    FillRect(pdc, &infoRect, (HBRUSH)GetStockObject(WHITE_BRUSH));
    262263    DrawText(pdc, infostring, -1, &infoRect, DT_CENTER);
    263264  }
     
    558559    // finally, get the host name (no error value
    559560    // is returned from this function)
    560     GetLocalName(Instance);
     561    GetLocalName((HINSTANCE)Instance);
    561562   
    562563      } else {
     
    596597  startbrowserdir[0] = '\0';
    597598  netscapeneeded = 0;
    598   int err = tryinitnetwork (Instance, MsgWindow, NULL);
    599   //int err = 1;
     599  //  int err = tryinitnetwork (Instance, MsgWindow, NULL);
     600  int err = 1;
    600601 
    601602  // if an error occurred, try again with billsock
     
    802803
    803804
    804 int __stdcall WinMain(HANDLE Instance, HANDLE /*PrevInstance*/, LPSTR CmdLineStr, int /*CmdShow*/) {
     805int __stdcall WinMain(HINSTANCE Instance, HINSTANCE /*PrevInstance*/, LPSTR CmdLineStr, int /*CmdShow*/) {
    805806  HWND MainWindow;  MSG Message;  WNDCLASS MainClass; 
    806807 
     
    813814  MainClass.hIcon     = LoadIcon(Instance, MAKEINTRESOURCE(TRAY_ICON));
    814815  MainClass.hCursor   = LoadCursor(NULL, IDC_ARROW);
    815   MainClass.hbrBackground = GetStockObject(WHITE_BRUSH);
     816  MainClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    816817  MainClass.lpszMenuName = MAKEINTRESOURCE(Main_Menu);
    817818  MainClass.lpszClassName = "Greenstone Digital Library Software";
  • trunk/gsdl/src/w32server/httpreq.cpp

    r611 r1203  
    1818The author can be contacted via Email at [email protected]
    1919*/
     20#include "text_t.h"
    2021#include <windows.h>
    2122#include <stdlib.h>
  • trunk/gsdl/src/w32server/httpsrv.cpp

    r902 r1203  
    1818The author can be contacted via Email at [email protected]
    1919*/
     20#include "text_t.h"
    2021#include <windows.h>
    2122#include <stdlib.h>
     
    2930#include "httpsrv.h"
    3031#include "locate.h"
    31 #include "settings.h"
    3232
    3333//Private Functions
  • trunk/gsdl/src/w32server/locate.cpp

    r1011 r1203  
     1#include "text_t.h"
    12#include <windows.h>
    23#include <stdio.h>
     
    115116  scroll.bottom = text_rect.bottom;
    116117  ScrollDC(dc,0,-nbits,&scroll,&clip,NULL,&update);
    117   FillRect(dc,&update, GetStockObject(WHITE_BRUSH));
     118  FillRect(dc,&update, (HBRUSH)GetStockObject(WHITE_BRUSH));
    118119}
    119120
  • trunk/gsdl/src/w32server/netio.cpp

    r611 r1203  
    103103}
    104104
    105 char *GetLocalName(HANDLE hInstance) {
     105char *GetLocalName(HINSTANCE hInstance) {
    106106    // static in case it is written to after the function has finished
    107107    // (I did not error checking on WSACancelAsyncRequest)
  • trunk/gsdl/src/w32server/netio.h

    r611 r1203  
    8484Returns: A string containing the local address
    8585*/
    86 char *GetLocalName(HANDLE hInstance);
     86char *GetLocalName(HINSTANCE hInstance);
    8787
    8888// returns 0 on success, and a WSA error message on failure.
  • trunk/gsdl/src/w32server/settings.cpp

    r902 r1203  
     1#include "text_t.h"
     2
    13#if defined(GSDL_USE_OBJECTSPACE)
    24#  include <ospace\std\fstream>
     
    367369  text_t key, value, section;
    368370  char *cstr_value;
     371#if defined (GSDL_USE_IOS_H)
    369372  ifstream conf (conffile, ios::nocreate);
     373#else
     374  ifstream conf (conffile);
     375#endif
    370376  if (conf) {
    371377    while (read_ini_line(conf, key, value) >= 0) {
Note: See TracChangeset for help on using the changeset viewer.