From ad606bcf363ff942d0e4aa6e72663dd039aa8481 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 3 Mar 2004 05:54:53 +0000 Subject: [PATCH] minor formatting, mostly whitespace git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16141 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/rcache/rc_base.c | 75 ++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/src/lib/krb5/rcache/rc_base.c b/src/lib/krb5/rcache/rc_base.c index e86a4fafb..40651787c 100644 --- a/src/lib/krb5/rcache/rc_base.c +++ b/src/lib/krb5/rcache/rc_base.c @@ -15,63 +15,64 @@ #define FREE(x) ((void) free((char *) (x))) -struct krb5_rc_typelist - { - const krb5_rc_ops *ops; - struct krb5_rc_typelist *next; - }; +struct krb5_rc_typelist { + const krb5_rc_ops *ops; + struct krb5_rc_typelist *next; +}; static struct krb5_rc_typelist krb5_rc_typelist_dfl = { &krb5_rc_dfl_ops, 0 }; static struct krb5_rc_typelist *typehead = &krb5_rc_typelist_dfl; krb5_error_code krb5_rc_register_type(krb5_context context, const krb5_rc_ops *ops) { - struct krb5_rc_typelist *t; - for (t = typehead;t && strcmp(t->ops->type,ops->type);t = t->next) - ; - if (t) - return KRB5_RC_TYPE_EXISTS; - if (!(t = (struct krb5_rc_typelist *) malloc(sizeof(struct krb5_rc_typelist)))) - return KRB5_RC_MALLOC; - t->next = typehead; - t->ops = ops; - typehead = t; - return 0; + struct krb5_rc_typelist *t; + for (t = typehead;t && strcmp(t->ops->type,ops->type);t = t->next) + ; + if (t) + return KRB5_RC_TYPE_EXISTS; + t = (struct krb5_rc_typelist *) malloc(sizeof(struct krb5_rc_typelist)); + if (t == NULL) + return KRB5_RC_MALLOC; + t->next = typehead; + t->ops = ops; + typehead = t; + return 0; } -krb5_error_code krb5_rc_resolve_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; - for (t = typehead;t && strcmp(t->ops->type,type);t = t->next) - ; - if (!t) - return KRB5_RC_TYPE_NOTFOUND; - /* allocate *id? nah */ - (*id)->ops = t->ops; - return 0; + struct krb5_rc_typelist *t; + for (t = typehead;t && strcmp(t->ops->type,type);t = t->next) + ; + if (!t) + return KRB5_RC_TYPE_NOTFOUND; + /* allocate *id? nah */ + (*id)->ops = t->ops; + return 0; } char * krb5_rc_get_type(krb5_context context, krb5_rcache id) { - return id->ops->type; + return id->ops->type; } char * krb5_rc_default_type(krb5_context context) { - char *s; - if ((s = getenv("KRB5RCACHETYPE"))) - return s; - else - return "dfl"; + char *s; + if ((s = getenv("KRB5RCACHETYPE"))) + return s; + else + return "dfl"; } char * krb5_rc_default_name(krb5_context context) { - char *s; - if ((s = getenv("KRB5RCACHENAME"))) - return s; - else - return (char *) 0; + char *s; + if ((s = getenv("KRB5RCACHENAME"))) + return s; + else + return (char *) 0; } krb5_error_code @@ -88,7 +89,7 @@ krb5_rc_default(krb5_context context, krb5_rcache *id) return retval; } if ((retval = krb5_rc_resolve(context, *id, - krb5_rc_default_name(context)))) + krb5_rc_default_name(context)))) FREE(*id); (*id)->magic = KV5M_RCACHE; return retval; -- 2.26.2