Changeset 2286 for trunk/gsdl/src/w32server/locate.cpp
- Timestamp:
- 2001-04-05T17:08:52+12:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/w32server/locate.cpp
r1203 r2286 1 /********************************************************************** 2 * 3 * locate.cpp 4 * Copyright (C) 1996 5 * 6 * A component of the fnord webserver written by [email protected]. 7 * 8 * Altered for use with the Greenstone digital library software by the 9 * New Zealand Digital Library Project at the University of Waikato, 10 * New Zealand. 11 * 12 * This program is free software; you can redistribute it and/or modify 13 * it under the terms of the GNU General Public License as published by 14 * the Free Software Foundation; either version 2 of the License, or 15 * (at your option) any later version. 16 * 17 * This program is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License 23 * along with this program; if not, write to the Free Software 24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 25 * 26 *********************************************************************/ 27 1 28 #include "text_t.h" 2 29 #include <windows.h> … … 14 41 15 42 static int location_found=0; 16 char data_location[MAX_ URL_SIZE];43 char data_location[MAX_FILENAME_SIZE]; 17 44 18 45 void set_location(char *possible) … … 24 51 strcat(data_location,"\\"); 25 52 location_found = 1; 26 53 } 27 54 } 28 55 … … 31 58 char *send; 32 59 if (location_found != 0) return; 33 if (GetModuleFileName(NULL,data_location,MAX_ URL_SIZE) <= 0)60 if (GetModuleFileName(NULL,data_location,MAX_FILENAME_SIZE) <= 0) 34 61 send = data_location; 35 62 else { … … 188 215 fprintf(log_file,"%s",msg); 189 216 fflush(log_file); 190 217 } 191 218 if (gsdl_show_console) { 192 219 char buffer[1024]; HDC dc; … … 195 222 display_text(dc,buffer); 196 223 ReleaseDC(GSDL_Window,dc); 197 224 } 198 225 } 199 226 … … 201 228 { 202 229 if (log_file != NULL) { 203 204 205 206 207 208 209 } 210 230 int len = 0; 231 while (len < n) { 232 fputc (msg[len], log_file); 233 len++; 234 } 235 fflush(log_file); 236 } 237 211 238 // these messages are not send to the console 212 239 if (gsdl_show_console) { … … 215 242 display_text(dc,"message only written to log file\n"); 216 243 ReleaseDC(GSDL_Window,dc); 217 244 } 218 245 } 219 246 220 247 void LogCriticalError(char *cderr, char *Msg) 221 248 { 222 223 224 225 226 227 228 229 230 231 249 char MsgBoxStr[200]; 250 251 strcpy(MsgBoxStr, "Critical Error Number "); 252 strcat(MsgBoxStr, cderr); 253 strcat(MsgBoxStr, "\n"); 254 strcat(MsgBoxStr, Msg); 255 strcat(MsgBoxStr, "\nGreenstone Digital Library software\nshutting down"); 256 MessageBox(GSDL_Window, MsgBoxStr, "Greenstone Digital Library Software", 257 MB_OK | MB_ICONERROR); 258 PostMessage(GSDL_Window, WM_DESTROY, 0, 0); 232 259 } 233 260 … … 236 263 DWORD DiffTickCounts (DWORD first, DWORD second) 237 264 { 238 239 240 } 265 if (second >= first) return (second-first); 266 return (MAXDWORD-first+1+second); 267 }
Note:
See TracChangeset
for help on using the changeset viewer.