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
839b3000
Commit
839b3000
authored
Apr 22, 2016
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a function to build indexer names
parent
ffa45579
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
src/obiblob_indexer.c
src/obiblob_indexer.c
+21
-0
src/obiblob_indexer.h
src/obiblob_indexer.h
+15
-0
No files found.
src/obiblob_indexer.c
View file @
839b3000
...
...
@@ -15,6 +15,8 @@
#include "obiblob_indexer.h"
#include "obidms.h"
#include "obierrno.h"
#include "obidebug.h"
inline
int
obi_indexer_exists
(
OBIDMS_p
dms
,
const
char
*
name
);
...
...
@@ -31,3 +33,22 @@ inline index_t obi_indexer_add(Obi_indexer_p indexer, Obi_blob_p value);
inline
Obi_blob_p
obi_indexer_get
(
Obi_indexer_p
indexer
,
index_t
idx
);
char
*
obi_build_indexer_name
(
const
char
*
column_name
,
obiversion_t
column_version
)
{
char
*
indexer_name
;
indexer_name
=
(
char
*
)
malloc
(
INDEXER_MAX_NAME
*
sizeof
(
char
));
if
(
indexer_name
==
NULL
)
{
obi_set_errno
(
OBI_MALLOC_ERROR
);
obidebug
(
1
,
"
\n
Error allocating the memory for an indexer name"
);
return
NULL
;
}
strcpy
(
indexer_name
,
column_name
);
sprintf
(
indexer_name
+
strlen
(
column_name
),
"_%d_indexer"
,
column_version
);
return
indexer_name
;
}
src/obiblob_indexer.h
View file @
839b3000
...
...
@@ -159,5 +159,20 @@ inline Obi_blob_p obi_indexer_get(Obi_indexer_p indexer, index_t idx)
}
/**
* @brief Builds an indexer name in the form columnname_columnversion_indexer.
*
* @param column_name The name of the column associated with the indexer.
* @param column_version The version of the column associated with the indexer.
*
* @returns A pointer on the indexer name built.
* @retval NULL if an error occurred.
*
* @since April 2016
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
char
*
obi_build_indexer_name
(
const
char
*
column_name
,
obiversion_t
column_version
)
#endif
/* OBIBLOB_INDEXER_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment