1999-04-25 05:19:27 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* pqformat.h
|
|
|
|
* Definitions for formatting and parsing frontend/backend messages
|
|
|
|
*
|
2002-06-20 22:29:54 +02:00
|
|
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1999-04-25 05:19:27 +02:00
|
|
|
*
|
2003-05-09 23:19:50 +02:00
|
|
|
* $Id: pqformat.h,v 1.18 2003/05/09 21:19:50 tgl Exp $
|
1999-04-25 05:19:27 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PQFORMAT_H
|
|
|
|
#define PQFORMAT_H
|
|
|
|
|
|
|
|
#include "lib/stringinfo.h"
|
|
|
|
|
2003-04-22 02:08:07 +02:00
|
|
|
extern void pq_beginmessage(StringInfo buf, char msgtype);
|
1999-05-25 18:15:34 +02:00
|
|
|
extern void pq_sendbyte(StringInfo buf, int byt);
|
|
|
|
extern void pq_sendbytes(StringInfo buf, const char *data, int datalen);
|
2003-05-08 20:16:37 +02:00
|
|
|
extern void pq_sendcountedtext(StringInfo buf, const char *str, int slen,
|
|
|
|
bool countincludesself);
|
2003-05-09 17:44:42 +02:00
|
|
|
extern void pq_sendtext(StringInfo buf, const char *str, int slen);
|
1999-05-25 18:15:34 +02:00
|
|
|
extern void pq_sendstring(StringInfo buf, const char *str);
|
|
|
|
extern void pq_sendint(StringInfo buf, int i, int b);
|
2003-05-09 17:44:42 +02:00
|
|
|
extern void pq_sendint64(StringInfo buf, int64 i);
|
2003-05-09 23:19:50 +02:00
|
|
|
extern void pq_sendfloat4(StringInfo buf, float4 f);
|
|
|
|
extern void pq_sendfloat8(StringInfo buf, float8 f);
|
1999-05-25 18:15:34 +02:00
|
|
|
extern void pq_endmessage(StringInfo buf);
|
1999-04-25 05:19:27 +02:00
|
|
|
|
2003-05-09 17:44:42 +02:00
|
|
|
extern void pq_begintypsend(StringInfo buf);
|
|
|
|
extern bytea *pq_endtypsend(StringInfo buf);
|
|
|
|
|
2003-04-22 02:08:07 +02:00
|
|
|
extern void pq_puttextmessage(char msgtype, const char *str);
|
|
|
|
extern void pq_putemptymessage(char msgtype);
|
1999-04-25 23:50:58 +02:00
|
|
|
|
2003-04-19 02:02:30 +02:00
|
|
|
extern int pq_getmsgbyte(StringInfo msg);
|
|
|
|
extern unsigned int pq_getmsgint(StringInfo msg, int b);
|
2003-05-09 17:44:42 +02:00
|
|
|
extern int64 pq_getmsgint64(StringInfo msg);
|
2003-05-09 23:19:50 +02:00
|
|
|
extern float4 pq_getmsgfloat4(StringInfo msg);
|
|
|
|
extern float8 pq_getmsgfloat8(StringInfo msg);
|
2003-04-19 02:02:30 +02:00
|
|
|
extern const char *pq_getmsgbytes(StringInfo msg, int datalen);
|
|
|
|
extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen);
|
2003-05-09 17:44:42 +02:00
|
|
|
extern char *pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes);
|
2003-04-19 02:02:30 +02:00
|
|
|
extern const char *pq_getmsgstring(StringInfo msg);
|
|
|
|
extern void pq_getmsgend(StringInfo msg);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* PQFORMAT_H */
|