2006-09-20 01:31:51 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2006 Jon Loeliger
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INTERPOLATE_H
|
|
|
|
#define INTERPOLATE_H
|
|
|
|
|
2006-09-25 21:19:00 +00:00
|
|
|
/*
|
|
|
|
* Convert a NUL-terminated string in buffer orig,
|
|
|
|
* performing substitutions on %-named sub-strings from
|
|
|
|
* the interpretation table.
|
|
|
|
*/
|
2006-09-20 01:31:51 +00:00
|
|
|
|
|
|
|
struct interp {
|
2007-03-07 01:44:17 +00:00
|
|
|
const char *name;
|
2006-09-20 01:31:51 +00:00
|
|
|
char *value;
|
|
|
|
};
|
|
|
|
|
2006-09-28 19:12:55 +00:00
|
|
|
extern void interp_set_entry(struct interp *table, int slot, const char *value);
|
2006-09-27 16:16:10 +00:00
|
|
|
extern void interp_clear_table(struct interp *table, int ninterps);
|
|
|
|
|
2006-09-20 01:31:51 +00:00
|
|
|
extern int interpolate(char *result, int reslen,
|
2006-09-25 21:19:00 +00:00
|
|
|
const char *orig,
|
|
|
|
const struct interp *interps, int ninterps);
|
2006-09-20 01:31:51 +00:00
|
|
|
|
|
|
|
#endif /* INTERPOLATE_H */
|