PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
pqformat.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * pqformat.h
4  * Definitions for formatting and parsing frontend/backend messages
5  *
6  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/libpq/pqformat.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PQFORMAT_H
14 #define PQFORMAT_H
15 
16 #include "lib/stringinfo.h"
17 
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_send_ascii_string(StringInfo buf, const char *str);
26 extern void pq_sendint(StringInfo buf, int i, int b);
27 extern void pq_sendint64(StringInfo buf, int64 i);
28 extern void pq_sendfloat4(StringInfo buf, float4 f);
29 extern void pq_sendfloat8(StringInfo buf, float8 f);
30 extern void pq_endmessage(StringInfo buf);
31 
32 extern void pq_begintypsend(StringInfo buf);
34 
35 extern void pq_puttextmessage(char msgtype, const char *str);
36 extern void pq_putemptymessage(char msgtype);
37 
38 extern int pq_getmsgbyte(StringInfo msg);
39 extern unsigned int pq_getmsgint(StringInfo msg, int b);
40 extern int64 pq_getmsgint64(StringInfo msg);
43 extern const char *pq_getmsgbytes(StringInfo msg, int datalen);
44 extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen);
45 extern char *pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes);
46 extern const char *pq_getmsgstring(StringInfo msg);
47 extern const char *pq_getmsgrawstring(StringInfo msg);
48 extern void pq_getmsgend(StringInfo msg);
49 
50 #endif /* PQFORMAT_H */
void pq_sendstring(StringInfo buf, const char *str)
Definition: pqformat.c:186
bytea * pq_endtypsend(StringInfo buf)
Definition: pqformat.c:379
void pq_endmessage(StringInfo buf)
Definition: pqformat.c:344
void pq_sendcountedtext(StringInfo buf, const char *str, int slen, bool countincludesself)
Definition: pqformat.c:131
unsigned int pq_getmsgint(StringInfo msg, int b)
Definition: pqformat.c:448
float8 pq_getmsgfloat8(StringInfo msg)
Definition: pqformat.c:530
void pq_sendfloat4(StringInfo buf, float4 f)
Definition: pqformat.c:298
const char * pq_getmsgstring(StringInfo msg)
Definition: pqformat.c:621
const char * pq_getmsgrawstring(StringInfo msg)
Definition: pqformat.c:650
void pq_sendfloat8(StringInfo buf, float8 f)
Definition: pqformat.c:324
int64 pq_getmsgint64(StringInfo msg)
Definition: pqformat.c:486
int pq_getmsgbyte(StringInfo msg)
Definition: pqformat.c:432
void pq_begintypsend(StringInfo buf)
Definition: pqformat.c:359
void pq_send_ascii_string(StringInfo buf, const char *str)
Definition: pqformat.c:218
double float8
Definition: c.h:375
char * pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes)
Definition: pqformat.c:588
const char * pq_getmsgbytes(StringInfo msg, int datalen)
Definition: pqformat.c:550
void pq_putemptymessage(char msgtype)
Definition: pqformat.c:421
static char * buf
Definition: pg_test_fsync.c:67
void pq_sendbyte(StringInfo buf, int byt)
Definition: pqformat.c:105
void pq_sendint64(StringInfo buf, int64 i)
Definition: pqformat.c:271
float float4
Definition: c.h:374
void pq_copymsgbytes(StringInfo msg, char *buf, int datalen)
Definition: pqformat.c:570
void pq_beginmessage(StringInfo buf, char msgtype)
Definition: pqformat.c:88
void pq_getmsgend(StringInfo msg)
Definition: pqformat.c:677
void pq_puttextmessage(char msgtype, const char *str)
Definition: pqformat.c:400
void pq_sendtext(StringInfo buf, const char *str, int slen)
Definition: pqformat.c:163
int i
void pq_sendbytes(StringInfo buf, const char *data, int datalen)
Definition: pqformat.c:115
Definition: c.h:433
float4 pq_getmsgfloat4(StringInfo msg)
Definition: pqformat.c:511
void pq_sendint(StringInfo buf, int i, int b)
Definition: pqformat.c:236