xref: /freebsd/crypto/krb5/src/util/verto/module.c (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /*
2  * Copyright 2011 Red Hat, Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person
5  * obtaining a copy of this software and associated documentation files
6  * (the "Software"), to deal in the Software without restriction,
7  * including without limitation the rights to use, copy, modify, merge,
8  * publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 
25 /* Stub implementation of module loading for MIT krb5 bundled libverto. */
26 
27 #include <string.h>
28 
29 int
module_symbol_is_present(const char * modname,const char * symbname)30 module_symbol_is_present(const char *modname, const char *symbname)
31 {
32     return 0;
33 }
34 
35 int
module_get_filename_for_symbol(void * addr,char ** filename)36 module_get_filename_for_symbol(void *addr, char **filename)
37 {
38     return 0;
39 }
40 
41 void
module_close(void * dll)42 module_close(void *dll)
43 {
44 }
45 
46 char *
module_load(const char * filename,const char * symbname,int (* shouldload)(void * symb,void * misc,char ** err),void * misc,void ** dll,void ** symb)47 module_load(const char *filename, const char *symbname,
48             int (*shouldload)(void *symb, void *misc, char **err), void *misc,
49             void **dll, void **symb)
50 {
51     if (dll)
52         *dll = NULL;
53     if (symb)
54         *symb = NULL;
55     return strdup("module loading disabled");
56 }
57