#include "metadata_table_private.h"
Go to the source code of this file.
Data Structures | |
struct | erMetadb_t |
Defines | |
#define | SQLITE_COLLATION_STRCASECMP "IREX_CASE_INSENSITIVE" |
Functions | |
const char *const * | ermetadb_private_get_global_column_names (const char *table) |
Get column names for a specified SQL table name. | |
int | local_delete_all_data_for_file (erMetadb thiz, const char *filename) |
int | local_delete_all_data_for_id (erMetadb thiz, gint64 file_id) |
#define SQLITE_COLLATION_STRCASECMP "IREX_CASE_INSENSITIVE" |
File Name : ermetadb_private.h
Description: Private functions used by libermetadb internally Copyright (C) 2008 iRex Technologies B.V. All rights reserved.
Definition at line 45 of file ermetadb_private.h.
Referenced by global_select_common(), and open_sqlite_database().
const char* const* ermetadb_private_get_global_column_names | ( | const char * | table | ) |
Get column names for a specified SQL table name.
---------------------------------------------------------------------------
Name : ermetadb_private_get_global_column_names
[in] | table | - name of the SQL table |
--------------------------------------------------------------------------
Definition at line 980 of file ermetadb.c.
References global_database_tables, LOGPRINTF, and table_name.
Referenced by ermetadb_global_get_file(), and set_file_metadata_impl().
00981 { 00982 LOGPRINTF("entry: table [%s]", table); 00983 g_assert(table); 00984 00985 int i; 00986 for (i = 0 ; global_database_tables[i].table_name; i++) 00987 { 00988 if ( strcmp(global_database_tables[i].table_name, table) == 0 ) 00989 { 00990 return global_database_tables[i].column_names; 00991 } 00992 } 00993 00994 return NULL; 00995 }
int local_delete_all_data_for_file | ( | erMetadb | thiz, | |
const char * | filename | |||
) |
Definition at line 846 of file ermetadb_local.c.
References ER_NOT_FOUND, get_local_id(), and local_delete_all_data_for_id().
Referenced by delete_local_metadata().
00847 { 00848 g_assert(!thiz->is_global); 00849 00850 gint64 file_id = get_local_id(thiz, filename); 00851 if (file_id < 0) return ER_NOT_FOUND; 00852 00853 return local_delete_all_data_for_id(thiz, file_id); 00854 }
int local_delete_all_data_for_id | ( | erMetadb | thiz, | |
gint64 | file_id | |||
) |
Definition at line 857 of file ermetadb_local.c.
References ER_OK, local_delete_all_annotations(), local_delete_all_application_data(), local_delete_entry(), sql3_begin_transaction(), and sql3_commit_or_rollback().
Referenced by convert_database_05_06(), and local_delete_all_data_for_file().
00858 { 00859 g_assert(!thiz->is_global); 00860 00861 int ret = sql3_begin_transaction(thiz); 00862 if (ret != ER_OK) return ret; 00863 00864 // delete annotations, application data and file_metadata entry 00865 local_delete_all_annotations(thiz, file_id); 00866 local_delete_all_application_data(thiz, file_id); 00867 local_delete_entry(thiz, file_id); 00868 00869 ret = sql3_commit_or_rollback(thiz, ER_OK); 00870 return ret; 00871 00872 }