summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>1999-09-01 21:09:09 +0000
committerKen Raeburn <raeburn@mit.edu>1999-09-01 21:09:09 +0000
commit8ac8e7ed1bdd9ceb4d84558f74906a95790eb313 (patch)
tree1cc0c7fa962920b3ea2191a1606e8efdc210412f /src
parent4f36c4c7f86567fa11597b562c111e614e155bfd (diff)
downloadkrb5-8ac8e7ed1bdd9ceb4d84558f74906a95790eb313.tar.gz
krb5-8ac8e7ed1bdd9ceb4d84558f74906a95790eb313.tar.xz
krb5-8ac8e7ed1bdd9ceb4d84558f74906a95790eb313.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/util/profile/ChangeLog15
-rw-r--r--src/util/profile/Makefile.in3
-rw-r--r--src/util/profile/prof_file.c2
-rw-r--r--src/util/profile/prof_init.c8
-rw-r--r--src/util/profile/prof_int.h4
-rw-r--r--src/util/profile/profile.hin14
6 files changed, 32 insertions, 14 deletions
diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog
index dddf3945bc..bf16b30fbb 100644
--- a/src/util/profile/ChangeLog
+++ b/src/util/profile/ChangeLog
@@ -1,3 +1,18 @@
+1999-09-01 Danilo Almeida <dalmeida@mit.edu>
+
+ * 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 <meeroh@mit.edu>
* 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 4d15050a3d..526684ccce 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 53f4ab7061..77c4f551e6 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 5668d98f3d..7f35e44219 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 970b42e018..76cebf1369 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 420b955d4b..f681f36f46 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 <Files.h>
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));