|
|
1.1 ! root 1: /* ver.cpp */ ! 2: ! 3: /* Synchronet version display */ ! 4: ! 5: /* $Id: ver.cpp,v 1.9 2000/12/15 17:39:01 rswindell Exp $ */ ! 6: ! 7: /**************************************************************************** ! 8: * @format.tab-size 4 (Plain Text/Source Code File Header) * ! 9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * ! 10: * * ! 11: * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * ! 12: * * ! 13: * This program is free software; you can redistribute it and/or * ! 14: * modify it under the terms of the GNU General Public License * ! 15: * as published by the Free Software Foundation; either version 2 * ! 16: * of the License, or (at your option) any later version. * ! 17: * See the GNU General Public License for more details: gpl.txt or * ! 18: * http://www.fsf.org/copyleft/gpl.html * ! 19: * * ! 20: * Anonymous FTP access to the most recent released source is available at * ! 21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * ! 22: * * ! 23: * Anonymous CVS access to the development source and modification history * ! 24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * ! 25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * ! 26: * (just hit return, no password is necessary) * ! 27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * ! 28: * * ! 29: * For Synchronet coding style and modification guidelines, see * ! 30: * http://www.synchro.net/source.html * ! 31: * * ! 32: * You are encouraged to submit any modifications (preferably in Unix diff * ! 33: * format) via e-mail to [email protected] * ! 34: * * ! 35: * Note: If this box doesn't appear square, then you need to fix your tabs. * ! 36: ****************************************************************************/ ! 37: ! 38: #include "sbbs.h" ! 39: ! 40: #define BETA " " /* Space if non-beta, " beta" otherwise */ ! 41: ! 42: #if defined(_WINSOCKAPI_) ! 43: extern WSADATA WSAData; ! 44: #endif ! 45: ! 46: #if defined(__unix__) ! 47: #include <sys/utsname.h> /* uname() */ ! 48: #endif ! 49: ! 50: void sbbs_t::ver() ! 51: { ! 52: char str[128],compiler[32]; ! 53: ! 54: CRLF; ! 55: strcpy(str,VERSION_NOTICE); ! 56: #if defined(_DEBUG) ! 57: strcat(str,"Debug"); ! 58: #endif ! 59: center(str); ! 60: CRLF; ! 61: ! 62: COMPILER_DESC(compiler); ! 63: ! 64: sprintf(str,"Revision %c%s %s %.5s " ! 65: "SMBLIB %s %s" ! 66: ,REVISION,BETA,__DATE__,__TIME__ ! 67: ,smb_lib_ver(),compiler); ! 68: ! 69: center(str); ! 70: CRLF; ! 71: ! 72: sprintf(str,"%s - http://www.synchro.net", COPYRIGHT_NOTICE); ! 73: center(str); ! 74: CRLF; ! 75: ! 76: #if defined(_WINSOCKAPI_) ! 77: ! 78: center(WSAData.szDescription); ! 79: CRLF; ! 80: ! 81: #endif ! 82: ! 83: #if defined(__OS2__) && defined(__BORLANDC__) ! 84: ! 85: sprintf(str,"OS/2 %u.%u (%u.%u)",_osmajor/10,_osminor/10,_osmajor,_osminor); ! 86: ! 87: #elif defined(_WIN32) ! 88: ! 89: /* Windows Version */ ! 90: char* winflavor=nulstr; ! 91: OSVERSIONINFO winver; ! 92: ! 93: winver.dwOSVersionInfoSize=sizeof(winver); ! 94: GetVersionEx(&winver); ! 95: ! 96: switch(winver.dwPlatformId) { ! 97: case VER_PLATFORM_WIN32_NT: ! 98: winflavor="NT "; ! 99: break; ! 100: case VER_PLATFORM_WIN32s: ! 101: winflavor="Win32s "; ! 102: break; ! 103: case VER_PLATFORM_WIN32_WINDOWS: ! 104: winver.dwBuildNumber&=0xffff; ! 105: break; ! 106: } ! 107: ! 108: sprintf(str,"Windows %sVersion %u.%02u (Build %u) %s" ! 109: ,winflavor ! 110: ,winver.dwMajorVersion, winver.dwMinorVersion ! 111: ,winver.dwBuildNumber,winver.szCSDVersion); ! 112: ! 113: #elif defined(__unix__) ! 114: ! 115: struct utsname unixver; ! 116: ! 117: if(uname(&unixver)!=0) ! 118: sprintf(str,"Unix (uname errno: %d)",errno); ! 119: else ! 120: sprintf(str,"%s %s %s" ! 121: ,unixver.sysname /* e.g. "Linux" */ ! 122: ,unixver.release /* e.g. "2.2.14-5.0" */ ! 123: ,unixver.machine /* e.g. "i586" */ ! 124: ); ! 125: ! 126: #else /* DOS && __BORLANDC__*/ ! 127: ! 128: sprintf(str,"DOS %u.%02u",_osmajor,_osminor); ! 129: ! 130: #endif ! 131: ! 132: center(str); ! 133: } ! 134:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.