diff options
author | Karl Ramm <kcr@mit.edu> | 2007-12-25 00:56:08 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2007-12-25 00:56:08 +0000 |
commit | 1a0e03eb19998ab496a6ea845ff2c42d9a02df0b (patch) | |
tree | 29b47c8532e1f1678063fbb1b851ee4208134626 /lib/ZFmtSmRaw.c | |
parent | 3f120f880be9ae9aa1612ddc2412e9acb9a8e85e (diff) |
applied athena-update-branch patch
Diffstat (limited to 'lib/ZFmtSmRaw.c')
-rw-r--r-- | lib/ZFmtSmRaw.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/ZFmtSmRaw.c b/lib/ZFmtSmRaw.c index a9ce79d..0fcd74c 100644 --- a/lib/ZFmtSmRaw.c +++ b/lib/ZFmtSmRaw.c @@ -37,3 +37,26 @@ Code_t ZFormatSmallRawNotice(notice, buffer, ret_len) return (ZERR_NONE); } + +Code_t ZNewFormatSmallRawNotice(notice, buffer, ret_len) + ZNotice_t *notice; + ZPacket_t buffer; + int *ret_len; +{ + Code_t retval; + int hdrlen; + + if ((retval = Z_AsciiFormatRawHeader(notice, buffer, Z_MAXHEADERLEN, + &hdrlen, NULL, NULL, NULL, NULL)) + != ZERR_NONE) + return (retval); + + *ret_len = hdrlen+notice->z_message_len; + + if (*ret_len > Z_MAXPKTLEN) + return (ZERR_PKTLEN); + + (void) memcpy(buffer+hdrlen, notice->z_message, notice->z_message_len); + + return (ZERR_NONE); +} |