Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Best way to write plug-ins?

From: ma...@alvserv-2.dfki.uni-kl.de (Thomas Malik)
Subject: Re: Best way to write plug-ins?
Date: 1995/07/17
Message-ID: <3udpm9$676@serv-200.dfki.uni-kl.de>#1/1
X-Deja-AN: 106437275
distribution: world
sender: ma...@dfki.uni-kl.de (Thomas Malik)
references: <3u7amh$hnq@felix.cc.gatech.edu>
organization: DFKI Kaiserslautern
keywords: plug-in, plugin, applet
newsgroups: comp.os.linux.development.apps

Another way would be to make use of ELF's fabulous dynamic linking
facilities: 


  1. make object files from your 
  2. use dlopen() to open an compiled (object) file
  3. use dlsym() to get the address of functions from the opened
     object file.
  4. use the address to call your function you just loaded from the
     object file.
  5. use dlclose to get rid of the module.

See the man pages for these functions (note that they aren't there on
a non-ELF system).

This makes any data passing easy, since the modules are linked against
the main program, so you may use any global variable/function from the
main program in your modules.

-- 

===============================================================================
  					       |
  _/_/_/_/_/_/_/_/_/_/_/      _/       _/_/    |      
          _/                 _/_/    _/ _/     |  Thomas Malik     
         _/                 _/  _/ _/  _/      |  ma...@serv-400.dfki.uni-kl.de    
        _/                 _/    _/   _/       |  ma...@sun.rhrk.uni-kl.de
       _/                 _/         _/        |  Berliner Str. 5-11
      _/                 _/         _/         |  6750 Kaiserlautern     
     _/                 _/         _/          |  (0631) 79868 
    _/  _/             _/         _/  _/       |