Commit 8b0dbefb authored by slevy's avatar slevy
Browse files

Const-ify.

parent 30b178ed
......@@ -44,8 +44,8 @@ geom.umn.edu; email: software@geom.umn.edu. */
#include <stdlib.h>
static char **dirlist = NULL;
static void dirprefix(char *file, char *dir);
static CONST char **dirlist = NULL;
static void dirprefix(CONST char *file, char *dir);
char *envexpand(char *s);
/*-----------------------------------------------------------------------
......@@ -60,14 +60,14 @@ char *envexpand(char *s);
* and expands all environment variables in them.
*/
void
filedirs(char *dirs[])
filedirs(CONST char *dirs[])
{
char buf[1024], **p;
char buf[1024];
int i,ndirs;
char **odirlist = dirlist;
CONST char **odirlist = dirlist;
for (ndirs=0; dirs[ndirs]!=NULL; ++ndirs);
dirlist = OOGLNewNE(char *,ndirs+1, "filedirs: dirlist");
dirlist = OOGLNewNE(CONST char *,ndirs+1, "filedirs: dirlist");
for (i=0; i<ndirs; ++i) {
strcpy(buf, dirs[i]);
envexpand(buf);
......@@ -75,6 +75,7 @@ filedirs(char *dirs[])
}
dirlist[ndirs] = NULL;
if (odirlist) {
CONST char **p;
for (p=odirlist; *p!=NULL; ++p) free(*p);
OOGLFree(odirlist);
}
......@@ -87,7 +88,7 @@ filedirs(char *dirs[])
* Author: mbp
* Date: Wed Feb 12 14:09:48 1992
*/
char **
CONST char **
getfiledirs()
{
return dirlist;
......@@ -133,10 +134,10 @@ getfiledirs()
* permission.
*/
char *
findfile(char *superfile, char *file)
findfile(CONST char *superfile, CONST char *file)
{
static char *path = NULL;
register char **dirp;
CONST char **dirp;
char pbuf[1024];
int trydot = 1;
......@@ -190,7 +191,7 @@ findfile(char *superfile, char *file)
* otherwise dir is set to "".
*/
static void
dirprefix(char *path, char *dir)
dirprefix(CONST char *path, char *dir)
{
register char *end;
......
......@@ -13,9 +13,9 @@
extern "C" {
#endif
extern char **getfiledirs(void);
extern char *findfile( char *superfile, char *fname );
extern void filedirs( char **dirs );
extern CONST char **getfiledirs(void);
extern char *findfile( CONST char *superfile, CONST char *fname );
extern void filedirs( CONST char **dirs );
extern char *envexpand(char *str);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment