> I hook fopen() from a loader lib injected using LD_PRELOAD. Originally I > hooked strrchr(), but it turned out that some systems have strrchr() as > macros.
Ok, not portable ;-) > If you plan to add native support in PCB so one doesn't need to use > such hacks, I think the simplest way would be to acquire the HID > names from a file and/or command line arguments and just load them > using dlopen() and call an init function. The init function then can > call back hid_register_hid() and co. I was wondering what to call the init function. I was thinking, for "foo.so" I'd first check "hid_foo_init()" and, failing that, "init()". Can't use "hid_init()" because that's a function in pcb itself. I'd go with just "init" for everyone, so that renaming .so's works, but that makes it messy when you link them in statically. You can also use gcc's __attribute__((constructor)) to tag a constructor function that's called at dlopen. I'll make sure you can't double-register a hid, and we should be covered. _______________________________________________ geda-dev mailing list [email protected] http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
