OpenVAS Manager  7.0.3~git
iterator.h
Go to the documentation of this file.
1 /* OpenVAS Manager
2  * $Id$
3  * Description: Headers for OpenVAS Manager: Iterators.
4  *
5  * The interface here is for "external" use. The SQL parts of the interface
6  * are in sql.h. Both are defined in sql.c.
7  *
8  * Authors:
9  * Matthew Mundell <matthew.mundell@greenbone.net>
10  *
11  * Copyright:
12  * Copyright (C) 2016 Greenbone Networks GmbH
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27  */
28 
29 #ifndef OPENVAS_MANAGER_ITERATOR_H
30 #define OPENVAS_MANAGER_ITERATOR_H
31 
32 #include "lsc_crypt.h"
33 
34 #include <glib.h>
35 
36 
37 /* Types. */
38 
42 typedef long long int resource_t;
43 
47 typedef struct sql_stmt sql_stmt_t;
48 
52 struct iterator
53 {
55  gboolean done;
56  int prepared;
58 };
59 
60 typedef struct iterator iterator_t;
61 
62 
63 /* Functions. */
64 
65 void
67 
68 gboolean
69 next (iterator_t*);
70 
71 #endif /* not OPENVAS_MANAGER_ITERATOR_H */
A generic SQL iterator.
Definition: iterator.h:52
lsc_crypt_ctx_t crypt_ctx
Encryption context.
Definition: iterator.h:57
gboolean done
End flag.
Definition: iterator.h:55
The context object for encryption operations.
Definition: lsc_crypt.c:87
sql_stmt_t * stmt
SQL statement.
Definition: iterator.h:54
int prepared
Prepared flag.
Definition: iterator.h:56
void cleanup_iterator(iterator_t *)
Cleanup an iterator.
Definition: sql.c:664
gboolean next(iterator_t *)
Increment an iterator.
Definition: sql.c:689
long long int resource_t
A resource, like a task or target.
Definition: iterator.h:42