OpenDNSSEC-enforcer  2.1.5
db_result.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Jerry Lundström <lundstrom.jerry@gmail.com>
3  * Copyright (c) 2014 .SE (The Internet Infrastructure Foundation).
4  * Copyright (c) 2014 OpenDNSSEC AB (svb)
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  */
29 
30 #ifndef __db_result_h
31 #define __db_result_h
32 
33 struct db_result;
34 struct db_result_list;
35 typedef struct db_result db_result_t;
37 
47 typedef db_result_t* (*db_result_list_next_t)(void* data, int finish);
48 
49 #include "db_value.h"
50 #include "db_backend.h"
51 
56 struct db_result {
59 };
60 
66 
72 db_result_t* db_result_new_copy(const db_result_t* from_result);
73 
78 void db_result_free(db_result_t* result);
79 
86 int db_result_copy(db_result_t* result, const db_result_t* from_result);
87 
94 const db_value_set_t* db_result_value_set(const db_result_t* result);
95 
102 int db_result_set_value_set(db_result_t* result, db_value_set_t* value_set);
103 
109 int db_result_not_empty(const db_result_t* result);
110 
119  void* next_data;
120  size_t size;
121  int begun;
122 };
123 
129 
136 
141 void db_result_list_free(db_result_list_t* result_list);
142 
152 int db_result_list_copy(db_result_list_t* result_list, const db_result_list_t* from_result_list);
153 
164 int db_result_list_set_next(db_result_list_t* result_list, db_result_list_next_t next_function, void* next_data, size_t size);
165 
173 int db_result_list_add(db_result_list_t* result_list, db_result_t* result);
174 
182 
190 
198 size_t db_result_list_size(const db_result_list_t* result_list);
199 
208 
209 #endif
db_result
Definition: db_result.h:56
db_result_list_next
const db_result_t * db_result_list_next(db_result_list_t *result_list)
Definition: db_result.c:310
db_result::next
db_result_t * next
Definition: db_result.h:57
db_result_list_copy
int db_result_list_copy(db_result_list_t *result_list, const db_result_list_t *from_result_list)
Definition: db_result.c:183
db_result_list_set_next
int db_result_list_set_next(db_result_list_t *result_list, db_result_list_next_t next_function, void *next_data, size_t size)
Definition: db_result.c:234
db_result_not_empty
int db_result_not_empty(const db_result_t *result)
Definition: db_result.c:120
db_result_free
void db_result_free(db_result_t *result)
Definition: db_result.c:63
db_result_list_new
db_result_list_t * db_result_list_new(void)
Definition: db_result.c:134
db_result_list_add
int db_result_list_add(db_result_list_t *result_list, db_result_t *result)
Definition: db_result.c:257
db_result_list_size
size_t db_result_list_size(const db_result_list_t *result_list)
Definition: db_result.c:333
db_result_list::begun
int begun
Definition: db_result.h:121
db_result_new_copy
db_result_t * db_result_new_copy(const db_result_t *from_result)
Definition: db_result.c:46
db_result_list::current
db_result_t * current
Definition: db_result.h:117
db_result_copy
int db_result_copy(db_result_t *result, const db_result_t *from_result)
Definition: db_result.c:73
db_value_set
Definition: db_value.h:281
db_result_list_next_t
db_result_t *(* db_result_list_next_t)(void *data, int finish)
Definition: db_result.h:47
db_result_list::end
db_result_t * end
Definition: db_result.h:116
db_result_list_begin
const db_result_t * db_result_list_begin(db_result_list_t *result_list)
Definition: db_result.c:290
db_result_list
Definition: db_result.h:114
db_result::value_set
db_value_set_t * value_set
Definition: db_result.h:58
db_result_list::next_data
void * next_data
Definition: db_result.h:119
db_result_value_set
const db_value_set_t * db_result_value_set(const db_result_t *result)
Definition: db_result.c:97
db_result_list_fetch_all
int db_result_list_fetch_all(db_result_list_t *result_list)
Definition: db_result.c:341
db_backend.h
db_result_list::size
size_t size
Definition: db_result.h:120
db_value.h
db_result_list::begin
db_result_t * begin
Definition: db_result.h:115
db_result_set_value_set
int db_result_set_value_set(db_result_t *result, db_value_set_t *value_set)
Definition: db_result.c:105
db_result_list_free
void db_result_list_free(db_result_list_t *result_list)
Definition: db_result.c:160
db_result_list::next_function
db_result_list_next_t next_function
Definition: db_result.h:118
db_result_new
db_result_t * db_result_new(void)
Definition: db_result.c:38
db_result_list_new_copy
db_result_list_t * db_result_list_new_copy(const db_result_list_t *from_result_list)
Definition: db_result.c:142