Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 28th, 2007, 12:06 AM   #1
Darkhack
Hobbyist Programmer
 
Darkhack's Avatar
 
Join Date: Dec 2005
Location: Kansas City
Posts: 106
Rep Power: 4 Darkhack is on a distinguished road
Send a message via AIM to Darkhack
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?
Darkhack is offline   Reply With Quote
Old Aug 28th, 2007, 2:50 PM   #2
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
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
Game_Ender is offline   Reply With Quote
Old Sep 25th, 2007, 9:05 AM   #3
Uten
Newbie
 
Join Date: Sep 2007
Posts: 2
Rep Power: 0 Uten is on a distinguished road
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.
Uten is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:57 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC