2424 *
2525 ***************************************************************************/
2626/*
27- This is an "external" header file. Don't give away any internals here!
27+ This is an "external" header file. Do not give away any internals here!
2828
2929 GOALS
3030
@@ -66,7 +66,7 @@ typedef enum {
6666 CURLM_OK ,
6767 CURLM_BAD_HANDLE , /* the passed-in handle is not a valid CURLM handle */
6868 CURLM_BAD_EASY_HANDLE , /* an easy handle was not good/valid */
69- CURLM_OUT_OF_MEMORY , /* if you ever get this, you're in deep sh*t */
69+ CURLM_OUT_OF_MEMORY , /* if you ever get this, you are in deep sh*t */
7070 CURLM_INTERNAL_ERROR , /* this is a libcurl bug */
7171 CURLM_BAD_SOCKET , /* the passed in socket argument did not match */
7272 CURLM_UNKNOWN_OPTION , /* curl_multi_setopt() with unsupported option */
@@ -109,7 +109,7 @@ struct CURLMsg {
109109typedef struct CURLMsg CURLMsg ;
110110
111111/* Based on poll(2) structure and values.
112- * We don't use pollfd and POLL* constants explicitly
112+ * We do not use pollfd and POLL* constants explicitly
113113 * to cover platforms without poll(). */
114114#define CURL_WAIT_POLLIN 0x0001
115115#define CURL_WAIT_POLLPRI 0x0002
@@ -118,7 +118,7 @@ typedef struct CURLMsg CURLMsg;
118118struct curl_waitfd {
119119 curl_socket_t fd ;
120120 short events ;
121- short revents ; /* not supported yet */
121+ short revents ;
122122};
123123
124124/*
@@ -205,7 +205,7 @@ CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
205205 /*
206206 * Name: curl_multi_perform()
207207 *
208- * Desc: When the app thinks there's data available for curl it calls this
208+ * Desc: When the app thinks there is data available for curl it calls this
209209 * function to read/write whatever there is right now. This returns
210210 * as soon as the reads and writes are done. This function does not
211211 * require that there actually is data available for reading or that
@@ -236,7 +236,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
236236/*
237237 * Name: curl_multi_info_read()
238238 *
239- * Desc: Ask the multi handle if there's any messages/informationals from
239+ * Desc: Ask the multi handle if there is any messages/informationals from
240240 * the individual transfers. Messages include informationals such as
241241 * error code from the transfer or just the fact that a transfer is
242242 * completed. More details on these should be written down as well.
@@ -253,7 +253,7 @@ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
253253 * we will provide the particular "transfer handle" in that struct
254254 * and that should/could/would be used in subsequent
255255 * curl_easy_getinfo() calls (or similar). The point being that we
256- * must never expose complex structs to applications, as then we'll
256+ * must never expose complex structs to applications, as then we will
257257 * undoubtably get backwards compatibility problems in the future.
258258 *
259259 * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
@@ -268,7 +268,7 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
268268 * Name: curl_multi_strerror()
269269 *
270270 * Desc: The curl_multi_strerror function may be used to turn a CURLMcode
271- * value into the equivalent human readable error string. This is
271+ * value into the equivalent human readable error string. This is
272272 * useful for printing meaningful error messages.
273273 *
274274 * Returns: A pointer to a null-terminated error message.
@@ -282,7 +282,7 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
282282 * Desc: An alternative version of curl_multi_perform() that allows the
283283 * application to pass in one of the file descriptors that have been
284284 * detected to have "action" on them and let libcurl perform.
285- * See man page for details.
285+ * See manpage for details.
286286 */
287287#define CURL_POLL_NONE 0
288288#define CURL_POLL_IN 1
@@ -426,6 +426,17 @@ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
426426CURL_EXTERN CURLMcode curl_multi_assign (CURLM * multi_handle ,
427427 curl_socket_t sockfd , void * sockp );
428428
429+ /*
430+ * Name: curl_multi_get_handles()
431+ *
432+ * Desc: Returns an allocated array holding all handles currently added to
433+ * the multi handle. Marks the final entry with a NULL pointer. If
434+ * there is no easy handle added to the multi handle, this function
435+ * returns an array with the first entry as a NULL pointer.
436+ *
437+ * Returns: NULL on failure, otherwise a CURL **array pointer
438+ */
439+ CURL_EXTERN CURL * * curl_multi_get_handles (CURLM * multi_handle );
429440
430441/*
431442 * Name: curl_push_callback
@@ -453,6 +464,20 @@ typedef int (*curl_push_callback)(CURL *parent,
453464 struct curl_pushheaders * headers ,
454465 void * userp );
455466
467+ /*
468+ * Name: curl_multi_waitfds()
469+ *
470+ * Desc: Ask curl for fds for polling. The app can use these to poll on.
471+ * We want curl_multi_perform() called as soon as one of them are
472+ * ready. Passing zero size allows to get just a number of fds.
473+ *
474+ * Returns: CURLMcode type, general multi error code.
475+ */
476+ CURL_EXTERN CURLMcode curl_multi_waitfds (CURLM * multi ,
477+ struct curl_waitfd * ufds ,
478+ unsigned int size ,
479+ unsigned int * fd_count );
480+
456481#ifdef __cplusplus
457482} /* end of extern "C" */
458483#endif
0 commit comments