]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - pcp/pcp_stream.h
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / pcp / pcp_stream.h
1 /*
2  * $Header: /cvsroot/pgpool/pgpool-II/pcp/pcp_stream.h,v 1.2 2008/01/29 01:56:38 y-asaba Exp $
3  *
4  * pgpool: a language independent connection pool server for PostgreSQL 
5  * written by Tatsuo Ishii
6  *
7  * Copyright (c) 2003-2008      PgPool Global Development Group
8  *
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.
19  *
20  * pcp_stream.h - master header file.
21  */
22
23 #ifndef PCP_STREAM_H
24 #define PCP_STREAM_H
25
26 #include "pool.h"
27
28 #define READBUFSZ              1024
29 #define WRITEBUFSZ             8192
30
31 typedef struct {
32         int fd;        /* fd for connection */
33
34         char *wbuf;        /* write buffer for the connection */
35         int wbufsz;        /* write buffer size */
36         int wbufpo;        /* buffer offset */
37
38         char *hp;          /* pending data buffer head address */
39         int po;            /* pending data offset */
40         int bufsz;         /* pending data buffer size */
41         int len;           /* pending data length */
42 } PCP_CONNECTION;
43
44 extern PCP_CONNECTION *pcp_open(int fd);
45 extern void pcp_close(PCP_CONNECTION *pc);
46 extern int pcp_read(PCP_CONNECTION *pc, void *buf, int len);
47 extern int pcp_write(PCP_CONNECTION *pc, void *buf, int len);
48 extern int pcp_flush(PCP_CONNECTION *pc);
49
50 #define UNIX_DOMAIN_PATH "/tmp"
51
52 #endif /* PCP_STREAM_H */