Browse Source

add and document Symbol.* files

tags/rel-2.0
Marc Alexander Lehmann 12 years ago
parent
commit
1612487be0
6 changed files with 139 additions and 2 deletions
  1. +54
    -0
      Symbols.ev
  2. +21
    -0
      Symbols.event
  3. +31
    -1
      ev.3
  4. +25
    -0
      ev.pod
  5. +1
    -1
      update_ev_wrap
  6. +7
    -0
      update_symbols

+ 54
- 0
Symbols.ev View File

@@ -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

+ 21
- 0
Symbols.event View File

@@ -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

+ 31
- 1
ev.3 View File

@@ -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
\& <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


+ 25
- 0
ev.pod View File

@@ -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


+ 1
- 1
update_ev_wrap View File

@@ -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

+ 7
- 0
update_symbols View File

@@ -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


Loading…
Cancel
Save