cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_version_info() take 2

From: Bjorn Reese <breese_at_mail1.stofanet.dk>
Date: Thu, 26 Sep 2002 16:56:07 +0000

Daniel Stenberg wrote:

> > /* declared as a struct to allow future expansion while remaining backwards
> > * and binary compatible; any new fields in these two structs must be added
> > * after the existing fields */
> > typedef struct {
> > const char *protoname;
> > } curl_runtime_protocol_info;
>
> It struck me that this attempt to be "binary compatible" doesn't work, as the
> returned data is an array that we can't change the size of individual entries
> in without breaking the ABI.

How about something like this

  enum curl_version {
    CURL_VERSION, /* both version and version_num */
    CURL_VERSION_FEATURES,
    CURL_VERSION_SSL, /* both ssl_version and ssl_version_num */
    /* etc. */
  };

  uintmax_t curl_version(enum curl_version);
  const char *curl_version_name(enum curl_version);

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-09-26