2
|
1 /*
|
|
2 *
|
|
3 *
|
|
4 *
|
|
5 */
|
|
6
|
|
7 #include "aim.h"
|
|
8
|
|
9 int aimutil_put8(u_char *buf, u_short data)
|
|
10 {
|
|
11 buf[0] = data&0xff;
|
|
12 return 1;
|
|
13 }
|
|
14
|
|
15 /*
|
|
16 * Endian-ness issues here?
|
|
17 */
|
|
18 int aimutil_put16(u_char *buf, u_short data)
|
|
19 {
|
|
20 buf[0] = (data>>8)&0xff;
|
|
21 buf[1] = (data)&0xff;
|
|
22 return 2;
|
|
23 }
|
|
24
|
|
25 int aimutil_put32(u_char *buf, u_long data)
|
|
26 {
|
|
27 buf[0] = (data>>24)&0xff;
|
|
28 buf[1] = (data>>16)&0xff;
|
|
29 buf[2] = (data>>8)&0xff;
|
|
30 buf[3] = (data)&0xff;
|
|
31 return 4;
|
|
32 }
|
|
33
|
|
34 int aimutil_putstr(u_char *dest, u_char *src, int len)
|
|
35 {
|
|
36 memcpy(dest, src, len);
|
|
37 return len;
|
|
38 }
|