]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/lib/ZFmtSmRaw.c
a9ce79d1465f26a1073a131a83c0d368d4843a5f
[1ts-debian.git] / zephyr / lib / ZFmtSmRaw.c
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It contains source for the ZFormatSmallRawNotice function.
3  *
4  *      Created by:     Robert French
5  *
6  *      $Id$
7  *
8  *      Copyright (c) 1987 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 char rcsid_ZFormatRawNotice_c[] = "$Id$";
15 #endif
16
17 #include <internal.h>
18
19 Code_t ZFormatSmallRawNotice(notice, buffer, ret_len)
20     ZNotice_t *notice;
21     ZPacket_t buffer;
22     int *ret_len;
23 {
24     Code_t retval;
25     int hdrlen;
26     
27     if ((retval = Z_FormatRawHeader(notice, buffer, Z_MAXHEADERLEN,
28                                     &hdrlen, NULL, NULL)) != ZERR_NONE)
29         return (retval);
30
31     *ret_len = hdrlen+notice->z_message_len;
32
33     if (*ret_len > Z_MAXPKTLEN)
34         return (ZERR_PKTLEN);
35
36     (void) memcpy(buffer+hdrlen, notice->z_message, notice->z_message_len);
37
38     return (ZERR_NONE);
39 }