ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/include/reslib.h
Revision: 3297
Committed: Fri Apr 11 16:08:55 2014 UTC (10 years ago) by michael
Content type: text/x-chdr
Original Path: ircd-hybrid/trunk/include/irc_reslib.h
File size: 1757 byte(s)
Log Message:
- Made irc_nscount an unsigned type

File Contents

# User Rev Content
1 adx 30 /*
2     * include/irc_reslib.h (C)opyright 1992 Darren Reed.
3     *
4 knight 31 * $Id$
5 adx 30 */
6     #ifndef INCLUDED_ircdreslib_h
7     #define INCLUDED_ircdreslib_h
8    
9     /*
10     * Inline versions of get/put short/long. Pointer is advanced.
11     */
12     #define IRC_NS_GET16(s, cp) { \
13     const unsigned char *t_cp = (const unsigned char *)(cp); \
14 michael 1032 (s) = ((uint16_t)t_cp[0] << 8) \
15     | ((uint16_t)t_cp[1]) \
16 adx 30 ; \
17     (cp) += NS_INT16SZ; \
18     }
19    
20     #define IRC_NS_GET32(l, cp) { \
21     const unsigned char *t_cp = (const unsigned char *)(cp); \
22 michael 1032 (l) = ((uint32_t)t_cp[0] << 24) \
23     | ((uint32_t)t_cp[1] << 16) \
24     | ((uint32_t)t_cp[2] << 8) \
25     | ((uint32_t)t_cp[3]) \
26 adx 30 ; \
27     (cp) += NS_INT32SZ; \
28     }
29    
30     #define IRC_NS_PUT16(s, cp) { \
31 michael 1032 uint16_t t_s = (uint16_t)(s); \
32 adx 30 unsigned char *t_cp = (unsigned char *)(cp); \
33     *t_cp++ = t_s >> 8; \
34     *t_cp = t_s; \
35     (cp) += NS_INT16SZ; \
36     }
37    
38     #define IRC_NS_PUT32(l, cp) { \
39 michael 1032 uint32_t t_l = (uint32_t)(l); \
40 adx 30 unsigned char *t_cp = (unsigned char *)(cp); \
41     *t_cp++ = t_l >> 24; \
42     *t_cp++ = t_l >> 16; \
43     *t_cp++ = t_l >> 8; \
44     *t_cp = t_l; \
45     (cp) += NS_INT32SZ; \
46     }
47    
48 michael 995 extern struct irc_ssaddr irc_nsaddr_list[];
49 michael 3297 extern unsigned int irc_nscount;
50 michael 1346 extern void irc_res_init(void);
51 adx 30 extern int irc_dn_expand(const unsigned char *msg, const unsigned char *eom, const unsigned char *src, char *dst, int dstsiz);
52     extern int irc_dn_skipname(const unsigned char *ptr, const unsigned char *eom);
53     extern unsigned int irc_ns_get16(const unsigned char *src);
54     extern unsigned long irc_ns_get32(const unsigned char *src);
55     extern void irc_ns_put16(unsigned int src, unsigned char *dst);
56     extern void irc_ns_put32(unsigned long src, unsigned char *dst);
57     extern int irc_res_mkquery(const char *dname, int class, int type, unsigned char *buf, int buflen);
58     #endif /* INCLUDED_res_h */
59    

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision