? config.h.in ? wez.versinfo.diff.txt ? lib/ca-bundle.h ? lib/stamp-h4 ? tests/log Index: include/curl/curl.h =================================================================== RCS file: /cvsroot/curl/curl/include/curl/curl.h,v retrieving revision 1.166 diff -u -r1.166 curl.h --- include/curl/curl.h 23 Sep 2002 13:27:12 -0000 1.166 +++ include/curl/curl.h 23 Sep 2002 15:02:56 -0000 @@ -909,6 +909,27 @@ CURLcode curl_share_set_lock_data (curl_share *, void *); CURLcode curl_share_destroy (curl_share *); +/**************************************************************************** + * Structures for querying information about the curl library at runtime. + */ + +/* 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; + +typedef struct { + const char *version; /* LIBCURL_VERSION */ + unsigned int version_num; /* LIBCURL_VERSION_NUM */ + /* protocols is terminated by an entry with a NULL protoname */ + curl_runtime_protocol_info *protocols; +} curl_version_info_data; + +/* returns a pointer to a static copy of the version info struct */ +const curl_version_info_data *curl_version_info(void); + #ifdef __cplusplus } #endif Index: lib/url.c =================================================================== RCS file: /cvsroot/curl/curl/lib/url.c,v retrieving revision 1.230 diff -u -r1.230 url.c --- lib/url.c 11 Sep 2002 10:32:37 -0000 1.230 +++ lib/url.c 23 Sep 2002 15:03:00 -0000 @@ -1832,6 +1832,9 @@ * is based on the first letters of the server name. */ + /* Note: if you add a new protocol, please update the list in + * lib/version.c too! */ + if(strnequal(conn->gname, "FTP", 3)) { strcpy(conn->protostr, "ftp"); } Index: lib/version.c =================================================================== RCS file: /cvsroot/curl/curl/lib/version.c,v retrieving revision 1.18 diff -u -r1.18 version.c --- lib/version.c 3 Sep 2002 11:53:01 -0000 1.18 +++ lib/version.c 23 Sep 2002 15:03:00 -0000 @@ -105,6 +105,33 @@ return version; } +/* data for curl_version_info */ + +static const curl_runtime_protocol_info protocols[] = { + { "ftp" }, + { "gopher" }, + { "telnet" }, + { "dict" }, + { "ldap" }, + { "http" }, +#ifdef USE_SSLEAY + { "https" }, + { "ftps" }, +#endif + { NULL } +}; + +static const curl_version_info_data version_info = { + LIBCURL_VERSION, + LIBCURL_VERSION_NUM, + &protocols +}; + +const curl_version_info_data *curl_version_info(void) +{ + return &version_info; +} + /* * local variables: * eval: (load-file "../curl-mode.el")