Annotation of embedaddon/sudo/include/sudo_dso.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (c) 2010, 2013 Todd C. Miller <Todd.Miller@courtesan.com>
3: *
4: * Permission to use, copy, modify, and distribute this software for any
5: * purpose with or without fee is hereby granted, provided that the above
6: * copyright notice and this permission notice appear in all copies.
7: *
8: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15: */
16:
17: #ifndef _SUDO_DSO_H
18: #define _SUDO_DSO_H
19:
20: /* Values for sudo_dso_load() mode. */
21: #define SUDO_DSO_LAZY 0x1
22: #define SUDO_DSO_NOW 0x2
23: #define SUDO_DSO_GLOBAL 0x4
24: #define SUDO_DSO_LOCAL 0x8
25:
26: /* Special handle arguments for sudo_dso_findsym(). */
27: #define SUDO_DSO_NEXT ((void *)-1) /* Search subsequent objects. */
28: #define SUDO_DSO_DEFAULT ((void *)-2) /* Use default search algorithm. */
29: #define SUDO_DSO_SELF ((void *)-3) /* Search the caller itself. */
30:
31: /* Internal structs for static linking of plugins. */
32: struct sudo_preload_symbol {
33: const char *name;
34: void *addr;
35: };
36: struct sudo_preload_table {
37: const char *path;
38: void *handle;
39: struct sudo_preload_symbol *symbols;
40: };
41:
42: /* Public functions. */
43: char *sudo_dso_strerror(void);
44: int sudo_dso_unload(void *handle);
45: void *sudo_dso_findsym(void *handle, const char *symbol);
46: void *sudo_dso_load(const char *path, int mode);
47: void sudo_dso_preload_table(struct sudo_preload_table *table);
48:
49: #endif /* _SUDO_DSO_H */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>