perlvdb.c

Go to the documentation of this file.
00001 /* 
00002  * $Id: perlvdb.c 770 2007-01-22 10:16:34Z bastian $
00003  *
00004  * Perl virtual database module
00005  *
00006  * Copyright (C) 2007 Collax GmbH
00007  *                    (Bastian Friedrich <bastian.friedrich@collax.com>)
00008  *
00009  * This file is part of Kamailio, a free SIP server.
00010  *
00011  * Kamailio is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version
00015  *
00016  * Kamailio is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License 
00022  * along with this program; if not, write to the Free Software 
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024  *
00025  */
00026 
00027 #include "perlvdb.h"
00028 
00029 MODULE_VERSION
00030 
00031 static int mod_init(void);
00032 
00033 SV* vdbmod;
00034 
00035 /*
00036  * Perl virtual database module interface
00037  */
00038 static cmd_export_t cmds[] = {
00039    {"db_use_table",  (cmd_function)perlvdb_use_table, 2, 0, 0, 0},
00040    {"db_init",    (cmd_function)perlvdb_db_init,   1, 0, 0, 0},
00041    {"db_close",      (cmd_function)perlvdb_db_close,  2, 0, 0, 0},
00042    {"db_insert",     (cmd_function)perlvdb_db_insert, 2, 0, 0, 0},
00043    {"db_update",     (cmd_function)perlvdb_db_update, 2, 0, 0, 0},
00044    {"db_delete",     (cmd_function)perlvdb_db_delete, 2, 0, 0, 0},
00045    {"db_query",      (cmd_function)perlvdb_db_query, 2, 0, 0, 0},
00046    {"db_free_result",   (cmd_function)perlvdb_db_free_result, 2, 0, 0, 0},
00047    {0, 0, 0, 0, 0, 0}
00048 };
00049 
00050 
00051 /*
00052  * Exported parameters
00053  */
00054 static param_export_t params[] = {
00055    {0, 0, 0}
00056 };
00057 
00058 
00059 
00060 struct module_exports exports = {
00061    "perlvdb",
00062    RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */
00063    cmds,
00064    params,      /*  module parameters */
00065    0,           /* exported statistics */
00066    0,           /* exported MI functions */
00067    0,           /* exported pseudo-variables */
00068    0,           /* extra processes */
00069    mod_init,    /* module initialization function */
00070    0,           /* response function*/
00071    0,           /* destroy function */
00072    0            /* per-child init function */
00073 };
00074 
00075 
00076 static int mod_init(void)
00077 {
00078    if (!module_loaded("perl")) {
00079       LM_CRIT("perl module not loaded. Exiting.\n");
00080       return -1;
00081    }
00082 
00083    return 0;
00084 }

Generated on Thu May 24 02:00:29 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6