… | |
… | |
3 | =head2 ABOUT LIBECB |
3 | =head2 ABOUT LIBECB |
4 | |
4 | |
5 | Libecb is currently a simple header file that doesn't require any |
5 | Libecb is currently a simple header file that doesn't require any |
6 | configuration to use or include in your project. |
6 | configuration to use or include in your project. |
7 | |
7 | |
8 | It's part of the e-suite of libraries, other memembers of which include |
8 | It's part of the e-suite of libraries, other members of which include |
9 | libev and libeio. |
9 | libev and libeio. |
10 | |
10 | |
11 | Its homepage can be found here: |
11 | Its homepage can be found here: |
12 | |
12 | |
13 | http://software.schmorp.de/pkg/libecb |
13 | http://software.schmorp.de/pkg/libecb |
14 | |
14 | |
15 | It mainly provides a number of wrappers around GCC built-ins, together |
15 | It mainly provides a number of wrappers around GCC built-ins, together |
16 | with replacement functions for other compilers. In addition to this, |
16 | with replacement functions for other compilers. In addition to this, |
17 | it provides a number of other lowlevel C utilities, such endienness |
17 | it provides a number of other lowlevel C utilities, such as endianness |
18 | detection, byte swapping or bit rotations. |
18 | detection, byte swapping or bit rotations. |
19 | |
19 | |
20 | More might come. |
20 | More might come. |
21 | |
21 | |
22 | =head2 ABOUT THE HEADER |
22 | =head2 ABOUT THE HEADER |
… | |
… | |
27 | #include <ecb.h> |
27 | #include <ecb.h> |
28 | |
28 | |
29 | The header should work fine for both C and C++ compilation, and gives you |
29 | The header should work fine for both C and C++ compilation, and gives you |
30 | all of F<inttypes.h> in addition to the ECB symbols. |
30 | all of F<inttypes.h> in addition to the ECB symbols. |
31 | |
31 | |
32 | There are currently no objetc files to link to - future versions might |
32 | There are currently no object files to link to - future versions might |
33 | come with an (optional) object code library to link against, to reduce |
33 | come with an (optional) object code library to link against, to reduce |
34 | code size or gain access to additional features. |
34 | code size or gain access to additional features. |
35 | |
35 | |
36 | It also currently includes everything from F<inttypes.h>. |
36 | It also currently includes everything from F<inttypes.h>. |
37 | |
37 | |
… | |
… | |
313 | =over 4 |
313 | =over 4 |
314 | |
314 | |
315 | =item x = ecb_mod (m, n) |
315 | =item x = ecb_mod (m, n) |
316 | |
316 | |
317 | Returns the positive remainder of the modulo operation between C<m> and |
317 | Returns the positive remainder of the modulo operation between C<m> and |
318 | C<n>. Unlike the C moduloe operator C<%>, this function ensures that the |
318 | C<n>. Unlike the C modulo operator C<%>, this function ensures that the |
319 | return value is always positive). |
319 | return value is always positive). |
320 | |
320 | |
321 | C<n> must be strictly positive (i.e. C<< >1 >>), while C<m> must be |
321 | C<n> must be strictly positive (i.e. C<< >1 >>), while C<m> must be |
322 | negatable, that is, both C<m> and C<-m> must be representable in its |
322 | negatable, that is, both C<m> and C<-m> must be representable in its |
323 | type. |
323 | type. |