mirror of
https://gitlab.com/80486DX2-66/gists
synced 2025-05-31 08:31:41 +05:30
C: fwrite_le.*: update to revision 3acee16
This commit is contained in:
@ -5,22 +5,31 @@
|
||||
* License: Unlicense
|
||||
*/
|
||||
|
||||
#ifndef _FWRITE_LE_H
|
||||
#define _FWRITE_LE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _FWRITE_LE_H
|
||||
#define _FWRITE_LE_H
|
||||
|
||||
#define FWRITE_LE_NO_MODIFICATION 0
|
||||
|
||||
#define DETECTED_LITTLE_ENDIAN 0
|
||||
#define DETECTED_BIG_ENDIAN 1
|
||||
#define UNSUPPORTED_ENDIANNESS -1
|
||||
|
||||
#define ORDER_NATIVE_U32 0x01234567
|
||||
#define ORDER_LITTLE_ENDIAN_S4 "\x67\x45\x23\x01"
|
||||
#define ORDER_BIG_ENDIAN_S4 "\x01\x23\x45\x67"
|
||||
#define ifeq_b32_ret(lhs, rhs, value) if (!memcmp(lhs, rhs, 4)) return value;
|
||||
|
||||
int detect_endianness(void);
|
||||
size_t fwrite_le(void* ptr, size_t size, size_t count, FILE* stream);
|
||||
size_t fwrite_le(
|
||||
#if FWRITE_LE_NO_MODIFICATION
|
||||
const
|
||||
#endif
|
||||
void* ptr, size_t size, size_t count, FILE* stream);
|
||||
void reorder_le_be(
|
||||
#if FWRITE_LE_NO_MODIFICATION
|
||||
uint8_t* dest, uint8_t* src,
|
||||
|
Reference in New Issue
Block a user