Skip to content
Extraits de code Groupes Projets

Corrections

Fusionnées Kubat a demandé de fusionner dev-kubat vers master
9 files
+ 117
104
Comparer les modifications
  • Côte à côte
  • En ligne

Fichiers

+ 13
16
@@ -4,11 +4,6 @@
#include <unistd.h>
#include <stdint.h>
/* May be usefull (gcc, see something else for clang):
__FLOAT_WORD_ORDER__
__ORDER_LITTLE_ENDIAN__
__ORDER_BIG_ENDIAN__ */
#define not_implemented() __not_implemented(__func__,__FILE__,__LINE__)
extern void __not_implemented(const char *func, char *file, int line);
@@ -22,24 +17,26 @@ void *safe_zero_malloc(size_t size);
int is_utf8(const char *string);
/* Same as `be_uint64_t` but for Big-endian doubles. The result is a
correct endian number. Restriction: bytes must be of length 8.
Use the be_uint64_t defined function. */
double be_double_t(const uint8_t bytes[]);
/* Same as `be_double_t` but for floats. Restriction: bytes must
be of length 4. The result is a correct endian number Use the
be_uint32_t defined function. */
float be_float_t(const uint8_t bytes[]);
/* Read `bytes` as the big endian representation of a 32-bit unsigned integer.
`n` is the number of bytes in `bytes`
`n` is the number of bytes in `bytes`. The result is a 'correct'-endian.
Returns 0 if n is 0.
Restriction: n <= 4 */
uint32_t be_uint32_t(const uint8_t bytes[], size_t n);
/* Same as `be_uint32_t` but for 64-bit unsigned integers.
Restriction: n <= 8 */
/* Same as `be_uint32_t` but for 64-bit unsigned integers. The result is a
'correct'-endian. Restriction: n <= 8 */
uint64_t be_uint64_t(const uint8_t bytes[], size_t n);
/* Same as `be_uint64_t` but for Big-endian doubles.
Restriction: bytes must be of length 8. */
double be_double_t(const uint8_t bytes[]);
/* Same as `be_double_t` but for floats. Restriction: bytes must
be of length 4. */
float be_float_t(const uint8_t bytes[]);
/* Trim the string `str` of the char `c` from the right and the left.
The string may not be null terminated.
Returns a pointer to the the trimmed string
Chargement en cours