1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #include "curl_setup.h"
- #include "strcase.h"
- #include "easyoptions.h"
- #ifndef CURL_DISABLE_GETOPTIONS
- static struct curl_easyoption *lookup(const char *name, CURLoption id)
- {
- DEBUGASSERT(name || id);
- DEBUGASSERT(!Curl_easyopts_check());
- if(name || id) {
- struct curl_easyoption *o = &Curl_easyopts[0];
- do {
- if(name) {
- if(strcasecompare(o->name, name))
- return o;
- }
- else {
- if((o->id == id) && !(o->flags & CURLOT_FLAG_ALIAS))
-
- return o;
- }
- o++;
- } while(o->name);
- }
- return NULL;
- }
- const struct curl_easyoption *curl_easy_option_by_name(const char *name)
- {
-
- return lookup(name, CURLOPT_LASTENTRY);
- }
- const struct curl_easyoption *curl_easy_option_by_id(CURLoption id)
- {
- return lookup(NULL, id);
- }
- const struct curl_easyoption *
- curl_easy_option_next(const struct curl_easyoption *prev)
- {
- if(prev && prev->name) {
- prev++;
- if(prev->name)
- return prev;
- }
- else if(!prev)
- return &Curl_easyopts[0];
- return NULL;
- }
- #else
- const struct curl_easyoption *curl_easy_option_by_name(const char *name)
- {
- (void)name;
- return NULL;
- }
- const struct curl_easyoption *curl_easy_option_by_id (CURLoption id)
- {
- (void)id;
- return NULL;
- }
- const struct curl_easyoption *
- curl_easy_option_next(const struct curl_easyoption *prev)
- {
- (void)prev;
- return NULL;
- }
- #endif
|