From 3c04877b3ab121d56b7f7bb6e02afdd7dc447f91 Mon Sep 17 00:00:00 2001
From: zmap <zmap>
Date: Tue, 15 Jun 2010 13:06:48 +0000
Subject: [PATCH] XRemote: add the x_program() getter/setter subroutine.

---
 src/perl/X11-XRemote-0.01/XRemote.xs         | 16 ++++++++++++++++
 src/perl/X11-XRemote-0.01/lib/X11/XRemote.pm | 19 +++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/src/perl/X11-XRemote-0.01/XRemote.xs b/src/perl/X11-XRemote-0.01/XRemote.xs
index dfc64e435..f6cb6087b 100755
--- a/src/perl/X11-XRemote-0.01/XRemote.xs
+++ b/src/perl/X11-XRemote-0.01/XRemote.xs
@@ -63,6 +63,22 @@ client_response_name(...)
       OUTPUT:
       RETVAL
 
+char *
+_x_program_get(...)
+      CODE:
+      RETVAL = ZMAP_X_PROGRAM_G;
+      OUTPUT:
+      RETVAL
+
+void
+_x_program_set(x_program)
+      char *x_program
+      CODE:
+      {
+        ZMAP_X_PROGRAM_G = x_program;
+        XSRETURN(1);
+      }
+
 
 MODULE = X11::XRemote           PACKAGE = X11::XRemote::Handle
 
diff --git a/src/perl/X11-XRemote-0.01/lib/X11/XRemote.pm b/src/perl/X11-XRemote-0.01/lib/X11/XRemote.pm
index abf42c5df..aa4087d81 100755
--- a/src/perl/X11-XRemote-0.01/lib/X11/XRemote.pm
+++ b/src/perl/X11-XRemote-0.01/lib/X11/XRemote.pm
@@ -28,6 +28,17 @@ my $PING_COMMAND = 'ping';
 
 bootstrap X11::XRemote $VERSION;
 
+#==========================================================#
+#  SUBS: Call directly, do not send to an object or class  #
+#==========================================================#
+sub x_program{
+    my ($x_program) = @_;
+    if ($x_program) {
+        _x_program_set($x_program);
+    }
+    return _x_program_get();
+}
+
 #==========================================================#
 # ALL MODES SUBS: Avaiable to client and server            #
 #==========================================================#
@@ -369,6 +380,14 @@ A string which corresponds to the name of the default request atom the client sh
 
 A string which corresponds to the name of the default response atom the client should use.
 
+=item x_program()
+
+Gets the X program name.
+
+=item x_program($x_program)
+
+Sets the X program name.
+
 =back
 
 =head1 AUTHOR
-- 
GitLab