updates.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 29 Jun 2007 12:09:14 +0000 (12:09 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 29 Jun 2007 12:09:14 +0000 (12:09 +0000)
TODO

diff --git a/TODO b/TODO
index cce78c711fc4e42c47a8007e506494f111a9b691..92ce8299bddb81c48a60e884da2ab1833e7e29d8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -253,6 +253,26 @@ Runtime library, lib/silcutil/
    _ua unaligned memory allocation routines.  Remove unaligned memory
    allocation possibility.
 
    _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
     protocol related status (currently in silcstatus.h) cannot be in
  (o Generic SilcStatus or SilcResult that includes all possible status and
     error conditions, including those of SILC protocol.  Though, the SILC
     protocol related status (currently in silcstatus.h) cannot be in