Danilo's const_profile_filespec_t and other changes from 1.1 branch
authorKen Raeburn <raeburn@mit.edu>
Wed, 1 Sep 1999 21:09:09 +0000 (21:09 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 1 Sep 1999 21:09:09 +0000 (21:09 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11766 dc483132-0cff-0310-8789-dd5450dbe970

src/util/profile/ChangeLog
src/util/profile/Makefile.in
src/util/profile/prof_file.c
src/util/profile/prof_init.c
src/util/profile/prof_int.h
src/util/profile/profile.hin

index dddf3945bcd128089ba201030f699fb1f734c779..bf16b30fbbc3896133e0d5bb90fd65fb6a40c747 100644 (file)
@@ -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
index 4d15050a3d508fbe6379c30c9c0da6caeb0106e3..526684ccce61b02cb7746f1b956d3c20654d55fa 100644 (file)
@@ -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
 
index 53f4ab706191bfd538ced9724211e158590caa50..77c4f551e679cb0dd52790cebb8fc64db57b89c6 100644 (file)
@@ -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;
index 5668d98f3d7a1e4ed6d835eac286efa26c428d81..7f35e442190c568bdec54a7315831d3afaabbbc1 100644 (file)
@@ -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;
index 970b42e0186decc05de8a30e17cd00e6c8b7b54d..76cebf136953ca8403f7677068ece0132e7463ba 100644 (file)
@@ -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));
index 420b955d4b94b6a539a3263d00bf05cfac927f86..f681f36f46b6d5a1f8123126525351f7cdd9a469 100644 (file)
@@ -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));