]> granicus.if.org Git - libevent/commitdiff
const-ify a few more functions in event.h
authorNick Mathewson <nickm@torproject.org>
Tue, 2 Feb 2010 20:44:10 +0000 (15:44 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 2 Feb 2010 20:44:10 +0000 (15:44 -0500)
event.c
include/event2/event.h

diff --git a/event.c b/event.c
index 19674c7b14ef359150d9d4457439aa97a0337fd6..43e49e98771191d3349f378b452e2f7664b92a9e 100644 (file)
--- a/event.c
+++ b/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;
index a643264bd18fe8068eca1947b6dd1c5993ec28c1..aa1f832ae5dfd0cfd71c2acbdce3f60a1ebf4c19 100644 (file)
@@ -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.