… | |
… | |
130 | { |
130 | { |
131 | W w; |
131 | W w; |
132 | int events; |
132 | int events; |
133 | } ANPENDING; |
133 | } ANPENDING; |
134 | |
134 | |
135 | #ifdef EV_MULTIPLICITY |
135 | #if EV_MULTIPLICITY |
136 | |
136 | |
137 | struct ev_loop |
137 | struct ev_loop |
138 | { |
138 | { |
139 | # define VAR(name,decl) decl; |
139 | # define VAR(name,decl) decl; |
140 | # include "ev_vars.h" |
140 | # include "ev_vars.h" |
… | |
… | |
542 | ev_method (EV_P) |
542 | ev_method (EV_P) |
543 | { |
543 | { |
544 | return method; |
544 | return method; |
545 | } |
545 | } |
546 | |
546 | |
547 | static void |
547 | inline int |
548 | loop_init (EV_P_ int methods) |
548 | loop_init (EV_P_ int methods) |
549 | { |
549 | { |
550 | if (!method) |
550 | if (!method) |
551 | { |
551 | { |
552 | #if EV_USE_MONOTONIC |
552 | #if EV_USE_MONOTONIC |
… | |
… | |
601 | } |
601 | } |
602 | |
602 | |
603 | return method; |
603 | return method; |
604 | } |
604 | } |
605 | |
605 | |
606 | #ifdef EV_MULTIPLICITY |
606 | #if EV_MULTIPLICITY |
607 | |
607 | |
608 | struct ev_loop * |
608 | struct ev_loop * |
609 | ev_loop_new (int methods) |
609 | ev_loop_new (int methods) |
610 | { |
610 | { |
611 | struct ev_loop *loop = (struct ev_loop *)calloc (1, sizeof (struct ev_loop)); |
611 | struct ev_loop *loop = (struct ev_loop *)calloc (1, sizeof (struct ev_loop)); |
612 | |
612 | |
613 | loop_init (EV_A_ methods); |
613 | if (loop_init (EV_A_ methods)) |
614 | |
|
|
615 | return loop; |
614 | return loop; |
|
|
615 | |
|
|
616 | ev_loop_delete (loop); |
|
|
617 | |
|
|
618 | return 0; |
616 | } |
619 | } |
617 | |
620 | |
618 | void |
621 | void |
619 | ev_loop_delete (EV_P) |
622 | ev_loop_delete (EV_P) |
620 | { |
623 | { |
… | |
… | |
625 | #else |
628 | #else |
626 | |
629 | |
627 | int |
630 | int |
628 | ev_init (int methods) |
631 | ev_init (int methods) |
629 | { |
632 | { |
630 | loop_init (); |
633 | return loop_init (methods); |
631 | } |
634 | } |
632 | |
635 | |
633 | #endif |
636 | #endif |
634 | |
637 | |
635 | /*****************************************************************************/ |
638 | /*****************************************************************************/ |