-
Notifications
You must be signed in to change notification settings - Fork 24
/
pandaseq-module.h
132 lines (114 loc) · 3.79 KB
/
pandaseq-module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/* PANDAseq -- Assemble paired FASTQ Illumina reads and strip the region between amplification primers.
Copyright (C) 2011-2012 Andre Masella
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PANDASEQ_MODULE_H
# define _PANDASEQ_MODULE_H
# ifdef __cplusplus
# define EXTERN_C_BEGIN extern "C" {
# define EXTERN_C_END }
# else
# define EXTERN_C_BEGIN
# define EXTERN_C_END
# endif
# include <pandaseq-common.h>
EXTERN_C_BEGIN
/**
* The current module API version of the running library
*/
int panda_api_version(
void);
/* === Constructors === */
/**
* Create a module given sequence checking parameters.
*
* @name: the name of the module, for user interaction
* @check: (closure user_data): the function to be run after assembly
* @precheck: (closure user_data): a function to be run before assembly
* @user_data: (transfer full): the context data for the functions. The user is responsible for managing the memory associated with user_data, but the cleanup function will always be called to do so.
* @cleanup: (closure user_data): a function to be called when this module is garbage collected
*/
PandaModule panda_module_new(
const char *name,
PandaCheck check,
PandaPreCheck precheck,
void *user_data,
PandaDestroy cleanup);
/**
* Load a module from a string containg the module name and arguments.
*
* @path: the name or path to a module separated by LT_PATHSEP_CHAR and any arguments to the initialisation function of that module
*/
PandaModule panda_module_load(
PandaLogProxy logger,
const char *path);
/* === Methods === */
/**
* Increase the reference count on a module.
*/
PandaModule panda_module_ref(
PandaModule module);
/**
* Decrease the reference count on a module.
* @module: (transfer full): the module to release.
*/
void panda_module_unref(
PandaModule module);
/* === Getter and Setters === */
/**
* Get the version of a module.
*
* This is only appropriate for loaded modules. Modules constructed by panda_module_new will always return PANDA_API.
*/
int panda_module_get_api(
PandaModule module);
/**
* Get the arguments passed on loading of a module of a module.
*
* This is only appropriate for loaded modules.
* Returns: (transfer none) (allow-none): The usage help text.
*/
const char *panda_module_get_args(
PandaModule module);
/**
* Get the description of a module.
*
* This is only appropriate for loaded modules.
* Returns: (transfer none) (allow-none): The description help text.
*/
const char *panda_module_get_description(
PandaModule module);
/**
* Get the name of a module.
*
* Returns: (transfer none): the module's name
*/
const char *panda_module_get_name(
PandaModule module);
/**
* Get the usage information (i.e., help text) of a module.
*
* This is only appropriate for loaded modules.
* Returns: (transfer none) (allow-none): The usage help text.
*/
const char *panda_module_get_usage(
PandaModule module);
/**
* Get the version of a module.
*
* This is only appropriate for loaded modules.
* Returns: (transfer none) (allow-none): The usage help text.
*/
const char *panda_module_get_version(
PandaModule module);
EXTERN_C_END
#endif