]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/lib/ZSendRLst.c
new upstream tarball
[1ts-debian.git] / zephyr / lib / ZSendRLst.c
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It contains source for the ZSendRawNotice function.
3  *
4  *      Created by:     John T. Kohl
5  *
6  *      $Id: ZSendRLst.c 2135 2008-01-21 03:39:30Z kcr $
7  *
8  *      Copyright (c) 1988 by the Massachusetts Institute of Technology.
9  *      For copying and distribution information, see the file
10  *      "mit-copyright.h". 
11  */
12
13 #ifndef lint
14 static const char rcsid_ZSendRawList_c[] = "$Id: ZSendRLst.c 2135 2008-01-21 03:39:30Z kcr $";
15 #endif
16
17 #include <internal.h>
18
19 Code_t ZSendRawList(ZNotice_t *notice,
20                     char *list[],
21                     int nitems)
22 {
23     return(ZSrvSendRawList(notice, list, nitems, Z_XmitFragment));
24 }
25
26 Code_t ZSrvSendRawList(ZNotice_t *notice,
27                        char *list[],
28                        int nitems,
29                        Code_t (*send_routine)(ZNotice_t *, char *, int, int))
30 {
31     Code_t retval;
32     ZNotice_t newnotice;
33     char *buffer;
34     int len;
35
36     if ((retval = ZFormatRawNoticeList(notice, list, nitems, &buffer, 
37                                        &len)) != ZERR_NONE)
38         return (retval);
39
40     if ((retval = ZParseNotice(buffer, len, &newnotice)) != ZERR_NONE)
41         return (retval);
42     
43     retval = Z_SendFragmentedNotice(&newnotice, len, NULL, send_routine);
44
45     free(buffer);
46
47     return (retval);
48 }