]> git.llucax.com Git - software/libev.git/commitdiff
add and document Symbol.* files
authorroot <root>
Wed, 19 Dec 2007 01:59:29 +0000 (01:59 +0000)
committerroot <root>
Wed, 19 Dec 2007 01:59:29 +0000 (01:59 +0000)
Symbols.ev [new file with mode: 0644]
Symbols.event [new file with mode: 0644]
ev.3
ev.pod
update_ev_wrap
update_symbols [new file with mode: 0755]

diff --git a/Symbols.ev b/Symbols.ev
new file mode 100644 (file)
index 0000000..501722b
--- /dev/null
@@ -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 (file)
index 0000000..c2d16eb
--- /dev/null
@@ -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 66308048a5cf04b0f954a2a5cc5c28f9bf36c462..a7805ec05c7f95a85c5e1917553fbeccc7699acb 100644 (file)
--- a/ev.3
+++ b/ev.3
 .\" ========================================================================
 .\"
 .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
+\&   <Symbols.ev sed -e "s/.*/#define & myprefix_&/" >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 901d76ec7a7c98e0de16892f33317cb21079474e..8f85af4d06e9eeb599033b9f4a86762bb3d26ea5 100644 (file)
--- a/ev.pod
+++ b/ev.pod
@@ -2447,6 +2447,31 @@ their default definitions. One possible use for overriding these is to
 avoid the C<struct ev_loop *> 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<Symbol.*> 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<ev.h>:
+
+   <Symbols.ev sed -e "s/.*/#define & myprefix_&/" >wrap.h
+
+This would create a file F<wrap.h> 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
index 30ebb4f4aa71eafef04f71e9135c02bc5a4cb097..6e43069c8d5ae72092e923e3c6f42112c1e0ec85 100755 (executable)
@@ -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 (executable)
index 0000000..a1a1cb3
--- /dev/null
@@ -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
+