Eneboo - Documentación para desarrolladores
|
00001 /*------------------------------------------------------------------------- 00002 * 00003 * libpq.h 00004 * POSTGRES LIBPQ buffer structure definitions. 00005 * 00006 * 00007 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group 00008 * Portions Copyright (c) 1994, Regents of the University of California 00009 * 00010 * $PostgreSQL: pgsql/src/include/libpq/libpq.h,v 1.65 2005/10/15 02:49:44 momjian Exp $ 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 #ifndef LIBPQ_H 00015 #define LIBPQ_H 00016 00017 #include <sys/types.h> 00018 #include <netinet/in.h> 00019 00020 #include "lib/stringinfo.h" 00021 #include "libpq/libpq-be.h" 00022 #include "libpq/ip.h" 00023 00024 /* ---------------- 00025 * PQArgBlock 00026 * Information (pointer to array of this structure) required 00027 * for the PQfn() call. (This probably ought to go somewhere else...) 00028 * ---------------- 00029 */ 00030 typedef struct 00031 { 00032 int len; 00033 int isint; 00034 union 00035 { 00036 int *ptr; /* can't use void (dec compiler barfs) */ 00037 int integer; 00038 } u; 00039 } PQArgBlock; 00040 00041 /* 00042 * External functions. 00043 */ 00044 00045 /* 00046 * prototypes for functions in pqcomm.c 00047 */ 00048 extern int StreamServerPort(int family, char *hostName, 00049 unsigned short portNumber, char *unixSocketName, int ListenSocket[], 00050 int MaxListen); 00051 extern int StreamConnection(int server_fd, Port *port); 00052 extern void StreamClose(int sock); 00053 extern void TouchSocketFile(void); 00054 extern void pq_init(void); 00055 extern void pq_comm_reset(void); 00056 extern int pq_getbytes(char *s, size_t len); 00057 extern int pq_getstring(StringInfo s); 00058 extern int pq_getmessage(StringInfo s, int maxlen); 00059 extern int pq_getbyte(void); 00060 extern int pq_peekbyte(void); 00061 extern int pq_putbytes(const char *s, size_t len); 00062 extern int pq_flush(void); 00063 extern int pq_putmessage(char msgtype, const char *s, size_t len); 00064 extern void pq_startcopyout(void); 00065 extern void pq_endcopyout(bool errorAbort); 00066 00067 /* 00068 * prototypes for functions in be-secure.c 00069 */ 00070 extern int secure_initialize(void); 00071 extern void secure_destroy(void); 00072 extern int secure_open_server(Port *port); 00073 extern void secure_close(Port *port); 00074 extern ssize_t secure_read(Port *port, void *ptr, size_t len); 00075 extern ssize_t secure_write(Port *port, void *ptr, size_t len); 00076 00077 #endif /* LIBPQ_H */