From 875d825afb07ba43445ca59d440c3b9fcd4ef007 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Sat, 12 Oct 2024 08:36:17 +0100 Subject: [PATCH] path.c: PaLockZOpen() constify and add prototype --- utils/path.c | 13 +++++++------ utils/utils.h | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/utils/path.c b/utils/path.c index 01527de4..bb948ade 100644 --- a/utils/path.c +++ b/utils/path.c @@ -416,18 +416,18 @@ nextName(ppath, file, dest, size) gzFile PaLockZOpen(file, mode, ext, path, library, pRealName, is_locked, fdp) - char *file; /* Name of the file to be opened. */ - char *mode; /* The file mode, as given to fopen. */ - char *ext; /* The extension to be added to the file name, + const char *file; /* Name of the file to be opened. */ + const char *mode; /* The file mode, as given to fopen. */ + const char *ext; /* The extension to be added to the file name, * or NULL. Note: this string must include * the dot (or whatever separator you use). */ - char *path; /* A search path: a list of directory names + const char *path; /* A search path: a list of directory names * separated by colons or blanks. To use * only the working directory, use "." for * the path. */ - char *library; /* A 2nd path containing library names. Can be + const char *library; /* A 2nd path containing library names. Can be * NULL to indicate no library. */ char **pRealName; /* Pointer to a location that will be filled @@ -442,7 +442,8 @@ PaLockZOpen(file, mode, ext, path, library, pRealName, is_locked, fdp) */ int *fdp; /* If non-NULL, put the file descriptor here */ { - char extendedName[MAXSIZE], *p1, *p2; + char extendedName[MAXSIZE], *p1; + const char *p2; static char realName[MAXSIZE]; int length, extLength, i, fd; int oflag = 0; diff --git a/utils/utils.h b/utils/utils.h index 87f1b063..33b35836 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -76,7 +76,8 @@ extern bool ParsSplit(); #ifdef HAVE_ZLIB extern gzFile PaZOpen(char *, char *, char *, char *, char *, char **); -extern gzFile PaLockZOpen(char *, char *, char *, char *, char *, char **, bool *, int *); +extern gzFile PaLockZOpen(const char *file, const char *mode, const char *ext, const char *path, const char *library, + char **pRealName, bool *is_locked, int *fdp); extern char *PaCheckCompressed(const char *filename); #endif