diff --git a/Makefile.am b/Makefile.am index a7c9bebe..2283bb5f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 # This is the point release for libevent. It shouldn't include any # a/b/c/d/e notations. -RELEASE = 1.4 +RELEASE = 2.0 # This is the version info for the libevent binary API. It has three # numbers: @@ -25,7 +25,15 @@ RELEASE = 1.4 # compatibility with old binaries. Increment Current. Set Age to 0, # since we're backward compatible with no previous APIs. Set Revision # to 0 too. -VERSION_INFO = 2:0:0 +# +# Version history: +# 1.4: +# 2 -- Libevent ??? ..Libevent 1.4.10 +# [Gap left for possible intermediate versions] +# +# 2.0 +# 1 -- Libevent 2.0.1-alpha. +VERSION_INFO = 1:0:0 bin_SCRIPTS = event_rpcgen.py diff --git a/configure.in b/configure.in index f8c6c74c..4327bc50 100644 --- a/configure.in +++ b/configure.in @@ -4,8 +4,9 @@ AC_INIT(event.c) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE(libevent,1.4.99-trunk) +AM_INIT_AUTOMAKE(libevent,2.0.1-alpha) AM_CONFIG_HEADER(config.h) +AC_DEFINE(NUMERIC_VERSION, 0x02000100, [Numeric representation of the version]) dnl Initialize prefix. if test "$prefix" = "NONE"; then diff --git a/event.c b/event.c index d9dc1b2e..9e55b86b 100644 --- a/event.c +++ b/event.c @@ -1551,6 +1551,12 @@ event_get_version(void) return (_EVENT_VERSION); } +ev_uint32_t +event_get_version_number(void) +{ + return (_EVENT_NUMERIC_VERSION); +} + /* * No thread-safe interface needed - the information should be the same * for all threads. diff --git a/include/event2/event.h b/include/event2/event.h index 7f9d8094..903659ad 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -543,12 +543,34 @@ evutil_socket_t event_get_fd(struct event *ev); #endif /** - Get the libevent version number. + Get the libevent version. - @return a string containing the version number of libevent - */ + Note that this will give you the version of the library that you're + currently linked against, not the version of the headers that you've + compiled against. + + @return a string containing the version number of Libevent +*/ const char *event_get_version(void); +/** + Return a numeric representation of Libevent's version. + + Note that this will give you the version of the library that you're + currently linked against, not the version of the headers you've used to + compile. + + The format uses one byte each for the major, minor, and patchlevel parts of + the version number. The low-order byte is unused. For example, version + 2.0.1-alpha has a numeric representation of 0x02000100 +*/ +ev_uint32_t event_get_version_number(void); + +/** As event_get_version, but gives the version of Libevent's headers. */ +#define LIBEVENT_VERSION _EVENT_VERSION +/** As event_get_version_number, but gives the version number of Libevent's + * headers. */ +#define LIBEVENT_VERSION_NUMBER _EVENT_NUMERIC_VERSION /** Set the number of different event priorities (threadsafe variant).