diff options
author | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-11-26 10:33:55 +0000 |
---|---|---|
committer | vodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-11-26 10:33:55 +0000 |
commit | 3082af9bcfed3f7ab3b39eaf7a02aa051043cbf1 (patch) | |
tree | 3f0e8887aeecd290f7c32ae413ee6e720733c94b | |
parent | afb1ad1f740adf1dd89da0617f60219e302934a1 (diff) | |
download | busybox-w32-3082af9bcfed3f7ab3b39eaf7a02aa051043cbf1.tar.gz busybox-w32-3082af9bcfed3f7ab3b39eaf7a02aa051043cbf1.tar.bz2 busybox-w32-3082af9bcfed3f7ab3b39eaf7a02aa051043cbf1.zip |
more use const for interface of libbb/compare_string_array, example usage for e2fsprogs/fsck
git-svn-id: svn://busybox.net/trunk/busybox@12534 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | e2fsprogs/fsck.c | 13 | ||||
-rw-r--r-- | include/libbb.h | 2 | ||||
-rw-r--r-- | libbb/compare_string_array.c | 3 |
3 files changed, 7 insertions, 11 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index b7e25d68a..ae4e3d0c8 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c | |||
@@ -988,8 +988,7 @@ static int fs_match(struct fs_info *fs, struct fs_type_compile *cmp) | |||
988 | /* Check if we should ignore this filesystem. */ | 988 | /* Check if we should ignore this filesystem. */ |
989 | static int ignore(struct fs_info *fs) | 989 | static int ignore(struct fs_info *fs) |
990 | { | 990 | { |
991 | const char * const *ip; | 991 | int wanted; |
992 | int wanted = 0; | ||
993 | char *s; | 992 | char *s; |
994 | 993 | ||
995 | /* | 994 | /* |
@@ -1007,15 +1006,11 @@ static int ignore(struct fs_info *fs) | |||
1007 | if (!fs_match(fs, &fs_type_compiled)) return 1; | 1006 | if (!fs_match(fs, &fs_type_compiled)) return 1; |
1008 | 1007 | ||
1009 | /* Are we ignoring this type? */ | 1008 | /* Are we ignoring this type? */ |
1010 | for(ip = ignored_types; *ip; ip++) | 1009 | if(compare_string_array(ignored_types, fs->type)) |
1011 | if (strcmp(fs->type, *ip) == 0) return 1; | 1010 | return 1; |
1012 | 1011 | ||
1013 | /* Do we really really want to check this fs? */ | 1012 | /* Do we really really want to check this fs? */ |
1014 | for(ip = really_wanted; *ip; ip++) | 1013 | wanted = compare_string_array(really_wanted, fs->type); |
1015 | if (strcmp(fs->type, *ip) == 0) { | ||
1016 | wanted = 1; | ||
1017 | break; | ||
1018 | } | ||
1019 | 1014 | ||
1020 | /* See if the <fsck.fs> program is available. */ | 1015 | /* See if the <fsck.fs> program is available. */ |
1021 | s = find_fsck(fs->type); | 1016 | s = find_fsck(fs->type); |
diff --git a/include/libbb.h b/include/libbb.h index b7dd48775..70a9336d8 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -466,7 +466,7 @@ typedef struct { | |||
466 | } procps_status_t; | 466 | } procps_status_t; |
467 | 467 | ||
468 | extern procps_status_t * procps_scan(int save_user_arg0); | 468 | extern procps_status_t * procps_scan(int save_user_arg0); |
469 | extern unsigned short compare_string_array(const char *string_array[], const char *key); | 469 | extern unsigned short compare_string_array(const char * const string_array[], const char *key); |
470 | 470 | ||
471 | extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret); | 471 | extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret); |
472 | 472 | ||
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c index 993b46266..8961e003e 100644 --- a/libbb/compare_string_array.c +++ b/libbb/compare_string_array.c | |||
@@ -17,7 +17,8 @@ | |||
17 | #include <string.h> | 17 | #include <string.h> |
18 | 18 | ||
19 | /* returns the array number of the string */ | 19 | /* returns the array number of the string */ |
20 | extern unsigned short compare_string_array(const char *string_array[], const char *key) | 20 | extern unsigned short |
21 | compare_string_array(const char * const string_array[], const char *key) | ||
21 | { | 22 | { |
22 | unsigned short i; | 23 | unsigned short i; |
23 | 24 | ||