cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_setopt() typechecker, try2

From: Michal Marek <mmarek_at_suse.cz>
Date: Wed, 05 Mar 2008 13:11:34 +0100

Dan Fandrich wrote:
> A couple of stylistic suggestions: ANSI reserves all identifiers beginning
> with an underscore, so things like
>
> #define _curl_long_option(option)
>
> should really have the leading underscore removed.

That's true. The problem is what to use instead. Anything that doesn't
start with "curl" can potentially conflict with users' code. Plain
"curl_" is used by the API and I want to express somehow that these
macros are "internal" to the header file.

curl_typechek_? curl_typeck_?, curl_i_ (i for internal)? Other ideas?

> Also, some macros are
> called curl_is_xxx but others (like the above) aren't. I like the _is_
> versions better because of the analogy to the standard C macros like
> isupper() and isxdigit() and make it more clear what they're accomplishing.

So you propose

<prefix>_is_long_option(opt): opt is an option that takes a long arg
<prefix>_is_long(val): val is of type long

? That sound like a good idea.

Michal
Received on 2008-03-05