2 * $Header: /cvsroot/pgpool/pgpool-II/pcp/pcp.h,v 1.4 2008/12/31 10:25:40 t-ishii Exp $
4 * pgpool: a language independent connection pool server for PostgreSQL
5 * written by Tatsuo Ishii
7 * Copyright (c) 2003-2008 PgPool Global Development Group
9 * Permission to use, copy, modify, and distribute this software and
10 * its documentation for any purpose and without fee is hereby
11 * granted, provided that the above copyright notice appear in all
12 * copies and that both that copyright notice and this permission
13 * notice appear in supporting documentation, and that the name of the
14 * author not be used in advertising or publicity pertaining to
15 * distribution of the software without specific, written prior
16 * permission. The author makes no representations about the
17 * suitability of this software for any purpose. It is provided "as
18 * is" without express or implied warranty.
21 * pcp.h - master header file.
27 #include "pool_type.h"
29 #define MAX_USER_PASSWD_LEN 128
32 UNKNOWNERR = 1, /* shouldn't happen */
33 EOFERR, /* EOF read by read() */
34 NOMEMERR, /* could not allocate memory */
35 READERR, /* read() error */
36 WRITEERR, /* flush() error */
37 TIMEOUTERR, /* select() timeout */
38 INVALERR, /* invalid command-line argument(s) number, length, range, etc. */
39 CONNERR, /* thrown by connect() */
40 NOCONNERR, /* not connected to server */
41 SOCKERR, /* thrown by socket() or setsockopt() */
42 HOSTERR, /* thrown by gethostbyname() */
43 BACKENDERR, /* server dependent error */
44 AUTHERR /* authorization faiure */
47 /* --------------------------------
49 * --------------------------------
51 extern struct timeval pcp_timeout;
52 extern int pcp_connect(char *hostname, int port, char *username, char *password);
53 extern void pcp_disconnect(void);
54 extern int pcp_terminate_pgpool(char mode);
55 extern int pcp_node_count(void);
56 extern BackendInfo *pcp_node_info(int nid);
57 extern int *pcp_process_count(int *process_count);
58 extern ProcessInfo *pcp_process_info(int pid, int *array_size);
59 extern SystemDBInfo *pcp_systemdb_info(void);
60 extern void free_systemdb_info(SystemDBInfo * si);
61 extern int pcp_detach_node(int nid);
62 extern int pcp_attach_node(int nid);
63 extern void pcp_set_timeout(long sec);
64 extern int pcp_recovery_node(int nid);
65 extern void pcp_enable_debug(void);
66 extern void pcp_disable_debug(void);
68 /* ------------------------------
70 * ------------------------------
72 extern ErrorCode errorcode;
73 extern void pcp_errorstr(ErrorCode e);