MFH header fixes
[m6w6/ext-http] / src / php_http_client_curl_user.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2014, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 #if PHP_HTTP_HAVE_CURL
14
15 PHP_HTTP_API zend_class_entry *php_http_client_curl_user_class_entry;
16 PHP_HTTP_API php_http_client_curl_ops_t *php_http_client_curl_user_ops_get();
17 PHP_MINIT_FUNCTION(http_client_curl_user);
18
19 #endif
20
21 #if 0
22 <?php
23
24 interface http\Client\Curl\User
25 {
26 const POLL_NONE = 0;
27 const POLL_IN = 1;
28 const POLL_OUT = 2;
29 const POLL_INOUT = 3;
30 const POLL_REMOVE = 4;
31
32 /**
33 * Initialize the loop
34 *
35 * The callback should be run when:
36 * - timeout occurs
37 * - a watched socket needs action
38 *
39 * @param callable $run callback as function(http\Client $client, resource $socket = null, int $action = http\Client\Curl\User::POLL_NONE)
40 */
41 function init(callable $run);
42
43 /**
44 * Register a timeout watcher
45 * @param int $timeout_ms desired timeout with milliseconds resolution
46 */
47 function timer(int $timeout_ms);
48
49 /**
50 * (Un-)Register a socket watcher
51 * @param resource $socket the fd to watch
52 * @param int $poll http\Client\Curl\Loop::POLL_* constant
53 */
54 function socket($socket, int $poll);
55
56 /**
57 * Run the loop as long as it does not block
58 *
59 * Called by http\Client::once()
60 */
61 function once();
62
63 /**
64 * Wait/poll/select (block the loop) until events fire
65 *
66 * Called by http\Client::wait()
67 *
68 * @param int $timeout_ms block for maximal $timeout_ms milliseconds
69 */
70 function wait(int $timeout_ms = null);
71
72 /**
73 * Run the loop
74 *
75 * Called by http\Client::send() while there are unfinished requests and
76 * no exception has occurred
77 */
78 function send();
79 }
80 #endif
81
82 /*
83 * Local variables:
84 * tab-width: 4
85 * c-basic-offset: 4
86 * End:
87 * vim600: noet sw=4 ts=4 fdm=marker
88 * vim<600: noet sw=4 ts=4
89 */