Brought back PDC_sysname(), in a new form. This eliminates the last

platform ifdefs from curspriv.h -- the only ones remaining are in
curses.h.
This commit is contained in:
William McBrine
2006-09-25 06:34:41 +00:00
parent e600bdf4c3
commit ca27a996b0
6 changed files with 29 additions and 25 deletions

View File

@@ -15,7 +15,7 @@
* See the file maintain.er for details of the current maintainer. *
************************************************************************/
/* $Id: curspriv.h,v 1.120 2006/09/24 21:22:32 wmcbrine Exp $ */
/* $Id: curspriv.h,v 1.121 2006/09/25 06:34:41 wmcbrine Exp $ */
/* CURSPRIV.H
@@ -79,6 +79,7 @@ void PDC_set_keyboard_binary(bool);
void PDC_sync(WINDOW *);
void PDC_transform_line(int, int, int, const chtype *);
int PDC_validchar(int);
const char *PDC_sysname(void);
#ifdef PDCDEBUG
void PDC_debug(const char *, ...);
@@ -103,20 +104,6 @@ void PDC_debug(const char *, ...);
#define chtype_attr(ch) (pdc_atrtab[(chtype)(ch) >> PDC_ATTR_SHIFT])
#define MAX_ATRTAB (PDC_COLOR_PAIRS * PDC_OFFSET)
#ifdef DOS
# define PDC_SYSNAME "DOS"
#else
# ifdef OS2
# define PDC_SYSNAME "OS/2"
# else
# ifdef WIN32
# define PDC_SYSNAME "Win32"
# else
# define PDC_SYSNAME "X11"
# endif
# endif
#endif
#ifndef max
# define max(a,b) (((a) > (b)) ? (a) : (b))
#endif

View File

@@ -23,7 +23,7 @@
#include <time.h>
RCSID("$Id: pdcutil.c,v 1.10 2006/09/21 16:09:34 wmcbrine Exp $");
RCSID("$Id: pdcutil.c,v 1.11 2006/09/25 06:34:41 wmcbrine Exp $");
void PDC_beep(void)
{
@@ -65,3 +65,8 @@ void PDC_napms(int ms)
# endif
#endif
}
const char *PDC_sysname(void)
{
return "DOS";
}

View File

@@ -31,7 +31,7 @@
APIRET APIENTRY DosSleep(ULONG ulTime);
#endif
RCSID("$Id: pdcutil.c,v 1.5 2006/08/13 05:36:53 wmcbrine Exp $");
RCSID("$Id: pdcutil.c,v 1.6 2006/09/25 06:34:41 wmcbrine Exp $");
void PDC_beep(void)
{
@@ -54,3 +54,8 @@ void PDC_napms(int ms)
DosSleep(ms);
#endif
}
const char *PDC_sysname(void)
{
return "OS/2";
}

View File

@@ -20,7 +20,7 @@
#include <string.h>
#include <limits.h>
RCSID("$Id: termattr.c,v 1.38 2006/08/20 21:48:36 wmcbrine Exp $");
RCSID("$Id: termattr.c,v 1.39 2006/09/25 06:34:41 wmcbrine Exp $");
/*man-start**************************************************************
@@ -143,14 +143,11 @@ char killchar(void)
char *longname(void)
{
static char _display[128];
char *p = _display;
PDC_LOG(("longname() - called\n"));
p += sprintf(_display, "PDCurses for " PDC_SYSNAME);
sprintf(p, " %s-%dx%d", SP->mono ? "MONO" : "COLOR",
LINES, COLS);
sprintf(_display, "PDCurses for %s %s-%dx%d", PDC_sysname(),
SP->mono ? "MONO" : "COLOR", LINES, COLS);
return _display;
}

View File

@@ -24,7 +24,7 @@
#define CURSES_LIBRARY 1
#include <curses.h>
RCSID("$Id: pdcutil.c,v 1.6 2006/08/10 08:43:36 wmcbrine Exp $");
RCSID("$Id: pdcutil.c,v 1.7 2006/09/25 06:34:41 wmcbrine Exp $");
void PDC_beep(void)
{
@@ -40,3 +40,8 @@ void PDC_napms(int ms)
Sleep(ms);
}
const char *PDC_sysname(void)
{
return "Win32";
}

View File

@@ -21,7 +21,7 @@
# include <poll.h>
#endif
RCSID("$Id: pdcutil.c,v 1.4 2006/07/15 15:13:40 wmcbrine Exp $");
RCSID("$Id: pdcutil.c,v 1.5 2006/09/25 06:34:41 wmcbrine Exp $");
void PDC_beep(void)
{
@@ -47,3 +47,8 @@ void PDC_napms(int ms)
}
#endif
}
const char *PDC_sysname(void)
{
return "X11";
}