Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dsdp-tcf-dev] [Bug 286149] New: TCF plugins system

https://bugs.eclipse.org/bugs/show_bug.cgi?id=286149  
Product/Component: Target Management / TCF
           Summary: TCF plugins system
           Product: Target Management
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: TCF
        AssignedTo: dsdp.tm.tcf-inbox@xxxxxxxxxxx
        ReportedBy: philippe.proulx@xxxxxxxxxx
         QAContact: martin.oberhuber@xxxxxxxxxxxxx


Created an attachment (id=143931)
 --> (https://bugs.eclipse.org/bugs/attachment.cgi?id=143931)
Proposal patch for TCF plugins system.

Here is the patch for a basic plugins system support. In the modified Makefile,
the plugins system is disabled by default. To enable it, you have to specifity
a plugins path, where the compiled agent is going to search for valid plugins.
The plugins path may be specified to `make' like this:

make PATH_Plugins="/absolute/path/to/the/plugins"

TCF plugins have to be compiled/linked as shared libraries (see
http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Program-Library-HOWTO.html#AEN95
). For example, a plugin `myplugin.so' made of `myplugin.c' and `tools.c'
should be built this way:

$ gcc -fPIC -c -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-Wmissing-prototypes -Wno-parentheses -I path/to/tcf-agent/ myplugin.c tools.c
$ gcc -shared -Wl,-soname,myplugin.so -o myplugin.so myplugin.o tools.o -lc

When the agent loads, the plugins system will call, for each .so found, the
function "tcf_init_plugin". Thus, the only function that's going to be called
by the system in your plugin should have this prototype:

void tcf_init_plugin(Protocol *, TCFBroadcastGroup *, TCFSuspendGroup *);

The plugin's function "tcf_init_plugin" has the same purpose as the services
initialization functions.

This patch has been applied and tested on SVN revision 760 of the C TCF agent
under Linux. The plugins system is only implemented on UNIX-based systems for
now (because it uses libdl functions), but could possibly be extended to other
systems using other mechanisms.

What do you think about it? Comments, suggestions?

Legal Message: I, Philippe Proulx, declare that I developed
attached code from scratch, without referencing any 3rd party materials
except material licensed under the EPL and EDL. I am authorized by my
employer, École Polytechnique de Montréal, to make this contribution
under the EPL and EDL.

The École Polytechnique de Montréal is a member of the Eclipse Associate
and Eclipse Membership At Large communities.


-- 
Configure bugmail: https://bugs.eclipse.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.

Back to the top