Browse code

New module interface

Jan Janak authored on 11/03/2003 13:03:30
Showing 1 changed files
... ...
@@ -24,6 +24,10 @@
24 24
  * You should have received a copy of the GNU General Public License 
25 25
  * along with this program; if not, write to the Free Software 
26 26
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
+ *
28
+ * History:
29
+ * -------
30
+ * 2003-03-11: New module interface (janakj)
27 31
  */
28 32
 
29 33
 
... ...
@@ -58,25 +62,40 @@ struct domain_list ***hash_table;            /* Pointer to current hash table po
58 62
 struct domain_list **hash_table_1;           /* Pointer to hash table 1 */
59 63
 struct domain_list **hash_table_2;           /* Pointer to hash table 2 */
60 64
 
65
+
66
+/*
67
+ * Exported functions
68
+ */
69
+static cmd_export_t cmds[] = {
70
+	{"is_from_local",     is_from_local,     0, 0},
71
+	{"is_uri_host_local", is_uri_host_local, 0, 0},
72
+	{0, 0, 0, 0}
73
+};
74
+
75
+
76
+/*
77
+ * Exported parameters
78
+ */
79
+static param_export_t params[] = {
80
+	{"db_url",               STR_PARAM, &db_url},
81
+	{"db_mode",              INT_PARAM, &db_mode},
82
+	{"domain_table",         STR_PARAM, &domain_table},
83
+	{"domain_domain_column", STR_PARAM, &domain_domain_col},
84
+	{0, 0, 0}
85
+};
86
+
87
+
61 88
 /*
62 89
  * Module interface
63 90
  */
64 91
 struct module_exports exports = {
65 92
 	"domain", 
66
-	(char*[]) {"is_from_local", "is_uri_host_local"},
67
-	(cmd_function[]) {is_from_local, is_uri_host_local},
68
-	(int[]) {0, 0},
69
-	(fixup_function[]) {0, 0},
70
-	2, /* number of functions*/
71
-	(char*[]){"db_url", "db_mode", "domain_table", "domain_domain_column"},
72
-	(modparam_t[]){STR_PARAM, INT_PARAM, STR_PARAM, STR_PARAM},
73
-	(void*[]){&db_url, &db_mode, &domain_table, &domain_domain_col},
74
-	4,
75
-	
93
+	cmds,      /* Exported functions */
94
+	params,    /* Exported parameters */
76 95
 	mod_init,  /* module initialization function */
77
-	NULL,      /* response function*/
96
+	0,         /* response function*/
78 97
 	destroy,   /* destroy function */
79
-	NULL,      /* cancel function */
98
+	0,         /* cancel function */
80 99
 	child_init /* per-child init function */
81 100
 };
82 101