aDefs.h

group aDefs

Acroname Specific Universal Defines and includes.

The C-Interface requires some specific defines for cross platform compatibility. The aDefs.h file contains those defines and includes that are necessary at a global level across platforms.

Things like a cross platform way to specify line endings, safe c-string copy and concatenation operations, and boolean typedefs when they are not defined by default.

We rely on the following std headers:

  • assert.h
  • stddef.h
  • stdint.h
  • stdbool.h
  • string.h
  • stdio.h
  • stdlib.h

aSHOWERR(msg, error)

A macro that will emit an error on stdout including file and line number when compiled without NDEBUG flag. When NDEBUG is defined it emits nothing.

OS_NEW_LN

A macro containing the appropriate line ending characters for a given platform \r\n on windows and \n elsewhere.

aStringCopySafe(d, l, s)

A macro that maps to platform specific safe string copy. Parameters are;.

  • d: destination
  • l: length
  • s: source

aStringCatSafe(d, l, s)

A macro that maps to platform specific safe string concatination. Parameters are;.

  • d: destination
  • l: length
  • s: source

aSNPRINTF

A macro that maps to the platform specific safe printf output.

aLIBEXPORT

A macro that expands for dynamic library linking on a given platform.

aMemPtr

An acroname specific semantic define for a pointer to a chunk of memory.

const char *aDefs_GetModelName(const int modelNum)

Returns a printable model string.