Browse Source

modules/textopsx, modules_k/alias_db, modules_k/pua_usrloc: added missing api.h files from previous commits

pd 14 năm trước cách đây
mục cha
commit
8f00ae7a9b
3 tập tin đã thay đổi với 100 bổ sung0 xóa
  1. 48 0
      modules/textopsx/api.h
  2. 26 0
      modules_k/alias_db/api.h
  3. 26 0
      modules_k/pua_usrloc/api.h

+ 48 - 0
modules/textopsx/api.h

@@ -0,0 +1,48 @@
+/*
+ * This file is part of kamailio, a free SIP server.
+ *
+ * kamailio is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * kamailio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+#ifndef TEXTOPSX_API_H_
+#define TEXTOPSX_API_H_
+#include "../../str.h"
+#include "../../sr_module.h"
+
+
+/*
+ * Struct with the textopsx api.
+ */
+typedef struct textopsx_binds {
+	cmd_function msg_apply_changes;
+} textopsx_api_t;
+
+typedef int (*bind_textopsx_f)(textopsx_api_t*);
+
+/*
+ * Function to be called direclty from other modules to load
+ * the textops API.
+ */
+inline static int load_textopsx_api(textopsx_api_t *tob){
+	bind_textopsx_f bind_textopsx_exports;
+	if(!(bind_textopsx_exports=(bind_textopsx_f)find_export("bind_textopsx", 1, 0))){
+		LM_ERR("Failed to import bind_textopsx\n");
+		return -1;
+	}
+	return bind_textopsx_exports(tob);
+}
+
+#endif /*TEXTX_OPS_API_H_*/

+ 26 - 0
modules_k/alias_db/api.h

@@ -0,0 +1,26 @@
+#ifndef ALIASDB_API_H
+#define ALIASDB_API_H
+#include "../../str.h"
+
+typedef int (*alias_db_lookup_t)(struct sip_msg*, str table);
+
+typedef struct alias_db_binds {
+	alias_db_lookup_t alias_db_lookup;
+} alias_db_api_t;
+
+typedef int (*bind_alias_db_f)(alias_db_api_t*);
+
+int bind_alias_db(struct alias_db_binds*);
+
+inline static int alias_db_load_api(alias_db_api_t *pxb)
+{
+	bind_alias_db_f bind_alias_db_exports;
+	if (!(bind_alias_db_exports = (bind_alias_db_f)find_export("bind_alias_db", 1, 0)))
+	{
+		LM_ERR("Failed to import bind_alias_db\n");
+		return -1;
+	}
+	return bind_alias_db_exports(pxb);
+}
+
+#endif /*ALIASDB_API_H*/

+ 26 - 0
modules_k/pua_usrloc/api.h

@@ -0,0 +1,26 @@
+#ifndef PUAUSRLOC_API_H
+#define PUAUSRLOC_API_H
+#include "../../str.h"
+
+typedef int (*pua_set_publish_t)(struct sip_msg*, char *, char *);
+
+typedef struct pua_usrloc_binds {
+	pua_set_publish_t pua_set_publish;
+} pua_usrloc_api_t;
+
+typedef int (*bind_pua_usrloc_f)(pua_usrloc_api_t*);
+
+int bind_pua_usrloc(struct pua_usrloc_binds*);
+
+inline static int pua_usrloc_load_api(pua_usrloc_api_t *pxb)
+{
+	bind_pua_usrloc_f bind_pua_usrloc_exports;
+	if (!(bind_pua_usrloc_exports = (bind_pua_usrloc_f)find_export("bind_pua_usrloc", 1, 0)))
+	{
+		LM_ERR("Failed to import bind_pua_usrloc\n");
+		return -1;
+	}
+	return bind_pua_usrloc_exports(pxb);
+}
+
+#endif /*PUAUSRLOC_API_H*/