Mercurial > pidgin.yaz
annotate src/protocols/zephyr/ZFmtSmRLst.c @ 11526:744b70723801
[gaim-migrate @ 13774]
Removing a problematic correction.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 12 Sep 2005 14:45:49 +0000 |
parents | 64895571248f |
children | 7c2e2c4d45a4 |
rev | line source |
---|---|
2086 | 1 /* This file is part of the Project Athena Zephyr Notification System. |
2 * It contains source for the ZFormatSmallRawNoticeList function. | |
3 * | |
4 * Created by: John T. Kohl | |
5 * | |
6 * Copyright (c) 1988 by the Massachusetts Institute of Technology. | |
7 * For copying and distribution information, see the file | |
8 * "mit-copyright.h". | |
9 */ | |
10 | |
8792
43d6c08d7e96
[gaim-migrate @ 9554]
Christian Hammond <chipx86@chipx86.com>
parents:
2086
diff
changeset
|
11 #include "internal.h" |
2086 | 12 |
13 Code_t ZFormatSmallRawNoticeList(notice, list, nitems, buffer, ret_len) | |
14 ZNotice_t *notice; | |
15 char *list[]; | |
16 int nitems; | |
17 ZPacket_t buffer; | |
18 int *ret_len; | |
19 { | |
20 Code_t retval; | |
21 int hdrlen, i, size; | |
22 char *ptr; | |
23 | |
24 if ((retval = Z_FormatRawHeader(notice, buffer, Z_MAXHEADERLEN, | |
25 &hdrlen, NULL, NULL)) != ZERR_NONE) | |
26 return (retval); | |
27 | |
28 size = 0; | |
29 for (i=0;i<nitems;i++) | |
30 size += strlen(list[i])+1; | |
31 | |
32 *ret_len = hdrlen+size; | |
33 | |
34 if (*ret_len > Z_MAXPKTLEN) | |
35 return (ZERR_PKTLEN); | |
36 | |
37 ptr = buffer+hdrlen; | |
38 | |
39 for (;nitems;nitems--, list++) { | |
40 i = strlen(*list)+1; | |
41 (void) memcpy(ptr, *list, i); | |
42 ptr += i; | |
43 } | |
44 | |
45 return (ZERR_NONE); | |
46 } |