openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
mmc_error.h File Reference

Error handling functions and codes. More...

#include <stdio.h>
Include dependency graph for mmc_error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PRINT_ERR_LINE(e)   printf("%s line %d: %s\n", __FILE__, __LINE__, get_error_str(e))
 Print the file name, line number and error description.
 

Enumerations

enum  mmc_err {
  MMC_OK , MMC_OOM_ERR , MMC_IO_ERR , MMC_INVALID_ARG_ERR ,
  MMC_TIMEOUT_ERR , MMC_RESOURCE_ERR , MMC_UNKNOWN_ERR
}
 

Functions

const char * get_error_str (mmc_err e)
 Get the corresponding string for an error code.
 

Detailed Description

Error handling functions and codes.

Author
Augusto Fraga Giachero augus.nosp@m.to.f.nosp@m.raga@.nosp@m.cnpe.nosp@m.m.br

Macro Definition Documentation

◆ PRINT_ERR_LINE

#define PRINT_ERR_LINE ( e)    printf("%s line %d: %s\n", __FILE__, __LINE__, get_error_str(e))

Print the file name, line number and error description.

Parameters
[in]eError code

Enumeration Type Documentation

◆ mmc_err

enum mmc_err
Enumerator
MMC_OK 
MMC_OOM_ERR 
MMC_IO_ERR 
MMC_INVALID_ARG_ERR 
MMC_TIMEOUT_ERR 
MMC_RESOURCE_ERR 
MMC_UNKNOWN_ERR 

Function Documentation

◆ get_error_str()

const char * get_error_str ( mmc_err e)

Get the corresponding string for an error code.

Parameters
[in]eError code
Returns
a pointer to a null-terminated string