Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenver.c
Go to the documentation of this file.
00001 /* 00002 * VER.C - ver internal command. 00003 * 00004 * 00005 * History: 00006 * 00007 * 06/30/98 (Rob Lake) 00008 * rewrote ver command to accept switches, now ver alone prints 00009 * copyright notice only. 00010 * 00011 * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>) 00012 * added config.h include 00013 * 00014 * 30-Jul-1998 (John P Price <linux-guru@gcfl.net>) 00015 * added text about where to send bug reports and get updates. 00016 * 00017 * 20-Jan-1999 (Eric Kohl) 00018 * Unicode and redirection safe! 00019 * 00020 * 26-Feb-1999 (Eric Kohl) 00021 * New version info and some output changes. 00022 */ 00023 00024 #include <precomp.h> 00025 #include <reactos/buildno.h> 00026 #include <reactos/version.h> 00027 00028 VOID ShortVersion (VOID) 00029 { 00030 OSVERSIONINFO VersionInfo; 00031 00032 ConOutResPrintf(STRING_CMD_SHELLINFO, _T(KERNEL_RELEASE_STR), _T(KERNEL_VERSION_BUILD_STR)); 00033 VersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); 00034 00035 memset(VersionInfo.szCSDVersion, 0, sizeof(VersionInfo.szCSDVersion)); 00036 if (GetVersionEx(&VersionInfo)) 00037 { 00038 LPTSTR RosVersion; 00039 SIZE_T RosVersionLen; 00040 00041 RosVersion = VersionInfo.szCSDVersion + _tcslen(VersionInfo.szCSDVersion) + 1; 00042 RosVersionLen = sizeof(VersionInfo.szCSDVersion) / sizeof(VersionInfo.szCSDVersion[0]) - 00043 (RosVersion - VersionInfo.szCSDVersion); 00044 if (7 <= RosVersionLen && 0 == _tcsnicmp(RosVersion, _T("ReactOS"), 7)) 00045 { 00046 ConOutResPrintf(STRING_VERSION_RUNVER, RosVersion); 00047 } 00048 } 00049 ConOutPuts (_T("\n")); 00050 } 00051 00052 00053 #ifdef INCLUDE_CMD_VER 00054 00055 /* 00056 * display shell version info internal command. 00057 * 00058 * 00059 */ 00060 INT cmd_ver (LPTSTR param) 00061 { 00062 INT i; 00063 00064 nErrorLevel = 0; 00065 00066 if (_tcsstr (param, _T("/?")) != NULL) 00067 { 00068 ConOutResPaging(TRUE,STRING_VERSION_HELP1); 00069 return 0; 00070 } 00071 00072 ShortVersion(); 00073 00074 /* Basic copyright notice */ 00075 if (param[0] != _T('\0')) 00076 { 00077 00078 ConOutPuts (_T("Copyright (C) 1994-1998 Tim Norman and others.")); 00079 ConOutPuts (_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR) _T(" ReactOS Team")); 00080 00081 for (i = 0; param[i]; i++) 00082 { 00083 /* skip spaces */ 00084 if (param[i] == _T(' ')) 00085 continue; 00086 00087 if (param[i] == _T('/')) 00088 { 00089 /* is this a lone '/' ? */ 00090 if (param[i + 1] == 0) 00091 { 00092 error_invalid_switch (_T(' ')); 00093 return 1; 00094 } 00095 continue; 00096 } 00097 00098 if (_totupper (param[i]) == _T('W')) 00099 { 00100 /* Warranty notice */ 00101 ConOutResPuts(STRING_VERSION_HELP3); 00102 } 00103 else if (_totupper (param[i]) == _T('R')) 00104 { 00105 /* Redistribution notice */ 00106 ConOutResPuts(STRING_VERSION_HELP4); 00107 } 00108 else if (_totupper (param[i]) == _T('C')) 00109 { 00110 /* Developer listing */ 00111 ConOutResPuts(STRING_VERSION_HELP6); 00112 ConOutResPuts(STRING_FREEDOS_DEV); 00113 ConOutResPuts(STRING_VERSION_HELP7); 00114 ConOutResPuts(STRING_REACTOS_DEV); 00115 } 00116 else 00117 { 00118 error_invalid_switch ((TCHAR)_totupper (param[i])); 00119 return 1; 00120 } 00121 } 00122 ConOutResPuts(STRING_VERSION_HELP5); 00123 } 00124 return 0; 00125 } 00126 00127 #endif Generated on Sat May 26 2012 04:17:10 for ReactOS by
1.7.6.1
|