summaryrefslogtreecommitdiff
path: root/src/include/libpq/pqformat.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/libpq/pqformat.h')
-rw-r--r--src/include/libpq/pqformat.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/libpq/pqformat.h b/src/include/libpq/pqformat.h
new file mode 100644
index 00000000000..2fe48539a2d
--- /dev/null
+++ b/src/include/libpq/pqformat.h
@@ -0,0 +1,31 @@
+/*-------------------------------------------------------------------------
+ *
+ * pqformat.h
+ * Definitions for formatting and parsing frontend/backend messages
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: pqformat.h,v 1.1 1999/04/25 03:19:14 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PQFORMAT_H
+#define PQFORMAT_H
+
+#include "postgres.h"
+#include "lib/stringinfo.h"
+
+#define pq_beginmessage(buf) initStringInfo(buf)
+
+extern void pq_sendbyte(StringInfo buf, int byt);
+extern void pq_sendbytes(StringInfo buf, const char *data, int datalen);
+extern void pq_sendtext(StringInfo buf, const char *str, int slen);
+extern void pq_sendstring(StringInfo buf, const char *str, int slen);
+extern void pq_sendint(StringInfo buf, int i, int b);
+extern void pq_endmessage(StringInfo buf);
+
+extern int pq_getint(int *result, int b);
+extern int pq_getstr(char *s, int maxlen);
+extern int pq_getnchar(char *s, int len);
+
+#endif /* PQFORMAT_H */