diff options
Diffstat (limited to 'src/mapi/mapi/stub.c')
-rw-r--r-- | src/mapi/mapi/stub.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mapi/mapi/stub.c b/src/mapi/mapi/stub.c index 3594eacb4e..9a5c1d694b 100644 --- a/src/mapi/mapi/stub.c +++ b/src/mapi/mapi/stub.c @@ -39,6 +39,12 @@ #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0])) +struct mapi_stub { + mapi_func addr; + int slot; + const void *name; +}; + /* define public_string_pool and public_stubs */ #define MAPI_TMP_PUBLIC_STUBS #include "mapi_tmp.h" @@ -164,3 +170,38 @@ stub_fix_dynamic(struct mapi_stub *stub, const struct mapi_stub *alias) entry_patch(stub->addr, slot); stub->slot = slot; } + +/** + * Return the name of a stub. + */ +const char * +stub_get_name(const struct mapi_stub *stub) +{ + const char *name; + + if (stub >= public_stubs && + stub < public_stubs + ARRAY_SIZE(public_stubs)) + name = &public_string_pool[(unsigned long) stub->name]; + else + name = (const char *) stub->name; + + return name; +} + +/** + * Return the slot of a stub. + */ +int +stub_get_slot(const struct mapi_stub *stub) +{ + return stub->slot; +} + +/** + * Return the address of a stub. + */ +mapi_func +stub_get_addr(const struct mapi_stub *stub) +{ + return stub->addr; +} |