Skip to content
Browse files

rxvt now compiles succesfully , working on getting rxvt-js to run in…

… spidermonkey
  • Loading branch information...
1 parent 3a4d980 commit 279597cc0d27dcd041cf19d2b79324e84cc9a296 Patrick Mullen committed Aug 10, 2009
View
30 libev/CVS/Entries
@@ -1,30 +0,0 @@
-/Changes/1.94/Wed Dec 24 22:05:18 2008//
-/LICENSE/1.8/Sat May 17 12:15:30 2008//
-/Makefile.am/1.5/Fri Jan 25 15:45:08 2008//
-/README/1.20/Thu Apr 24 08:02:15 2008//
-/README.embed/1.29/Sat Nov 24 10:10:26 2007//
-/Symbols.ev/1.6/Mon Sep 8 17:24:39 2008//
-/Symbols.event/1.3/Fri May 23 16:43:45 2008//
-/autogen.sh/1.1/Fri Dec 14 21:07:13 2007//
-/configure.ac/1.20/Wed Dec 24 22:05:18 2008//
-/ev++.h/1.44/Wed Dec 3 15:23:44 2008//
-/ev.3/1.75/Wed Dec 24 22:05:18 2008//
-/ev.c/1.277/Sun Dec 14 21:58:08 2008//
-/ev.h/1.107/Wed Nov 5 02:48:45 2008//
-/ev.pod/1.223/Sun Dec 14 21:58:08 2008//
-/ev_epoll.c/1.43/Fri Nov 7 15:07:50 2008//
-/ev_kqueue.c/1.35/Wed Oct 29 06:32:48 2008//
-/ev_poll.c/1.27/Wed Oct 29 06:32:48 2008//
-/ev_port.c/1.13/Fri Nov 21 02:10:34 2008//
-/ev_select.c/1.38/Wed Oct 29 06:32:48 2008//
-/ev_vars.h/1.30/Mon Nov 3 14:27:06 2008//
-/ev_win32.c/1.6/Fri Jun 20 23:31:19 2008//
-/ev_wrap.h/1.20/Mon Nov 3 14:27:06 2008//
-/event.c/1.38/Mon Nov 17 03:37:08 2008//
-/event.h/1.19/Mon Nov 17 03:37:08 2008//
-/event_compat.h/1.7/Thu Jan 31 13:10:56 2008//
-/import_libevent/1.29/Tue Apr 15 04:34:07 2008//
-/libev.m4/1.11/Thu Nov 20 00:35:10 2008//
-/update_ev_wrap/1.4/Thu Dec 20 07:12:57 2007//
-/update_symbols/1.1/Wed Dec 19 01:59:29 2007//
-D
View
1 libev/CVS/Repository
@@ -1 +0,0 @@
-libev
View
1 libev/CVS/Root
@@ -1 +0,0 @@
-:pserver:anonymous@cvs.schmorp.de/schmorpforge
View
193 libev/Changes
@@ -1,193 +0,0 @@
-Revision history for libev, a high-performance and full-featured event loop.
-
-3.51 Wed Dec 24 23:00:11 CET 2008
- - fix a bug where an inotify watcher was added twice, causing
- freezes on hash collisions (reported and analysed by Graham Leggett).
- - new config symbol, EV_USE_CLOCK_SYSCALL, to make libev use
- a direct syscall - slower, but no dependency on librt et al.
- - assume negative return values != -1 signals success of port_getn
- (http://cvs.epicsol.org/cgi/viewcvs.cgi/epic5/source/newio.c?rev=1.52)
- (no known failure reports, but it doesn't hurt).
- - fork detection in ev_embed now stops and restarts the watcher
- automatically.
- - EXPERIMENTAL: default the method to operator () in ev++.h,
- to make it nicer to use functors (requested by Benedek László).
- - fixed const object callbacks in ev++.h.
- - replaced loop_ref argument of watcher.set (loop) by a direct
- ev_loop * in ev++.h, to avoid clashes with functor patch.
- - do not try to watch the empty string via inotify.
- - inotify watchers could be leaked under certain circumstances.
- - OS X 10.5 is actually even more broken than earlier versions,
- so fall back to select on that piece of garbage.
- - fixed some weirdness in the ev_embed documentation.
-
-3.49 Wed Nov 19 11:26:53 CET 2008
- - ev_stat watchers will now use inotify as a mere hint on
- kernels <2.6.25, or if the filesystem is not in the
- "known to be good" list.
- - better mingw32 compatibility (it's not as borked as native win32)
- (analysed by Roger Pack).
- - include stdio.h in the example program, as too many people are
- confused by the weird C language otherwise. I guess the next thing
- I get told is that the "..." ellipses in the examples don't compile
- with their C compiler.
-
-3.48 Thu Oct 30 09:02:37 CET 2008
- - further optimise away the EPOLL_CTL_ADD/MOD combo in the epoll
- backend by assuming the kernel event mask hasn't changed if
- ADD fails with EEXIST.
- - work around spurious event notification bugs in epoll by using
- a 32-bit generation counter. recreate kernel state if we receive
- spurious notifications or unwanted events. this is very costly,
- but I didn't come up with this horrible design.
- - use memset to initialise most arrays now and do away with the
- init functions.
- - expand time-out strategies into a "Be smart about timeouts" section.
- - drop the "struct" from all ev_watcher declarations in the
- documentation and did other clarifications (yeah, it was a mistake
- to have a struct AND a function called ev_loop).
- - fix a bug where ev_default would not initialise the default
- loop again after it was destroyed with ev_default_destroy.
- - rename syserr to ev_syserr to avoid name clashes when embedding,
- do similar changes for event.c.
-
-3.45 Tue Oct 21 21:59:26 CEST 2008
- - disable inotify usage on linux <2.6.25, as it is broken
- (reported by Yoann Vandoorselaere).
- - ev_stat errornously would try to add inotify watchers
- even when inotify wasn't available (this should only
- have a performance impact).
- - ev_once now passes both timeout and io to the callback if both
- occur concurrently, instead of giving timeouts precedence.
- - disable EV_USE_INOTIFY when sys/inotify.h is too old.
-
-3.44 Mon Sep 29 05:18:39 CEST 2008
- - embed watchers now automatically invoke ev_loop_fork on the
- embedded loop when the parent loop forks.
- - new function: ev_now_update (loop).
- - verify_watcher was not marked static.
- - improve the "associating..." manpage section.
- - documentation tweaks here and there.
-
-3.43 Sun Jul 6 05:34:41 CEST 2008
- - include more include files on windows to get struct _stati64
- (reported by Chris Hulbert, but doesn't quite fix his issue).
- - add missing #include <io.h> in ev.c on windows (reported by
- Matt Tolton).
-
-3.42 Tue Jun 17 12:12:07 CEST 2008
- - work around yet another windows bug: FD_SET actually adds fd's
- multiple times to the fd_*SET*, despite official MSN docs claiming
- otherwise. Reported and well-analysed by Matt Tolton.
- - define NFDBITS to 0 when EV_SELECT_IS_WINSOCKET to make it compile
- (reported any analysed by Chris Hulbert).
- - fix a bug in ev_ebadf (this function is only used to catch
- programming errors in the libev user). reported by Matt Tolton.
- - fix a bug in fd_intern on win32 (could lead to compile errors
- under some circumstances, but would work correctly if it compiles).
- reported by Matt Tolton.
- - (try to) work around missing lstat on windows.
- - pass in the write fd set as except fd set under windows. windows
- is so uncontrollably lame that it requires this. this means that
- switching off oobinline is not supported (but tcp/ip doesn't
- have oob, so that would be stupid anyways.
- - use posix module symbol to auto-detect monotonic clock presence
- and some other default values.
-
-3.41 Fri May 23 18:42:54 CEST 2008
- - work around an obscure bug in winsocket select: if you
- provide only empty fd sets then select returns WSAEINVAL. how sucky.
- - improve timer scheduling stability and reduce use of time_epsilon.
- - use 1-based 2-heap for EV_MINIMAL, simplifies code, reduces
- codesize and makes for better cache-efficiency.
- - use 3-based 4-heap for !EV_MINIMAL. this makes better use
- of cpu cache lines and gives better growth behaviour than
- 2-based heaps.
- - cache timestamp within heap for !EV_MINIMAL, to avoid random
- memory accesses.
- - document/add EV_USE_4HEAP and EV_HEAP_CACHE_AT.
- - fix a potential aliasing issue in ev_timer_again.
- - add/document ev_periodic_at, retract direct access to ->at.
- - improve ev_stat docs.
- - add portability requirements section.
- - fix manpage headers etc.
- - normalise WSA error codes to lower range on windows.
- - add consistency check code that can be called automatically
- or on demand to check for internal structures (ev_loop_verify).
-
-3.31 Wed Apr 16 20:45:04 CEST 2008
- - added last minute fix for ev_poll.c by Brandon Black.
-
-3.3 Wed Apr 16 19:04:10 CEST 2008
- - event_base_loopexit should return 0 on success
- (W.C.A. Wijngaards).
- - added linux eventfd support.
- - try to autodetect epoll and inotify support
- by libc header version if not using autoconf.
- - new symbols: EV_DEFAULT_UC and EV_DEFAULT_UC_.
- - declare functions defined in ev.h as inline if
- C99 or gcc are available.
- - enable inlining with gcc versions 2 and 3.
- - work around broken poll implementations potentially
- not clearing revents field in ev_poll (Brandon Black)
- (no such systems are known at this time).
- - work around a bug in realloc on openbsd and darwin,
- also makes the errornous valgrind complaints
- go away (noted by various people).
- - fix ev_async_pending, add c++ wrapper for ev_async
- (based on patch sent by Johannes Deisenhofer.
- - add sensible set method to ev::embed.
- - made integer constants type int in ev.h.
-
-3.2 Wed Apr 2 17:11:19 CEST 2008
- - fix a 64 bit overflow issue in the select backend,
- by using fd_mask instead of int for the mask.
- - rename internal sighandler to avoid clash with very old perls.
- - entering ev_loop will not clear the ONESHOT or NONBLOCKING
- flags of any outer loops anymore.
- - add ev_async_pending.
-
-3.1 Thu Mar 13 13:45:22 CET 2008
- - implement ev_async watchers.
- - only initialise signal pipe on demand.
- - make use of sig_atomic_t configurable.
- - improved documentation.
-
-3.0 Mon Jan 28 13:14:47 CET 2008
- - API/ABI bump to version 3.0.
- - ev++.h includes "ev.h" by default now, not <ev.h>.
- - slightly improved documentation.
- - speed up signal detection after a fork.
- - only optionally return trace status changed in ev_child
- watchers.
- - experimental (and undocumented) loop wrappers for ev++.h.
-
-2.01 Tue Dec 25 08:04:41 CET 2007
- - separate Changes file.
- - fix ev_path_set => ev_stat_set typo.
- - remove event_compat.h from the libev tarball.
- - change how include files are found.
- - doc updates.
- - update licenses, explicitly allow for GPL relicensing.
-
-2.0 Sat Dec 22 17:47:03 CET 2007
- - new ev_sleep, ev_set_(io|timeout)_collect_interval.
- - removed epoll from embeddable fd set.
- - fix embed watchers.
- - renamed ev_embed.loop to other.
- - added exported Symbol tables.
- - undefine member wrapper macros at the end of ev.c.
- - respect EV_H in ev++.h.
-
-1.86 Tue Dec 18 02:36:57 CET 2007
- - fix memleak on loop destroy (not relevant for perl).
-
-1.85 Fri Dec 14 20:32:40 CET 2007
- - fix some aliasing issues w.r.t. timers and periodics
- (not relevant for perl).
-
-(for historic versions refer to EV/Changes, found in the Perl interface)
-
-0.1 Wed Oct 31 21:31:48 CET 2007
- - original version; hacked together in <24h.
-
View
36 libev/LICENSE
@@ -1,36 +0,0 @@
-All files in libev are Copyright (C)2007,2008 Marc Alexander Lehmann.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * 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.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"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 COPYRIGHT
-OWNER OR CONTRIBUTORS 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.
-
-Alternatively, the contents of this package may be used under the terms
-of the GNU General Public License ("GPL") version 2 or any later version,
-in which case the provisions of the GPL are applicable instead of the
-above. If you wish to allow the use of your version of this package only
-under the terms of the GPL and not to allow others to use your version of
-this file under the BSD license, indicate your decision by deleting the
-provisions above and replace them with the notice and other provisions
-required by the GPL in this and the other files of this package. If you do
-not delete the provisions above, a recipient may use your version of this
-file under either the BSD or the GPL.
View
18 libev/Makefile.am
@@ -1,18 +0,0 @@
-AUTOMAKE_OPTIONS = foreign no-dependencies
-
-VERSION_INFO = 3:0
-
-EXTRA_DIST = LICENSE Changes libev.m4 autogen.sh \
- ev_vars.h ev_wrap.h \
- ev_epoll.c ev_select.c ev_poll.c ev_kqueue.c ev_port.c ev_win32.c \
- ev.3 ev.pod
-
-man_MANS = ev.3
-
-include_HEADERS = ev.h ev++.h event.h
-
-lib_LTLIBRARIES = libev.la
-
-libev_la_SOURCES = ev.c event.c
-libev_la_LDFLAGS = -version-info $(VERSION_INFO)
-
View
58 libev/README
@@ -1,58 +0,0 @@
-libev is a high-performance event loop/event model with lots of features.
-(see benchmark at http://libev.schmorp.de/bench.html)
-
-
-ABOUT
-
- Homepage: http://software.schmorp.de/pkg/libev
- Mailinglist: libev@lists.schmorp.de
- http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
- Library Documentation: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod
-
- Libev is modelled (very losely) after libevent and the Event perl
- module, but is faster, scales better and is more correct, and also more
- featureful. And also smaller. Yay.
-
- Some of the specialties of libev not commonly found elsewhere are:
-
- - extensive and detailed, readable documentation (not doxygen garbage).
- - fully supports fork, can detect fork in various ways and automatically
- re-arms kernel mechanisms that do not support fork.
- - highly optimised select, poll, epoll, kqueue and event ports backends.
- - filesystem object (path) watching (with optional linux inotify support).
- - wallclock-based times (using absolute time, cron-like).
- - relative timers/timeouts (handle time jumps).
- - fast intra-thread communication between multiple
- event loops (with optional fast linux eventfd backend).
- - extremely easy to embed.
- - very small codebase, no bloated library.
- - fully extensible by being able to plug into the event loop,
- integrate other event loops, integrate other event loop users.
- - very little memory use (small watchers, small event loop data).
- - optional C++ interface allowing method and function callbacks
- at no extra memory or runtime overhead.
- - optional Perl interface with similar characteristics (capable
- of running Glib/Gtk2 on libev, interfaces with Net::SNMP and
- libadns).
- - support for other languages (multiple C++ interfaces, D, Ruby,
- Python) available from third-parties.
-
- Examples of programs that embed libev: the EV perl module,
- rxvt-unicode, gvpe (GNU Virtual Private Ethernet), the Deliantra MMORPG
- server (http://www.deliantra.net/), Rubinius (a next-generation Ruby
- VM), the Ebb web server, the Rev event toolkit.
-
-
-CONTRIBUTORS
-
- libev was written and designed by Marc Lehmann and Emanuele Giaquinta.
-
- The following people sent in patches or made other noteworthy
- contributions to the design (for minor patches, see the Changes
- file. If I forgot to include you, please shout at me, it was an
- accident):
-
- W.C.A. Wijngaards
- Christopher Layne
- Chris Brody
-
View
3 libev/README.embed
@@ -1,3 +0,0 @@
-This file is now included in the main libev documentation, see
-
- http://cvs.schmorp.de/libev/ev.html
View
62 libev/Symbols.ev
@@ -1,62 +0,0 @@
-ev_async_send
-ev_async_start
-ev_async_stop
-ev_backend
-ev_check_start
-ev_check_stop
-ev_child_start
-ev_child_stop
-ev_clear_pending
-ev_default_destroy
-ev_default_fork
-ev_default_loop_init
-ev_default_loop_ptr
-ev_embed_start
-ev_embed_stop
-ev_embed_sweep
-ev_embeddable_backends
-ev_feed_event
-ev_feed_fd_event
-ev_feed_signal_event
-ev_fork_start
-ev_fork_stop
-ev_idle_start
-ev_idle_stop
-ev_invoke
-ev_io_start
-ev_io_stop
-ev_loop
-ev_loop_count
-ev_loop_destroy
-ev_loop_fork
-ev_loop_new
-ev_loop_verify
-ev_now
-ev_now_update
-ev_once
-ev_periodic_again
-ev_periodic_start
-ev_periodic_stop
-ev_prepare_start
-ev_prepare_stop
-ev_recommended_backends
-ev_ref
-ev_set_allocator
-ev_set_io_collect_interval
-ev_set_syserr_cb
-ev_set_timeout_collect_interval
-ev_signal_start
-ev_signal_stop
-ev_sleep
-ev_stat_start
-ev_stat_stat
-ev_stat_stop
-ev_supported_backends
-ev_time
-ev_timer_again
-ev_timer_start
-ev_timer_stop
-ev_unloop
-ev_unref
-ev_version_major
-ev_version_minor
View
21 libev/Symbols.event
@@ -1,21 +0,0 @@
-event_active
-event_add
-event_base_dispatch
-event_base_free
-event_base_loop
-event_base_loopexit
-event_base_once
-event_base_priority_init
-event_base_set
-event_del
-event_dispatch
-event_get_method
-event_get_version
-event_init
-event_loop
-event_loopexit
-event_once
-event_pending
-event_priority_init
-event_priority_set
-event_set
View
6 libev/autogen.sh
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-libtoolize --force
-automake --add-missing
-autoreconf
-
View
18 libev/configure.ac
@@ -1,18 +0,0 @@
-AC_INIT
-AC_CONFIG_SRCDIR([ev_epoll.c])
-
-AM_INIT_AUTOMAKE(libev,3.51)
-AC_CONFIG_HEADERS([config.h])
-AM_MAINTAINER_MODE
-
-AC_PROG_INSTALL
-AC_PROG_LIBTOOL
-
-if test "x$GCC" = xyes ; then
- CFLAGS="$CFLAGS -O3"
-fi
-
-m4_include([libev.m4])
-
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
View
124 libev/ev++.h
@@ -162,14 +162,24 @@ namespace ev {
}
#if EV_MULTIPLICITY
- bool operator == (const EV_P) const throw ()
+ bool operator == (struct ev_loop *other) const throw ()
{
- return this->EV_AX == EV_A;
+ return this->EV_AX == other;
}
- bool operator != (const EV_P) const throw ()
+ bool operator != (struct ev_loop *other) const throw ()
{
- return (*this == EV_A);
+ return ! (*this == other);
+ }
+
+ bool operator == (const struct ev_loop *other) const throw ()
+ {
+ return this->EV_AX == other;
+ }
+
+ bool operator != (const struct ev_loop *other) const throw ()
+ {
+ return (*this == other);
}
operator struct ev_loop * () const throw ()
@@ -243,7 +253,7 @@ namespace ev {
}
// function callback
- void once (int fd, int events, tstamp timeout, void (*cb)(int, void *), void *arg = 0) throw ()
+ void once (int fd, int events, tstamp timeout, void (*cb)(int, void *), void* arg = 0) throw ()
{
ev_once (EV_AX_ fd, events, timeout, cb, arg);
}
@@ -255,32 +265,39 @@ namespace ev {
once (fd, events, timeout, method_thunk<K, method>, object);
}
- // default method == operator ()
- template<class K>
- void once (int fd, int events, tstamp timeout, K *object) throw ()
+ template<class K, void (K::*method)(int)>
+ static void method_thunk (int revents, void* arg)
{
- once (fd, events, timeout, method_thunk<K, &K::operator ()>, object);
+ K *obj = static_cast<K *>(arg);
+ (obj->*method) (revents);
}
- template<class K, void (K::*method)(int)>
- static void method_thunk (int revents, void *arg)
+ // const method callback
+ template<class K, void (K::*method)(int) const>
+ void once (int fd, int events, tstamp timeout, const K *object) throw ()
{
- static_cast<K *>(arg)->*method
- (revents);
+ once (fd, events, timeout, const_method_thunk<K, method>, object);
}
- // no-argument method callback
+ template<class K, void (K::*method)(int) const>
+ static void const_method_thunk (int revents, void* arg)
+ {
+ K *obj = static_cast<K *>(arg);
+ (obj->*method) (revents);
+ }
+
+ // simple method callback
template<class K, void (K::*method)()>
void once (int fd, int events, tstamp timeout, K *object) throw ()
{
once (fd, events, timeout, method_noargs_thunk<K, method>, object);
}
template<class K, void (K::*method)()>
- static void method_noargs_thunk (int revents, void *arg)
+ static void method_noargs_thunk (int revents, void* arg)
{
- static_cast<K *>(arg)->*method
- ();
+ K *obj = static_cast<K *>(arg);
+ (obj->*method) ();
}
// simpler function callback
@@ -291,10 +308,9 @@ namespace ev {
}
template<void (*cb)(int)>
- static void simpler_func_thunk (int revents, void *arg)
+ static void simpler_func_thunk (int revents, void* arg)
{
- (*cb)
- (revents);
+ (*cb) (revents);
}
// simplest function callback
@@ -305,10 +321,9 @@ namespace ev {
}
template<void (*cb)()>
- static void simplest_func_thunk (int revents, void *arg)
+ static void simplest_func_thunk (int revents, void* arg)
{
- (*cb)
- ();
+ (*cb) ();
}
void feed_fd_event (int fd, int revents) throw ()
@@ -408,7 +423,7 @@ namespace ev {
#if EV_MULTIPLICITY
EV_PX;
- void set (EV_P) throw ()
+ void set (EV_PX) throw ()
{
this->EV_A = EV_A;
}
@@ -422,48 +437,54 @@ namespace ev {
ev_init (this, 0);
}
- void set_ (const void *data, void (*cb)(EV_P_ ev_watcher *w, int revents)) throw ()
+ void set_ (void *data, void (*cb)(EV_P_ ev_watcher *w, int revents)) throw ()
{
- this->data = (void *)data;
+ this->data = data;
ev_set_cb (static_cast<ev_watcher *>(this), cb);
}
- // function callback
- template<void (*function)(watcher &w, int)>
- void set (void *data = 0) throw ()
+ // method callback
+ template<class K, void (K::*method)(watcher &w, int)>
+ void set (K *object) throw ()
{
- set_ (data, function_thunk<function>);
+ set_ (object, method_thunk<K, method>);
}
- template<void (*function)(watcher &w, int)>
- static void function_thunk (EV_P_ ev_watcher *w, int revents)
+ template<class K, void (K::*method)(watcher &w, int)>
+ static void method_thunk (EV_P_ ev_watcher *w, int revents)
{
- function
- (*static_cast<watcher *>(w), revents);
+ K *obj = static_cast<K *>(w->data);
+ (obj->*method) (*static_cast<watcher *>(w), revents);
}
- // method callback
- template<class K, void (K::*method)(watcher &w, int)>
- void set (K *object) throw ()
+ // const method callback
+ template<class K, void (K::*method)(watcher &w, int) const>
+ void set (const K *object) throw ()
{
- set_ (object, method_thunk<K, method>);
+ set_ (object, const_method_thunk<K, method>);
}
- // default method == operator ()
- template<class K>
- void set (K *object) throw ()
+ template<class K, void (K::*method)(watcher &w, int) const>
+ static void const_method_thunk (EV_P_ ev_watcher *w, int revents)
{
- set_ (object, method_thunk<K, &K::operator ()>);
+ K *obj = static_cast<K *>(w->data);
+ (static_cast<K *>(w->data)->*method) (*static_cast<watcher *>(w), revents);
}
- template<class K, void (K::*method)(watcher &w, int)>
- static void method_thunk (EV_P_ ev_watcher *w, int revents)
+ // function callback
+ template<void (*function)(watcher &w, int)>
+ void set (void *data = 0) throw ()
+ {
+ set_ (data, function_thunk<function>);
+ }
+
+ template<void (*function)(watcher &w, int)>
+ static void function_thunk (EV_P_ ev_watcher *w, int revents)
{
- (static_cast<K *>(w->data)->*method)
- (*static_cast<watcher *>(w), revents);
+ function (*static_cast<watcher *>(w), revents);
}
- // no-argument callback
+ // simple callback
template<class K, void (K::*method)()>
void set (K *object) throw ()
{
@@ -473,15 +494,14 @@ namespace ev {
template<class K, void (K::*method)()>
static void method_noargs_thunk (EV_P_ ev_watcher *w, int revents)
{
- static_cast<K *>(w->data)->*method
- ();
+ K *obj = static_cast<K *>(w->data);
+ (obj->*method) ();
}
void operator ()(int events = EV_UNDEF)
{
- return
- ev_cb (static_cast<ev_watcher *>(this))
- (static_cast<ev_watcher *>(this), events);
+ return ev_cb (static_cast<ev_watcher *>(this))
+ (static_cast<ev_watcher *>(this), events);
}
bool is_active () const throw ()
View
4,019 libev/ev.3
0 additions, 4,019 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
46 libev/ev.c
@@ -49,18 +49,6 @@ extern "C" {
# include "config.h"
# endif
-# if HAVE_CLOCK_SYSCALL
-# ifndef EV_USE_CLOCK_SYSCALL
-# define EV_USE_CLOCK_SYSCALL 1
-# ifndef EV_USE_REALTIME
-# define EV_USE_REALTIME 0
-# endif
-# ifndef EV_USE_MONOTONIC
-# define EV_USE_MONOTONIC 1
-# endif
-# endif
-# endif
-
# if HAVE_CLOCK_GETTIME
# ifndef EV_USE_MONOTONIC
# define EV_USE_MONOTONIC 1
@@ -178,14 +166,6 @@ extern "C" {
/* this block tries to deduce configuration from header-defined symbols and defaults */
-#ifndef EV_USE_CLOCK_SYSCALL
-# if __linux && __GLIBC__ >= 2
-# define EV_USE_CLOCK_SYSCALL 1
-# else
-# define EV_USE_CLOCK_SYSCALL 0
-# endif
-#endif
-
#ifndef EV_USE_MONOTONIC
# if defined (_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
# define EV_USE_MONOTONIC 1
@@ -322,15 +302,6 @@ extern "C" {
# include <winsock.h>
#endif
-/* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */
-/* which makes programs even slower. might work on other unices, too. */
-#if EV_USE_CLOCK_SYSCALL
-# include <syscall.h>
-# define clock_gettime(id, ts) syscall (SYS_clock_gettime, (id), (ts))
-# undef EV_USE_MONOTONIC
-# define EV_USE_MONOTONIC 1
-#endif
-
#if EV_USE_EVENTFD
/* our minimum requirement is glibc 2.7 which has the stub, but not the header */
# include <stdint.h>
@@ -1272,8 +1243,8 @@ ev_recommended_backends (void)
flags &= ~EVBACKEND_KQUEUE;
#endif
#ifdef __APPLE__
- // flags &= ~EVBACKEND_KQUEUE & ~EVBACKEND_POLL; for documentation
- flags &= ~EVBACKEND_SELECT;
+ // flags &= ~EVBACKEND_KQUEUE; for documentation
+ flags &= ~EVBACKEND_POLL;
#endif
return flags;
@@ -2480,17 +2451,16 @@ infy_add (EV_P_ ev_stat *w)
char *pend = strrchr (path, '/');
- if (!pend || pend == path)
- break;
+ if (!pend)
+ break; /* whoops, no '/', complain to your admin */
*pend = 0;
w->wd = inotify_add_watch (fs_fd, path, mask);
}
while (w->wd < 0 && (errno == ENOENT || errno == EACCES));
}
}
-
- if (w->wd >= 0)
+ else
{
wlist_add (&fs_hash [w->wd & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w);
@@ -2550,7 +2520,6 @@ infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev)
{
if (ev->mask & (IN_IGNORED | IN_UNMOUNT | IN_DELETE_SELF))
{
- wlist_del (&fs_hash [slot & (EV_INOTIFY_HASHSIZE - 1)].head, (WL)w);
w->wd = -1;
infy_add (EV_A_ w); /* re-add, no matter what */
}
@@ -2907,16 +2876,11 @@ embed_fork_cb (EV_P_ ev_fork *fork_w, int revents)
{
ev_embed *w = (ev_embed *)(((char *)fork_w) - offsetof (ev_embed, fork));
- ev_embed_stop (EV_A_ w);
-
{
struct ev_loop *loop = w->other;
ev_loop_fork (EV_A);
- ev_loop (EV_A_ EVLOOP_NONBLOCK);
}
-
- ev_embed_start (EV_A_ w);
}
#if 0
View
3,941 libev/ev.pod
0 additions, 3,941 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
2 libev/ev_port.c
@@ -89,7 +89,7 @@ port_poll (EV_P_ ev_tstamp timeout)
ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9;
res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts);
- if (res == -1)
+ if (res < 0)
{
if (errno != EINTR && errno != ETIME)
ev_syserr ("(libev) port_getn");
View
399 libev/event.c
@@ -1,399 +0,0 @@
-/*
- * libevent compatibility layer
- *
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
- * CIAL, 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 OTH-
- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * the GNU General Public License ("GPL") version 2 or any later version,
- * in which case the provisions of the GPL are applicable instead of
- * the above. If you wish to allow the use of your version of this file
- * only under the terms of the GPL and not to allow others to use your
- * version of this file under the BSD license, indicate your decision
- * by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL. If you do not delete the
- * provisions above, a recipient may use your version of this file under
- * either the BSD or the GPL.
- */
-
-#include <stddef.h>
-#include <stdlib.h>
-#include <assert.h>
-
-#ifdef EV_EVENT_H
-# include EV_EVENT_H
-#else
-# include "event.h"
-#endif
-
-#if EV_MULTIPLICITY
-# define dLOOPev struct ev_loop *loop = (struct ev_loop *)ev->ev_base
-# define dLOOPbase struct ev_loop *loop = (struct ev_loop *)base
-#else
-# define dLOOPev
-# define dLOOPbase
-#endif
-
-/* never accessed, will always be cast from/to ev_loop */
-struct event_base
-{
- int dummy;
-};
-
-static struct event_base *ev_x_cur;
-
-static void
-ev_tv_set (struct timeval *tv, ev_tstamp at)
-{
- tv->tv_sec = (long)at;
- tv->tv_usec = (long)((at - (ev_tstamp)tv->tv_sec) * 1e6);
-}
-
-static ev_tstamp
-ev_tv_get (struct timeval *tv)
-{
- if (tv)
- return tv->tv_sec + tv->tv_usec * 1e-6;
- else
- return -1.;
-}
-
-#define EVENT_VERSION(a,b) # a "." # b
-
-const char *event_get_version (void)
-{
- return EVENT_VERSION (EV_VERSION_MAJOR, EV_VERSION_MINOR);
-}
-
-const char *event_get_method (void)
-{
- return "libev";
-}
-
-void *event_init (void)
-{
-#if EV_MULTIPLICITY
- if (ev_x_cur)
- ev_x_cur = (struct event_base *)ev_loop_new (EVFLAG_AUTO);
- else
- ev_x_cur = (struct event_base *)ev_default_loop (EVFLAG_AUTO);
-#else
- assert (("multiple event bases not supported when not compiled with EV_MULTIPLICITY", !ev_x_cur));
-
- ev_x_cur = (struct event_base *)(long)ev_default_loop (EVFLAG_AUTO);
-#endif
-
- return ev_x_cur;
-}
-
-void event_base_free (struct event_base *base)
-{
- dLOOPbase;
-
-#if EV_MULTIPLICITY
- if (ev_default_loop (EVFLAG_AUTO) != loop)
- ev_loop_destroy (loop);
-#endif
-}
-
-int event_dispatch (void)
-{
- return event_base_dispatch (ev_x_cur);
-}
-
-#ifdef EV_STANDALONE
-void event_set_log_callback (event_log_cb cb)
-{
- /* nop */
-}
-#endif
-
-int event_loop (int flags)
-{
- return event_base_loop (ev_x_cur, flags);
-}
-
-int event_loopexit (struct timeval *tv)
-{
- return event_base_loopexit (ev_x_cur, tv);
-}
-
-static void
-ev_x_cb (struct event *ev, int revents)
-{
- revents &= EV_READ | EV_WRITE | EV_TIMEOUT | EV_SIGNAL;
-
- ev->ev_res = revents;
- ev->ev_callback (ev->ev_fd, (short)revents, ev->ev_arg);
-}
-
-static void
-ev_x_cb_sig (EV_P_ struct ev_signal *w, int revents)
-{
- struct event *ev = (struct event *)(((char *)w) - offsetof (struct event, iosig.sig));
-
- if (revents & EV_ERROR)
- event_del (ev);
-
- ev_x_cb (ev, revents);
-}
-
-static void
-ev_x_cb_io (EV_P_ struct ev_io *w, int revents)
-{
- struct event *ev = (struct event *)(((char *)w) - offsetof (struct event, iosig.io));
-
- if ((revents & EV_ERROR) || !(ev->ev_events & EV_PERSIST))
- event_del (ev);
-
- ev_x_cb (ev, revents);
-}
-
-static void
-ev_x_cb_to (EV_P_ struct ev_timer *w, int revents)
-{
- struct event *ev = (struct event *)(((char *)w) - offsetof (struct event, to));
-
- event_del (ev);
-
- ev_x_cb (ev, revents);
-}
-
-void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg)
-{
- if (events & EV_SIGNAL)
- ev_init (&ev->iosig.sig, ev_x_cb_sig);
- else
- ev_init (&ev->iosig.io, ev_x_cb_io);
-
- ev_init (&ev->to, ev_x_cb_to);
-
- ev->ev_base = ev_x_cur; /* not threadsafe, but it's how libevent works */
- ev->ev_fd = fd;
- ev->ev_events = events;
- ev->ev_pri = 0;
- ev->ev_callback = cb;
- ev->ev_arg = arg;
- ev->ev_res = 0;
- ev->ev_flags = EVLIST_INIT;
-}
-
-int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv)
-{
- return event_base_once (ev_x_cur, fd, events, cb, arg, tv);
-}
-
-int event_add (struct event *ev, struct timeval *tv)
-{
- dLOOPev;
-
- if (ev->ev_events & EV_SIGNAL)
- {
- if (!ev_is_active (&ev->iosig.sig))
- {
- ev_signal_set (&ev->iosig.sig, ev->ev_fd);
- ev_signal_start (EV_A_ &ev->iosig.sig);
-
- ev->ev_flags |= EVLIST_SIGNAL;
- }
- }
- else if (ev->ev_events & (EV_READ | EV_WRITE))
- {
- if (!ev_is_active (&ev->iosig.io))
- {
- ev_io_set (&ev->iosig.io, ev->ev_fd, ev->ev_events & (EV_READ | EV_WRITE));
- ev_io_start (EV_A_ &ev->iosig.io);
-
- ev->ev_flags |= EVLIST_INSERTED;
- }
- }
-
- if (tv)
- {
- ev->to.repeat = ev_tv_get (tv);
- ev_timer_again (EV_A_ &ev->to);
- ev->ev_flags |= EVLIST_TIMEOUT;
- }
- else
- {
- ev_timer_stop (EV_A_ &ev->to);
- ev->ev_flags &= ~EVLIST_TIMEOUT;
- }
-
- ev->ev_flags |= EVLIST_ACTIVE;
-
- return 0;
-}
-
-int event_del (struct event *ev)
-{
- dLOOPev;
-
- if (ev->ev_events & EV_SIGNAL)
- ev_signal_stop (EV_A_ &ev->iosig.sig);
- else if (ev->ev_events & (EV_READ | EV_WRITE))
- ev_io_stop (EV_A_ &ev->iosig.io);
-
- if (ev_is_active (&ev->to))
- ev_timer_stop (EV_A_ &ev->to);
-
- ev->ev_flags = EVLIST_INIT;
-
- return 0;
-}
-
-void event_active (struct event *ev, int res, short ncalls)
-{
- dLOOPev;
-
- if (res & EV_TIMEOUT)
- ev_feed_event (EV_A_ &ev->to, res & EV_TIMEOUT);
-
- if (res & EV_SIGNAL)
- ev_feed_event (EV_A_ &ev->iosig.sig, res & EV_SIGNAL);
-
- if (res & (EV_READ | EV_WRITE))
- ev_feed_event (EV_A_ &ev->iosig.io, res & (EV_READ | EV_WRITE));
-}
-
-int event_pending (struct event *ev, short events, struct timeval *tv)
-{
- short revents = 0;
- dLOOPev;
-
- if (ev->ev_events & EV_SIGNAL)
- {
- /* sig */
- if (ev_is_active (&ev->iosig.sig) || ev_is_pending (&ev->iosig.sig))
- revents |= EV_SIGNAL;
- }
- else if (ev->ev_events & (EV_READ | EV_WRITE))
- {
- /* io */
- if (ev_is_active (&ev->iosig.io) || ev_is_pending (&ev->iosig.io))
- revents |= ev->ev_events & (EV_READ | EV_WRITE);
- }
-
- if (ev->ev_events & EV_TIMEOUT || ev_is_active (&ev->to) || ev_is_pending (&ev->to))
- {
- revents |= EV_TIMEOUT;
-
- if (tv)
- ev_tv_set (tv, ev_now (EV_A)); /* not sure if this is right :) */
- }
-
- return events & revents;
-}
-
-int event_priority_init (int npri)
-{
- return event_base_priority_init (ev_x_cur, npri);
-}
-
-int event_priority_set (struct event *ev, int pri)
-{
- ev->ev_pri = pri;
-
- return 0;
-}
-
-int event_base_set (struct event_base *base, struct event *ev)
-{
- ev->ev_base = base;
-
- return 0;
-}
-
-int event_base_loop (struct event_base *base, int flags)
-{
- dLOOPbase;
-
- ev_loop (EV_A_ flags);
-
- return 0;
-}
-
-int event_base_dispatch (struct event_base *base)
-{
- return event_base_loop (base, 0);
-}
-
-static void
-ev_x_loopexit_cb (int revents, void *base)
-{
- dLOOPbase;
-
- ev_unloop (EV_A_ EVUNLOOP_ONE);
-}
-
-int event_base_loopexit (struct event_base *base, struct timeval *tv)
-{
- ev_tstamp after = ev_tv_get (tv);
- dLOOPbase;
-
- ev_once (EV_A_ -1, 0, after >= 0. ? after : 0., ev_x_loopexit_cb, (void *)base);
-
- return 0;
-}
-
-struct ev_x_once
-{
- int fd;
- void (*cb)(int, short, void *);
- void *arg;
-};
-
-static void
-ev_x_once_cb (int revents, void *arg)
-{
- struct ev_x_once *once = (struct ev_x_once *)arg;
-
- once->cb (once->fd, (short)revents, once->arg);
- free (once);
-}
-
-int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv)
-{
- struct ev_x_once *once = (struct ev_x_once *)malloc (sizeof (struct ev_x_once));
- dLOOPbase;
-
- if (!once)
- return -1;
-
- once->fd = fd;
- once->cb = cb;
- once->arg = arg;
-
- ev_once (EV_A_ fd, events & (EV_READ | EV_WRITE), ev_tv_get (tv), ev_x_once_cb, (void *)once);
-
- return 0;
-}
-
-int event_base_priority_init (struct event_base *base, int npri)
-{
- /*dLOOPbase;*/
-
- return 0;
-}
-
View
158 libev/event.h
@@ -1,158 +0,0 @@
-/*
- * libevent compatibility header, only core events supported
- *
- * Copyright (c) 2007,2008 Marc Alexander Lehmann <libev@schmorp.de>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modifica-
- * tion, 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.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
- * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
- * CIAL, 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 OTH-
- * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Alternatively, the contents of this file may be used under the terms of
- * the GNU General Public License ("GPL") version 2 or any later version,
- * in which case the provisions of the GPL are applicable instead of
- * the above. If you wish to allow the use of your version of this file
- * only under the terms of the GPL and not to allow others to use your
- * version of this file under the BSD license, indicate your decision
- * by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL. If you do not delete the
- * provisions above, a recipient may use your version of this file under
- * either the BSD or the GPL.
- */
-
-#ifndef EVENT_H__
-#define EVENT_H__
-
-#ifdef EV_H
-# include EV_H
-#else
-# include "ev.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* we need sys/time.h for struct timeval only */
-#if !defined (WIN32) || defined (__MINGW32__)
-# include <time.h> /* mingw seems to need this, for whatever reason */
-# include <sys/time.h>
-#endif
-
-struct event_base;
-
-#define EVLIST_TIMEOUT 0x01
-#define EVLIST_INSERTED 0x02
-#define EVLIST_SIGNAL 0x04
-#define EVLIST_ACTIVE 0x08
-#define EVLIST_INTERNAL 0x10
-#define EVLIST_INIT 0x80
-
-struct event
-{
- /* libev watchers we map onto */
- union {
- struct ev_io io;
- struct ev_signal sig;
- } iosig;
- struct ev_timer to;
-
- /* compatibility slots */
- struct event_base *ev_base;
- void (*ev_callback)(int, short, void *arg);
- void *ev_arg;
- int ev_fd;
- int ev_pri;
- int ev_res;
- int ev_flags;
- short ev_events;
-};
-
-#define EV_PERSIST 0x10
-
-#define EVENT_SIGNAL(ev) ((int) (ev)->ev_fd)
-#define EVENT_FD(ev) ((int) (ev)->ev_fd)
-
-#define event_initialized(ev) ((ev)->ev_flags & EVLIST_INIT)
-
-#define evtimer_add(ev,tv) event_add (ev, tv)
-#define evtimer_set(ev,cb,data) event_set (ev, -1, 0, cb, data)
-#define evtimer_del(ev) event_del (ev)
-#define evtimer_pending(ev,tv) event_pending (ev, EV_TIMEOUT, tv)
-#define evtimer_initialized(ev) event_initialized (ev)
-
-#define timeout_add(ev,tv) evtimer_add (ev, tv)
-#define timeout_set(ev,cb,data) evtimer_set (ev, cb, data)
-#define timeout_del(ev) evtimer_del (ev)
-#define timeout_pending(ev,tv) evtimer_pending (ev, tv)
-#define timeout_initialized(ev) evtimer_initialized (ev)
-
-#define signal_add(ev,tv) event_add (ev, tv)
-#define signal_set(ev,sig,cb,data) event_set (ev, sig, EV_SIGNAL | EV_PERSIST, cb, data)
-#define signal_del(ev) event_del (ev)
-#define signal_pending(ev,tv) event_pending (ev, EV_SIGNAL, tv)
-#define signal_initialized(ev) event_initialized (ev)
-
-const char *event_get_version (void);
-const char *event_get_method (void);
-
-void *event_init (void);
-void event_base_free (struct event_base *base);
-
-#define EVLOOP_ONCE EVLOOP_ONESHOT
-int event_loop (int);
-int event_loopexit (struct timeval *tv);
-int event_dispatch (void);
-
-#define _EVENT_LOG_DEBUG 0
-#define _EVENT_LOG_MSG 1
-#define _EVENT_LOG_WARN 2
-#define _EVENT_LOG_ERR 3
-typedef void (*event_log_cb)(int severity, const char *msg);
-void event_set_log_callback(event_log_cb cb);
-
-void event_set (struct event *ev, int fd, short events, void (*cb)(int, short, void *), void *arg);
-int event_once (int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv);
-
-int event_add (struct event *ev, struct timeval *tv);
-int event_del (struct event *ev);
-void event_active (struct event *ev, int res, short ncalls); /* ncalls is being ignored */
-
-int event_pending (struct event *ev, short, struct timeval *tv);
-
-int event_priority_init (int npri);
-int event_priority_set (struct event *ev, int pri);
-
-int event_base_set (struct event_base *base, struct event *ev);
-int event_base_loop (struct event_base *base, int);
-int event_base_loopexit (struct event_base *base, struct timeval *tv);
-int event_base_dispatch (struct event_base *base);
-int event_base_once (struct event_base *base, int fd, short events, void (*cb)(int, short, void *), void *arg, struct timeval *tv);
-int event_base_priority_init (struct event_base *base, int fd);
-
-/* next line is different in the libevent+libev version */
-/*libevent-include*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
View
226 libev/event_compat.h
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2000-2004 Niels Provos <provos@citi.umich.edu>
- * Copyright (c) 2008 Marc Alexander Lehmann <libev@schmorp.de>
- * 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.
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _WIN32
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
-typedef unsigned char u_char;
-typedef unsigned short u_short;
-#else
-# include <sys/types.h>
-# include <sys/time.h>
-# include <inttypes.h>
-#endif
-
-#include <stdarg.h>
-
-/* Fix so that ppl dont have to run with <sys/queue.h> */
-#ifndef TAILQ_ENTRY
-#define _EVENT_DEFINED_TQENTRY
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-#endif /* !TAILQ_ENTRY */
-#ifndef RB_ENTRY
-#define _EVENT_DEFINED_RBENTRY
-#define RB_ENTRY(type) \
-struct { \
- struct type *rbe_left; /* left element */ \
- struct type *rbe_right; /* right element */ \
- struct type *rbe_parent; /* parent element */ \
- int rbe_color; /* node color */ \
-}
-#endif /* !RB_ENTRY */
-
-/*
- * Key-Value pairs. Can be used for HTTP headers but also for
- * query argument parsing.
- */
-struct evkeyval {
- TAILQ_ENTRY(evkeyval) next;
-
- char *key;
- char *value;
-};
-
-#ifdef _EVENT_DEFINED_TQENTRY
-#undef TAILQ_ENTRY
-struct event_list;
-struct evkeyvalq;
-#undef _EVENT_DEFINED_TQENTRY
-#else
-TAILQ_HEAD (event_list, event);
-TAILQ_HEAD (evkeyvalq, evkeyval);
-#endif /* _EVENT_DEFINED_TQENTRY */
-#ifdef _EVENT_DEFINED_RBENTRY
-#undef RB_ENTRY
-#undef _EVENT_DEFINED_RBENTRY
-#endif /* _EVENT_DEFINED_RBENTRY */
-
-struct eventop {
- char *name;
- void *(*init)(struct event_base *);
- int (*add)(void *, struct event *);
- int (*del)(void *, struct event *);
- int (*recalc)(struct event_base *, void *, int);
- int (*dispatch)(struct event_base *, void *, struct timeval *);
- void (*dealloc)(struct event_base *, void *);
-};
-
-/* These functions deal with buffering input and output */
-
-struct evbuffer {
- u_char *buffer;
- u_char *orig_buffer;
-
- size_t misalign;
- size_t totallen;
- size_t off;
-
- void (*cb)(struct evbuffer *, size_t, size_t, void *);
- void *cbarg;
-};
-
-/* Just for error reporting - use other constants otherwise */
-#define EVBUFFER_READ 0x01
-#define EVBUFFER_WRITE 0x02
-#define EVBUFFER_EOF 0x10
-#define EVBUFFER_ERROR 0x20
-#define EVBUFFER_TIMEOUT 0x40
-
-struct bufferevent;
-typedef void (*evbuffercb)(struct bufferevent *, void *);
-typedef void (*everrorcb)(struct bufferevent *, short what, void *);
-
-struct event_watermark {
- size_t low;
- size_t high;
-};
-
-struct bufferevent {
- struct event ev_read;
- struct event ev_write;
-
- struct evbuffer *input;
- struct evbuffer *output;
-
- struct event_watermark wm_read;
- struct event_watermark wm_write;
-
- evbuffercb readcb;
- evbuffercb writecb;
- everrorcb errorcb;
- void *cbarg;
-
- int timeout_read; /* in seconds */
- int timeout_write; /* in seconds */
-
- short enabled; /* events that are currently enabled */
-};
-
-struct bufferevent *bufferevent_new(int fd,
- evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg);
-int bufferevent_base_set(struct event_base *base, struct bufferevent *bufev);
-int bufferevent_priority_set(struct bufferevent *bufev, int pri);
-void bufferevent_free(struct bufferevent *bufev);
-int bufferevent_write(struct bufferevent *bufev, const void *data, size_t size);
-int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf);
-size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size);
-int bufferevent_enable(struct bufferevent *bufev, short event);
-int bufferevent_disable(struct bufferevent *bufev, short event);
-void bufferevent_settimeout(struct bufferevent *bufev,
- int timeout_read, int timeout_write);
-
-#define EVBUFFER_LENGTH(x) (x)->off
-#define EVBUFFER_DATA(x) (x)->buffer
-#define EVBUFFER_INPUT(x) (x)->input
-#define EVBUFFER_OUTPUT(x) (x)->output
-
-struct evbuffer *evbuffer_new(void);
-void evbuffer_free(struct evbuffer *);
-int evbuffer_expand(struct evbuffer *, size_t);
-int evbuffer_add(struct evbuffer *, const void *, size_t);
-int evbuffer_remove(struct evbuffer *, void *, size_t);
-char *evbuffer_readline(struct evbuffer *);
-int evbuffer_add_buffer(struct evbuffer *, struct evbuffer *);
-int evbuffer_add_printf(struct evbuffer *, const char *fmt, ...);
-int evbuffer_add_vprintf(struct evbuffer *, const char *fmt, va_list ap);
-void evbuffer_drain(struct evbuffer *, size_t);
-int evbuffer_write(struct evbuffer *, int);
-int evbuffer_read(struct evbuffer *, int, int);
-u_char *evbuffer_find(struct evbuffer *, const u_char *, size_t);
-void evbuffer_setcb(struct evbuffer *, void (*)(struct evbuffer *, size_t, size_t, void *), void *);
-
-/*
- * Marshaling tagged data - We assume that all tags are inserted in their
- * numeric order - so that unknown tags will always be higher than the
- * known ones - and we can just ignore the end of an event buffer.
- */
-
-void evtag_init(void);
-
-void evtag_marshal(struct evbuffer *evbuf, uint32_t tag, const void *data,
- uint32_t len);
-
-void encode_int(struct evbuffer *evbuf, uint32_t number);
-
-void evtag_marshal_int(struct evbuffer *evbuf, uint32_t tag, uint32_t integer);
-
-void evtag_marshal_string(struct evbuffer *buf, uint32_t tag,
- const char *string);
-
-void evtag_marshal_timeval(struct evbuffer *evbuf, uint32_t tag,
- struct timeval *tv);
-
-int evtag_unmarshal(struct evbuffer *src, uint32_t *ptag, struct evbuffer *dst);
-int evtag_peek(struct evbuffer *evbuf, uint32_t *ptag);
-int evtag_peek_length(struct evbuffer *evbuf, uint32_t *plength);
-int evtag_payload_length(struct evbuffer *evbuf, uint32_t *plength);
-int evtag_consume(struct evbuffer *evbuf);
-
-int evtag_unmarshal_int(struct evbuffer *evbuf, uint32_t need_tag,
- uint32_t *pinteger);
-
-int evtag_unmarshal_fixed(struct evbuffer *src, uint32_t need_tag, void *data,
- size_t len);
-
-int evtag_unmarshal_string(struct evbuffer *evbuf, uint32_t need_tag,
- char **pstring);
-
-int evtag_unmarshal_timeval(struct evbuffer *evbuf, uint32_t need_tag,
- struct timeval *ptv);
-
-#ifdef __cplusplus
-}
-#endif
View
131 libev/import_libevent
@@ -1,131 +0,0 @@
-#!/bin/sh
-
-LE=../libevent-1.4.3-stable
-
-if ! [ -e evbuffer.c ]; then
- echo do not run this programm unless you know what you are doing
- exit 1
-fi
-
-# this program combines libev and libevent into a single package
-
-cvs update -AdP libev
-rsync -avP libev/. . --exclude CVS
-
-rm -f configure.ac
-
-cp $LE/evdns.h .
-
-perl -i -pe 's%^/.libevent-include./%#include "event_compat.h"%' event.h
-
-perl -ne '
- s/\s+char buf\[64\];/\tchar buf[96];/;
- if (/#include "event.h"/) {
- print "#ifndef EV_STANDALONE\n$_#endif\n";
- next;
- }
- if (/#include "misc.h"/) {
- print "#ifndef EV_STANDALONE\n$_#endif\n";
- next;
- }
- if (/#include "(unistd.h|sys\/time.h)"/) {
- print "#ifndef WIN32\n$_#endif\n";
- next;
- }
- next if /#include "log.h"/;
-
- print;
-' <$LE/evdns.c >evdns.c
-
-cp $LE/autogen.sh .
-cp $LE/epoll_sub.c .
-cp $LE/evbuffer.c .
-cp $LE/buffer.c .
-cp $LE/evhttp.h .
-cp $LE/evutil.h .
-cp $LE/evutil.c .
-cp $LE/event-config.h .
-cp $LE/event-internal.h .
-cp $LE/evrpc.h .
-cp $LE/evrpc.c .
-cp $LE/evrpc-internal.h .
-cp $LE/http.c .
-cp $LE/event_tagging.c .
-cp $LE/http-internal.h .
-cp $LE/strlcpy-internal.h .
-cp $LE/log.c .
-cp $LE/log.h .
-cp $LE/strlcpy.c .
-rsync -a $LE/WIN32* $LE/sample $LE/test $LE/compat . --del
-#rename 's/libevent/libev/' WIN32-Prj/lib*
-cp $LE/aclocal.m4 .
-#cp $LE/acconfig.h .
-cp $LE/config.h.in .
-cp $LE/event_rpcgen.py .
-cp $LE/*.3 .
-
-#perl -i -pe 's/libevent/libev/g' sample/Makefile.am
-#perl -i -pe 's/libevent/libev/g' test/Makefile.am
-
-perl -i -pe 's/#include <event.h>$/#include "event.h"/' test/*.c
-
-perl -i -ne '
- next if /"event-internal.h"/;
- s/base\d?->sig.ev_signal_added/0/;
- s/base\d?->sig.ev_signal_pair\[0\]/-1/;
- s/base->sig.evsignal_caught/0/;
- next if /^\ttest_signal_(dealloc|pipeloss|switchbase|assert|restore)\(\)/;
- next if /^\ttest_simplesignal\(\)/; # non-default-loop
- next if /^\ttest_immediatesignal\(\)/; # non-default-loop
- next if /test_priorities\(\d\)/;
- print;
-' test/regress.c
-
-perl -ne '
- s/\bmin_heap.h\b//g;
- s/\bsignal.c\b//g;
- s/\bevport.c\b//g;
- s/\bkqueue.c\b//g;
- s/\bdevpoll.c\b//g;
- s/\brtsig.c\b//g;
- s/\bselect.c\b//g;
- s/\bpoll.c\b//g;
- s/\bepoll.c\b//g;
- s/\bepoll_sub.c\b//g;
- s/\bevent-internal.h\b//g;
- s/\bevsignal.h\b//g;
- s/^(man_MANS\s*=)/$1 ev.3 /;
- s/^(EXTRA_DIST\s*=)/$1 libev.m4 ev.h ev_vars.h ev_wrap.h event_compat.h ev++.h ev_epoll.c ev_select.c ev_poll.c ev_kqueue.c ev_port.c ev_win32.c ev.3 ev.pod /;
- s/^(include_HEADERS\s*=)/$1 ev.h event_compat.h ev++.h /;
- s/^(CORE_SRC\s*=)/$1 ev.c /;
- s/^(SYS_LIBS\s*=)/$1 -lm /;
- #s/libevent/libev/g;
- print;
-' <$LE/Makefile.am >Makefile.am
-
-perl -ne '
- #s/-Wall/-Wall -Wno-comment -Wunused-function -Wno-unused-value/;
- s/-Wall//g;
- #s/libevent/libev/g;
- #VERSION
- s/AM_INIT_AUTOMAKE\s*\(.*,(.*)\)/AM_INIT_AUTOMAKE(libevent-$1+libev,3.1)/;
- s/AC_LIBOBJ\(select\)/: ;/g;
- s/AC_LIBOBJ\(poll\)/: ;/g;
- s/AC_LIBOBJ\(kqueue\)/: ;/g;
- s/AC_LIBOBJ\(epoll\)/: ;/g;
- s/AC_LIBOBJ\(devpoll\)/: ;/g;
- s/AC_LIBOBJ\(evport\)/: ;/g;
- s/AC_LIBOBJ\(signal\)/: ;/g;
- s/AC_LIBOBJ\(rtsig\)/: ;/g;
- print "m4_include([libev.m4])\n" if /^AC_OUTPUT/;
- print;
-' <$LE/configure.in >configure.in
-
-aclocal-1.7
-automake-1.7 --add-missing
-autoconf
-autoheader
-libtoolize
-CC="ccache gcc" ./configure --prefix=/opt/libev --disable-shared "$@"
-
-
View
14 libev/libev.m4
@@ -7,19 +7,7 @@ AC_CHECK_HEADERS(sys/inotify.h sys/epoll.h sys/event.h sys/queue.h port.h poll.h
AC_CHECK_FUNCS(inotify_init epoll_ctl kqueue port_create poll select eventfd)
AC_CHECK_FUNC(clock_gettime, [], [
- dnl on linux, try syscall wrapper first
- if test $(uname) = Linux; then
- AC_MSG_CHECKING(for clock_gettime syscall)
- AC_LINK_IFELSE([AC_LANG_PROGRAM(
- [#include <syscall.h>
- #include <time.h>],
- [struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts)])],
- [ac_have_clock_syscall=1
- AC_DEFINE(HAVE_CLOCK_SYSCALL, 1, "use syscall interface for clock_gettime")
- AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)])
- fi
- if test -z "$LIBEV_M4_AVOID_LIBRT" && test -z "$ac_have_clock_syscall"; then
+ if test -z "$LIBEV_M4_AVOID_LIBRT"; then
AC_CHECK_LIB(rt, clock_gettime)
unset ac_cv_func_clock_gettime
AC_CHECK_FUNCS(clock_gettime)
View
19 libev/update_ev_wrap
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-(
- echo '#define VAR(name,decl) name'
- echo '#define EV_GENWRAP 1'
- cat ev_vars.h
-) | cc -E -o - - | perl -ne '
- while (<>) {
- push @syms, $1 if /(^\w+)/;
- }
- print "/* DO NOT EDIT, automatically generated by update_ev_wrap */\n",
- "#ifndef EV_WRAP_H\n",
- "#define EV_WRAP_H\n",
- (map "#define $_ ((loop)->$_)\n", @syms),
- "#else\n",
- "#undef EV_WRAP_H\n",
- (map "#undef $_\n", @syms),
- "#endif\n";
-' >ev_wrap.h
View
7 libev/update_symbols
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-make ev.o event.o || exit
-
-nm ev.o | perl -ne 'print "$1\n" if /\S+ [A-Z] (\S+)/' > Symbols.ev
-nm event.o | perl -ne 'print "$1\n" if /\S+ [A-Z] (\S+)/' > Symbols.event
-
View
BIN src/background.o
Binary file not shown.
View
53 src/command.C
@@ -136,6 +136,7 @@ static unsigned short iso14755_symtab[] = {
void
rxvt_term::iso14755_54 (int x, int y)
{
+ FUNCTION_DEBUG("iso14755_54 ")
x = Pixel2Col (x);
y = Pixel2Row (y);
@@ -163,6 +164,7 @@ rxvt_term::iso14755_54 (int x, int y)
void
rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
{
+ FUNCTION_DEBUG("iso14755_51 ")
rxvt_fontset *fs = FONTSET (r);
rxvt_font *f = (*fs)[fs->find_font (ch)];
wchar_t *chr, *alloc, ch2, *fname;
@@ -253,6 +255,7 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
void
rxvt_term::commit_iso14755 ()
{
+ FUNCTION_DEBUG("commit_iso14755 ")
wchar_t ch[2];
ch[0] = iso14755buf & ISO_14755_MASK;
@@ -398,6 +401,7 @@ map_function_key (KeySym keysym)
void
rxvt_term::key_press (XKeyEvent &ev)
{
+ FUNCTION_DEBUG("key_press ")
int ctrl, meta, shft, len;
KeySym keysym;
int valid_keysym;
@@ -856,6 +860,7 @@ rxvt_term::key_press (XKeyEvent &ev)
void
rxvt_term::key_release (XKeyEvent &ev)
{
+ FUNCTION_DEBUG("key_release ")
#if (MOUSE_WHEEL && MOUSE_SLIP_WHEELING) || ISO_14755 || ENABLE_PERL
KeySym keysym;
@@ -934,6 +939,7 @@ rxvt_term::key_release (XKeyEvent &ev)
unsigned int
rxvt_term::cmd_write (const char *str, unsigned int count)
{
+ FUNCTION_DEBUG("cmd_write ")
unsigned int n, s;
n = cmdbuf_ptr - cmdbuf_base;
@@ -966,6 +972,7 @@ rxvt_term::cmd_write (const char *str, unsigned int count)
void
rxvt_term::flush ()
{
+ FUNCTION_DEBUG("flush ")
flush_ev.stop ();
#ifdef HAVE_BG_PIXMAP
@@ -1030,6 +1037,7 @@ rxvt_term::flush ()
void
rxvt_term::refresh_check ()
{
+ FUNCTION_DEBUG("refresh_check ")
if (want_refresh && !flush_ev.is_active ())
flush_ev.start (1. / 60.); // refresh at max. 60 Hz normally
@@ -1039,6 +1047,7 @@ rxvt_term::refresh_check ()
void
rxvt_term::flush_cb (ev::timer &w, int revents)
{
+ FUNCTION_DEBUG("flush_cb ")
make_current ();
refresh_count = 0;
@@ -1049,6 +1058,7 @@ rxvt_term::flush_cb (ev::timer &w, int revents)
void
rxvt_term::cursor_blink_cb (ev::timer &w, int revents)
{
+ FUNCTION_DEBUG("cursor_blink_cb ")
hidden_cursor = !hidden_cursor;
want_refresh = 1;
refresh_check ();
@@ -1059,6 +1069,7 @@ rxvt_term::cursor_blink_cb (ev::timer &w, int revents)
void
rxvt_term::text_blink_cb (ev::timer &w, int revents)
{
+ FUNCTION_DEBUG("text_blink_cb ")
if (scr_refresh_rend (RS_Blink, RS_Blink))
{
hidden_text = !hidden_text;
@@ -1074,6 +1085,7 @@ rxvt_term::text_blink_cb (ev::timer &w, int revents)
void
rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
{
+ FUNCTION_DEBUG("cont_scroll_cb ")
if ((scrollBar.state == STATE_UP || scrollBar.state == STATE_DOWN)
&& scr_page (scrollBar.state == STATE_UP ? UP : DN, 1))
{
@@ -1089,6 +1101,7 @@ rxvt_term::cont_scroll_cb (ev::timer &w, int revents)
void
rxvt_term::sel_scroll_cb (ev::timer &w, int revents)
{
+ FUNCTION_DEBUG("sel_scroll_cb ")
if (scr_page (scroll_selection_dir, scroll_selection_lines))
{
selection_extend (selection_save_x, selection_save_y, selection_save_state);
@@ -1104,6 +1117,7 @@ rxvt_term::sel_scroll_cb (ev::timer &w, int revents)
void
rxvt_term::slip_wheel_cb (ev::timer &w, int revents)
{
+ FUNCTION_DEBUG("slip_wheel_cb ")
if (scr_changeview (view_start - mouse_slip_wheel_speed))
{
want_refresh = 1;
@@ -1149,6 +1163,7 @@ static struct event_handler
bool
rxvt_term::pty_fill ()
{
+ FUNCTION_DEBUG("pty_fill ")
ssize_t n = cmdbuf_endp - cmdbuf_ptr;
if (CBUFSIZ == n)
@@ -1189,6 +1204,7 @@ rxvt_term::pty_fill ()
void
rxvt_term::pty_cb (ev::io &w, int revents)
{
+ FUNCTION_DEBUG("pty_cb ")
make_current ();
if (revents & ev::READ)
@@ -1205,6 +1221,7 @@ rxvt_term::pty_cb (ev::io &w, int revents)
void
rxvt_term::pointer_unblank ()
{
+ FUNCTION_DEBUG("pointer_unblank ")
XDefineCursor (dpy, vt, TermWin_cursor);
recolour_cursor ();
@@ -1220,6 +1237,7 @@ rxvt_term::pointer_unblank ()
void
rxvt_term::pointer_blank ()
{
+ FUNCTION_DEBUG("pointer_blank ")
if (!option (Opt_pointerBlank))
return;
@@ -1232,6 +1250,7 @@ rxvt_term::pointer_blank ()
void
rxvt_term::pointer_cb (ev::timer &w, int revents)
{
+ FUNCTION_DEBUG("pointer_cb ")
make_current ();
pointer_blank ();
@@ -1241,6 +1260,7 @@ rxvt_term::pointer_cb (ev::timer &w, int revents)
void
rxvt_term::mouse_report (XButtonEvent &ev)
{
+ FUNCTION_DEBUG("mouse_report ")
int button_number, key_state = 0;
int x, y;
int code = 32;
@@ -1319,6 +1339,7 @@ rxvt_term::mouse_report (XButtonEvent &ev)
void
rxvt_term::x_cb (XEvent &ev)
{
+ //FUNCTION_DEBUG("x_cb ")
make_current ();
dLocal (Display *, dpy);
@@ -1689,6 +1710,7 @@ rxvt_term::x_cb (XEvent &ev)
void
rxvt_term::set_urgency (bool enable)
{
+ FUNCTION_DEBUG("set_urgency ")
if (enable == urgency_hint)
return;
@@ -1703,6 +1725,7 @@ rxvt_term::set_urgency (bool enable)
void
rxvt_term::focus_in ()
{
+ FUNCTION_DEBUG("focus_in ")
if (!focus)
{
focus = 1;
@@ -1738,6 +1761,7 @@ rxvt_term::focus_in ()
void
rxvt_term::focus_out ()
{
+ FUNCTION_DEBUG("focus_out ")
if (focus)
{
focus = 0;
@@ -1781,6 +1805,7 @@ rxvt_term::focus_out ()
void
rxvt_term::update_fade_color (unsigned int idx)
{
+ //FUNCTION_DEBUG("update_fade_color ")
#if OFF_FOCUS_FADING
if (rs[Rs_fade])
{
@@ -1795,6 +1820,7 @@ rxvt_term::update_fade_color (unsigned int idx)
void
rxvt_term::rootwin_cb (XEvent &ev)
{
+ FUNCTION_DEBUG("rootwin_cb ")
make_current ();
if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
@@ -1827,6 +1853,7 @@ rxvt_term::rootwin_cb (XEvent &ev)
void
rxvt_term::button_press (XButtonEvent &ev)
{
+ FUNCTION_DEBUG("button_press ")
int reportmode = 0, clickintime;
bypass_keystate = ev.state & (ModMetaMask | ShiftMask);
@@ -2073,6 +2100,7 @@ rxvt_term::button_press (XButtonEvent &ev)
void
rxvt_term::button_release (XButtonEvent &ev)
{
+ FUNCTION_DEBUG("button_release ")
int reportmode = 0;
csrO = 0; /* reset csr Offset */
@@ -2189,6 +2217,7 @@ rxvt_term::button_release (XButtonEvent &ev)
void
rxvt_term::cmd_parse ()
{
+ FUNCTION_DEBUG("cmd_parse ")
wchar_t ch = NOCHAR;
char *seq_begin; // remember start of esc-sequence here
@@ -2318,6 +2347,7 @@ rxvt_term::cmd_parse ()
wchar_t
rxvt_term::next_char () NOTHROW
{
+ //FUNCTION_DEBUG("next_char ")
while (cmdbuf_ptr < cmdbuf_endp)
{
// assume 7-bit to be ascii ALWAYS
@@ -2352,6 +2382,7 @@ rxvt_term::next_char () NOTHROW
uint32_t
rxvt_term::next_octet () NOTHROW
{
+ FUNCTION_DEBUG("next_octet ")
return cmdbuf_ptr < cmdbuf_endp
? (unsigned char)*cmdbuf_ptr++
: NOCHAR;
@@ -2367,6 +2398,7 @@ static class out_of_input out_of_input;
wchar_t
rxvt_term::cmd_getc () THROW ((class out_of_input))
{
+ //FUNCTION_DEBUG("cmd_getc ")
wchar_t c = next_char ();
if (c == NOCHAR)
@@ -2378,6 +2410,7 @@ rxvt_term::cmd_getc () THROW ((class out_of_input))
uint32_t
rxvt_term::cmd_get8 () THROW ((class out_of_input))
{
+ FUNCTION_DEBUG("cmd_get8 ")
uint32_t c = next_octet ();
if (c == NOCHAR)
@@ -2392,6 +2425,7 @@ rxvt_term::cmd_get8 () THROW ((class out_of_input))
FILE *
rxvt_term::popen_printer ()
{
+ FUNCTION_DEBUG("popen_printer ")
FILE *stream = popen (rs[Rs_print_pipe] ? rs[Rs_print_pipe] : PRINTPIPE, "w");
if (stream == NULL)
@@ -2403,6 +2437,7 @@ rxvt_term::popen_printer ()
int
rxvt_term::pclose_printer (FILE *stream)
{
+ FUNCTION_DEBUG("pclose_printer ")
fflush (stream);
return pclose (stream);
}
@@ -2413,6 +2448,7 @@ rxvt_term::pclose_printer (FILE *stream)
void
rxvt_term::process_print_pipe ()
{
+ FUNCTION_DEBUG("process_print_pipe ")
FILE *fd = popen_printer ();
if (!fd)
@@ -2480,6 +2516,7 @@ enum {
void
rxvt_term::process_nonprinting (unicode_t ch)
{
+ FUNCTION_DEBUG("process_nonprinting ")
switch (ch)
{
case C0_ESC:
@@ -2536,6 +2573,7 @@ rxvt_term::process_nonprinting (unicode_t ch)
void
rxvt_term::process_escape_vt52 (unicode_t ch)
{
+ FUNCTION_DEBUG("process_escape_vt52 ")
int row, col;
switch (ch)
@@ -2596,6 +2634,7 @@ rxvt_term::process_escape_vt52 (unicode_t ch)
void
rxvt_term::process_escape_seq ()
{
+ FUNCTION_DEBUG("process_escape_seq ")
unicode_t ch = cmd_getc ();
if (priv_modes & PrivMode_vt52)
@@ -2756,6 +2795,7 @@ const unsigned char csi_defaults[] =
void
rxvt_term::process_csi_seq ()
{
+ FUNCTION_DEBUG("process_csi_seq ")
unicode_t ch, priv, i;
unsigned int nargs, p;
int n, ndef;
@@ -3075,6 +3115,7 @@ rxvt_term::process_csi_seq ()
void
rxvt_term::process_window_ops (const int *args, unsigned int nargs)
{
+ FUNCTION_DEBUG("process_window_ops ")
int x, y;
XWindowAttributes wattr;
Window wdummy;
@@ -3174,6 +3215,7 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs)
char *
rxvt_term::get_to_st (unicode_t &ends_how)
{
+ FUNCTION_DEBUG("get_to_st ")
unicode_t ch;
bool seen_esc = false;
unsigned int n = 0;
@@ -3223,6 +3265,7 @@ rxvt_term::get_to_st (unicode_t &ends_how)
void
rxvt_term::process_dcs_seq ()
{
+ FUNCTION_DEBUG("process_dcs_seq ")
char *s;
unicode_t eh;
@@ -3243,6 +3286,7 @@ rxvt_term::process_dcs_seq ()
void
rxvt_term::process_osc_seq ()
{
+ FUNCTION_DEBUG("process_osc_seq ")
unicode_t ch, eh;
int arg;
@@ -3265,6 +3309,7 @@ rxvt_term::process_osc_seq ()
void
rxvt_term::process_color_seq (int report, int color, const char *str, char resp)
{
+ FUNCTION_DEBUG("process_color_seq ")
if (str[0] == '?' && !str[1])
{
rgba c;
@@ -3287,6 +3332,7 @@ rxvt_term::process_color_seq (int report, int color, const char *str, char resp)
void
rxvt_term::process_xterm_seq (int op, const char *str, char resp)
{
+ FUNCTION_DEBUG("process_xterm_seq ")
int color;
char *buf, *name;
bool query = str[0] == '?' && !str[1];
@@ -3558,6 +3604,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp)
int
rxvt_term::privcases (int mode, unsigned long bit)
{
+ FUNCTION_DEBUG("privcases ")
int state;
if (mode == 's')
@@ -3581,6 +3628,7 @@ rxvt_term::privcases (int mode, unsigned long bit)
void
rxvt_term::process_terminal_mode (int mode, int priv UNUSED, unsigned int nargs, const int *arg)
{
+ FUNCTION_DEBUG("process_terminal_mode ")
unsigned int i, j;
int state;
@@ -3776,6 +3824,7 @@ rxvt_term::process_terminal_mode (int mode, int priv UNUSED, unsigned int nargs,
void
rxvt_term::process_sgr_mode (unsigned int nargs, const int *arg)
{
+ FUNCTION_DEBUG("process_sgr_mode ")
unsigned int i;
short rendset;
int rendstyle;
@@ -3930,6 +3979,7 @@ rxvt_term::process_sgr_mode (unsigned int nargs, const int *arg)
void
rxvt_term::process_graphics ()
{
+ FUNCTION_DEBUG("process_graphics ")
unicode_t ch, cmd = cmd_getc ();
if (cmd == 'Q')
@@ -3954,6 +4004,7 @@ rxvt_term::process_graphics ()
void
rxvt_term::tt_printf (const char *fmt,...)
{
+ FUNCTION_DEBUG("tt_printf ")
va_list arg_ptr;
char buf[256];
@@ -3972,6 +4023,7 @@ const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT
void
rxvt_term::tt_write (const char *data, unsigned int len)
{
+ FUNCTION_DEBUG("tt_write ")
if (HOOK_INVOKE ((this, HOOK_TT_WRITE, DT_STR_LEN, data, len, DT_END)))
return;
@@ -3999,6 +4051,7 @@ rxvt_term::tt_write (const char *data, unsigned int len)
void rxvt_term::pty_write ()
{
+ FUNCTION_DEBUG("pty_write ")
int written = write (pty->pty, v_buffer, min (v_buflen, MAX_PTY_WRITE));
if (written > 0)
View
111 src/command.C.js
@@ -130,6 +130,8 @@ I bound them to "C-H u" "C-H o" and "C-H p"
//REMOVED:rxvt_term::commit_iso14755 () function ()
//REMOVED:static int hex_keyval (XKeyEvent &ev)
//REMOVED:static inline KeySym translate_keypad (KeySym keysym, bool kp)
+//REMOVED:static inline int // map_function_key (KeySym keysym)
+//REMOVED:void rxvt_term::key_press (XKeyEvent &ev)