diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 20:59:50 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-19 20:59:50 +0800 |
commit | 15135e4525a4294ce016f87e85841e7d3ec2164b (patch) | |
tree | c88bdd5afd05c2b5c5d08984b87fe103ec96cd9c /mbbsd/file.c | |
parent | 7c0c9404b7353ca9c4bf08b0b9a3226554ea8031 (diff) | |
download | pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.gz pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.bz2 pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.lz pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.xz pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.tar.zst pttbbs-15135e4525a4294ce016f87e85841e7d3ec2164b.zip |
add 'const' qualifiers on function parameters.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2632 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/file.c')
-rw-r--r-- | mbbsd/file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mbbsd/file.c b/mbbsd/file.c index d0e7d097..cf13fb36 100644 --- a/mbbsd/file.c +++ b/mbbsd/file.c @@ -10,7 +10,7 @@ * 傳回 file 檔的行數 * @param file */ -int file_count_line(char *file) +int file_count_line(const char *file) { FILE *fp; int count = 0; @@ -33,7 +33,7 @@ int file_count_line(char *file) * @param string * @return 成功傳回 0,失敗傳回 -1。 */ -int file_append_line(char *file, char *string) +int file_append_line(const char *file, const char *string) { FILE *fp; if ((fp = fopen(file, "a")) == NULL) @@ -52,7 +52,7 @@ int file_append_line(char *file, char *string) * @param string * @param case_sensitive 字串比對是否 case sensitive */ -int file_delete_line(char *file, char *string, int case_sensitive) +int file_delete_line(const char *file, const char *string, int case_sensitive) { FILE *fp, *nfp = NULL; char fnew[80]; @@ -81,7 +81,7 @@ int file_delete_line(char *file, char *string, int case_sensitive) /** * 傳回檔案 file 中是否有 string 這個字串。 */ -int file_exist_record(char *file, char *string) +int file_exist_record(const char *file, const char *string) { FILE *fp; char buf[STRLEN], *ptr; @@ -106,7 +106,7 @@ int file_exist_record(char *file, char *string) * 第一個參數是檔案中的一行,第二個參數為 info。 * @param info 一個額外的參數。 */ -int file_foreach_entry(char *file, int (*func)(char *, int), int info) +int file_foreach_entry(const char *file, int (*func)(char *, int), int info) { char line[80]; FILE *fp; |