headers: name the arguments the way the definitions name them

Eleven arguments are named one way in the header and another in the
definition. the compiler only checks types so nothing is broken, but the
header is what people read first, and then the name changes under them
in the source:

```
curl_dbg_malloc          size     ->  wantedsize
curl_dbg_calloc          n, size  ->  wanted_elements, wanted_size
curl_dbg_realloc         size     ->  wantedsize
curl_dbg_strdup          src      ->  source
r_freeaddrinfo           res      ->  cahead
my_get_line              fp, db   ->  input, buf
curl_slist_append_ccsid  l        ->  list
curl_version_info_ccsid  cid      ->  ccsid
curl_easy_setopt_ccsid   curl     ->  easy
```

Follow-up to df6014894b #20794

Closes #22550
This commit is contained in:
Anton Karpov 2026-08-10 00:48:09 +03:00 committed by Viktor Szakats
parent 406edd036a
commit 05ddf5511a
No known key found for this signature in database
5 changed files with 19 additions and 16 deletions

View file

@ -1018,7 +1018,7 @@ int curl_formget_ccsid(struct curl_httppost *form, void *arg,
return curl_formget(form, (void *)&lcfc, Curl_formget_callback_ccsid);
}
CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
CURLcode curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...)
{
CURLcode result;
va_list arg;
@ -1026,7 +1026,7 @@ CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
char *cp = NULL;
unsigned int ccsid;
curl_off_t pfsize;
struct Curl_easy *data = easy;
struct Curl_easy *data = curl;
va_start(arg, tag);
@ -1143,7 +1143,7 @@ CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
}
}
result = curl_easy_setopt(easy, tag, s);
result = curl_easy_setopt(curl, tag, s);
free(s);
break;
@ -1157,7 +1157,7 @@ CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
pfsize = data->set.postfieldsize;
if(!s || !pfsize || ccsid == NOCONV_CCSID || ccsid == ASCII_CCSID) {
result = curl_easy_setopt(easy, CURLOPT_COPYPOSTFIELDS, s);
result = curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, s);
break;
}
@ -1204,7 +1204,7 @@ CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
cp = NULL;
}
result = curl_easy_setopt(easy, CURLOPT_POSTFIELDS, s);
result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, s);
data->set.str[STRING_COPYPOSTFIELDS] = s; /* Give to library. */
break;
@ -1241,12 +1241,12 @@ CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
blob.flags = bp->flags | CURL_BLOB_COPY;
bp = &blob;
}
result = curl_easy_setopt(easy, tag, bp);
result = curl_easy_setopt(curl, tag, bp);
break;
}
FALLTHROUGH();
case CURLOPT_ERRORBUFFER: /* This is an output buffer. */
result = Curl_vsetopt(easy, tag, arg);
result = Curl_vsetopt(curl, tag, arg);
break;
}

View file

@ -37,13 +37,14 @@ CURL_EXTERN char *curl_easy_unescape_ccsid(CURL *handle, const char *string,
int length, int *outlength,
unsigned int sccsid,
unsigned int dccsid);
CURL_EXTERN struct curl_slist *curl_slist_append_ccsid(struct curl_slist *l,
CURL_EXTERN struct curl_slist *curl_slist_append_ccsid(struct curl_slist *list,
const char *data,
unsigned int ccsid);
CURL_EXTERN time_t curl_getdate_ccsid(const char *p, const time_t *unused,
unsigned int ccsid);
CURL_EXTERN curl_version_info_data *curl_version_info_ccsid(CURLversion stamp,
unsigned int cid);
CURL_EXTERN curl_version_info_data *curl_version_info_ccsid(
CURLversion stamp,
unsigned int ccsid);
CURL_EXTERN const char *curl_easy_strerror_ccsid(CURLcode error,
unsigned int ccsid);
CURL_EXTERN const char *curl_share_strerror_ccsid(CURLSHcode error,