1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains source for the ZFormatRawNoticeList function.
4 * Created by: Robert French
7 * $Author: warmenhoven $
9 * Copyright (c) 1987 by the Massachusetts Institute of Technology.
10 * For copying and distribution information, see the file
16 static char rcsid_ZFormatRawNoticeList_c
[] = "$Header$";
21 Code_t
ZFormatRawNoticeList(notice
, list
, nitems
, buffer
, ret_len
)
28 char header
[Z_MAXHEADERLEN
];
33 if ((retval
= Z_FormatRawHeader(notice
, header
, sizeof(header
),
34 &hdrlen
, NULL
, NULL
)) != ZERR_NONE
)
38 for (i
=0;i
<nitems
;i
++)
39 size
+= strlen(list
[i
])+1;
41 *ret_len
= hdrlen
+size
;
43 if (!(*buffer
= (char *) malloc((unsigned) *ret_len
)))
46 (void) memcpy(*buffer
, header
, hdrlen
);
50 for (;nitems
;nitems
--, list
++) {
52 (void) memcpy(ptr
, *list
, i
);