libsir 2.2.6
Standard Incident Reporter
Loading...
Searching...
No Matches
Collaboration diagram for Types:

Data Structures

struct  sir_errorinfo
 Information about an error that occurred. More...
 
struct  sir_textstyle
 Container for all the information associated with the appearance of text in the context of stdio. More...
 
struct  sir_stdio_dest
 Configuration for stdio destinations (stdout and stderr). More...
 
struct  sir_syslog_dest
 Configuration for the system logger destination. More...
 
struct  sirinit
 libsir initialization and configuration data. More...
 
struct  sir_syslog_dest._state
 Reserved for internal use; do not modify. More...
 

Macros

#define SIRL_NONE   0x0000U
 No output.
 
#define SIRL_EMERG   0x0001U
 Nuclear war, Armageddon, etc.
 
#define SIRL_ALERT   0x0002U
 Action required ASAP.
 
#define SIRL_CRIT   0x0004U
 Critical errors.
 
#define SIRL_ERROR   0x0008U
 Errors.
 
#define SIRL_WARN   0x0010U
 Warnings that could likely be ignored.
 
#define SIRL_NOTICE   0x0020U
 Normal but significant.
 
#define SIRL_INFO   0x0040U
 Informational messages.
 
#define SIRL_DEBUG   0x0080U
 Debugging/diagnostic output.
 
#define SIRL_ALL   0x00ffU
 Include all logging levels.
 
#define SIRL_DEFAULT   0x0100U
 Default levels for this type of destination.
 
#define SIRO_ALL   0x00000000U
 Include all formatting and functionality.
 
#define SIRO_NOTIME   0x00000100U
 Exclude time stamps (implies SIRO_NOMSEC).
 
#define SIRO_NOMSEC   0x00000200U
 Exclude millisecond-resolution in time stamps.
 
#define SIRO_NOHOST   0x00000400U
 Exclude local hostname.
 
#define SIRO_NOLEVEL   0x00000800U
 Exclude human-readable logging level.
 
#define SIRO_NONAME   0x00001000U
 Exclude process/app name.
 
#define SIRO_NOPID   0x00002000U
 Exclude process ID.
 
#define SIRO_NOTID   0x00004000U
 Exclude thread ID/name.
 
#define SIRO_NOHDR   0x00010000U
 Don't write header messages to log files.
 
#define SIRO_MSGONLY   0x00007f00U
 Sets all other options except SIRO_NOHDR.
 
#define SIRO_DEFAULT   0x00100000U
 Default options for this type of destination.
 

Typedefs

typedef uint32_t sirfileid
 Log file identifier type.
 
typedef uint32_t sirpluginid
 Plugin module identifier type.
 
typedef uint16_t sir_level
 The sir_level type.
 
typedef uint16_t sir_levels
 sir_level bitmask type.
 
typedef uint32_t sir_option
 The sir_option type.
 
typedef uint32_t sir_options
 sir_option bitmask type.
 
typedef uint32_t sir_textcolor
 stdio text color type.
 

Enumerations

enum  sir_errorcode {
  SIR_E_NOERROR = 1 ,
  SIR_E_NOTREADY = 2 ,
  SIR_E_ALREADY = 3 ,
  SIR_E_DUPITEM = 4 ,
  SIR_E_NOITEM = 5 ,
  SIR_E_NOROOM = 6 ,
  SIR_E_OPTIONS = 7 ,
  SIR_E_LEVELS = 8 ,
  SIR_E_TEXTSTYLE = 9 ,
  SIR_E_STRING = 10 ,
  SIR_E_NULLPTR = 11 ,
  SIR_E_INVALID = 12 ,
  SIR_E_NODEST = 13 ,
  SIR_E_UNAVAIL = 14 ,
  SIR_E_INTERNAL = 15 ,
  SIR_E_COLORMODE = 16 ,
  SIR_E_TEXTATTR = 17 ,
  SIR_E_TEXTCOLOR = 18 ,
  SIR_E_PLUGINBAD = 19 ,
  SIR_E_PLUGINDAT = 20 ,
  SIR_E_PLUGINVER = 21 ,
  SIR_E_PLUGINERR = 22 ,
  SIR_E_PLATFORM = 23 ,
  SIR_E_UNKNOWN = 4095
}
 Error codes. More...
 
enum  sir_colormode {
  SIRCM_16 = 0 ,
  SIRCM_256 = 1 ,
  SIRCM_RGB = 2 ,
  SIRCM_INVALID = 3
}
 Color mode selection. More...
 
enum  sir_textattr {
  SIRTA_NORMAL = 0 ,
  SIRTA_BOLD = 1 ,
  SIRTA_DIM = 2 ,
  SIRTA_EMPH = 3 ,
  SIRTA_ULINE = 4
}
 Attributes for stdio output. More...
 
enum  {
  SIRTC_BLACK = 0 ,
  SIRTC_RED = 1 ,
  SIRTC_GREEN = 2 ,
  SIRTC_YELLOW = 3 ,
  SIRTC_BLUE = 4 ,
  SIRTC_MAGENTA = 5 ,
  SIRTC_CYAN = 6 ,
  SIRTC_LGRAY = 7 ,
  SIRTC_DGRAY = 8 ,
  SIRTC_BRED = 9 ,
  SIRTC_BGREEN = 10 ,
  SIRTC_BYELLOW = 11 ,
  SIRTC_BBLUE = 12 ,
  SIRTC_BMAGENTA = 13 ,
  SIRTC_BCYAN = 14 ,
  SIRTC_WHITE = 15 ,
  SIRTC_DEFAULT = 256
}
 Colors for stdio output (16-color mode). More...
 

Detailed Description


Data Structure Documentation

◆ sir_errorinfo

struct sir_errorinfo

Information about an error that occurred.

Granular error information in order to provide the caller with flexibility in regards to error handling and formatting.

Data Fields
uint16_t code Numeric error code (see sir_errorcode).
const char * file Name of the file in which the error occurred.
const char * func Name of the function in which the error occurred.
uint32_t line Line number at which the error occurred.
char msg[SIR_MAXERROR] Error message associated with code.
int os_code If an OS/libc error, the relevant code.
char os_msg[SIR_MAXERROR] If an OS/libc error, the relevant message.

◆ sir_textstyle

struct sir_textstyle

Container for all the information associated with the appearance of text in the context of stdio.

For 4-bit (16-color) and 8-bit (256-color) modes, fg and bg are simply the associated SIRTC_* value. For 24-bit RGB color mode, fg and bg are packed as follows: 0x00rrggbb.

Data Fields
sir_textattr attr Text attributes.
sir_textcolor bg Background color.
sir_textcolor fg Foreground color.

◆ sir_stdio_dest

struct sir_stdio_dest

Configuration for stdio destinations (stdout and stderr).

See also
sir_syslog_dest
Data Fields
sir_levels levels sir_level bitmask defining output levels to register for.
sir_options opts sir_option bitmask defining the formatting of output.

◆ sir_syslog_dest

struct sir_syslog_dest

Configuration for the system logger destination.

See also
sir_stdio_dest
Data Fields
struct sir_syslog_dest._state _state Reserved for internal use; do not modify.
char category[SIR_MAX_SYSLOG_CAT] The category string to pass to the system logger.
See also
sir_syslogcat
char identity[SIR_MAX_SYSLOG_ID] The identity string to pass to the system logger.
See also
sir_syslogid
sir_levels levels sir_level bitmask defining levels to register for.
sir_options opts sir_option bitmask defining the formatting of output.
Remarks
Unlike the stdio and log file destinations, not all options are supported. This is due to the fact that system logging facilities typically already include the information represented by sir_option on their own.

Furthermore, the supported options vary based on the system logging facility in use.

Note
If your system supports syslog, and libsir is compiled with the intent to use it (SIR_SYSLOG_ENABLED is defined), then at least SIRO_NOPID is supported.

◆ sirinit

struct sirinit

libsir initialization and configuration data.

Note
Pass a pointer to an instance of this structure to sir_init to begin using libsir.
See also
sir_makeinit
sir_stdio_dest
sir_syslog_dest
Data Fields
sir_stdio_dest d_stderr stderr configuration.
sir_stdio_dest d_stdout stdout configuration.
sir_syslog_dest d_syslog System logger configuration.
char name[SIR_MAXNAME] The name to use in log messages (usually the process name).

Set SIRO_NONAME in a destination's options bitmask to suppress it.

◆ sir_syslog_dest._state

struct sir_syslog_dest._state

Reserved for internal use; do not modify.

Data Fields
void * logger System logger handle/identifier.
uint32_t mask State bitmask.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Colors for stdio output (16-color mode).

Enumerator
SIRTC_BLACK 

Black.

SIRTC_RED 

Red.

SIRTC_GREEN 

Green.

SIRTC_YELLOW 

Yellow.

SIRTC_BLUE 

Blue.

SIRTC_MAGENTA 

Magenta.

SIRTC_CYAN 

Cyan.

SIRTC_LGRAY 

Light gray.

SIRTC_DGRAY 

Dark gray.

SIRTC_BRED 

Bright red.

SIRTC_BGREEN 

Bright green.

SIRTC_BYELLOW 

Bright yellow.

SIRTC_BBLUE 

Bright blue.

SIRTC_BMAGENTA 

Bright magenta.

SIRTC_BCYAN 

Bright cyan.

SIRTC_WHITE 

White.

SIRTC_DEFAULT 

Represents the default color.

◆ sir_colormode

Color mode selection.

Enumerator
SIRCM_16 

4-bit 16-color mode.

SIRCM_256 

8-bit 256-color mode.

SIRCM_RGB 

24-bit RGB-color mode.

SIRCM_INVALID 

Represents the invalid color mode.

◆ sir_errorcode

Error codes.

Enumerator
SIR_E_NOERROR 

The operation completed successfully.

SIR_E_NOTREADY 

libsir has not been initialized

SIR_E_ALREADY 

libsir is already initialized

SIR_E_DUPITEM 

Item already managed by libsir.

SIR_E_NOITEM 

Item not managed by libsir.

SIR_E_NOROOM 

Maximum number of items already stored.

SIR_E_OPTIONS 

Option flags are invalid.

SIR_E_LEVELS 

Level flags are invalid.

SIR_E_TEXTSTYLE 

Text style is invalid.

SIR_E_STRING 

Invalid string argument.

SIR_E_NULLPTR 

NULL pointer argument.

SIR_E_INVALID 

Invalid argument.

SIR_E_NODEST 

No destinations registered for level.

SIR_E_UNAVAIL 

Feature is disabled or unavailable.

SIR_E_INTERNAL 

An internal error has occurred.

SIR_E_COLORMODE 

Color mode is invalid.

SIR_E_TEXTATTR 

Text attributes are invalid.

SIR_E_TEXTCOLOR 

Text color is invalid for mode.

SIR_E_PLUGINBAD 

Plugin module is malformed.

SIR_E_PLUGINDAT 

Data produced by plugin is invalid.

SIR_E_PLUGINVER 

Plugin interface version unsupported.

SIR_E_PLUGINERR 

Plugin reported failure.

SIR_E_PLATFORM 

Platform error code %d: %s.

SIR_E_UNKNOWN 

Unknown error.

◆ sir_textattr

Attributes for stdio output.

Enumerator
SIRTA_NORMAL 

Normal text.

SIRTA_BOLD 

Bold text.

SIRTA_DIM 

Dimmed text.

SIRTA_EMPH 

Italicized/emphasized text.

SIRTA_ULINE 

Underlined text.