00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
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
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,
00063 cmds,
00064 params,
00065 0,
00066 0,
00067 0,
00068 0,
00069 mod_init,
00070 0,
00071 0,
00072 0
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 }