Open Files 5.3.0
Multi-Platform Event-Driven Application Framework
types.h File Reference
#include "ofc/config.h"
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _iovec
 
#define OFC_LARGE_INTEGER_HIGH(x)   ((OFC_UINT32)((x)>>32))
 
#define OFC_LARGE_INTEGER_LOW(x)   ((OFC_UINT32)((x)&0xFFFFFFFF))
 
#define OFC_LARGE_INTEGER_ASSIGN(x, y)   x=y
 
#define OFC_LARGE_INTEGER_SET(x, y, z)   (x)=(OFC_LARGE_INTEGER)(z)<<32|(y)
 
#define OFC_LARGE_INTEGER_EQUAL(x, y)   (x==y)
 
#define OFC_LARGE_INTEGER_INCR(x)   x++
 
#define OFC_LARGE_INTEGER_AND(x, y, z)   (x)&=((OFC_LARGE_INTEGER)(z)<<32|(y))
 
#define OFC_LARGE_INTEGER_INIT(x, y)   (OFC_LARGE_INTEGER)(y)<<32|(x)
 
#define OFC_ULONG_MAX   ((OFC_ULONG)(~0L))
 
#define OFC_LONG_MAX   ((OFC_LONG)(OFC_ULONG_MAX >> 1))
 
#define OFC_LONG_MIN   ((OFC_LONG)(~OFC_LONG_MAX))
 
#define OFC_DWORD_MASK   0xFFFFFFFF
 
#define TCHAR_BACKSLASH   L'\\'
 
#define TCHAR_SLASH   L'/'
 
#define TCHAR_COLON   L':'
 
#define TCHAR_EOS   L'\0'
 
#define TCHAR_AMP   L'@'
 
#define TSTR(x)   (const OFC_TCHAR *) L##x
 
#define TCHAR(x)   (const OFC_TCHAR) L##x
 
#define TACHAR_BACKSLASH   TCHAR('\\')
 
#define TACHAR_SLASH   TCHAR('/')
 
#define TACHAR_COLON   TCHAR(':')
 
#define TACHAR_EOS   TCHAR('\0')
 
#define TACHAR_AMP   TCHAR('@')
 
#define TASTR(x)   TSTR(x)
 
#define TACHAR(x)   TCHAR(x)
 
#define OFC_UUID_LEN   16
 
#define OFC_NULL   ((OFC_LPVOID) 0)
 
#define container_of(ptr, type, member)    (type *)((OFC_CHAR *)(ptr)-(OFC_CHAR *)&((type *)0)->member)
 
enum  { OFC_FALSE = 0 , OFC_TRUE = 1 }
 
enum  OFC_LOG_LEVEL { OFC_LOG_FATAL = 0 , OFC_LOG_WARN = 1 , OFC_LOG_INFO = 2 , OFC_LOG_DEBUG = 3 }
 
typedef long int OFC_SIZET
 
typedef int OFC_INT
 
typedef unsigned int OFC_UINT
 
typedef int OFC_INT32
 
typedef short int OFC_INT16
 
typedef char OFC_INT8
 
typedef char OFC_CHAR
 
typedef char OFC_BYTE
 
typedef OFC_BYTEOFC_LPBYTE
 
typedef unsigned char OFC_UCHAR
 
typedef void OFC_VOID
 
typedef long OFC_LONG
 
typedef OFC_LONGOFC_PLONG
 
typedef short OFC_SHORT
 
typedef unsigned int OFC_UINT32
 
typedef unsigned short int OFC_UINT16
 
typedef unsigned char OFC_UINT8
 
typedef unsigned long long int OFC_UINT64
 
typedef long long int OFC_INT64
 
typedef OFC_INT64 OFC_LARGE_INTEGER
 
typedef OFC_LARGE_INTEGER OFC_OFFT
 
typedef unsigned long OFC_ULONG
 
typedef OFC_ULONGOFC_LPULONG
 
typedef OFC_UINT64 OFC_ULONG_PTR
 
typedef const OFC_VOID OFC_CVOID
 
typedef OFC_WCHAR * OFC_LPWSTR
 
typedef OFC_WCHAR * OFC_LMSTR
 
typedef const OFC_WCHAR OFC_CWCHAR
 
typedef const OFC_WCHAR * OFC_LPCWSTR
 
typedef const OFC_CHAR OFC_CCHAR
 
typedef OFC_CHAROFC_LPSTR
 
typedef const OFC_CHAROFC_LPCSTR
 
typedef OFC_UINT16 OFC_WORD
 
typedef OFC_UINT32 OFC_DWORD
 
typedef OFC_DWORDOFC_LPDWORD
 
typedef OFC_UINT64 OFC_DWORD_PTR
 
typedef OFC_VOIDOFC_LPVOID
 
typedef OFC_VOIDOFC_PVOID
 
typedef const OFC_VOIDOFC_LPCVOID
 
typedef OFC_WCHAR OFC_TCHAR
 
typedef const OFC_WCHAR OFC_CTCHAR
 
typedef OFC_TCHAR OFC_TACHAR
 
typedef const OFC_TCHAR OFC_CTACHAR
 
typedef OFC_TCHAROFC_LPTSTR
 
typedef OFC_TACHAROFC_LPTASTR
 
typedef const OFC_TCHAROFC_LPCTSTR
 
typedef const OFC_TACHAROFC_LPCTASTR
 
typedef OFC_INT32 OFC_MSTIME
 
typedef OFC_UCHAR OFC_UUID[OFC_UUID_LEN]
 
typedef OFC_UINT8 OFC_BOOL
 
typedef struct _iovec OFC_IOVEC
 

Macro Definition Documentation

◆ container_of

#define container_of (   ptr,
  type,
  member 
)     (type *)((OFC_CHAR *)(ptr)-(OFC_CHAR *)&((type *)0)->member)

Container of macro

Parameters
ptrPointer to field within structure
typeType of structure
membermember name withing structure
Returns
offset to member field within structure

◆ OFC_DWORD_MASK

#define OFC_DWORD_MASK   0xFFFFFFFF

The mask to associate with a double word

◆ OFC_LARGE_INTEGER_AND

#define OFC_LARGE_INTEGER_AND (   x,
  y,
 
)    (x)&=((OFC_LARGE_INTEGER)(z)<<32|(y))

Perform a binary AND between two 64 bit values

Parameters
xResult of AND and first 64 bit value
ylow order 32 bit values to AND with
zhigh order 32 bit values to AND with

◆ OFC_LARGE_INTEGER_ASSIGN

#define OFC_LARGE_INTEGER_ASSIGN (   x,
 
)    x=y

Assign one large integer to another

Parameters
x64 bit integer to receive assignment
y64 bit integer to assign
Examples
test_file.c.

◆ OFC_LARGE_INTEGER_EQUAL

#define OFC_LARGE_INTEGER_EQUAL (   x,
 
)    (x==y)

Compare two large integers

Parameters
xFirst 64 bit integer to compare
ySecond 64 bit integer to compare
Returns
OFC_TRUE if equal, OFC_FALSE otherwise

◆ OFC_LARGE_INTEGER_HIGH

#define OFC_LARGE_INTEGER_HIGH (   x)    ((OFC_UINT32)((x)>>32))

Return the high order 32 bits of a large integer

Parameters
xA 64 bit integer that we wish to get the high order from

◆ OFC_LARGE_INTEGER_INCR

#define OFC_LARGE_INTEGER_INCR (   x)    x++

Increment a 64 bit integer

This insure carry if using two 32 bit values to represent a 64 bit value

Parameters
x64 bit value to increment

◆ OFC_LARGE_INTEGER_INIT

#define OFC_LARGE_INTEGER_INIT (   x,
 
)    (OFC_LARGE_INTEGER)(y)<<32|(x)

Initialize one 64 bit value from two 32 bit values

Parameters
xLow order 32 bit values to initialize with
yHigh order 32 bit values to initialize with
Returns
64 bit value

◆ OFC_LARGE_INTEGER_LOW

#define OFC_LARGE_INTEGER_LOW (   x)    ((OFC_UINT32)((x)&0xFFFFFFFF))

Return the low order 32 bits of a large integer

Parameters
xA 64 bit integer that we wish to get the low order from
Examples
test_file.c.

◆ OFC_LARGE_INTEGER_SET

#define OFC_LARGE_INTEGER_SET (   x,
  y,
 
)    (x)=(OFC_LARGE_INTEGER)(z)<<32|(y)

Initialize a large integer from two 32 bit integers

Parameters
xA 64 bit integer to receive assignment
yA 32 bit integer to assign to the low order 32 bits
zA 32 bit integer to assign to the high order 32 bits
Examples
test_file.c.

◆ OFC_LONG_MAX

#define OFC_LONG_MAX   ((OFC_LONG)(OFC_ULONG_MAX >> 1))

Represents the maximum positive long value

◆ OFC_LONG_MIN

#define OFC_LONG_MIN   ((OFC_LONG)(~OFC_LONG_MAX))

Represents the minimum negative long value

◆ OFC_NULL

◆ OFC_ULONG_MAX

#define OFC_ULONG_MAX   ((OFC_ULONG)(~0L))

Represents the maximum unsigned long value

◆ OFC_UUID_LEN

#define OFC_UUID_LEN   16

The length of a UUID

◆ TACHAR

#define TACHAR (   x)    TCHAR(x)

A default API wide character

◆ TACHAR_AMP

#define TACHAR_AMP   TCHAR('@')

A default API wide character ampersand

◆ TACHAR_BACKSLASH

#define TACHAR_BACKSLASH   TCHAR('\\')

A default API wide character backslash

◆ TACHAR_COLON

#define TACHAR_COLON   TCHAR(':')

A default API wide character colon

◆ TACHAR_EOS

#define TACHAR_EOS   TCHAR('\0')

A default API wide character end of string

◆ TACHAR_SLASH

#define TACHAR_SLASH   TCHAR('/')

A default API wide character slash

◆ TASTR

#define TASTR (   x)    TSTR(x)

A default API wide character String

◆ TCHAR

#define TCHAR (   x)    (const OFC_TCHAR) L##x

A wide character

Parameters
xCharacter to convert to wide
Examples
test_file.c.

◆ TCHAR_AMP

#define TCHAR_AMP   L'@'

A wide character ampersand

◆ TCHAR_BACKSLASH

#define TCHAR_BACKSLASH   L'\\'

A wide character backslash

◆ TCHAR_COLON

#define TCHAR_COLON   L':'

A wide character colon

◆ TCHAR_EOS

#define TCHAR_EOS   L'\0'

A wide character end of string

Examples
test_file.c, and test_path.c.

◆ TCHAR_SLASH

#define TCHAR_SLASH   L'/'

A wide character slash

◆ TSTR

#define TSTR (   x)    (const OFC_TCHAR *) L##x

A wide character String

Parameters
xString to convert to wide character
Examples
smbinit.c, smbls.c, test_file.c, and test_path.c.

Typedef Documentation

◆ OFC_BOOL

Represents a Boolean value

This should be a 8 bit value on a windows system to be compatable with Windows BOOL

◆ OFC_BYTE

typedef char OFC_BYTE

Another representation of a character byte

◆ OFC_CCHAR

typedef const OFC_CHAR OFC_CCHAR

Represents a constant character

◆ OFC_CHAR

typedef char OFC_CHAR

Represents a character byte

◆ OFC_CTACHAR

typedef const OFC_TCHAR OFC_CTACHAR

Represents a wide character constant

◆ OFC_CTCHAR

typedef const OFC_WCHAR OFC_CTCHAR

Represents a wide character constant

◆ OFC_CVOID

typedef const OFC_VOID OFC_CVOID

Represents a void constant

◆ OFC_CWCHAR

typedef const OFC_WCHAR OFC_CWCHAR

Represents a constant wide character

◆ OFC_DWORD

Represents a generic double word

Examples
test_file.c.

◆ OFC_DWORD_PTR

Represents a pointer to a double word

◆ OFC_INT

typedef int OFC_INT

Represents a generic platform default integer

◆ OFC_INT16

typedef short int OFC_INT16

Represents a 16 bit signed integer

◆ OFC_INT32

typedef int OFC_INT32

Represents a 32 bit signed integer

◆ OFC_INT64

typedef long long int OFC_INT64

Represents a signed 64 bit value

◆ OFC_INT8

typedef char OFC_INT8

Represents an 8 bit signed integer

◆ OFC_IOVEC

typedef struct _iovec OFC_IOVEC

An IO Vector used by SASL

◆ OFC_LARGE_INTEGER

Represents a generic large integer

◆ OFC_LMSTR

typedef OFC_WCHAR* OFC_LMSTR

Another representation of a pointer to a wide character string

◆ OFC_LONG

typedef long OFC_LONG

Represents a generic long value

◆ OFC_LPBYTE

typedef OFC_BYTE* OFC_LPBYTE

A pointer to a character byte array

◆ OFC_LPCSTR

typedef const OFC_CHAR* OFC_LPCSTR

Represents a pointer to a constant character string

◆ OFC_LPCTASTR

typedef const OFC_TACHAR* OFC_LPCTASTR

Represents a pointer to a default API wide character constant string

◆ OFC_LPCTSTR

typedef const OFC_TCHAR* OFC_LPCTSTR

Represents a pointer to a wide character constant string

◆ OFC_LPCVOID

typedef const OFC_VOID* OFC_LPCVOID

Represents a pointer to a constant element

◆ OFC_LPCWSTR

typedef const OFC_WCHAR* OFC_LPCWSTR

Represents a pointer to a constant wide character string

◆ OFC_LPDWORD

Represents a pointer to an array of double words

◆ OFC_LPSTR

typedef OFC_CHAR* OFC_LPSTR

Represents a pointer to a character string

◆ OFC_LPTASTR

Represents a Pointer to a default API wide character

◆ OFC_LPTSTR

Represents a Pointer to a wide character string

◆ OFC_LPULONG

Represents a pointer to an Unsigned Long

◆ OFC_LPVOID

typedef OFC_VOID* OFC_LPVOID

Represents a pointer to a void element

◆ OFC_LPWSTR

typedef OFC_WCHAR* OFC_LPWSTR

Represents a pointer to a wide character string

◆ OFC_MSTIME

Represents a Millisecond time value

◆ OFC_OFFT

Represents an offset into a structure

◆ OFC_PLONG

typedef OFC_LONG* OFC_PLONG

Represents a pointer to a generic long value

◆ OFC_PVOID

typedef OFC_VOID* OFC_PVOID

Another representation of a pointer to a void element

◆ OFC_SHORT

typedef short OFC_SHORT

Represents a generic short value

◆ OFC_SIZET

typedef long int OFC_SIZET

Represents the size of a string or structure

◆ OFC_TACHAR

Represents a wide character

◆ OFC_TCHAR

typedef OFC_WCHAR OFC_TCHAR

Represents a wide character

◆ OFC_UCHAR

typedef unsigned char OFC_UCHAR

Represents an unsigned 8 bit character

◆ OFC_UINT

typedef unsigned int OFC_UINT

Represents a generic platform default unsigned integer

◆ OFC_UINT16

typedef unsigned short int OFC_UINT16

Represents a 16 bit unsigned integer

◆ OFC_UINT32

typedef unsigned int OFC_UINT32

Represents a 32 bit unsigned integer

◆ OFC_UINT64

typedef unsigned long long int OFC_UINT64

Represents an unsigned 64 bit value

◆ OFC_UINT8

typedef unsigned char OFC_UINT8

Represents an 8 bit unsigned integer

◆ OFC_ULONG

typedef unsigned long OFC_ULONG

Represents a generic unsigned long value

Examples
test_file.c.

◆ OFC_ULONG_PTR

Represents a pointer to a 64 bit value

◆ OFC_UUID

typedef OFC_UCHAR OFC_UUID[OFC_UUID_LEN]

Represents a UUID

◆ OFC_VOID

typedef void OFC_VOID

Represents a generic VOID

◆ OFC_WORD

Represents a Generic WORD

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Values of a Boolean

Enumerator
OFC_FALSE 

The value is false

OFC_TRUE 

The value is true

◆ OFC_LOG_LEVEL

Log Level

Values that represent the criticality of a log message and the threshold of logging on the system

Enumerator
OFC_LOG_FATAL 

Fatal error

OFC_LOG_WARN 

Warning

OFC_LOG_INFO 

Info Level

OFC_LOG_DEBUG 

Debug Only