]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
notify: use 'notify' in public header and docs
authorViktor Szakats <commit@vsz.me>
Tue, 7 Oct 2025 10:47:19 +0000 (12:47 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 7 Oct 2025 17:11:31 +0000 (19:11 +0200)
Closes #18915

docs/libcurl/opts/CURLMOPT_NOTIFYDATA.md
docs/libcurl/opts/CURLMOPT_NOTIFYFUNCTION.md
include/curl/typecheck-gcc.h

index deb4b5b95c509854f359418b3bffea625713c0de..ad57cbea14149a672b6a466bbd3f0603cce65e03 100644 (file)
@@ -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);
 }
index 4091b1ae684146d9bb68b9c37a1a6a56bfd68627..0e10aa91878723c1d25fe15c117e0c96ee756747 100644 (file)
@@ -23,12 +23,12 @@ CURLMOPT_NOTIFYFUNCTION - callback receiving notifications
 ~~~c
 #include <curl/curl.h>
 
-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);
 }
index de2cfb715a6731ffcb34754c7e69853318e7b730..063cea57e6f2730f2351d942ef35bd7d399e97b5 100644 (file)
         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();                            \
 /* 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 ||                                    \
    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