how do 'plug-ins' work?

how do 'plug-ins' work?

Post by Ethan Vonderwei » Fri, 22 Oct 1999 04:00:00



I've got a little project I'm working on that could benifit from being able to
drop in third-party extensions as plug-ins.  I understand the plug-in theory,
more or less, but I'm fuzzy on the implementation details.  I was hoping someone
could help me out a bit.

As I understand it (and please correct me if I'm wrong), if I create a function
library and compile it as a static object then I have to compile the final app
along with that object.  If I make my library a shared object than I just have to
link against it at compile time and it's included at run-time (I've never made
any of my own so's - do you have to do anything different than what you'd do for
a static object?).

But what if I want to create a library that I can just drop into an app without
having to recompile against it (such as a netscape-style plug-in)?  Obviously
there has to be some agreed-upon api so the app knows what entry points exist in
the library and the library knows what functions the app exposes, but how does
the app actually 'load' the library while it's running?

I noticed some functions for loading dynamic modules in a glib reference and this
seems like it would be a place to start, but once I've loaded the module is there
anything special I have to do to call it's functions or do they just magically
become available?  This is the part where I'm getting lost...

If anyone can point me to a good online resource for this or drop me a basic
explanation, I'd be grateful.  I've looked over netscape's plug-in docs but that
mostly concentrates on the api side of things.  I spent some time digging through
the gimp source but gimp plug-ins appear to run as a separate process which isn't
really the behavior I'm after (I could probably still do what I want that way,
but I need to get a handle on this whole library thing anyway ;).

thanks in advance,

e
--
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
|  Ethan VonderWeid                          IT Technical Operations  |

|  (650) 336-0534 (internal x60534)              This space for rent  |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+

 
 
 

how do 'plug-ins' work?

Post by Robert Lync » Fri, 22 Oct 1999 04:00:00



> I've got a little project I'm working on that could benifit from being able to
> drop in third-party extensions as plug-ins.  I understand the plug-in theory,
> more or less, but I'm fuzzy on the implementation details.  I was hoping someone
> could help me out a bit.

> As I understand it (and please correct me if I'm wrong), if I create a function
> library and compile it as a static object then I have to compile the final app
> along with that object.  If I make my library a shared object than I just have to
> link against it at compile time and it's included at run-time (I've never made
> any of my own so's - do you have to do anything different than what you'd do for
> a static object?).

> But what if I want to create a library that I can just drop into an app without
> having to recompile against it (such as a netscape-style plug-in)?  Obviously
> there has to be some agreed-upon api so the app knows what entry points exist in
> the library and the library knows what functions the app exposes, but how does
> the app actually 'load' the library while it's running?

> I noticed some functions for loading dynamic modules in a glib reference and this
> seems like it would be a place to start, but once I've loaded the module is there
> anything special I have to do to call it's functions or do they just magically
> become available?  This is the part where I'm getting lost...

> If anyone can point me to a good online resource for this or drop me a basic
> explanation, I'd be grateful.  I've looked over netscape's plug-in docs but that
> mostly concentrates on the api side of things.  I spent some time digging through
> the gimp source but gimp plug-ins appear to run as a separate process which isn't
> really the behavior I'm after (I could probably still do what I want that way,
> but I need to get a handle on this whole library thing anyway ;).

> thanks in advance,

> e
> --
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
> |  Ethan VonderWeid                          IT Technical Operations  |

> |  (650) 336-0534 (internal x60534)              This space for rent  |
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+

If you have access to Linux Journal, the Sept. 1999 issue has an article
by Larry Hoff called: "Netscape Plug-Ins" that appears to be in English.
:)

HTH. Bob L.
--

http://www.veryComputer.com/~rm*/

 
 
 

how do 'plug-ins' work?

Post by Robert C » Sat, 23 Oct 1999 04:00:00


Read
  man dlopen     // open a *.so file
  man dlsym      // return a pointer to a named object in the file
  man dlclose    // close the file
This interface used on most Unixes, except HP-UX.  You'll need to
have at least one "standard" entry point in the plugin.so library
so you can attach to it and call it with dlsym().  In my software,
each plugin must have a routine named "PLUGIN_init" - the software
looks for it with dlsym(), and if it finds it, calls it for the
plugin to initialize itself.  If the symbol doesn't exist, then
it isn't a valid plugin, and the file is dlclose()-ed.

bob cox

 
 
 

1. I plug'n played but couldn't plug again

Boy am I having problems trying to get my CDrom to read the CD again.

The first time I tried the YggDrasil distribution CD and floppy it
worked. I used the demo and installation scripts ok, however the
CD took hours to do the data transfers. I believe it mounts a RAMdisk
and a CDrom whatever.

Unfortunately the boot wouldn't work (there were a few I/O errors so
probably the necessary loading stuff was corrupted.
So I attempted to put the floppy and CD in to boot form there.
Now there occurs CD I/O error messages and I never get to the login prompt.

What's happening? I don't know anything about CD technolgy and what
can go wrong. The CD is detected as a Mitsumi (its on a IDE type of
CD interface card). It's an early version single speed drive. Is
access speed important (I read about SCSI asyncronous timeouts).
Has my CD-rom drive somehow got out of alignment in that when attempting
to read parts of the roms  surface on the extremities, it misses????
Surely the CD hasn't deteriorated! I can read DOS files from a CD fine!

I have tried the floppy and CD on machines at work- I get the boot:
prompt, but then there is a MINIX-fs unable to read superblock
error with a code snippet/core dump hangup.

2. Abit BE2 + HPT366 + Kernel 2.2.14

3. What's 'side effects' of Ksh built-ins?

4. How to Get , Read , Send Mail ???

5. Netscape plug-ins on AIX 4

6. CDROM Standards

7. plug-ins netscape

8. Digi PC/8em driver problem OSR5

9. Reward for NExS Spreadsheet Plug-Ins

10. Netscape helpers and plug-ins, also java help

11. List of plug-ins for linux/netscape please!

12. Browser Question (Plug-ins) m-w.com

13. Netscape and Plug-ins