2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 #pragma ident "%Z%%M% %I% %E% SMI"
9 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
11 * Openvision retains the copyright to derivative works of
12 * this source code. Do *NOT* create a derivative of this
13 * source code before consulting with your legal department.
14 * Do *NOT* integrate *ANY* of this source code into another
15 * product before consulting with your legal department.
17 * For further information, read the top-level Openvision
18 * copyright which is contained in the top-level MIT Kerberos
21 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
26 /* ktutil_ct.c - automatically generated from ktutil_ct.ct */
27 /* Above no longer appears to be true */
34 * I18n hack. We sill define gettext(s) to be s here. That way the info_strings
35 * will be extracted to the .po file.
44 static char const * const ssu00001
[] = {
49 extern void ktutil_clear_list __SS_PROTO
;
50 static char const * const ssu00002
[] = {
55 extern void ktutil_read_v5 __SS_PROTO
;
56 static char const * const ssu00003
[] = {
61 extern void ktutil_read_v4 __SS_PROTO
;
62 static char const * const ssu00004
[] = {
67 extern void ktutil_write_v5 __SS_PROTO
;
68 static char const * const ssu00005
[] = {
73 extern void ktutil_write_v4 __SS_PROTO
;
74 static char const * const ssu00006
[] = {
79 extern void ktutil_add_entry __SS_PROTO
;
80 static char const * const ssu00007
[] = {
85 extern void ktutil_delete_entry __SS_PROTO
;
86 static char const * const ssu00008
[] = {
91 extern void ktutil_list __SS_PROTO
;
92 static char const * const ssu00009
[] = {
98 extern void ss_list_requests __SS_PROTO
;
99 static char const * const ssu00010
[] = {
105 extern void ss_quit __SS_PROTO
;
106 static ss_request_entry ssu00011
[] = {
109 gettext("Clear the current keylist."),
113 gettext("Read a krb5 keytab into the current keylist."),
117 gettext("Read a krb4 srvtab into the current keylist."),
121 gettext("Write the current keylist to a krb5 keytab."),
125 gettext("Write the current keylist to a krb4 srvtab."),
129 gettext("Add an entry to the current keylist."),
133 gettext("Delete an entry from the current keylist."),
137 gettext("List the current keylist."),
141 gettext("List available requests."),
145 gettext("Exit program."),
150 ss_request_table ktutil_cmds
= { 2, ssu00011
};
155 * This routine is responsible for localizing all the displayable
156 * messages in the table. This was necessary since ktutil will be
157 * invoking library calls that need to be able to display the messages
158 * in the correct text domain (which only ktutil knows).
160 * This function assumes that the US version of the messages are
161 * pre-loaded in the table and will be used should gettext not be
162 * successful. This routine does NOT free the replaced strings as
163 * its expected they may be in the heap (as above) and not malloc'ed.
164 * If the caller malloc'ed the strings, they should retain pointers
165 * and free them if not matching the contents of the table.
168 ktutil_initialize_cmds_table(ss_request_table
*ktutil_cmds
)
170 char *localized_text
;
171 ss_request_entry
*ss_cmd
;
172 krb5_error_code retval
= 0;
175 for (ss_cmd
= ktutil_cmds
->requests
;
176 ss_cmd
->info_string
&& *(ss_cmd
->info_string
) != '\0';
178 localized_text
= gettext(ss_cmd
->info_string
);
180 if ((strcmp(localized_text
, ss_cmd
->info_string
))
182 ss_cmd
->info_string
= strdup(localized_text
);