[svn-commits] rizzo: trunk r89364 - /trunk/main/cygload.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Nov 17 03:37:12 CST 2007


Author: rizzo
Date: Sat Nov 17 03:37:12 2007
New Revision: 89364

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89364
Log:
Loader for cygwin where asterisk is really a big dll
(something like this is already in 1.2)


Added:
    trunk/main/cygload.c   (with props)

Added: trunk/main/cygload.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cygload.c?view=auto&rev=89364
==============================================================================
--- trunk/main/cygload.c (added)
+++ trunk/main/cygload.c Sat Nov 17 03:37:12 2007
@@ -1,0 +1,20 @@
+/*
+ * Loader for asterisk under windows.
+ * Open the dll, locate main, run.
+ */
+#include <unistd.h>
+#include <dlfcn.h>
+#include <stdio.h>
+
+typedef int (*main_f)(int argc, char *argv[]);
+
+int main(int argc, char *argv[])
+{
+	main_f ast_main = NULL;
+	void *handle = dlopen("asterisk.dll", 0);
+	if (handle)
+		ast_main = (main_f)dlsym(handle, "amain");
+	if (ast_main)
+		return ast_main(argc, argv);
+	fprintf(stderr, "could not load asterisk, %s\n", dlerror());
+}

Propchange: trunk/main/cygload.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/main/cygload.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/main/cygload.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list