Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Looking for examples that call C functions from PL/SQL!

Re: Looking for examples that call C functions from PL/SQL!

From: Dirk Bellemans <Dirk.Bellemans_at_skynet.belgium>
Date: Thu, 12 Aug 1999 08:03:56 +0200
Message-ID: <7otq82$2g7$1@news0.skynet.be>


Yass Khogaly wrote in message <7n7vgj$538$1_at_inet16.us.oracle.com>...
>
> long __declspec(dllexport) OutputString(context ,
> path , path_ind ,
> message , message_ind,
> filemode , filemode_ind ,
> len , len_ind )
>
> char *path;
> char *message;
> char *filemode;
> int len;
> OCIExtProcContext *context;
> short path_ind;
> short message_ind;
> short filemode_ind;
> short len_ind;
>
> {

I don't intend to jump on every little detail, but the above declaration will make many compilers complain...

Modern c(++) requests a declaration as follows:

long __declspec(dllexport)
OutputString (

    OCIExtProcContext* context ,
    char* path,
    short path_ind,
    char* message,
    short message_ind,
    char* filemode,
    short filemode_ind ,
    int len,
    short len_ind )
{

Furthermore, if the "path_ind", the "message_ind" etcetera are #defined as literals somewhere in a header file (I can't tell from the posting), it is slightly more efficient to use "int" everywhere (instead of short).

And I don't recall by it by heart, but if you're using M$, it is common to use macro's for linker directives, instead of the "__declspec(dllexport)", but that is -of course- a matter of (bad) taste (hence the nickname "Macro Foundation Classes...").

--
Dirk Bellemans
Modify email address to reply (use .be instead of .belgium) Received on Thu Aug 12 1999 - 01:03:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US