[gdal-dev] Re: Convenience Functions

Frank Warmerdam warmerda at h...
Wed Dec 2 15:27:52 EST 1998


Daniel Morissette wrote:
> In the meantime, I attached my current cpl.h header and the strlist.c
> source so that you can have a first look... as you'll see, the only
> convenience stuff I have for now is error handling and stringlist
> manipulation, a Tokenize() function (that does not honour "" yet), etc.
> 
> What did we decide about error handling? We should probably make a
> decision about that today. One possibility would be to add an error
> class (LOG, WARNING, FATAL, etc.) to my current implementation... did
> you already have something I could use for error handling?

Daniel,

I don't know that we have really decided on an error handling approach. 
I think we agree on adding an error class (none, log, warning, failure 
and fatal) come to mind. As for error identifiers, there is still the
string vs. number issue.

If we went with numbers, how would we maintain an error number registry?

Ah, heck, lets go with numbers so we can get on with stuff that matters.

BTW, the difference between error classes of failure, and fatal is that
failure indicates something failed, but that the error function won't 
interrupt control (for instance an open failure), while fatal indicates
that the error reporting mechanism will interrupt processing. The
error function will never return. It may exit(), or abort(), or do a
longjmp(), but the caller need not worry. This is useful for the
safe memory allocator for instance.

> Should we give a common prefix to all the stringlist function names,
> like SL or something else?

I had been prefixing everything I considered a convenience function with
CPL, including a new ``safe malloc'' API and an re-implementation of
DKReadLine(). I supposed for any subgroups we want to be able to 
carve off, having a prefix to group them would be a good idea. SL for
all functions related to string lists sounds good to me. 

Later,

-----------------------------------+---------------------------------------
Who can give them back their lives | Frank Warmerdam, Software Developer
and all those wasted years? - Rush | URL http://members.home.com/warmerda
| warmerda at h...
------------------------------------------------------------------------
Free Web-based e-mail groups -- http://www.eGroups.com





More information about the Gdal-dev mailing list