diff options
| author | Bruce Momjian | 1998-02-26 04:46:47 +0000 |
|---|---|---|
| committer | Bruce Momjian | 1998-02-26 04:46:47 +0000 |
| commit | a32450a5855eed4bfd756ef292ee45d3c754665b (patch) | |
| tree | 26735c3406d9f46d0f39accbe6ff1fb5cc5beedc /src/include/libpq | |
| parent | 757bf69a2e259c76baed94fa06e792664ab5ed67 (diff) | |
pgindent run before 6.3 release, with Thomas' requested changes.
Diffstat (limited to 'src/include/libpq')
| -rw-r--r-- | src/include/libpq/auth.h | 6 | ||||
| -rw-r--r-- | src/include/libpq/crypt.h | 16 | ||||
| -rw-r--r-- | src/include/libpq/hba.h | 17 | ||||
| -rw-r--r-- | src/include/libpq/libpq-be.h | 84 | ||||
| -rw-r--r-- | src/include/libpq/libpq.h | 11 | ||||
| -rw-r--r-- | src/include/libpq/password.h | 2 | ||||
| -rw-r--r-- | src/include/libpq/pqcomm.h | 68 |
7 files changed, 112 insertions, 92 deletions
diff --git a/src/include/libpq/auth.h b/src/include/libpq/auth.h index bf85ee5996..0adc4d4658 100644 --- a/src/include/libpq/auth.h +++ b/src/include/libpq/auth.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: auth.h,v 1.8 1998/01/26 01:42:05 scrappy Exp $ + * $Id: auth.h,v 1.9 1998/02/26 04:41:35 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -20,8 +20,8 @@ *---------------------------------------------------------------- */ -void be_recvauth(Port *port); -void auth_failed(Port *port); +void be_recvauth(Port *port); +void auth_failed(Port *port); #define PG_KRB4_VERSION "PGVER4.1" /* at most KRB_SENDAUTH_VLEN chars */ #define PG_KRB5_VERSION "PGVER5.1" diff --git a/src/include/libpq/crypt.h b/src/include/libpq/crypt.h index b1da83ac60..4c0117d616 100644 --- a/src/include/libpq/crypt.h +++ b/src/include/libpq/crypt.h @@ -15,15 +15,17 @@ #define CRYPT_PWD_FILE_SEPCHAR "'\\t'" #define CRYPT_PWD_FILE_SEPSTR "\t" #define CRYPT_PWD_RELOAD_SUFX ".reload" - -extern char** pwd_cache; -extern int pwd_cache_count; -extern char* crypt_getpwdfilename(void); -extern char* crypt_getpwdreloadfilename(void); +extern char **pwd_cache; +extern int pwd_cache_count; + +extern char *crypt_getpwdfilename(void); +extern char *crypt_getpwdreloadfilename(void); + #if 0 -extern MsgType crypt_salt(const char* user); +extern MsgType crypt_salt(const char *user); + #endif -extern int crypt_verify(Port* port, const char* user, const char* pgpass); +extern int crypt_verify(Port *port, const char *user, const char *pgpass); #endif diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h index fdadfc0d85..8900c6f34f 100644 --- a/src/include/libpq/hba.h +++ b/src/include/libpq/hba.h @@ -4,7 +4,7 @@ * Interface to hba.c * * - * $Id: hba.h,v 1.7 1998/01/26 01:42:15 scrappy Exp $ + * $Id: hba.h,v 1.8 1998/02/26 04:41:43 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -31,7 +31,7 @@ #define MAX_TOKEN 80 /* Maximum size of one token in the configuration file */ -#define MAX_AUTH_ARG 80 /* Max size of an authentication arg */ +#define MAX_AUTH_ARG 80 /* Max size of an authentication arg */ #define IDENT_PORT 113 /* Standard TCP port number for Ident service. Assigned by IANA */ @@ -39,7 +39,8 @@ #define IDENT_USERNAME_MAX 512 /* Max size of username ident server can return */ -typedef enum UserAuth { +typedef enum UserAuth +{ uaReject, uaKrb4, uaKrb5, @@ -49,9 +50,11 @@ typedef enum UserAuth { uaCrypt } UserAuth; -int hba_getauthmethod(SockAddr *raddr, char *database, char *auth_arg, - UserAuth *auth_method); -int authident(struct sockaddr_in *raddr, struct sockaddr_in *laddr, - const char postgres_username[], const char auth_arg[]); +int +hba_getauthmethod(SockAddr *raddr, char *database, char *auth_arg, + UserAuth *auth_method); +int +authident(struct sockaddr_in * raddr, struct sockaddr_in * laddr, + const char postgres_username[], const char auth_arg[]); #endif 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 */ diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h index b4d7407f12..57ec39576d 100644 --- a/src/include/libpq/libpq.h +++ b/src/include/libpq/libpq.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: libpq.h,v 1.11 1998/01/26 01:49:19 scrappy Exp $ + * $Id: libpq.h,v 1.12 1998/02/26 04:41:51 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -180,9 +180,11 @@ extern int PQninstancesGroup(PortalBuffer *portal, int group_index); extern int PQnfieldsGroup(PortalBuffer *portal, int group_index); extern int PQfnumberGroup(PortalBuffer *portal, int group_index, char *field_name); extern char *PQfnameGroup(PortalBuffer *portal, int group_index, int field_number); -extern int PQftypeGroup(PortalBuffer *portal, int group_index, +extern int +PQftypeGroup(PortalBuffer *portal, int group_index, int field_number); -extern int PQfsizeGroup(PortalBuffer *portal, int group_index, +extern int +PQfsizeGroup(PortalBuffer *portal, int group_index, int field_number); extern GroupBuffer *PQgroup(PortalBuffer *portal, int tuple_index); extern int PQgetgroup(PortalBuffer *portal, int tuple_index); @@ -270,7 +272,8 @@ extern int pq_sendoob(char *msg, int len); extern int pq_recvoob(char *msgPtr, int *lenPtr); extern int pq_getinaddr(struct sockaddr_in * sin, char *host, int port); extern int pq_getinserv(struct sockaddr_in * sin, char *host, char *serv); -extern int pq_connect(char *dbname, char *user, char *args, char *hostName, +extern int +pq_connect(char *dbname, char *user, char *args, char *hostName, char *debugTty, char *execFile, short portName); extern int StreamOpen(char *hostName, short portName, Port *port); extern void pq_regoob(void (*fptr) ()); diff --git a/src/include/libpq/password.h b/src/include/libpq/password.h index f0c24794c3..9c7421d893 100644 --- a/src/include/libpq/password.h +++ b/src/include/libpq/password.h @@ -1,6 +1,6 @@ #ifndef PASSWORD_H #define PASSWORD_H -int verify_password(char *auth_arg, char *user, char *password); +int verify_password(char *auth_arg, char *user, char *password); #endif diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h index 0145f26270..0b06de0df1 100644 --- a/src/include/libpq/pqcomm.h +++ b/src/include/libpq/pqcomm.h @@ -1,12 +1,12 @@ /*------------------------------------------------------------------------- * * pqcomm.h-- - * Definitions common to frontends and backends. + * Definitions common to frontends and backends. * * * Copyright (c) 1994, Regents of the University of California * - * $Id: pqcomm.h,v 1.22 1998/01/28 02:29:40 momjian Exp $ + * $Id: pqcomm.h,v 1.23 1998/02/26 04:41:53 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -24,16 +24,17 @@ /* Define a generic socket address type. */ -typedef union SockAddr { - struct sockaddr sa; - struct sockaddr_in in; - struct sockaddr_un un; +typedef union SockAddr +{ + struct sockaddr sa; + struct sockaddr_in in; + struct sockaddr_un un; } SockAddr; /* Configure the UNIX socket address for the well known port. */ -#define UNIXSOCK_PATH(sun,port) \ +#define UNIXSOCK_PATH(sun,port) \ (sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)) + \ offsetof(struct sockaddr_un, sun_path)) /* @@ -57,14 +58,14 @@ typedef union SockAddr { * version. */ -#define PG_PROTOCOL_MAJOR(v) ((v) >> 16) -#define PG_PROTOCOL_MINOR(v) ((v) & 0x0000ffff) -#define PG_PROTOCOL(m,n) (((m) << 16) | (n)) +#define PG_PROTOCOL_MAJOR(v) ((v) >> 16) +#define PG_PROTOCOL_MINOR(v) ((v) & 0x0000ffff) +#define PG_PROTOCOL(m,n) (((m) << 16) | (n)) /* The earliest and latest frontend/backend protocol version supported. */ -#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(0,0) -#define PG_PROTOCOL_LATEST PG_PROTOCOL(1,0) +#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(0,0) +#define PG_PROTOCOL_LATEST PG_PROTOCOL(1,0) /* * All packets sent to the postmaster start with the length. This is omitted @@ -73,48 +74,49 @@ typedef union SockAddr { typedef uint32 PacketLen; - + /* * Startup message parameters sizes. These must not be changed without changing * the protcol version. These are all strings that are '\0' terminated only if * there is room. */ -#define SM_DATABASE 64 -#define SM_USER 32 -#define SM_OPTIONS 64 -#define SM_UNUSED 64 -#define SM_TTY 64 +#define SM_DATABASE 64 +#define SM_USER 32 +#define SM_OPTIONS 64 +#define SM_UNUSED 64 +#define SM_TTY 64 -typedef uint32 ProtocolVersion; /* Fe/Be protocol version nr. */ +typedef uint32 ProtocolVersion; /* Fe/Be protocol version nr. */ -typedef struct StartupPacket { - ProtocolVersion protoVersion; /* Protocol version */ +typedef struct StartupPacket +{ + ProtocolVersion protoVersion; /* Protocol version */ char database[SM_DATABASE]; /* Database name */ - char user[SM_USER]; /* User name */ + char user[SM_USER]; /* User name */ char options[SM_OPTIONS]; /* Optional additional args */ - char unused[SM_UNUSED]; /* Unused */ - char tty[SM_TTY]; /* Tty for debug output */ + char unused[SM_UNUSED]; /* Unused */ + char tty[SM_TTY]; /* Tty for debug output */ } StartupPacket; /* These are the authentication requests sent by the backend. */ -#define AUTH_REQ_OK 0 /* User is authenticated */ -#define AUTH_REQ_KRB4 1 /* Kerberos V4 */ -#define AUTH_REQ_KRB5 2 /* Kerberos V5 */ -#define AUTH_REQ_PASSWORD 3 /* Password */ -#define AUTH_REQ_CRYPT 4 /* Encrypted password */ +#define AUTH_REQ_OK 0 /* User is authenticated */ +#define AUTH_REQ_KRB4 1 /* Kerberos V4 */ +#define AUTH_REQ_KRB5 2 /* Kerberos V5 */ +#define AUTH_REQ_PASSWORD 3 /* Password */ +#define AUTH_REQ_CRYPT 4 /* Encrypted password */ typedef uint32 AuthRequest; /* This next section is to maintain compatibility with protocol v0.0. */ -#define STARTUP_MSG 7 /* Initialise a connection */ -#define STARTUP_KRB4_MSG 10 /* krb4 session follows */ -#define STARTUP_KRB5_MSG 11 /* krb5 session follows */ -#define STARTUP_PASSWORD_MSG 14 /* Password follows */ +#define STARTUP_MSG 7 /* Initialise a connection */ +#define STARTUP_KRB4_MSG 10 /* krb4 session follows */ +#define STARTUP_KRB5_MSG 11 /* krb5 session follows */ +#define STARTUP_PASSWORD_MSG 14 /* Password follows */ typedef ProtocolVersion MsgType; |
