Xref: alice comp.databases.oracle.misc:38544 comp.databases.oracle.server:61751 comp.databases.oracle.tools:30221
Path: alice!news-feed.fnsi.net!newsfeed.icl.net!newsfeed.nacamar.de!bignews.mediaways.net!skynet.be!poster!not-for-mail
From: "Dirk Bellemans" <Dirk.Bellemans@skynet.belgium>
Newsgroups: comp.databases.oracle.misc,comp.databases.oracle.server,comp.databases.oracle.tools
Subject: Re: Looking for examples that call C functions from PL/SQL!
Date: Fri, 13 Aug 1999 06:32:20 +0200
Organization: Belgacom Skynet SA/NV
Lines: 50
Message-ID: <7p3agb$ukp$1@news1.skynet.be>
References: <37975E87.2071707E@yahoo.com> <7n7vgj$538$1@inet16.us.oracle.com> <7otq82$2g7$1@news0.skynet.be> <37b5ab1f.59156993@newshost.us.oracle.com>
X-Trace: news1.skynet.be 934620491 31385 194.78.224.248 (14 Aug 1999 08:48:11 GMT)
X-Complaints-To: abuse@skynet.be
NNTP-Posting-Date: 14 Aug 1999 08:48:11 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

Thomas Kyte wrote in message <37b5ab1f.59156993@newshost.us.oracle.com>...
>A copy of this was sent to "Dirk Bellemans" <Dirk.Bellemans@skynet.belgium>
>(if that email address didn't require changing)

It does, but the change is straightforward. I have to pay for my own
connection time....

>many compliers on the other hand (if portability is important) will not
process
>the next one...  (i myself prefer the type checking I get with the
following
>prototype)...
>
>>Modern c(++) requests a declaration as follows:
>>
>>long __declspec(dllexport)
>>OutputString (
>>    OCIExtProcContext* context ,
>>    char* path,
>>    short  path_ind,
>>    char* message,


Well, like I wrote *modern* c(++) requests the declaration I gave. I you use
an old compiler, you can't use recent constructs, can you? Actually, you
could even use c++ IF you provide a c wrapper function. Makes programming
much easier than with straight c.

>In the case of in/out variables, path_ind would be a short *.  It is
recommended
>that you always just use short -- not int.  Its a short we pass around and
while
>it might get promoted to int on the stack, since we frequently pass
pointers to
>it -- you should just keep it short.


Thank you for the explanation. I was only pointing out that "short" is an
datatype that is rarely used in modern c(++). We can't, of course, expect
library writers to modify their interfaces with every fashion change ;-) My
opinion still stands for local variables: int (and for non-ints: double) are
by far the preferred data types. I'd use int everywhere but the interface,
but I'm a purist...

--
Dirk Bellemans
Modify email address to reply (use .be instead of .belgium)



