X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=zephyr%2Flib%2FZFmtSmRaw.c;fp=zephyr%2Flib%2FZFmtSmRaw.c;h=16d0f83364d59a09a5f52b85bdc1ba3157eac706;hb=01134f8b62d6bb2ce42e3563e22a34b34093843b;hp=473c0b505b4d5db0d2bdf84d589af4817965b326;hpb=d940aeab23bcc4a4a1dfb461b55f203161964a21;p=1ts-debian.git diff --git a/zephyr/lib/ZFmtSmRaw.c b/zephyr/lib/ZFmtSmRaw.c index 473c0b5..16d0f83 100644 --- a/zephyr/lib/ZFmtSmRaw.c +++ b/zephyr/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); +}