JS5: Add a CMakeList
authorNicolas Cornu <nicolas.cornu@ensi-bourges.fr>
Sat, 14 Aug 2010 02:47:21 +0200
changeset 115 cae0cb7eff45
parent 114 813867884159
child 116 7dbd5e5e7a7c
JS5: Add a CMakeList
CMakeLists.txt
jingle-filetransfer/filetransfer.c
jingle-socks5/CMakeLists.txt
jingle-socks5/socks5.c
jingle-socks5/socks5.h
socks5.c
socks5.h
--- a/CMakeLists.txt	Sat Aug 14 02:17:09 2010 +0200
+++ b/CMakeLists.txt	Sat Aug 14 02:47:21 2010 +0200
@@ -40,6 +40,7 @@
 add_subdirectory(jingle)
 add_subdirectory(jingle-filetransfer)
 add_subdirectory(jingle-ibb)
+add_subdirectory(jingle-socks5)
 
 ## Packaging information
 set(CPACK_PACKAGE_NAME mcabber-jingle)
--- a/jingle-filetransfer/filetransfer.c	Sat Aug 14 02:17:09 2010 +0200
+++ b/jingle-filetransfer/filetransfer.c	Sat Aug 14 02:47:21 2010 +0200
@@ -168,8 +168,11 @@
     if (!g_strcmp0(lm_message_node_get_attribute(node, "xmlns"), NS_JINGLE_APP_FT_INFO)
         && !g_strcmp0(node->name, "hash")) {
       ((JingleFT *)data)->hash = lm_message_node_get_value(node);
+      return TRUE;
 	}
+	return FALSE;
   }
+  return FALSE;
 }
 
 static gboolean is_md5_hash(const gchar *hash)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jingle-socks5/CMakeLists.txt	Sat Aug 14 02:47:21 2010 +0200
@@ -0,0 +1,4 @@
+add_library(jingle-socks5 MODULE socks5.c socks5.h)
+set_target_properties(jingle-socks5 PROPERTIES COMPILE_FLAGS "-Wall -O0 -g")
+include_directories(${CMAKE_SOURCE_DIR})
+install(TARGETS jingle-socks5 DESTINATION lib/mcabber)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jingle-socks5/socks5.c	Sat Aug 14 02:47:21 2010 +0200
@@ -0,0 +1,89 @@
+/*
+ * socks5.c
+ *
+ * Copyrigth (C) 2010 Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
+ *
+ * This program 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.
+ *
+ * This program 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
+ */
+
+#include "config.h"
+
+#include <glib.h>
+
+#include <mcabber/xmpp.h>
+#include <mcabber/modules.h>
+#include <mcabber/utils.h>
+#include <mcabber/xmpp_helper.h>
+#include <mcabber/logprint.h>
+#include <mcabber/hooks.h>
+
+#include <jingle/jingle.h>
+#include <jingle/check.h>
+#include <jingle/register.h>
+
+#include "socks5.h"
+
+gconstpointer jingle_socks5_check(JingleContent *cn, GError **err);
+gboolean jingle_socks5_cmp(gconstpointer data1, gconstpointer data2);
+void jingle_socks5_tomessage(gconstpointer data, LmMessageNode *node);
+const gchar* jingle_socks5_xmlns(void);
+gconstpointer jingle_socks5_new(void);
+void jingle_socks5_send(session_content *sc, const gchar *to, gconstpointer data, gchar *buf, gsize size);
+
+static void jingle_socks5_init(void);
+static void jingle_socks5_uninit(void);
+
+const gchar *deps[] = { "jingle", NULL };
+
+static JingleTransportFuncs funcs = {
+  jingle_socks5_xmlns,
+  jingle_socks5_check,
+  jingle_socks5_tomessage,
+  jingle_socks5_cmp,
+  jingle_socks5_new,
+  jingle_socks5_send
+};
+
+module_info_t  info_jingle_inbandbytestream = {
+  .branch          = MCABBER_BRANCH,
+  .api             = MCABBER_API_VERSION,
+  .version         = PROJECT_VERSION,
+  .description     = "Jingle In Band Bytestream (XEP-0261)\n",
+  .requires        = deps,
+  .init            = jingle_socks5_init,
+  .uninit          = jingle_socks5_uninit,
+  .next            = NULL,
+};
+
+
+const gchar* jingle_socks5_xmlns(void)
+{
+  return NS_JINGLE_TRANSPORT_SOCKS5;
+}
+
+static void jingle_socks5_init(void)
+{
+  jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs,
+                            JINGLE_TRANSPORT_STREAMING,
+                            JINGLE_TRANSPORT_HIGH);
+  xmpp_add_feature(NS_JINGLE_TRANSPORT_SOCKS5);
+}
+
+static void jingle_socks5_uninit(void)
+{
+  xmpp_del_feature(NS_JINGLE_TRANSPORT_SOCKS5);
+  jingle_unregister_transport(NS_JINGLE_TRANSPORT_SOCKS5);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jingle-socks5/socks5.h	Sat Aug 14 02:47:21 2010 +0200
@@ -0,0 +1,10 @@
+#ifndef __JINGLESOCKS5_H__
+#define __JINGLESOCKS5_H__ 1
+
+#define NS_JINGLE_TRANSPORT_SOCKS5 "urn:xmpp:jingle:transports:s5b:1"
+
+typedef struct {
+  
+} JingleSocks5;
+
+#endif
--- a/socks5.c	Sat Aug 14 02:17:09 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * socks5.c
- *
- * Copyrigth (C) 2010 Nicolas Cornu <nicolas.cornu@ensi-bourges.fr>
- *
- * This program 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.
- *
- * This program 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
- */
-
-#include "config.h"
-
-#include <glib.h>
-
-#include <mcabber/xmpp.h>
-#include <mcabber/modules.h>
-#include <mcabber/utils.h>
-#include <mcabber/xmpp_helper.h>
-#include <mcabber/logprint.h>
-#include <mcabber/hooks.h>
-
-#include <jingle/jingle.h>
-#include <jingle/check.h>
-#include <jingle/register.h>
-
-#include "socks5.h"
-
-gconstpointer jingle_socks5_check(JingleContent *cn, GError **err);
-gboolean jingle_socks5_cmp(gconstpointer data1, gconstpointer data2);
-void jingle_socks5_tomessage(gconstpointer data, LmMessageNode *node);
-const gchar* jingle_socks5_xmlns(void);
-gconstpointer jingle_socks5_new(void);
-void jingle_socks5_send(session_content *sc, const gchar *to, gconstpointer data, gchar *buf, gsize size);
-
-static void jingle_socks5_init(void);
-static void jingle_socks5_uninit(void);
-
-const gchar *deps[] = { "jingle", NULL };
-
-static JingleTransportFuncs funcs = {
-  jingle_socks5_xmlns,
-  jingle_socks5_check,
-  jingle_socks5_tomessage,
-  jingle_socks5_cmp,
-  jingle_socks5_new,
-  jingle_socks5_send
-};
-
-module_info_t  info_jingle_inbandbytestream = {
-  .branch          = MCABBER_BRANCH,
-  .api             = MCABBER_API_VERSION,
-  .version         = PROJECT_VERSION,
-  .description     = "Jingle In Band Bytestream (XEP-0261)\n",
-  .requires        = deps,
-  .init            = jingle_socks5_init,
-  .uninit          = jingle_socks5_uninit,
-  .next            = NULL,
-};
-
-
-const gchar* jingle_socks5_xmlns(void)
-{
-  return NS_JINGLE_TRANSPORT_SOCKS5;
-}
-
-static void jingle_socks5_init(void)
-{
-  jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs,
-                            JINGLE_TRANSPORT_STREAMING,
-                            JINGLE_TRANSPORT_MEDIUM);
-  xmpp_add_feature(NS_JINGLE_TRANSPORT_SOCKS5);
-}
-
-static void jingle_socks5_uninit(void)
-{
-  xmpp_del_feature(NS_JINGLE_TRANSPORT_SOCKS5);
-  jingle_unregister_transport(NS_JINGLE_TRANSPORT_SOCKS5);
-}
--- a/socks5.h	Sat Aug 14 02:17:09 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#ifndef __JINGLESOCKS5_H__
-#define __JINGLESOCKS5_H__ 1
-
-#define NS_JINGLE_TRANSPORT_SOCKS5 "urn:xmpp:jingle:transports:s5b:1"
-
-typedef struct {
-  
-} JingleSocks5;
-
-#endif