5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 1997 - 2007 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
20 /****h* silcutil/SILC Buffer Format Interface
24 * SILC Buffer Format API provides functions for formatting different data
25 * types into a buffer and retrieving different data types from a buffer
26 * into specified data types. It is especially useful to encode packets,
27 * protocol payloads and such.
29 * As the SilcBuffer API is not thread-safe these routines may not be used
30 * in multithreaded environment with a same SilcBuffer context without
31 * concurrency control.
35 * SilcBufferStruct buffer;
37 * memset(&buffer, 0, sizeof(buffer));
38 * ret = silc_buffer_format(&buffer,
39 * SILC_STR_UINT32(intval),
40 * SILC_STR_UINT8(charval),
41 * SILC_STR_UINT64(longintval),
42 * SILC_STR_UINT16(str_len),
43 * SILC_STR_DATA(str, str_len),
53 /****f* silcutil/SilcBufferFormatAPI/SilcBufferFormatFunc
57 * typedef int (*SilcBuffeSFormatFunc)(SilcStack stack,
64 * Formatting function callback given with SILC_STR_FUNC type. The
65 * `buffer' is the buffer being formatted at the location where the
66 * SILC_STR_FUNC was placed in formatting. The function should call
67 * silc_buffer_senlarge before it adds the data to the buffer to make
68 * sure that it has enough space. The buffer->head points to the
69 * start of the buffer and silc_buffer_headlen() gives the length
70 * of the currently formatted data area. It is also possible to use
71 * silc_buffer_sformat with `buffer' which will enlarge the buffer if
74 * The `value' is the value given to SILC_STR_FUNC that is to be formatted
75 * into the buffer. It may be NULL if the function is not formatting
76 * new data into the buffer. The `context' is caller specific context.
77 * Returns -1 on error and length of the formatted value otherwise, and
78 * 0 if nothing was formatted.
81 typedef int (*SilcBufferFormatFunc)(SilcStack stack, SilcBuffer buffer,
82 void *value, void *context);
84 /****f* silcutil/SilcBufferFormatAPI/SilcBufferUnformatFunc
88 * typedef int (*SilcBufferUnformatFunc)(SilcBuffer buffer,
94 * Unformatting function callback given with SILC_STR_FUNC type. The
95 * `buffer' is the buffer being unformatted and is at the location where
96 * the SILC_STR_FUNC was placed in unformatting. The function should
97 * check there is enough data in the `buffer' before trying to decode
100 * If this function unformats anything from the buffer its value is to
101 * be returned to the `value' pointer. The implementation should itself
102 * decide whether the unformatted value is allocated or not. If this
103 * function does not unformat anything, nothing is returned to `value'
105 * The `context' is caller specific context. Returns -1 on error, and
106 * length of the unformatted value otherwise, and 0 if nothing was
110 typedef int (*SilcBufferUnformatFunc)(SilcStack stack, SilcBuffer buffer,
111 void **value, void *context);
115 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_format
119 * int silc_buffer_format(SilcBuffer dst, ...);
123 * Formats a buffer from a variable argument list. Returns -1 if the
124 * system is out of memory and the length of the formatted buffer otherwise.
125 * The buffer is enlarged automatically during formatting, if it doesn't
126 * already have enough space. Sets silc_errno in case of error.
130 * Three basic ways of using silc_buffer_format:
132 * // Statically allocated zero size buffer
133 * SilcBufferStruct buffer;
135 * memset(&buffer, 0, sizeof(buffer));
136 * ret = silc_buffer_format(&buffer,
137 * SILC_STR_UINT32(intval),
138 * SILC_STR_UINT8(charval),
139 * SILC_STR_UINT32(intval),
140 * SILC_STR_UINT16(str_len),
141 * SILC_STR_DATA(str, str_len),
146 * // Free the allocated data
147 * silc_buffer_purge(&buffer);
149 * // Dynamically allocated zero size buffer
151 * buf = silc_buffer_alloc(0);
152 * ret = silc_buffer_format(buf,
153 * SILC_STR_UINT32(intval),
154 * SILC_STR_UINT8(charval),
159 * // Free the allocated buffer
160 * silc_buffer_free(buf);
162 * // Dynamically allocated buffer with enough space
164 * buf = silc_buffer_alloc(2 + str_len);
165 * ret = silc_buffer_format(buf,
166 * SILC_STR_UINT16(str_len),
167 * SILC_STR_DATA(str, str_len),
173 int silc_buffer_format(SilcBuffer dst, ...);
175 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat
179 * int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...);
183 * Same as silc_buffer_format but uses `stack' to allocate the memory.
184 * if `stack' is NULL reverts back to silc_buffer_format call. Returns
185 * -1 if system is out of memory. Sets silc_errno in case of error.
187 * Note that this call consumes the `stack'. The caller should push the
188 * stack before calling the function and pop it later.
191 int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...);
193 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_format_vp
197 * int silc_buffer_format_vp(SilcBuffer dst, va_list vp);
201 * Formats a buffer from a variable argument list indicated by the `ap'.
202 * Returns -1 if system is out of memory and the length of the formatted
206 int silc_buffer_format_vp(SilcBuffer dst, va_list ap);
208 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat_vp
212 * int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list vp);
216 * Same as silc_buffer_format_vp but uses `stack' to allocate the memory.
217 * if `stack' is NULL reverts back to silc_buffer_format_vp call. Returns
218 * -1 if system is out of memory. Sets silc_errno in case of error.
220 * Note that this call consumes the `stack'. The caller should push the
221 * stack before calling the function and pop it later.
224 int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap);
226 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat
230 * int silc_buffer_unformat(SilcBuffer src, ...);
234 * Unformats a buffer from a variable argument list. Returns -1 on error
235 * and the length of the unformatted buffer otherwise. Sets silc_errno
240 * ret = silc_buffer_unformat(buffer,
241 * SILC_STR_UINT32(&intval),
242 * SILC_STR_UINT8(&charval),
243 * SILC_STR_OFFSET(4),
244 * SILC_STR_UI16_NSTRING_ALLOC(&str, &str_len),
250 int silc_buffer_unformat(SilcBuffer src, ...);
252 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat
256 * int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...);
260 * Same as silc_buffer_unformat but uses `stack' to allocate the memory.
261 * if `stack' is NULL reverts back to silc_buffer_format call.
263 * Note that this call consumes the `stack'. The caller should push the
264 * stack before calling the function and pop it later.
267 int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...);
269 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat_vp
273 * int silc_buffer_unformat_vp(SilcBuffer src, va_list vp);
277 * Unformats a buffer from a variable argument list indicated by the `ap'.
278 * Returns -1 on error and the length of the unformatted buffer otherwise.
281 int silc_buffer_unformat_vp(SilcBuffer src, va_list ap);
283 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat_vp
287 * int silc_buffer_sunformat_vp(SilcBuffer src, va_list vp);
291 * Same as silc_buffer_unformat_vp but uses `stack' to allocate the
292 * memory. if `stack' is NULL reverts back to silc_buffer_format_vp call.
294 * Note that this call consumes the `stack'. The caller should push the
295 * stack before calling the function and pop it later.
298 int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap);
300 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_strformat
304 * int silc_buffer_strformat(SilcBuffer dst, ...);
308 * Formats a buffer from variable argument list of strings. Each
309 * string must be NULL-terminated and the variable argument list must
310 * be end with SILC_STRFMT_END argument. This allows that a string in
311 * the list can be NULL, in which case it is skipped. This automatically
312 * allocates the space for the buffer data but `dst' must be already
313 * allocated by the caller. Returns -1 if system is out of memory and
318 * ret = silc_buffer_strformat(buffer, "foo", "bar", SILC_STRFMT_END);
323 int silc_buffer_strformat(SilcBuffer dst, ...);
325 /****f* silcutil/SilcBufferFormatAPI/silc_buffer_sstrformat
329 * int silc_buffer_strformat(SilcStack stack, SilcBuffer dst, ...);
333 * Formats a buffer from variable argument list of strings. Each
334 * string must be NULL-terminated and the variable argument list must
335 * be end with SILC_STRFMT_END argument. This allows that a string in
336 * the list can be NULL, in which case it is skipped. This automatically
337 * allocates the space for the buffer data but `dst' must be already
338 * allocated by the caller. This function is equivalent to
339 * silc_buffer_strformat but allocates memory from `stack'. Returns -1
340 * if system is out of memory and sets silc_errno.
342 * Note that this call consumes the `stack'. The caller should push the
343 * stack before calling the function and pop it later.
346 int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...);
348 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT8
352 * #define SILC_STR_SINT8() ...
356 * One 8-bit signed integer.
358 * Formatting: SILC_STR_SINT8(SilcInt8)
359 * Unformatting: SILC_STR_SINT8(SilcInt8 *)
362 #define SILC_STR_SINT8(x) SILC_PARAM_SINT8, (x)
364 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT8
368 * #define SILC_STR_UINT8() ...
372 * One 8-bit unsigned integer.
374 * Formatting: SILC_STR_UINT8(SilcUInt8)
375 * Unformatting: SILC_STR_UINT8(SilcUInt8 *)
378 #define SILC_STR_UINT8(x) SILC_PARAM_UINT8, (x)
381 #define SILC_STR_SI_CHAR(x) SILC_PARAM_SINT8, (x)
382 #define SILC_STR_UI_CHAR(x) SILC_PARAM_UINT8, (x)
384 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT16
388 * #define SILC_STR_SINT16() ...
394 * Formatting: SILC_STR_SINT16(SilcInt16)
395 * Unformatting: SILC_STR_SINT16(SilcInt16 *)
398 #define SILC_STR_SINT16(x) SILC_PARAM_SINT16, (x)
400 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT16
404 * #define SILC_STR_UINT16() ...
410 * Formatting: SILC_STR_UINT16(SilcUInt16)
411 * Unformatting: SILC_STR_UINT16(SilcUInt16 *)
414 #define SILC_STR_UINT16(x) SILC_PARAM_UINT16, (x)
417 #define SILC_STR_SI_SHORT(x) SILC_PARAM_SINT16, (x)
418 #define SILC_STR_UI_SHORT(x) SILC_PARAM_UINT16, (x)
420 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT32
424 * #define SILC_STR_SINT32() ...
430 * Formatting: SILC_STR_SINT32(SilcInt32)
431 * Unformatting: SILC_STR_SINT32(SilcInt32 *)
434 #define SILC_STR_SINT32(x) SILC_PARAM_SINT32, (x)
436 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT32
440 * #define SILC_STR_UINT32() ...
446 * Formatting: SILC_STR_UINT32(SilcUInt32)
447 * Unformatting: SILC_STR_UINT32(SilcUInt32 *)
450 #define SILC_STR_UINT32(x) SILC_PARAM_UINT32, (x)
453 #define SILC_STR_SI_INT(x) SILC_PARAM_SINT32, (x)
454 #define SILC_STR_UI_INT(x) SILC_PARAM_UINT32, (x)
456 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT64
460 * #define SILC_STR_SINT64() ...
466 * Formatting: SILC_STR_SINT64(SilcInt64)
467 * Unformatting: SILC_STR_SINT64(SilcInt64 *)
470 #define SILC_STR_SI_INT64(x) SILC_PARAM_SINT64, (x)
472 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT64
476 * #define SILC_STR_UINT64() ...
482 * Formatting: SILC_STR_UINT64(SilcUInt64)
483 * Unformatting: SILC_STR_UINT64(SilcUInt64 *)
486 #define SILC_STR_UI_INT64(x) SILC_PARAM_UINT64, (x)
489 #define SILC_STR_SI_INT64(x) SILC_PARAM_SINT64, (x)
490 #define SILC_STR_UI_INT64(x) SILC_PARAM_UINT64, (x)
492 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_STRING
496 * #define SILC_STR_UI8_STRING() ...
497 * #define SILC_STR_UI8_STRING_ALLOC() ...
498 * #define SILC_STR_UI16_STRING() ...
499 * #define SILC_STR_UI16_STRING_ALLOC() ...
500 * #define SILC_STR_UI32_STRING() ...
501 * #define SILC_STR_UI32_STRING_ALLOC() ...
505 * Unsigned NULL terminated string. Note that the string must be
506 * NULL terminated because strlen() will be used to get the length of
509 * Formatting: SILC_STR_UI32_STRING(unsigned char *)
510 * Unformatting: SILC_STR_UI32_STRING(unsigned char **)
512 * Unformatting procedure will check for length of the string from the
513 * buffer before trying to get the string out. Thus, one *must* format the
514 * length as UI_INT or UI_SHORT into the buffer *before* formatting the
515 * actual string to the buffer, and, in unformatting one must ignore the
516 * length of the string because unformatting procedure will take it
521 * Formatting: ..., SILC_STR_UI_INT(strlen(string)),
522 * SILC_STR_UI32_STRING(string), ...
523 * Unformatting: ..., SILC_STR_UI32_STRING(&string), ...
525 * I.e., you can ignore the formatted length field in unformatting.
527 * UI8, UI16 and UI32 means that the length is considered to be
528 * either char (8 bits), short (16 bits) or int (32 bits) in
531 * _ALLOC routines automatically allocates memory for the variable sent
532 * as argument in unformatting.
535 #define SILC_STR_UI8_STRING(x) SILC_PARAM_UI8_STRING, (x)
536 #define SILC_STR_UI8_STRING_ALLOC(x) SILC_PARAM_UI8_STRING | SILC_PARAM_ALLOC, (x)
537 #define SILC_STR_UI16_STRING(x) SILC_PARAM_UI16_STRING, (x)
538 #define SILC_STR_UI16_STRING_ALLOC(x) SILC_PARAM_UI16_STRING | SILC_PARAM_ALLOC, (x)
539 #define SILC_STR_UI32_STRING(x) SILC_PARAM_UI32_STRING, (x)
540 #define SILC_STR_UI32_STRING_ALLOC(x) SILC_PARAM_UI32_STRING | SILC_PARAM_ALLOC, (x)
542 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_NSTRING
546 * #define SILC_STR_UI8_NSTRING() ...
547 * #define SILC_STR_UI8_NSTRING_ALLOC() ...
548 * #define SILC_STR_UI16_NSTRING() ...
549 * #define SILC_STR_UI16_NSTRING_ALLOC() ...
550 * #define SILC_STR_UI32_NSTRING() ...
551 * #define SILC_STR_UI32_NSTRING_ALLOC() ...
555 * Unsigned string. Second argument is the length of the string.
557 * Formatting: SILC_STR_UI32_NSTRING(unsigned char *, SilcUInt32)
558 * Unformatting: SILC_STR_UI32_NSTRING(unsigned char **, SilcUInt32 *)
560 * Unformatting procedure will check for length of the string from the
561 * buffer before trying to get the string out. Thus, one *must* format the
562 * length as UI_INT or UI_SHORT into the buffer *before* formatting the
563 * actual string to the buffer, and, in unformatting one must ignore the
564 * length of the string because unformatting procedure will take it
569 * Formatting: ..., SILC_STR_UI_INT(strlen(string)),
570 * SILC_STR_UI32_NSTRING(string, strlen(string)), ...
571 * Unformatting: ..., SILC_STR_UI32_NSTRING(&string, &len), ...
573 * I.e., you can ignore the formatted length field in unformatting. The
574 * length taken from the buffer is returned to the pointer sent as
575 * argument (&len in above example).
577 * UI8, UI16 and UI32 means that the length is considered to be
578 * either char (8 bits), short (16 bits) or int (32 bits) in
581 * _ALLOC routines automatically allocates memory for the variable sent
582 * as argument in unformatting.
585 #define SILC_STR_UI8_NSTRING(x, l) SILC_PARAM_UI8_NSTRING, (x), (l)
586 #define SILC_STR_UI8_NSTRING_ALLOC(x, l) \
587 SILC_PARAM_UI8_NSTRING | SILC_PARAM_ALLOC, (x), (l)
588 #define SILC_STR_UI16_NSTRING(x, l) SILC_PARAM_UI16_NSTRING, (x), (l)
589 #define SILC_STR_UI16_NSTRING_ALLOC(x, l) \
590 SILC_PARAM_UI16_NSTRING | SILC_PARAM_ALLOC, (x), (l)
591 #define SILC_STR_UI32_NSTRING(x, l) SILC_PARAM_UI32_NSTRING, (x), (l)
592 #define SILC_STR_UI32_NSTRING_ALLOC(x, l) \
593 SILC_PARAM_UI32_NSTRING | SILC_PARAM_ALLOC, (x), (l)
595 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_DATA
599 * #define SILC_STR_DATA() ...
600 * #define SILC_STR_DATA_ALLOC() ...
604 * Binary data formatting. Second argument is the length of the data.
606 * Formatting: SILC_STR_DATA(unsigned char *, SilcUInt32)
607 * Unformatting: SILC_STR_DATA(unsigned char **, SilcUInt32)
609 * This type can be used to take arbitrary size data block from the buffer
610 * by sending the requested amount of bytes as argument.
612 * _ALLOC routines automatically allocates memory for the variable sent
613 * as argument in unformatting.
616 #define SILC_STR_DATA(x, l) SILC_PARAM_UICHAR, (x), (l)
617 #define SILC_STR_DATA_ALLOC(x, l) SILC_PARAM_UICHAR | SILC_PARAM_ALLOC, (x), (l)
620 #define SILC_STR_UI_XNSTRING(x, l) SILC_PARAM_UICHAR, (x), (l)
621 #define SILC_STR_UI_XNSTRING_ALLOC(x, l) SILC_PARAM_UICHAR | SILC_PARAM_ALLOC, (x), (l)
623 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_BUFFER
627 * #define SILC_STR_BUFFER() ...
628 * #define SILC_STR_BUFFER_ALLOC() ...
632 * SilcBuffer formatting.
634 * Formatting: SILC_STR_BUFFER(SilcBuffer)
635 * Unformatting: SILC_STR_BUFFER(SilcBuffer)
637 * This type can be used to format and unformat SilcBuffer. Note that, the
638 * length of the buffer will be automatically encoded into the buffer as
639 * a 32-bit integer. In unformatting the SilcBuffer context must be
642 * _ALLOC routines automatically allocates memory inside SilcBuffer in
646 #define SILC_STR_BUFFER(x) SILC_PARAM_BUFFER, (x)
647 #define SILC_STR_BUFFER_ALLOC(x) SILC_PARAM_BUFFER | SILC_PARAM_ALLOC, (x)
649 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_FUNC
653 * #define SILC_STR_FUNC() ...
657 * SilcBuffer formatting.
659 * Formatting: SILC_STR_FUNC(function, void *value, void *context)
660 * Unformatting: SILC_STR_FUNC(function, void **value, void *context)
662 * This type can be used to call the `function' of the type
663 * SilcBufferFormatFunc or SilcBufferUnformatFunc to encode or decode
664 * the `value'. In encoding the `value' will be passed to the `function'
665 * and can be encoded into the buffer. The buffer will be passed as
666 * well to the `function' at the location where SILC_STR_FUNC is placed
667 * in formatting. The `context' delivers caller specific context to
670 * In unformatting the `function' will decode the encoded type and
671 * return it to `value' pointer. The decoding function should decide
672 * itself whether to allocate or not the decoded value.
674 * The `function' does not have to encode anything and passing `value'
675 * as NULL is allowed. The `function' could for example modify the
680 * // Encode payload, encrypt and compute MAC.
681 * silc_buffer_format(buf,
682 * SILC_STR_FUNC(foo_encode_id, id, ctx),
683 * SILC_STR_UINT16(len),
684 * SILC_STR_DATA(data, len),
685 * SILC_STR_FUNC(foo_buf_encrypt, NULL, key),
686 * SILC_STR_FUNC(foo_buf_hmac, NULL, hmac),
687 * SILC_STR_DATA(iv, iv_len);
690 * // Check MAC, decrypt and decode payload
691 * silc_buffer_unformat(buf,
692 * SILC_STR_FUNC(foo_buf_hmac, NULL, hmac),
693 * SILC_STR_FUNC(foo_buf_decrypt, NULL, key),
694 * SILC_STR_FUNC(foo_decode_id, &id, ctx),
695 * SILC_STR_UINT16(&len),
699 #define SILC_STR_FUNC(func, val, context) SILC_PARAM_FUNC, \
700 func, (val), (context)
702 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_OFFSET
706 * #define SILC_STR_OFFSET() ...
710 * Offset in buffer. This can be used in formatting and unformatting to
711 * move the data pointer of the buffer either forwards (positive offset)
712 * or backwards (negative offset). It can be used to for example skip
713 * some types during unformatting.
717 * ..., SILC_STR_OFFSET(5), ...
718 * ..., SILC_STR_OFFSET(-3), ...
720 * Moves the data pointer at the point of the offset either forward
721 * or backward and then moves to the next type. Multiple SILC_STR_OFFSETs
722 * can be used in formatting and unformatting at the same time.
725 #define SILC_STR_OFFSET(x) SILC_PARAM_OFFSET, (x)
727 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_ADVANCE
731 * #define SILC_STR_ADVANCE ...
735 * Advance the buffer to the end of the data after the formatting is
736 * done. In normal operation when the formatted data is written the
737 * buffer is positioned at the start of the data. With SILC_STR_ADVANCE
738 * the buffer will be positioned at the end of the data. This makes it
739 * easy to add new data immediately after the previously added data.
740 * The SILC_STR_ADVANCE may also be used in unformatting.
745 * len = read(fd, buf, sizeof(buf));
747 * // Add read data to the buffer
748 * silc_buffer_format(buffer,
750 * SILC_STR_DATA(buf, len),
754 * // Move to beginning of buffer
755 * silc_buffer_start(buffer);
758 #define SILC_STR_ADVANCE SILC_PARAM_ADVANCE
760 /****d* silcutil/SilcBufferFormatAPI/SILC_STR_END
764 * #define SILC_STR_END ...
768 * Marks end of the argument list. This must be at the end of the
769 * argument list or error will occur.
772 #define SILC_STR_END SILC_PARAM_END
774 /****d* silcutil/SilcBufferFormatAPI/SILC_STRFMT_END
778 * #define SILC_STRFMT_END ...
782 * Marks end of the argument list in silc_buffer_strformat function.
783 * This must be at the end of the argument list or error will occur.
786 #define SILC_STRFMT_END (void *)SILC_STR_END
788 #endif /* !SILCBUFFMT_H */