strbuf: separate callback for strbuf_expand:ing literals
Expanding '%n' and '%xNN' is generic functionality, so extract that from the pretty.c formatter into a callback that can be reused. No functional change intended Signed-off-by: Anders Waldenborg <anders@0x63.nu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
d9b936db52
commit
fd2015b323
8
strbuf.h
8
strbuf.h
@ -320,6 +320,14 @@ void strbuf_expand(struct strbuf *sb,
|
||||
expand_fn_t fn,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* Used as callback for `strbuf_expand` to only expand literals
|
||||
* (i.e. %n and %xNN). The context argument is ignored.
|
||||
*/
|
||||
size_t strbuf_expand_literal_cb(struct strbuf *sb,
|
||||
const char *placeholder,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* Used as callback for `strbuf_expand()`, expects an array of
|
||||
* struct strbuf_expand_dict_entry as context, i.e. pairs of
|
||||
|
||||
Reference in New Issue
Block a user