From a9dabaf1e8f5a5f97d679d0d196f9c0e02c50ad0 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Fri, 5 Sep 1997 12:21:26 +0000 Subject: [PATCH] rename STRING -> krb5_config_string, and LIST -> krb5_config_list git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3386 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/config_file.c | 26 +++++++++++++------------- lib/krb5/get_host_realm.c | 2 +- lib/krb5/krb5.h | 2 +- lib/krb5/krbhst.c | 2 +- lib/krb5/log.c | 5 +++-- lib/krb5/principal.c | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/krb5/config_file.c b/lib/krb5/config_file.c index 5fedd3509..a16b19eda 100644 --- a/lib/krb5/config_file.c +++ b/lib/krb5/config_file.c @@ -63,7 +63,7 @@ ni_proplist2binding(ni_proplist *pl, krb5_config_section **ret) return NI_FAILED; b->next = NULL; - b->type = STRING; + b->type = krb5_config_string; b->name = ni_name_dup(pl->nipl_val[i].nip_name); b->u.string = ni_name_dup(pl->nipl_val[i].nip_val.ninl_val[j]); @@ -110,7 +110,7 @@ ni_idlist2binding(void *ni, ni_idlist *idlist, krb5_config_section **ret) *next = b; } - b->type = LIST; + b->type = krb5_config_list; b->name = ni_name_dup(pl.nipl_val[index].nip_val.ninl_val[0]); b->next = NULL; b->u.list = NULL; @@ -210,7 +210,7 @@ parse_section(char *p, krb5_config_section **s, krb5_config_section **parent) tmp->name = strdup(p+1); if (tmp->name == NULL) return -1; - tmp->type = LIST; + tmp->type = krb5_config_list; tmp->u.list = NULL; tmp->next = NULL; return 0; @@ -275,13 +275,13 @@ parse_binding(FILE *f, unsigned *lineno, char *p, while(isspace(*p)) ++p; if (*p == '{') { - tmp->type = LIST; + tmp->type = krb5_config_list; tmp->u.list = NULL; ret = parse_list (f, lineno, &tmp->u.list); if (ret) return ret; } else { - tmp->type = STRING; + tmp->type = krb5_config_string; tmp->u.string = strdup(p); } return 0; @@ -339,9 +339,9 @@ free_binding (krb5_config_binding *b) while (b) { free (b->name); - if (b->type == STRING) + if (b->type == krb5_config_string) free (b->u.string); - else if (b->type == LIST) + else if (b->type == krb5_config_list) free_binding (b->u.list); else abort (); @@ -385,9 +385,9 @@ print_binding (FILE *f, krb5_config_binding *b, unsigned level) { tab (f, level); fprintf (f, "%s = ", b->name); - if (b->type == STRING) + if (b->type == krb5_config_string) fprintf (f, "%s\n", b->u.string); - else if (b->type == LIST) { + else if (b->type == krb5_config_list) { fprintf (f, "{\n"); print_list (f, b->u.list, level + 1); tab (f, level); @@ -462,7 +462,7 @@ krb5_config_vget_next (krb5_config_section *c, if (type == b->type && p == NULL) { *pointer = b; return b->u.generic; - } else if(b->type == LIST && p != NULL) { + } else if(b->type == krb5_config_list && p != NULL) { b = b->u.list; } else { return NULL; @@ -515,7 +515,7 @@ const krb5_config_binding * krb5_config_vget_list (krb5_config_section *c, va_list args) { - return krb5_config_vget (c, LIST, args); + return krb5_config_vget (c, krb5_config_list, args); } const char * @@ -535,7 +535,7 @@ const char * krb5_config_vget_string (krb5_config_section *c, va_list args) { - return krb5_config_vget (c, STRING, args); + return krb5_config_vget (c, krb5_config_string, args); } char ** @@ -546,7 +546,7 @@ krb5_config_vget_strings(krb5_config_section *c, int nstr = 0; krb5_config_binding *b = NULL; const char *p; - while((p = krb5_config_vget_next(c, &b, STRING, args))){ + while((p = krb5_config_vget_next(c, &b, krb5_config_string, args))){ char *tmp = strdup(p); char *pos = NULL; char *s; diff --git a/lib/krb5/get_host_realm.c b/lib/krb5/get_host_realm.c index 3c4d64ea6..94bfef0a3 100644 --- a/lib/krb5/get_host_realm.c +++ b/lib/krb5/get_host_realm.c @@ -91,7 +91,7 @@ krb5_get_host_realm(krb5_context context, NULL); l; l = l->next) { - if (l->type != STRING) + if (l->type != krb5_config_string) continue; if (exact_match (host, l->name)) { res = l->u.string; diff --git a/lib/krb5/krb5.h b/lib/krb5/krb5.h index 2e559b115..283ddea89 100644 --- a/lib/krb5/krb5.h +++ b/lib/krb5/krb5.h @@ -212,7 +212,7 @@ typedef struct krb5_cc_ops{ struct krb5_log_facility; struct krb5_config_binding { - enum { STRING, LIST } type; + enum { krb5_config_string, krb5_config_list } type; char *name; struct krb5_config_binding *next; union { diff --git a/lib/krb5/krbhst.c b/lib/krb5/krbhst.c index fc0d3f2bb..0006a8c11 100644 --- a/lib/krb5/krbhst.c +++ b/lib/krb5/krbhst.c @@ -64,7 +64,7 @@ krb5_get_krbhst (krb5_context context, for(done = FALSE; !done;) { char *h = (char *)krb5_config_get_next (context->cf, &pointer, - STRING, + krb5_config_string, "realms", r, "kdc", diff --git a/lib/krb5/log.c b/lib/krb5/log.c index b1cffc82b..4d390bc9d 100644 --- a/lib/krb5/log.c +++ b/lib/krb5/log.c @@ -324,7 +324,7 @@ krb5_openlog(krb5_context context, return ret; - while(p = krb5_config_get_next(context->cf, &binding, STRING, + while(p = krb5_config_get_next(context->cf, &binding, krb5_config_string, "logging", program, NULL)){ @@ -332,7 +332,8 @@ krb5_openlog(krb5_context context, done = 1; } if(!done){ - while(p = krb5_config_get_next(context->cf, &binding, STRING, + while(p = krb5_config_get_next(context->cf, &binding, + krb5_config_string, "logging", "default", NULL)){ diff --git a/lib/krb5/principal.c b/lib/krb5/principal.c index 0941ed779..8c3f12c46 100644 --- a/lib/krb5/principal.c +++ b/lib/krb5/principal.c @@ -601,7 +601,7 @@ name_convert(krb5_context context, const char *name, const char *realm, NULL); while(l){ - if (l->type != STRING) + if (l->type != krb5_config_string) continue; if(strcmp(name, l->u.string) == 0) return l->name;