Subject Re: [IBDI] Writing UDFs for InterBase
Author Olivier Mascia
> Here's the link: http://www.interbase2000.org/doc_deatz_udf.htm
> Enjoy!

Well, that's a good introduction chapter for people who have never written a
Windows DLL or a Unix shared-library and who wonders what kind of beast a
UDF might be. It introduces the subject. Pretty much like the famous old
"Hello World" program ubiquitous in every introductory C/C++ programming
course.

So that's indeed a good, funny, pleasant start. Thanks to Greg.

Now, regarding the specification of any details to take into account, the
Chapter 6 of the current Developer's Guide is far better. Indeed for someone
who already know the pitfalls of DLLs/shared-libraries writing (argument
passing conventions, name mangling issues, multi-threading considerations,
dynamic memory allocation / de-allocation, shared/statically linked standard
libraries issues and so on), then that Chapter 6 is a concentrate of usefull
information. It also covers some of those pitfalls, but maybe does not put
enough emphasis on these.

To my personal liking, it miss three things :

1) An introductory paragraph as
http://www.interbase2000.org/doc_deatz_udf.htm to clear worries from some
newcomers.

2) A warning paragraph to get people's feet back on earth : 'that's not so
easy to do it correctly, pay attention to the following technical pitfalls',
followed by a in-depth discussion of those allocation, threading, and so on
issues. What's in chapter 6 is ok, but maybe 'too packed' for some
newcomers. I understand those issues are more sensible for C/C++ guys like
me than Delphi programmers.

3) A nice correspondence table of C types (ibase.h types) and the SQL types.
So that if you want to write a UDF which takes a IB6 Dialect 3 DATE as input
you know you will receive it through a ISC_DATE* type.

Up until now, I solved all questions I could have with that chapter 6 and
some experiments.
But for a newcomer here are the kinds of questions hard to answer :

"In IB 6 Dialect 1, you want to call a UDF taking a DATE as input : what C
type will you be passed in ?"

"How about that same UDF being called from a Dialect 3 connection ? Will you
still get what you expected as input ?"

-------------------------- www.tipgroup.com -------------------------
Olivier Mascia T.I.P. Group S.A.
om@... Company Phone +32 65401111
Director, Senior Software Engineer Private Mailbox/FAX +32 22564213