[libvirt] [libvirt-php][PATCH 07/11] src: Introduce vncfunc.h

Michal Privoznik mprivozn at redhat.com
Tue Sep 27 13:11:10 UTC 2016


Instead of forward declaration of some vnc_* functions from
vncfunc.c lets have a separate header file for that purpose.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/Makefile.am   |  2 +-
 src/libvirt-php.c |  3 +--
 src/libvirt-php.h |  5 -----
 src/vncfunc.c     |  1 +
 src/vncfunc.h     | 38 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 41 insertions(+), 8 deletions(-)
 create mode 100644 src/vncfunc.h

diff --git a/src/Makefile.am b/src/Makefile.am
index a12e729..5720ddd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,7 +19,7 @@ php_plugindir = $(extensiondir)
 php_plugin_LTLIBRARIES = libvirt-php.la
 libvirt_php_la_SOURCES = \
 	util.c util.h	\
-	vncfunc.c \
+	vncfunc.c vncfunc.h	\
 	sockets.c \
 	libvirt-php.c libvirt-php.h
 libvirt_php_la_CFLAGS = \
diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index 70405f2..01e9b57 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -28,10 +28,9 @@
 
 #include "libvirt-php.h"
 #include "util.h"
+#include "vncfunc.h"
 
 #ifndef EXTWIN
-// From vncfunc.c
-int vnc_get_dimensions(char *server, char *port, int *width, int *height);
 // From sockets.c
 int connect_socket(char *server, char *port, int keepalive, int nodelay, int allow_server_override);
 #endif
diff --git a/src/libvirt-php.h b/src/libvirt-php.h
index 39bd520..1225c0b 100644
--- a/src/libvirt-php.h
+++ b/src/libvirt-php.h
@@ -136,7 +136,6 @@ int connect_socket(char *server, char *port, int keepalive, int nodelay, int all
 int socket_has_data(int sfd, long maxtime, int ignoremsg);
 void socket_read(int sfd, long length);
 int socket_read_and_save(int sfd, char *fn, long length);
-int vnc_get_bitmap(char *server, char *port, char *fn);
 
 typedef struct tTokenizer {
     char **tokens;
@@ -280,10 +279,6 @@ typedef struct _php_libvirt_hash_key_info {
 } php_libvirt_hash_key_info;
 
 /* Private definitions */
-int vnc_refresh_screen(char *server, char *port, int scancode);
-int vnc_send_keys(char *server, char *port, char *keys);
-int vnc_send_pointer_event(char *server, char *port, int pos_x, int pos_y, int clicked, int release);
-
 int set_logfile(char *filename, long maxsize TSRMLS_DC);
 char *get_datetime(void);
 char *get_string_from_xpath(char *xml, char *xpath, zval **val, int *retVal);
diff --git a/src/vncfunc.c b/src/vncfunc.c
index 393624f..b1a994d 100644
--- a/src/vncfunc.c
+++ b/src/vncfunc.c
@@ -7,6 +7,7 @@
  *   Michal Novotny <minovotn at redhat.com>
  */
 
+#include "vncfunc.h"
 #include "libvirt-php.h"
 #include "util.h"
 
diff --git a/src/vncfunc.h b/src/vncfunc.h
new file mode 100644
index 0000000..4758f95
--- /dev/null
+++ b/src/vncfunc.h
@@ -0,0 +1,38 @@
+/*
+ * vncfunc.h: VNC Client functions to be used for the graphical VNC console of libvirt-php
+ *
+ * See COPYING for the license of this software
+ *
+ * Written by:
+ *   Michal Novotny <minovotn at redhat.com>
+ *   Michal Privoznik <mprivozn at redhat.com>
+ */
+
+#ifndef __VNCFUNC_H__
+# define __VNCFUNC_H__
+
+int vnc_get_bitmap(char *server,
+                   char *port,
+                   char *fn);
+
+int vnc_get_dimensions(char *server,
+                       char *port,
+                       int *width,
+                       int *height);
+
+int vnc_refresh_screen(char *server,
+                       char *port,
+                       int scancode);
+
+int vnc_send_keys(char *server,
+                  char *port,
+                  char *keys);
+
+int vnc_send_pointer_event(char *server,
+                           char *port,
+                           int pos_x,
+                           int pos_y,
+                           int clicked,
+                           int release);
+
+#endif /* __VNCFUNC_H__ */
-- 
2.8.4




More information about the libvir-list mailing list