Harlequin RIP SDK
Standard integer and Bool types

Macros

#define MAXUINT64   UINT64_MAX
 Maximum value of 64-bit unsigned integer.
 
#define MAXINT64   INT64_MAX
 Maximum value of 64-bit signed integer.
 
#define MININT64   INT64_MIN
 Minimum value of 64-bit signed integer.
 
#define HQN_INT64   int64_t
 Assume that 64-bit integers are supported from C99 onwards.
 
#define MAXUINT8   ((uint8)255)
 Maximum value of 8-bit unsigned integer.
 
#define MAXINT8   ((int8)127)
 Maximum value of 8-bit signed integer.
 
#define MININT8   ((int8)-128)
 Minimum value of 8-bit signed integer.
 
#define MAXUINT16   ((uint16)65535)
 Maximum value of 16-bit unsigned integer.
 
#define MAXINT16   ((int16)32767)
 Maximum value of 16-bit signed integer.
 
#define MININT16   ((int16)-32768)
 Minimum value of 16-bit signed integer.
 
#define MAXUINT32   0xffffffffU
 Maximum value of 32-bit unsigned integer.
 
#define MAXINT32   ((int32)0x7fffffff)
 Maximum value of 32-bit signed integer.
 
#define MININT32   ((int32)0x80000000)
 Minimum value of 32-bit signed integer.
 
#define MAXINT   MAXINT32
 Maximum value of signed integer. More...
 
#define MININT   MININT32
 Minimum value of signed integer. More...
 
#define MAXUINT   MAXUINT32
 Minimum value of unsigned integer. More...
 
#define SIZE_MAX   MAXUINT64
 Maximum value of size_t.
 
#define UINTPTR_MAX   MAXUINT64
 Maximum value of uintptr_t.
 
#define TRUE   1
 HqBool boolean true value. More...
 
#define FALSE   0
 HqBool boolean false value. More...
 
#define BOOL_IS_VALID(bool_)   ((bool_) == TRUE || (bool_) == FALSE)
 Validate boolean values. More...
 
#define HQNIDENT_MAX   MAXINT32
 Maximum value of an HqnIdent before wrap-around.
 
#define HQNIDENT_MIN   MININT32
 Minimum value of an HqnIdent after wrap-around.
 

Typedefs

typedef int8_t int8
 8-bit signed integer
 
typedef uint8_t uint8
 8-bit unsigned integer
 
typedef int16_t int16
 16-bit signed integer
 
typedef uint16_t uint16
 16-bit unsigned integer
 
typedef int32_t int32
 32-bit signed integer
 
typedef uint32_t uint32
 32-bit unsigned integer
 
typedef int64_t int64
 64-bit signed integer
 
typedef uint64_t uint64
 64-bit unsigned integer
 
typedef int HqBool
 Harlequin standard boolean type. More...
 
typedef intptr_t HqnFileDescriptor
 The type of a file descriptor on a device. More...
 
typedef int32 HqnIdent
 HqnIdent identifiers. More...
 
typedef int32 HqnResult
 HqnResult return types. More...
 

Enumerations

enum  { HQN_RESULT_SUCCESS = 0 }
 

Detailed Description

Integer and Bool types for specific sizes.

These types were created before C99, and so use Harlequin-specific names rather than those from <stdint.h>.

Macro Definition Documentation

◆ BOOL_IS_VALID

#define BOOL_IS_VALID (   bool_)    ((bool_) == TRUE || (bool_) == FALSE)

Validate boolean values.

Check a boolean value to make sure it is true or false. This should only be used for Bool variables. C language conventions are normally used, so non-zero values are true and zero values are false.

◆ FALSE

#define FALSE   0

HqBool boolean false value.

C boolean conventions are used. Zero values are false.

◆ MAXINT

#define MAXINT   MAXINT32

Maximum value of signed integer.

This is a compatibility definition. Please use the explicitly-sized maximum/minimum values instead of this define.

◆ MAXUINT

#define MAXUINT   MAXUINT32

Minimum value of unsigned integer.

This is a compatibility definition. Please use the explicitly-sized maximum/minimum values instead of this define.

◆ MININT

#define MININT   MININT32

Minimum value of signed integer.

This is a compatibility definition. Please use the explicitly-sized maximum/minimum values instead of this define.

◆ TRUE

#define TRUE   1

HqBool boolean true value.

C boolean conventions are used. Any non-zero value is true.

Typedef Documentation

◆ HqBool

typedef int HqBool

Harlequin standard boolean type.

Note that we do not use the C++ or C99 definitions of boolean types, because we want the type to have the same size in function prototypes and structures linked between the different languages. We use the native machine integer rather than give it an explicit size for efficiency.

◆ HqnFileDescriptor

The type of a file descriptor on a device.

Device file descriptors on 64 bit platforms are 64 bits wide.

◆ HqnIdent

typedef int32 HqnIdent

HqnIdent identifiers.

HqnIdent is a superclass of identifiers used by the RDR, Event and Timeline APIs and are defined to be interworkable. It is therefore possible to use a Timeline reference as an RDR ID within some Class and Type, for example. HqnIdent is also typedeffed for monitor and error UIDs (as sw_mon_type).

◆ HqnResult

typedef int32 HqnResult

HqnResult return types.

HqnResult is used as a return type for some API functions in the core and Harlequin SDK. Declaring HqnResult as a return type or out parameter for a function indicates that the function follows these semantics:

  • The value 0 (aka HQN_RESULT_SUCCESS) indicates a successful operation;
  • Any value greater than or equal to MON_CLASS_ERROR is a well-formed error code, according to the rules for sw_mon_type. In particular, it should have a valid PS error number in the MON_MASK_ERRORNUM bits. It should preferably have a unique ID for that error class and number in the MON_MASK_UNIQUE bits.
  • Small magnitude negative or positive values may be used to indicate other success or return codes, but these should be filtered out by clients or converted to HQN_RESULT_SUCCESS or an error code if the result is to be passed to the core's error handler. Small negative values are recommended, so that positive values less than MON_CLASS_ERROR can be used for sw_mon_type messages, if appropriate, and so that the MON_PSERROR() macro will return that value.
  • If an API function returning or setting an HqnResult does not declare any extra result values, and does not document that it explicitly supports other sw_mon_type classes, clients may test the HqnResult as a boolean to determine if the operation succeeded or failed.

HqnResult is assignment-compatible with the monitor UID type (sw_mon_type).

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Standard values for HqnResult type.

Enumerator
HQN_RESULT_SUCCESS 

Operation succeeded.