diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2006-03-28 07:21:50 +0000 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2006-03-28 07:21:50 +0000 |
commit | bd283c2464e2c0e1fd0aca1dedff0f39c2564c34 (patch) | |
tree | cac760be0ee93a44a265722ad13ac9eeb094fe74 /hw | |
parent | a06342eccc76035ff859fee4d283b288c90ee923 (diff) |
Add a new export, LoaderGetABIVersion. This function allows modules to
query the versions directly instead of having to guess. Bug #6416: Add
LoaderGetABIVersion.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86Module.h | 1 | ||||
-rw-r--r-- | hw/xfree86/loader/loader.c | 25 | ||||
-rw-r--r-- | hw/xfree86/loader/xf86sym.c | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index ea6d25b09..fafedba40 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -215,6 +215,7 @@ void LoaderReqSymLists(const char **, ...); void LoaderReqSymbols(const char *, ...); int LoaderCheckUnresolved(int); void LoaderGetOS(const char **name, int *major, int *minor, int *teeny); +int LoaderGetABIVersion(const char *abiclass); typedef pointer (*ModuleSetupProc)(pointer, pointer, int *, int *); typedef void (*ModuleTearDownProc)(pointer); diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c index ba2f4e692..30f151a4c 100644 --- a/hw/xfree86/loader/loader.c +++ b/hw/xfree86/loader/loader.c @@ -1508,3 +1508,28 @@ LoaderClearOptions(unsigned long opts) { LoaderOptions &= ~opts; } + +_X_EXPORT int +LoaderGetABIVersion(const char *abiclass) +{ + struct { + const char *name; + int version; + } classes[] = { + { ABI_CLASS_ANSIC, LoaderVersionInfo.ansicVersion }, + { ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion }, + { ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion }, + { ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion }, + { ABI_CLASS_FONT, LoaderVersionInfo.fontVersion }, + { NULL, 0 } + }; + int i; + + for(i = 0; classes[i].name; i++) { + if(!strcmp(classes[i].name, abiclass)) { + return classes[i].version; + } + } + + return 0; +} diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index d33cc8da7..e99c34301 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -760,6 +760,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(LoaderListDirs) SYMFUNC(LoaderFreeDirList) SYMFUNC(LoaderGetOS) + SYMFUNC(LoaderGetABIVersion) /* * These are our own interfaces to libc functions. |