postgresql/src/include/libpq/libpq.h

78 lines
2.1 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* libpq.h
* POSTGRES LIBPQ buffer structure definitions.
*
*
2010-01-02 17:58:17 +01:00
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
2010-01-02 17:58:17 +01:00
* $PostgreSQL: pgsql/src/include/libpq/libpq.h,v 1.72 2010/01/02 16:58:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef LIBPQ_H
#define LIBPQ_H
#include <sys/types.h>
#include <netinet/in.h>
#include "lib/stringinfo.h"
#include "libpq/libpq-be.h"
/* ----------------
1999-05-25 18:15:34 +02:00
* PQArgBlock
* Information (pointer to array of this structure) required
* for the PQfn() call. (This probably ought to go somewhere else...)
* ----------------
*/
typedef struct
{
int len;
int isint;
union
{
int *ptr; /* can't use void (dec compiler barfs) */
int integer;
} u;
} PQArgBlock;
/*
* External functions.
*/
/*
* prototypes for functions in pqcomm.c
*/
2001-03-22 05:01:46 +01:00
extern int StreamServerPort(int family, char *hostName,
2005-10-15 04:49:52 +02:00
unsigned short portNumber, char *unixSocketName, int ListenSocket[],
2003-08-04 02:43:34 +02:00
int MaxListen);
extern int StreamConnection(int server_fd, Port *port);
extern void StreamClose(int sock);
extern void TouchSocketFile(void);
extern void pq_init(void);
extern void pq_comm_reset(void);
extern int pq_getbytes(char *s, size_t len);
extern int pq_getstring(StringInfo s);
extern int pq_getmessage(StringInfo s, int maxlen);
extern int pq_getbyte(void);
extern int pq_peekbyte(void);
extern int pq_putbytes(const char *s, size_t len);
extern int pq_flush(void);
extern int pq_putmessage(char msgtype, const char *s, size_t len);
1999-05-25 18:15:34 +02:00
extern void pq_startcopyout(void);
extern void pq_endcopyout(bool errorAbort);
/*
* prototypes for functions in be-secure.c
*/
2003-08-04 02:43:34 +02:00
extern int secure_initialize(void);
extern bool secure_loaded_verify_locations(void);
2003-08-04 02:43:34 +02:00
extern void secure_destroy(void);
extern int secure_open_server(Port *port);
extern void secure_close(Port *port);
extern ssize_t secure_read(Port *port, void *ptr, size_t len);
extern ssize_t secure_write(Port *port, void *ptr, size_t len);
#endif /* LIBPQ_H */