/home/dcp1990/prog/fakedbfs/include/fakedbfs/db.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005, Dan Ponte
00003  *
00004  * db.h - database stuff
00005  * 
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  * 4. Neither the name of the University nor the names of its contributors
00015  *    may be used to endorse or promote products derived from this software
00016  *    without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00019  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00022  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00023  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00024  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00025  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00026  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00027  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00028  * SUCH DAMAGE.
00029  */
00030 /* $Amigan: fakedbfs/include/fakedbfs/db.h,v 1.7 2006/04/19 19:58:22 dcp1990 Exp $ */
00035 #ifndef HAVE_FDBFS_DB_H
00036 #define HAVE_FDBFS_DB_H
00037 #include <fakedbfs/types.h>
00038 
00046 int fdbfs_db_open(fdbfs_t *f);
00047 
00055 int fdbfs_db_close(fdbfs_t *f);
00056 
00065 int fdbfs_db_table_exists(fdbfs_t *f, const char *tname);
00066 
00075 int fdbfs_db_cat_exists(fdbfs_t *f, const char *cat);
00076 
00086 int fdbfs_db_create_table(fdbfs_t *f, const char *tname, const char *tspec);
00087 
00095 const char* fdbfs_db_gettype(enum DataType t);
00096 
00108 int fdbfs_db_add_column(fdbfs_t *f, const char *tname, const char *cname, coltype_t datatype);
00109 
00119 int fdbfs_db_del_column(fdbfs_t *f, const char *tname, const char *cname);
00120 
00131 int fdbfs_db_add_to_enum_list_table(fdbfs_t *f, const char *name, const char *tname, const char *specf);
00132 
00145 int fdbfs_db_add_to_cat_list_table(fdbfs_t *f, const char *name, const char *alias, const char *tablename,
00146                 const char *fieldtable);
00147 
00160 int fdbfs_db_add_to_field_desc(fdbfs_t *f, const char *tablename, const char *name, const char *alias, enum DataType
00161                 type, const char *typen);
00162 
00174 int fdbfs_db_delete(fdbfs_t *f, const char *from, const char *wherecol, const char *wherecmp, const char *whereval);
00175 
00184 int fdbfs_db_drop_table(fdbfs_t *f, const char *tablename);
00185 
00199 int fdbfs_db_add_enum_elem(fdbfs_t *f, const char *tname, const char *name, const char *fmtname, unsigned int value,
00200                 enum DataType dtype, const char *subelements);
00201 
00214 int fdbfs_db_bind_field(fdbfs_t *f, int *count, enum DataType type, void *value, size_t len, sqlite3_stmt *stmt);
00215 
00227 int fdbfs_db_get_lastupdate(fdbfs_t *f, const char *cat, const char *filename);
00228 
00236 int fdbfs_db_rm_catalogue(fdbfs_t *f, const const char *catname);
00237 
00248 int fdbfs_db_mib_add(fdbfs_t *f, const char *mib, enum DataType type, union Data data);
00249 
00260 int fdbfs_db_mib_update(fdbfs_t *f, const char *mib, enum DataType type, union Data data);
00261 
00268 int fdbfs_db_start(fdbfs_t *f);
00269 
00280 int fdbfs_db_add_to_cfd_list_table(fdbfs_t *f, const char *name, const char *alias, const char *tablename, const char *specfile);
00281 
00291 int fdbfs_db_cfd_update_refcount(fdbfs_t *f, const char *name, int add, unsigned int val);
00292 
00301 int fdbfs_db_cat_getcfdname(fdbfs_t *f, const char *catname, char **tcfd);
00302 
00303 #endif

Generated on Wed Apr 19 16:26:23 2006 for fakedbfs by  doxygen 1.4.6