Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, Can anyone point me to a tutorial on writing programs in C that accept plugins without having to recompile the original program. Thanks is-serp...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2004
    Location
    Malta
    Posts
    41

    Writing C code with plugins


    Hi,

    Can anyone point me to a tutorial on writing programs in C that accept plugins without having to recompile the original program.

    Thanks
    is-serp

  2. #2
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    This might be of some help, is-serp:
    http://www-106.ibm.com/developerwork...html?n-l-10181
    By using functions described in the article you are able to open shared objects contained in some plugin directory. Those objects can all have an initialization that you will call upon main program startup. Now, from within the plugin, register functions handling various events in you application. In main app have linked list or dynamic array for each event you wish accessible to the plugins. That lists will store functions pointers to functions you have registered. Now when an event happens fire up each method from a corresponding list. I hope this helps a little.
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

  3. #3
    Just Joined!
    Join Date
    May 2004
    Location
    Malta
    Posts
    41
    Thanks for the link man

    is-serp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •