J-Pilot Plugin Manual

Updates

This document was last updated 28 September 2002, for J-Pilot-0.99.3 

What are plugins?

A plugin is code that can extend the functionality of j-pilot without adding any code to j-pilot, or recompiling it.  It is basically just a shared library that contains pre-defined callback functions.
A callback function is a function that is not called from the application itself, but from an external program.  When J-Pilot starts up it will scan the plugin directories for any shared libraries (~/.jpilot/plugins/ and $BASE_DIR/lib/jpilot/plugins).  When it finds a shared library it will find callback functions inside of the library and call them when needed.  So, a plugin can be an integral part of the overall program just by its existence and when taken away the main program will still run only missing the functionality that the plugin provided.

Creating plugins

Plugins are relatively easy to write for J-Pilot.  All you need to do is implement the plugin callback functions as needed and write the application specific code.  I have provided an example plugin for the Expense application.  I used this application because it is included in the palm pilot ROM and everyone should have it.  Since then I have been proved wrong.  The new m100s don't have Expense and I think some old Pilots don't have it.  It took me about 10 hours to write it with a lot of code reuse from other parts of j-pilot.

I have created a library of useful functions for writing J-Pilot conduits.  The code is inside j-pilot and the header file is libplugin.h.  The naming convention is that all of these functions start with "jp_".  There are some I threw in there and didn't add a jp_ prefix because I would have had to change too much existing code. 

If you do create a plugin I would appreciate it if you would give me a link to the site so that I can put it on my website.  This will encourage more people to use J-Pilot and your plugin.  Even if you are working on a plugin you can let me know and I will put it down as in progress so that someone doesn't duplicate your effort.  Its GNU licensed code so you are free to not tell me of course, as long as you follow the GNU license. My email is Judd Montgomery <judd@engineer.com>.  The official J-Pilot website is at http://jpilot.org.

Example Plugins

I have written Expense and SyncTime as example plugins. Expense is a GUI (Graphical User Interface) application and SyncTime has no GUI.  It shouldn't be too hard to use these as a base point for writing your own. 

Plugin call back functions

These functions are functions that you may implement in your plugin application.  Most of them are not required.  All you have to do is write them and they will be called at the appropriate times.  The naming convention is that all of these functions start with "plugin_".


int plugin_search(char *search_string, int case