ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/branches/newio/include/irc_reslib.h
Revision: 2381
Committed: Sat Jul 6 16:22:05 2013 UTC (10 years, 8 months ago) by michael
Content type: text/x-chdr
File size: 1748 byte(s)
Log Message:
- Add NEWIO branch

File Contents

# Content
1 /*
2 * include/irc_reslib.h (C)opyright 1992 Darren Reed.
3 *
4 * $Id$
5 */
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 (s) = ((uint16_t)t_cp[0] << 8) \
15 | ((uint16_t)t_cp[1]) \
16 ; \
17 (cp) += NS_INT16SZ; \
18 }
19
20 #define IRC_NS_GET32(l, cp) { \
21 const unsigned char *t_cp = (const unsigned char *)(cp); \
22 (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 ; \
27 (cp) += NS_INT32SZ; \
28 }
29
30 #define IRC_NS_PUT16(s, cp) { \
31 uint16_t t_s = (uint16_t)(s); \
32 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 uint32_t t_l = (uint32_t)(l); \
40 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 extern struct irc_ssaddr irc_nsaddr_list[];
49 extern int irc_nscount;
50 extern void irc_res_init(void);
51 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