OpenDNSSEC-enforcer 2.1.13
|
Go to the source code of this file.
const db_connection_t * db_object_connection | ( | const db_object_t * | object | ) |
Get the database connection of a database object.
[in] | object | a db_object_t pointer. |
Definition at line 320 of file db_object.c.
Referenced by database_version_list_next(), hsm_key_list_begin(), hsm_key_list_get_begin(), hsm_key_list_get_next(), hsm_key_list_new_copy(), hsm_key_list_new_get_by_policy_key(), hsm_key_list_next(), hsm_key_new_copy(), key_data_cache_hsm_key(), key_data_get_hsm_key(), key_data_get_zone(), key_data_list_begin(), key_data_list_get_begin(), key_data_list_get_next(), key_data_list_new_copy(), key_data_list_next(), key_data_new_copy(), key_data_retrieve_key_state_list(), key_dependency_get_from_key_data(), key_dependency_list_begin(), key_dependency_list_get_begin(), key_dependency_list_get_next(), key_dependency_list_new_copy(), key_dependency_list_next(), key_dependency_new_copy(), key_state_list_begin(), key_state_list_get_begin(), key_state_list_get_next(), key_state_list_new_copy(), key_state_list_next(), key_state_new_copy(), policy_get_policy_keys(), policy_key_list_begin(), policy_key_list_get_next(), policy_key_list_new_copy(), policy_key_list_next(), policy_key_new_copy(), policy_list_begin(), policy_list_get_next(), policy_list_new_copy(), policy_list_next(), policy_new_copy(), policy_retrieve_zone_list(), test_class_db_object(), test_list_begin(), test_list_next(), zone_db_get_key_dependencies(), zone_db_get_keys(), zone_db_get_policy(), zone_db_new_copy(), zone_list_db_begin(), zone_list_db_get_next(), zone_list_db_new_copy(), and zone_list_db_next().
int db_object_count | ( | const db_object_t * | object, |
const db_join_list_t * | join_list, | ||
const db_clause_list_t * | clause_list, | ||
size_t * | count | ||
) |
Count objects from the database. Return the count in count
.
[in] | object | a db_object_t pointer. |
[in] | join_list | a db_join_list_t pointer. |
[in] | clause_list | a db_clause_list_t pointer. |
[out] | count | a size_t pointer. |
Definition at line 481 of file db_object.c.
References db_object::connection, db_connection_count(), DB_ERROR_UNKNOWN, db_object::primary_key_name, and db_object::table.
Referenced by hsm_key_count(), key_data_count(), test_class_db_object(), test_count_by_id(), test_count_by_name(), and zone_db_count().
int db_object_create | ( | const db_object_t * | object, |
const db_object_field_list_t * | object_field_list, | ||
const db_value_set_t * | value_set | ||
) |
Create an object in the database. The object_field_list
describes the fields that should be set in the object and the value_set
has the values for each field.
[in] | object | a db_object_t pointer. |
[in] | object_field_list | a db_object_field_list_t pointer. |
[in] | value_set | a db_value_set_t pointer. |
Definition at line 401 of file db_object.c.
References db_object::connection, db_connection_create(), DB_ERROR_UNKNOWN, db_object::object_field_list, db_object::primary_key_name, and db_object::table.
Referenced by hsm_key_create(), key_data_create(), key_dependency_create(), key_state_create(), policy_create(), policy_key_create(), test2_create(), test_class_db_object(), test_create(), and zone_db_create().
int db_object_delete | ( | const db_object_t * | object, |
const db_clause_list_t * | clause_list | ||
) |
Delete an object or objects from the database.
[in] | object | a db_object_t pointer. |
[in] | clause_list | a db_clause_list_t pointer. |
Definition at line 464 of file db_object.c.
References db_object::connection, db_connection_delete(), DB_ERROR_UNKNOWN, db_object::primary_key_name, and db_object::table.
Referenced by hsm_key_factory_delete_key(), key_data_delete(), key_dependency_delete(), key_state_delete(), policy_delete(), policy_key_delete(), test2_delete(), test_class_db_object(), test_delete(), and zone_db_delete().
int db_object_field_copy | ( | db_object_field_t * | object_field, |
const db_object_field_t * | from_object_field | ||
) |
Copy the content of a database object field.
[in] | object_field | a db_object_field_t pointer. |
[in] | from_object_field | a db_object_field_t pointer. |
Definition at line 76 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, db_object_field::enum_set, db_object_field::name, db_object_field::next, and db_object_field::type.
Referenced by db_object_field_new_copy().
void db_object_field_free | ( | db_object_field_t * | object_field | ) |
Delete a database object field.
[in] | object_field | a db_object_field_t pointer. |
Definition at line 69 of file db_object.c.
Referenced by clean_suite_classes(), db_object_field_list_free(), db_object_field_new_copy(), hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), test2_create(), test2_update(), test_create(), test_update(), zone_db_create(), and zone_db_update().
int db_object_field_list_add | ( | db_object_field_list_t * | object_field_list, |
db_object_field_t * | object_field | ||
) |
Add a database object field to a database object field list, this will takes over the ownership of the object field.
[in] | object_field_list | a db_object_field_list_t pointer. |
[in] | object_field | a db_object_field_t pointer. |
Definition at line 254 of file db_object.c.
References db_object_field_list::begin, DB_ERROR_UNKNOWN, db_object_field_not_empty(), DB_OK, db_object_field_list::end, db_object_field::next, and db_object_field_list::size.
Referenced by __test2_new_object(), __test_new_object(), db_object_field_list_copy(), hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), test2_create(), test2_update(), test_class_db_object_field_list(), test_create(), test_update(), zone_db_create(), and zone_db_update().
const db_object_field_t * db_object_field_list_begin | ( | const db_object_field_list_t * | object_field_list | ) |
Return the first database object field in a database object field list.
[in] | object_field_list | a db_object_field_list_t pointer. |
Definition at line 284 of file db_object.c.
References db_object_field_list::begin.
Referenced by test_class_db_object_field_list().
int db_object_field_list_copy | ( | db_object_field_list_t * | object_field_list, |
const db_object_field_list_t * | from_object_field_list | ||
) |
Copy the content of a database object field list.
[in] | object_field_list | a db_object_field_list_t pointer. |
[in] | from_object_field_list | a db_object_field_list_t pointer. |
Definition at line 216 of file db_object.c.
References db_object_field_list::begin, DB_ERROR_UNKNOWN, db_object_field_list_add(), db_object_field_new_copy(), DB_OK, db_object_field_list::end, db_object_field::next, and db_object_field_list::size.
Referenced by db_object_field_list_new_copy().
void db_object_field_list_free | ( | db_object_field_list_t * | object_field_list | ) |
Delete a object field list and all object fields within the list.
[in] | object_field_list | a db_object_field_list_t pointer. |
Definition at line 199 of file db_object.c.
References db_object_field_list::begin, and db_object_field_free().
Referenced by clean_suite_classes(), db_object_field_list_new_copy(), db_object_free(), hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), test2_create(), test2_update(), test_class_end(), test_create(), test_update(), zone_db_create(), and zone_db_update().
db_object_field_list_t * db_object_field_list_new | ( | void | ) |
Create a new object field list.
Definition at line 174 of file db_object.c.
Referenced by __test2_new_object(), __test_new_object(), db_object_field_list_new_copy(), hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), test2_create(), test2_update(), test_class_db_object_field_list(), test_create(), test_update(), zone_db_create(), and zone_db_update().
db_object_field_list_t * db_object_field_list_new_copy | ( | const db_object_field_list_t * | from_object_field_list | ) |
Create a new object field list that is a copy of another.
[in] | from_object_field_list | a db_object_field_list_t pointer. |
Definition at line 182 of file db_object.c.
References db_object_field_list_copy(), db_object_field_list_free(), and db_object_field_list_new().
size_t db_object_field_list_size | ( | const db_object_field_list_t * | object_field_list | ) |
Return the size of a object field list.
[in] | object_field_list | a db_object_field_list_t pointer. |
Definition at line 292 of file db_object.c.
References db_object_field_list::size.
const char * db_object_field_name | ( | const db_object_field_t * | object_field | ) |
Get the name of a database object field.
[in] | object_field | a db_object_field_t pointer. |
Definition at line 94 of file db_object.c.
References db_object_field::name.
Referenced by test_class_db_object_field().
db_object_field_t * db_object_field_new | ( | void | ) |
Create a database object field.
Definition at line 40 of file db_object.c.
References DB_TYPE_EMPTY, and db_object_field::type.
Referenced by __test2_new_object(), __test_new_object(), db_object_field_new_copy(), hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), test2_create(), test2_update(), test_class_db_object_field(), test_create(), test_update(), zone_db_create(), and zone_db_update().
db_object_field_t * db_object_field_new_copy | ( | const db_object_field_t * | from_object_field | ) |
Create a database object field that is a copy of another.
[in] | from_object_field | a db_object_field_t pointer. |
Definition at line 52 of file db_object.c.
References db_object_field_copy(), db_object_field_free(), and db_object_field_new().
Referenced by db_object_field_list_copy().
const db_object_field_t * db_object_field_next | ( | const db_object_field_t * | object_field | ) |
Get the next object field connected in a database object field list.
[in] | object_field | a db_object_field_t pointer. |
Definition at line 162 of file db_object.c.
References db_object_field::next.
Referenced by test_class_db_object_field_list().
int db_object_field_not_empty | ( | const db_object_field_t * | object_field | ) |
Check if the object field is not empty.
[in] | object_field | a db_object_field_t pointer. |
Definition at line 146 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, DB_TYPE_EMPTY, DB_TYPE_ENUM, db_object_field::enum_set, db_object_field::name, and db_object_field::type.
Referenced by db_object_field_list_add(), and test_class_db_object_field().
int db_object_field_set_enum_set | ( | db_object_field_t * | object_field, |
const db_enum_t * | enum_set | ||
) |
Set the enumerate set of a database object field.
[in] | object_field | a db_object_field_t pointer. |
[in] | enum_set | a NULL terminated db_enum_t list. |
Definition at line 134 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, DB_TYPE_ENUM, db_object_field::enum_set, and db_object_field::type.
Referenced by hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), and test_class_db_object_field().
int db_object_field_set_name | ( | db_object_field_t * | object_field, |
const char * | name | ||
) |
Set the name of a database object field.
[in] | object_field | a db_object_field_t pointer. |
[in] | name | a character pointer. |
Definition at line 110 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, and db_object_field::name.
Referenced by __test2_new_object(), __test_new_object(), hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), test2_create(), test2_update(), test_class_db_object_field(), test_create(), test_update(), zone_db_create(), and zone_db_update().
int db_object_field_set_type | ( | db_object_field_t * | object_field, |
db_type_t | type | ||
) |
Set the type of a database object field.
[in] | object_field | a db_object_field_t pointer. |
[in] | type | a db_type_t. |
Definition at line 122 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, DB_TYPE_EMPTY, and db_object_field::type.
Referenced by __test2_new_object(), __test_new_object(), hsm_key_create(), hsm_key_update(), key_data_create(), key_data_update(), key_dependency_create(), key_state_create(), key_state_update(), policy_create(), policy_key_create(), policy_update(), test2_create(), test2_update(), test_class_db_object_field(), test_create(), test_update(), zone_db_create(), and zone_db_update().
db_type_t db_object_field_type | ( | const db_object_field_t * | object_field | ) |
Get the type of a database object field.
[in] | object_field | a db_object_field_t pointer. |
Definition at line 102 of file db_object.c.
References DB_TYPE_EMPTY, and db_object_field::type.
Referenced by test_class_db_object_field().
void db_object_free | ( | db_object_t * | object | ) |
Delete a database object and the object field list and backend meta data list if set.
[in] | object | a db_object_t pointer. |
Definition at line 311 of file db_object.c.
References db_object_field_list_free(), and db_object::object_field_list.
Referenced by clean_suite_classes(), database_version_free(), database_version_list_free(), hsm_key_free(), hsm_key_list_free(), key_data_free(), key_data_list_free(), key_dependency_free(), key_dependency_list_free(), key_state_free(), key_state_list_free(), policy_free(), policy_key_free(), policy_key_list_free(), policy_list_free(), test2_free(), test_class_db_object(), test_free(), test_list_free(), zone_db_free(), and zone_list_db_free().
db_object_t * db_object_new | ( | void | ) |
Create a new database object.
Definition at line 304 of file db_object.c.
Referenced by __test2_new_object(), __test_new_object(), and test_class_db_object().
const db_object_field_list_t * db_object_object_field_list | ( | const db_object_t * | object | ) |
Get the object field list of a database object.
[in] | object | a db_object_t pointer. |
Definition at line 334 of file db_object.c.
Referenced by test_class_db_object().
db_result_list_t * db_object_read | ( | const db_object_t * | object, |
const db_join_list_t * | join_list, | ||
const db_clause_list_t * | clause_list | ||
) |
Read an object or objects from the database.
[in] | object | a db_object_t pointer. |
[in] | join_list | a db_join_list_t pointer. |
[in] | clause_list | a db_clause_list_t pointer. |
Definition at line 424 of file db_object.c.
References db_object::connection, db_connection_read(), db_object::primary_key_name, and db_object::table.
Referenced by database_version_list_get(), hsm_key_get_by_id(), hsm_key_get_by_locator(), hsm_key_list_get_by_clauses(), hsm_key_list_get_by_policy_id(), key_data_get_by_hsm_key_id(), key_data_get_by_id(), key_data_list_get(), key_data_list_get_by_clauses(), key_data_list_get_by_zone_id(), key_dependency_get_by_id(), key_dependency_list_get_by_clauses(), key_dependency_list_get_by_zone_id(), key_state_get_by_id(), key_state_list_get_by_clauses(), key_state_list_get_by_key_data_id(), policy_get_by_id(), policy_get_by_name(), policy_key_get_by_id(), policy_key_get_by_policyid_and_role(), policy_key_list_get_by_clauses(), policy_key_list_get_by_policy_id(), policy_list_get(), policy_list_get_by_clauses(), test2_get_by_id(), test2_get_by_name(), test_class_db_object(), test_get_by_id(), test_get_by_name(), test_list_get(), zone_db_get_by_id(), zone_db_get_by_name(), zone_list_db_get(), zone_list_db_get_by_clauses(), and zone_list_db_get_by_policy_id().
int db_object_set_connection | ( | db_object_t * | object, |
const db_connection_t * | connection | ||
) |
Set the database connection of a database object.
[in] | object | a db_object_t pointer. |
[in] | connection | a db_connection_t pointer. |
Definition at line 341 of file db_object.c.
References db_object::connection, DB_ERROR_UNKNOWN, and DB_OK.
Referenced by __test2_new_object(), __test_new_object(), and test_class_db_object().
int db_object_set_object_field_list | ( | db_object_t * | object, |
db_object_field_list_t * | object_field_list | ||
) |
Set the object field list of a database object, this takes over the ownership of the object field list.
[in] | object | a db_object_t pointer. |
[in] | object_field_list | a db_object_field_list_t pointer. |
Definition at line 386 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, and db_object::object_field_list.
Referenced by __test2_new_object(), __test_new_object(), and test_class_db_object().
int db_object_set_primary_key_name | ( | db_object_t * | object, |
const char * | primary_key_name | ||
) |
Set the primary key name of a database object.
[in] | object | a db_object_t pointer. |
[in] | primary_key_name | a character pointer. |
Definition at line 371 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, and db_object::primary_key_name.
Referenced by __test2_new_object(), __test_new_object(), and test_class_db_object().
int db_object_set_table | ( | db_object_t * | object, |
const char * | table | ||
) |
Set the table name of a database object.
[in] | object | a db_object_t pointer. |
[in] | table | a character pointer. |
Definition at line 356 of file db_object.c.
References DB_ERROR_UNKNOWN, DB_OK, and db_object::table.
Referenced by __test2_new_object(), __test_new_object(), and test_class_db_object().
const char * db_object_table | ( | const db_object_t * | object | ) |
Get the table name of a database object.
[in] | object | a db_object_t pointer. |
Definition at line 327 of file db_object.c.
Referenced by test_class_db_object().
int db_object_update | ( | const db_object_t * | object, |
const db_object_field_list_t * | object_field_list, | ||
const db_value_set_t * | value_set, | ||
const db_clause_list_t * | clause_list | ||
) |
Update an object or objects in the database.
[in] | object | a db_object_t pointer. |
[in] | object_field_list | a db_object_field_list_t pointer. |
[in] | value_set | a db_value_set_t pointer. |
[in] | clause_list | a db_clause_list_t pointer. |
Definition at line 441 of file db_object.c.
References db_object::connection, db_connection_update(), DB_ERROR_UNKNOWN, db_object::object_field_list, db_object::primary_key_name, and db_object::table.
Referenced by hsm_key_update(), key_data_update(), key_state_update(), policy_update(), test2_update(), test_class_db_object(), test_update(), and zone_db_update().