fixed const-ness of matchlist functions
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 3 Sep 2007 07:40:40 +0000 (07:40 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 3 Sep 2007 07:40:40 +0000 (07:40 +0000)
made the initial file-list a 'char const **' to ease
initialization from string constants

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2607 94cd875c-1c1d-0410-91d2-eb244daf1a30

lib_internal/matchlist-appendfiles.c
lib_internal/matchlist-initmanually.c
lib_internal/matchlist.h

index 73af1a0..bf05ad7 100644 (file)
@@ -38,7 +38,7 @@ determineCompareFunc(char const UNUSED *fname)
 
 void
 MatchList_appendFiles(struct MatchList *list, size_t idx,
-                     char **files, size_t count,
+                     char const **files, size_t count,
                      bool auto_type)
 {
   struct MatchItem     *ptr = list->data + idx;
@@ -48,7 +48,7 @@ MatchList_appendFiles(struct MatchList *list, size_t idx,
 
   if (auto_type) {
     for (i=0; i<count; ++i) {
-      char     *file = files[i];
+      char const       *file = files[i];
       switch (file[0]) {
        case '+'        :  ptr->type = stINCLUDE; ++file; break;
        case '~'        :  ptr->type = stSKIP;    ++file; break;
index 8fffe73..4be43fd 100644 (file)
@@ -42,7 +42,7 @@ extern bool   Global_doRenew() PURE CONST;
 
 static void
 readExcludeListFD(int fd,
-                 char ***files,  size_t *size,
+                 char const ***files,  size_t *size,
                  char **buf)
 {
   off_t                len;
@@ -90,7 +90,7 @@ readExcludeListFD(int fd,
 
 static void
 readExcludeList(char const *filename,
-               char ***files,  size_t *size,
+               char const ***files,  size_t *size,
                char **buf)
 {
   int          fd = open(filename, O_RDONLY);
@@ -102,7 +102,7 @@ readExcludeList(char const *filename,
 
 static void
 getConfigfileList(char const *vserver,
-                 char ***files, size_t *size,
+                 char const ***files, size_t *size,
                  char **buf)
 {
   char                 tmpname[] = "/tmp/vunify.XXXXXX";
@@ -152,10 +152,10 @@ MatchList_initManually(struct MatchList *list,
 {
   char                 *buf[2] = { 0,0 };
   
-  char                 **fixed_files = 0;
+  char const           **fixed_files = 0;
   size_t               fixed_count   = 0;
 
-  char                 **expr_files  = 0;
+  char const           **expr_files  = 0;
   size_t               expr_count    = 0;
   size_t               len;
 
index 49a60ff..35a7620 100644 (file)
@@ -73,7 +73,7 @@ void          MatchList_initRefserverList(struct MatchList **, size_t *cnt,
                                            char const *dir) NONNULL((1,2,3));
 void           MatchList_destroy(struct MatchList *) NONNULL((1));
 void           MatchList_appendFiles(struct MatchList *, size_t idx,
-                                     char **files, size_t count,
+                                     char const **files, size_t count,
                                      bool auto_type) NONNULL((1,3));
 
 MatchType      MatchList_compare(struct MatchList const *,