From a7d6c70e4c01dc0c3e7e4b2029a46a68094e02e2 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sun, 10 Dec 1995 16:19:38 +0000 Subject: [PATCH] Add new routine krb5_input_flag_to_string to allow an application to loop over the input flag strings for displaying help messages (i.e. modent in krb5_edit). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7187 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm/ChangeLog | 4 ++++ src/lib/kadm/str_conv.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/lib/kadm/ChangeLog b/src/lib/kadm/ChangeLog index 791ec5253..fdf21ac2d 100644 --- a/src/lib/kadm/ChangeLog +++ b/src/lib/kadm/ChangeLog @@ -1,3 +1,7 @@ +Sun Dec 10 11:02:56 1995 Ezra Peisach + + * str_conv.c (krb5_input_flag_to_string): Add new routine. + Wed Nov 8 02:46:54 1995 Theodore Y. Ts'o * alt_prof.c (krb5_free_realm_params): Free the realm_kdc_ports diff --git a/src/lib/kadm/str_conv.c b/src/lib/kadm/str_conv.c index fc9967493..ccd0da030 100644 --- a/src/lib/kadm/str_conv.c +++ b/src/lib/kadm/str_conv.c @@ -207,3 +207,15 @@ krb5_flags_to_string(flags, sep, buffer, buflen) } return(retval); } + +krb5_error_code +krb5_input_flag_to_string(flag, buffer, buflen) + int flag; + char * buffer; + size_t buflen; +{ + if(flag < 0 || flag >= flags_table_nents) return ENOENT; /* End of list */ + if(strlen(flags_table[flag].fl_specifier) > buflen) return ENOMEM; + strcpy(buffer, flags_table[flag].fl_specifier); + return 0; +} -- 2.26.2