+2002-09-03 Ken Raeburn <raeburn@mit.edu>
+
+ * rc_base.c, rc_conv.c, rc_io.c, ser_rc.c: Use prototype style
+ function definitions.
+
+ * rc_io.c (errno): Don't declare.
+ (krb5_rc_io_move): Avoid variable name "new".
+ * rc_dfl.c (cmp, alive): Avoid variable name "new".
+
2002-08-29 Ken Raeburn <raeburn@mit.edu>
* Makefile.in: Revert $(S)=>/ change, for Windows support.
semaphore ex_typelist = 1;
#endif
-krb5_error_code krb5_rc_register_type(context, ops)
- krb5_context context;
- krb5_rc_ops *ops;
+krb5_error_code krb5_rc_register_type(krb5_context context, krb5_rc_ops *ops)
{
struct krb5_rc_typelist *t;
#ifdef SEMAPHORE
return 0;
}
-krb5_error_code krb5_rc_resolve_type(context, id, type)
- krb5_context context;
- krb5_rcache *id;
- char *type;
+krb5_error_code krb5_rc_resolve_type(krb5_context context, krb5_rcache *id, char *type)
{
struct krb5_rc_typelist *t;
#ifdef SEMAPHORE
return 0;
}
-char * krb5_rc_get_type(context, id)
- krb5_context context;
- krb5_rcache id;
+char * krb5_rc_get_type(krb5_context context, krb5_rcache id)
{
return id->ops->type;
}
-char * krb5_rc_default_type(context)
- krb5_context context;
+char * krb5_rc_default_type(krb5_context context)
{
char *s;
if ((s = getenv("KRB5RCACHETYPE")))
return "dfl";
}
-char * krb5_rc_default_name(context)
- krb5_context context;
+char * krb5_rc_default_name(krb5_context context)
{
char *s;
if ((s = getenv("KRB5RCACHENAME")))
}
krb5_error_code
-krb5_rc_default(context, id)
- krb5_context context;
- krb5_rcache *id;
+krb5_rc_default(krb5_context context, krb5_rcache *id)
{
krb5_error_code retval;
}
-krb5_error_code krb5_rc_resolve_full(context, id, string_name)
- krb5_context context;
- krb5_rcache *id;
- char *string_name;
+krb5_error_code krb5_rc_resolve_full(krb5_context context, krb5_rcache *id, char *string_name)
{
char *type;
char *residual;
*/
krb5_error_code
-krb5_auth_to_rep(context, auth, rep)
- krb5_context context;
- krb5_tkt_authent *auth;
- krb5_donot_replay *rep;
+krb5_auth_to_rep(krb5_context context, krb5_tkt_authent *auth, krb5_donot_replay *rep)
{
krb5_error_code retval;
rep->cusec = auth->authenticator->cusec;
/*ARGSUSED*/
static int
-cmp(krb5_donot_replay *old, krb5_donot_replay *new, krb5_deltat t)
+cmp(krb5_donot_replay *old, krb5_donot_replay *new1, krb5_deltat t)
{
- if ((old->cusec == new->cusec) && /* most likely to distinguish */
- (old->ctime == new->ctime) &&
- (strcmp(old->client, new->client) == 0) &&
- (strcmp(old->server, new->server) == 0)) /* always true */
+ if ((old->cusec == new1->cusec) && /* most likely to distinguish */
+ (old->ctime == new1->ctime) &&
+ (strcmp(old->client, new1->client) == 0) &&
+ (strcmp(old->server, new1->server) == 0)) /* always true */
return CMP_REPLAY;
return CMP_HOHUM;
}
static int
-alive(krb5_context context, krb5_donot_replay *new, krb5_deltat t)
+alive(krb5_context context, krb5_donot_replay *new1, krb5_deltat t)
{
krb5_int32 mytime;
if (krb5_timeofday(context, &mytime))
return CMP_HOHUM; /* who cares? */
/* I hope we don't have to worry about overflow */
- if (new->ctime + t < mytime)
+ if (new1->ctime + t < mytime)
return CMP_EXPIRED;
return CMP_HOHUM;
}
#error find some way to use net-byte-order file version numbers.
#endif
-#ifndef HAVE_ERRNO
-extern int errno; /* this should be in errno.h, but isn't on some systems */
-#endif
-
#define FREE(x) ((void) free((char *) (x)))
#define UNIQUE getpid() /* hopefully unique number */
#define GETDIR do { if (!dirlen) getdir(); } while(0)
static void
-getdir()
+getdir(void)
{
if (!(dir = getenv("KRB5RCACHEDIR"))) {
#if defined(_WIN32)
}
krb5_error_code
-krb5_rc_io_move(krb5_context context, krb5_rc_iostuff *new,
+krb5_rc_io_move(krb5_context context, krb5_rc_iostuff *new1,
krb5_rc_iostuff *old)
{
#if defined(_WIN32)
*/
offset = lseek(old->fd, 0, SEEK_CUR);
- new_fn = new->fn;
- new->fn = NULL;
+ new_fn = new1->fn;
+ new1->fn = NULL;
close(new->fd);
- new->fd = -1;
+ new1->fd = -1;
unlink(new_fn);
goto cleanup;
}
- retval = krb5_rc_io_open_internal(context, new, 0, new_fn);
+ retval = krb5_rc_io_open_internal(context, new1, 0, new_fn);
if (retval)
goto cleanup;
return retval;
#else
char *fn = NULL;
- if (rename(old->fn, new->fn) == -1) /* MUST be atomic! */
+ if (rename(old->fn, new1->fn) == -1) /* MUST be atomic! */
return KRB5_RC_IO_UNKNOWN;
- fn = new->fn;
- new->fn = NULL; /* avoid clobbering */
- (void) krb5_rc_io_close(context, new);
- new->fn = fn;
+ fn = new1->fn;
+ new1->fn = NULL; /* avoid clobbering */
+ (void) krb5_rc_io_close(context, new1);
+ new1->fn = fn;
#ifdef macintosh
- new->fd = fcntl(old->fd, F_DUPFD);
+ new1->fd = fcntl(old->fd, F_DUPFD);
#else
- new->fd = dup(old->fd);
+ new1->fd = dup(old->fd);
#endif
return 0;
#endif
* this krb5_rcache variant.
*/
static krb5_error_code
-krb5_rcache_size(kcontext, arg, sizep)
- krb5_context kcontext;
- krb5_pointer arg;
- size_t *sizep;
+krb5_rcache_size(krb5_context kcontext, krb5_pointer arg, size_t *sizep)
{
krb5_error_code kret;
krb5_rcache rcache;
* krb5_rcache_externalize() - Externalize the krb5_rcache.
*/
static krb5_error_code
-krb5_rcache_externalize(kcontext, arg, buffer, lenremain)
- krb5_context kcontext;
- krb5_pointer arg;
- krb5_octet **buffer;
- size_t *lenremain;
+krb5_rcache_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet **buffer, size_t *lenremain)
{
krb5_error_code kret;
krb5_rcache rcache;
* krb5_rcache_internalize() - Internalize the krb5_rcache.
*/
static krb5_error_code
-krb5_rcache_internalize(kcontext, argp, buffer, lenremain)
- krb5_context kcontext;
- krb5_pointer *argp;
- krb5_octet **buffer;
- size_t *lenremain;
+krb5_rcache_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octet **buffer, size_t *lenremain)
{
krb5_error_code kret;
krb5_rcache rcache;
* Register the rcache serializer.
*/
krb5_error_code KRB5_CALLCONV
-krb5_ser_rcache_init(kcontext)
- krb5_context kcontext;
+krb5_ser_rcache_init(krb5_context kcontext)
{
return(krb5_register_serializer(kcontext, &krb5_rcache_ser_entry));
}