mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
lib: make Curl_easyopts const
Also, make the optiontable rule work in an out-of-tree build. Closes #16950
This commit is contained in:
parent
9f4f61ddcb
commit
9ba597bed7
@ -185,7 +185,7 @@ tidy:
|
||||
$(TIDY) $$_csources $(TIDYFLAGS) $(CURL_CLANG_TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H)
|
||||
|
||||
optiontable:
|
||||
perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
|
||||
@PERL@ $(srcdir)/optiontable.pl < $(top_srcdir)/include/curl/curl.h > $(srcdir)/easyoptions.c
|
||||
|
||||
if HAVE_WINDRES
|
||||
.rc.lo:
|
||||
|
||||
@ -29,12 +29,12 @@
|
||||
#ifndef CURL_DISABLE_GETOPTIONS
|
||||
|
||||
/* Lookups easy options at runtime */
|
||||
static struct curl_easyoption *lookup(const char *name, CURLoption id)
|
||||
static const 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];
|
||||
const struct curl_easyoption *o = &Curl_easyopts[0];
|
||||
do {
|
||||
if(name) {
|
||||
if(strcasecompare(o->name, name))
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include "easyoptions.h"
|
||||
|
||||
/* all easy setopt options listed in alphabetical order */
|
||||
struct curl_easyoption Curl_easyopts[] = {
|
||||
const struct curl_easyoption Curl_easyopts[] = {
|
||||
{"ABSTRACT_UNIX_SOCKET", CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOT_STRING, 0},
|
||||
{"ACCEPTTIMEOUT_MS", CURLOPT_ACCEPTTIMEOUT_MS, CURLOT_LONG, 0},
|
||||
{"ACCEPT_ENCODING", CURLOPT_ACCEPT_ENCODING, CURLOT_STRING, 0},
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#include <curl/curl.h>
|
||||
|
||||
/* generated table with all easy options */
|
||||
extern struct curl_easyoption Curl_easyopts[];
|
||||
extern const struct curl_easyoption Curl_easyopts[];
|
||||
|
||||
#ifdef DEBUGBUILD
|
||||
int Curl_easyopts_check(void);
|
||||
|
||||
@ -31,7 +31,7 @@ print <<HEAD
|
||||
#include "easyoptions.h"
|
||||
|
||||
/* all easy setopt options listed in alphabetical order */
|
||||
struct curl_easyoption Curl_easyopts[] = {
|
||||
const struct curl_easyoption Curl_easyopts[] = {
|
||||
HEAD
|
||||
;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user