pecl-ev / pe.c

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
/*
   +----------------------------------------------------------------------+
   | PHP Version 5                                                        |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997-2012 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 3.01 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.php.net/license/3_01.txt                                  |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
   | Author: Ruslan Osmanov <osmanov@php.net>                             |
   +----------------------------------------------------------------------+
*/

#include "php_ev.h"
#include "watcher.h"

static inline void php_ev_prop_write_zval(zval **ppz, const zval *value)
{
	if (!*ppz) {
		MAKE_STD_ZVAL(*ppz);
	}

    /* Make a copy of the zval, avoid direct binding to the address
     * of value, since it breaks refcount in php_ev_read_property()
     * causing further leaks and memory access violations */
	REPLACE_ZVAL_VALUE(ppz, value, 1);
}

static inline void php_ev_prop_read_zval(const zval *pz, zval **retval)
{
	if (!pz) {
		ALLOC_INIT_ZVAL(*retval);
		return;
	}

    MAKE_STD_ZVAL(*retval);
    REPLACE_ZVAL_VALUE(retval, pz, 1);
}


/* {{{ EvLoop property handlers */

/* {{{ ev_loop_prop_data_read  */
static int ev_loop_prop_data_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	zval *data = PHP_EV_LOOP_OBJECT_FETCH_FROM_OBJECT(obj)->data;

	php_ev_prop_read_zval(data, retval);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_data_write  */
static int ev_loop_prop_data_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	php_ev_prop_write_zval(&(PHP_EV_LOOP_OBJECT_FETCH_FROM_OBJECT(obj))->data, value);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_backend_read */
static int ev_loop_prop_backend_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);
	
	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, ev_backend(PHP_EV_LOOP_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_is_default_loop_read */
static int ev_loop_prop_is_default_loop_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);
	
	MAKE_STD_ZVAL(*retval);
	ZVAL_BOOL(*retval, ev_is_default_loop(PHP_EV_LOOP_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_iteration_loop_read */
static int ev_loop_prop_iteration_loop_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);
	
	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, ev_iteration(PHP_EV_LOOP_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_pending_loop_read */
static int ev_loop_prop_pending_loop_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);
	
	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, ev_pending_count(PHP_EV_LOOP_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_io_interval_read */
static int ev_loop_prop_io_interval_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	php_ev_loop *loop_obj = PHP_EV_LOOP_OBJECT_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_DOUBLE(*retval, loop_obj->io_collect_interval);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_io_interval_write */
static int ev_loop_prop_io_interval_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	php_ev_loop *loop_obj;

	PHP_EV_ASSERT(obj->ptr);

	loop_obj = PHP_EV_LOOP_OBJECT_FETCH_FROM_OBJECT(obj);

	loop_obj->io_collect_interval = Z_DVAL_P(value);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_timeout_interval_read */
static int ev_loop_prop_timeout_interval_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	php_ev_loop *loop_obj = PHP_EV_LOOP_OBJECT_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_DOUBLE(*retval, loop_obj->timeout_collect_interval);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_timeout_interval_write */
static int ev_loop_prop_timeout_interval_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	php_ev_loop *loop_obj;

	PHP_EV_ASSERT(obj->ptr);

	loop_obj = PHP_EV_LOOP_OBJECT_FETCH_FROM_OBJECT(obj);

	loop_obj->timeout_collect_interval = Z_DVAL_P(value);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_loop_prop_depth_read */
static int ev_loop_prop_depth_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, ev_depth(PHP_EV_LOOP_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* }}} */

/* {{{ EvWatcher property handlers */


/* {{{ ev_watcher_prop_is_active_read */
static int ev_watcher_prop_is_active_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);
	
	MAKE_STD_ZVAL(*retval);
	ZVAL_BOOL(*retval, ev_is_active(PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* {{{ ev_watcher_prop_data_get_ptr_ptr */
static zval **ev_watcher_prop_data_get_ptr_ptr(php_ev_object *obj TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	return &PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj)->data;
}
/* }}} */

/* {{{ ev_watcher_prop_data_read  */
static int ev_watcher_prop_data_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	zval *data = PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj)->data;

	php_ev_prop_read_zval(data, retval);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_watcher_prop_data_write */
static int ev_watcher_prop_data_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	php_ev_prop_write_zval(&(PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj))->data, value);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_watcher_prop_is_pending_read */
static int ev_watcher_prop_is_pending_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);
	
	MAKE_STD_ZVAL(*retval);
	ZVAL_BOOL(*retval, ev_is_pending(PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* {{{ ev_watcher_prop_priority_read */
static int ev_watcher_prop_priority_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);
	
	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, ev_priority(PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj)));

	return SUCCESS;
}
/* }}} */

/* {{{ ev_watcher_prop_priority_write */
static int ev_watcher_prop_priority_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	long priority;
	ev_watcher *watcher = PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	int active = ev_is_active(watcher);

    if (active) {
        php_error_docref(NULL TSRMLS_CC, E_WARNING,
        		"Modifying active watcher. Restarting the watcher internally.");
    }

	priority = Z_LVAL_P(value);
	if (priority < INT_MIN) {
		php_error_docref(NULL TSRMLS_CC, E_WARNING,
				"Priority value must be bigger than INT_MIN");
	    return FAILURE;
	}
	if (priority > INT_MAX) {
		php_error_docref(NULL TSRMLS_CC, E_WARNING,
				"Priority value must not exceed INT_MAX");
	    return FAILURE;
	}

	if (active) {
		php_ev_stop_watcher(watcher TSRMLS_CC);
	}

	php_ev_set_watcher_priority(watcher, priority TSRMLS_CC);

	if (active) {
		php_ev_start_watcher(watcher TSRMLS_CC);
	}

	return SUCCESS;
}
/* }}} */

/* }}} */

/* {{{ EvIo property handlers */

/* {{{ ev_io_prop_fd_read  */
static int ev_io_prop_fd_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	ev_io *io_watcher = (ev_io *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);
	php_stream *stream = php_stream_fopen_from_fd(io_watcher->fd, "r", NULL);

	if (stream) {
		MAKE_STD_ZVAL(*retval);
		php_stream_to_zval(stream, *retval);
	} else {
		ALLOC_INIT_ZVAL(*retval); // NULL
	}

	return SUCCESS;
}
/* }}} */

/* {{{ ev_io_prop_events_read */
static int ev_io_prop_events_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	ev_io *io_watcher = (ev_io *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, io_watcher->events);

	return SUCCESS;
}
/* }}} */

/* }}} */

/* {{{ EvTimer property handlers */

/* {{{ ev_timer_prop_repeat_read */
static int ev_timer_prop_repeat_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_timer *timer_watcher = (ev_timer *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_DOUBLE(*retval, timer_watcher->repeat);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_timer_prop_repeat_write */
static int ev_timer_prop_repeat_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	ev_timer *timer_watcher;
	double    repeat;

	timer_watcher = (ev_timer *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	PHP_EV_ASSERT(obj->ptr);

	repeat = Z_DVAL_P(value);

	PHP_EV_CHECK_REPEAT_RET(repeat, FAILURE);

	timer_watcher->repeat = (ev_tstamp) repeat;

	return SUCCESS;
}
/* }}} */

/* {{{ ev_timer_prop_remaining_read */
static int ev_timer_prop_remaining_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_timer *timer_watcher = (ev_timer *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_DOUBLE(*retval, ev_timer_remaining(
				php_ev_watcher_loop_ptr(timer_watcher), timer_watcher));

	return SUCCESS;
}
/* }}} */

/* }}} */

#if EV_PERIODIC_ENABLE
/* {{{ EvPeriodic property handlers */

/* {{{ ev_periodic_prop_offset_read */
static int ev_periodic_prop_offset_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_periodic *w = (ev_periodic *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_DOUBLE(*retval, w->offset);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_periodic_prop_offset_write */
static int ev_periodic_prop_offset_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_periodic *w = (ev_periodic *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	w->offset = (ev_tstamp) Z_DVAL_P(value);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_periodic_prop_interval_read */
static int ev_periodic_prop_interval_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_periodic *w = (ev_periodic *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_DOUBLE(*retval, w->interval);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_periodic_prop_interval_write*/
static int ev_periodic_prop_interval_write(php_ev_object *obj, zval *value TSRMLS_DC)
{
	double interval;

	PHP_EV_ASSERT(obj->ptr);

	ev_periodic *w = (ev_periodic *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);
	interval       = (ev_tstamp) Z_DVAL_P(value);

	PHP_EV_CHECK_REPEAT_RET(interval, FAILURE);

	w->interval = interval;

	return SUCCESS;
}
/* }}} */

/* }}} */
#endif

#if EV_SIGNAL_ENABLE
/* {{{ EvSignal property handlers */

/* {{{ ev_signal_prop_signum_read */
static int ev_signal_prop_signum_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_signal *signal_watcher = (ev_signal *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, signal_watcher->signum);

	return SUCCESS;
}
/* }}} */

/* }}} */
#endif

#if EV_CHILD_ENABLE
/* {{{ EvChild property handlers */

/* {{{ ev_child_prop_pid_read */
static int ev_child_prop_pid_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_child *child_watcher = (ev_child *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, child_watcher->pid);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_child_prop_rpid_read */
static int ev_child_prop_rpid_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_child *child_watcher = (ev_child *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, child_watcher->rpid);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_child_prop_rstatus_read */
static int ev_child_prop_rstatus_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_child *child_watcher = (ev_child *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_LONG(*retval, child_watcher->rstatus);

	return SUCCESS;
}
/* }}} */

/* }}} */
#endif

#if EV_STAT_ENABLE
/* {{{ EvStat property handlers */

/* {{{ ev_stat_prop_path_read */
static int ev_stat_prop_path_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	php_ev_stat *stat_ptr = (php_ev_stat *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_STRING(*retval, stat_ptr->path, 1);

	return SUCCESS;
}
/* }}} */

/* {{{ ev_stat_prop_interval_read */
static int ev_stat_prop_interval_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	ev_stat *stat_watcher = (ev_stat *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	MAKE_STD_ZVAL(*retval);
	ZVAL_DOUBLE(*retval, (double) stat_watcher->interval);

	return SUCCESS;
}
/* }}} */

/* }}} */
#endif

#if EV_EMBED_ENABLE
/* {{{ EvEmbed property handlers */

/* {{{ ev_embed_prop_other_read */
static int ev_embed_prop_other_read(php_ev_object *obj, zval **retval TSRMLS_DC)
{
	PHP_EV_ASSERT(obj->ptr);

	php_ev_embed *embed_ptr = (php_ev_embed *) PHP_EV_WATCHER_FETCH_FROM_OBJECT(obj);

	php_ev_prop_read_zval(embed_ptr->other, retval);

	return SUCCESS;
}
/* }}} */

/* }}} */
#endif

/* {{{ ev_loop_property_entries[] */
const php_ev_property_entry ev_loop_property_entries[] = {
	{"data",             sizeof("data")             - 1, ev_loop_prop_data_read,             ev_loop_prop_data_write},
	{"backend",          sizeof("backend")          - 1, ev_loop_prop_backend_read,          NULL},
	{"is_default_loop",  sizeof("is_default_loop")  - 1, ev_loop_prop_is_default_loop_read,  NULL},
	{"iteration",        sizeof("iteration")        - 1, ev_loop_prop_iteration_loop_read,   NULL},
	{"pending",          sizeof("pending")          - 1, ev_loop_prop_pending_loop_read,     NULL},
	{"io_interval",      sizeof("io_interval")      - 1, ev_loop_prop_io_interval_read,      ev_loop_prop_io_interval_write},
	{"timeout_interval", sizeof("timeout_interval") - 1, ev_loop_prop_timeout_interval_read, ev_loop_prop_timeout_interval_write},
	{"depth",            sizeof("depth")            - 1, ev_loop_prop_depth_read,            NULL},
    {NULL, 0, NULL, NULL}
};
/* }}} */

/* {{{ ev_loop_property_entry_info[] */
const zend_property_info ev_loop_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "data",             sizeof("data")             - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "backend",          sizeof("backend")          - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "is_default_loop",  sizeof("is_default_loop")  - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "iteration",        sizeof("iteration")        - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "pending",          sizeof("pending")          - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "io_interval",      sizeof("io_interval")      - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "timeout_interval", sizeof("timeout_interval") - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "depth",            sizeof("depth")            - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL}
};
/* }}} */

/* {{{ ev_watcher_property_entries[] */
const php_ev_property_entry ev_watcher_property_entries[] = {
	{"is_active",  sizeof("is_active")  - 1, ev_watcher_prop_is_active_read,  NULL,                           NULL},
	{"data",       sizeof("data")       - 1, ev_watcher_prop_data_read,       ev_watcher_prop_data_write,     ev_watcher_prop_data_get_ptr_ptr},
	{"is_pending", sizeof("is_pending") - 1, ev_watcher_prop_is_pending_read, NULL,                           NULL},
	{"priority",   sizeof("priority")   - 1, ev_watcher_prop_priority_read,   ev_watcher_prop_priority_write, NULL},
	{NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_watcher_property_entry_info[] */
const zend_property_info ev_watcher_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "is_active",  sizeof("is_active")  - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "data",       sizeof("data")       - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "is_pending", sizeof("is_pending") - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "priority",   sizeof("priority")   - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL}
};
/* }}} */

/* {{{ ev_io_property_entries[] */
const php_ev_property_entry ev_io_property_entries[] = {
	{"fd",     sizeof("fd")     - 1, ev_io_prop_fd_read,     NULL, NULL},
	{"events", sizeof("events") - 1, ev_io_prop_events_read, NULL, NULL},
    {NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_io_property_entry_info[] */
const zend_property_info ev_io_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "fd",     sizeof("fd")     - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "events", sizeof("events") - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL},
};
/* }}} */

/* {{{ ev_timer_property_entries[] */
const php_ev_property_entry ev_timer_property_entries[] = {
	{"repeat",    sizeof("repeat")    - 1, ev_timer_prop_repeat_read,    ev_timer_prop_repeat_write, NULL},
	{"remaining", sizeof("remaining") - 1, ev_timer_prop_remaining_read, NULL, NULL},
    {NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_timer_property_entry_info[] */
const zend_property_info ev_timer_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "repeat",    sizeof("repeat")    - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "remaining", sizeof("remaining") - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL},
};
/* }}} */

#if EV_PERIODIC_ENABLE
/* {{{ ev_periodic_property_entries[] */
const php_ev_property_entry ev_periodic_property_entries[] = {
	{"offset",   sizeof("offset")   - 1, ev_periodic_prop_offset_read,   ev_periodic_prop_offset_write, NULL},
	{"interval", sizeof("interval") - 1, ev_periodic_prop_interval_read, ev_periodic_prop_interval_write, NULL},
    {NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_periodic_property_entry_info[] */
const zend_property_info ev_periodic_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "offset",   sizeof("offset")   - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "interval", sizeof("interval") - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL},
};
/* }}} */
#endif

#if EV_SIGNAL_ENABLE
/* {{{ ev_signal_property_entries[] */
const php_ev_property_entry ev_signal_property_entries[] = {
	{"signum", sizeof("signum") - 1, ev_signal_prop_signum_read, NULL, NULL},
    {NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_signal_property_entry_info[] */
const zend_property_info ev_signal_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "signum", sizeof("signum") - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL},
};
/* }}} */
#endif

#if EV_CHILD_ENABLE
/* {{{ ev_child_property_entries[] */
const php_ev_property_entry ev_child_property_entries[] = {
	{"pid",     sizeof("pid")     - 1, ev_child_prop_pid_read,     NULL, NULL},
	{"rpid",    sizeof("rpid")    - 1, ev_child_prop_rpid_read,    NULL, NULL},
	{"rstatus", sizeof("rstatus") - 1, ev_child_prop_rstatus_read, NULL, NULL},
    {NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_child_property_entry_info[] */
const zend_property_info ev_child_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "pid",     sizeof("pid")     - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "rpid",    sizeof("rpid")    - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "rstatus", sizeof("rstatus") - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL},
};
/* }}} */
#endif

#if EV_STAT_ENABLE
/* {{{ ev_stat_property_entries[] */
const php_ev_property_entry ev_stat_property_entries[] = {
	{"path",     sizeof("path")     - 1, ev_stat_prop_path_read,     NULL, NULL},
	{"interval", sizeof("interval") - 1, ev_stat_prop_interval_read, NULL, NULL},
    {NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_stat_property_entry_info[] */
const zend_property_info ev_stat_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "path",     sizeof("path")     - 1, -1, 0, NULL, 0, NULL},
	{ZEND_ACC_PUBLIC, "interval", sizeof("interval") - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL},
};
/* }}} */
#endif

#if EV_EMBED_ENABLE
/* {{{ ev_embed_property_entries[] */
const php_ev_property_entry ev_embed_property_entries[] = {
	{"other", sizeof("other") - 1, ev_embed_prop_other_read, NULL, NULL},
    {NULL, 0, NULL, NULL, NULL}
};
/* }}} */

/* {{{ ev_embed_property_entry_info[] */
const zend_property_info ev_embed_property_entry_info[] = {
	{ZEND_ACC_PUBLIC, "embed", sizeof("embed") - 1, -1, 0, NULL, 0, NULL},
	{0, NULL, 0, -1, 0, NULL, 0, NULL},
};
/* }}} */
#endif

/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: fdm=marker
 * vim: noet sts=4 sw=4 ts=4
 */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.