defs/si_sys/defs.h File Reference

A file of standard typedefs used to make porting code easier, and APIs more consistent. More...

#include <stdlib.h>

Go to the source code of this file.

Defines

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

Simple integer type portability

#define _T(s)   s
enum  s_bool { seFalse = 0, seTrue }
typedef unsigned char s_uint8
typedef char s_int8
typedef unsigned short s_uint16
typedef short s_int16
typedef unsigned int s_uint32
typedef int s_int32
typedef long long s_int64
typedef unsigned long long s_uint64
typedef char TCHAR

Simple error handling facilities

#define sc_status_success   0
#define sc_status_failure   -1
#define sc_err_outOfMemory   (0xF0000001)
#define sc_err_badArgument   (0xF0000002)
#define sc_err_nullArgument   (0xF0000003)
#define sc_err_invalidIterator   (0xF0000004)
#define sm_status_failed(s)   ((s) & 0x80000000)
#define sm_status_succeeded(s)   (!sm_status_failed(s))
#define sm_status_returnIfFailed(s)
#define sm_status_returnError(s, e)
#define sm_status_return(s)   return s
typedef int sc_status
void dbgbreak (sc_status s)


Detailed Description

A file of standard typedefs used to make porting code easier, and APIs more consistent.


Define Documentation

#define sm_status_returnError ( s,
 ) 

Value:

do { \
                                     (s) = (e); \
                                     dbgbreak(s);\
                                     return (s);\
                                   } while(0)
Returns error e in status s.
Note:
In debug mode, the initial line where an error was generated calls the function dbgbreak(). Try setting a break point in this function and then looking back up the call stack to find the line where the error originated.

#define sm_status_returnIfFailed (  ) 

Value:

do { \
                                      if(sm_status_failed(s)) \
                                        return (s);\
                                    } while(0)


doxygen