masqmail

diff src/libident/ident.h @ 10:26e34ae9a3e3

changed indention and line wrapping to a more consistent style
author meillo@marmaro.de
date Mon, 27 Oct 2008 16:23:10 +0100
parents 08114f7dcc23
children
line diff
     1.1 --- a/src/libident/ident.h	Mon Oct 27 16:21:27 2008 +0100
     1.2 +++ b/src/libident/ident.h	Mon Oct 27 16:23:10 2008 +0100
     1.3 @@ -8,7 +8,7 @@
     1.4  #ifndef __IDENT_H__
     1.5  #define __IDENT_H__
     1.6  
     1.7 -#ifdef	__cplusplus
     1.8 +#ifdef __cplusplus
     1.9  extern "C" {
    1.10  #endif
    1.11  
    1.12 @@ -22,21 +22,21 @@
    1.13  #ifdef __P
    1.14  #  undef __P
    1.15  #endif
    1.16 -    
    1.17 +
    1.18  #ifdef IS_STDC
    1.19 -#  define __P(AL)	                  AL
    1.20 +#  define __P(AL) AL
    1.21  
    1.22  #ifdef IN_LIBIDENT_SRC
    1.23 -    
    1.24 +
    1.25  #  define __P1(t1,a1) \
    1.26      (t1 a1)
    1.27 -    
    1.28 +
    1.29  #  define __P2(t1,a1,t2,a2) \
    1.30      (t1 a1, t2 a2)
    1.31 -	
    1.32 +
    1.33  #  define __P3(t1,a1,t2,a2,t3,a3) \
    1.34      (t1 a1, t2 a2, t3 a3)
    1.35 -	    
    1.36 +
    1.37  #  define __P4(t1,a1,t2,a2,t3,a3,t4,a4) \
    1.38      (t1 a1, t2 a2, t3 a3, t4 a4)
    1.39  
    1.40 @@ -46,13 +46,13 @@
    1.41  #  define __P7(t1,a1,t2,a2,t3,a3,t4,a4,t5,a5,t6,a6,t7,a7) \
    1.42      (t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7)
    1.43  #endif
    1.44 -    
    1.45 +
    1.46  #else
    1.47  
    1.48 -#  define __P(AL)	                  ()
    1.49 +#  define __P(AL) ()
    1.50  
    1.51  #ifdef IN_LIBIDENT_SRC
    1.52 -    
    1.53 +
    1.54  #  define __P1(t1,a1)                     (a1) \
    1.55      t1 a1;
    1.56  #  define __P2(t1,a1,t2,a2)               (a1, a2) \
    1.57 @@ -108,87 +108,74 @@
    1.58   * in function prototypes...
    1.59   */
    1.60  #if defined(__GNUC__) && !defined(INADDR_ANY)
    1.61 -#  define __STRUCT_IN_ADDR_P	void *
    1.62 +#  define __STRUCT_IN_ADDR_P void *
    1.63  #else
    1.64 -#  define __STRUCT_IN_ADDR_P	struct in_addr *
    1.65 +#  define __STRUCT_IN_ADDR_P struct in_addr *
    1.66  #endif
    1.67  
    1.68  #if defined(__GNUC__) && !defined(DST_NONE)
    1.69 -#  define __STRUCT_TIMEVAL_P	void *
    1.70 +#  define __STRUCT_TIMEVAL_P void *
    1.71  #else
    1.72 -#  define __STRUCT_TIMEVAL_P	struct timeval *
    1.73 +#  define __STRUCT_TIMEVAL_P struct timeval *
    1.74  #endif
    1.75  
    1.76  #if defined(__sgi) && defined(_POSIX_SOURCE)
    1.77  #  undef  __STRUCT_TIMEVAL_P
    1.78 -#  define __STRUCT_TIMEVAL_P	void *
    1.79 +#  define __STRUCT_TIMEVAL_P void *
    1.80  #endif
    1.81 -	
    1.82 +
    1.83  #ifndef IDBUFSIZE
    1.84  #  define IDBUFSIZE 2048
    1.85  #endif
    1.86  
    1.87  #ifndef IDPORT
    1.88 -#  define IDPORT	113
    1.89 +#  define IDPORT 113
    1.90  #endif
    1.91  
    1.92 -typedef struct
    1.93 -{
    1.94 -  int fd;
    1.95 -  char buf[IDBUFSIZE];
    1.96 -} ident_t;
    1.97 +	typedef struct {
    1.98 +		int fd;
    1.99 +		char buf[IDBUFSIZE];
   1.100 +	} ident_t;
   1.101  
   1.102 -typedef struct {
   1.103 -  int lport;                    /* Local port */
   1.104 -  int fport;                    /* Far (remote) port */
   1.105 -  char *identifier;             /* Normally user name */
   1.106 -  char *opsys;                  /* OS */
   1.107 -  char *charset;                /* Charset (what did you expect?) */
   1.108 -} IDENT;                        /* For higher-level routines */
   1.109 +	typedef struct {
   1.110 +		int lport;  /* Local port */
   1.111 +		int fport;  /* Far (remote) port */
   1.112 +		char *identifier;  /* Normally user name */
   1.113 +		char *opsys;  /* OS */
   1.114 +		char *charset;  /* Charset (what did you expect?) */
   1.115 +	} IDENT;  /* For higher-level routines */
   1.116  
   1.117  /* Low-level calls and macros */
   1.118 -#define id_fileno(ID)	((ID)->fd)
   1.119 +#define id_fileno(ID) ((ID)->fd)
   1.120  
   1.121 -extern ident_t * id_open __P((__STRUCT_IN_ADDR_P laddr,
   1.122 -			   __STRUCT_IN_ADDR_P faddr,
   1.123 -			   __STRUCT_TIMEVAL_P timeout));
   1.124 -  
   1.125 -extern int    id_close __P((ident_t *id));
   1.126 -  
   1.127 -extern int    id_query __P((ident_t *id,
   1.128 -			    int lport,
   1.129 -			    int fport,
   1.130 -			    __STRUCT_TIMEVAL_P timeout));
   1.131 -  
   1.132 -extern int    id_parse __P((ident_t *id,
   1.133 -			    __STRUCT_TIMEVAL_P timeout,
   1.134 -			    int *lport,
   1.135 -			    int *fport,
   1.136 -			    char **identifier,
   1.137 -			    char **opsys,
   1.138 -			    char **charset));
   1.139 -  
   1.140 +	extern ident_t *id_open __P((__STRUCT_IN_ADDR_P laddr, __STRUCT_IN_ADDR_P faddr, __STRUCT_TIMEVAL_P timeout));
   1.141 +
   1.142 +	extern int id_close __P((ident_t * id));
   1.143 +
   1.144 +	extern int id_query __P((ident_t * id, int lport, int fport, __STRUCT_TIMEVAL_P timeout));
   1.145 +
   1.146 +	extern int id_parse __P((ident_t * id, __STRUCT_TIMEVAL_P timeout, int *lport, int *fport, char **identifier, char **opsys, char **charset));
   1.147 +
   1.148  /* High-level calls */
   1.149  
   1.150 -extern IDENT *ident_lookup __P((int fd, int timeout));
   1.151 +	extern IDENT *ident_lookup __P((int fd, int timeout));
   1.152  
   1.153 -extern char  *ident_id __P((int fd, int timeout));
   1.154 +	extern char *ident_id __P((int fd, int timeout));
   1.155  
   1.156 -extern IDENT *ident_query __P(( __STRUCT_IN_ADDR_P laddr, __STRUCT_IN_ADDR_P raddr, int lport, int rport, int timeout));
   1.157 +	extern IDENT *ident_query __P((__STRUCT_IN_ADDR_P laddr, __STRUCT_IN_ADDR_P raddr, int lport, int rport, int timeout));
   1.158  
   1.159 -extern void   ident_free __P((IDENT *id));
   1.160 +	extern void ident_free __P((IDENT * id));
   1.161  
   1.162 -extern char  id_version[];
   1.163 +	extern char id_version[];
   1.164  
   1.165  #ifdef IN_LIBIDENT_SRC
   1.166  
   1.167 -extern char *id_strdup __P((char *str));
   1.168 -extern char *id_strtok __P((char *cp, char *cs, char *dc));
   1.169 +	extern char *id_strdup __P((char *str));
   1.170 +	extern char *id_strtok __P((char *cp, char *cs, char *dc));
   1.171  
   1.172  #endif
   1.173  
   1.174 -#ifdef	__cplusplus
   1.175 +#ifdef __cplusplus
   1.176  }
   1.177  #endif
   1.178 -
   1.179  #endif