/* convert struct sockaddr to string. dest must be NG_INET_ADDRSTRLEN bytes long */
GLOBAL bool ng_ipaddr_tostr_r PARAMS((const ng_ipaddr_t *addr, char *dest));
#else
-static inline const char *
-ng_ipaddr_tostr(const ng_ipaddr_t *addr) { return inet_ntoa(addr->sin4.sin_addr); }
+static inline const char*
+ng_ipaddr_tostr(const ng_ipaddr_t *addr)
+{
+ return inet_ntoa(addr->sin4.sin_addr);
+}
static inline bool
ng_ipaddr_tostr_r(const ng_ipaddr_t *addr, char *d)
* @param User User name to set.
*/
GLOBAL void
-Client_SetOrigUser(CLIENT UNUSED *Client, const char UNUSED *User) {
+Client_SetOrigUser(CLIENT UNUSED *Client, const char UNUSED *User)
+{
assert(Client != NULL);
assert(User != NULL);
ConnSSL_InitLibrary(void);
#else
static inline bool
-ConnSSL_InitLibrary(void) { return true; }
+ConnSSL_InitLibrary(void)
+{ return true; }
#endif /* SSL_SUPPORT */
#endif /* conf_ssl_h */
} /* Check_ArgIsTrue */
-static unsigned int Handle_MaxNickLength(int Line, const char *Arg)
+static unsigned int
+Handle_MaxNickLength(int Line, const char *Arg)
{
unsigned new;
}
#else
static inline bool
-SSL_WantRead(UNUSED const CONNECTION *c) { return false; }
+SSL_WantRead(UNUSED const CONNECTION *c)
+{ return false; }
static inline bool
-SSL_WantWrite(UNUSED const CONNECTION *c) { return false; }
+SSL_WantWrite(UNUSED const CONNECTION *c)
+{ return false; }
#endif
GLOBAL bool Conn_GetCipherInfo PARAMS((CONN_ID Idx, char *buf, size_t len));
GLOBAL bool Conn_UsesSSL PARAMS((CONN_ID Idx));
#else
-static inline bool Conn_UsesSSL(UNUSED CONN_ID Idx) { return false; }
+static inline bool
+Conn_UsesSSL(UNUSED CONN_ID Idx)
+{ return false; }
#endif
GLOBAL long Conn_Count PARAMS((void));
* the largest fd registered, plus one.
*/
static int select_maxfd;
-static int io_dispatch_select(struct timeval *tv);
+static int io_dispatch_select PARAMS((struct timeval *tv));
#ifndef IO_USE_EPOLL
#define io_masterfd -1
static void io_docallback PARAMS((int fd, short what));
#ifdef DEBUG_IO
-static void io_debug(const char *s, int fd, int what)
+static void
+io_debug(const char *s, int fd, int what)
{
Log(LOG_DEBUG, "%s: %d, %d\n", s, fd, what);
}
#else
-static inline void io_debug(const char UNUSED *s,int UNUSED a, int UNUSED b) {/*NOTHING*/}
+static inline void
+io_debug(const char UNUSED *s,int UNUSED a, int UNUSED b)
+{ /* NOTHING */ }
#endif
static io_event *
eventsize, io_masterfd);
}
#else
-static inline void io_close_devpoll(int UNUSED x) {/* NOTHING */}
-static inline void io_library_init_devpoll(unsigned int UNUSED ev) {/*NOTHING*/}
+static inline void
+io_close_devpoll(int UNUSED x)
+{ /* NOTHING */ }
+static inline void
+io_library_init_devpoll(unsigned int UNUSED ev)
+{ /* NOTHING */ }
#endif
}
}
#else
-static inline void io_close_poll(int UNUSED x) {/* NOTHING */}
-static inline void io_library_init_poll(unsigned int UNUSED ev) {/*NOTHING*/}
+static inline void
+io_close_poll(int UNUSED x)
+{ /* NOTHING */ }
+static inline void
+io_library_init_poll(unsigned int UNUSED ev)
+{ /* NOTHING */ }
#endif
static int
io_dispatch_select(struct timeval *tv)
{
- fd_set readers_tmp = readers;
- fd_set writers_tmp = writers;
+ fd_set readers_tmp;
+ fd_set writers_tmp;
short what;
int ret, i;
int fds_ready;
+
+ readers_tmp = readers;
+ writers_tmp = writers;
+
ret = select(select_maxfd + 1, &readers_tmp, &writers_tmp, NULL, tv);
if (ret <= 0)
return ret;
}
}
#else
-static inline void io_library_init_select(int UNUSED x) {/* NOTHING */}
-static inline void io_close_select(int UNUSED x) {/* NOTHING */}
+static inline void
+io_library_init_select(int UNUSED x)
+{ /* NOTHING */ }
+static inline void
+io_close_select(int UNUSED x)
+{ /* NOTHING */ }
#endif /* SELECT */
#endif
}
#else
-static inline void io_library_init_epoll(unsigned int UNUSED ev) {/* NOTHING */}
+static inline void
+io_library_init_epoll(unsigned int UNUSED ev)
+{ /* NOTHING */ }
#endif /* IO_USE_EPOLL */
library_initialized = true;
}
#else
-static inline void io_library_init_kqueue(unsigned int UNUSED ev) {/* NOTHING */}
+static inline void
+io_library_init_kqueue(unsigned int UNUSED ev)
+{ /* NOTHING */ }
#endif
return ret;
}
#else
-static inline bool Show_MOTD_SSLInfo(UNUSED CLIENT *c) { return true; }
+static inline bool
+Show_MOTD_SSLInfo(UNUSED CLIENT *c)
+{ return true; }
#endif
GLOBAL bool
static void
Log_Forgery_NoIP(const char *ip, const char *host)
{
- Log_Subprocess(LOG_WARNING, "Possible forgery: %s resolved to %s "
- "(which has no ip address)", ip, host);
+ Log_Subprocess(LOG_WARNING,
+ "Possible forgery: %s resolved to %s (which has no ip address)", ip, host);
}
static void
Log_Forgery_WrongIP(const char *ip, const char *host)
{
- Log_Subprocess(LOG_WARNING,"Possible forgery: %s resolved to %s "
- "(which points to different address)", ip, host);
+ Log_Subprocess(LOG_WARNING,
+ "Possible forgery: %s resolved to %s (which points to different address)", ip, host);
}
#endif
-GLOBAL const char
-*ngt_SyslogFacilityName(int Facility)
+GLOBAL const char*
+ngt_SyslogFacilityName(int Facility)
{
int i = 0;
while(facilitynames[i].c_name) {