[rygel] core: Separate VAPI for misc functions from C world



commit 2f46a6247b92a236ec2b466b0d50135c641b3a5a
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Jun 22 15:58:43 2010 +0300

    core: Separate VAPI for misc functions from C world

 src/rygel/Makefile.am     |    3 ++-
 src/rygel/rygel-main.vala |    7 +------
 src/rygel/rygel-misc.vapi |   31 +++++++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 7 deletions(-)
---
diff --git a/src/rygel/Makefile.am b/src/rygel/Makefile.am
index 4fe846b..956d2e1 100644
--- a/src/rygel/Makefile.am
+++ b/src/rygel/Makefile.am
@@ -103,7 +103,7 @@ VAPI_SOURCE_FILES = rygel-configuration.vala \
 
 rygel_VALAFLAGS = \
 	-H rygel.h -C --library=rygel-1.0 --vapidir=$(srcdir) --thread \
-	--pkg rygel-build-config --pkg gupnp-1.0 \
+	--pkg rygel-build-config --pkg rygel-misc --pkg gupnp-1.0 \
 	--pkg gupnp-av-1.0 --pkg dbus-glib-1 --pkg gstreamer-0.10 \
 	--pkg gio-2.0 --pkg gee-1.0 --pkg posix -g
 
@@ -136,6 +136,7 @@ librygel_configuration_a_SOURCES = rygel-configuration.c \
 
 MAINTAINERCLEANFILES = Makefile.in $(BUILT_SOURCES)
 EXTRA_DIST = rygel-build-config.vapi \
+             rygel-misc.vapi \
              $(VAPI_FILES) \
              $(DEPS_FILES) \
              $(BUILT_SOURCES)
diff --git a/src/rygel/rygel-main.vala b/src/rygel/rygel-main.vala
index bb56471..baef63e 100644
--- a/src/rygel/rygel-main.vala
+++ b/src/rygel/rygel-main.vala
@@ -24,11 +24,6 @@
 using Gee;
 using GUPnP;
 
-namespace Posix {
-    [CCode (cheader_filename = "unistd.h")]
-    public extern int execvp (string file, string[] argv);
-}
-
 public class Rygel.Main : Object {
     private static int PLUGIN_TIMEOUT = 5;
 
@@ -238,7 +233,7 @@ public class Rygel.Main : Object {
         int exit_code = main.run ();
 
         if (main.need_restart) {
-            Posix.execvp (original_args[0], original_args);
+            Misc.Posix.execvp (original_args[0], original_args);
         }
 
         return exit_code;
diff --git a/src/rygel/rygel-misc.vapi b/src/rygel/rygel-misc.vapi
new file mode 100644
index 0000000..487bae0
--- /dev/null
+++ b/src/rygel/rygel-misc.vapi
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation.
+ *
+ * Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+namespace Rygel.Misc {
+    namespace Posix {
+        [CCode (cname = "execvp", cheader_filename = "unistd.h")]
+        public int execvp (string file,
+                           [CCode (array_length = false,
+                                   array_null_terminated = true)]
+                           string[] argv);
+    }
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]