summaryrefslogtreecommitdiffstats
path: root/mod_log_sql.h
diff options
context:
space:
mode:
authorGravatar Edward Rudd 2004-03-02 05:34:50 +0000
committerGravatar Edward Rudd 2004-03-02 05:34:50 +0000
commit1caf9013120e8df2d65a97c7216cefa58536f058 (patch)
treedf9201a0d86396bae32a1a4cb366761859dcce72 /mod_log_sql.h
parent53acb181ef04ae70a7dcfed849f7c02850781c20 (diff)
mysql code separation complete..
Diffstat (limited to 'mod_log_sql.h')
-rw-r--r--mod_log_sql.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/mod_log_sql.h b/mod_log_sql.h
index 0c59cb7..1eed9b4 100644
--- a/mod_log_sql.h
+++ b/mod_log_sql.h
@@ -1,4 +1,4 @@
1/* $Id: mod_log_sql.h,v 1.4 2004/02/29 23:36:18 urkle Exp $ */ 1/* $Id: mod_log_sql.h,v 1.5 2004/03/02 05:34:50 urkle Exp $ */
2 2
3#ifndef MOD_LOG_SQL_H 3#ifndef MOD_LOG_SQL_H
4#define MOD_LOG_SQL_H 4#define MOD_LOG_SQL_H
@@ -31,12 +31,11 @@ LOGSQL_DECLARE(void) log_sql_register_item(server_rec *s, apr_pool_t *p,
31 char key, logsql_item_func *func, const char *sql_field_name, 31 char key, logsql_item_func *func, const char *sql_field_name,
32 int want_orig_default, int string_contents); 32 int want_orig_default, int string_contents);
33 33
34/* DB Connection structure holds connection status information 34/* DB Connection structure holds connection handle */
35 * and connection handle
36 */
37typedef struct { 35typedef struct {
38 int connected; /* Are we connected to the DB */ 36 int connected; /* Are we connected to the DB */
39 void *handle; /* DB specific connection pointer */ 37 void *handle; /* DB specific connection pointer */
38 apr_table_t *parms; /* DB connection parameters */
40} logsql_dbconnection; 39} logsql_dbconnection;
41 40
42/* open db handle return values*/ 41/* open db handle return values*/
@@ -45,9 +44,22 @@ typedef enum {
45 LOGSQL_OPENDB_SUCCESS, 44 LOGSQL_OPENDB_SUCCESS,
46 LOGSQL_OPENDB_ALREADY, 45 LOGSQL_OPENDB_ALREADY,
47 LOGSQL_OPENDB_PRESERVE 46 LOGSQL_OPENDB_PRESERVE
48} logsql_opendb; 47} logsql_opendb_ret;
48
49typedef enum {
50 LOGSQL_QUERY_SUCCESS = 0,
51 LOGSQL_QUERY_FAIL,
52 LOGSQL_QUERY_NOLINK,
53 LOGSQL_QUERY_NOTABLE,
54 LOGSQL_QUERY_PRESERVED,
55} logsql_query_ret;
49 56
50/* For passing to create_tables handler */ 57typedef enum {
58 LOGSQL_TABLE_SUCCESS = 0,
59 LOGSQL_TABLE_FAIL,
60} logsql_table_ret;
61
62/* Table type to create/log to */
51typedef enum { 63typedef enum {
52 LOGSQL_TABLE_ACCESS = 0, 64 LOGSQL_TABLE_ACCESS = 0,
53 LOGSQL_TABLE_NOTES, 65 LOGSQL_TABLE_NOTES,
@@ -60,5 +72,15 @@ typedef enum {
60#define LOGSQL_TABLE_ALL LOGSQL_TABLE_ACCESS | LOGSQL_TABLE_NOTES | \ 72#define LOGSQL_TABLE_ALL LOGSQL_TABLE_ACCESS | LOGSQL_TABLE_NOTES | \
61 LOGSQL_TABLE_HEADERSIN | LOGSQL_TABLE_HEADERSOUT | LOGSQL_TABLE_COOKIES 73 LOGSQL_TABLE_HEADERSIN | LOGSQL_TABLE_HEADERSOUT | LOGSQL_TABLE_COOKIES
62 74
75/* MySQL module calls */
76logsql_opendb_ret log_sql_mysql_connect(server_rec *s, logsql_dbconnection *db);
77void log_sql_mysql_close(logsql_dbconnection *db);
78const char *log_sql_mysql_escape(const char *from_str, apr_pool_t *p,
79 logsql_dbconnection *db);
80logsql_query_ret log_sql_mysql_query(request_rec *r,logsql_dbconnection *db,
81 const char *query);
82logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection *db,
83 logsql_tabletype table_type, const char *table_name);
84
63 85
64#endif /* MOD_LOG_SQL_H */ 86#endif /* MOD_LOG_SQL_H */