mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 21:10:06 -04:00
const-ify a few more functions in event.h
This commit is contained in:
parent
f4190bfb85
commit
d38a7a1931
13
event.c
13
event.c
@ -392,7 +392,8 @@ event_base_new(void)
|
||||
}
|
||||
|
||||
static int
|
||||
event_config_is_avoided_method(struct event_config *cfg, const char *method)
|
||||
event_config_is_avoided_method(const struct event_config *cfg,
|
||||
const char *method)
|
||||
{
|
||||
struct event_config_entry *entry;
|
||||
|
||||
@ -418,7 +419,7 @@ event_is_method_disabled(const char *name)
|
||||
}
|
||||
|
||||
int
|
||||
event_base_get_features(struct event_base *base)
|
||||
event_base_get_features(const struct event_base *base)
|
||||
{
|
||||
return base->evsel->features;
|
||||
}
|
||||
@ -477,7 +478,7 @@ event_disable_debug_mode(void)
|
||||
#endif
|
||||
|
||||
struct event_base *
|
||||
event_base_new_with_config(struct event_config *cfg)
|
||||
event_base_new_with_config(const struct event_config *cfg)
|
||||
{
|
||||
int i;
|
||||
struct event_base *base;
|
||||
@ -1222,7 +1223,7 @@ event_base_dispatch(struct event_base *event_base)
|
||||
}
|
||||
|
||||
const char *
|
||||
event_base_get_method(struct event_base *base)
|
||||
event_base_get_method(const struct event_base *base)
|
||||
{
|
||||
EVUTIL_ASSERT(base);
|
||||
return (base->evsel->name);
|
||||
@ -1600,7 +1601,7 @@ event_priority_set(struct event *ev, int pri)
|
||||
*/
|
||||
|
||||
int
|
||||
event_pending(struct event *ev, short event, struct timeval *tv)
|
||||
event_pending(const struct event *ev, short event, struct timeval *tv)
|
||||
{
|
||||
struct timeval now, res;
|
||||
int flags = 0;
|
||||
@ -1631,7 +1632,7 @@ event_pending(struct event *ev, short event, struct timeval *tv)
|
||||
}
|
||||
|
||||
int
|
||||
_event_initialized(struct event *ev, int need_fd)
|
||||
_event_initialized(const struct event *ev, int need_fd)
|
||||
{
|
||||
if (!(ev->ev_flags & EVLIST_INIT))
|
||||
return 0;
|
||||
|
@ -126,7 +126,7 @@ int event_base_dispatch(struct event_base *);
|
||||
@param eb the event_base structure returned by event_base_new()
|
||||
@return a string identifying the kernel event mechanism (kqueue, epoll, etc.)
|
||||
*/
|
||||
const char *event_base_get_method(struct event_base *);
|
||||
const char *event_base_get_method(const struct event_base *);
|
||||
|
||||
/**
|
||||
Gets all event notification mechanisms supported by Libevent.
|
||||
@ -205,7 +205,7 @@ enum event_base_config_flag {
|
||||
/**
|
||||
Return a bitmask of the features implemented by an event base.
|
||||
*/
|
||||
int event_base_get_features(struct event_base *base);
|
||||
int event_base_get_features(const struct event_base *base);
|
||||
|
||||
/**
|
||||
Enters a required event method feature that the application demands.
|
||||
@ -246,7 +246,7 @@ int event_config_set_flag(struct event_config *cfg, int flag);
|
||||
or NULL if no event base can be created with the requested event_config.
|
||||
@see event_base_new(), event_base_free(), event_init(), event_assign()
|
||||
*/
|
||||
struct event_base *event_base_new_with_config(struct event_config *cfg);
|
||||
struct event_base *event_base_new_with_config(const struct event_config *);
|
||||
|
||||
/**
|
||||
Deallocate all memory associated with an event_base, and free the base.
|
||||
@ -556,7 +556,7 @@ void event_active(struct event *, int, short);
|
||||
is to say, it has been added), or 0 if the event is not added.
|
||||
|
||||
*/
|
||||
int event_pending(struct event *, short, struct timeval *);
|
||||
int event_pending(const struct event *, short, struct timeval *);
|
||||
|
||||
|
||||
/**
|
||||
@ -575,7 +575,7 @@ int event_pending(struct event *, short, struct timeval *);
|
||||
*/
|
||||
#define event_initialized(ev) _event_initialized((ev), 1)
|
||||
|
||||
int _event_initialized(struct event *, int check_fd);
|
||||
int _event_initialized(const struct event *, int check_fd);
|
||||
|
||||
/**
|
||||
Get the signal number assigned to an event.
|
||||
|
Loading…
x
Reference in New Issue
Block a user