Commit d8ac8d18 authored by Alexander Barkov's avatar Alexander Barkov

Merge 10.0->10.0-connect

parents 1e711c8d 0c0fe7a8
......@@ -142,7 +142,6 @@ INCLUDE(cpack_deb)
INCLUDE(character_sets)
INCLUDE(cpu_info)
INCLUDE(zlib)
INCLUDE(libevent)
INCLUDE(ssl)
INCLUDE(readline)
INCLUDE(libutils)
......@@ -266,8 +265,6 @@ MYSQL_CHECK_ZLIB_WITH_COMPRESS()
MYSQL_CHECK_SSL()
# Add readline or libedit.
MYSQL_CHECK_READLINE()
# Add libevent
MYSQL_CHECK_LIBEVENT()
CHECK_JEMALLOC()
......
This diff is collapsed.
......@@ -2834,7 +2834,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
mysql_free_result(fields);
break;
}
field_names[i][num_fields*2]= '\0';
field_names[i][num_fields*2]= NULL;
j=0;
while ((sql_field=mysql_fetch_field(fields)))
{
......
......@@ -1228,6 +1228,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case WRITE_ROWS_EVENT:
case DELETE_ROWS_EVENT:
case UPDATE_ROWS_EVENT:
case WRITE_ROWS_EVENT_V1:
case UPDATE_ROWS_EVENT_V1:
case DELETE_ROWS_EVENT_V1:
{
Rows_log_event *e= (Rows_log_event*) ev;
if (print_row_event(print_event_info, ev, e->get_table_id(),
......
/*
Copyright (c) 2001, 2012, Oracle and/or its affiliates.
Copyright (c) 2010, 2011, Monty Program Ab.
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -18,7 +18,7 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.7.2"
#define CHECK_VERSION "2.7.2-MariaDB"
#include "client_priv.h"
#include <m_ctype.h>
......@@ -32,6 +32,10 @@
#define EX_USAGE 1
#define EX_MYSQLERR 2
/* ALTER instead of repair. */
#define MAX_ALTER_STR_SIZE 128 * 1024
#define KEY_PARTITIONING_CHANGED_STR "KEY () partitioning changed"
static MYSQL mysql_connection, *sock = 0;
static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_compress = 0, opt_databases = 0, opt_fast = 0,
......@@ -47,7 +51,7 @@ static char *opt_password = 0, *current_user = 0,
*default_charset= 0, *current_host= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0;
DYNAMIC_ARRAY tables4repair, tables4rebuild;
DYNAMIC_ARRAY tables4repair, tables4rebuild, alter_table_cmds;
static char *shared_memory_base_name=0;
static uint opt_protocol=0;
......@@ -816,6 +820,7 @@ static void print_result()
MYSQL_RES *res;
MYSQL_ROW row;
char prev[(NAME_LEN+9)*2+2];
char prev_alter[MAX_ALTER_STR_SIZE];
uint i;
my_bool found_error=0, table_rebuild=0;
DBUG_ENTER("print_result");
......@@ -823,6 +828,7 @@ static void print_result()
res = mysql_use_result(sock);
prev[0] = '\0';
prev_alter[0]= 0;
for (i = 0; (row = mysql_fetch_row(res)); i++)
{
int changed = strcmp(prev, row[0]);
......@@ -839,12 +845,18 @@ static void print_result()
strcmp(row[3],"OK"))
{
if (table_rebuild)
insert_dynamic(&tables4rebuild, (uchar*) prev);
{
if (prev_alter[0])
insert_dynamic(&alter_table_cmds, (uchar*) prev_alter);
else
insert_dynamic(&tables4rebuild, (uchar*) prev);
}
else
insert_dynamic(&tables4repair, (uchar*) prev);
insert_dynamic(&tables4repair, prev);
}
found_error=0;
table_rebuild=0;
prev_alter[0]= 0;
if (opt_silent)
continue;
}
......@@ -861,7 +873,7 @@ static void print_result()
printf("%-50s %s", row[0], "Needs upgrade");
else
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
if (strcmp(row[2],"note"))
if (opt_auto_repair && strcmp(row[2],"note"))
{
found_error=1;
if (opt_auto_repair && strstr(row[3], "ALTER TABLE") != NULL)
......@@ -877,9 +889,14 @@ static void print_result()
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
{
if (table_rebuild)
insert_dynamic(&tables4rebuild, (uchar*) prev);
{
if (prev_alter[0])
insert_dynamic(&alter_table_cmds, prev_alter);
else
insert_dynamic(&tables4rebuild, prev);
}
else
insert_dynamic(&tables4repair, (uchar*) prev);
insert_dynamic(&tables4repair, prev);
}
mysql_free_result(res);
DBUG_VOID_RETURN;
......@@ -999,7 +1016,9 @@ int main(int argc, char **argv)
(my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0)) ||
my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,
64, MYF(0))))
64, MYF(0)) ||
my_init_dynamic_array(&alter_table_cmds, MAX_ALTER_STR_SIZE, 0, 1,
MYF(0))))
goto end;
if (opt_alldbs)
......@@ -1024,6 +1043,8 @@ int main(int argc, char **argv)
}
for (i = 0; i < tables4rebuild.elements ; i++)
rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
for (i = 0; i < alter_table_cmds.elements ; i++)
run_query((char*) dynamic_array_ptr(&alter_table_cmds, i));
}
ret= test(first_error);
......
# Copyright (C) 2011 Oracle and/or its affiliates. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MACRO (MYSQL_USE_BUNDLED_LIBEVENT)
SET(LIBEVENT_LIBRARY event)
SET(LIBEVENT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libevent)
SET(LIBEVENT_FOUND TRUE)
SET(WITH_LIBEVENT "bundled" CACHE STRING "Use bundled libevent")
ADD_SUBDIRECTORY(libevent)
GET_TARGET_PROPERTY(src libevent SOURCES)
FOREACH(file ${src})
SET(LIBEVENT_SOURCES ${LIBEVENT_SOURCES} ${CMAKE_SOURCE_DIR}/libevent/${file})
ENDFOREACH()
ENDMACRO()
# MYSQL_CHECK_LIBEVENT
#
# Provides the following configure options:
# WITH_LIBEVENT_BUNDLED
# If this is set,we use bindled libevent
# If this is not set,search for system libevent.
# if system libevent is not found, use bundled copy
# LIBEVENT_LIBRARIES, LIBEVENT_INCLUDE_DIR and LIBEVENT_SOURCES
# are set after this macro has run
MACRO (MYSQL_CHECK_LIBEVENT)
IF (NOT WITH_LIBEVENT)
SET(WITH_LIBEVENT "bundled" CACHE STRING "By default use bundled libevent on this platform")
ENDIF()
IF(WITH_LIBEVENT STREQUAL "bundled")
MYSQL_USE_BUNDLED_LIBEVENT()
ELSEIF(WITH_LIBEVENT STREQUAL "system" OR WITH_LIBEVENT STREQUAL "yes")
SET(LIBEVENT_FIND_QUIETLY TRUE)
IF (NOT LIBEVENT_INCLUDE_PATH)
set(LIBEVENT_INCLUDE_PATH /usr/local/include /opt/local/include)
ENDIF()
find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LIBEVENT_INCLUDE_PATH})
if (NOT LIBEVENT_INCLUDE_DIR)
MESSAGE(SEND_ERROR "Cannot find appropriate event.h in /usr/local/include or /opt/local/include. Use bundled libevent")
endif()
IF (NOT LIBEVENT_LIB_PATHS)
set(LIBEVENT_LIB_PATHS /usr/local/lib /opt/local/lib)
ENDIF()
find_library(LIBEVENT_LIB event PATHS ${LIBEVENT_LIB_PATHS})
if (NOT LIBEVENT_LIB)
MESSAGE(SEND_ERROR "Cannot find appropriate event lib in /usr/local/lib or /opt/local/lib. Use bundled libevent")
endif()
IF (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR)
set(LIBEVENT_FOUND TRUE)
set(LIBEVENT_LIBS ${LIBEVENT_LIB})
ELSE()
set(LIBEVENT_FOUND FALSE)
ENDIF()
IF(LIBEVENT_FOUND)
SET(LIBEVENT_SOURCES "")
SET(LIBEVENT_LIBRARIES ${LIBEVENT_LIBS})
SET(LIBEVENT_INCLUDE_DIRS ${LIBEVENT_INCLUDE_DIR})
SET(LIBEVENT_DEFINES "-DHAVE_LIBEVENT")
ELSE()
IF(WITH_LIBEVENT STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for libevent. Use bundled libevent")
ENDIF()
MYSQL_USE_BUNDLED_LIBEVENT()
ENDIF()
ENDIF()
ENDMACRO()
......@@ -4,7 +4,7 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev
Standards-Version: 3.8.3
Homepage: http://mariadb.org/
Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/10.0/files
......
......@@ -4,6 +4,7 @@ usr/lib/mysql/plugin/ha_sequence.so
usr/lib/mysql/plugin/ha_sphinx.so
usr/lib/mysql/plugin/handlersocket.so
usr/lib/mysql/plugin/locales.so
usr/lib/mysql/plugin/metadata_lock_info.so
usr/lib/mysql/plugin/query_cache_info.so
usr/lib/mysql/plugin/query_response_time.so
usr/lib/mysql/plugin/semisync_master.so
......
......@@ -4,7 +4,7 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev
Standards-Version: 3.8.2
Homepage: http://mariadb.org/
Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/10.0/files
......
......@@ -4,6 +4,7 @@ usr/lib/mysql/plugin/ha_sequence.so
usr/lib/mysql/plugin/ha_sphinx.so
usr/lib/mysql/plugin/handlersocket.so
usr/lib/mysql/plugin/locales.so
usr/lib/mysql/plugin/metadata_lock_info.so
usr/lib/mysql/plugin/query_cache_info.so
usr/lib/mysql/plugin/query_response_time.so
usr/lib/mysql/plugin/semisync_master.so
......
/* defines and prototypes for using crypt_genhash_impl.cc */
#ifndef CRYPT_HASHGEN_IMPL_H
#define CRYPT_HASHGEN_IMPL_H
#define ROUNDS_DEFAULT 5000
#define ROUNDS_MIN 1000
#define ROUNDS_MAX 999999999
#define MIXCHARS 32
#define CRYPT_SALT_LENGTH 20
#define CRYPT_MAGIC_LENGTH 3
#define CRYPT_PARAM_LENGTH 13
#define SHA256_HASH_LENGTH 43
#define CRYPT_MAX_PASSWORD_SIZE (CRYPT_SALT_LENGTH + \
SHA256_HASH_LENGTH + \
CRYPT_MAGIC_LENGTH + \
CRYPT_PARAM_LENGTH)
int extract_user_salt(char **salt_begin,
char **salt_end);
C_MODE_START
char *
my_crypt_genhash(char *ctbuffer,
size_t ctbufflen,
const char *plaintext,
int plaintext_len,
const char *switchsalt,
const char **params);
void generate_user_salt(char *buffer, int buffer_len);
void xor_string(char *to, int to_len, char *pattern, int pattern_len);
C_MODE_END
#endif
......@@ -749,7 +749,7 @@ size_t my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs,
my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs);
const MY_CONTRACTIONS *my_charset_get_contractions(const CHARSET_INFO *cs,
const MY_CONTRACTIONS *my_charset_get_contractions(CHARSET_INFO *cs,
int level);
extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n,
......
......@@ -483,14 +483,13 @@ enum ha_base_keytype {
#define HA_ERR_GENERIC 168 /* Generic error */
/* row not actually updated: new values same as the old values */
#define HA_ERR_RECORD_IS_THE_SAME 169
/* It is not possible to log this statement */
#define HA_ERR_LOGGING_IMPOSSIBLE 170
/* The event was corrupt, leading to illegal data being read */
#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this
statement */
#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to
illegal data being read */
#define HA_ERR_NEW_FILE 172 /* New file format */
/* The event could not be processed no other handler error happened */
#define HA_ERR_ROWS_EVENT_APPLY 173
#define HA_ERR_ROWS_EVENT_APPLY 173 /* The event could not be processed
no other hanlder error happened */
#define HA_ERR_INITIALIZATION 174 /* Error during initialization */
#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
......@@ -504,10 +503,11 @@ enum ha_base_keytype {
#define HA_ERR_TABLE_IN_FK_CHECK 183 /* Table being used in foreign key check */
#define HA_ERR_TABLESPACE_EXISTS 184 /* The tablespace existed in storage engine */
#define HA_ERR_TOO_MANY_FIELDS 185 /* Table has too many columns */
#define HA_ERR_ROW_NOT_VISIBLE 186
#define HA_ERR_ABORTED_BY_USER 187
#define HA_ERR_DISK_FULL 188
#define HA_ERR_LAST 188 /* Copy of last error nr */
#define HA_ERR_ROW_IN_WRONG_PARTITION 186 /* Row in wrong partition */
#define HA_ERR_ROW_NOT_VISIBLE 187
#define HA_ERR_ABORTED_BY_USER 188
#define HA_ERR_DISK_FULL 189
#define HA_ERR_LAST 189 /* Copy of last error nr */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
......
#ifndef MYSYS_MY_HANDLER_ERRORS_INCLUDED
#define MYSYS_MY_HANDLER_ERRORS_INCLUDED
/* Copyright (c) 2008, 2012, Oracle and/or its affiliates.
/* Copyright (c) 2008, 2013, Oracle and/or its affiliates.
Copyright (c) 2011, 2013, SkySQL Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -88,6 +89,7 @@ static const char *handler_error_messages[]=
"Table is being used in foreign key check",
"Tablespace already exists",
"Too many columns",
"Row in wrong partition",
"Row is not visible by the current transaction",
"Operation was interrupted by end user (probably kill command?)",
"Disk full"
......
#ifndef CLIENT_AUTHENTICATION_H
#define CLIENT_AUTHENTICATION_H
#include "mysql.h"
#include "mysql/client_plugin.h"
C_MODE_START
int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
int sha256_password_init(char *, size_t, int, va_list);
int sha256_password_deinit(void);
C_MODE_END
#endif
......@@ -75,7 +75,7 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0104
/* MariaDB plugin interface version */
#define MARIA_PLUGIN_INTERFACE_VERSION 0x0107
#define MARIA_PLUGIN_INTERFACE_VERSION 0x0108
/*
The allowable types of plugins
......@@ -622,11 +622,15 @@ void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
void thd_storage_lock_wait(MYSQL_THD thd, long long value);
int thd_tx_isolation(const MYSQL_THD thd);
int thd_tx_is_read_only(const MYSQL_THD thd);
#if MARIA_PLUGIN_INTERFACE_VERSION < 0x0200
/**
TODO: This function is for API compatibility, remove it eventually.
All engines should switch to use thd_get_error_context_description()
plugin service function.
*/
char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
unsigned int max_query_len);
/* Increments the row counter, see THD::row_count */
void thd_inc_row_count(MYSQL_THD thd);
#endif
/**
Create a temporary file.
......
......@@ -137,6 +137,31 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
unsigned long (*thd_get_error_row_func)(const void* thd);
void (*thd_inc_error_row_func)(void* thd);
char *(*thd_get_error_context_description_func)(void* thd,
char *buffer,
unsigned int length,
unsigned int max_query_length);
} *thd_error_context_service;
const char *thd_get_error_message(const void* thd);
unsigned int thd_get_error_number(const void* thd);
unsigned long thd_get_error_row(const void* thd);
void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
struct st_mysql_xid {
long formatID;
long gtrid_length;
......@@ -280,7 +305,6 @@ int thd_tx_isolation(const void* thd);
int thd_tx_is_read_only(const void* thd);
char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
......
......@@ -137,6 +137,31 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
unsigned long (*thd_get_error_row_func)(const void* thd);
void (*thd_inc_error_row_func)(void* thd);
char *(*thd_get_error_context_description_func)(void* thd,
char *buffer,
unsigned int length,
unsigned int max_query_length);
} *thd_error_context_service;
const char *thd_get_error_message(const void* thd);
unsigned int thd_get_error_number(const void* thd);
unsigned long thd_get_error_row(const void* thd);
void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
struct st_mysql_xid {
long formatID;
long gtrid_length;
......@@ -280,7 +305,6 @@ int thd_tx_isolation(const void* thd);
int thd_tx_is_read_only(const void* thd);
char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
......
......@@ -137,6 +137,31 @@ extern struct logger_service_st {
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
int logger_rotate(LOGGER_HANDLE *log);
#include <mysql/service_thd_autoinc.h>
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const void* thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
void thd_get_autoinc(const void* thd,
unsigned long* off, unsigned long* inc);
#include <mysql/service_thd_error_context.h>
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const void* thd);
unsigned int (*thd_get_error_number_func)(const void* thd);
unsigned long (*thd_get_error_row_func)(const void* thd);
void (*thd_inc_error_row_func)(void* thd);
char *(*thd_get_error_context_description_func)(void* thd,
char *buffer,
unsigned int length,
unsigned int max_query_length);
} *thd_error_context_service;
const char *thd_get_error_message(const void* thd);
unsigned int thd_get_error_number(const void* thd);
unsigned long thd_get_error_row(const void* thd);
void thd_inc_error_row(void* thd);
char *thd_get_error_context_description(void* thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
struct st_mysql_xid {
long formatID;
long gtrid_length;
......@@ -233,7 +258,6 @@ int thd_tx_isolation(const void* thd);
int thd_tx_is_read_only(const void* thd);
char *thd_security_context(void* thd, char *buffer, unsigned int length,
unsigned int max_query_len);
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
......
#ifndef MYSQL_SERVICE_THD_AUTOINC_INCLUDED
/* Copyright (C) 2013 MariaDB Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
This service provides access to the auto_increment related system variables:
@@auto_increment_offset
@@auto_increment_increment
*/
#ifdef __cplusplus
extern "C" {
#endif
extern struct thd_autoinc_service_st {
void (*thd_get_autoinc_func)(const MYSQL_THD thd,
unsigned long* off, unsigned long* inc);
} *thd_autoinc_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define thd_get_autoinc(thd, off, inc) \
(thd_autoinc_service->thd_get_autoinc_func((thd), (off), (inc)))
#else
/**
Return autoincrement system variables
@param IN thd user thread connection handle
@param OUT off the value of @@SESSION.auto_increment_offset
@param OUT inc the value of @@SESSION.auto_increment_increment
*/
void thd_get_autoinc(const MYSQL_THD thd,
unsigned long* off, unsigned long* inc);
#endif
#ifdef __cplusplus
}
#endif
#define MYSQL_SERVICE_THD_AUTOINC_INCLUDED
#endif
#ifndef MYSQL_SERVICE_THD_STMT_DA_INCLUDED
/* Copyright (C) 2013 MariaDB Foundation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
@file
This service provides access to the statement diagnostics area:
- error message
- error number
- row for warning (e.g. for multi-row INSERT statements)
*/
#ifdef __cplusplus
extern "C" {
#endif
extern struct thd_error_context_service_st {
const char *(*thd_get_error_message_func)(const MYSQL_THD thd);
unsigned int (*thd_get_error_number_func)(const MYSQL_THD thd);
unsigned long (*thd_get_error_row_func)(const MYSQL_THD thd);
void (*thd_inc_error_row_func)(MYSQL_THD thd);
char *(*thd_get_error_context_description_func)(MYSQL_THD thd,
char *buffer,
unsigned int length,
unsigned int max_query_length);
} *thd_error_context_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define thd_get_error_message(thd) \
(thd_error_context_service->thd_get_error_message_func((thd)))
#define thd_get_error_number(thd) \
(thd_error_context_service->thd_get_error_number_func((thd)))
#define thd_get_error_row(thd) \
(thd_error_context_service->thd_get_error_row_func((thd)))
#define thd_inc_error_row(thd) \
(thd_error_context_service->thd_inc_error_row_func((thd)))
#define thd_get_error_context_description(thd, buffer, length, max_query_len) \
(thd_error_context_service->thd_get_error_context_description_func((thd), \
(buffer), \
(length), \
(max_query_len)))
#else
/**
Return error message
@param thd user thread connection handle
@return error text
*/
const char *thd_get_error_message(const MYSQL_THD thd);
/**
Return error number
@param thd user thread connection handle
@return error number
*/
unsigned int thd_get_error_number(const MYSQL_THD thd);
/**
Return the current row number (i.e. in a multiple INSERT statement)
@param thd user thread connection handle
@return row number
*/
unsigned long thd_get_error_row(const MYSQL_THD thd);
/**
Increment the current row number
@param thd user thread connection handle
*/
void thd_inc_error_row(MYSQL_THD thd);
/**
Return a text description of a thread, its security context (user,host)
and the current query.
*/
char *thd_get_error_context_description(MYSQL_THD thd,
char *buffer, unsigned int length,
unsigned int max_query_length);
#endif
#ifdef __cplusplus
}
#endif
#define MYSQL_SERVICE_THD_STMT_DA_INCLUDED
#endif
......@@ -28,6 +28,8 @@ extern "C" {
#include <mysql/service_thd_timezone.h>
#include <mysql/service_sha1.h>
#include <mysql/service_logger.h>
#include <mysql/service_thd_autoinc.h>
#include <mysql/service_thd_error_context.h>
#ifdef __cplusplus
}
......
......@@ -265,11 +265,11 @@ enum enum_server_command
CLIENT_REMEMBER_OPTIONS | \
CLIENT_PROGRESS | \
CLIENT_PLUGIN_AUTH | \
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
CLIENT_CONNECT_ATTRS)
/*
To be added later:
CLIENT_CONNECT_ATTRS, CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA,
CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS
*/
......@@ -641,7 +641,9 @@ void my_thread_end(void);
#ifdef MY_GLOBAL_INCLUDED
ulong STDCALL net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet);
my_ulonglong safe_net_field_length_ll(uchar **packet, size_t packet_len);
uchar *net_store_length(uchar *pkg, ulonglong length);
uchar *safe_net_store_length(uchar *pkg, size_t pkg_len, ulonglong length);
#endif
#ifdef __cplusplus
......
......@@ -24,8 +24,6 @@ void my_make_scrambled_password_323(char *to, const char *password,
size_t pass_len);
void my_make_scrambled_password(char *to, const char *password,
size_t pass_len);
void my_make_scrambled_password_sha1(char *to, const char *password,
size_t pass_len);
void hash_password(ulong *result, const char *password, uint password_len);
......
......@@ -7,120 +7,123 @@
#ifdef __cplusplus
extern "C" {
#define MYSQL_DTRACE_DISABLED false
#else
#define MYSQL_DTRACE_DISABLED 0
#endif
#define MYSQL_CONNECTION_START(arg0, arg1, arg2)
#define MYSQL_CONNECTION_START_ENABLED() (0)
#define MYSQL_CONNECTION_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_CONNECTION_DONE(arg0, arg1)
#define MYSQL_CONNECTION_DONE_ENABLED() (0)
#define MYSQL_CONNECTION_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_COMMAND_START(arg0, arg1, arg2, arg3)
#define MYSQL_COMMAND_START_ENABLED() (0)
#define MYSQL_COMMAND_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_COMMAND_DONE(arg0)
#define MYSQL_COMMAND_DONE_ENABLED() (0)
#define MYSQL_COMMAND_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4)
#define MYSQL_QUERY_START_ENABLED() (0)
#define MYSQL_QUERY_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_DONE(arg0)
#define MYSQL_QUERY_DONE_ENABLED() (0)
#define MYSQL_QUERY_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_PARSE_START(arg0)
#define MYSQL_QUERY_PARSE_START_ENABLED() (0)
#define MYSQL_QUERY_PARSE_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_PARSE_DONE(arg0)
#define MYSQL_QUERY_PARSE_DONE_ENABLED() (0)
#define MYSQL_QUERY_PARSE_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_CACHE_HIT(arg0, arg1)
#define MYSQL_QUERY_CACHE_HIT_ENABLED() (0)
#define MYSQL_QUERY_CACHE_HIT_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_CACHE_MISS(arg0)
#define MYSQL_QUERY_CACHE_MISS_ENABLED() (0)
#define MYSQL_QUERY_CACHE_MISS_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5)
#define MYSQL_QUERY_EXEC_START_ENABLED() (0)
#define MYSQL_QUERY_EXEC_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_QUERY_EXEC_DONE(arg0)
#define MYSQL_QUERY_EXEC_DONE_ENABLED() (0)
#define MYSQL_QUERY_EXEC_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INSERT_ROW_START(arg0, arg1)
#define MYSQL_INSERT_ROW_START_ENABLED() (0)
#define MYSQL_INSERT_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INSERT_ROW_DONE(arg0)
#define MYSQL_INSERT_ROW_DONE_ENABLED() (0)
#define MYSQL_INSERT_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_UPDATE_ROW_START(arg0, arg1)
#define MYSQL_UPDATE_ROW_START_ENABLED() (0)
#define MYSQL_UPDATE_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_UPDATE_ROW_DONE(arg0)
#define MYSQL_UPDATE_ROW_DONE_ENABLED() (0)
#define MYSQL_UPDATE_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_DELETE_ROW_START(arg0, arg1)
#define MYSQL_DELETE_ROW_START_ENABLED() (0)
#define MYSQL_DELETE_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_DELETE_ROW_DONE(arg0)
#define MYSQL_DELETE_ROW_DONE_ENABLED() (0)
#define MYSQL_DELETE_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_READ_ROW_START(arg0, arg1, arg2)
#define MYSQL_READ_ROW_START_ENABLED() (0)
#define MYSQL_READ_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_READ_ROW_DONE(arg0)
#define MYSQL_READ_ROW_DONE_ENABLED() (0)
#define MYSQL_READ_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INDEX_READ_ROW_START(arg0, arg1)
#define MYSQL_INDEX_READ_ROW_START_ENABLED() (0)
#define MYSQL_INDEX_READ_ROW_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INDEX_READ_ROW_DONE(arg0)
#define MYSQL_INDEX_READ_ROW_DONE_ENABLED() (0)
#define MYSQL_INDEX_READ_ROW_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_HANDLER_RDLOCK_START(arg0, arg1)
#define MYSQL_HANDLER_RDLOCK_START_ENABLED() (0)
#define MYSQL_HANDLER_RDLOCK_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_HANDLER_WRLOCK_START(arg0, arg1)
#define MYSQL_HANDLER_WRLOCK_START_ENABLED() (0)
#define MYSQL_HANDLER_WRLOCK_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_HANDLER_UNLOCK_START(arg0, arg1)
#define MYSQL_HANDLER_UNLOCK_START_ENABLED() (0)
#define MYSQL_HANDLER_UNLOCK_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_HANDLER_RDLOCK_DONE(arg0)
#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() (0)
#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_HANDLER_WRLOCK_DONE(arg0)
#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() (0)
#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_HANDLER_UNLOCK_DONE(arg0)
#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() (0)
#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_FILESORT_START(arg0, arg1)
#define MYSQL_FILESORT_START_ENABLED() (0)
#define MYSQL_FILESORT_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_FILESORT_DONE(arg0, arg1)
#define MYSQL_FILESORT_DONE_ENABLED() (0)
#define MYSQL_FILESORT_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_SELECT_START(arg0)
#define MYSQL_SELECT_START_ENABLED() (0)
#define MYSQL_SELECT_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_SELECT_DONE(arg0, arg1)
#define MYSQL_SELECT_DONE_ENABLED() (0)
#define MYSQL_SELECT_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INSERT_START(arg0)
#define MYSQL_INSERT_START_ENABLED() (0)
#define MYSQL_INSERT_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INSERT_DONE(arg0, arg1)
#define MYSQL_INSERT_DONE_ENABLED() (0)
#define MYSQL_INSERT_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INSERT_SELECT_START(arg0)
#define MYSQL_INSERT_SELECT_START_ENABLED() (0)
#define MYSQL_INSERT_SELECT_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_INSERT_SELECT_DONE(arg0, arg1)
#define MYSQL_INSERT_SELECT_DONE_ENABLED() (0)
#define MYSQL_INSERT_SELECT_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_UPDATE_START(arg0)
#define MYSQL_UPDATE_START_ENABLED() (0)
#define MYSQL_UPDATE_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_UPDATE_DONE(arg0, arg1, arg2)
#define MYSQL_UPDATE_DONE_ENABLED() (0)
#define MYSQL_UPDATE_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_MULTI_UPDATE_START(arg0)
#define MYSQL_MULTI_UPDATE_START_ENABLED() (0)
#define MYSQL_MULTI_UPDATE_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2)
#define MYSQL_MULTI_UPDATE_DONE_ENABLED() (0)
#define MYSQL_MULTI_UPDATE_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_DELETE_START(arg0)
#define MYSQL_DELETE_START_ENABLED() (0)
#define MYSQL_DELETE_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_DELETE_DONE(arg0, arg1)
#define MYSQL_DELETE_DONE_ENABLED() (0)
#define MYSQL_DELETE_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_MULTI_DELETE_START(arg0)
#define MYSQL_MULTI_DELETE_START_ENABLED() (0)
#define MYSQL_MULTI_DELETE_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_MULTI_DELETE_DONE(arg0, arg1)
#define MYSQL_MULTI_DELETE_DONE_ENABLED() (0)
#define MYSQL_MULTI_DELETE_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_NET_READ_START()
#define MYSQL_NET_READ_START_ENABLED() (0)
#define MYSQL_NET_READ_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_NET_READ_DONE(arg0, arg1)
#define MYSQL_NET_READ_DONE_ENABLED() (0)
#define MYSQL_NET_READ_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_NET_WRITE_START(arg0)
#define MYSQL_NET_WRITE_START_ENABLED() (0)
#define MYSQL_NET_WRITE_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_NET_WRITE_DONE(arg0)
#define MYSQL_NET_WRITE_DONE_ENABLED() (0)
#define MYSQL_NET_WRITE_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_READ_START(arg0, arg1, arg2, arg3)
#define MYSQL_KEYCACHE_READ_START_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_READ_BLOCK(arg0)
#define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_READ_HIT()
#define MYSQL_KEYCACHE_READ_HIT_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_HIT_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_READ_MISS()
#define MYSQL_KEYCACHE_READ_MISS_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_MISS_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_READ_DONE(arg0, arg1)
#define MYSQL_KEYCACHE_READ_DONE_ENABLED() (0)
#define MYSQL_KEYCACHE_READ_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_WRITE_START(arg0, arg1, arg2, arg3)
#define MYSQL_KEYCACHE_WRITE_START_ENABLED() (0)
#define MYSQL_KEYCACHE_WRITE_START_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_WRITE_BLOCK(arg0)
#define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() (0)
#define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() MYSQL_DTRACE_DISABLED
#define MYSQL_KEYCACHE_WRITE_DONE(arg0, arg1)
#define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() (0)
#define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() MYSQL_DTRACE_DISABLED
#ifdef __cplusplus
}
......
......@@ -30,4 +30,5 @@
#define VERSION_thd_timezone 0x0100
#define VERSION_my_sha1 0x0100
#define VERSION_logger 0x0100
#define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100
......@@ -35,7 +35,6 @@ struct st_mysql_options_extention {
char *default_auth;
char *ssl_crl; /* PEM CRL file */
char *ssl_crlpath; /* PEM directory of CRL-s? */
char *server_public_key_path;
void (*report_progress)(const MYSQL *mysql,
unsigned int stage,
unsigned int max_stage,
......
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Common defines and includes
IF(WITH_INNODB_MEMCACHED AND UNIX)
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
INCLUDE_DIRECTORIES(${LIBEVENT_INCLUDE_DIR}/compat/sys
${LIBEVENT_INCLUDE_DIR})
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_SHARED_LIBRARY_C_FLAGS} -I${LIBEVENT_INCLUDE_DIR}")
SET(LIBEVENT_CORE_SOURCES
event.h
event-internal.h
evutil.h
log.h
event.c
buffer.c
evbuffer.c
log.c
evutil.c)
SET(LIBEVENT_EXTRA_SOURCES
event_tagging.c
http.c
evhttp.h
http-internal.h
evdns.h
evrpc.c
evrpc.h
evrpc-internal.h
strlcpy.c
strlcpy-internal.h)
IF(HAVE_SIGNAL_H)
SET(LIBEVENT_SIGNAL_SOURCES signal.c)
ENDIF()
IF(HAVE_POLL_H)
SET(LIBEVENT_POLL_SOURCES poll.c)
ENDIF()
IF(HAVE_SELECT)
SET(LIBEVENT_SELECT_SOURCE select.c)
ENDIF()
IF(HAVE_SYS_EPOLL_H)
SET(LIBEVENT_EPOLL_SOURCES epoll.c epoll_sub.c)
ENDIF()
IF(HAVE_SYS_DEVPOLL_H)
SET(LIBEVENT_DEVPOLL_SOURCES devpoll.c)
ENDIF()
IF(HAVE_EVENT_PORTS)
SET(LIBEVENT_EVPORT_SOURCES evport.c)
ENDIF()
IF(HAVE_WORKING_KQUEUE)
SET(LIBEVENT_KQUEUE_SOURCES kqueue.c)
ENDIF()
ADD_LIBRARY(event_share SHARED ${LIBEVENT_CORE_SOURCES} ${LIBEVENT_EXTRA_SOURCES} ${LIBEVENT_SIGNAL_SOURCES} ${LIBEVENT_POLL_SOURCES} ${LIBEVENT_SELECT_SOURCE} ${LIBEVENT_EPOLL_SOURCES} ${LIBEVENT_DEVPOLL_SOURCES} ${LIBEVENT_EVPORT_SOURCES} ${LIBEVENT_KQUEUE_SOURCES})
ADD_LIBRARY(event STATIC ${LIBEVENT_CORE_SOURCES} ${LIBEVENT_EXTRA_SOURCES} ${LIBEVENT_SIGNAL_SOURCES} ${LIBEVENT_POLL_SOURCES} ${LIBEVENT_SELECT_SOURCE} ${LIBEVENT_EPOLL_SOURCES} ${LIBEVENT_DEVPOLL_SOURCES} ${LIBEVENT_EVPORT_SOURCES} ${LIBEVENT_KQUEUE_SOURCES})
ENDIF()
This diff is collapsed.
# Doxyfile 1.5.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = libevent
# Place all output under 'doxygen/'
OUTPUT_DIRECTORY = doxygen/
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explicit @brief command for a brief description.
JAVADOC_AUTOBRIEF = YES
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
# brief documentation of file, namespace and class members alphabetically
# by member name. If set to NO (the default) the members will appear in
# declaration order.
SORT_BRIEF_DOCS = YES
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = event.h evdns.h evhttp.h evrpc.h
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = YES
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = NO
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = YES
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = YES
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. To prevent a macro definition from being
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = TAILQ_ENTRY RB_ENTRY _EVENT_DEFINED_TQENTRY
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
# on a line, have an all uppercase name, and do not end with a semicolon. Such
# function macros are typically used for boiler-plate code, and will confuse
# the parser if not removed.
SKIP_FUNCTION_MACROS = YES
AUTOMAKE_OPTIONS = foreign no-dependencies
# This is the point release for libevent. It shouldn't include any
# a/b/c/d/e notations.
RELEASE = 1.4
# This is the version info for the libevent binary API. It has three
# numbers:
# Current -- the number of the binary API that we're implementing
# Revision -- which iteration of the implementation of the binary
# API are we supplying?
# Age -- How many previous binary API versions do we also
# support?
#
# If we release a new version that does not change the binary API,
# increment Revision.
#
# If we release a new version that changes the binary API, but does
# not break programs compiled against the old binary API, increment
# Current and Age. Set Revision to 0, since this is the first
# implementation of the new API.
#
# Otherwise, we're changing the binary API and breaking bakward
# compatibility with old binaries. Increment Current. Set Age to 0,
# since we're backward compatible with no previous APIs. Set Revision
# to 0 too.
# History:
# Libevent 1.4.1 was 2:0:0
# Libevent 1.4.2 should be 3:0:0
# Libevent 1.4.5 is 3:0:1 (we forgot to increment in the past)
VERSION_INFO = 3:3:1
bin_SCRIPTS = event_rpcgen.py
EXTRA_DIST = autogen.sh event.h event-internal.h log.h evsignal.h evdns.3 \
evrpc.h evrpc-internal.h min_heap.h \
event.3 \
Doxyfile \
kqueue.c epoll_sub.c epoll.c select.c poll.c signal.c \
evport.c devpoll.c event_rpcgen.py \
sample/Makefile.am sample/Makefile.in sample/event-test.c \
sample/signal-test.c sample/time-test.c \
test/Makefile.am test/Makefile.in test/bench.c test/regress.c \
test/test-eof.c test/test-weof.c test/test-time.c \
test/test-init.c test/test.sh \
compat/sys/queue.h compat/sys/_time.h \
WIN32-Code/config.h \
WIN32-Code/event-config.h \
WIN32-Code/win32.c \
WIN32-Code/tree.h \
WIN32-Prj/event_test/event_test.dsp \
WIN32-Prj/event_test/test.txt WIN32-Prj/libevent.dsp \
WIN32-Prj/libevent.dsw WIN32-Prj/signal_test/signal_test.dsp \
WIN32-Prj/time_test/time_test.dsp WIN32-Prj/regress/regress.vcproj \
WIN32-Prj/libevent.sln WIN32-Prj/libevent.vcproj
lib_LTLIBRARIES = libevent.la libevent_core.la libevent_extra.la
if BUILD_WIN32
SUBDIRS = . sample
SYS_LIBS = -lws2_32
SYS_SRC = WIN32-Code/win32.c
SYS_INCLUDES = -IWIN32-Code
else
SUBDIRS = . sample test
SYS_LIBS =
SYS_SRC =
SYS_INCLUDES =
endif
BUILT_SOURCES = event-config.h
event-config.h: config.h
echo '/* event-config.h' > $@
echo ' * Generated by autoconf; post-processed by libevent.' >> $@
echo ' * Do not edit this file.' >> $@
echo ' * Do not rely on macros in this file existing in later versions.'>> $@
echo ' */' >> $@
echo '#ifndef _EVENT_CONFIG_H_' >> $@
echo '#define _EVENT_CONFIG_H_' >> $@
sed -e 's/#define /#define _EVENT_/' \
-e 's/#undef /#undef _EVENT_/' \
-e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
echo "#endif" >> $@
CORE_SRC = event.c buffer.c evbuffer.c log.c evutil.c $(SYS_SRC)
EXTRA_SRC = event_tagging.c http.c evhttp.h http-internal.h evdns.c \
evdns.h evrpc.c evrpc.h evrpc-internal.h \
strlcpy.c strlcpy-internal.h strlcpy-internal.h
libevent_la_SOURCES = $(CORE_SRC) $(EXTRA_SRC)
libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_la_LDFLAGS = -release $(RELEASE) -version-info $(VERSION_INFO)
libevent_core_la_SOURCES = $(CORE_SRC)
libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_core_la_LDFLAGS = -release $(RELEASE) -version-info $(VERSION_INFO)
libevent_extra_la_SOURCES = $(EXTRA_SRC)
libevent_extra_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
libevent_extra_la_LDFLAGS = -release $(RELEASE) -version-info $(VERSION_INFO)
include_HEADERS = event.h evhttp.h evdns.h evrpc.h evutil.h
nodist_include_HEADERS = event-config.h
INCLUDES = -I$(srcdir)/compat $(SYS_INCLUDES)
man_MANS = event.3 evdns.3
verify: libevent.la
cd test && make verify
doxygen: FORCE
doxygen $(srcdir)/Doxyfile
FORCE:
DISTCLEANFILES = *~ event-config.h
To build libevent, type
$ ./configure && make
(If you got libevent from the subversion repository, you will
first need to run the included "autogen.sh" script in order to
generate the configure script.)
Install as root via
# make install
You can run the regression tests by
$ make verify
Before, reporting any problems, please run the regression tests.
To enable the low-level tracing build the library as:
CFLAGS=-DUSE_DEBUG ./configure [...]
Acknowledgements:
-----------------
The following people have helped with suggestions, ideas, code or
fixing bugs:
Alejo
Weston Andros Adamson
William Ahern
Stas Bekman
Andrew Danforth
Mike Davis
Shie Erlich
Alexander von Gernler
Artur Grabowski
Aaron Hopkins
Claudio Jeker
Scott Lamb
Adam Langley
Philip Lewis
David Libenzi
Nick Mathewson
Andrey Matveev
Richard Nyberg
Jon Oberheide
Phil Oleson
Dave Pacheco
Tassilo von Parseval
Pierre Phaneuf
Jon Poland
Bert JW Regeer
Dug Song
Taral
If I have forgotten your name, please contact me.
/* event-config.h
* Generated by autoconf; post-processed by libevent.
* Do not edit this file.
* Do not rely on macros in this file existing in later versions.
*/
#ifndef _EVENT_CONFIG_H_
#define _EVENT_CONFIG_H_
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define if clock_gettime is available in libc */
/* #undef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID */
/* Define is no secure id variant is available */
#define _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID 1
/* Define to 1 if you have the `clock_gettime' function. */
/* #undef _EVENT_HAVE_CLOCK_GETTIME */
/* Define if /dev/poll is available */
/* #undef _EVENT_HAVE_DEVPOLL */
/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef _EVENT_HAVE_DLFCN_H */
/* Define if your system supports the epoll system calls */
/* #undef _EVENT_HAVE_EPOLL */
/* Define to 1 if you have the `epoll_ctl' function. */
/* #undef _EVENT_HAVE_EPOLL_CTL */
/* Define if your system supports event ports */
/* #undef _EVENT_HAVE_EVENT_PORTS */
/* Define to 1 if you have the `fcntl' function. */
/* #undef _EVENT_HAVE_FCNTL */
/* Define to 1 if you have the <fcntl.h> header file. */
#define _EVENT_HAVE_FCNTL_H 1
/* Define to 1 if you have the `getaddrinfo' function. */
/* #undef _EVENT_HAVE_GETADDRINFO */
/* Define to 1 if you have the `getnameinfo' function. */
/* #undef _EVENT_HAVE_GETNAMEINFO */
/* Define to 1 if you have the `gettimeofday' function. */
/* #define _EVENT_HAVE_GETTIMEOFDAY 1 */
/* Define to 1 if you have the `inet_ntop' function. */
/* #undef _EVENT_HAVE_INET_NTOP */
/* Define to 1 if you have the <inttypes.h> header file. */
/* #undef _EVENT_HAVE_INTTYPES_H 1 */
/* Define to 1 if you have the `kqueue' function. */
/* #undef _EVENT_HAVE_KQUEUE */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef _EVENT_HAVE_LIBNSL */
/* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef _EVENT_HAVE_LIBRESOLV */
/* Define to 1 if you have the `rt' library (-lrt). */
/* #undef _EVENT_HAVE_LIBRT */
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef _EVENT_HAVE_LIBSOCKET */
/* Define to 1 if you have the <memory.h> header file. */
#define _EVENT_HAVE_MEMORY_H 1
/* Define to 1 if you have the <netinet/in6.h> header file. */
/* #undef _EVENT_HAVE_NETINET_IN6_H */
/* Define to 1 if you have the `poll' function. */
/* #undef _EVENT_HAVE_POLL */
/* Define to 1 if you have the <poll.h> header file. */
/* #undef _EVENT_HAVE_POLL_H */
/* Define to 1 if you have the `port_create' function. */
/* #undef _EVENT_HAVE_PORT_CREATE */
/* Define to 1 if you have the <port.h> header file. */
/* #undef _EVENT_HAVE_PORT_H */
/* Define to 1 if you have the `select' function. */
/* #undef _EVENT_HAVE_SELECT */
/* Define if F_SETFD is defined in <fcntl.h> */
/* #undef _EVENT_HAVE_SETFD */
/* Define to 1 if you have the `sigaction' function. */
/* #undef _EVENT_HAVE_SIGACTION */
/* Define to 1 if you have the `signal' function. */
#define _EVENT_HAVE_SIGNAL 1
/* Define to 1 if you have the <signal.h> header file. */
#define _EVENT_HAVE_SIGNAL_H 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define _EVENT_HAVE_STDARG_H 1
/* Define to 1 if you have the <stdint.h> header file. */
/* #define _EVENT_HAVE_STDINT_H 1 */
/* Define to 1 if you have the <stdlib.h> header file. */
#define _EVENT_HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define _EVENT_HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define _EVENT_HAVE_STRING_H 1
/* Define to 1 if you have the `strlcpy' function. */
/* #undef _EVENT_HAVE_STRLCPY */
/* Define to 1 if you have the `strsep' function. */
/* #undef _EVENT_HAVE_STRSEP */
/* Define to 1 if you have the `strtok_r' function. */
/* #undef _EVENT_HAVE_STRTOK_R */
/* Define to 1 if the system has the type `struct in6_addr'. */
#define _EVENT_HAVE_STRUCT_IN6_ADDR 1
/* Define to 1 if you have the <sys/devpoll.h> header file. */
/* #undef _EVENT_HAVE_SYS_DEVPOLL_H */
/* Define to 1 if you have the <sys/epoll.h> header file. */
/* #undef _EVENT_HAVE_SYS_EPOLL_H */
/* Define to 1 if you have the <sys/event.h> header file. */
/* #undef _EVENT_HAVE_SYS_EVENT_H */
/* Define to 1 if you have the <sys/ioctl.h> header file. */
/* #undef _EVENT_HAVE_SYS_IOCTL_H */
/* Define to 1 if you have the <sys/queue.h> header file. */
/* #undef _EVENT_HAVE_SYS_QUEUE_H */
/* Define to 1 if you have the <sys/select.h> header file. */
/* #undef _EVENT_HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
/* #undef _EVENT_HAVE_SYS_SOCKET_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define _EVENT_HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
/* #define _EVENT_HAVE_SYS_TIME_H 1 */
/* Define to 1 if you have the <sys/types.h> header file. */
/* #define _EVENT_HAVE_SYS_TYPES_H 1 */
/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
/* #undef _EVENT_HAVE_TAILQFOREACH */
/* Define if timeradd is defined in <sys/time.h> */
/* #undef _EVENT_HAVE_TIMERADD */
/* Define if timerclear is defined in <sys/time.h> */
/* #define _EVENT_HAVE_TIMERCLEAR 1 */
/* Define if timercmp is defined in <sys/time.h> */
#define _EVENT_HAVE_TIMERCMP 1
/* Define if timerisset is defined in <sys/time.h> */
#define _EVENT_HAVE_TIMERISSET 1
/* Define to 1 if you have the <unistd.h> header file. */
/* #define _EVENT_HAVE_UNISTD_H 1 */
/* Define to 1 if you have the `vasprintf' function. */
/* #undef _EVENT_HAVE_VASPRINTF */
/* Define if kqueue works correctly with pipes */
/* #undef _EVENT_HAVE_WORKING_KQUEUE */
/* Name of package */
#define _EVENT_PACKAGE "libevent"
/* Define to the address where bug reports for this package should be sent. */
#define _EVENT_PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define _EVENT_PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define _EVENT_PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define _EVENT_PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define _EVENT_PACKAGE_VERSION ""
/* Define to 1 if you have the ANSI C header files. */
#define _EVENT_STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define _EVENT_TIME_WITH_SYS_TIME 1
/* Version number of package */
#define _EVENT_VERSION "1.3.99-trunk"
/* Define to appropriate substitue if compiler doesnt have __func__ */
/* #undef _EVENT___func__ */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef _EVENT_const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef _EVENT___cplusplus
#define _EVENT_inline __inline
#endif
/* Define to `int' if <sys/types.h> does not define. */
/* #undef _EVENT_pid_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef _EVENT_size_t */
/* Define to unsigned int if you dont have it */
#define _EVENT_socklen_t unsigned int
/* Define to `unsigned short' if <sys/types.h> does not define. */
/* #undef _EVENT_uint16_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef _EVENT_uint32_t */
/* Define to `unsigned long long' if <sys/types.h> does not define. */
/* #undef _EVENT_uint64_t */
/* Define to `unsigned char' if <sys/types.h> does not define. */
/* #undef _EVENT_uint8_t */
#endif
#include <stdio.h>
#include <string.h>
#include <windows.h>
#include <sys/timeb.h>
#include <time.h>
#ifdef __GNUC__
/*our prototypes for timeval and timezone are in here, just in case the above
headers don't have them*/
#include "misc.h"
#endif
/****************************************************************************
*
* Function: gettimeofday(struct timeval *, struct timezone *)
*
* Purpose: Get current time of day.
*
* Arguments: tv => Place to store the curent time of day.
* tz => Ignored.
*
* Returns: 0 => Success.
*
****************************************************************************/
#ifndef HAVE_GETTIMEOFDAY
int gettimeofday(struct timeval *tv, struct timezone *tz) {
struct _timeb tb;
if(tv == NULL)
return -1;
_ftime(&tb);
tv->tv_sec = (long) tb.time;
tv->tv_usec = ((int) tb.millitm) * 1000;
return 0;
}
#endif
#if 0
int
win_read(int fd, void *buf, unsigned int length)
{
DWORD dwBytesRead;
int res = ReadFile((HANDLE) fd, buf, length, &dwBytesRead, NULL);
if (res == 0) {
DWORD error = GetLastError();
if (error == ERROR_NO_DATA)
return (0);
return (-1);
} else
return (dwBytesRead);
}
int
win_write(int fd, void *buf, unsigned int length)
{
DWORD dwBytesWritten;
int res = WriteFile((HANDLE) fd, buf, length, &dwBytesWritten, NULL);
if (res == 0) {
DWORD error = GetLastError();
if (error == ERROR_NO_DATA)
return (0);
return (-1);
} else
return (dwBytesWritten);
}
int
socketpair(int d, int type, int protocol, int *sv)
{
static int count;
char buf[64];
HANDLE fd;
DWORD dwMode;
sprintf(buf, "\\\\.\\pipe\\levent-%d", count++);
/* Create a duplex pipe which will behave like a socket pair */
fd = CreateNamedPipe(buf, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_NOWAIT,
PIPE_UNLIMITED_INSTANCES, 4096, 4096, 0, NULL);
if (fd == INVALID_HANDLE_VALUE)
return (-1);
sv[0] = (int)fd;
fd = CreateFile(buf, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (fd == INVALID_HANDLE_VALUE)
return (-1);
dwMode = PIPE_NOWAIT;
SetNamedPipeHandleState(fd, &dwMode, NULL, NULL);
sv[1] = (int)fd;
return (0);
}
#endif
#ifndef MISC_H
#define MISC_H
struct timezone;
struct timeval;
#ifndef HAVE_GETTIMEOFDAY
int gettimeofday(struct timeval *,struct timezone *);
#endif
#endif
This diff is collapsed.
This diff is collapsed.
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "event_test"=".\event_test\event_test.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libevent
End Project Dependency
}}}
###############################################################################
Project: "libevent"=".\libevent.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "signal_test"=".\signal_test\signal_test.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libevent
End Project Dependency
}}}
###############################################################################
Project: "time_test"=".\time_test\time_test.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libevent
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "event_test", "event_test\event_test.vcproj", "{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "libevent.vcproj", "{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_test", "signal_test\signal_test.vcproj", "{768DB9DD-2694-4274-89B8-74106E8F7786}"
ProjectSection(ProjectDependencies) = postProject
{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "time_test", "time_test\time_test.vcproj", "{D4BE29FB-E45C-4177-9647-74BBAFDC1257}"
ProjectSection(ProjectDependencies) = postProject
{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regress", "regress\regress.vcproj", "{F7C26008-6066-4AD3-8543-452EFE58BD2E}"
ProjectSection(ProjectDependencies) = postProject
{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.ActiveCfg = Debug|Win32
{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.Build.0 = Debug|Win32
{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.ActiveCfg = Release|Win32
{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.Build.0 = Release|Win32
{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.ActiveCfg = Debug|Win32
{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.Build.0 = Debug|Win32
{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.ActiveCfg = Release|Win32
{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.Build.0 = Release|Win32
{768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.ActiveCfg = Debug|Win32
{768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.Build.0 = Debug|Win32
{768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.ActiveCfg = Release|Win32
{768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.Build.0 = Release|Win32
{D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.ActiveCfg = Debug|Win32
{D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.Build.0 = Debug|Win32
{D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.ActiveCfg = Release|Win32
{D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.Build.0 = Release|Win32
{F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.ActiveCfg = Debug|Win32
{F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.Build.0 = Debug|Win32
{F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.ActiveCfg = Release|Win32
{F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
#!/bin/sh
LIBTOOLIZE=libtoolize
SYSNAME=`uname`
if [ "x$SYSNAME" = "xDarwin" ] ; then
LIBTOOLIZE=glibtoolize
fi
aclocal && \
autoheader && \
$LIBTOOLIZE && \
autoconf && \
automake --add-missing --copy
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright 2003 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdint.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <sys/epoll.h>
#include <unistd.h>
int
epoll_create(int size)
{
return (syscall(__NR_epoll_create, size));
}
int
epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
{
return (syscall(__NR_epoll_ctl, epfd, op, fd, event));
}
int
epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout)
{
return (syscall(__NR_epoll_wait, epfd, events, maxevents, timeout));
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _EVENT_INTERNAL_H_
#define _EVENT_INTERNAL_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "config.h"
#include "min_heap.h"
#include "evsignal.h"
struct eventop {
const char *name;
void *(*init)(struct event_base *);
int (*add)(void *, struct event *);
int (*del)(void *, struct event *);
int (*dispatch)(struct event_base *, void *, struct timeval *);
void (*dealloc)(struct event_base *, void *);
/* set if we need to reinitialize the event base */
int need_reinit;
};
struct event_base {
const struct eventop *evsel;
void *evbase;
int event_count; /* counts number of total events */
int event_count_active; /* counts number of active events */
int event_gotterm; /* Set to terminate loop */
int event_break; /* Set to terminate loop immediately */
/* active event management */
struct event_list **activequeues;
int nactivequeues;
/* signal handling info */
struct evsignal_info sig;
struct event_list eventqueue;
struct timeval event_tv;
struct min_heap timeheap;
struct timeval tv_cache;
};
/* Internal use only: Functions that might be missing from <sys/queue.h> */
#ifndef HAVE_TAILQFOREACH
#define TAILQ_FIRST(head) ((head)->tqh_first)
#define TAILQ_END(head) NULL
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
#define TAILQ_FOREACH(var, head, field) \
for((var) = TAILQ_FIRST(head); \
(var) != TAILQ_END(head); \
(var) = TAILQ_NEXT(var, field))
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
(elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
(elm)->field.tqe_next = (listelm); \
*(listelm)->field.tqe_prev = (elm); \
(listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
} while (0)
#define TAILQ_LAST(head, headname) \
(*(((struct headname *)((head)->tqh_last))->tqh_last))
#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
#endif /* TAILQ_FOREACH */
int _evsignal_set_handler(struct event_base *base, int evsignal,
void (*fn)(int));
int _evsignal_restore_handler(struct event_base *base, int evsignal);
#ifdef __cplusplus
}
#endif
#endif /* _EVENT_INTERNAL_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment