summaryrefslogtreecommitdiffstats
path: root/mbbsd/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/file.c')
-rw-r--r--mbbsd/file.c10
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;