author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 22 Nov 2008 23:09:30 +0000 (00:09 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Nov 2008 03:55:47 +0000 (19:55 -0800) | ||
commit | 9b864e730bda0e028a85387fa568429724582f22 | |
tree | d7c43e556e2e2d7955a39c83bcb9e5e4d147ef0e | tree | snapshot |
parent | 6fc4a7e546d5e2b0ce545f73b5c1829887db2462 | commit | diff |
add strbuf_expand_dict_cb(), a helper for simple cases
The new callback function strbuf_expand_dict_cb() can be used together
with strbuf_expand() if there is only a small number of placeholders
for static replacement texts. It expects its dictionary as an array of
placeholder+value pairs as context parameter, terminated by an entry
with the placeholder member set to NULL.
The new helper is intended to aid converting the remaining calls of
interpolate(). strbuf_expand() is smaller, more flexible and can be
used to go faster than interpolate(), so it should replace the latter.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The new callback function strbuf_expand_dict_cb() can be used together
with strbuf_expand() if there is only a small number of placeholders
for static replacement texts. It expects its dictionary as an array of
placeholder+value pairs as context parameter, terminated by an entry
with the placeholder member set to NULL.
The new helper is intended to aid converting the remaining calls of
interpolate(). strbuf_expand() is smaller, more flexible and can be
used to go faster than interpolate(), so it should replace the latter.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/technical/api-strbuf.txt | diff | blob | history | |
strbuf.c | diff | blob | history | |
strbuf.h | diff | blob | history |