ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/src/symbolmatrix.C
Revision: 1.4
Committed: Tue Aug 28 17:12:24 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
State: FILE REMOVED
Log Message:
removed old files

File Contents

# Content
1 /*
2 * symbolmatrix.C: Module symbol management.
3 * Rights to this code are documented in doc/pod/license.pod.
4 *
5 * Copyright © 2005-2007 Atheme Project (http://www.atheme.org)
6 */
7
8 static char const rcsid[] = "$Id: symbolmatrix.C,v 1.3 2007-07-21 13:23:22 pippijn Exp $";
9
10 #include "atheme.h"
11
12 void *
13 module_symbol_get (module_t *mod, module_symbol_t * sym)
14 {
15 return_val_if_fail (mod != NULL, NULL);
16 return_val_if_fail (sym != NULL, NULL);
17 return_val_if_fail (sym->sym != NULL, NULL);
18
19 /* XXX sym->mod->header->name is wrong. :( */
20 sym->mod = mod;
21 sym->addr = module_locate_symbol (sym->mod->header->name, sym->sym);
22
23 return sym->addr;
24 }
25
26 int
27 module_symbol_getn (module_symbol_source_t * map, size_t n)
28 {
29 int i;
30
31 return_val_if_fail (map != NULL, -1);
32 return_val_if_fail (n > 0, -1);
33
34 for (i = 0; i < n; i++)
35 {
36 module_t *m = module_find_published (map[i].mod);
37 map[i].sym.sym = map[i].symn;
38
39 /* handle failed lookups. */
40 if (module_symbol_get (m, &map[i].sym) == NULL)
41 i--;
42 }
43
44 return i;
45 }