Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OBITools3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
5d967f5b
Commit
5d967f5b
authored
Jun 10, 2015
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed typos and other minor things
parent
9b6de9c4
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
171 additions
and
141 deletions
+171
-141
src/obidms.c
src/obidms.c
+8
-5
src/obidms.h
src/obidms.h
+28
-48
src/obidmscolumn.c
src/obidmscolumn.c
+57
-37
src/obidmscolumn.h
src/obidmscolumn.h
+23
-25
src/obierrno.h
src/obierrno.h
+34
-6
src/obilittlebigman.c
src/obilittlebigman.c
+2
-2
src/obilittlebigman.h
src/obilittlebigman.h
+10
-10
src/obitypes.c
src/obitypes.c
+3
-3
src/obitypes.h
src/obitypes.h
+6
-5
No files found.
src/obidms.c
View file @
5d967f5b
...
...
@@ -8,17 +8,17 @@
#include <obidms.h>
/***********************************************************************
/***********************************************************************
*
*
* D E C L A R A T I O N O F T H E P R I V A T E F U N C T I O N S
*
***********************************************************************/
***********************************************************************
*
/
/**
* Internal function building the directory name from a OBIDMS name.
* Internal function building the directory name from a
n
OBIDMS name.
*
* The function build
the directory name corresponding to a
OBIDMS.
* The function build
s the directory name corresponding to an
OBIDMS.
* It checks also that the name is not too long.
*
* @warning The returned pointer has to be freed by the caller.
...
...
@@ -30,7 +30,7 @@
* @retvalue NULL if an error occurs
*
* ###Error values
* - OBIDMS_MEMORY_ERROR : something wrong occur
s
during memory allocation.
* - OBIDMS_MEMORY_ERROR : something wrong occur
ed
during memory allocation.
* - OBIDMS_LONG_NAME_ERROR : the database name exceeds the limit.
*
* @since May 2015
...
...
@@ -58,6 +58,7 @@ static char *build_directory_name(const char *name) {
return
dirdbname
;
}
/***********************************************************************
*
* D E F I N I T I O N O F T H E P R I V A T E F U N C T I O N S
...
...
@@ -111,6 +112,7 @@ OBIDMS_p obi_create_dms(const char *name) {
return
obi_open_dms
(
name
);
}
OBIDMS_p
obi_open_dms
(
const
char
*
name
)
{
OBIDMS_p
dms
=
NULL
;
char
*
dirdbname
;
...
...
@@ -162,6 +164,7 @@ OBIDMS_p obi_open_dms(const char *name) {
return
dms
;
}
OBIDMS_p
obi_dms
(
const
char
*
name
)
{
int
exist
=
obi_dms_exists
(
name
);
...
...
src/obidms.h
View file @
5d967f5b
...
...
@@ -35,43 +35,18 @@ typedef struct OBIDMS {
*/
}
OBIDMS_t
,
*
OBIDMS_p
;
/**
* @defgroup OBIDMSErrors OBIDMS related error codes
*
* Error codes set in errno following an error related
* to the manipulation of an OBIDMS.
*
* @{
*/
#define OBIDMS_EXIST_ERROR (1)
/**< Try to create an OBIDMS with a name
* that corresponds to an existing OBIDMS
*/
#define OBIDMS_NOT_EXIST_ERROR (2)
/**< Try to open a non-existing OBIDMS
*/
#define OBIDMS_LONG_NAME_ERROR (3)
/**< The specified OBIDMS name is too long
*/
#define OBIDMS_MEMORY_ERROR (4)
/**< A memory error occurred during allocation
*/
#define OBIDMS_UNKNOWN_ERROR (5)
/**< Not determined error
*/
#define OBIDMS_ACCESS_ERROR (6)
/**< Permission error for accessing to the database
*/
#define OBIDMS_BAD_ENDIAN_ERROR (7)
/**< The opened data structure does not corresponds
* to the endianess of the platform.
*/
/**@}*/
/*@
* @brief Check
if a OBIDMS exist
* @brief Check
s if an OBIDMS exists
*
* @param name a pointer to a C string containing the name of the database
*
t
he actual directory name used to store the DMS will be
* `<name>.obidms`
* @param name a pointer to a C string containing the name of the database
.
*
T
he actual directory name used to store the DMS will be
* `<name>.obidms`
.
*
* @return an integer value indicating the status of the database
* @retvalue 1 the database exist
* @retvalue 0 the database does not exist
* @retvalue -1 an error occur
s
* @retvalue -1 an error occur
ed
*
* @see obi_close_dms()
* @since May 2015
...
...
@@ -79,15 +54,16 @@ typedef struct OBIDMS {
*/
int
obi_dms_exists
(
const
char
*
name
);
/**
* @brief Create a new OBITools Data Management instance (OBIDMS).
* @brief Create
s
a new OBITools Data Management instance (OBIDMS).
*
* A `DMS` is implemented as a directory. This function
takes care
*
to check
if a directory with this name does not already exist
* before creating the new database
* A `DMS` is implemented as a directory. This function
checks
* if a directory with this name does not already exist
* before creating the new database
.
*
* @param name a pointer to a C string containing the name of the database
*
t
he actual directory name used to store the DMS will be
* @param name a pointer to a C string containing the name of the database
.
*
T
he actual directory name used to store the DMS will be
* `<name>.obidms`
*
* @return a pointer to an OBIDMS structure describing the newly created DMS
...
...
@@ -96,7 +72,7 @@ int obi_dms_exists(const char* name);
* ###Error values
* - OBIDMS_EXIST_ERROR : a database with the same name already exists.
* - OBIDMS_LONG_NAME_ERROR : the database name exceeds the limit.
* - OBIDMS_MEMORY_ERROR : something wrong occur
s
during memory allocation.
* - OBIDMS_MEMORY_ERROR : something wrong occur
ed
during memory allocation.
*
* @see obi_close_dms()
* @since May 2015
...
...
@@ -104,11 +80,12 @@ int obi_dms_exists(const char* name);
*/
OBIDMS_p
obi_create_dms
(
const
char
*
name
);
/**
* @brief Open an existing OBITools Data Management instance (OBIDMS).
* @brief Open
s
an existing OBITools Data Management instance (OBIDMS).
*
* @param name a pointer to a C string containing the name of the database
*
t
he actual directory name used to store the DMS will be
* @param name a pointer to a C string containing the name of the database
.
*
T
he actual directory name used to store the DMS will be
* `<name>.obidms`
*
* @return a pointer to an OBIDMS structure describing the newly created DMS
...
...
@@ -117,7 +94,7 @@ OBIDMS_p obi_create_dms(const char *name);
* ###Error values
* - OBIDMS_EXIST_ERROR : a database with the same name already exists.
* - OBIDMS_LONG_NAME_ERROR : the database name exceeds the limit.
* - OBIDMS_MEMORY_ERROR : something wrong occur
s
during memory allocation.
* - OBIDMS_MEMORY_ERROR : something wrong occur
ed
during memory allocation.
*
* @see obi_close_dms()
* @since May 2015
...
...
@@ -125,14 +102,15 @@ OBIDMS_p obi_create_dms(const char *name);
*/
OBIDMS_p
obi_open_dms
(
const
char
*
name
);
/**
* @brief Create a new OBIDMS instance.
* @brief Create
s
a new OBIDMS instance.
*
* If the database already exist
this function open
it, otherwise it
* creates a new databse.
* If the database already exist
s, this function opens
it, otherwise it
* creates a new datab
a
se.
*
* @param name a pointer to a C string containing the name of the database
*
t
he actual directory name used to store the DMS is
* @param name a pointer to a C string containing the name of the database
.
*
T
he actual directory name used to store the DMS is
* `<name>.obidms`
*
* @return a pointer to an OBIDMS structure describing the newly created DMS
...
...
@@ -140,7 +118,7 @@ OBIDMS_p obi_open_dms(const char *name);
*
* ###Error values
* - OBIDMS_LONG_NAME_ERROR : the database name exceeds the limit.
* - OBIDMS_MEMORY_ERROR : something wrong occur
s
during memory allocation.
* - OBIDMS_MEMORY_ERROR : something wrong occur
ed
during memory allocation.
*
* @see obi_close_dms()
* @since May 2015
...
...
@@ -148,8 +126,9 @@ OBIDMS_p obi_open_dms(const char *name);
*/
OBIDMS_p
obi_dms
(
const
char
*
name
);
/**
* @brief Close an opened OBITools Data Management instance (OBIDMS).
* @brief Close
s
an opened OBITools Data Management instance (OBIDMS).
*
* @param dms a pointer as returned by obi_create_dms() or obi_open_dms()
*
...
...
@@ -165,4 +144,5 @@ OBIDMS_p obi_dms(const char *name);
*/
int
obi_close_dms
(
OBIDMS_p
dms
);
#endif
/* OBIDMS_H_ */
src/obidmscolumn.c
View file @
5d967f5b
/****************************************************************************
* OBIDMS
C
olumn functions *
* OBIDMS
_c
olumn functions *
****************************************************************************/
/**
* @file
obidms
column.h
* @file
OBIDMS_
column.h
* @author Celine Mercier
* @date 22 May 2015
* @brief Functions for the shared elements of all the OBIColumn structures.
...
...
@@ -16,17 +16,17 @@
#include <sys/mman.h>
/* mmap() is defined in this header */
/***********************************************************************
/***********************************************************************
**
*
* D E C L A R A T I O N O F T H E P R I V A T E F U N C T I O N S
* D E C L A R A T I O N O F T H E
P R I V A T E F U N C T I O N S
*
***********************************************************************/
***********************************************************************
**
/
/**
* @brief Internal function building the file name for a column.
*
* The function build the file name corresponding to a column of an OBIDMS.
* The function build
s
the file name corresponding to a column of an OBIDMS.
*
* @warning The returned pointer has to be freed by the caller.
*
...
...
@@ -36,12 +36,13 @@
* @retvalue NULL if an error occurs
*
* ###Error values
* - OBIDMS_MEMORY_ERROR : something wrong occur
s
during memory allocation.
* - OBIDMS_MEMORY_ERROR : something wrong occur
ed
during memory allocation.
*
* @since May 2015
* @author Eric Coissac (eric.coissac@metabarcoding.org)
*/
static
char
*
build_column_name
(
const
char
*
name
,
obiversion_t
version
);
static
char
*
build_column_name
(
const
char
*
name
,
obiversion_t
version
);
/**
* @brief Internal function building the file name for a version column file.
...
...
@@ -64,6 +65,7 @@ static char *build_column_name(const char *name,obiversion_t version);
*/
static
char
*
build_version_name
(
const
char
*
name
);
/**
* @brief Internal function returning a new column version number
* in the `dms` database
...
...
@@ -82,6 +84,7 @@ static char *build_version_name(const char *name);
*/
static
obiversion_t
obi_new_version
(
OBIDMS_p
dms
,
char
*
name
,
bool
block
);
/**
* @brief Internal function creating a new column version file
* in the `dms` database
...
...
@@ -99,11 +102,12 @@ static obiversion_t obi_new_version(OBIDMS_p dms,char *name, bool block);
*/
static
int
create_version
(
OBIDMS_p
dms
,
char
*
name
);
/***********************************************************************
/************************************************************************
*
* D E F I N I T I O N O F T H E P R I V A T E F U N C T I O N S
* D E F I N I T I O N O F T H E
P R I V A T E F U N C T I O N S
*
***********************************************************************/
***********************************************************************
*
/
static
char
*
build_column_name
(
const
char
*
name
,
obiversion_t
version
)
{
...
...
@@ -134,6 +138,7 @@ static char *build_version_name(const char *name) {
return
filename
;
}
static
obiversion_t
obi_new_version
(
OBIDMS_p
dms
,
char
*
name
,
bool
block
)
{
off_t
locsize
=
sizeof
(
bool
)
+
sizeof
(
obiversion_t
);
...
...
@@ -164,13 +169,16 @@ static obiversion_t obi_new_version(OBIDMS_p dms,char *name, bool block) {
}
//open the version file
versionfd
=
openat
(
directoryfd
,
versionfile
,
O_RDWR
);
//versionfd = openat(directoryfd, versionfile, O_RDWR);
versionfd
=
open
(
versionfile
,
O_RDWR
);
if
(
versionfd
<
0
)
{
free
(
versionfile
);
if
(
errno
==
ENOENT
)
{
return
create_version
(
dms
,
name
);
return
create_version
(
dms
,
name
);
}
else
{
...
...
@@ -180,7 +188,7 @@ static obiversion_t obi_new_version(OBIDMS_p dms,char *name, bool block) {
}
// Test if the version file size is ok
if
(
lseek
(
versionfd
,
SEEK_END
,
0
)
<
locsize
)
if
(
lseek
(
versionfd
,
SEEK_END
,
0
)
<
locsize
)
{
close
(
versionfd
);
obi_set_errno
(
OBIDMS_UNKNOWN_ERROR
);
...
...
@@ -189,7 +197,7 @@ static obiversion_t obi_new_version(OBIDMS_p dms,char *name, bool block) {
}
// prepare the file for locking
if
(
lseek
(
versionfd
,
SEEK_SET
,
0
)
!=
0
)
if
(
lseek
(
versionfd
,
SEEK_SET
,
0
)
!=
0
)
{
close
(
versionfd
);
obi_set_errno
(
OBIDMS_UNKNOWN_ERROR
);
...
...
@@ -216,7 +224,7 @@ static obiversion_t obi_new_version(OBIDMS_p dms,char *name, bool block) {
}
// check if endianess is correct
if
(
little
!=
obi_is_little_end
())
if
(
little
!=
obi_is_little_end
ian
())
{
close
(
versionfd
);
obi_set_errno
(
OBIDMS_BAD_ENDIAN_ERROR
);
...
...
@@ -275,6 +283,7 @@ static obiversion_t obi_new_version(OBIDMS_p dms,char *name, bool block) {
return
newversion
;
}
static
int
create_version
(
OBIDMS_p
dms
,
char
*
name
)
{
off_t
locsize
=
sizeof
(
bool
)
+
sizeof
(
obiversion_t
);
obiversion_t
version
=
0
;
...
...
@@ -295,10 +304,15 @@ static int create_version(OBIDMS_p dms,char *name) {
return
-
1
;
}
versionfd
=
openat
(
directoryfd
,
versionfile
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
666
);
//versionfd = openat(directoryfd,
// versionfile,
// O_RDWR|O_CREAT|O_EXCL,
// 666);
versionfd
=
open
(
versionfile
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
666
);
if
(
versionfd
<
0
)
{
obi_set_errno
(
OBIDMS_UNKNOWN_ERROR
);
...
...
@@ -331,7 +345,7 @@ static int create_version(OBIDMS_p dms,char *name) {
return
-
1
;
}
little
=
obi_is_little_end
();
little
=
obi_is_little_end
ian
();
if
(
write
(
versionfd
,
&
little
,
sizeof
(
bool
))
<
sizeof
(
bool
))
{
...
...
@@ -372,6 +386,7 @@ static int create_version(OBIDMS_p dms,char *name) {
return
version
;
}
/***********************************************************************
*
* D E F I N I T I O N O F T H E P U B L I C F U N C T I O N S
...
...
@@ -397,7 +412,9 @@ obiversion_t obi_latest_version(OBIDMS_p dms,char *name) {
return
-
1
;
}
versionfd
=
openat
(
directoryfd
,
versionfile
,
O_RDWR
);
//versionfd = openat(directoryfd,versionfile,O_RDWR);
versionfd
=
open
(
versionfile
,
O_RDWR
);
if
(
versionfd
<
0
)
{
obi_set_errno
(
OBIDMS_UNKNOWN_ERROR
);
free
(
versionfile
);
...
...
@@ -428,7 +445,7 @@ obiversion_t obi_latest_version(OBIDMS_p dms,char *name) {
return
-
1
;
}
if
(
little
!=
obi_is_little_end
())
if
(
little
!=
obi_is_little_end
ian
())
{
close
(
versionfd
);
obi_set_errno
(
OBIDMS_BAD_ENDIAN_ERROR
);
...
...
@@ -450,20 +467,20 @@ obiversion_t obi_latest_version(OBIDMS_p dms,char *name) {
return
version
;
}
size_t
obi_get_platform_header_size
()
{
return
getpagesize
()
*
1
;
}
OBIDMSColumn_p
obi_create_column
(
OBIDMS_p
dms
,
OBIDMS_column_p
obi_create_column
(
OBIDMS_p
dms
,
char
*
name
,
OBIType_t
type
,
size_t
nbelement
)
size_t
nbelement
s
)
{
OBIDMS
C
olumn_p
newcolumn
=
NULL
;
OBIDMS
ColumnH
eader_p
header
;
OBIDMS
_c
olumn_p
newcolumn
=
NULL
;
OBIDMS
_column_h
eader_p
header
;
size_t
filesize
;
obiversion_t
version
;
char
*
columnfile
;
...
...
@@ -480,7 +497,7 @@ OBIDMSColumn_p obi_create_column(OBIDMS_p dms,
}
hsize
=
obi_get_platform_header_size
();
dsize
=
obi_array_sizeof
(
type
,
nbelement
);
dsize
=
obi_array_sizeof
(
type
,
nbelement
s
);
filesize
=
hsize
+
dsize
;
...
...
@@ -494,10 +511,14 @@ OBIDMSColumn_p obi_create_column(OBIDMS_p dms,
columnfile
=
build_column_name
(
name
,
version
);
columnfd
=
openat
(
directoryfd
,
columnfile
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
666
);
//columnfd = openat(directoryfd,
// columnfile,
// O_RDWR|O_CREAT|O_EXCL,
// 666);
columnfd
=
open
(
columnfile
,
O_RDWR
|
O_CREAT
|
O_EXCL
,
666
);
if
(
ftruncate
(
columnfd
,
filesize
)
<
0
)
{
...
...
@@ -507,7 +528,7 @@ OBIDMSColumn_p obi_create_column(OBIDMS_p dms,
return
NULL
;
}
newcolumn
=
(
OBIDMS
Column_p
)
malloc
(
sizeof
(
OBIDMSC
olumn_t
));
newcolumn
=
(
OBIDMS
_column_p
)
malloc
(
sizeof
(
OBIDMS_c
olumn_t
));
if
(
newcolumn
)
{
...
...
@@ -556,9 +577,9 @@ OBIDMSColumn_p obi_create_column(OBIDMS_p dms,
newcolumn
->
writable
=
true
;
header
=
newcolumn
->
header
;
header
->
little_endian
=
obi_is_little_end
();
header
->
little_endian
=
obi_is_little_end
ian
();
header
->
header_size
=
hsize
;
header
->
line_count
=
nbelement
;
header
->
line_count
=
nbelement
s
;
header
->
line_used
=
0
;
header
->
data_type
=
type
;
header
->
creation_date
=
time
(
NULL
);
...
...
@@ -571,7 +592,6 @@ OBIDMSColumn_p obi_create_column(OBIDMS_p dms,
}
// if( access( fname, F_OK ) != -1 ) {
// // file exists
// } else {
...
...
src/obidmscolumn.h
View file @
5d967f5b
/****************************************************************************
* OBIDMS
C
olumn header file *
* OBIDMS
_c
olumn header file *
****************************************************************************/
/**
* @file obidmscolumn.h
* @author Celine Mercier
* @date 12 May 2015
* @brief Header file for the shared elements of all the OBI
C
olumn structures.
* @brief Header file for the shared elements of all the OBI
DMS c
olumn structures.
*/
#ifndef OBIDMSCOLUMN_H_
...
...
@@ -34,10 +34,10 @@ typedef int32_t obiversion_t; /**< Used to store the column version number
* @brief OBIColumnHeader structure.
*/
typedef
struct
OBIDMS
ColumnH
eader
{
typedef
struct
OBIDMS
_column_h
eader
{
bool
little_endian
;
/**< endianess of the column:
- `true` on little endian platform
- `false` on big endian platform
- `true` on little endian platform
s
- `false` on big endian platform
s
@see obi_is_little_end()
*/
...
...
@@ -52,41 +52,42 @@ typedef struct OBIDMSColumnHeader {
*/
char
comments
[
1
];
/**< comments stored as a classical
zero end C string. T
The size of the comment is
just
limited
The size of the comment is
only
limited
by the header size
*/
}
OBIDMS
ColumnHeader_t
,
*
OBIDMSColumnH
eader_p
;
}
OBIDMS
_column_header_t
,
*
OBIDMS_column_h
eader_p
;
/**
* @brief Structure describing a Column of the OBITools DMS
*
* A data structure of this type is returned by the functions
* creating, opening or cloning an OBIDMS
C
olumn.
* creating, opening or cloning an OBIDMS
_c
olumn.
*/
typedef
struct
OBIDMS
C
olumn
{
typedef
struct
OBIDMS
_c
olumn
{
OBIDMS_p
dms
;
/**< A pointer to a DMS instance
*/
OBIDMS
ColumnH
eader_p
header
;
/**< A pointer to the header of the column
OBIDMS
_column_h
eader_p
header
;
/**< A pointer to the header of the column
*/
void
*
data
;
/**< A `void` pointer to the beginning of the
* data.
*
* @
attention
never use this member directly
*
outside of the code of the
*
low level functions
*
of the OBITools DMS
* @
warning
never use this member directly
* outside of the code of the
* low level functions
* of the OBITools DMS
*/
bool
writable
;
/**< Indicates if the column is writable or not.
* - `true` the column is writable
* - `false` the column is read-only
*
* A column is writable only by its creator
* until
he
closes it.
* until
it
closes it.
*/
}
OBIDMSColumn_t
,
*
OBIDMSColumn_p
;
}
OBIDMS_column_t
,
*
OBIDMS_column_p
;
/**
* @brief Return the header size in bytes of a column on this platform.
* @brief Return
s
the header size in bytes of a column on this platform.
*
* Header size is defined as a multiple of the memory page size.
* Up to now the header size is defined as one time the page size
...
...
@@ -99,27 +100,25 @@ typedef struct OBIDMSColumn {
size_t
obi_get_platform_header_size
();
/**
* @brief Create a column.
* @brief Create
s
a column.
*
* @param dms a pointer as returned by obi_create_dms() or obi_open_dms()
* @param name the name of the new column
* @param type the OBIType code used to create the column
* @param nbelement
the number of element
to be stored
* @param nbelement
s the number of elements
to be stored
*
* @since May 2015
* @author Eric Coissac (eric.coissac@metabarcoding.org)
*/
OBIDMSColumn_p
obi_create_column
(
OBIDMS_p
dms
,
OBIDMS_column_p
obi_create_column
(
OBIDMS_p
dms
,
char
*
name
,
OBIType_t
type
,
size_t
nbelement
);
size_t
nbelement
s
);
/**
* @brief Return the latest column version in the `dms` database
* @brief Return
s
the latest column version in the `dms` database
*
* @param dms a pointer as returned by obi_create_dms() or obi_open_dms()
* @param name the name of the column
...
...
@@ -130,5 +129,4 @@ OBIDMSColumn_p obi_create_column(OBIDMS_p dms,
obiversion_t
obi_latest_version
(
OBIDMS_p
dms
,
char
*
name
);
#endif
/* OBIDMSCOLUMN_H_ */
src/obierrno.h
View file @
5d967f5b
...
...
@@ -11,26 +11,54 @@
/**
* @brief The declaration of the external variable `obi_errno`.
*
* `obi_errno` is an equivalent of `errno` for the system level error
* but for
for error
generated by the C layer of the OBITools framework.
* `obi_errno` is an equivalent of `errno` for the system level error
,
* but for
errors
generated by the C layer of the OBITools framework.
*
* @todo We have to look
for
defining this variable as thread specific.
* @todo We have to look
into
defining this variable as thread specific.
*/
extern
int
obi_errno
;
/**
* @brief
set
the global `obi_errno` variable with
* @brief
Sets
the global `obi_errno` variable with
* the specified `err` code
*
* This function is defined as a macro to reduce the risk
*
to increase
the problem generating the error by calling
*
of increasing
the problem generating the error by calling
* a new function.
*
* @param err
the error code as an integer value
* @param err
The error code as an integer value.
*
* @since May 2015
* @author Eric Coissac (eric.coissac@metabarcoding.org)
*/
#define obi_set_errno(err) (obi_errno = (err))
/**
* @defgroup OBIDMSErrors OBIDMS related error codes
*
* Error codes set in errno following an error related
* to the manipulation of an OBIDMS.
*
* @{
*/
#define OBIDMS_EXIST_ERROR (1)
/**< Trying to create an OBIDMS with a name
* that corresponds to an existing OBIDMS
*/
#define OBIDMS_NOT_EXIST_ERROR (2)
/**< Trying to open a non-existing OBIDMS
*/
#define OBIDMS_LONG_NAME_ERROR (3)
/**< The specified OBIDMS name is too long
*/
#define OBIDMS_MEMORY_ERROR (4)
/**< A memory error occurred during allocation
*/
#define OBIDMS_UNKNOWN_ERROR (5)
/**< Undetermined error
*/
#define OBIDMS_ACCESS_ERROR (6)
/**< Permission error trying to access the database
*/
#define OBIDMS_BAD_ENDIAN_ERROR (7)
/**< The opened data structure does not corresponds
* to the endianess of the platform.
*/
/**@}*/
#endif
/* OBIERRNO_H_ */
src/obilittlebigman.c
View file @
5d967f5b
...
...
@@ -7,8 +7,8 @@