![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
Runtime Extensions
I'm interested in writing a program in C using GTK+ on Linux, but I wanted to know how I might go about providing developers with the ability to write extensions for my application without recompiling. This is similar to the way Firefox does extensions, although I would like for my extensions to be written in C for maximum performance. I don't have a clue about how something like this can be done. Can anyone here give a basic explanation or provide some links that show examples?
|
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
There are several steps to this process:
1) Determine which functionality of your program you wish plugins to use. 2) Place that functionality into a shared library that both your program and the plugin's will link to. 3) Compile a shared library against your programs shared library 4) At runtime load the shared library with dlopen and use dlsym to look up the predefined registration function. 5) Call that registration function with whatever initial data your plugin needs to operate. 6) When you wish to unload the plugin you will have to use dlclose. Once you have wrapped your head around that, feel free to ask questions. Here is a short discussion with some example code.
__________________
Robotics @ Maryland AUV Team - Software Lead |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Sep 2007
Posts: 2
Rep Power: 0
![]() |
I know I'm late so for a later reference.
LUA, LUA, LUA. I know it ain't exactly what TP asked for but in the end, if he studies how LUA is implemented in an application, he will understand how to achieve extendability in his application. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating forms at runtime | kruptof | Visual Basic | 6 | Jun 14th, 2006 7:01 PM |
| Is it possible to glob files with no extensions? | aznluvsmc | Perl | 3 | Jan 25th, 2006 5:38 AM |
| Runtime error R6034 | Polyphemus_ | C++ | 4 | Nov 27th, 2005 6:14 AM |
| Mono Runtime error. | pr0gm3r | C# | 8 | Oct 12th, 2005 4:10 PM |
| how to write Shell extensions in masm | salafi | Assembly | 1 | Jul 8th, 2005 11:26 PM |