savan_db_mgr.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef SAVAN_DB_MGR_H
00018 #define SAVAN_DB_MGR_H
00019 
00025 #include <axutil_allocator.h>
00026 #include <axutil_env.h>
00027 #include <axutil_error.h>
00028 #include <axutil_string.h>
00029 #include <axutil_utils.h>
00030 #include <axutil_array_list.h>
00031 #include <savan_subscriber.h>
00032 #include <sqlite3.h>
00033 
00034 #ifdef __cplusplus
00035 extern "C"
00036 {
00037 #endif
00038 
00039 
00044 typedef struct savan_db_mgr
00045 {
00046     axis2_char_t *dbname;
00047 }savan_db_mgr_t;
00048 
00049 AXIS2_EXTERN savan_db_mgr_t * AXIS2_CALL
00050 savan_db_mgr_create(
00051     const axutil_env_t *env,
00052     axis2_char_t *dbname);
00053 
00054 AXIS2_EXTERN void AXIS2_CALL
00055 savan_db_mgr_free(
00056     savan_db_mgr_t *db_mgr,
00057     const axutil_env_t *env);
00058 
00059 AXIS2_EXTERN int 
00060 savan_db_mgr_topic_find_callback(
00061     void *not_used, 
00062     int argc, 
00063     char **argv, 
00064     char **col_name);
00065 
00066 AXIS2_EXTERN int 
00067 savan_db_mgr_subs_find_callback(
00068     void *not_used, 
00069     int argc, 
00070     char **argv, 
00071     char **col_name);
00072 
00073 AXIS2_EXTERN int 
00074 savan_db_mgr_subs_retrieve_callback(
00075     void *not_used, 
00076     int argc, 
00077     char **argv, 
00078     char **col_name);
00079 
00080 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00081 savan_db_mgr_insert_subscriber(
00082     const axutil_env_t *env,
00083     const axis2_char_t *dbname,
00084     savan_subscriber_t *subscriber);
00085 
00086 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00087 savan_db_mgr_update_subscriber(
00088     const axutil_env_t *env,
00089     const axis2_char_t *dbname,
00090     savan_subscriber_t *subscriber);
00091 
00092 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00093 savan_db_mgr_insert_topic(
00094     const axutil_env_t *env,
00095     const axis2_char_t *dbname,
00096     axis2_char_t *topic_name,
00097     axis2_char_t *topic_url);
00098 
00099 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00100 savan_db_mgr_remove(
00101     const axutil_env_t *env,
00102     const axis2_char_t *dbname,
00103     axis2_char_t *sql_stmt_remove);
00104 
00105 AXIS2_EXTERN savan_subscriber_t *AXIS2_CALL
00106 savan_db_mgr_retrieve(
00107     const axutil_env_t *env,
00108     const axis2_char_t *dbname,
00109     int (*retrieve_func)(void *, int, char **, char **),
00110     axis2_char_t *sql_stmt_retrieve);
00111 
00112 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00113 savan_db_mgr_update(
00114     const axutil_env_t *env,
00115     const axis2_char_t *dbname,
00116     axis2_char_t *sql_stmt_update);
00117 
00118 AXIS2_EXTERN axutil_array_list_t * AXIS2_CALL
00119 savan_db_mgr_retrieve_all(
00120     const axutil_env_t *env,
00121     const axis2_char_t *dbname,
00122     int (*find_func)(void *, int, char **, char **),
00123     axis2_char_t *sql_stmt_find);
00124 
00125 AXIS2_EXTERN void * AXIS2_CALL
00126 savan_db_mgr_get_dbconn(
00127     const axutil_env_t *env,
00128     const axis2_char_t *dbname);
00129 
00130 axis2_char_t *AXIS2_CALL
00131 savan_db_mgr_create_update_sql(
00132     const axutil_env_t *env,
00133     savan_subscriber_t *subscriber);
00134 
00141 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00142 savan_db_mgr_create_db(
00143     const axutil_env_t *env,
00144     const axis2_char_t *dbname);
00145 
00147 #ifdef __cplusplus
00148 }
00149 #endif
00150 #endif /* SAVAN_DB_MGR_H */

Generated on Wed Oct 14 01:02:18 2009 for Savan/C by  doxygen 1.5.7.1