delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/21/13:16:24

From: yorka AT dlc DOT fi (aYk)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Plugins with djgpp
Date: Sun, 21 Jun 1998 16:06:56 GMT
Organization: Majik
Lines: 55
Message-ID: <358d275f.243624@news.dlc.fi>
References: <358d0a71 DOT 3634475 AT news DOT kfunigraz DOT ac DOT at>
NNTP-Posting-Host: kou90.pp.dlc.fi
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

POSSIBILITY #1 - Extra functionality:
-------------------------------------
Generally speaking any "plugin" can be used with libc file functions
and some clever coding, just like loading any file (I am assuming you
mean an external file that provides extra features by "plugin" here).

The trick is coming up with a format that you store the "plugins" in,
however this is not something that I or anyone else could answer in a
newsgroup, you must do this yourself since the format will and must
change from program to program.

You can store/load raw data pretty easily but storing/loading
something like a class with internal functions is impossible, since it
can't be represented in any kind of data form (the computer does not
understand what a class is, but the programmer does).

POSSIBILITY #2 - Realtime instruction interpretation:
-----------------------------------------------------
If you mean loading a compiled .o file in your main program and
turning it into a set of instructions for the computer in realtime
(ie. you load an .o file and do whatever is told in the file), then I
can only say that it is by all means _possible_ (actually this is what
the computer does whenever you fire up an executable), but also
_virtually_impossible_, as you would need a pretty complicated system
for this one to say the least (the problem here is trying to feed the
data in the .o file to the computer in the right format, you would
need some pretty hardcore stuff for this one).

POSSIBILITY #3 - Compile-time object files:
-------------------------------------------
If you simply mean linking a program with external objects (ie. adding
compiled files together and building an executable out of them) then
you can forget about my ramblings above and try something like:

gcc/gpp/gxx/g++ -o <executable> <objects and source code>

ie:

gcc -o program.exe program.c plugin1.o plugin2.o plugin3.c

- aYk -

| Atte "Yorkaturr" Koivula 	- aYk -	 |
| -------------------------------------- |
| God of Evil | yorkaturr AT majik DOT netti DOT fi |
| Programmer  |	yorka AT dlc DOT fi		 |
| Graphician  |	yorka AT newbies DOT net	 |
| -------------------------------------- |
| Majik MURPE  -  http://majik.netti.fi  |

>
>does anybody have experiences with implementing external plugins into
>a program compiled with djgpp? in my program i have a class which i
>want to load as a plugin from a file (probably .o-file)
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019