Plug-ins......?

Plug-ins......?

Post by Krog » Tue, 20 Jun 2000 04:00:00



Is there a good way of adding plugins to djgpp programs....

lets say i have a program that draws random circles on the screen,
or random rectangles.The user can select from a list what
kind of thing to draw,circles or rectangles.But i want to
add new things in the future,like say triangles or heart
shapes,but i dont want to make the users download the WHOLE
darn package,just a plug-in for the new shapes....Is this
possible?Can i do something like this with DXE?...

Is there a way to compile a little bit of code for a
drawing function and load it in memory and call it
from my program in a way that it could access global
varibles or other functions from my main program...

I dont have ANY experience with this type of thing,is
it possible or am i just out of luck unless i want
to switch to windows programming?

Thanks,
 Krogg

--
.sig fell off

 
 
 

Plug-ins......?

Post by Kalum Somaratna aka Grende » Wed, 21 Jun 2000 04:00:00


On Mon, 19 Jun 2000, The awesome and feared Krogg commented thusly,

Greetings Krogg,

Quote:> Is there a good way of adding plugins to djgpp programs....

> lets say i have a program that draws random circles on the screen,
> or random rectangles.The user can select from a list what
> kind of thing to draw,circles or rectangles.But i want to
> add new things in the future,like say triangles or heart
> shapes,but i dont want to make the users download the WHOLE
> darn package,just a plug-in for the new shapes....Is this
> possible?

Actually many windoze programmers would use DLL's for such functionality,
but the use is debatable (see below).

BTW it is not necessary for the users to download the whole package again
if they want to add the new functionality.

Say is the origrnial source code is 1 mb, and after you add the new shaped
the source code is 1.1 mb. you can send the diffs to the user who can
patch his old source distribution and recompile.

In the above examples the patch would be only 100k in size and it would be
further reduces to ~25 K once it is compressed.

If you arent distributing sources but distributing binaries, then there
are programs which would create patches for the binaries, thus the user
can get the patches and apply them very easily.

I suppose you may have come across downloading a 1 mb patch which
automtically installs it self and patches  a game etc..

Quote:> Can i do something like this with DXE?...

Yes, but DXE's have there limitations (please see the FAQ for details) and
I don't think it is worth the pain and hassle in the current context.. far
easier for you to distribute the patches...

Quote:> I dont have ANY experience with this type of thing,is
> it possible or am i just out of luck unless i want
> to switch to windows programming?

No you don't have to do windoze programmin, Actually it would be wise to
remember that the original purpose of DLL's was to enable the sharing of
resources etc, but then some crappy programmers realised that if there is
a bit of code that they aren't sure of, all they had to do was to put it
in a DLL and ship the product, and once they find the problem all they had
to do was to send only the DLL...a crappy approach as you may see, which
has led to innumerable problems..

Grendel

Hi, I'm a signature virus. plz set me as your signature and help me spread
:)

 
 
 

Plug-ins......?

Post by Tim Robinso » Wed, 21 Jun 2000 04:00:00


On Tue, 20 Jun 2000 19:14:41 +0600 (LKT)

Quote:> No you don't have to do windoze programmin, Actually it would be wise to
> remember that the original purpose of DLL's was to enable the sharing of
> resources etc, but then some crappy programmers realised that if there is
> a bit of code that they aren't sure of, all they had to do was to put it
> in a DLL and ship the product, and once they find the problem all they had
> to do was to send only the DLL...a crappy approach as you may see, which
> has led to innumerable problems..

Like Microsoft Plus!: they didn't have time (supposedly) to put some
stuff into the base version of Win95, so they thought "I know, we'll put
it all in a DLL and sell it at an inflated price after the OS comes
out".

------------
Tim Robinson

 
 
 

Plug-ins......?

Post by Eli Zaretski » Wed, 21 Jun 2000 04:00:00



> Newsgroups: comp.os.msdos.djgpp
> Date: Mon, 19 Jun 2000 19:48:07 -0400

> lets say i have a program that draws random circles on the screen,
> or random rectangles.The user can select from a list what
> kind of thing to draw,circles or rectangles.But i want to
> add new things in the future,like say triangles or heart
> shapes,but i dont want to make the users download the WHOLE
> darn package,just a plug-in for the new shapes....Is this
> possible?Can i do something like this with DXE?...

Yes, you can in principle use DXE for this.  However, DXE is
intentionally limited, so if you want to write loadable modules with
it, you will need to employ some tricks; see section 22.15 of the FAQ
for more details.

Alternatively, you could use the DLX package which is more versatile.

Quote:> Is there a way to compile a little bit of code for a
> drawing function and load it in memory and call it
> from my program in a way that it could access global
> varibles or other functions from my main program...

It's possible, but you will have to reinvent what DXE and DLX already
do for you: how to resolve addresses in loadable modules.  Given an
address, you just need an lcall instruction to call the code; figuring
out the address is the hard part.
 
 
 

Plug-ins......?

Post by Krog » Wed, 21 Jun 2000 04:00:00



Quote:

> On Mon, 19 Jun 2000, The awesome and feared Krogg commented thusly,

> Greetings Krogg,

> > Is there a good way of adding plugins to djgpp programs....

> Say is the origrnial source code is 1 mb, and after you add the new shaped
> the source code is 1.1 mb. you can send the diffs to the user who can
> patch his old source distribution and recompile.

This wouldnt fit in my plans...MY example is a little
limited in the scope of what i want to do...

Quote:

> > Can i do something like this with DXE?...

> Yes, but DXE's have there limitations (please see the FAQ for details) and
> I don't think it is worth the pain and hassle in the current context.. far
> easier for you to distribute the patches...

Well,I found DLM:

http://www.fukt.hk-r.se/~flognat/hacks/DLM/

and DLX:

http://nanosoft.hypermart.net/

They both seem to be near about what i am looking for.

I want to let a user download a new module IF they
want that one....A "plug-in" or "ADD on" so to speak.

Thanks for you input.

--

|"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
|      `.`/""""""\,','            my sig is too big,      |
|SEE HIS (  /   \ \' SEE HIS      but its really cool.    |
| FACE    \/<> <>\/   SMILE                               |
|         /   W   \          Visit my ascii art site:     |
|       ,'\_|||||_/`.  http://www.gtcom.net/~krogg/ascii/ |

|____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|

 
 
 

Plug-ins......?

Post by Krog » Wed, 21 Jun 2000 04:00:00




> > Newsgroups: comp.os.msdos.djgpp
> > Date: Mon, 19 Jun 2000 19:48:07 -0400

> > lets say i have a program that draws random circles on the screen,
> > or random rectangles.The user can select from a list what
> > kind of thing to draw,circles or rectangles.But i want to
> > add new things in the future,like say triangles or heart
> > shapes,but i dont want to make the users download the WHOLE
> > darn package,just a plug-in for the new shapes....Is this
> > possible?Can i do something like this with DXE?...

> Yes, you can in principle use DXE for this.  However, DXE is
> intentionally limited, so if you want to write loadable modules with
> it, you will need to employ some tricks; see section 22.15 of the FAQ
> for more details.

Well,i figured DXE was limited in this,I had allready  read
the FAQ about it....Looked like a super pain to use in the
manner i would want......

Quote:> Alternatively, you could use the DLX package which is more versatile.

AH ha...I found that:

http://nanosoft.hypermart.net/

and DLM:

http://www.fukt.hk-r.se/~flognat/hacks/DLM/

I think there is hope after all,though both of them
have rather little in the way of docs and how to's.I guess
i will have to play around with using them for a while
b4 i can integrate the idea into my projects...

Quote:> > Is there a way to compile a little bit of code for a
> > drawing function and load it in memory and call it
> > from my program in a way that it could access global
> > varibles or other functions from my main program...

> It's possible, but you will have to reinvent what DXE and DLX already
> do for you: how to resolve addresses in loadable modules.  Given an
> address, you just need an lcall instruction to call the code; figuring
> out the address is the hard part.

Ok,I was just grasping at straws here.I am  glad that there
is DLX and DLM to play with.

Does anybody know of any other packages like these or
any more info or how to's related to them OR even tools
that help in using them...?

Thanks,
 Krogg.

--

|"""""<`.THE PRINCE ,'>"""""""""""""""""""""""""""""""""""|
|      `.`/""""""\,','            my sig is too big,      |
|SEE HIS (  /   \ \' SEE HIS      but its really cool.    |
| FACE    \/<> <>\/   SMILE                               |
|         /   W   \          Visit my ascii art site:     |
|       ,'\_|||||_/`.  http://www.gtcom.net/~krogg/ascii/ |

|____<,' TIME TO DIE `.>____Remove no.to.spam to reply____|

 
 
 

Plug-ins......?

Post by Eli Zaretski » Thu, 22 Jun 2000 04:00:00



> and DLM:

> http://www.fukt.hk-r.se/~flognat/hacks/DLM/

Note that DLM sources have disappeared from the net, so all you have is
binaries.  Which means if you find a bug, you cannot investigate or fix
it.
 
 
 

Plug-ins......?

Post by Krog » Thu, 22 Jun 2000 04:00:00




> > and DLM:

> > http://www.fukt.hk-r.se/~flognat/hacks/DLM/

> Note that DLM sources have disappeared from the net, so all you have is
> binaries.  Which means if you find a bug, you cannot investigate or fix
> it.

no so...the stuff i downloaded has sources for the 3 binaries
that were included.Not that,_that_ would help me,as i doubt
_i_ can figure out how to fix any bugs that _may_ be present.

--
.sig no verb.