diff options
| author | Peter Eisentraut | 2000-06-04 01:44:38 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2000-06-04 01:44:38 +0000 |
| commit | 209aa77d98d8d44b329e942e6f15aec1284db2ca (patch) | |
| tree | d68949ba2f6d558aae721aca8bfd35de4cfdb387 /src/include | |
| parent | 2ea370a3ceea5f3a30df709dea08c41c1f19e486 (diff) | |
New ps display code, works on more platforms.
Install a default configuration file.
Clean up some funny business in the config file code.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/config.h.in | 17 | ||||
| -rw-r--r-- | src/include/libpq/libpq.h | 4 | ||||
| -rw-r--r-- | src/include/utils/ps_status.h | 102 |
3 files changed, 28 insertions, 95 deletions
diff --git a/src/include/config.h.in b/src/include/config.h.in index e881485b5a..76390c3c97 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -8,7 +8,7 @@ * or in config.h afterwards. Of course, if you edit config.h, then your * changes will be overwritten the next time you run configure. * - * $Id: config.h.in,v 1.114 2000/05/31 00:28:36 petere Exp $ + * $Id: config.h.in,v 1.115 2000/06/04 01:44:36 petere Exp $ */ #ifndef CONFIG_H @@ -276,6 +276,15 @@ /* Set to 1 if you have <values.h> */ #undef HAVE_VALUES_H +/* Set to 1 if you have <sys/exec.h> */ +#undef HAVE_SYS_EXEC_H + +/* Set to 1 if you have <sys/pstat.h> */ +#undef HAVE_SYS_PSTAT_H + +/* Set to 1 if you have <machine/vmparam.h> */ +#undef HAVE_MACHINE_VMPARAM_H + /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -285,6 +294,12 @@ /* Define if you have the setproctitle function. */ #undef HAVE_SETPROCTITLE +/* Define if you have the pstat function. */ +#undef HAVE_PSTAT + +/* Define if the PS_STRINGS thing exists. */ +#undef HAVE_PS_STRINGS + /* Define if you have the stricmp function. */ #undef HAVE_STRICMP diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index bb935d4251..22df644905 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: libpq.h,v 1.36 2000/04/12 17:16:36 momjian Exp $ + * $Id: libpq.h,v 1.37 2000/06/04 01:44:37 petere Exp $ * *------------------------------------------------------------------------- */ @@ -236,7 +236,7 @@ extern int32 pqtest(struct varlena * vlena); /* * prototypes for functions in pqcomm.c */ -extern int StreamServerPort(char *hostName, unsigned short portName, int *fdP); +extern int StreamServerPort(int family, unsigned short portName, int *fdP); extern int StreamConnection(int server_fd, Port *port); extern void StreamClose(int sock); extern void pq_init(void); diff --git a/src/include/utils/ps_status.h b/src/include/utils/ps_status.h index 31e98f6ce3..90f088ea2d 100644 --- a/src/include/utils/ps_status.h +++ b/src/include/utils/ps_status.h @@ -2,8 +2,7 @@ * * ps_status.h * - * Defines macros to show backend status on the ps status line. - * Unfortunately this is system dpendent. + * Declarations for backend/utils/misc/ps_status.c * *------------------------------------------------------------------------- */ @@ -11,98 +10,17 @@ #ifndef PS_STATUS_H #define PS_STATUS_H -#ifdef HAVE_SETPROCTITLE +#include "libpq/libpq-be.h" -extern char Ps_status_buffer[]; +void +init_ps_display(int argc, char *argv[], + const char * username, const char * dbname, + const char * host_info); -#undef PS_DEFINE_BUFFER +void +set_ps_display(const char * value); -#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \ - do { \ - sprintf(Ps_status_buffer, "%s %s %s %s", execname, hostname, username, dbname); \ - setproctitle("%s", Ps_status_buffer); \ - } while (0) - -#define PS_CLEAR_STATUS() \ - do { setproctitle("%s", Ps_status_buffer); } while (0) - -#define PS_SET_STATUS(status) \ - do { setproctitle("%s %s", Ps_status_buffer, (status)); } while (0) - -#define PS_STATUS (Ps_status_buffer) - -#elif defined(linux) - -#include <string.h> - -extern char *ps_status_buffer; - -#define PS_DEFINE_BUFFER \ -char *ps_status_buffer = NULL - -#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \ - do { \ - int i; \ - for (i = 0; i < (argc); i++) { \ - memset((argv)[i], 0, strlen((argv)[i])); \ - } \ - ps_status_buffer = (argv)[0]; \ - sprintf(ps_status_buffer, "%s %s %s %s ", execname, username, hostname, dbname); \ - ps_status_buffer += strlen(ps_status_buffer); \ - ps_status_buffer[0] = '\0'; \ - } while (0) - -#define PS_CLEAR_STATUS() \ - do { \ - if (ps_status_buffer) \ - memset(ps_status_buffer, 0, strlen(ps_status_buffer)); \ - } while (0) - -#define PS_SET_STATUS(status) \ - do { \ - if (ps_status_buffer) \ - { \ - PS_CLEAR_STATUS(); \ - strcpy(ps_status_buffer, status); \ - } \ - } while (0) - -#define PS_STATUS (ps_status_buffer ? ps_status_buffer : "") - -#else /* !linux */ - -extern char Ps_status_buffer[]; - -#undef PS_DEFINE_BUFFER - -#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \ - do { \ - int i; \ - Assert(argc >= 5); \ - argv[0] = execname; \ - argv[1] = hostname; \ - argv[2] = username; \ - argv[3] = dbname; \ - argv[4] = Ps_status_buffer; \ - for (i = 5; i < argc; i++) \ - argv[i] = ""; /* blank them */ \ - } while (0) - -#define PS_CLEAR_STATUS() \ - do { Ps_status_buffer[0] = '\0'; } while (0) - -#define PS_SET_STATUS(status) \ - do { strcpy(Ps_status_buffer, (status)); } while (0) - -#define PS_STATUS (Ps_status_buffer) -#endif - -#ifdef NO_PS_STATUS -#undef PS_DEFINE_BUFFER -#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) -#define PS_CLEAR_STATUS() -#define PS_SET_STATUS(status) do { if ((status)); } while (0) -#define PS_STATUS "" -#endif /* !linux */ +const char * +get_ps_display(void); #endif /* PS_STATUS_H */ |
