summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8daf78)
raw | patch | inline | side by side (parent: e8daf78)
author | Alex Riesen <fork0@t-online.de> | |
Mon, 25 Sep 2006 21:19:00 +0000 (23:19 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 26 Sep 2006 05:11:26 +0000 (22:11 -0700) |
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
interpolate.c | patch | blob | history | |
interpolate.h | patch | blob | history |
diff --git a/interpolate.c b/interpolate.c
index d82f1b51bbff4a545a2d5a0aebb91612cacd3d69..4570c123dce811bab8a89efe4c3b4a9a977e6c5a 100644 (file)
--- a/interpolate.c
+++ b/interpolate.c
*/
int interpolate(char *result, int reslen,
- char *orig,
- struct interp *interps, int ninterps)
+ const char *orig,
+ const struct interp *interps, int ninterps)
{
- char *src = orig;
+ const char *src = orig;
char *dest = result;
int newlen = 0;
char *name, *value;
diff --git a/interpolate.h b/interpolate.h
index 00c63a5622da8545f46fb6b170951b224679bc73..d16f9244f3de25ec9e554c6d9f5bae07de7bf2a0 100644 (file)
--- a/interpolate.h
+++ b/interpolate.h
#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;
};
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 */