summaryrefslogtreecommitdiff
path: root/src/include/libpq/libpq-be.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-02-26 04:46:47 +0000
committerBruce Momjian <bruce@momjian.us>1998-02-26 04:46:47 +0000
commita32450a5855eed4bfd756ef292ee45d3c754665b (patch)
tree26735c3406d9f46d0f39accbe6ff1fb5cc5beedc /src/include/libpq/libpq-be.h
parent757bf69a2e259c76baed94fa06e792664ab5ed67 (diff)
downloadpostgresql-a32450a5855eed4bfd756ef292ee45d3c754665b.tar.gz
pgindent run before 6.3 release, with Thomas' requested changes.
Diffstat (limited to 'src/include/libpq/libpq-be.h')
-rw-r--r--src/include/libpq/libpq-be.h84
1 files changed, 47 insertions, 37 deletions
diff --git a/src/include/libpq/libpq-be.h b/src/include/libpq/libpq-be.h
index 4d0e186198..7058eec246 100644
--- a/src/include/libpq/libpq-be.h
+++ b/src/include/libpq/libpq-be.h
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: libpq-be.h,v 1.9 1998/01/26 01:42:17 scrappy Exp $
+ * $Id: libpq-be.h,v 1.10 1998/02/26 04:41:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,7 +23,8 @@
/* Protocol v0 password packet. */
-typedef struct PasswordPacketV0 {
+typedef struct PasswordPacketV0
+{
uint32 unused;
char data[288]; /* User and password as strings. */
} PasswordPacketV0;
@@ -33,68 +34,76 @@ typedef struct PasswordPacketV0 {
* Password packet. The length of the password can be changed without
* affecting anything.
*/
-
-typedef struct PasswordPacket {
- char passwd[100]; /* The password. */
+
+typedef struct PasswordPacket
+{
+ char passwd[100]; /* The password. */
} PasswordPacket;
/* Error message packet. */
-typedef struct ErrorMessagePacket {
- char data[1 + 100]; /* 'E' + the message. */
+typedef struct ErrorMessagePacket
+{
+ char data[1 + 100]; /* 'E' + the message. */
} ErrorMessagePacket;
/* Authentication request packet. */
-typedef struct AuthRequestPacket {
- char data[1 + sizeof (AuthRequest) + 2]; /* 'R' + the request + optional salt. */
+typedef struct AuthRequestPacket
+{
+ char data[1 + sizeof(AuthRequest) + 2]; /* 'R' + the request +
+ * optional salt. */
} AuthRequestPacket;
-
+
/* These are used by the packet handling routines. */
-typedef enum {
+typedef enum
+{
Idle,
ReadingPacketLength,
ReadingPacket,
WritingPacket
} PacketState;
-typedef struct Packet {
- PacketState state; /* What's in progress. */
+typedef struct Packet
+{
+ PacketState state; /* What's in progress. */
PacketLen len; /* Actual length */
- int nrtodo; /* Bytes still to transfer */
- char *ptr; /* Buffer pointer */
- void (*iodone)(); /* I/O complete callback */
- char *arg; /* Argument to callback */
+ int nrtodo; /* Bytes still to transfer */
+ char *ptr; /* Buffer pointer */
+ void (*iodone) (); /* I/O complete callback */
+ char *arg; /* Argument to callback */
/* A union of all the different packets. */
- union {
+ union
+ {
/* These are outgoing so have no packet length prepended. */
- ErrorMessagePacket em;
- AuthRequestPacket ar;
+ ErrorMessagePacket em;
+ AuthRequestPacket ar;
/* These are incoming and have a packet length prepended. */
- StartupPacket si;
- PasswordPacketV0 pwv0;
- PasswordPacket pw;
- } pkt;
+ StartupPacket si;
+ PasswordPacketV0 pwv0;
+ PasswordPacket pw;
+ } pkt;
} Packet;
/*
- * This is used by the postmaster in its communication with frontends. It is
+ * This is used by the postmaster in its communication with frontends. It is
* contains all state information needed during this communication before the
* backend is run.
*/
-
-typedef struct Port {
- int sock; /* File descriptor */
+
+typedef struct Port
+{
+ int sock; /* File descriptor */
Packet pktInfo; /* For the packet handlers */
SockAddr laddr; /* local addr (us) */
SockAddr raddr; /* remote addr (them) */
@@ -105,7 +114,7 @@ typedef struct Port {
* handshake.
*/
- ProtocolVersion proto;
+ ProtocolVersion proto;
char database[SM_DATABASE + 1];
char user[SM_USER + 1];
char options[SM_OPTIONS + 1];
@@ -115,18 +124,19 @@ typedef struct Port {
} Port;
-extern FILE *Pfout, *Pfin;
-extern int PQAsyncNotifyWaiting;
+extern FILE *Pfout,
+ *Pfin;
+extern int PQAsyncNotifyWaiting;
extern ProtocolVersion FrontendProtocol;
/*
* prototypes for functions in pqpacket.c
*/
-void PacketReceiveSetup(Packet *pkt, void (*iodone)(), char *arg);
-int PacketReceiveFragment(Packet *pkt, int sock);
-void PacketSendSetup(Packet *pkt, int nbytes, void (*iodone)(), char *arg);
-int PacketSendFragment(Packet *pkt, int sock);
-void PacketSendError(Packet *pkt, char *errormsg);
-
+void PacketReceiveSetup(Packet *pkt, void (*iodone) (), char *arg);
+int PacketReceiveFragment(Packet *pkt, int sock);
+void PacketSendSetup(Packet *pkt, int nbytes, void (*iodone) (), char *arg);
+int PacketSendFragment(Packet *pkt, int sock);
+void PacketSendError(Packet *pkt, char *errormsg);
+
#endif /* LIBPQ_BE_H */