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