Blame modules/lua/lua_dbd.h

Packit 90a5c9
/**
Packit 90a5c9
 * Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
 * contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
 * this work for additional information regarding copyright ownership.
Packit 90a5c9
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
 * (the "License"); you may not use this file except in compliance with
Packit 90a5c9
 * the License.  You may obtain a copy of the License at
Packit 90a5c9
 *
Packit 90a5c9
 * http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
 *
Packit 90a5c9
 * Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
 * See the License for the specific language governing permissions and
Packit 90a5c9
 * limitations under the License.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#ifndef _LUA_DBD_H_
Packit 90a5c9
#define _LUA_DBD_H_
Packit 90a5c9
Packit 90a5c9
#include "mod_lua.h"
Packit 90a5c9
#include "apr.h"
Packit 90a5c9
#include "apr_dbd.h"
Packit 90a5c9
#include "mod_dbd.h"
Packit 90a5c9
Packit 90a5c9
#define LUA_DBTYPE_APR_DBD 0
Packit 90a5c9
#define LUA_DBTYPE_MOD_DBD 1
Packit 90a5c9
typedef struct
Packit 90a5c9
{
Packit 90a5c9
    apr_dbd_t               *handle;
Packit 90a5c9
    const apr_dbd_driver_t  *driver;
Packit 90a5c9
    int                     alive;
Packit 90a5c9
    apr_pool_t              *pool;
Packit 90a5c9
    char                    type;
Packit 90a5c9
    ap_dbd_t *              dbdhandle;
Packit 90a5c9
    server_rec              *server;
Packit 90a5c9
} lua_db_handle;
Packit 90a5c9
Packit 90a5c9
typedef struct {
Packit 90a5c9
    const apr_dbd_driver_t  *driver;
Packit 90a5c9
    int                     rows;
Packit 90a5c9
    int                     cols;
Packit 90a5c9
    apr_dbd_results_t       *results;
Packit 90a5c9
    apr_pool_t              *pool;
Packit 90a5c9
} lua_db_result_set;
Packit 90a5c9
Packit 90a5c9
typedef struct {
Packit 90a5c9
    apr_dbd_prepared_t      *statement;
Packit 90a5c9
    int                     variables;
Packit 90a5c9
    lua_db_handle           *db;
Packit 90a5c9
} lua_db_prepared_statement;
Packit 90a5c9
Packit 90a5c9
int lua_db_acquire(lua_State* L);
Packit 90a5c9
int lua_db_escape(lua_State* L);
Packit 90a5c9
int lua_db_close(lua_State* L);
Packit 90a5c9
int lua_db_prepare(lua_State* L);
Packit 90a5c9
int lua_db_prepared(lua_State* L);
Packit 90a5c9
int lua_db_select(lua_State* L);
Packit 90a5c9
int lua_db_query(lua_State* L);
Packit 90a5c9
int lua_db_prepared_select(lua_State* L);
Packit 90a5c9
int lua_db_prepared_query(lua_State* L);
Packit 90a5c9
int lua_db_get_row(lua_State* L);
Packit 90a5c9
int lua_db_gc(lua_State* L);
Packit 90a5c9
int lua_db_active(lua_State* L);
Packit 90a5c9
Packit 90a5c9
#endif /* !_LUA_DBD_H_ */