BTW, below is a minimal Xorg-module stub derived from dummy_driver.c -
it contains the mandatory basics required by Xorg's loadmod.c .
You can LD_PRELOAD whatever you need and then call whatever external
functions from testingAround() :
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* All drivers should typically include these */
#include "xf86.h"
#include "xf86_OSproc.h"
/* This is used for module versioning */
#include "xf86Version.h"
/* All drivers initialising the SW cursor need this */
#include "mipointer.h"
/* All drivers implementing backing store need this */
#include "mibstore.h"
/* All drivers using the mi colormap manipulation need this */
#include "micmap.h"
/* identifying atom needed by magnifiers */
#include <X11/Xatom.h>
#include "property.h"
#include "xf86cmap.h"
#include "xf86fbman.h"
#include "fb.h"
#include "picturestr.h"
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
/*
* Driver data structures.
*/
#include "dummy.h"
/* These need to be checked */
#include <X11/X.h>
#include <X11/Xproto.h>
#include "scrnintstr.h"
#include "servermd.h"
#ifdef XFreeXDGA
#define _XF86DGA_SERVER_
#include <X11/extensions/xf86dgastr.h>
#endif
/* Mandatory functions */
/*
* static const OptionInfoRec * DUMMYAvailableOptions(int chipid, int busid);
* static void DUMMYIdentify(int flags);
* static Bool DUMMYProbe(DriverPtr drv, int flags);
* static Bool DUMMYPreInit(ScrnInfoPtr pScrn, int flags);
* static Bool DUMMYScreenInit(int Index, ScreenPtr pScreen, int argc,
* char **argv);
* static Bool DUMMYEnterVT(int scrnIndex, int flags);
* static void DUMMYLeaveVT(int scrnIndex, int flags);
* static Bool DUMMYCloseScreen(int scrnIndex, ScreenPtr pScreen);
* static Bool DUMMYCreateWindow(WindowPtr pWin);
* static void DUMMYFreeScreen(int scrnIndex, int flags);
* static ModeStatus DUMMYValidMode(int scrnIndex, DisplayModePtr mode,
* Bool verbose, int flags);
* static Bool DUMMYSaveScreen(ScreenPtr pScreen, int mode);
* /
/* Internally used functions */
static Bool dummyModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
static void dummySave(ScrnInfoPtr pScrn);
static void dummyRestore(ScrnInfoPtr pScrn, Bool restoreText);
static Bool dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
pointer ptr);
static void testingAround(void);
/*
* This is intentionally screen-independent. It indicates the binding
* choice made in the first PreInit.
*/
static int pix24bpp = 0;
#ifdef XFree86LOADER
static XF86ModuleVersionInfo dummyVersRec =
{
"dummy",
"MODULEVENDORSTRING",
"MODINFOSTRING1",
"MODINFOSTRING2",
7,
7, 7, 7,
"abiclass7",
7,
"mosclass",
{7,7,7,7}
};
/*
* This is the module init data.
* Its name has to be the driver name followed by ModuleData
*/
_X_EXPORT XF86ModuleData dummyModuleData = { &ffbVersRec, testingAround,
NULL };
#endif /* XFree86LOADER */
void testingAround(void)
{
fprintf(stderr, "%s", "Hi, PLAYGROUND HERE!\n");
// ...
}