[sqlite] function pointers? - Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-08 Thread Kervin L. Pierre
Hello, Regardless of program loading design, wouldn't this feature be better coded using function pointers? Ie. Have a "register/load" function that maps functions in the exe? PS. It would be helpful to have sqlite3OSMalloc() and sqlite3OSFree() as function pointers as well, so an application

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-08 Thread Peter Cunderlik
How does introducing a new shared library format that supports automatic bidirectional linking (as in Unix) break backwards compatibility? Nobody says they have to stop supporting DLLs. Just provide something better in addition to DLLs... Despite disliking many of the Win32 "features", I see

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Joe Wilson
What you're trying to do is possible without .def files or import files or whatever. Just put something like this in sqlite3.h before everything: #ifdef _WIN32 #define S3EXPORT __declspec(dllexport) #define S3IMPORT __declspec(dllimport) #define S3CALL __stdcall #ifdef

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Ted Unangst
Robert Simpson wrote: Pardon my ignorance about *nix, but what happens during this whole global symbol mapping thing if two libraries both export the same function name? generally the first one is picked, though there's variations between OS. the search order for first is fairly flexible

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Dennis Cote
Dennis Jenkins wrote: You can do something very similar on windows. Just dump a hacked "kernel32.dll" into the same directory as the EXE. This might not work with SP2 of XP for system DLLs. However, if the EXE uses a non-system DLL (like libJpeg.dll), then just replace that one. Put some

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Dennis Jenkins
[EMAIL PROTECTED] wrote: > Dennis Jenkins <[EMAIL PROTECTED]> wrote: > >> The Windows way does not seem as powerful as the Unix way. I hate >> the M$ operating systems, but I code for them almost every day. So my >> next statement isn't so much a defense of Microsoft , but a rebuttal to

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread drh
Dennis Jenkins <[EMAIL PROTECTED]> wrote: > > The Windows way does not seem as powerful as the Unix way. I hate > the M$ operating systems, but I code for them almost every day. So my > next statement isn't so much a defense of Microsoft , but a rebuttal to > your assertion that "the

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Dennis Jenkins
Robert Simpson wrote: >> -Original Message- >> From: Dennis Jenkins [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, June 07, 2006 11:46 AM >> To: sqlite-users@sqlite.org >> Subject: Re: [sqlite] DLLs containing user-defined SQL functi

RE: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Robert Simpson
> -Original Message- > From: Dennis Jenkins [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 07, 2006 11:46 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] DLLs containing user-defined SQL functions > > Robert Simpson wrote: > >> -Original

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Dennis Jenkins
Robert Simpson wrote: >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, June 07, 2006 10:36 AM >> To: sqlite-users@sqlite.org >> Subject: Re: [sqlite] DLLs containing user-defined SQL functions >> >> &g

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread drh
"Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > > Note an inherent chicken and egg problem: you can't build two DLLs (or > an EXE and a DLL) using this approach where a circular dependency > exists, that is, where DLL A needs a function exported from DLL B, and > at the same time DLL B needs a

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Laurent Blanquet
Hello, It could be done using something like that : === sharedenv.h// used in calling program and DLL. === typedef struct{ pointer to functions funA,funB ... etc } mysharedfuns; = Main Program = mysharedfuns sharedfuns; main() {

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Jay Sprenkle
On 6/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: The disadvantages to the windows approach are obvious. Before I add this characteristic to the ever-growing list of reasons why I hate windows and especially hate programming for windows, I should be fair and ask if there are any advantages

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Dennis Jenkins
[EMAIL PROTECTED] wrote: > "Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > >>> This all works great on Unix. When I use dlopen() to >>> attach the shared library, the procA() reference in >>> the shared library is automatically resolved to the >>> address of procA() in the main program. >>>

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread drh
"Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > > > This all works great on Unix. When I use dlopen() to > > attach the shared library, the procA() reference in > > the shared library is automatically resolved to the > > address of procA() in the main program. > > On Windows, the loader works in

RE: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Robert Simpson
> -Original Message- > From: Robert Simpson [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 07, 2006 7:55 AM > To: 'sqlite-users@sqlite.org' > Subject: RE: [sqlite] DLLs containing user-defined SQL functions > > > -Original Message- > > From: [E

RE: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Robert Simpson
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 07, 2006 7:30 AM > To: Sqlite-users > Subject: [sqlite] DLLs containing user-defined SQL functions > [snip] > Another way to ask the question is this: How do I build > a DLL in windows that

Re: [sqlite] DLLs containing user-defined SQL functions

2006-06-07 Thread Ulrich Schöbel
Hi Richard, I'm no windows expert, but why don't you use something like the tcl stubs mechanism? Build a static sqlite_stubs.a library and link all loadable dynamic libs against it. Kind regards Ulrich On Wednesday 07 June 2006 16:30, [EMAIL PROTECTED] wrote: > I'm trying to add the ability