2015-03-03 00:38:33 +08:00
|
|
|
/****************************************************************************
|
2015-05-28 15:40:24 +08:00
|
|
|
** gmio
|
2015-05-01 00:19:45 +08:00
|
|
|
** Copyright Fougue (2 Mar. 2015)
|
2015-07-13 17:42:03 +08:00
|
|
|
** contact@fougue.pro
|
2015-03-03 00:38:33 +08:00
|
|
|
**
|
|
|
|
** This software is a reusable library whose purpose is to provide complete
|
|
|
|
** I/O support for various CAD file formats (eg. STL)
|
|
|
|
**
|
|
|
|
** This software is governed by the CeCILL-B license under French law and
|
|
|
|
** abiding by the rules of distribution of free software. You can use,
|
|
|
|
** modify and/ or redistribute the software under the terms of the CeCILL-B
|
|
|
|
** license as circulated by CEA, CNRS and INRIA at the following URL
|
2015-03-30 15:05:25 +08:00
|
|
|
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
|
2015-03-03 00:38:33 +08:00
|
|
|
****************************************************************************/
|
|
|
|
|
2015-03-05 01:25:51 +08:00
|
|
|
/*! \file error.h
|
|
|
|
* List of common errors, reported by I/O functions
|
2015-09-09 17:44:34 +08:00
|
|
|
*
|
|
|
|
* \addtogroup gmio_core
|
|
|
|
* @{
|
2015-03-05 01:25:51 +08:00
|
|
|
*/
|
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#ifndef GMIO_ERROR_H
|
|
|
|
#define GMIO_ERROR_H
|
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
|
|
|
|
/*! This enum defines common errors */
|
|
|
|
enum gmio_error
|
|
|
|
{
|
2015-03-03 17:35:36 +08:00
|
|
|
/*! No error occurred, success */
|
2015-04-02 16:04:24 +08:00
|
|
|
GMIO_ERROR_OK = 0,
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-03-03 17:35:36 +08:00
|
|
|
/*! Pointer on argument gmio_transfer_t is NULL */
|
2015-05-28 22:19:31 +08:00
|
|
|
GMIO_ERROR_NULL_TRANSFER,
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-09-25 19:16:41 +08:00
|
|
|
/*! Pointer on argument memory block is NULL */
|
|
|
|
GMIO_ERROR_NULL_MEMBLOCK,
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-09-25 19:16:41 +08:00
|
|
|
/*! Argument size for the memory block is too small */
|
|
|
|
GMIO_ERROR_INVALID_MEMBLOCK_SIZE,
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-04-02 16:04:24 +08:00
|
|
|
/*! An error occurred with gmio_stream */
|
2015-05-28 22:19:31 +08:00
|
|
|
GMIO_ERROR_STREAM,
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-03-13 00:46:40 +08:00
|
|
|
/*! Transfer was stopped by user, that is to say
|
2015-07-10 17:33:05 +08:00
|
|
|
* gmio_transfer::func_is_stop_requested() returned GMIO_TRUE */
|
2015-05-28 22:19:31 +08:00
|
|
|
GMIO_ERROR_TRANSFER_STOPPED,
|
2015-03-24 01:13:07 +08:00
|
|
|
|
2015-05-28 23:31:36 +08:00
|
|
|
/*! An error occured after a call to a <stdio.h> function
|
|
|
|
*
|
|
|
|
* The caller can check errno to get the real error number
|
|
|
|
*/
|
|
|
|
GMIO_ERROR_STDIO,
|
|
|
|
|
2015-03-24 01:13:07 +08:00
|
|
|
/*! Unknown error */
|
2015-05-28 22:19:31 +08:00
|
|
|
GMIO_ERROR_UNKNOWN
|
2014-03-28 23:33:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum gmio_error gmio_error_t;
|
|
|
|
|
2015-03-31 16:10:26 +08:00
|
|
|
/*! Returns true if <tt>code == GMIO_NO_ERROR</tt> */
|
|
|
|
GMIO_INLINE gmio_bool_t gmio_no_error(int code)
|
2015-04-02 16:04:24 +08:00
|
|
|
{ return code == GMIO_ERROR_OK ? GMIO_TRUE : GMIO_FALSE; }
|
2015-03-31 16:10:26 +08:00
|
|
|
|
|
|
|
/*! Returns true if <tt>code != GMIO_NO_ERROR</tt> */
|
|
|
|
GMIO_INLINE gmio_bool_t gmio_error(int code)
|
2015-04-02 16:04:24 +08:00
|
|
|
{ return code != GMIO_ERROR_OK ? GMIO_TRUE : GMIO_FALSE; }
|
2015-03-31 16:10:26 +08:00
|
|
|
|
2014-03-28 23:33:35 +08:00
|
|
|
#endif /* GMIO_ERROR_H */
|
2015-09-09 17:44:34 +08:00
|
|
|
/*! @} */
|