600 char *encoding; |
600 char *encoding; |
601 char *language; |
601 char *language; |
602 }; |
602 }; |
603 |
603 |
604 |
604 |
|
605 // nsapi ext begin |
|
606 |
|
607 #define EVENT_POLLIN 0x1 |
|
608 #define EVENT_POLLOUT 0x2 |
|
609 |
|
610 typedef struct EventHandler EventHandler; |
|
611 typedef struct Event Event; |
|
612 |
|
613 typedef int(*eventfunc)(EventHandler*, Event*); |
|
614 |
|
615 struct Event { |
|
616 eventfunc fn; |
|
617 eventfunc finish; |
|
618 void *cookie; |
|
619 intptr_t object; |
|
620 int events; |
|
621 int error; |
|
622 }; |
|
623 |
|
624 // nsapi ext end |
|
625 |
|
626 |
605 typedef void* CONDVAR; |
627 typedef void* CONDVAR; |
606 typedef void *COUNTING_SEMAPHORE; |
628 typedef void *COUNTING_SEMAPHORE; |
607 typedef void* CRITICAL; |
629 typedef void* CRITICAL; |
608 |
630 |
609 #ifdef XP_UNIX |
631 #ifdef XP_UNIX |
1523 threadpool_t* threadpool_new(int min, int max); |
1547 threadpool_t* threadpool_new(int min, int max); |
1524 void* threadpool_func(void *data); |
1548 void* threadpool_func(void *data); |
1525 threadpool_job* threadpool_get_job(threadpool_t *pool); |
1549 threadpool_job* threadpool_get_job(threadpool_t *pool); |
1526 void threadpool_run(threadpool_t *pool, job_callback_f func, void *data); |
1550 void threadpool_run(threadpool_t *pool, job_callback_f func, void *data); |
1527 |
1551 |
|
1552 int ev_pollin(EventHandler *h, int fd, Event *event); |
|
1553 |
|
1554 int ev_pollout(EventHandler *h, int fd, Event *event); |
|
1555 |
|
1556 int evt_send(EventHandler *h, Event *event); |
|
1557 |
1528 |
1558 |
1529 // assert |
1559 // assert |
1530 void ws_log_assert(const char *file, const char *func, int line); |
1560 void ws_log_assert(const char *file, const char *func, int line); |
1531 #ifdef _DEBUG |
1561 #ifdef _DEBUG |
1532 #ifndef __FUNCTION__ |
1562 #ifndef __FUNCTION__ |