• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/samba-3.5.8/lib/tevent/

Lines Matching refs:req

32  * @param[in] req	The request to be printed
34 * @retval Text representation of req
41 char *tevent_req_default_print(struct tevent_req *req, TALLOC_CTX *mem_ctx)
46 req, req->internal.create_location,
47 req->internal.state,
48 (unsigned long long)req->internal.error,
49 (unsigned long long)req->internal.error,
50 talloc_get_name(req->data),
51 req->data,
52 req->internal.timer
59 * @param[in] req The request to be printed
60 * @retval Text representation of req
65 char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req)
67 if (!req->private_print) {
68 return tevent_req_default_print(req, mem_ctx);
71 return req->private_print(req, mem_ctx);
89 struct tevent_req *req;
93 req = talloc_zero(mem_ctx, struct tevent_req);
94 if (req == NULL) {
97 req->internal.private_type = type;
98 req->internal.create_location = location;
99 req->internal.finish_location = NULL;
100 req->internal.state = TEVENT_REQ_IN_PROGRESS;
101 req->internal.trigger = tevent_create_immediate(req);
102 if (!req->internal.trigger) {
103 talloc_free(req);
107 data = talloc_zero_size(req, data_size);
109 talloc_free(req);
114 req->data = data;
117 return req;
120 void _tevent_req_notify_callback(struct tevent_req *req, const char *location)
122 req->internal.finish_location = location;
123 if (req->async.fn != NULL) {
124 req->async.fn(req);
128 static void tevent_req_finish(struct tevent_req *req,
132 req->internal.state = state;
133 _tevent_req_notify_callback(req, location);
138 * @param[in] req The finished request
145 void _tevent_req_done(struct tevent_req *req,
148 tevent_req_finish(req, TEVENT_REQ_DONE, location);
153 * @param[in] req The request with an error
165 * if (tevent_req_error(req, error)) {
170 * if (tevent_req_error(req, error)) {
174 * tevent_req_done(req);
179 bool _tevent_req_error(struct tevent_req *req,
187 req->internal.error = error;
188 tevent_req_finish(req, TEVENT_REQ_USER_ERROR, location);
195 * @param[in] req The request being processed
203 * if (tevent_req_nomem(p, req)) {
210 struct tevent_req *req,
216 tevent_req_finish(req, TEVENT_REQ_NO_MEMORY, location);
230 struct tevent_req *req = talloc_get_type(private_data,
233 tevent_req_finish(req, req->internal.state,
234 req->internal.finish_location);
239 * @param[in] req The finished request
241 * @retval req will be returned
251 struct tevent_req *tevent_req_post(struct tevent_req *req,
254 tevent_schedule_immediate(req->internal.trigger,
255 ev, tevent_req_trigger, req);
256 return req;
261 * @param[in] req The request to poll
269 bool tevent_req_is_in_progress(struct tevent_req *req)
271 if (req->internal.state == TEVENT_REQ_IN_PROGRESS) {
280 * @param[in] req The finished request
285 void tevent_req_received(struct tevent_req *req)
287 TALLOC_FREE(req->data);
288 req->private_print = NULL;
290 TALLOC_FREE(req->internal.trigger);
291 TALLOC_FREE(req->internal.timer);
293 req->internal.state = TEVENT_REQ_RECEIVED;
298 * @param[in] req The request to poll
313 bool tevent_req_poll(struct tevent_req *req,
316 while (tevent_req_is_in_progress(req)) {
328 bool tevent_req_is_error(struct tevent_req *req, enum tevent_req_state *state,
331 if (req->internal.state == TEVENT_REQ_DONE) {
334 if (req->internal.state == TEVENT_REQ_USER_ERROR) {
335 *error = req->internal.error;
337 *state = req->internal.state;
346 struct tevent_req *req = talloc_get_type(private_data,
349 TALLOC_FREE(req->internal.timer);
351 tevent_req_finish(req, TEVENT_REQ_TIMED_OUT, __FUNCTION__);
354 bool tevent_req_set_endtime(struct tevent_req *req,
358 TALLOC_FREE(req->internal.timer);
360 req->internal.timer = tevent_add_timer(ev, req, endtime,
362 req);
363 if (tevent_req_nomem(req->internal.timer, req)) {
370 void tevent_req_set_callback(struct tevent_req *req, tevent_req_fn fn, void *pvt)
372 req->async.fn = fn;
373 req->async.private_data = pvt;
376 void *_tevent_req_callback_data(struct tevent_req *req)
378 return req->async.private_data;
381 void *_tevent_req_data(struct tevent_req *req)
383 return req->data;
388 * @param[in] req The given request
397 void tevent_req_set_print_fn(struct tevent_req *req, tevent_req_print_fn fn)
399 req->private_print = fn;
404 * @param[in] req The given request
412 void tevent_req_set_cancel_fn(struct tevent_req *req, tevent_req_cancel_fn fn)
414 req->private_cancel = fn;
419 * @param[in] req The given request
436 bool _tevent_req_cancel(struct tevent_req *req, const char *location)
438 if (req->private_cancel == NULL) {
442 return req->private_cancel(req);