make event methods static so that they are not exported; from Andrei Nigmatulin

svn:r692
This commit is contained in:
Niels Provos 2008-03-29 01:45:45 +00:00
parent cb50f615d4
commit ca42671a14
6 changed files with 54 additions and 53 deletions

View File

@ -59,6 +59,7 @@ Changes in current version:
o Provide OpenSSL style support for multiple threads accessing the same event_base o Provide OpenSSL style support for multiple threads accessing the same event_base
o make event_rpcgen.py generate code include event-config.h; reported by Sam Banks. o make event_rpcgen.py generate code include event-config.h; reported by Sam Banks.
o switch thread support so that locks get allocated as they are needed. o switch thread support so that locks get allocated as they are needed.
o make event methods static so that they are not exported; from Andrei Nigmatulin
Changes in 1.4.0: Changes in 1.4.0:
o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr. o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr.

View File

@ -69,11 +69,11 @@ struct devpollop {
int nchanges; int nchanges;
}; };
void *devpoll_init (struct event_base *); static void *devpoll_init (struct event_base *);
int devpoll_add (void *, struct event *); static int devpoll_add (void *, struct event *);
int devpoll_del (void *, struct event *); static int devpoll_del (void *, struct event *);
int devpoll_dispatch (struct event_base *, void *, struct timeval *); static int devpoll_dispatch (struct event_base *, void *, struct timeval *);
void devpoll_dealloc (struct event_base *, void *); static void devpoll_dealloc (struct event_base *, void *);
struct eventop devpollops = { struct eventop devpollops = {
"devpoll", "devpoll",
@ -123,7 +123,7 @@ devpoll_queue(struct devpollop *devpollop, int fd, int events) {
return(0); return(0);
} }
void * static void *
devpoll_init(struct event_base *base) devpoll_init(struct event_base *base)
{ {
int dpfd, nfiles = NEVENT; int dpfd, nfiles = NEVENT;
@ -182,7 +182,7 @@ devpoll_init(struct event_base *base)
return (devpollop); return (devpollop);
} }
int static int
devpoll_recalc(struct event_base *base, void *arg, int max) devpoll_recalc(struct event_base *base, void *arg, int max)
{ {
struct devpollop *devpollop = arg; struct devpollop *devpollop = arg;
@ -209,7 +209,7 @@ devpoll_recalc(struct event_base *base, void *arg, int max)
return (0); return (0);
} }
int static int
devpoll_dispatch(struct event_base *base, void *arg, struct timeval *tv) devpoll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
{ {
struct devpollop *devpollop = arg; struct devpollop *devpollop = arg;
@ -286,7 +286,7 @@ devpoll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
} }
int static int
devpoll_add(void *arg, struct event *ev) devpoll_add(void *arg, struct event *ev)
{ {
struct devpollop *devpollop = arg; struct devpollop *devpollop = arg;
@ -340,7 +340,7 @@ devpoll_add(void *arg, struct event *ev)
return (0); return (0);
} }
int static int
devpoll_del(void *arg, struct event *ev) devpoll_del(void *arg, struct event *ev)
{ {
struct devpollop *devpollop = arg; struct devpollop *devpollop = arg;
@ -397,7 +397,7 @@ devpoll_del(void *arg, struct event *ev)
return (0); return (0);
} }
void static void
devpoll_dealloc(struct event_base *base, void *arg) devpoll_dealloc(struct event_base *base, void *arg)
{ {
struct devpollop *devpollop = arg; struct devpollop *devpollop = arg;

20
epoll.c
View File

@ -69,11 +69,11 @@ struct epollop {
int epfd; int epfd;
}; };
void *epoll_init (struct event_base *); static void *epoll_init (struct event_base *);
int epoll_add (void *, struct event *); static int epoll_add (void *, struct event *);
int epoll_del (void *, struct event *); static int epoll_del (void *, struct event *);
int epoll_dispatch (struct event_base *, void *, struct timeval *); static int epoll_dispatch (struct event_base *, void *, struct timeval *);
void epoll_dealloc (struct event_base *, void *); static void epoll_dealloc (struct event_base *, void *);
struct eventop epollops = { struct eventop epollops = {
"epoll", "epoll",
@ -96,7 +96,7 @@ struct eventop epollops = {
#define NEVENT 32000 #define NEVENT 32000
void * static void *
epoll_init(struct event_base *base) epoll_init(struct event_base *base)
{ {
int epfd, nfiles = NEVENT; int epfd, nfiles = NEVENT;
@ -179,7 +179,7 @@ epoll_recalc(struct event_base *base, void *arg, int max)
return (0); return (0);
} }
int static int
epoll_dispatch(struct event_base *base, void *arg, struct timeval *tv) epoll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
{ {
struct epollop *epollop = arg; struct epollop *epollop = arg;
@ -238,7 +238,7 @@ epoll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
} }
int static int
epoll_add(void *arg, struct event *ev) epoll_add(void *arg, struct event *ev)
{ {
struct epollop *epollop = arg; struct epollop *epollop = arg;
@ -286,7 +286,7 @@ epoll_add(void *arg, struct event *ev)
return (0); return (0);
} }
int static int
epoll_del(void *arg, struct event *ev) epoll_del(void *arg, struct event *ev)
{ {
struct epollop *epollop = arg; struct epollop *epollop = arg;
@ -337,7 +337,7 @@ epoll_del(void *arg, struct event *ev)
return (0); return (0);
} }
void static void
epoll_dealloc(struct event_base *base, void *arg) epoll_dealloc(struct event_base *base, void *arg)
{ {
struct epollop *epollop = arg; struct epollop *epollop = arg;

View File

@ -75,12 +75,12 @@ struct kqop {
pid_t pid; pid_t pid;
}; };
void *kq_init (struct event_base *); static void *kq_init (struct event_base *);
int kq_add (void *, struct event *); static int kq_add (void *, struct event *);
int kq_del (void *, struct event *); static int kq_del (void *, struct event *);
int kq_dispatch (struct event_base *, void *, struct timeval *); static int kq_dispatch (struct event_base *, void *, struct timeval *);
int kq_insert (struct kqop *, struct kevent *); static int kq_insert (struct kqop *, struct kevent *);
void kq_dealloc (struct event_base *, void *); static void kq_dealloc (struct event_base *, void *);
const struct eventop kqops = { const struct eventop kqops = {
"kqueue", "kqueue",
@ -92,7 +92,7 @@ const struct eventop kqops = {
1 /* need reinit */ 1 /* need reinit */
}; };
void * static void *
kq_init(struct event_base *base) kq_init(struct event_base *base)
{ {
int kq; int kq;
@ -155,7 +155,7 @@ kq_init(struct event_base *base)
return (kqueueop); return (kqueueop);
} }
int static int
kq_insert(struct kqop *kqop, struct kevent *kev) kq_insert(struct kqop *kqop, struct kevent *kev)
{ {
int nevents = kqop->nevents; int nevents = kqop->nevents;
@ -206,7 +206,7 @@ kq_sighandler(int sig)
/* Do nothing here */ /* Do nothing here */
} }
int static int
kq_dispatch(struct event_base *base, void *arg, struct timeval *tv) kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
{ {
struct kqop *kqop = arg; struct kqop *kqop = arg;
@ -283,7 +283,7 @@ kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
} }
int static int
kq_add(void *arg, struct event *ev) kq_add(void *arg, struct event *ev)
{ {
struct kqop *kqop = arg; struct kqop *kqop = arg;
@ -351,7 +351,7 @@ kq_add(void *arg, struct event *ev)
return (0); return (0);
} }
int static int
kq_del(void *arg, struct event *ev) kq_del(void *arg, struct event *ev)
{ {
struct kqop *kqop = arg; struct kqop *kqop = arg;
@ -405,7 +405,7 @@ kq_del(void *arg, struct event *ev)
return (0); return (0);
} }
void static void
kq_dealloc(struct event_base *base, void *arg) kq_dealloc(struct event_base *base, void *arg)
{ {
struct kqop *kqop = arg; struct kqop *kqop = arg;

20
poll.c
View File

@ -65,11 +65,11 @@ struct pollop {
* "no entry." */ * "no entry." */
}; };
void *poll_init (struct event_base *); static void *poll_init (struct event_base *);
int poll_add (void *, struct event *); static int poll_add (void *, struct event *);
int poll_del (void *, struct event *); static int poll_del (void *, struct event *);
int poll_dispatch (struct event_base *, void *, struct timeval *); static int poll_dispatch (struct event_base *, void *, struct timeval *);
void poll_dealloc (struct event_base *, void *); static void poll_dealloc (struct event_base *, void *);
const struct eventop pollops = { const struct eventop pollops = {
"poll", "poll",
@ -81,7 +81,7 @@ const struct eventop pollops = {
0 0
}; };
void * static void *
poll_init(struct event_base *base) poll_init(struct event_base *base)
{ {
struct pollop *pollop; struct pollop *pollop;
@ -132,7 +132,7 @@ poll_check_ok(struct pollop *pop)
#define poll_check_ok(pop) #define poll_check_ok(pop)
#endif #endif
int static int
poll_dispatch(struct event_base *base, void *arg, struct timeval *tv) poll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
{ {
int res, i, msec = -1, nfds; int res, i, msec = -1, nfds;
@ -196,7 +196,7 @@ poll_dispatch(struct event_base *base, void *arg, struct timeval *tv)
return (0); return (0);
} }
int static int
poll_add(void *arg, struct event *ev) poll_add(void *arg, struct event *ev)
{ {
struct pollop *pop = arg; struct pollop *pop = arg;
@ -301,7 +301,7 @@ poll_add(void *arg, struct event *ev)
* Nothing to be done here. * Nothing to be done here.
*/ */
int static int
poll_del(void *arg, struct event *ev) poll_del(void *arg, struct event *ev)
{ {
struct pollop *pop = arg; struct pollop *pop = arg;
@ -354,7 +354,7 @@ poll_del(void *arg, struct event *ev)
return (0); return (0);
} }
void static void
poll_dealloc(struct event_base *base, void *arg) poll_dealloc(struct event_base *base, void *arg)
{ {
struct pollop *pop = arg; struct pollop *pop = arg;

View File

@ -70,11 +70,11 @@ struct selectop {
struct event **event_w_by_fd; struct event **event_w_by_fd;
}; };
void *select_init (struct event_base *); static void *select_init (struct event_base *);
int select_add (void *, struct event *); static int select_add (void *, struct event *);
int select_del (void *, struct event *); static int select_del (void *, struct event *);
int select_dispatch (struct event_base *, void *, struct timeval *); static int select_dispatch (struct event_base *, void *, struct timeval *);
void select_dealloc (struct event_base *, void *); static void select_dealloc (struct event_base *, void *);
const struct eventop selectops = { const struct eventop selectops = {
"select", "select",
@ -88,7 +88,7 @@ const struct eventop selectops = {
static int select_resize(struct selectop *sop, int fdsz); static int select_resize(struct selectop *sop, int fdsz);
void * static void *
select_init(struct event_base *base) select_init(struct event_base *base)
{ {
struct selectop *sop; struct selectop *sop;
@ -134,7 +134,7 @@ check_selectop(struct selectop *sop)
#define check_selectop(sop) do { (void) sop; } while (0) #define check_selectop(sop) do { (void) sop; } while (0)
#endif #endif
int static int
select_dispatch(struct event_base *base, void *arg, struct timeval *tv) select_dispatch(struct event_base *base, void *arg, struct timeval *tv)
{ {
int res, i; int res, i;
@ -250,7 +250,7 @@ select_resize(struct selectop *sop, int fdsz)
} }
int static int
select_add(void *arg, struct event *ev) select_add(void *arg, struct event *ev)
{ {
struct selectop *sop = arg; struct selectop *sop = arg;
@ -300,7 +300,7 @@ select_add(void *arg, struct event *ev)
* Nothing to be done here. * Nothing to be done here.
*/ */
int static int
select_del(void *arg, struct event *ev) select_del(void *arg, struct event *ev)
{ {
struct selectop *sop = arg; struct selectop *sop = arg;
@ -328,7 +328,7 @@ select_del(void *arg, struct event *ev)
return (0); return (0);
} }
void static void
select_dealloc(struct event_base *base, void *arg) select_dealloc(struct event_base *base, void *arg)
{ {
struct selectop *sop = arg; struct selectop *sop = arg;