From bd283c2464e2c0e1fd0aca1dedff0f39c2564c34 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Tue, 28 Mar 2006 07:21:50 +0000 Subject: [PATCH] Add a new export, LoaderGetABIVersion. This function allows modules to query the versions directly instead of having to guess. Bug #6416: Add LoaderGetABIVersion. --- ChangeLog | 9 +++++++++ hw/xfree86/common/xf86Module.h | 1 + hw/xfree86/loader/loader.c | 25 +++++++++++++++++++++++++ hw/xfree86/loader/xf86sym.c | 1 + 4 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09ce7e222..19737c74a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-03-27 Aaron Plattner + + * hw/xfree86/common/xf86Module.h: + * hw/xfree86/loader/loader.c: (LoaderGetABIVersion): + * hw/xfree86/loader/xf86sym.c: + Add a new export, LoaderGetABIVersion. This function allows + modules to query the versions directly instead of having to guess. + Bug #6416: Add LoaderGetABIVersion. + 2006-03-27 Kristian Høgsberg * configure.ac: 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.