src/server/public/nsapi.h

branch
aio
changeset 159
9ba9f8befa80
parent 147
d050449c3b9e
child 172
5580517faafc
equal deleted inserted replaced
157:a0c8e752490d 159:9ba9f8befa80
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
679 int csd_open; 701 int csd_open;
680 702
681 struct in_addr iaddr; 703 struct in_addr iaddr;
682 704
683 pool_handle_t *pool; 705 pool_handle_t *pool;
706
707 EventHandler *ev; /* event handler instance (new) */
684 708
685 void *clauth; /* v2 ACL client authentication information */ 709 void *clauth; /* v2 ACL client authentication information */
686 struct Session *next; 710 struct Session *next;
687 int fill; 711 int fill;
688 struct sockaddr_in local_addr; /* local addr for this session */ 712 struct sockaddr_in local_addr; /* local addr for this session */
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__

mercurial