Skip to content

OSDEP API

This module provides a portable cross-platform abstraction layer. By including "osdep.h", you will include most common O/S headers and define a set of useful cross-platform constants.

Function Index

Typedef Index

OffsetSigned file offset data type.
SocketArgument for sockets.
SocklenSize to hold the length of a socket address.
TicksElapsed time data type.
TimeTime in milliseconds since Jan 1, 1970.
boolBoolean data type.
ccharConstant char data type.
cintConstant int data type.
cucharUnsigned char data type.
cushortConstant unsigned short data type.
cvoidConstant void data type.
int16Integer 16 bits data type.
int32Integer 32 bits data type.
int8Integer 8 bits data type.
scharSigned char data type.
size_tUnsigned integral type.
ssizeSigned integer size field large enough to hold a pointer offset.
time_tUnsigned time type.
ucharUnsigned char data type.
uintUnsigned integer (machine dependent bit size) data type.
uint16Unsigned integer 16 bits data type.
uint32Unsigned integer 32 bits data type.
uint8Unsigned integer 8 bits data type.
ulongUnsigned long (machine dependent bit size) data type.
ushortUnsigned short data type.
wsizeWindows uses uint for write/read counts (Ugh!).

Defines

#defineME_BIG_ENDIAN   2
 Big endian byte ordering.
#defineME_BUFSIZE   4096
 Reasonable size for buffers.
#defineME_CPU_ARM   1
 Arm.
#defineME_CPU_ARM64   2
 Arm64.
#defineME_CPU_ITANIUM   3
 Intel Itanium.
#defineME_CPU_MIPS   6
 Mips.
#defineME_CPU_MIPS64   7
 Mips 64.
#defineME_CPU_PPC   8
 Power PC.
#defineME_CPU_PPC64   9
 Power PC 64.
#defineME_CPU_RISCV   13
 RiscV.
#defineME_CPU_RISCV64   14
 RiscV64.
#defineME_CPU_SH   12
 SuperH.
#defineME_CPU_SPARC   10
 Sparc.
#defineME_CPU_TIDSP   11
 TI DSP.
#defineME_CPU_X64   5
 AMD64 or EMT64.
#defineME_CPU_X86   4
 X86.
#defineME_CPU_XTENSA   15
 Xtensa / ESP32.
#defineME_DEBUG   0
 Default to a debug build.
#defineME_LITTLE_ENDIAN   1
 Little endian byte ordering.
#defineME_MAX_ARGC   32
 Maximum number of command line args if using MAIN().
#defineME_MAX_FNAME   256
 Reasonable filename size.
#defineME_MAX_PATH   1024
 Reasonable path size.
#defineME_STACK_SIZE   (32 * 1024)
 Default thread stack size (0 means use system default).
#defineOSDEP_USE_ME   1
 Operating system dependent layer that provides a portable cross-platform abstraction layer.
#defineTPS   1000
 Time/Ticks units per second (milliseconds).

Typedefs

typedef char bool

Boolean data type.

API Stability:
Stable.

typedef const char cchar

Constant char data type.

API Stability:
Stable.

typedef const int cint

Constant int data type.

API Stability:
Stable.

typedef const unsigned char cuchar

Unsigned char data type.

API Stability:
Stable.

typedef const unsigned short cushort

Constant unsigned short data type.

API Stability:
Stable.

typedef const void cvoid

Constant void data type.

API Stability:
Stable.

typedef short int16

Integer 16 bits data type.

API Stability:
Stable.

typedef int int32

Integer 32 bits data type.

API Stability:
Stable.

typedef char int8

Integer 8 bits data type.

API Stability:
Stable.

typedef int64 Offset

Signed file offset data type.

Supports large files greater than 4GB in size on all systems
API Stability:
Stable.

typedef signed char schar

Signed char data type.

API Stability:
Stable.

typedef long size_t

Unsigned integral type.

Equivalent in size to void*

typedef int Socket

Argument for sockets.

API Stability:
Stable.

typedef int Socklen

Size to hold the length of a socket address.

API Stability:
Stable.

typedef ssize_t ssize

Signed integer size field large enough to hold a pointer offset.

API Stability:
Stable.

typedef int64 Ticks

Elapsed time data type.

Stores time in milliseconds from some arbitrary start epoch
API Stability:
Stable.

typedef int64 Time

Time in milliseconds since Jan 1, 1970.

API Stability:
Stable.

typedef long time_t

Unsigned time type.

Time in seconds since Jan 1, 1970

typedef unsigned char uchar

Unsigned char data type.

API Stability:
Stable.

typedef unsigned int uint

Unsigned integer (machine dependent bit size) data type.

API Stability:
Stable.

typedef unsigned short uint16

Unsigned integer 16 bits data type.

API Stability:
Stable.

typedef unsigned int uint32

Unsigned integer 32 bits data type.

API Stability:
Stable.

typedef unsigned char uint8

Unsigned integer 8 bits data type.

API Stability:
Stable.

typedef unsigned long ulong

Unsigned long (machine dependent bit size) data type.

API Stability:
Stable.

typedef unsigned short ushort

Unsigned short data type.

API Stability:
Stable.

typedef ssize wsize

Windows uses uint for write/read counts (Ugh!).

API Stability:
Stable.

Functions