Sturk 1.1.0
Publish-subscribe C implementation.
Loading...
Searching...
No Matches
sys.h File Reference

System procedures. More...

#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
Include dependency graph for sys.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  StException
 Exception. More...
 

Functions

int st_snprintf (char *buffer, size_t bufsz, const char *format,...)
 
int st_remove (const char *filename)
 
void st_except (const char *reason, const char *file, int line)
 Log error reason and call exit(EXIT_FAILURE).
 

Variables

static const struct StException st_except_null_param = {"Null param."}
 Exception: "null_param".
 
static const struct StException st_except_alloc_fail = {"Memory allocation failed."}
 Exception: "alloc_fail".
 
static const struct StException st_except_sem_fail = {"Semaphore failure."}
 Exception: "sem_fail".
 
static const struct StException st_except_mutex_fail = {"Mutex failure."}
 Exception: "mutex_fail".
 
static const struct StException st_except_not_supported = {"Not supported."}
 Exception: "not_supported".
 
static const struct StException st_except_sanity_fail = {"Sanity check failed."}
 Exception: "sanity_fail".
 

Detailed Description

System procedures.

Function Documentation

◆ st_except()

void st_except ( const char *  reason,
const char *  file,
int  line 
)

Log error reason and call exit(EXIT_FAILURE).

Parameters
[in]reasonThe reason.
[in]fileThe path to the calling source file.
[in]lineThe number of the calling line of code from the source file.

◆ st_remove()

int st_remove ( const char *  filename)
See also
remove()

◆ st_snprintf()

int st_snprintf ( char *  buffer,
size_t  bufsz,
const char *  format,
  ... 
)
See also
snprintf()