1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * Copyright (C) 2006 Massachusetts Institute of Technology.
6 * This software is being provided to you, the LICENSEE, by the
7 * Massachusetts Institute of Technology (M.I.T.) under the following
8 * license. By obtaining, using and/or copying this software, you agree
9 * that you have read, understood, and will comply with these terms and
12 * Export of this software from the United States of America may
13 * require a specific license from the United States Government.
14 * It is the responsibility of any person or organization contemplating
15 * export to obtain such a license before exporting.
17 * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute
18 * this software and its documentation for any purpose and without fee or
19 * royalty is hereby granted, provided that you agree to comply with the
20 * following copyright notice and statements, including the disclaimer, and
21 * that the same appear on ALL copies of the software and documentation,
22 * including modifications that you make for internal use or for
25 * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS
26 * OR WARRANTIES, EXPRESS OR IMPLIED. By way of example, but not
27 * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF
28 * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
29 * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
30 * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
32 * The name of the Massachusetts Institute of Technology or M.I.T. may NOT
33 * be used in advertising or publicity pertaining to distribution of the
34 * software. Title to copyright in this software and any associated
35 * documentation shall at all times remain with M.I.T., and USER agrees to
38 * Furthermore if you modify this software you must label
39 * your software as modified software and not distribute it in such a
40 * fashion that it might be confused with the original M.I.T. software.
43 /* Just those definitions which are needed by util/support/plugins.c,
44 which gets compiled before util/et is built, which happens before
45 we can construct krb5.h, which is included by k5-int.h.
52 #if defined(_MSDOS) || defined(_WIN32)
58 #define KRB5_CALLCONV_C
64 * Plugins normally export fixed symbol names, but when statically
65 * linking plugins, we need a different symbol name for each plugin.
66 * The first argument to PLUGIN_SYMBOL_NAME acts as the
67 * differentiator, and is only used for static plugin linking.
69 * Although this macro (and thus this header file) are used in plugins
70 * whose code lies inside the krb5 tree, plugins maintained separately
71 * from the krb5 tree do not need it; they can just use the fixed
72 * symbol name unconditionally.
75 #define PLUGIN_SYMBOL_NAME(prefix, symbol) prefix ## _ ## symbol
77 #define PLUGIN_SYMBOL_NAME(prefix, symbol) symbol
80 struct plugin_file_handle; /* opaque */
82 struct plugin_dir_handle {
83 /* This points to a NULL-terminated list of pointers to plugin_file_handle structs */
84 struct plugin_file_handle **files;
86 #define PLUGIN_DIR_INIT(P) ((P)->files = NULL)
87 #define PLUGIN_DIR_OPEN(P) ((P)->files != NULL)
90 krb5int_open_plugin (const char *, struct plugin_file_handle **, struct errinfo *);
92 krb5int_close_plugin (struct plugin_file_handle *);
95 krb5int_get_plugin_data (struct plugin_file_handle *, const char *, void **,
99 krb5int_get_plugin_func (struct plugin_file_handle *, const char *,
100 void (**)(), struct errinfo *);
104 krb5int_open_plugin_dirs (const char * const *, const char * const *,
105 struct plugin_dir_handle *, struct errinfo *);
107 krb5int_close_plugin_dirs (struct plugin_dir_handle *);
110 krb5int_get_plugin_dir_data (struct plugin_dir_handle *, const char *,
111 void ***, struct errinfo *);
113 krb5int_free_plugin_dir_data (void **);
116 krb5int_get_plugin_dir_func (struct plugin_dir_handle *, const char *,
117 void (***)(void), struct errinfo *);
119 krb5int_free_plugin_dir_func (void (**)(void));
121 #endif /* K5_PLUGIN_H */