From 065b91948ce4cb4043a4c915576eaaff624a199c Mon Sep 17 00:00:00 2001 From: root Date: Wed, 19 Dec 2007 01:59:29 +0000 Subject: [PATCH] add and document Symbol.* files --- Symbols.ev | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ Symbols.event | 21 ++++++++++++++++++++ ev.3 | 32 +++++++++++++++++++++++++++++- ev.pod | 25 +++++++++++++++++++++++ update_ev_wrap | 2 +- update_symbols | 7 +++++++ 6 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 Symbols.ev create mode 100644 Symbols.event create mode 100755 update_symbols diff --git a/Symbols.ev b/Symbols.ev new file mode 100644 index 0000000..501722b --- /dev/null +++ b/Symbols.ev @@ -0,0 +1,54 @@ +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_now +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_syserr_cb +ev_signal_start +ev_signal_stop +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 diff --git a/Symbols.event b/Symbols.event new file mode 100644 index 0000000..c2d16eb --- /dev/null +++ b/Symbols.event @@ -0,0 +1,21 @@ +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 diff --git a/ev.3 b/ev.3 index 6630804..a7805ec 100644 --- a/ev.3 +++ b/ev.3 @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "EV 1" -.TH EV 1 "2007-12-18" "perl v5.8.8" "User Contributed Perl Documentation" +.TH EV 1 "2007-12-19" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" libev \- a high performance full\-featured event loop written in C .SH "SYNOPSIS" @@ -2631,6 +2631,36 @@ definition and a statement, respectively. See the \fIev.v\fR header file for their default definitions. One possible use for overriding these is to avoid the \f(CW\*(C`struct ev_loop *\*(C'\fR as first argument in all cases, or to use method calls instead of plain function calls in \*(C+. +.Sh "\s-1EXPORTED\s0 \s-1API\s0 \s-1SYMBOLS\s0" +.IX Subsection "EXPORTED API SYMBOLS" +If you need to re-export the \s-1API\s0 (e.g. via a dll) and you need a list of +exported symbols, you can use the provided \fISymbol.*\fR files which list +all public symbols, one per line: +.Sp +.Vb 2 +\& Symbols.ev for libev proper +\& Symbols.event for the libevent emulation +.Ve +.Sp +This can also be used to rename all public symbols to avoid clashes with +multiple versions of libev linked together (which is obviously bad in +itself, but sometimes it is inconvinient to avoid this). +.Sp +A sed comamnd like this will create wrapper \f(CW\*(C`#define\*(C'\fR's that you need to +include before including \fIev.h\fR: +.Sp +.Vb 1 +\& wrap.h +.Ve +.Sp +This would create a file \fIwrap.h\fR which essentially looks like this: +.Sp +.Vb 4 +\& #define ev_backend myprefix_ev_backend +\& #define ev_check_start myprefix_ev_check_start +\& #define ev_check_stop myprefix_ev_check_stop +\& ... +.Ve .Sh "\s-1EXAMPLES\s0" .IX Subsection "EXAMPLES" For a real-world example of a program the includes libev diff --git a/ev.pod b/ev.pod index 901d76e..8f85af4 100644 --- a/ev.pod +++ b/ev.pod @@ -2447,6 +2447,31 @@ their default definitions. One possible use for overriding these is to avoid the C as first argument in all cases, or to use method calls instead of plain function calls in C++. +=head2 EXPORTED API SYMBOLS + +If you need to re-export the API (e.g. via a dll) and you need a list of +exported symbols, you can use the provided F files which list +all public symbols, one per line: + + Symbols.ev for libev proper + Symbols.event for the libevent emulation + +This can also be used to rename all public symbols to avoid clashes with +multiple versions of libev linked together (which is obviously bad in +itself, but sometimes it is inconvinient to avoid this). + +A sed comamnd like this will create wrapper C<#define>'s that you need to +include before including F: + + wrap.h + +This would create a file F which essentially looks like this: + + #define ev_backend myprefix_ev_backend + #define ev_check_start myprefix_ev_check_start + #define ev_check_stop myprefix_ev_check_stop + ... + =head2 EXAMPLES For a real-world example of a program the includes libev diff --git a/update_ev_wrap b/update_ev_wrap index 30ebb4f..6e43069 100755 --- a/update_ev_wrap +++ b/update_ev_wrap @@ -7,4 +7,4 @@ ) | cc -E -o - - | sed -n -e 's/define/#define/p' | ( echo "/* DO NOT EDIT, automatically generated by update_ev_wrap */" cat -) | tee ev_wrap.h +) > ev_wrap.h diff --git a/update_symbols b/update_symbols new file mode 100755 index 0000000..a1a1cb3 --- /dev/null +++ b/update_symbols @@ -0,0 +1,7 @@ +#!/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 + -- 2.43.0