/[svn]/ircd-hybrid/libio/misc/misc.c
ViewVC logotype

Diff of /ircd-hybrid/libio/misc/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 655 by michael, Fri Jun 9 13:30:21 2006 UTC revision 656 by michael, Fri Jun 9 13:51:25 2006 UTC
# Line 139  uname(struct utsname *uts) Line 139  uname(struct utsname *uts)
139    
140    memset(uts, 0, sizeof(*uts));    memset(uts, 0, sizeof(*uts));
141    
142    osver.dwOSVersionInfoSize = sizeof (osver);    osver.dwOSVersionInfoSize = sizeof(osver);
143    GetVersionEx (&osver);    GetVersionEx(&osver);
144    GetSystemInfo (&sysinfo);    GetSystemInfo(&sysinfo);
145    
146    switch (osver.dwPlatformId)    switch (osver.dwPlatformId)
147      {    {
148      case VER_PLATFORM_WIN32_NT: /* NT, Windows 2000 or Windows XP */      case VER_PLATFORM_WIN32_NT: /* NT, Windows 2000 or Windows XP */
149        if (osver.dwMajorVersion == 4)        if (osver.dwMajorVersion == 4)
150          strcpy (uts->sysname, "Windows NT4x"); /* NT4x */          strcpy (uts->sysname, "Windows NT4x");    /* NT4x */
151        else if (osver.dwMajorVersion <= 3)        else if (osver.dwMajorVersion <= 3)
152          strcpy (uts->sysname, "Windows NT3x"); /* NT3x */          strcpy (uts->sysname, "Windows NT3x");    /* NT3x */
153        else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion  < 1)        else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion  < 1)
154          strcpy (uts->sysname, "Windows 2000"); /* 2k */          strcpy (uts->sysname, "Windows 2000");    /* 2k */
155        else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion == 2)        else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion == 2)
156          strcpy (uts->sysname, "Windows 2003"); /* 2003 */          strcpy (uts->sysname, "Windows 2003");    /* 2003 */
157        else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion == 1)        else if (osver.dwMajorVersion == 5 && osver.dwMinorVersion == 1)
158          strcpy (uts->sysname, "Windows XP");   /* XP */          strcpy (uts->sysname, "Windows XP");      /* XP */
159          else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 0)
160            strcpy (uts->sysname, "Windows Vista");   /* Vista */
161        os = WinNT;        os = WinNT;
162        break;        break;
163    
164      case VER_PLATFORM_WIN32_WINDOWS: /* Win95, Win98 or WinME */      case VER_PLATFORM_WIN32_WINDOWS: /* Win95, Win98 or WinME */
165        if ((osver.dwMajorVersion > 4) ||        if ((osver.dwMajorVersion > 4) ||
166            ((osver.dwMajorVersion == 4) && (osver.dwMinorVersion > 0)))            ((osver.dwMajorVersion == 4) && (osver.dwMinorVersion > 0)))
167          {        {
168            if (osver.dwMinorVersion >= 90)          if (osver.dwMinorVersion >= 90)
169              strcpy (uts->sysname, "Windows ME"); /* ME */            strcpy (uts->sysname, "Windows ME"); /* ME */
170            else          else
171              strcpy (uts->sysname, "Windows 98"); /* 98 */            strcpy (uts->sysname, "Windows 98"); /* 98 */
172            os = Win98;          os = Win98;
173          }        }
174        else        else
175          {        {
176            strcpy (uts->sysname, "Windows 95"); /* 95 */          strcpy (uts->sysname, "Windows 95"); /* 95 */
177            os = Win95;          os = Win95;
178          }        }
179        break;        break;
180    
181      case VER_PLATFORM_WIN32s: /* Windows 3.x */      case VER_PLATFORM_WIN32s: /* Windows 3.x */
182        strcpy (uts->sysname, "Windows");        strcpy (uts->sysname, "Windows");
183        break;        break;
184      }    }
185    
186    sprintf (uts->version, "%ld.%02ld",    sprintf(uts->version, "%ld.%02ld",
187             osver.dwMajorVersion, osver.dwMinorVersion);            osver.dwMajorVersion, osver.dwMinorVersion);
188    
189    if (osver.szCSDVersion[0] != '\0' &&    if (osver.szCSDVersion[0] != '\0' &&
190        (strlen (osver.szCSDVersion) + strlen (uts->version) + 1) <        (strlen (osver.szCSDVersion) + strlen (uts->version) + 1) <
# Line 211  uname(struct utsname *uts) Line 213  uname(struct utsname *uts)
213         * wProcessorLevel is only valid in WinNT         * wProcessorLevel is only valid in WinNT
214         */         */
215        switch (os)        switch (os)
216          {        {
217          case Win95:          case Win95:
218          case Win98:          case Win98:
219            switch (sysinfo.dwProcessorType)            switch (sysinfo.dwProcessorType)
220              {            {
221              case PROCESSOR_INTEL_386:              case PROCESSOR_INTEL_386:
222              case PROCESSOR_INTEL_486:              case PROCESSOR_INTEL_486:
223              case PROCESSOR_INTEL_PENTIUM:              case PROCESSOR_INTEL_PENTIUM:
224                sprintf (uts->machine, "i%ld", sysinfo.dwProcessorType);                sprintf(uts->machine, "i%ld", sysinfo.dwProcessorType);
225                break;                break;
226              default:              default:
227                strcpy (uts->machine, "i386");                strcpy(uts->machine, "i386");
228                break;                break;
229            }            }
230            break;            break;
# Line 246  uname(struct utsname *uts) Line 248  uname(struct utsname *uts)
248              }              }
249            break;            break;
250          default:          default:
251            strcpy (uts->machine, "unknown");            strcpy(uts->machine, "unknown");
252        }        }
253        break;        break;
254      default:      default:
# Line 254  uname(struct utsname *uts) Line 256  uname(struct utsname *uts)
256        break;        break;
257    }    }
258    
259    sLength = sizeof (uts->nodename) - 1;    sLength = sizeof(uts->nodename) - 1;
260    GetComputerName (uts->nodename, &sLength);    GetComputerName(uts->nodename, &sLength);
261    return 0;    return 0;
262  }  }
263  #endif  #endif
264    
   
265  #ifdef HAVE_LIBCRYPTO  #ifdef HAVE_LIBCRYPTO
266  char *  char *
267  ssl_get_cipher(SSL *ssl)  ssl_get_cipher(SSL *ssl)

Legend:
Removed from v.655  
changed lines
  Added in v.656

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28