Products Support Documentation Download
psptypes.h File Reference

Header for the Platform Support Package - Platform dependent types. More...

#include "pspplat.h"
#include "psptypes-doxygen.h"
Include dependency graph for psptypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RDM_UNREF(a)   ((void) a)
 
#define RDM_UNSET(a)   = a
 
#define EXTERNAL_FCN_PTR   EXTERNAL_FCN *
 
#define RDM_STARTUP_HOOK
 
#define RDM_SHUTDOWN_HOOK
 
#define RDM_CHAR_T   RDM_CHAR_T
 
#define RDM_T(text)   text
 
#define RDM_TCHAR_T   RDM_TCHAR_T
 
#define RDM_TSTR_FMT   "%s"
 
#define RDM_STARTUP_EXAMPLE(name)
 
#define RDM_LEN(x)   (sizeof (x) / sizeof (x[0]))
 
#define RDM_ASSERT(x)
 
#define RDM_EVAL_ASSERT(x, y)   x
 
#define RDM_MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define RDM_MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define RDM_INT8_MIN   ((int8_t) 0x80U)
 
#define RDM_INT8_MAX   ((int8_t) 0x7FU)
 
#define RDM_UINT8_MAX   ((uint8_t) 0xFFU)
 
#define RDM_INT16_MIN   ((int16_t) 0x8000U)
 
#define RDM_INT16_MAX   ((int16_t) 0x7FFFU)
 
#define RDM_UINT16_MAX   ((uint16_t) 0xFFFFU)
 
#define RDM_INT32_MIN   ((int32_t) 0x80000000U)
 
#define RDM_INT32_MAX   ((int32_t) 0x7FFFFFFFU)
 
#define RDM_UINT32_MAX   ((uint32_t) 0xFFFFFFFFU)
 
#define RDM_INT64_MIN   (-9223372036854775807LL - 1)
 
#define RDM_INT64_MAX   (9223372036854775807LL)
 
#define RDM_UINT64_MAX   (18446744073709551615ULL)
 
#define RDM_INT64_FMT   RDM_T ("%") RDM_64BIT_CODE RDM_T ("d")
 
#define RDM_UINT64_FMT   RDM_T ("%") RDM_64BIT_CODE RDM_T ("u")
 
#define RDM_INT64_FMT_HEX   RDM_T ("%") RDM_64BIT_CODE RDM_T ("X")
 
#define RDM_UINT64_FMT_HEX   RDM_T ("%") RDM_64BIT_CODE RDM_T ("X")
 
#define RDM_INT64_FMT_SIZE(size)   RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("d")
 
#define RDM_UINT64_FMT_SIZE(size)   RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("u")
 
#define RDM_INT64_FMT_SIZE_HEX(size)   RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("X")
 
#define RDM_UINT64_FMT_SIZE_HEX(size)   RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("X")
 
#define RDM_STRINGIFY_(data)   #data
 
#define RDM_STRINGIFY(data)   RDM_STRINGIFY_ (data)
 
#define RDM_BYTES_PER_UTF8_CHAR   4
 
#define RDM_BYTES_PER_UTF8_CHAR_OPTION   ("bytes_per_utf8_char=" RDM_STRINGIFY (RDM_BYTES_PER_UTF8_CHAR))
 
#define RDM_BYTES_PER_UTF8_CHAR_OPTION_VALUE   RDM_STRINGIFY (RDM_BYTES_PER_UTF8_CHAR)
 

Typedefs

typedef struct RDM_ENCRYPT_S * RDM_ENCRYPT
 

Enumerations

enum  RDM_BOOL_T { RDM_FALSE = 0, RDM_TRUE = 1, __RDM_BOOL_MAX = 0x7fffffff }
 
enum  RDM_COMPARE { RDM_LT = -1, RDM_EQ = 0, RDM_GT = 1 }
 
enum  RDM_ENC_TYPE {
  RDM_ENC_NONE, RDM_ENC_XOR, RDM_ENC_AES128, RDM_ENC_AES192,
  RDM_ENC_AES256, RDM_ENC_DEFAULT
}
 

Functions

int32_t psp_threadMain (int32_t(*main)(int32_t argc, const char *const *argv), int argc, const RDM_TCHAR_T *const *argv)
 

Detailed Description

Header for the Platform Support Package - Platform dependent types.

Definition in file psptypes.h.

Macro Definition Documentation

◆ EXTERNAL_FCN_PTR

#define EXTERNAL_FCN_PTR   EXTERNAL_FCN *

Definition at line 92 of file psptypes.h.

◆ RDM_ASSERT

#define RDM_ASSERT (   x)

Definition at line 201 of file psptypes.h.

◆ RDM_BYTES_PER_UTF8_CHAR

#define RDM_BYTES_PER_UTF8_CHAR   4
Examples:
examples/hello_world_structs.h.

Definition at line 294 of file psptypes.h.

◆ RDM_BYTES_PER_UTF8_CHAR_OPTION

#define RDM_BYTES_PER_UTF8_CHAR_OPTION   ("bytes_per_utf8_char=" RDM_STRINGIFY (RDM_BYTES_PER_UTF8_CHAR))

Definition at line 301 of file psptypes.h.

◆ RDM_BYTES_PER_UTF8_CHAR_OPTION_VALUE

#define RDM_BYTES_PER_UTF8_CHAR_OPTION_VALUE   RDM_STRINGIFY (RDM_BYTES_PER_UTF8_CHAR)

Definition at line 303 of file psptypes.h.

◆ RDM_CHAR_T

#define RDM_CHAR_T   RDM_CHAR_T

RDM character

RDM_CHAR_T are always expanded to char. On Windows extra overloaded methods are provided with parameter types wchar_t instead of char

Definition at line 115 of file psptypes.h.

Referenced by RDM_CPP::TFS::_ValidateITFS().

◆ RDM_EVAL_ASSERT

#define RDM_EVAL_ASSERT (   x,
 
)    x

Macro for doing assertions on x == y. Will always evaluate x, even when NDEBUG (or not RDM_ASSERT_ENABLED) is defined

Definition at line 225 of file psptypes.h.

◆ RDM_INT16_MAX

#define RDM_INT16_MAX   ((int16_t) 0x7FFFU)

Maximum value for int64_t

Definition at line 242 of file psptypes.h.

◆ RDM_INT16_MIN

#define RDM_INT16_MIN   ((int16_t) 0x8000U)

Minimum value for int16_t

Definition at line 240 of file psptypes.h.

◆ RDM_INT32_MAX

#define RDM_INT32_MAX   ((int32_t) 0x7FFFFFFFU)

Maximum value for int64_t

Definition at line 248 of file psptypes.h.

◆ RDM_INT32_MIN

#define RDM_INT32_MIN   ((int32_t) 0x80000000U)

Minimum value for int32_t

Definition at line 246 of file psptypes.h.

◆ RDM_INT64_FMT

#define RDM_INT64_FMT   RDM_T ("%") RDM_64BIT_CODE RDM_T ("d")

Format string for 64 bit integer

Definition at line 259 of file psptypes.h.

◆ RDM_INT64_FMT_HEX

#define RDM_INT64_FMT_HEX   RDM_T ("%") RDM_64BIT_CODE RDM_T ("X")

Format string for 64 bit integer in hexadecimal

Definition at line 263 of file psptypes.h.

◆ RDM_INT64_FMT_SIZE

#define RDM_INT64_FMT_SIZE (   size)    RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("d")

Format string for 64 bit integer where size is specified

Definition at line 267 of file psptypes.h.

◆ RDM_INT64_FMT_SIZE_HEX

#define RDM_INT64_FMT_SIZE_HEX (   size)    RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("X")

Format string for 64 bit integer in hexadecimal where size is specified

Definition at line 271 of file psptypes.h.

◆ RDM_INT64_MAX

#define RDM_INT64_MAX   (9223372036854775807LL)

Maximum value for int64_t

Definition at line 254 of file psptypes.h.

◆ RDM_INT64_MIN

#define RDM_INT64_MIN   (-9223372036854775807LL - 1)

Minimum value for int64_t

Definition at line 252 of file psptypes.h.

◆ RDM_INT8_MAX

#define RDM_INT8_MAX   ((int8_t) 0x7FU)

Maximum value for int64_t

Definition at line 236 of file psptypes.h.

◆ RDM_INT8_MIN

#define RDM_INT8_MIN   ((int8_t) 0x80U)

Minimum value for int_t

Definition at line 234 of file psptypes.h.

◆ RDM_LEN

#define RDM_LEN (   x)    (sizeof (x) / sizeof (x[0]))

Macro to get the number of elements in an array of any type

Examples:
tutorials/HelloWorld/hello_worldTutorial_main.c, and tutorials/HelloWorldCPP/hello_worldCPPTutorial_main.cpp.

Definition at line 198 of file psptypes.h.

◆ RDM_MAX

#define RDM_MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

Macro fo taking the max of two arguments of any type

Definition at line 231 of file psptypes.h.

◆ RDM_MIN

#define RDM_MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Macro fo taking the min of two arguments of any type

Definition at line 229 of file psptypes.h.

◆ RDM_SHUTDOWN_HOOK

#define RDM_SHUTDOWN_HOOK

Shutdown hook

Shutdown hook for tools, examples, and tests that are using any of the RDM_STARTUP macros

Definition at line 106 of file psptypes.h.

◆ RDM_STARTUP_EXAMPLE

#define RDM_STARTUP_EXAMPLE (   name)
Value:
int32_t main_##name (int32_t argc, const RDM_TCHAR_T *const *argv); \
int main (int argc, const RDM_TCHAR_T *const *argv) \
{ \
int32_t status; \
\
RDM_STARTUP_HOOK \
status = psp_threadMain (main_##name, argc, argv); \
RDM_SHUTDOWN_HOOK \
return status; \
}
int32_t psp_threadMain(int32_t(*main)(int32_t argc, const char *const *argv), int argc, const RDM_TCHAR_T *const *argv)
#define RDM_TCHAR_T
Definition: psptypes.h:130

Startup for examples

This sets up a main function, with a startup hook, a call to a named main function, and a shutdown hook.

This is used for examples.

Examples:
tutorials/HelloWorld/hello_worldTutorial_main.c, and tutorials/HelloWorldCPP/hello_worldCPPTutorial_main.cpp.

Definition at line 167 of file psptypes.h.

◆ RDM_STARTUP_HOOK

#define RDM_STARTUP_HOOK

Startup hook

Startup hook for tools, examples, and tests that are using any of the RDM_STARTUP macros

Definition at line 99 of file psptypes.h.

◆ RDM_STRINGIFY

#define RDM_STRINGIFY (   data)    RDM_STRINGIFY_ (data)

Definition at line 291 of file psptypes.h.

◆ RDM_STRINGIFY_

#define RDM_STRINGIFY_ (   data)    #data

Definition at line 290 of file psptypes.h.

◆ RDM_T

#define RDM_T (   text)    text

Macro for an RDM string

Definition at line 126 of file psptypes.h.

◆ RDM_TCHAR_T

#define RDM_TCHAR_T   RDM_TCHAR_T

RDM_TCHAR_T is expanded to wchar_t on Windows when _UNICODE is defined. Otherwise it is expanded to char.

Examples:
examples/hello_world_cat.c, and examples/hello_world_cat.h.

Definition at line 130 of file psptypes.h.

◆ RDM_TSTR_FMT

#define RDM_TSTR_FMT   "%s"

Definition at line 134 of file psptypes.h.

◆ RDM_UINT16_MAX

#define RDM_UINT16_MAX   ((uint16_t) 0xFFFFU)

Maximum value for uint64_t

Definition at line 244 of file psptypes.h.

◆ RDM_UINT32_MAX

#define RDM_UINT32_MAX   ((uint32_t) 0xFFFFFFFFU)

Maximum value for uint64_t

Definition at line 250 of file psptypes.h.

◆ RDM_UINT64_FMT

#define RDM_UINT64_FMT   RDM_T ("%") RDM_64BIT_CODE RDM_T ("u")

Format string for 64 bit unsigned integer

Definition at line 261 of file psptypes.h.

◆ RDM_UINT64_FMT_HEX

#define RDM_UINT64_FMT_HEX   RDM_T ("%") RDM_64BIT_CODE RDM_T ("X")

Format string for 64 bit unsigned integer in hexadecimal

Definition at line 265 of file psptypes.h.

◆ RDM_UINT64_FMT_SIZE

#define RDM_UINT64_FMT_SIZE (   size)    RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("u")

Format string for 64 bit unsigned integer where size is specified

Definition at line 269 of file psptypes.h.

◆ RDM_UINT64_FMT_SIZE_HEX

#define RDM_UINT64_FMT_SIZE_HEX (   size)    RDM_T ("%") #size RDM_64BIT_CODE RDM_T ("X")

Format string for 64 bit unsigned integer in hexadecimal where size is specified

Definition at line 274 of file psptypes.h.

◆ RDM_UINT64_MAX

#define RDM_UINT64_MAX   (18446744073709551615ULL)

Maximum value for uint64_t

Definition at line 256 of file psptypes.h.

◆ RDM_UINT8_MAX

#define RDM_UINT8_MAX   ((uint8_t) 0xFFU)

Maximum value for uint64_t

Definition at line 238 of file psptypes.h.

◆ RDM_UNREF

#define RDM_UNREF (   a)    ((void) a)

◆ RDM_UNSET

#define RDM_UNSET (   a)    = a

Definition at line 49 of file psptypes.h.

Typedef Documentation

◆ RDM_ENCRYPT

typedef struct RDM_ENCRYPT_S* RDM_ENCRYPT

RDM encryption handle

Definition at line 73 of file psptypes.h.

Enumeration Type Documentation

◆ RDM_BOOL_T

enum RDM_BOOL_T

Enumeration for RDM boolen values

This enumeration adds support for a platform/language agnostic BOOLEAN value in the RDM library

Enumerator
RDM_FALSE 

enum value for FALSE

RDM_TRUE 

enum value for TRUE

__RDM_BOOL_MAX 

Definition at line 57 of file psptypes.h.

58 {
59  RDM_FALSE = 0,
60  RDM_TRUE = 1,
61  __RDM_BOOL_MAX = 0x7fffffff
62 } RDM_BOOL_T;
RDM_BOOL_T
Definition: psptypes.h:57

◆ RDM_COMPARE

Enumeration for RDM comparison values

Enumerator
RDM_LT 

The first argument is lesser than the second argument

RDM_EQ 

The arguments are equal

RDM_GT 

The first argument is greater than the second argument

Definition at line 66 of file psptypes.h.

67 {
68  RDM_LT = -1,
69  RDM_EQ = 0,
70  RDM_GT = 1
71 } RDM_COMPARE;
RDM_COMPARE
Definition: psptypes.h:66

◆ RDM_ENC_TYPE

Enumeration for RDM encryption algorithms

The enumeration identifies the supported encryption algorithms.

RDM_ENC_XOR is the only type of encryption that is included in packages without export restrictions.

Enumerator
RDM_ENC_NONE 

No encryption

RDM_ENC_XOR 

XOR encryption

RDM_ENC_AES128 

AES-128 encryption

RDM_ENC_AES192 

AES-192 encryption

RDM_ENC_AES256 

AES-256 encryption

RDM_ENC_DEFAULT 

Default encryption

Definition at line 82 of file psptypes.h.

Function Documentation

◆ psp_threadMain()

int32_t psp_threadMain ( int32_t(*)(int32_t argc, const char *const *argv)  main,
int  argc,
const RDM_TCHAR_T *const *  argv 
)