1 /*-------------------------------------------------------------------------
4 * Definitions for formatting and parsing frontend/backend messages
6 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
11 *-------------------------------------------------------------------------
16 #include "lib/stringinfo.h"
18 extern void pq_beginmessage(StringInfo buf
, char msgtype
);
19 extern void pq_sendbyte(StringInfo buf
, int byt
);
20 extern void pq_sendbytes(StringInfo buf
, const char *data
, int datalen
);
21 extern void pq_sendcountedtext(StringInfo buf
, const char *str
, int slen
,
22 bool countincludesself
);
23 extern void pq_sendtext(StringInfo buf
, const char *str
, int slen
);
24 extern void pq_sendstring(StringInfo buf
, const char *str
);
25 extern void pq_sendint(StringInfo buf
, int i
, int b
);
26 extern void pq_sendint64(StringInfo buf
, int64 i
);
27 extern void pq_sendfloat4(StringInfo buf
, float4 f
);
28 extern void pq_sendfloat8(StringInfo buf
, float8 f
);
29 extern void pq_endmessage(StringInfo buf
);
31 extern void pq_begintypsend(StringInfo buf
);
32 extern bytea
*pq_endtypsend(StringInfo buf
);
34 extern void pq_puttextmessage(char msgtype
, const char *str
);
35 extern void pq_putemptymessage(char msgtype
);
37 extern int pq_getmsgbyte(StringInfo msg
);
38 extern unsigned int pq_getmsgint(StringInfo msg
, int b
);
39 extern int64
pq_getmsgint64(StringInfo msg
);
40 extern float4
pq_getmsgfloat4(StringInfo msg
);
41 extern float8
pq_getmsgfloat8(StringInfo msg
);
42 extern const char *pq_getmsgbytes(StringInfo msg
, int datalen
);
43 extern void pq_copymsgbytes(StringInfo msg
, char *buf
, int datalen
);
44 extern char *pq_getmsgtext(StringInfo msg
, int rawbytes
, int *nbytes
);
45 extern const char *pq_getmsgstring(StringInfo msg
);
46 extern void pq_getmsgend(StringInfo msg
);
48 #endif /* PQFORMAT_H */