ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.159 by root, Thu May 22 02:44:57 2008 UTC vs.
Revision 1.160 by root, Thu May 22 03:06:58 2008 UTC

116called C<ev_tstamp>, which is what you should use too. It usually aliases 116called C<ev_tstamp>, which is what you should use too. It usually aliases
117to the C<double> type in C, and when you need to do any calculations on 117to the C<double> type in C, and when you need to do any calculations on
118it, you should treat it as some floatingpoint value. Unlike the name 118it, you should treat it as some floatingpoint value. Unlike the name
119component C<stamp> might indicate, it is also used for time differences 119component C<stamp> might indicate, it is also used for time differences
120throughout libev. 120throughout libev.
121
122=head1 ERROR HANDLING
123
124Libev knows three classes of errors: operating system errors, usage errors
125and internal errors (bugs).
126
127When libev catches an operating system error it cannot handle (for example
128a syscall indicating a condition libev cannot fix), it calls the callback
129set via C<ev_set_syserr_cb>, which is supposed to fix the problem or
130abort. The default is to print a diagnostic message and to call C<abort
131()>.
132
133When libev detects a usage error such as a negative timer interval, then
134it will print a diagnostic message and abort (via the C<assert> mechanism,
135so C<NDEBUG> will disable this checking): these are programming errors in
136the libev caller and need to be fixed there.
137
138Libev also has a few internal error-checking C<assert>ions, and also has
139extensive consistency checking code. These do not trigger under normal
140circumstances, as they indicate either a bug in libev or worse.
141
121 142
122=head1 GLOBAL FUNCTIONS 143=head1 GLOBAL FUNCTIONS
123 144
124These functions can be called anytime, even before initialising the 145These functions can be called anytime, even before initialising the
125library in any way. 146library in any way.
3293 3314
3294=over 4 3315=over 4
3295 3316
3296=item The winsocket select function 3317=item The winsocket select function
3297 3318
3298The winsocket C<select> function doesn't follow POSIX in that it requires 3319The winsocket C<select> function doesn't follow POSIX in that it
3299socket I<handles> and not socket I<file descriptors>. This makes select 3320requires socket I<handles> and not socket I<file descriptors> (it is
3300very inefficient, and also requires a mapping from file descriptors 3321also extremely buggy). This makes select very inefficient, and also
3301to socket handles. See the discussion of the C<EV_SELECT_USE_FD_SET>, 3322requires a mapping from file descriptors to socket handles. See the
3302C<EV_SELECT_IS_WINSOCKET> and C<EV_FD_TO_WIN32_HANDLE> preprocessor 3323discussion of the C<EV_SELECT_USE_FD_SET>, C<EV_SELECT_IS_WINSOCKET> and
3303symbols for more info. 3324C<EV_FD_TO_WIN32_HANDLE> preprocessor symbols for more info.
3304 3325
3305The configuration for a "naked" win32 using the microsoft runtime 3326The configuration for a "naked" win32 using the microsoft runtime
3306libraries and raw winsocket select is: 3327libraries and raw winsocket select is:
3307 3328
3308 #define EV_USE_SELECT 1 3329 #define EV_USE_SELECT 1
3386=back 3407=back
3387 3408
3388If you know of other additional requirements drop me a note. 3409If you know of other additional requirements drop me a note.
3389 3410
3390 3411
3412=head1 COMPILER WARNINGS
3413
3414Depending on your compiler and compiler settings, you might get no or a
3415lot of warnings when compiling libev code. Some people are apparently
3416scared by this.
3417
3418However, these are unavoidable for many reasons. For one, each compiler
3419has different warnings, and each user has different tastes regarding
3420warning options. "Warn-free" code therefore cannot be a goal except when
3421targetting a specific compiler and compiler-version.
3422
3423Another reason is that some compiler warnings require elaborate
3424workarounds, or other changes to the code that make it less clear and less
3425maintainable.
3426
3427And of course, some compiler warnings are just plain stupid, or simply
3428wrong (because they don't actually warn about the cindition their message
3429seems to warn about).
3430
3431While libev is written to generate as few warnings as possible,
3432"warn-free" code is not a goal, and it is recommended not to build libev
3433with any compiler warnings enabled unless you are prepared to cope with
3434them (e.g. by ignoring them). Remember that warnings are just that:
3435warnings, not errors, or proof of bugs.
3436
3437
3391=head1 VALGRIND 3438=head1 VALGRIND
3392 3439
3393Valgrind has a special section here because it is a popular tool that is 3440Valgrind has a special section here because it is a popular tool that is
3394highly useful, but valgrind reports are very hard to interpret. 3441highly useful, but valgrind reports are very hard to interpret.
3395 3442

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines