aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/common/inet.c88
-rw-r--r--apps/common/makefile3
-rw-r--r--apps/xauth/config.h94
-rw-r--r--apps/xauth/makefile22
-rw-r--r--apps/xcalc/makefile24
-rw-r--r--apps/xcalc/xcalc.c2
-rw-r--r--apps/xclock/Clock.c5
-rw-r--r--apps/xclock/makefile31
-rw-r--r--apps/xhost/config.h97
-rw-r--r--apps/xhost/makefile18
-rw-r--r--apps/xhost/xhost.c23
-rw-r--r--apps/xrdb/makefile12
-rw-r--r--apps/xrdb/xrdb.c1
-rw-r--r--apps/xwininfo/config.h109
-rw-r--r--apps/xwininfo/dsimple.c1
-rw-r--r--apps/xwininfo/dsimple.h5
-rw-r--r--apps/xwininfo/makefile19
-rw-r--r--apps/xwininfo/xwininfo.c11
18 files changed, 553 insertions, 12 deletions
diff --git a/apps/common/inet.c b/apps/common/inet.c
new file mode 100644
index 000000000..e6c0a1554
--- /dev/null
+++ b/apps/common/inet.c
@@ -0,0 +1,88 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifdef WIN32
+#include <X11/Xwinsock.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#if NTDDI_VERSION < NTDDI_VISTA
+const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt)
+{
+ if (af == AF_INET)
+ {
+ struct sockaddr_in in;
+ memset(&in, 0, sizeof(in));
+ in.sin_family = AF_INET;
+ memcpy(&in.sin_addr, src, sizeof(struct in_addr));
+ if (getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in), dst, cnt, NULL, 0, NI_NUMERICHOST) != 0)
+ {
+ errno = WSAGetLastError();
+ return NULL;
+ }
+ else return dst;
+ }
+ else if (af == AF_INET6)
+ {
+ struct sockaddr_in6 in;
+ memset(&in, 0, sizeof(in));
+ in.sin6_family = AF_INET6;
+ memcpy(&in.sin6_addr, src, sizeof(struct in_addr6));
+ if (getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6), dst, cnt, NULL, 0, NI_NUMERICHOST) != 0)
+ {
+ errno = WSAGetLastError();
+ return NULL;
+ }
+ else return dst;
+ }
+ errno = WSAEAFNOSUPPORT;
+ return NULL;
+}
+
+int inet_pton(int af, const char *src, void *dst)
+{
+ struct sockaddr_storage ss;
+ int sslen = sizeof(ss);
+ if (af == AF_INET)
+ {
+ struct in_addr out;
+ char buffer[INET_ADDRSTRLEN + 1];
+ strncpy (buffer, src, INET_ADDRSTRLEN);
+ buffer [INET_ADDRSTRLEN] = '\0';
+ if (WSAStringToAddressA(buffer, AF_INET, NULL, (struct sockaddr*)&ss, &sslen) == SOCKET_ERROR)
+ {
+ errno = WSAGetLastError();
+ return 0;
+ }
+ else
+ {
+ out = ((struct sockaddr_in *)&ss)->sin_addr;
+ memcpy (dst, &out, sizeof(struct in_addr));
+ return 1;
+ }
+ }
+ else if (af == AF_INET6)
+ {
+ struct in6_addr out6;
+ char buffer6[INET6_ADDRSTRLEN + 1];
+ strncpy (buffer6, src, INET6_ADDRSTRLEN);
+ buffer6 [INET6_ADDRSTRLEN] = '\0';
+ if (WSAStringToAddressA(buffer6, AF_INET6, NULL, (struct sockaddr*)&ss, &sslen) == SOCKET_ERROR)
+ {
+ errno = WSAGetLastError();
+ return 0;
+ }
+ else
+ {
+ out6 = ((struct sockaddr_in6 *)&ss)->sin6_addr;
+ memcpy (dst, &out6, sizeof(struct in6_addr));
+ return 1;
+ }
+ }
+ errno = WSAEAFNOSUPPORT;
+ return -1;
+}
+#endif
diff --git a/apps/common/makefile b/apps/common/makefile
new file mode 100644
index 000000000..e261f52c9
--- /dev/null
+++ b/apps/common/makefile
@@ -0,0 +1,3 @@
+LIBRARY = common
+
+CSRCS = inet.c
diff --git a/apps/xauth/config.h b/apps/xauth/config.h
new file mode 100644
index 000000000..8152de05a
--- /dev/null
+++ b/apps/xauth/config.h
@@ -0,0 +1,94 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */
+#undef BSD44SOCKETS
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
+#undef HAVE_LIBWS2_32
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <net/errno.h> header file. */
+#undef HAVE_NET_ERRNO_H
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#undef HAVE_STRLCPY
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Support IPv6 for TCP connections */
+#define IPv6 1
+
+/* Support os-specific local connections */
+#undef LOCALCONN
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Support TCP socket connections */
+#define TCPCONN 1
+
+/* Support UNIX socket connections */
+#undef UNIXCONN
+
+/* Version number of package */
+#undef VERSION
diff --git a/apps/xauth/makefile b/apps/xauth/makefile
new file mode 100644
index 000000000..d14cf9e35
--- /dev/null
+++ b/apps/xauth/makefile
@@ -0,0 +1,22 @@
+TTYAPP = xauth
+
+INCLUDELIBFILES = \
+ ..\common\$(OBJDIR)\common.lib \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libXau\$(OBJDIR)\libXau.lib \
+ $(MHMAKECONF)\libXmu\src\$(OBJDIR)\libXmu.lib \
+ $(MHMAKECONF)\libXext\src\$(OBJDIR)\libXext.lib \
+ $(MHMAKECONF)\libX11\$(OBJDIR)\libX11.lib
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+LINKLIBS += $(PTHREADLIB)
+
+CSRCS = \
+ gethost.c \
+ parsedpy.c \
+ process.c \
+ xauth.c
+
diff --git a/apps/xcalc/makefile b/apps/xcalc/makefile
new file mode 100644
index 000000000..4d20e4d82
--- /dev/null
+++ b/apps/xcalc/makefile
@@ -0,0 +1,24 @@
+WINAPP = xcalc
+
+DEFINES += XT_NO_SM IEEE
+
+INCLUDELIBFILES = \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libXpm\src\$(OBJDIR)\libXpm.lib \
+ $(MHMAKECONF)\libXau\$(OBJDIR)\libXau.lib \
+ $(MHMAKECONF)\libXaw\src\$(OBJDIR)\libXaw.lib \
+ $(MHMAKECONF)\libXt\src\$(OBJDIR)\libXt.lib \
+ $(MHMAKECONF)\libXext\src\$(OBJDIR)\libXext.lib \
+ $(MHMAKECONF)\libXmu\src\$(OBJDIR)\libXmu.lib \
+ $(MHMAKECONF)\libX11\$(OBJDIR)\libX11.lib
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+LINKLIBS += $(PTHREADLIB)
+
+CSRCS = \
+ actions.c \
+ math.c \
+ xcalc.c
diff --git a/apps/xcalc/xcalc.c b/apps/xcalc/xcalc.c
index bc262b681..68a69ec4e 100644
--- a/apps/xcalc/xcalc.c
+++ b/apps/xcalc/xcalc.c
@@ -117,6 +117,8 @@ main(int argc, char **argv)
XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
+ XawInitializeWidgetSet(); // Needed to have the string to bitmap conversion function initialised
+
toplevel = XtAppInitialize(&xtcontext, "XCalc", Options, XtNumber(Options),
&argc, argv, NULL, NULL, 0);
if (argc != 1) Syntax(argc, argv);
diff --git a/apps/xclock/Clock.c b/apps/xclock/Clock.c
index 8af0045d4..b4272fd61 100644
--- a/apps/xclock/Clock.c
+++ b/apps/xclock/Clock.c
@@ -86,6 +86,7 @@ SOFTWARE.
#include <X11/Xosdefs.h>
#include <stdio.h>
#include <X11/Xos.h>
+#include <X11\Xwinsock.h>
#include <X11/Xaw/XawInit.h>
#if !defined(NO_I18N) && defined(HAVE_ICONV)
#include <iconv.h>
@@ -112,7 +113,7 @@ SOFTWARE.
#include <locale.h>
extern Boolean no_locale; /* if True, use old (unlocalized) behaviour */
#endif
-
+#include <unistd.h>
/* Private Definitions */
@@ -130,8 +131,10 @@ extern Boolean no_locale; /* if True, use old (unlocalized) behaviour */
#define ANALOG_SIZE_DEFAULT 164
+#ifndef max
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
/* #define abs(a) ((a) < 0 ? -(a) : (a)) */
diff --git a/apps/xclock/makefile b/apps/xclock/makefile
new file mode 100644
index 000000000..42231508e
--- /dev/null
+++ b/apps/xclock/makefile
@@ -0,0 +1,31 @@
+WINAPP = xclock
+
+DEFINES += XT_NO_SM XRENDER
+
+INCLUDELIBFILES = \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libxkbfile\src\$(OBJDIR)\libxkbfile.lib \
+ $(MHMAKECONF)\libXpm\src\$(OBJDIR)\libXpm.lib \
+ $(MHMAKECONF)\libXau\$(OBJDIR)\libXau.lib \
+ $(MHMAKECONF)\libXaw\src\$(OBJDIR)\libXaw.lib \
+ $(MHMAKECONF)\libXt\src\$(OBJDIR)\libXt.lib \
+ $(MHMAKECONF)\libXext\src\$(OBJDIR)\libXext.lib \
+ $(MHMAKECONF)\libXmu\src\$(OBJDIR)\libXmu.lib \
+ $(MHMAKECONF)\libX11\$(OBJDIR)\libX11.lib \
+ $(MHMAKECONF)\libXft\src\$(OBJDIR)\libXft.lib \
+ $(MHMAKECONF)\libXrender\src\$(OBJDIR)\libXrender.lib \
+ $(MHMAKECONF)\fontconfig\src\$(OBJDIR)\libfontconfig.lib \
+ $(MHMAKECONF)\libXfont\src\util\$(OBJDIR)\libutil.lib
+
+INCLUDES += $(MHMAKECONF)\libXft\include $(MHMAKECONF)\freetype\include $(MHMAKECONF)\fontconfig
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+LINKLIBS += $(PTHREADLIB) $(FREETYPELIB) $(LIBXMLLIB)
+
+CSRCS = \
+ Clock.c \
+ xclock.c
+
diff --git a/apps/xhost/config.h b/apps/xhost/config.h
new file mode 100644
index 000000000..ffe93f580
--- /dev/null
+++ b/apps/xhost/config.h
@@ -0,0 +1,97 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */
+#undef BSD44SOCKETS
+
+/* Define to 1 if you have the `authdes_create' function. */
+#undef HAVE_AUTHDES_CREATE
+
+/* Define to 1 if you have the `authdes_seccreate' function. */
+#undef HAVE_AUTHDES_SECCREATE
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
+#undef HAVE_LIBWS2_32
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Support IPv6 for TCP connections */
+#define IPv6 1
+
+/* Support os-specific local connections */
+#undef LOCALCONN
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */
+#undef SECURE_RPC
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Support TCP socket connections */
+#define TCPCONN 1
+
+/* Support UNIX socket connections */
+#undef UNIXCONN
+
+/* Version number of package */
+#undef VERSION
diff --git a/apps/xhost/makefile b/apps/xhost/makefile
new file mode 100644
index 000000000..328fe8ccf
--- /dev/null
+++ b/apps/xhost/makefile
@@ -0,0 +1,18 @@
+DEFINES += BAD_ARPAINET
+
+TTYAPP = xhost
+
+INCLUDELIBFILES = \
+ ..\common\$(OBJDIR)\common.lib \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libXau\$(OBJDIR)\libXau.lib \
+ $(MHMAKECONF)\libXmu\src\$(OBJDIR)\libXmu.lib \
+ $(MHMAKECONF)\libX11\$(OBJDIR)\libX11.lib \
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+LINKLIBS += $(PTHREADLIB)
+
+CSRCS = xhost.c
diff --git a/apps/xhost/xhost.c b/apps/xhost/xhost.c
index a67d1361f..44d85a09e 100644
--- a/apps/xhost/xhost.c
+++ b/apps/xhost/xhost.c
@@ -92,6 +92,10 @@ X Window System is a trademark of The Open Group.
#include <arpa/inet.h>
#endif
+#ifdef _MSC_VER
+#define _X_UNUSED
+#endif
+
#ifdef SECURE_RPC
#include <pwd.h>
@@ -130,6 +134,16 @@ static volatile int nameserver_timedout;
static char *ProgramName;
+#ifdef WIN32
+#define alarm(arg)
+
+void sethostent(int x)
+{}
+
+void endhostent()
+{}
+#endif
+
#ifdef NEEDSOCKETS
static int
XFamily(int af)
@@ -842,12 +856,3 @@ local_xerror(Display *dpy, XErrorEvent *rep)
XmuPrintDefaultErrorMessage (dpy, rep, stderr);
return 0;
}
-
-#if defined(__CYGWIN__) || defined(WIN32)
-void sethostent(int x)
-{}
-
-void endhostent()
-{}
-#endif
-
diff --git a/apps/xrdb/makefile b/apps/xrdb/makefile
new file mode 100644
index 000000000..ca16db238
--- /dev/null
+++ b/apps/xrdb/makefile
@@ -0,0 +1,12 @@
+TTYAPP = xrdb
+
+INCLUDELIBFILES = \
+ $(MHMAKECONF)\libXmu\src\$(OBJDIR)\libXmu.lib \
+ $(MHMAKECONF)\libX11\$(OBJDIR)\libX11.lib
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+CSRCS = xrdb.c
+
diff --git a/apps/xrdb/xrdb.c b/apps/xrdb/xrdb.c
index b7c9fa3aa..d086a603c 100644
--- a/apps/xrdb/xrdb.c
+++ b/apps/xrdb/xrdb.c
@@ -53,6 +53,7 @@
#include <errno.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <unistd.h>
#ifdef NEED_SYS_PARAM_H
# include <sys/param.h> /* defines MAXHOSTNAMELEN on BSD & Linux */
diff --git a/apps/xwininfo/config.h b/apps/xwininfo/config.h
new file mode 100644
index 000000000..b77456819
--- /dev/null
+++ b/apps/xwininfo/config.h
@@ -0,0 +1,109 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the iconv() function */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strlcat' function. */
+#undef HAVE_STRLCAT
+
+/* Define to 1 if you have a working strnlen function. */
+#define HAVE_STRNLEN
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Major version of this package */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version of this package */
+#undef PACKAGE_VERSION_MINOR
+
+/* Patch version of this package */
+#undef PACKAGE_VERSION_PATCHLEVEL
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define to 1 to call xcb-icccm library functions instead of local
+ replacements */
+#undef USE_XCB_ICCCM
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
diff --git a/apps/xwininfo/dsimple.c b/apps/xwininfo/dsimple.c
index 6432e1335..d42e56aa3 100644
--- a/apps/xwininfo/dsimple.c
+++ b/apps/xwininfo/dsimple.c
@@ -58,6 +58,7 @@ from The Open Group.
#include <X11/cursorfont.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <stdarg.h>
#include <string.h>
#include "clientwin.h"
diff --git a/apps/xwininfo/dsimple.h b/apps/xwininfo/dsimple.h
index 952960542..d0dd71ae9 100644
--- a/apps/xwininfo/dsimple.h
+++ b/apps/xwininfo/dsimple.h
@@ -39,8 +39,9 @@ from The Open Group.
#include <xcb/xcb.h>
#include <xcb/xproto.h>
-typedef enum { False = 0, True } Bool;
-
+typedef int Bool;
+#define False 0
+#define True 1
/* Global variables used by routines in dsimple.c */
extern const char *program_name; /* Name of this program */
diff --git a/apps/xwininfo/makefile b/apps/xwininfo/makefile
new file mode 100644
index 000000000..cacef1297
--- /dev/null
+++ b/apps/xwininfo/makefile
@@ -0,0 +1,19 @@
+TTYAPP = xwininfo
+
+INCLUDELIBFILES = \
+ $(MHMAKECONF)\libxcb\src\$(OBJDIR)\libxcb.lib \
+ $(MHMAKECONF)\libXau\$(OBJDIR)\libXau.lib \
+ $(MHMAKECONF)\libXext\src\$(OBJDIR)\libXext.lib \
+ $(MHMAKECONF)\libX11\$(OBJDIR)\libX11.lib
+
+LIBDIRS=$(dir $(INCLUDELIBFILES))
+
+load_makefile $(LIBDIRS:%$(OBJDIR)\=%makefile MAKESERVER=0 DEBUG=$(DEBUG);)
+
+LINKLIBS += $(PTHREADLIB)
+
+CSRCS = \
+ clientwin.c \
+ dsimple.c \
+ xwininfo.c
+
diff --git a/apps/xwininfo/xwininfo.c b/apps/xwininfo/xwininfo.c
index 39ae6ea27..59e09aff8 100644
--- a/apps/xwininfo/xwininfo.c
+++ b/apps/xwininfo/xwininfo.c
@@ -74,9 +74,12 @@ of the copyright holder.
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <locale.h>
+#ifndef _MSC_VER
#include <langinfo.h>
+#endif
#ifdef HAVE_ICONV
# include <iconv.h>
#endif
@@ -442,6 +445,7 @@ main (int argc, char **argv)
register int i;
int tree = 0, stats = 0, bits = 0, events = 0, wm = 0, size = 0, shape = 0;
int frame = 0, children = 0;
+ int pauseatend = 0;
int use_root = 0;
xcb_window_t window = 0;
char *display_name = NULL;
@@ -453,7 +457,9 @@ main (int argc, char **argv)
if (!setlocale (LC_ALL, ""))
fprintf (stderr, "%s: can not set locale properly\n", program_name);
+#ifndef _MSC_VER
user_encoding = nl_langinfo (CODESET);
+#endif
if (user_encoding == NULL)
user_encoding = "unknown encoding";
@@ -537,6 +543,10 @@ main (int argc, char **argv)
tree = stats = bits = events = wm = size = shape = 1;
continue;
}
+ if (!strcmp(argv[i], "-pause")) {
+ pauseatend = 1;
+ continue;
+ }
usage ();
}
@@ -676,6 +686,7 @@ main (int argc, char **argv)
if (shape)
Display_Window_Shape (window);
printf ("\n");
+ if (pauseatend) getchar();
wininfo_wipe (w);
xcb_disconnect (dpy);