1 /*
2  * Copyright (C) 2006 Massachusetts Institute of Technology.
3  * All Rights Reserved.
4  *
5  * This software is being provided to you, the LICENSEE, by the
6  * Massachusetts Institute of Technology (M.I.T.) under the following
7  * license.  By obtaining, using and/or copying this software, you agree
8  * that you have read, understood, and will comply with these terms and
9  * conditions:
10  *
11  * Export of this software from the United States of America may
12  * require a specific license from the United States Government.
13  * It is the responsibility of any person or organization contemplating
14  * export to obtain such a license before exporting.
15  *
16  * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute
17  * this software and its documentation for any purpose and without fee or
18  * royalty is hereby granted, provided that you agree to comply with the
19  * following copyright notice and statements, including the disclaimer, and
20  * that the same appear on ALL copies of the software and documentation,
21  * including modifications that you make for internal use or for
22  * distribution:
23  *
24  * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS
25  * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not
26  * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF
27  * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
28  * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
29  * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
30  *
31  * The name of the Massachusetts Institute of Technology or M.I.T. may NOT
32  * be used in advertising or publicity pertaining to distribution of the
33  * software.  Title to copyright in this software and any associated
34  * documentation shall at all times remain with M.I.T., and USER agrees to
35  * preserve same.
36  *
37  * Furthermore if you modify this software you must label
38  * your software as modified software and not distribute it in such a
39  * fashion that it might be confused with the original M.I.T. software.
40  */
41 
42 /* Just those definitions which are needed by util/support/plugins.c,
43    which gets compiled before util/et is built, which happens before
44    we can construct krb5.h, which is included by k5-int.h.
45 
46    So, no krb5 types.  */
47 
48 #ifndef _K5_PLUGIN_H_
49 #define _K5_PLUGIN_H_
50 
51 #if defined(_MSDOS) || defined(_WIN32)
52 #include "win-mac.h"
53 #endif
54 #include "autoconf.h"
55 #ifndef KRB5_CALLCONV
56 #define KRB5_CALLCONV
57 #define KRB5_CALLCONV_C
58 #endif
59 
60 #ifdef HAVE_STDINT_H
61 # include <stdint.h>
62 #elif defined(HAVE_INTTYPES_H)
63 # include <inttypes.h>
64 #endif
65 
66 #include "k5-err.h"
67 
68 struct plugin_file_handle;	/* opaque */
69 
70 struct plugin_dir_handle {
71     /* This points to a NULL-terminated list of pointers to plugin_file_handle structs */
72     struct plugin_file_handle **files;
73 };
74 #define PLUGIN_DIR_INIT(P) ((P)->files = NULL)
75 #define PLUGIN_DIR_OPEN(P) ((P)->files != NULL)
76 
77 long KRB5_CALLCONV
78 krb5int_open_plugin (const char *, struct plugin_file_handle **, struct errinfo *);
79 void KRB5_CALLCONV
80 krb5int_close_plugin (struct plugin_file_handle *);
81 
82 long KRB5_CALLCONV
83 krb5int_get_plugin_data (struct plugin_file_handle *, const char *, void **,
84 			 struct errinfo *);
85 
86 long KRB5_CALLCONV
87 krb5int_get_plugin_func (struct plugin_file_handle *, const char *,
88 			 void (**)(), struct errinfo *);
89 
90 
91 long KRB5_CALLCONV
92 krb5int_open_plugin_dirs (const char * const *, const char * const *,
93 			  struct plugin_dir_handle *, struct errinfo *);
94 void KRB5_CALLCONV
95 krb5int_close_plugin_dirs (struct plugin_dir_handle *);
96 
97 long KRB5_CALLCONV
98 krb5int_get_plugin_dir_data (struct plugin_dir_handle *, const char *,
99 			     void ***, struct errinfo *);
100 void KRB5_CALLCONV
101 krb5int_free_plugin_dir_data (void **);
102 
103 long KRB5_CALLCONV
104 krb5int_get_plugin_dir_func (struct plugin_dir_handle *, const char *,
105 			     void (***)(void), struct errinfo *);
106 void KRB5_CALLCONV
107 krb5int_free_plugin_dir_func (void (**)(void));
108 
109 #endif /* _K5_PLUGIN_H_ */
110