aboutsummaryrefslogtreecommitdiff
path: root/nxproxy/Main.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-11-13 09:53:38 +0100
committerReinhard Tartler <siretart@tauware.de>2011-11-13 09:53:38 +0100
commit35472e34809a80b228f2763ef33d58acdb88dcce (patch)
treec8dda8a89bbe74c7fd614c3a4b5c627c39d2a261 /nxproxy/Main.c
parenta840692edc9c6d19cd7c057f68e39c7d95eb767d (diff)
downloadnx-libs-35472e34809a80b228f2763ef33d58acdb88dcce.tar.gz
nx-libs-35472e34809a80b228f2763ef33d58acdb88dcce.tar.bz2
nx-libs-35472e34809a80b228f2763ef33d58acdb88dcce.zip
Imported nxproxy-3.0.0-4.tar.gznxproxy/3.0.0-4
Summary: Imported nxproxy-3.0.0-4.tar.gz Keywords: Imported nxproxy-3.0.0-4.tar.gz into Git repository
Diffstat (limited to 'nxproxy/Main.c')
-rw-r--r--nxproxy/Main.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/nxproxy/Main.c b/nxproxy/Main.c
new file mode 100644
index 000000000..a5ce26275
--- /dev/null
+++ b/nxproxy/Main.c
@@ -0,0 +1,69 @@
+/**************************************************************************/
+/* */
+/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */
+/* */
+/* NXPROXY, NX protocol compression and NX extensions to this software */
+/* are copyright of NoMachine. Redistribution and use of the present */
+/* software is allowed according to terms specified in the file LICENSE */
+/* which comes in the source distribution. */
+/* */
+/* Check http://www.nomachine.com/licensing.html for applicability. */
+/* */
+/* NX and NoMachine are trademarks of Medialogic S.p.A. */
+/* */
+/* All rigths reserved. */
+/* */
+/**************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "NX.h"
+
+#define PANIC
+#define WARNING
+#undef TEST
+#undef DEBUG
+
+/*
+ * Entry point when running nxproxy stand-alone.
+ */
+
+int main(int argc, const char **argv)
+{
+ int result = -1;
+
+ char *options = NULL;
+
+ options = getenv("NX_DISPLAY");
+
+ if (NXTransParseCommandLine(argc, argv) < 0)
+ {
+ NXTransCleanup();
+ }
+
+ if (NXTransParseEnvironment(options, 0) < 0)
+ {
+ NXTransCleanup();
+ }
+
+ /*
+ * This should not return...
+ */
+
+ #ifdef TEST
+ fprintf(stderr, "Main: Yielding control to NX entry point.\n");
+ #endif
+
+ result = NXTransProxy(NX_FD_ANY, NX_MODE_ANY, NX_DISPLAY_ANY);
+
+ /*
+ * ...So these should not be called.
+ */
+
+ NXTransExit(result);
+
+ return 0;
+}