GCGlib  0.04.228
GCG Graphics Engine
Macros for composing and decomposing report codes from/into its components: type, domain, message.

Macros

#define GCG_REPORT_CODE(t, d, m)   (((((int) d) & (int) 0xff) << 3) | ((((int) m) & (int) 0x3ff) << 11) | ((((int) t) & (int) 0x07) << 0))
 Composes an error/warning/information given a triple (TYPE, DOMAIN, MESSAGE) with 3, 8 and 10 bits respectively. More...
 
#define GCG_REPORT_TYPE(c)   ((((int) c) >> 0) & (int) 0x07)
 Extracts the TYPE from a report code. Uses 3 bits. More...
 
#define GCG_REPORT_DOMAIN(c)   ((((int) c) >> 3) & (int) 0xff)
 Extracts the DOMAIN from a report code. Uses 7 bits. More...
 
#define GCG_REPORT_MESSAGE(c)   ((((int) c) >> 11) & (int) 0x3ff)
 Extracts the MESSAGE from a report code. Uses 10 bits. More...
 

Detailed Description

GCGlib has macros for report codes composition and decomposition from/into its components: type, domain, message.

Since
0.02.0

Macro Definition Documentation

◆ GCG_REPORT_CODE

#define GCG_REPORT_CODE (   t,
  d,
 
)    (((((int) d) & (int) 0xff) << 3) | ((((int) m) & (int) 0x3ff) << 11) | ((((int) t) & (int) 0x07) << 0))

Composes an error/warning/information given a triple (TYPE, DOMAIN, MESSAGE) with 3, 8 and 10 bits respectively.

Since
0.02.0

◆ GCG_REPORT_DOMAIN

#define GCG_REPORT_DOMAIN (   c)    ((((int) c) >> 3) & (int) 0xff)

Extracts the DOMAIN from a report code. Uses 7 bits.

Since
0.02.0

◆ GCG_REPORT_MESSAGE

#define GCG_REPORT_MESSAGE (   c)    ((((int) c) >> 11) & (int) 0x3ff)

Extracts the MESSAGE from a report code. Uses 10 bits.

Since
0.02.0

◆ GCG_REPORT_TYPE

#define GCG_REPORT_TYPE (   c)    ((((int) c) >> 0) & (int) 0x07)

Extracts the TYPE from a report code. Uses 3 bits.

Since
0.02.0