This repository has been archived on 2026-04-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bhlib/doc/Manual/en/BH_Util.pod

242 lines
4.1 KiB
Plaintext
Raw Normal View History

=encoding UTF-8
=head1 NAME
BH_Util - Utility Functions
=head1 SYNTAX
#include <BH/Math.h>
2025-06-22 18:48:26 +03:00
cc prog.c -o prog -lbh
=head1 DESCRIPTION
2025-06-22 18:48:26 +03:00
The BH_Util library provides a set of functions for working with numbers in
little-endian and big-endian formats, as well as for classifying floating-point
values.
=head1 API CALLS
=head2 BH_ClassifyDouble
int BH_ClassifyDouble(double value);
Classifies a floating-point value.
This function returns a combination of the following values:
=over
=item B<BH_FP_NORMAL>
The value is normal or subnormal.
=item B<BH_FP_ZERO>
The value is positive or negative zero.
=item B<BH_FP_INFINITE>
The value is positive or negative infinity.
=item B<BH_FP_NAN>
The value is not a number (NaN).
=item B<BH_FP_NEGATIVE>
The value is negative.
=back
=head2 BH_Read16LEu
uint16_t BH_Read16LEu(const char *buffer);
Reads an unsigned 16-bit little-endian integer from the buffer.
=head2 BH_Read16LEs
int16_t BH_Read16LEs(const char *buffer);
Reads a signed 16-bit little-endian integer from the buffer.
=head2 BH_Read32LEu
uint32_t BH_Read32LEu(const char *buffer);
Reads an unsigned 32-bit little-endian integer from the buffer.
=head2 BH_Read32LEs
int32_t BH_Read32LEs(const char *buffer);
Reads a signed 32-bit little-endian integer from the buffer.
=head2 BH_Read64LEu
uint64_t BH_Read64LEu(const char *buffer);
Reads an unsigned 64-bit little-endian integer from the buffer.
=head2 BH_Read64LEs
int64_t BH_Read64LEs(const char *buffer);
Reads a signed 64-bit little-endian integer from the buffer.
=head2 BH_Read16BEu
uint16_t BH_Read16BEu(const char *buffer);
Reads an unsigned 16-bit big-endian integer from the buffer.
=head2 BH_Read16BEs
int16_t BH_Read16BEs(const char *buffer);
Reads a signed 16-bit big-endian integer from the buffer.
=head2 BH_Read32BEu
uint32_t BH_Read32BEu(const char *buffer);
Reads an unsigned 32-bit big-endian integer from the buffer.
=head2 BH_Read32BEs
int32_t BH_Read32BEs(const char *buffer);
Reads a signed 32-bit big-endian integer from the buffer.
=head2 BH_Read64BEu
uint64_t BH_Read64BEu(const char *buffer);
Reads an unsigned 64-bit big-endian integer from the buffer.
=head2 BH_Read64BEs
int64_t BH_Read64BEs(const char *buffer);
Reads a signed 64-bit big-endian integer from the buffer.
=head2 BH_Write16LEu
2025-06-22 18:48:26 +03:00
void BH_Write16LEu(char *buffer,
uint16_t value);
Writes an unsigned 16-bit little-endian integer to the buffer.
=head2 BH_Write16LEs
void BH_Write16LEs(char *buffer,
int16_t value);
Writes a signed 16-bit little-endian integer to the buffer.
=head2 BH_Write32LEu
2025-06-22 18:48:26 +03:00
void BH_Write32LEu(char *buffer,
uint32_t value);
Writes an unsigned 32-bit little-endian integer to the buffer.
=head2 BH_Write32LEs
2025-06-22 18:48:26 +03:00
void BH_Write32LEs(char *buffer,
int32_t value);
Writes a signed 32-bit little-endian integer to the buffer.
=head2 BH_Write64LEu
void BH_Write64LEu(char *buffer,
uint64_t value);
Writes an unsigned 64-bit little-endian integer to the buffer.
=head2 BH_Write64LEs
void BH_Write64LEs(char *buffer,
int64_t value);
Writes a signed 64-bit little-endian integer to the buffer.
=head2 BH_Write16BEu
void BH_Write16BEu(char *buffer,
uint16_t value);
Writes an unsigned 16-bit big-endian integer to the buffer.
=head2 BH_Write16BEs
void BH_Write16BEs(char *buffer,
int16_t value);
Writes a signed 16-bit big-endian integer to the buffer.
=head2 BH_Write32BEu
2025-06-22 18:48:26 +03:00
void BH_Write32BEu(char *buffer,
uint32_t value);
Writes an unsigned 32-bit big-endian integer to the buffer.
=head2 BH_Write32BEs
2025-06-22 18:48:26 +03:00
void BH_Write32BEs(char *buffer,
int32_t value);
Writes a signed 32-bit big-endian integer to the buffer.
=head2 BH_Write64BEu
2025-06-22 18:48:26 +03:00
void BH_Write64BEu(char *buffer,
uint64_t value);
Writes an unsigned 64-bit big-endian integer to the buffer.
=head2 BH_Write64BEs
2025-06-22 18:48:26 +03:00
void BH_Write64BEs(char *buffer,
int64_t value);
Writes a signed 64-bit big-endian integer to the buffer.
=head1 SEE ALSO
L<BH>