defined.
o Add new functions to SilcStack API in lib/silcutil/silcstack.[ch]. Add
- silc_stack_[set|get]_byte_alignment and
- silc_stack_[set|get]_address_alignment. The _byte_alignment defines the
- default alignment when allocating aligned memory for structures etc.
- The address_alignment defines the default (default is 0) alignment for
- memory addresses SilcStack routines return. Usefull when needing
- aligned addresses for example for hardware devices (such as crypto
- accelerators). Move also the low level silc_stack_malloc and
- silc_stack_realloc from silcstack_i.h to silcstack.h.
+ silc_stack_[set|get]_alignment. It defines the default alignment used
+ when allocating memory from stack. It can be used to specify special
+ alignments too when needed (such as for hardware devices like crypto
+ accelerators). Move also the low level silc_stack_malloc and
+ silc_stack_realloc from silcstack_i.h to silcstack.h. Remove the
+ _ua unaligned memory allocation routines. Remove unaligned memory
+ allocation possibility.
+
+ o Add '%@' format to silc_snprintf functions. It marks for external
+ rendering function of following type:
+
+ /* Snprintf rendering function. The `data' is rendered into a string
+ and allocated string is returned. If NULL is returned the
+ rendering is skipped and ignored. If the returned string does
+ not fit to the destination buffer it may be truncated. */
+ typedef char *(*SilcSnprintfRender)(void *data);
+
+ It can work like following:
+
+ char *id_renderer(void *data)
+ {
+ char tmp[32];
+ id_to_str(tmp, sizeof(tmp), (SilcID *)data);
+ return strdup(tmp);
+ }
+
+ silc_snprintf(buf, sizeof(buf), "Client ID %@", id_renderer, client_id);
(o Generic SilcStatus or SilcResult that includes all possible status and
error conditions, including those of SILC protocol. Though, the SILC