X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fircd_reslib.h;h=fae4156bf88709bfde44a4c5fa61f94dde89b576;hb=3d59398668e6f0977c147c5efeefe7582d05b25b;hp=9dd6e2555b71ba44865641d1db851c222909bb6e;hpb=a43a98c096947864d5c9e4401fe6e15aa4de61ae;p=ircu2.10.12-pk.git diff --git a/include/ircd_reslib.h b/include/ircd_reslib.h index 9dd6e25..fae4156 100644 --- a/include/ircd_reslib.h +++ b/include/ircd_reslib.h @@ -1,8 +1,10 @@ /* * include/ircd_reslib.h * (C)opyright 1992 Darren Reed. - * - * $Id$ + */ +/** @file + * @brief Interface from ircd resolver to its support functions. + * @version $Id$ */ #ifndef INCLUDED_ircdreslib_h #define INCLUDED_ircdreslib_h @@ -12,34 +14,38 @@ /* * Inline versions of get/put short/long. Pointer is advanced. */ +/** Get a 16-bit network endian value from \a cp and assign to \a s. */ #define IRC_NS_GET16(s, cp) { \ const unsigned char *t_cp = (const unsigned char *)(cp); \ - (s) = ((u_int16_t)t_cp[0] << 8) \ - | ((u_int16_t)t_cp[1]) \ + (s) = ((uint16_t)t_cp[0] << 8) \ + | ((uint16_t)t_cp[1]) \ ; \ (cp) += NS_INT16SZ; \ } +/** Get a 32-bit network endian value from \a cp and assign to \a s. */ #define IRC_NS_GET32(l, cp) { \ const unsigned char *t_cp = (const unsigned char *)(cp); \ - (l) = ((u_int32_t)t_cp[0] << 24) \ - | ((u_int32_t)t_cp[1] << 16) \ - | ((u_int32_t)t_cp[2] << 8) \ - | ((u_int32_t)t_cp[3]) \ + (l) = ((uint32_t)t_cp[0] << 24) \ + | ((uint32_t)t_cp[1] << 16) \ + | ((uint32_t)t_cp[2] << 8) \ + | ((uint32_t)t_cp[3]) \ ; \ (cp) += NS_INT32SZ; \ } +/** Put \a s at \a cp as a 16-bit network endian value. */ #define IRC_NS_PUT16(s, cp) { \ - u_int16_t t_s = (u_int16_t)(s); \ + uint16_t t_s = (uint16_t)(s); \ unsigned char *t_cp = (unsigned char *)(cp); \ *t_cp++ = t_s >> 8; \ *t_cp = t_s; \ (cp) += NS_INT16SZ; \ } +/** Put \a s at \a cp as a 32-bit network endian value. */ #define IRC_NS_PUT32(l, cp) { \ - u_int32_t t_l = (u_int32_t)(l); \ + uint32_t t_l = (uint32_t)(l); \ unsigned char *t_cp = (unsigned char *)(cp); \ *t_cp++ = t_l >> 24; \ *t_cp++ = t_l >> 16; \ @@ -48,6 +54,7 @@ (cp) += NS_INT32SZ; \ } +/** Maximum number of nameservers to bother with. */ #define IRCD_MAXNS 8 int irc_res_init(void);