database_version.h File Reference
`#include "db_object.h"`
`#include "database_version_ext.h"`

Go to the source code of this file.

## Data Structures

struct | database_version
struct | database_version_list

## Typedefs

typedef struct database_version | database_version_t
typedef struct database_version_list | database_version_list_t

## Functions

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)
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)

## Typedef Documentation

## database_version_list_t

typedef struct database_version_list database_version_list_t

Definition at line 38 of file database_version.h.

## database_version_t

typedef struct database_version database_version_t

Definition at line 37 of file database_version.h.

## Function Documentation

## database_version_free()

void database_version_free | ( | database_version_t * | database_version | ) |

extern

Delete a database version object, this does not delete it from the database.

Parameters

  [in] | database_version | a database_version_t pointer.

Definition at line 118 of file database_version.c.

References db_object_free(), db_value_reset(), database_version::dbo, database_version::id, and database_version::rev.

Referenced by database_version_list_free(), database_version_list_get(), and database_version_list_next().

## database_version_from_result()

int database_version_from_result | ( | database_version_t * | database_version,
|  | const db_result_t * | result
| ) |  |

extern

Set the content of a database version object based on a database result.

Parameters

  [in] | database_version | a database_version_t pointer.
  [in] | result | a db_result_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 129 of file database_version.c.

References DB_ERROR_UNKNOWN, DB_OK, db_result_value_set(), db_value_copy(), db_value_reset(), db_value_set_at(), db_value_set_size(), db_value_to_uint32(), database_version::id, database_version::rev, and database_version::version.

Referenced by database_version_list_next().

## database_version_list_free()

void database_version_list_free | ( | database_version_list_t * | database_version_list | ) |

extern

Delete a database version object list.

Parameters

  [in] | database_version_list | a database_version_list_t pointer.

Definition at line 179 of file database_version.c.

References database_version_list::database_version, database_version_free(), db_object_free(), db_result_list_free(), database_version_list::dbo, database_version_list::object_list, database_version_list::object_list_size, and database_version_list::result_list.

Referenced by database_version_get_version(), and database_version_list_new_get().

## database_version_list_get()

int database_version_list_get | ( | database_version_list_t * | database_version_list | ) |

extern

Get all database version objects.

Parameters

  [in] | database_version_list | a database_version_list_t pointer.

Returns
  DB_ERROR_* on failure, otherwise DB_OK.

Definition at line 209 of file database_version.c.

References database_version_list::associated_fetch, database_version_free(), DB_ERROR_UNKNOWN, db_object_read(), DB_OK, db_result_list_fetch_all(), db_result_list_free(), database_version_list::dbo, database_version_list::object_list, database_version_list::object_list_first, database_version_list::object_list_size, and database_version_list::result_list.

Referenced by database_version_list_new_get().

## database_version_list_new()

database_version_list_t * database_version_list_new | ( | const db_connection_t * | connection | ) |

extern

Create a new database version object list.

Parameters

  [in] | connection | a db_connection_t pointer.

Returns
  a database_version_list_t pointer or NULL on error.

Definition at line 165 of file database_version.c.

References database_version_list::dbo.

Referenced by database_version_list_new_get().

## database_version_list_new_get()

database_version_list_t * database_version_list_new_get | ( | const db_connection_t * | connection | ) |

extern

Get a new list with all database version objects.

Parameters

  [in] | connection | a db_connection_t pointer.

Returns
  a database_version_list_t pointer or NULL on error.

Definition at line 248 of file database_version.c.

References database_version_list_free(), database_version_list_get(), and database_version_list_new().

Referenced by database_version_get_version().

## database_version_list_next()

const database_version_t * database_version_list_next | ( | database_version_list_t * | database_version_list | ) |

extern

Get the next database version object in a database version object list. Ownership of this object is retained within the list and the object is only valid until the next call to this function.

Parameters

  [in] | database_version_list | a database_version_list_t pointer.

Returns
  a database_version_t pointer or NULL on error or if there are no more database version objects in the database version object list.

Definition at line 265 of file database_version.c.

References database_version_list::database_version, database_version_free(), database_version_from_result(), database_version_new(), db_object_connection(), db_result_list_next(), db_result_list_size(), database_version_list::dbo, database_version_list::object_list, database_version_list::object_list_first, database_version_list::object_list_position, database_version_list::object_list_size, database_version_list::object_store, and database_version_list::result_list.

Referenced by database_version_get_version().

## database_version_new()

database_version_t * database_version_new | ( | const db_connection_t * | connection | ) |

extern

Create a new database version object.

Parameters

  [in] | connection | a db_connection_t pointer.

Returns
  a database_version_t pointer or NULL on error.

Definition at line 102 of file database_version.c.

References db_value_reset(), database_version::dbo, database_version::id, and database_version::rev.

Referenced by database_version_list_next().

## database_version_version()

unsigned int database_version_version | ( | const database_version_t * | database_version | ) |

extern

Get the version of a database version object. Undefined behavior if `database_version` is NULL.

Parameters

  [in] | database_version | a database_version_t pointer.

Returns
  an unsigned integer.

Definition at line 153 of file database_version.c.

References database_version::version.

Referenced by database_version_get_version().