Header And Logo

PostgreSQL
| The world's most advanced open source database.

pqformat.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * pqformat.h
00004  *      Definitions for formatting and parsing frontend/backend messages
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * src/include/libpq/pqformat.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef PQFORMAT_H
00014 #define PQFORMAT_H
00015 
00016 #include "lib/stringinfo.h"
00017 
00018 extern void pq_beginmessage(StringInfo buf, char msgtype);
00019 extern void pq_sendbyte(StringInfo buf, int byt);
00020 extern void pq_sendbytes(StringInfo buf, const char *data, int datalen);
00021 extern void pq_sendcountedtext(StringInfo buf, const char *str, int slen,
00022                    bool countincludesself);
00023 extern void pq_sendtext(StringInfo buf, const char *str, int slen);
00024 extern void pq_sendstring(StringInfo buf, const char *str);
00025 extern void pq_send_ascii_string(StringInfo buf, const char *str);
00026 extern void pq_sendint(StringInfo buf, int i, int b);
00027 extern void pq_sendint64(StringInfo buf, int64 i);
00028 extern void pq_sendfloat4(StringInfo buf, float4 f);
00029 extern void pq_sendfloat8(StringInfo buf, float8 f);
00030 extern void pq_endmessage(StringInfo buf);
00031 
00032 extern void pq_begintypsend(StringInfo buf);
00033 extern bytea *pq_endtypsend(StringInfo buf);
00034 
00035 extern void pq_puttextmessage(char msgtype, const char *str);
00036 extern void pq_putemptymessage(char msgtype);
00037 
00038 extern int  pq_getmsgbyte(StringInfo msg);
00039 extern unsigned int pq_getmsgint(StringInfo msg, int b);
00040 extern int64 pq_getmsgint64(StringInfo msg);
00041 extern float4 pq_getmsgfloat4(StringInfo msg);
00042 extern float8 pq_getmsgfloat8(StringInfo msg);
00043 extern const char *pq_getmsgbytes(StringInfo msg, int datalen);
00044 extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen);
00045 extern char *pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes);
00046 extern const char *pq_getmsgstring(StringInfo msg);
00047 extern void pq_getmsgend(StringInfo msg);
00048 
00049 #endif   /* PQFORMAT_H */