Added OS and CPU nameing functions

This commit is contained in:
Michiel Broek
2002-02-10 15:57:05 +00:00
parent 4f76ee06db
commit 054987b525
21 changed files with 79 additions and 98 deletions

View File

@@ -538,6 +538,9 @@ char *GetLocalHMS(void);
char *StrDateMDY(time_t *);
char *StrDateDMY(time_t);
char *GetDateDMY(void);
char *OsName(void);
char *OsCPU(void);
char *TearLine(void);

View File

@@ -35,6 +35,7 @@
#define Max_passlen 14 /* Define maximum passwd length */
/*****************************************************************************
*
* Global typedefs.

View File

@@ -334,3 +334,48 @@ char *GetDateDMY()
}
char *OsName()
{
#ifdef __linux__
return (char *)"Linux";
#elif __FreeBSD__
return (char *)"FreeBSD";
#elif __NetBSD__
return (char *)"NetBSD";
#else
return (char *)"Unknown";
#endif
}
char *OsCPU()
{
#ifdef __i386__
return (char *)"i386";
#elif __PPC__
return (char *)"PPC";
#elif __sparc__
return (char *)"Sparc";
#elif __alpha__
return (char *)"Alpha";
#else
return (char *)"Unknown";
#endif
}
/*
* Return universal tearline, note if OS and CPU are
* unknow, the tearline is already 39 characters.
*/
char *TearLine()
{
static char tearline[41];
sprintf(tearline, "--- MBSE BBS v%s (%s-%s)", VERSION, OsName(), OsCPU());
return tearline;
}