Use const for interpolate arguments
authorAlex Riesen <fork0@t-online.de>
Mon, 25 Sep 2006 21:19:00 +0000 (23:19 +0200)
committerJunio 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>
interpolate.c
interpolate.h

index d82f1b51bbff4a545a2d5a0aebb91612cacd3d69..4570c123dce811bab8a89efe4c3b4a9a977e6c5a 100644 (file)
  */
 
 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;
index 00c63a5622da8545f46fb6b170951b224679bc73..d16f9244f3de25ec9e554c6d9f5bae07de7bf2a0 100644 (file)
@@ -5,6 +5,11 @@
 #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;
@@ -12,7 +17,7 @@ struct interp {
 };
 
 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 */