X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=interpolate.h;h=190a180b587aa565ae2ae71f9eb068ad75db168f;hb=f0df4ed5629c25e9978708115ad654b9f83f55df;hp=00c63a5622da8545f46fb6b170951b224679bc73;hpb=d1cb7ac49b7ab9195383bca50f6aec8b6de2c0d7;p=git.git diff --git a/interpolate.h b/interpolate.h index 00c63a562..190a180b5 100644 --- a/interpolate.h +++ b/interpolate.h @@ -5,14 +5,22 @@ #ifndef INTERPOLATE_H #define INTERPOLATE_H +/* + * Convert a NUL-terminated string in buffer orig, + * performing substitutions on %-named sub-strings from + * the interpretation table. + */ struct interp { char *name; char *value; }; +extern void interp_set_entry(struct interp *table, int slot, const char *value); +extern void interp_clear_table(struct interp *table, int ninterps); + extern int interpolate(char *result, int reslen, - char *orig, - struct interp *interps, int ninterps); + const char *orig, + const struct interp *interps, int ninterps); #endif /* INTERPOLATE_H */