+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
##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
}
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;
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;
*/
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;
*/
#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
/* 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));
#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));