This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
pcb:plugins [2018/06/23 13:20] cparker [Plugin Mechanics] |
pcb:plugins [2018/07/12 16:40] (current) cparker |
||
---|---|---|---|
Line 5: | Line 5: | ||
pcb plugins are essentially shared libraries that pcb will load at run-time. Because of this, they can be written in just about any language that can be compiled into a shared library. I haven't verified anything other than C and C++, but it ought to be possible. If you've successfully written a plugin in another language, let me know! | pcb plugins are essentially shared libraries that pcb will load at run-time. Because of this, they can be written in just about any language that can be compiled into a shared library. I haven't verified anything other than C and C++, but it ought to be possible. If you've successfully written a plugin in another language, let me know! | ||
- | At runtime, pcb scans several directories for .so/.dll files (see src/common/hidinit.c:hid_load_dir). If it finds one, it opens it and looks for a couple of symbols: "hid_<file basename>_init" and "pcb_plugin_init". If it finds one, it executes it as a function. These functions are responsible for registering the code they represent with pcb. | + | At runtime, pcb scans several directories for .so/.dll files (see src/common/hidinit.c:hid_load_dir). These include the exec prefix and the users personal preferences directory (~/.pcb). The exec_prefix is currently reserved for system plugins. Inside the personal pref directory should be a directory called "plugins". User plugins should be located in this directory. |
+ | |||
+ | If pcb finds a .so/.dll file, it opens it and looks for a couple of symbols: "hid_<file basename>_init" and "pcb_plugin_init". If it finds one, it executes it as a function. These functions are responsible for registering the code they represent with pcb. | ||
====Registration==== | ====Registration==== | ||