database_version.h
Go to the documentation of this file.
/*
* Copyright (c) 2014 Jerry Lundström <lundstrom.jerry@gmail.com>
* Copyright (c) 2014 .SE (The Internet Infrastructure Foundation).
* Copyright (c) 2014 OpenDNSSEC AB (svb)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __database_version_h
#define __database_version_h
#include "db_object.h"
struct database_version;
struct database_version_list;
typedef struct database_version database_version_t;
typedef struct database_version_list database_version_list_t;
#include "database_version_ext.h"
struct database_version {
db_object_t* dbo;
db_value_t id;
db_value_t rev;
unsigned int version;
};
database_version_t* database_version_new(const db_connection_t* connection);
void database_version_free(database_version_t* database_version);
int database_version_from_result(database_version_t* database_version, const db_result_t* result);
unsigned int database_version_version(const database_version_t* database_version);
struct database_version_list {
db_object_t* dbo;
db_result_list_t* result_list;
const db_result_t* result;
database_version_t* database_version;
int object_store;
database_version_t** object_list;
size_t object_list_size;
size_t object_list_position;
int object_list_first;
int associated_fetch;
};
database_version_list_t* database_version_list_new(const db_connection_t* connection);
void database_version_list_free(database_version_list_t* database_version_list);
int database_version_list_get(database_version_list_t* database_version_list);
database_version_list_t* database_version_list_new_get(const db_connection_t* connection);
const database_version_t* database_version_list_next(database_version_list_t* database_version_list);
#endif
database_version_list::object_list
database_version_t ** object_list
Definition: database_version.h:89
database_version::version
unsigned int version
Definition: database_version.h:49
database_version_free
void database_version_free(database_version_t *database_version)
Definition: database_version.c:118
db_object
Definition: db_object.h:201
database_version_new
database_version_t * database_version_new(const db_connection_t *connection)
Definition: database_version.c:102
database_version_list::object_list_first
int object_list_first
Definition: database_version.h:92
database_version::id
db_value_t id
Definition: database_version.h:47
database_version_list_get
int database_version_list_get(database_version_list_t *database_version_list)
Definition: database_version.c:209
database_version_list::result_list
db_result_list_t * result_list
Definition: database_version.h:85
database_version_list::object_store
int object_store
Definition: database_version.h:88
database_version_list::database_version
database_version_t * database_version
Definition: database_version.h:87
db_result_list
Definition: db_result.h:114
db_value
Definition: db_value.h:48
database_version_from_result
int database_version_from_result(database_version_t *database_version, const db_result_t *result)
Definition: database_version.c:129
database_version_list::object_list_position
size_t object_list_position
Definition: database_version.h:91
database_version_list_next
const database_version_t * database_version_list_next(database_version_list_t *database_version_list)
Definition: database_version.c:265
database_version_list::object_list_size
size_t object_list_size
Definition: database_version.h:90
database_version::rev
db_value_t rev
Definition: database_version.h:48
database_version_ext.h
db_result
Definition: db_result.h:56
database_version_list_new_get
database_version_list_t * database_version_list_new_get(const db_connection_t *connection)
Definition: database_version.c:248
database_version_list::associated_fetch
int associated_fetch
Definition: database_version.h:93
database_version_list
Definition: database_version.h:83
database_version::dbo
db_object_t * dbo
Definition: database_version.h:46
database_version_list::dbo
db_object_t * dbo
Definition: database_version.h:84
db_object.h
db_connection
Definition: db_connection.h:46
database_version_list::result
const db_result_t * result
Definition: database_version.h:86
database_version_version
unsigned int database_version_version(const database_version_t *database_version)
Definition: database_version.c:153
database_version_list_free
void database_version_list_free(database_version_list_t *database_version_list)
Definition: database_version.c:179
database_version_list_new
database_version_list_t * database_version_list_new(const db_connection_t *connection)
Definition: database_version.c:165
database_version
Definition: database_version.h:45