From: Ken Raeburn Date: Wed, 1 Sep 1999 21:09:09 +0000 (+0000) Subject: Danilo's const_profile_filespec_t and other changes from 1.1 branch X-Git-Tag: krb5-1.2-beta1~262 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8ac8e7ed1bdd9ceb4d84558f74906a95790eb313;p=krb5.git Danilo's const_profile_filespec_t and other changes from 1.1 branch git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11766 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index dddf3945b..bf16b30fb 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,18 @@ +1999-09-01 Danilo Almeida + + * profile.hin (profile_init, profile_init_path): Define and use + const_profile_filespec_t. + + * prof_init.c (profile_init, profile_init_path): + * prof_file.c (profile_open_file): + * prof_int.h (profile_open_file): Use const_profile_filespec_t. + + * prof_int.h (PROFILE_LAST_FILESPEC): Compare a char against a char, + not a void*. + + * Makefile.in: Remove DOSDEFS to avoid warnings. The thing it + defined is already set in win-mac.h. + 1999-08-18 Miro Jurisic * profile.exp: removed com_err functions (they are in a library diff --git a/src/util/profile/Makefile.in b/src/util/profile/Makefile.in index 4d15050a3..526684ccc 100644 --- a/src/util/profile/Makefile.in +++ b/src/util/profile/Makefile.in @@ -7,9 +7,8 @@ PROG_RPATH=$(KRB5_LIBDIR) ##DOS##BUILDTOP = ..\.. ##DOS##OBJFILE=$(OUTPRE)profile.lst ##DOS##LIBNAME=$(OUTPRE)profile.lib -##DOS##DOSDEFS=-DHAVE_STDLIB_H -CFLAGS = $(CCOPTS) $(DEFS) $(LOCALINCLUDE) $(DOSDEFS) +CFLAGS = $(CCOPTS) $(DEFS) $(LOCALINCLUDE) LOCALINCLUDE=-I. -I$(srcdir)/../et diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c index 53f4ab706..77c4f551e 100644 --- a/src/util/profile/prof_file.c +++ b/src/util/profile/prof_file.c @@ -67,7 +67,7 @@ static int rw_access(filespec) } errcode_t profile_open_file(filespec, ret_prof) - profile_filespec_t filespec; + const_profile_filespec_t filespec; prf_file_t *ret_prof; { prf_file_t prf; diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 5668d98f3..7f35e4421 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -25,16 +25,16 @@ error(do not have a 4-byte integer type) KRB5_DLLIMP errcode_t KRB5_CALLCONV profile_init(files, ret_profile) - profile_filespec_t *files; + const_profile_filespec_t *files; profile_t *ret_profile; { - profile_filespec_t *fs; + const_profile_filespec_t *fs; profile_t profile; prf_file_t new_file, last = 0; errcode_t retval = 0; initialize_prof_error_table(); - + profile = malloc(sizeof(struct _profile_t)); if (!profile) return ENOMEM; @@ -79,7 +79,7 @@ profile_init(files, ret_profile) */ KRB5_DLLIMP errcode_t KRB5_CALLCONV profile_init_path(filepath, ret_profile) - profile_filespec_list_t filepath; + const_profile_filespec_list_t filepath; profile_t *ret_profile; { int n_entries, i; diff --git a/src/util/profile/prof_int.h b/src/util/profile/prof_int.h index 970b42e01..76cebf136 100644 --- a/src/util/profile/prof_int.h +++ b/src/util/profile/prof_int.h @@ -80,7 +80,7 @@ struct _profile_t { */ #ifdef PROFILE_USES_PATHS -#define PROFILE_LAST_FILESPEC(x) (((x) == NULL) || ((x)[0] == NULL)) +#define PROFILE_LAST_FILESPEC(x) (((x) == NULL) || ((x)[0] == '\0')) #else #define PROFILE_LAST_FILESPEC(x) (((x).vRefNum == 0) && ((x).parID == 0) && ((x).name[0] == '\0')) #endif @@ -173,7 +173,7 @@ errcode_t profile_rename_node /* prof_file.c */ errcode_t profile_open_file - PROTOTYPE ((profile_filespec_t file, prf_file_t *ret_prof)); + PROTOTYPE ((const_profile_filespec_t file, prf_file_t *ret_prof)); errcode_t profile_update_file PROTOTYPE ((prf_file_t profile)); diff --git a/src/util/profile/profile.hin b/src/util/profile/profile.hin index 420b955d4..f681f36f4 100644 --- a/src/util/profile/profile.hin +++ b/src/util/profile/profile.hin @@ -51,21 +51,25 @@ extern "C" { #endif #ifdef PROFILE_USES_PATHS -typedef char* profile_filespec_t; /* path as C string */ +typedef char* profile_filespec_t; /* path as C string */ typedef char* profile_filespec_list_t; /* list of : separated paths, C string */ +typedef const char* const_profile_filespec_t; /* path as C string */ +typedef const char* const_profile_filespec_list_t; /* list of : separated paths, C string */ #else /* On MacOS, we use native file specifiers as unique file identifiers */ #include typedef FSSpec profile_filespec_t; -typedef FSSpec* profile_filespec_list_t; - /* array should be terminated with {0, 0, ""} */ +typedef FSSpec* profile_filespec_list_t; +/* array should be terminated with {0, 0, ""} */ +typedef FSSpec const_profile_filespec_t; +typedef FSSpec* const_profile_filespec_list_t; #endif KRB5_DLLIMP long KRB5_CALLCONV profile_init - PROTOTYPE ((profile_filespec_t *files, profile_t *ret_profile)); + PROTOTYPE ((const_profile_filespec_t *files, profile_t *ret_profile)); KRB5_DLLIMP long KRB5_CALLCONV profile_init_path - PROTOTYPE ((profile_filespec_list_t filelist, profile_t *ret_profile)); + PROTOTYPE ((const_profile_filespec_list_t filelist, profile_t *ret_profile)); KRB5_DLLIMP long KRB5_CALLCONV profile_flush PROTOTYPE ((profile_t profile));