When does a wrapper become a library, and when to use DLL's?

Everything else that doesn't fall into one of the other PB categories.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

When does a wrapper become a library, and when to use DLL's?

Post by SFSxOI »

In a very simplistic manner and basically;

A wrapper basically opens a dll library and provides access to the functions within the .dll library.

A library adds functionality that doesn't already exist in PureBasic in the form of new methods or functionality.

so I have a few questions...

1. If you produce a wrapper that adds a new method or access to new functions in a .dll file, and those functions or methods do not currently exist in PureBasic, is it classed as a wrapper or a library?

2. If you want to distribute such a wrapper (or library) for free is it correct to do so using the original .dll function names? (probably wouldn't do this anyway)

3. When is it necessary to produce a new .dll file (for free distribution) if your using the new functions or methods if those functions or methods do not already exist in PureBasic? (or is this just a personal choice thing)

4. And last...if the new functions and methods are not already in PureBasic and you produce this wrapper, library, or .dll, for free distribution and compile it within PureBasic, what portions of the Purebasic license apply? (because the functions and methods do not currently exist in PureBasic)

Maybe dumb questions...but my boss is asking me about some things because I used PureBasic in an internal project (non-commercial project) which was distributed freely in a very limited scope using some of the new functionality in Vista and the project used all API (no PureBasic commands - it was a requirement of the project) but was compiled in PureBasic. Just a few questions because the legal department asked, nothing serious. (and...i'm not in trouble - personally I think the world would be better off without lawyers)
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

1. a wrapper is linked statically into your exe, so you could call your wrapper a library (of sorts.). The wrapper still needs the .dll though...
2. a function name is just part of the interface to the code proper. You're not duplicating the implementation code, so that I guess it would be ok to use the function names. In free projects (using free dll's) it will even be less of a problem...
3. new code can either be distributed for static linking (i.e. a library) or a .dll. A dll would allow other languages to use your code as well.
4. Merely wrapping the libraries that already came with PureBasic is a no-no.
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

dell_jockey wrote:1. a wrapper is linked statically into your exe, so you could call your wrapper a library (of sorts.). The wrapper still needs the .dll though...
2. a function name is just part of the interface to the code proper. You're not duplicating the implementation code, so that I guess it would be ok to use the function names. In free projects (using free dll's) it will even be less of a problem...
3. new code can either be distributed for static linking (i.e. a library) or a .dll. A dll would allow other languages to use your code as well.
4. Merely wrapping the libraries that already came with PureBasic is a no-no.
OK, dell_jockey, you mentioned something that I should have clarified a little. I am not wrapping any libraries, files, functions, that come with PureBasic (your right that is a no-no, I would never do that). Thanks for mentioning that.
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

I guess that PB licence don't apply in your case and you are free to do whatever you want with your wrapper/library/dll, no matter it was compiled with PB.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

the PB licence surely always applies when you work with PB.

but since you are allowed to distribute your products,
you are of course allowed to use your programs the way you want.
oh... and have a nice day.
Post Reply