From: Viktor Szakats Date: Tue, 7 Oct 2025 10:47:19 +0000 (+0200) Subject: notify: use 'notify' in public header and docs X-Git-Tag: rc-8_17_0-1~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9f52458e7d14a7185b39a8d1046e4935caeb0a54;p=thirdparty%2Fcurl.git notify: use 'notify' in public header and docs Closes #18915 --- diff --git a/docs/libcurl/opts/CURLMOPT_NOTIFYDATA.md b/docs/libcurl/opts/CURLMOPT_NOTIFYDATA.md index deb4b5b95c..ad57cbea14 100644 --- a/docs/libcurl/opts/CURLMOPT_NOTIFYDATA.md +++ b/docs/libcurl/opts/CURLMOPT_NOTIFYDATA.md @@ -46,10 +46,10 @@ struct priv { void *ours; }; -static void ntfy_cb(CURLM *multi, unsigned int notification, - CURL *easy, void *ntfyp) +static void notify_cb(CURLM *multi, unsigned int notification, + CURL *easy, void *notifyp) { - struct priv *p = ntfyp; + struct priv *p = notifyp; printf("my ptr: %p\n", p->ours); /* ... */ } @@ -59,7 +59,7 @@ int main(void) struct priv setup; CURLM *multi = curl_multi_init(); /* ... use socket callback and custom pointer */ - curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, ntfy_cb); + curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, notify_cb); curl_multi_setopt(multi, CURLMOPT_NOTIFYDATA, &setup); curl_multi_notify_enable(multi, CURLMNOTIFY_INFO_READ); } diff --git a/docs/libcurl/opts/CURLMOPT_NOTIFYFUNCTION.md b/docs/libcurl/opts/CURLMOPT_NOTIFYFUNCTION.md index 4091b1ae68..0e10aa9187 100644 --- a/docs/libcurl/opts/CURLMOPT_NOTIFYFUNCTION.md +++ b/docs/libcurl/opts/CURLMOPT_NOTIFYFUNCTION.md @@ -23,12 +23,12 @@ CURLMOPT_NOTIFYFUNCTION - callback receiving notifications ~~~c #include -void ntfy_callback(CURLM *multi, /* multi handle */ - unsigned int notification, /* notification type */ - CURL *easy, /* easy handle */ - void *ntfyp); /* private ntfy pointer */ +void notify_callback(CURLM *multi, /* multi handle */ + unsigned int notification, /* notification type */ + CURL *easy, /* easy handle */ + void *notifyp); /* private notify pointer */ -CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_NOTIFYFUNCTION, ntfy_callback); +CURLMcode curl_multi_setopt(CURLM *handle, CURLMOPT_NOTIFYFUNCTION, notify_callback); ~~~ # DESCRIPTION @@ -89,7 +89,7 @@ an internal handle when DoH or other features are used. *easy* identifies the transfer involved. This may be one of the application's own easy handle or an internal handle. -**ntfyp** is set with CURLMOPT_NOTIFYDATA(3). +**notifyp** is set with CURLMOPT_NOTIFYDATA(3). # DEFAULT @@ -104,10 +104,10 @@ struct priv { void *ours; }; -static void ntfy_cb(CURLM *multi, unsigned int notification, - CURL *easy, void *ntfyp) +static void notify_cb(CURLM *multi, unsigned int notification, + CURL *easy, void *notifyp) { - struct priv *p = ntfyp; + struct priv *p = notifyp; printf("my ptr: %p\n", p->ours); /* ... */ } @@ -117,7 +117,7 @@ int main(void) struct priv setup; CURLM *multi = curl_multi_init(); /* ... use socket callback and custom pointer */ - curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, ntfy_cb); + curl_multi_setopt(multi, CURLMOPT_NOTIFYFUNCTION, notify_cb); curl_multi_setopt(multi, CURLMOPT_NOTIFYDATA, &setup); curl_multi_notify_enable(multi, CURLMNOTIFY_INFO_READ); } diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h index de2cfb715a..063cea57e6 100644 --- a/include/curl/typecheck-gcc.h +++ b/include/curl/typecheck-gcc.h @@ -208,9 +208,9 @@ if(curlcheck_charpp_option(option)) \ if(!curlcheck_ptrptr(value, char)) \ Wcurl_multi_setopt_err_charpp(); \ - if((option) == CURLMOPT_NOTIFYFUNCTION) \ - if(!curlcheck_multintfy_cb(value)) \ - Wcurl_multi_setopt_err_ntfycb(); \ + if((option) == CURLMOPT_NOTIFYFUNCTION) \ + if(!curlcheck_multinotify_cb(value)) \ + Wcurl_multi_setopt_err_notifycb(); \ if((option) == CURLMOPT_PUSHFUNCTION) \ if(!curlcheck_multipush_cb(value)) \ Wcurl_multi_setopt_err_pushcb(); \ @@ -227,7 +227,7 @@ /* evaluates to true if the option takes a data argument to pass to a callback */ #define curlcheck_multicb_data_option(option) \ - ((option) == CURLMOPT_NOTIFYDATA || \ + ((option) == CURLMOPT_NOTIFYDATA || \ (option) == CURLMOPT_PUSHDATA || \ (option) == CURLMOPT_SOCKETDATA || \ (option) == CURLMOPT_TIMERDATA || \ @@ -250,13 +250,13 @@ curlcheck_cb_compatible((expr), curl_socket_callback)) /* evaluates to true if expr is of type curl_push_callback */ -#define curlcheck_multipush_cb(expr) \ - (curlcheck_NULL(expr) || \ +#define curlcheck_multipush_cb(expr) \ + (curlcheck_NULL(expr) || \ curlcheck_cb_compatible((expr), curl_push_callback)) /* evaluates to true if expr is of type curl_push_callback */ -#define curlcheck_multintfy_cb(expr) \ - (curlcheck_NULL(expr) || \ +#define curlcheck_multinotify_cb(expr) \ + (curlcheck_NULL(expr) || \ curlcheck_cb_compatible((expr), curl_notify_callback)) /* @@ -284,7 +284,7 @@ CURLWARNING(Wcurl_multi_setopt_err_charpp, "curl_multi_setopt expects a 'char **' argument") CURLWARNING(Wcurl_multi_setopt_err_pushcb, "curl_multi_setopt expects a curl_push_callback argument") -CURLWARNING(Wcurl_multi_setopt_err_ntfycb, +CURLWARNING(Wcurl_multi_setopt_err_notifycb, "curl_multi_setopt expects a curl_notify_callback argument") CURLWARNING(Wcurl_multi_setopt_err_socketcb, "curl_multi_setopt expects a curl_socket_callback argument") @@ -392,16 +392,16 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, /* groups of curl_easy_setops options that take the same type of argument */ /* evaluates to true if option takes a long argument */ -#define curlcheck_long_option(option) \ +#define curlcheck_long_option(option) \ (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) #define curlcheck_off_t_option(option) \ (((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB)) /* option takes a CURL * argument */ -#define curlcheck_curl_option(option) \ - ((option) == CURLOPT_STREAM_DEPENDS || \ - (option) == CURLOPT_STREAM_DEPENDS_E || \ +#define curlcheck_curl_option(option) \ + ((option) == CURLOPT_STREAM_DEPENDS || \ + (option) == CURLOPT_STREAM_DEPENDS_E || \ 0) /* evaluates to true if option takes a char* argument */ @@ -684,7 +684,7 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, (curlcheck_ptr((expr), void) || \ curlcheck_ptr((expr), FILE)) #else /* be less strict */ -#define curlcheck_cb_data(expr) \ +#define curlcheck_cb_data(expr) \ curlcheck_any_ptr(expr) #endif