Unverified Commit 3039a34c authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/decouple-xserver' into 3.6.x

parents 168c063d 736a2333
......@@ -61,9 +61,8 @@ SOFTWARE.
#include "cursorstr.h"
#include "dixstruct.h"
#include "site.h"
#define XKB_IN_SERVER
#ifdef XKB
#include <nx-X11/extensions/XKBsrv.h>
#include "xkbsrv.h"
#endif
#ifdef XCSECURITY
#define _SECURITY_SERVER
......
......@@ -109,9 +109,8 @@ int ProcInitialConnection();
#include <nx-X11/extensions/security.h>
#endif
#ifdef XKB
#define XKB_IN_SERVER
#include "inputstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include "xkbsrv.h"
#endif
#define mskcnt ((MAXCLIENTS + 31) / 32)
......
......@@ -129,7 +129,7 @@ of the copyright holder.
#include "globals.h"
#ifdef XKB
#include <nx-X11/extensions/XKBsrv.h>
#include "xkbsrv.h"
extern Bool XkbFilterEvents(ClientPtr, int, xEvent *);
#endif
......
......@@ -73,12 +73,14 @@ is" without express or implied warranty.
#include <nx-X11/extensions/XKB.h>
#define XKBSRV_NEED_FILE_FUNCS
/*
we need the client side header here, xkbsrv.h will not work because
server and libX11 have different struct sizes on
64bit. Interestingly upstream xnest does not take care of this.
*/
#include <nx-X11/extensions/XKBsrv.h>
#include <nx-X11/extensions/XKBconfig.h>
#include <nx-X11/extensions/XKBrules.h>
#include "Xatom.h"
#include <errno.h>
......
#ifndef _XKBRULES_H_
#define _XKBRULES_H_ 1
/************************************************************
Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/***====================================================================***/
typedef struct _XkbRF_VarDefs {
char * model;
char * layout;
char * variant;
char * options;
unsigned short sz_extra;
unsigned short num_extra;
char * extra_names;
char ** extra_values;
} XkbRF_VarDefsRec,*XkbRF_VarDefsPtr;
typedef struct _XkbRF_VarDesc {
char * name;
char * desc;
} XkbRF_VarDescRec, *XkbRF_VarDescPtr;
typedef struct _XkbRF_DescribeVars {
int sz_desc;
int num_desc;
XkbRF_VarDescPtr desc;
} XkbRF_DescribeVarsRec,*XkbRF_DescribeVarsPtr;
typedef struct _XkbRF_Rule {
int number;
int layout_num;
int variant_num;
char * model;
char * layout;
char * variant;
char * option;
/* yields */
char * keycodes;
char * symbols;
char * types;
char * compat;
char * geometry;
char * keymap;
unsigned flags;
} XkbRF_RuleRec,*XkbRF_RulePtr;
typedef struct _XkbRF_Group {
int number;
char * name;
char * words;
} XkbRF_GroupRec, *XkbRF_GroupPtr;
#define XkbRF_PendingMatch (1L<<1)
#define XkbRF_Option (1L<<2)
#define XkbRF_Append (1L<<3)
#define XkbRF_Normal (1L<<4)
#define XkbRF_Invalid (1L<<5)
typedef struct _XkbRF_Rules {
XkbRF_DescribeVarsRec models;
XkbRF_DescribeVarsRec layouts;
XkbRF_DescribeVarsRec variants;
XkbRF_DescribeVarsRec options;
unsigned short sz_extra;
unsigned short num_extra;
char ** extra_names;
XkbRF_DescribeVarsPtr extra;
unsigned short sz_rules;
unsigned short num_rules;
XkbRF_RulePtr rules;
unsigned short sz_groups;
unsigned short num_groups;
XkbRF_GroupPtr groups;
} XkbRF_RulesRec, *XkbRF_RulesPtr;
/***====================================================================***/
_XFUNCPROTOBEGIN
extern Bool XkbRF_GetComponents(
XkbRF_RulesPtr /* rules */,
XkbRF_VarDefsPtr /* var_defs */,
XkbComponentNamesPtr /* names */
);
extern XkbRF_RulePtr XkbRF_AddRule(
XkbRF_RulesPtr /* rules */
);
extern XkbRF_GroupPtr XkbRF_AddGroup(XkbRF_RulesPtr rules);
extern Bool XkbRF_LoadRules(
FILE * /* file */,
XkbRF_RulesPtr /* rules */
);
extern Bool XkbRF_LoadRulesByName(
char * /* base */,
char * /* locale */,
XkbRF_RulesPtr /* rules */
);
/***====================================================================***/
extern XkbRF_VarDescPtr XkbRF_AddVarDesc(
XkbRF_DescribeVarsPtr /* vars */
);
extern XkbRF_VarDescPtr XkbRF_AddVarDescCopy(
XkbRF_DescribeVarsPtr /* vars */,
XkbRF_VarDescPtr /* copy_from */
);
extern XkbRF_DescribeVarsPtr XkbRF_AddVarToDescribe(
XkbRF_RulesPtr /* rules */,
char * /* name */
);
extern Bool XkbRF_LoadDescriptions(
FILE * /* file */,
XkbRF_RulesPtr /* rules */
);
extern Bool XkbRF_LoadDescriptionsByName(
char * /* base */,
char * /* locale */,
XkbRF_RulesPtr /* rules */
);
extern XkbRF_RulesPtr XkbRF_Load(
char * /* base */,
char * /* locale */,
Bool /* wantDesc */,
Bool /* wantRules */
);
extern XkbRF_RulesPtr XkbRF_Create(
int /* sz_rules */,
int /* sz_extra */
);
/***====================================================================***/
extern void XkbRF_Free(
XkbRF_RulesPtr /* rules */,
Bool /* freeRules */
);
/***====================================================================***/
#define _XKB_RF_NAMES_PROP_ATOM "_XKB_RULES_NAMES"
#define _XKB_RF_NAMES_PROP_MAXLEN 1024
_XFUNCPROTOEND
#endif /* _XKBRULES_H_ */
......@@ -114,12 +114,12 @@ BOOTSTRAPCFLAGS =
SRCS = WaitFor.c access.c connection.c io.c $(COLOR_SRCS) \
osinit.c utils.c log.c auth.c mitauth.c secauth.c \
$(XDMAUTHSRCS) $(RPCSRCS) xdmcp.c OtherSources \
transport.c $(SNPRINTF_SRCS) $(STRLCAT_SRCS) \
xstrans.c $(SNPRINTF_SRCS) $(STRLCAT_SRCS) \
xprintf.c
OBJS = WaitFor.o access.o connection.o io.o $(COLOR_OBJS) \
osinit.o utils.o log.o auth.o mitauth.o secauth.o \
$(XDMAUTHOBJS) $(RPCOBJS) xdmcp.o OtherObjects \
transport.o $(SNPRINTF_OBJS) $(STRLCAT_OBJS) \
xstrans.o $(SNPRINTF_OBJS) $(STRLCAT_OBJS) \
xprintf.o
#if UseMemLeak
......@@ -135,7 +135,7 @@ BOOTSTRAPCFLAGS =
#if HasPam && HasPamMisc
PAM_DEFINES = -DUSE_PAM
#endif
DEFINES = -DXSERV_t -DTRANS_SERVER $(CONNECTION_FLAGS) $(MEM_DEFINES) \
DEFINES = $(CONNECTION_FLAGS) $(MEM_DEFINES) \
$(XDMAUTHDEFS) $(RPCDEFS) $(SIGNAL_DEFINES) $(OS_DEFINES) \
$(RGB_DEFINES) $(GETPEER_DEFINES) \
$(RANDOM_DEFINES) $(BUGMSG) $(XTRANS_FAILDEFINES) $(NX_DEFINES)
......@@ -172,8 +172,6 @@ SpecialCObjectRule(auth,$(ICONFIGFILES),$(XDMCP_DEFINES))
SpecialCObjectRule(xdmauth,$(ICONFIGFILES),$(XDMCP_DEFINES))
SpecialCObjectRule(xdmcp,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES))
SpecialCObjectRule(connection,$(ICONFIGFILES),$(SOCK_DEFINES) $(XDMCP_DEFINES))
SpecialCObjectRule(transport,$(ICONFIGFILES),$(TRANS_INCLUDES) $(CONN_DEFINES) $(SOCK_DEFINES))
LinkSourceFile(transport.c,$(TRANSCOMMSRC))
SpecialCObjectRule(osinit,$(ICONFIGFILES),$(ADM_DEFINES))
SpecialCObjectRule(WaitFor,$(ICONFIGFILES),$(EXT_DEFINES))
SpecialCObjectRule(io,$(ICONFIGFILES),$(EXT_DEFINES))
......
......@@ -64,6 +64,9 @@ SOFTWARE.
#include <stdio.h>
#include <stdlib.h>
#define XSERV_t
#define TRANS_SERVER
#define TRANS_REOPEN
#include <nx-X11/Xtrans/Xtrans.h>
#include <nx-X11/Xauth.h>
#include <nx-X11/X.h>
......@@ -1168,7 +1171,7 @@ ResetHosts (char *display)
struct dn_naddr dnaddr, *dnaddrp, *dnet_addr();
#endif
int family = 0;
void *addr;
void *addr = NULL;
int len;
siTypesInitialize();
......@@ -1306,8 +1309,8 @@ ResetHosts (char *display)
for (a = addresses ; a != NULL ; a = a->ai_next) {
len = a->ai_addrlen;
f = ConvertAddr(a->ai_addr,&len,(void **)&addr);
if ( (family == f) ||
((family == FamilyWild) && (f != -1)) ) {
if (addr && ((family == f) ||
((family == FamilyWild) && (f != -1)))) {
NewHost(f, addr, len, FALSE);
}
}
......@@ -1696,7 +1699,7 @@ GetHosts (
for (host = validhosts; host; host = host->next)
{
len = host->len;
if ((ptr + sizeof(xHostEntry) + len) > (data + n))
if ((ptr + sizeof(xHostEntry) + len) > ((unsigned char *) *data + n))
break;
((xHostEntry *)ptr)->family = host->family;
((xHostEntry *)ptr)->length = len;
......@@ -1775,7 +1778,7 @@ InvalidHost (
ClientPtr client)
{
int family;
void *addr;
void *addr = NULL;
register HOST *selfhost, *host;
if (!AccessEnabled) /* just let them in */
......@@ -1810,7 +1813,7 @@ InvalidHost (
return (0);
}
} else {
if (addrEqual (family, addr, len, host))
if (addr && addrEqual (family, addr, len, host))
return (0);
}
......@@ -2082,7 +2085,7 @@ siHostnameAddrMatch(int family, void * addr, int len,
struct addrinfo *addresses;
struct addrinfo *a;
int f, hostaddrlen;
void * hostaddr;
void * hostaddr = NULL;
if (siAddrLen >= sizeof(hostname))
return FALSE;
......@@ -2094,7 +2097,7 @@ siHostnameAddrMatch(int family, void * addr, int len,
for (a = addresses ; a != NULL ; a = a->ai_next) {
hostaddrlen = a->ai_addrlen;
f = ConvertAddr(a->ai_addr,&hostaddrlen,&hostaddr);
if ((f == family) && (len == hostaddrlen) &&
if ((f == family) && (len == hostaddrlen) && hostaddr &&
(acmp (addr, hostaddr, len) == 0) ) {
res = TRUE;
break;
......
......@@ -70,15 +70,9 @@ SOFTWARE.
#endif
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#ifndef XSERV_t
# define XSERV_t
#endif
#ifndef TRANS_SERVER
# define TRANS_SERVER
#endif
#ifndef TRANS_REOPEN
# define TRANS_REOPEN
#endif
#define XSERV_t
#define TRANS_SERVER
#define TRANS_REOPEN
#include <nx-X11/Xtrans/Xtrans.h>
#include <errno.h>
#include <signal.h>
......
......@@ -64,6 +64,9 @@ SOFTWARE.
#include <nx-X11/Xwinsock.h>
#endif
#include <stdio.h>
#define XSERV_t
#define TRANS_SERVER
#define TRANS_REOPEN
#include <nx-X11/Xtrans/Xtrans.h>
#include <nx-X11/Xmd.h>
#include <errno.h>
......
......@@ -90,6 +90,9 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <stdio.h>
#include "misc.h"
#include <nx-X11/X.h>
#define XSERV_t
#define TRANS_SERVER
#define TRANS_REOPEN
#include <nx-X11/Xtrans/Xtrans.h>
#include "input.h"
#include "dixfont.h"
......@@ -141,7 +144,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#endif
#ifdef XKB
#include <nx-X11/extensions/XKBsrv.h>
#include "xkbsrv.h"
#endif
#ifdef XCSECURITY
#define _SECURITY_SERVER
......
......@@ -39,6 +39,9 @@ from The Open Group.
#include <stdio.h>
#include <nx-X11/X.h>
#define XSERV_t
#define TRANS_SERVER
#define TRANS_REOPEN
#include <nx-X11/Xtrans/Xtrans.h>
#include "os.h"
#include "osdep.h"
......@@ -66,8 +69,8 @@ XdmAuthenticationValidator (ARRAY8Ptr privateData, ARRAY8Ptr incomingData,
{
XdmAuthKeyPtr incoming;
XdmcpUnwrap (incomingData->data, &privateKey,
incomingData->data,incomingData->length);
XdmcpUnwrap (incomingData->data, (unsigned char *)&privateKey,
incomingData->data,incomingData->length);
if (packet_type == ACCEPT) {
if (incomingData->length != 8)
return FALSE;
......@@ -86,7 +89,8 @@ XdmAuthenticationGenerator (ARRAY8Ptr privateData, ARRAY8Ptr outgoingData,
outgoingData->data = 0;
if (packet_type == REQUEST) {
if (XdmcpAllocARRAY8 (outgoingData, 8))
XdmcpWrap (&rho, &privateKey, outgoingData->data, 8);
XdmcpWrap ((unsigned char *)&rho, (unsigned char *)&privateKey,
outgoingData->data, 8);
}
return TRUE;
}
......@@ -96,7 +100,8 @@ XdmAuthenticationAddAuth (int name_len, char *name,
int data_len, char *data)
{
Bool ret;
XdmcpUnwrap (data, (unsigned char *)&privateKey, data, data_len);
XdmcpUnwrap ((unsigned char *)data, (unsigned char *)&privateKey,
(unsigned char *)data, data_len);
authFromXDMCP = TRUE;
ret = AddAuthorization (name_len, name, data_len, data);
authFromXDMCP = FALSE;
......@@ -149,11 +154,11 @@ XdmAuthenticationInit (char *cookie, int cookie_len)
}
XdmcpGenerateKey (&rho);
XdmcpRegisterAuthentication (XdmAuthenticationName, XdmAuthenticationNameLen,
(unsigned char *)&rho,
(char *)&rho,
sizeof (rho),
XdmAuthenticationValidator,
XdmAuthenticationGenerator,
XdmAuthenticationAddAuth);
(ValidatorFunc)XdmAuthenticationValidator,
(GeneratorFunc)XdmAuthenticationGenerator,
(AddAuthorFunc)XdmAuthenticationAddAuth);
}
#endif /* XDMCP */
......@@ -384,7 +389,7 @@ XdmCheckCookie (unsigned short cookie_length, char *cookie,
if (!plain)
return (XID) -1;
for (auth = xdmAuth; auth; auth=auth->next) {
XdmcpUnwrap (cookie, (unsigned char *)&auth->key, plain, cookie_length);
XdmcpUnwrap ((unsigned char *)cookie, (unsigned char *)&auth->key, plain, cookie_length);
if ((client = XdmAuthorizationValidate (plain, cookie_length, &auth->rho, xclient, reason)) != NULL)
{
client->next = xdmClients;
......@@ -429,7 +434,7 @@ XdmToID (unsigned short cookie_length, char *cookie)
if (!plain)
return (XID) -1;
for (auth = xdmAuth; auth; auth=auth->next) {
XdmcpUnwrap (cookie, (unsigned char *)&auth->key, plain, cookie_length);
XdmcpUnwrap ((unsigned char *)cookie, (unsigned char *)&auth->key, plain, cookie_length);
if ((client = XdmAuthorizationValidate (plain, cookie_length, &auth->rho, NULL, NULL)) != NULL)
{
free (client);
......
......@@ -19,6 +19,10 @@
#ifdef WIN32
#include <nx-X11/Xwinsock.h>
#define XSERV_t
#define TRANS_SERVER
#define TRANS_REOPEN
#include <nx-X11/Xtrans/Xtrans.h>
#endif
#include <nx-X11/Xos.h>
......
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <nx-X11/Xfuncproto.h>
/* ErrorF is used by xtrans */
#ifndef HAVE_DIX_CONFIG_H
extern _X_EXPORT void
ErrorF(const char *f, ...)
_X_ATTRIBUTE_PRINTF(1, 2);
#endif
#define TRANS_REOPEN
#define TRANS_SERVER
#define XSERV_t
#include <nx-X11/Xtrans/transport.c>
......@@ -55,7 +55,7 @@ XF86INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC)
`pkg-config --cflags-only-I pixman-1`
LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln
DEFINES = -DXKB_IN_SERVER $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES)
DEFINES = $(EXTRA_ALLOC_DEFINES) $(XKB_DDXDEFS) $(NX_DEFINES)
XKB_DEFINES = -DXKB_BASE_DIRECTORY=\"$(LIBDIR)/xkb\" $(XKB_DISABLE)
NormalLibraryObjectRule()
......@@ -72,12 +72,6 @@ AllTarget($(XF86_OBJS))
SpecialCObjectRule(xkbInit,$(ICONFIGFILES),$(XKB_DEFINES))
XCOMM avoid clash between XKBMisc.c and xkbmisc.c on NT
LinkSourceFile(XKBMisc.c,$(XLIBSRC))
LinkSourceFile(XKBMAlloc.c,$(XLIBSRC))
LinkSourceFile(XKBAlloc.c,$(XLIBSRC))
LinkSourceFile(XKBGAlloc.c,$(XLIBSRC))
LinkSourceFile(modinit.h,../Xext/extmod)
#if BuildLibraries
......
......@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#if (defined(__osf__) && defined(__alpha))
......
......@@ -36,8 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "scrnintstr.h"
#include "windowstr.h"
#include "os.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XKBconfig.h>
Bool
......
......@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
void
......
......@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
......
......@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
void
......
......@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#ifdef PANORAMIX
......
......@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
int
......
......@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
void
......
......@@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#ifdef XF86DDXACTIONS
......
......@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
void
......
......@@ -38,8 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#ifndef PATH_MAX
......
......@@ -49,8 +49,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#include "xkb.h"
......
......@@ -10,8 +10,7 @@
#include <stdio.h>
#include <nx-X11/X.h>
#include "windowstr.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#ifdef XF86DDXACTIONS
#include "xf86.h"
......
......@@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include "scrnintstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#ifdef XF86DDXACTIONS
......
......@@ -38,21 +38,6 @@
#define XOS_USE_NO_LOCKING
#include <nx-X11/Xos_r.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xproto.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/Xos.h>
#include <nx-X11/Xfuncs.h>
#include <nx-X11/Xatom.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
#include "XKBrules.h"
#else
#include <nx-X11/Xproto.h>
#include <nx-X11/X.h>
......@@ -63,11 +48,9 @@
#include "misc.h"
#include "inputstr.h"
#include "dix.h"
#include <nx-X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include "xkbstr.h"
#include <xkbsrv.h>
#endif
#ifdef DEBUG
#define PR_DEBUG(s) fprintf(stderr,s)
......@@ -1349,131 +1332,3 @@ XkbRF_GroupPtr group;
return;
}
#ifndef XKB_IN_SERVER
Bool
XkbRF_GetNamesProp(Display *dpy,char **rf_rtrn,XkbRF_VarDefsPtr vd_rtrn)
{
Atom rules_atom,actual_type;
int fmt;
unsigned long nitems,bytes_after;
char *data,*out;
Status rtrn;
rules_atom= XInternAtom(dpy,_XKB_RF_NAMES_PROP_ATOM,True);
if (rules_atom==None) /* property cannot exist */
return False;
rtrn= XGetWindowProperty(dpy,DefaultRootWindow(dpy),rules_atom,
0L,_XKB_RF_NAMES_PROP_MAXLEN,False,
XA_STRING,&actual_type,
&fmt,&nitems,&bytes_after,
(unsigned char **)&data);
if (rtrn!=Success)
return False;
if (rf_rtrn)
*rf_rtrn= NULL;
(void)bzero((char *)vd_rtrn,sizeof(XkbRF_VarDefsRec));
if ((bytes_after>0)||(actual_type!=XA_STRING)||(fmt!=8)) {
if (data) XFree(data);
return (fmt==0?True:False);
}
out= data;
if (out && (*out) && rf_rtrn)
*rf_rtrn= _XkbDupString(out);
out+=strlen(out)+1;
if ((out-data)<nitems) {
if (*out)
vd_rtrn->model= _XkbDupString(out);
out+=strlen(out)+1;
}
if ((out-data)<nitems) {
if (*out)
vd_rtrn->layout= _XkbDupString(out);
out+=strlen(out)+1;
}
if ((out-data)<nitems) {
if (*out)
vd_rtrn->variant= _XkbDupString(out);
out+=strlen(out)+1;
}
if ((out-data)<nitems) {
if (*out)
vd_rtrn->options= _XkbDupString(out);
out+=strlen(out)+1;
}
XFree(data);
return True;
}
Bool
XkbRF_SetNamesProp(Display *dpy,char *rules_file,XkbRF_VarDefsPtr var_defs)
{
int len,out;
Atom name;
char * pval;
len= (rules_file?strlen(rules_file):0);
len+= (var_defs->model?strlen(var_defs->model):0);
len+= (var_defs->layout?strlen(var_defs->layout):0);
len+= (var_defs->variant?strlen(var_defs->variant):0);
len+= (var_defs->options?strlen(var_defs->options):0);
if (len<1)
return True;
len+= 5; /* trailing NULs */
name= XInternAtom(dpy,_XKB_RF_NAMES_PROP_ATOM,False);
if (name==None) { /* should never happen */
_XkbLibError(_XkbErrXReqFailure,"XkbRF_SetNamesProp",X_InternAtom);
return False;
}
pval= (char *)_XkbAlloc(len);
if (!pval) {
_XkbLibError(_XkbErrBadAlloc,"XkbRF_SetNamesProp",len);
return False;
}
out= 0;
if (rules_file) {
strcpy(&pval[out],rules_file);
out+= strlen(rules_file);
}
pval[out++]= '\0';
if (var_defs->model) {
strcpy(&pval[out],var_defs->model);
out+= strlen(var_defs->model);
}
pval[out++]= '\0';
if (var_defs->layout) {
strcpy(&pval[out],var_defs->layout);
out+= strlen(var_defs->layout);
}
pval[out++]= '\0';
if (var_defs->variant) {
strcpy(&pval[out],var_defs->variant);
out+= strlen(var_defs->variant);
}
pval[out++]= '\0';
if (var_defs->options) {
strcpy(&pval[out],var_defs->options);
out+= strlen(var_defs->options);
}
pval[out++]= '\0';
if (out!=len) {
_XkbLibError(_XkbErrBadLength,"XkbRF_SetNamesProp",out);
_XkbFree(pval);
return False;
}
XChangeProperty(dpy,DefaultRootWindow(dpy),name,XA_STRING,8,PropModeReplace,
(unsigned char *)pval,len);
_XkbFree(pval);
return True;
}
#endif
......@@ -33,8 +33,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/Xproto.h>
#include "misc.h"
#include "inputstr.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include "extnsionst.h"
#include "xkb.h"
#include "protocol-versions.h"
......@@ -3880,7 +3879,7 @@ ProcXkbSetNames(ClientPtr client)
/***====================================================================***/
#include <nx-X11/extensions/XKBgeom.h>
#include "xkbgeom.h"
#define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4)
......
/* $XFree86$ */
/* #include "XKBfile.h" */
extern int ProcXkbUseExtension(ClientPtr client);
extern int ProcXkbSelectEvents(ClientPtr client);
extern int ProcXkbBell(ClientPtr client);
......
......@@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/Xproto.h>
#include <nx-X11/keysym.h>
#include "inputstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#if !defined(WIN32) && !defined(Lynx)
#include <sys/time.h>
#endif
......
......@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/keysym.h>
#include "misc.h"
#include "inputstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include "xkb.h"
#include <ctype.h>
......
......@@ -7,13 +7,8 @@
#ifndef DEFAULT_H
#define DEFAULT_H 1
#ifndef XKB_IN_SERVER
#define GET_ATOM(d,s) XInternAtom(d,s,0)
#define DPYTYPE Display *
#else
#define GET_ATOM(d,s) MakeAtom(s,strlen(s),1)
#define DPYTYPE char *
#endif
#define NUM_KEYS 1
#define vmod_NumLock 0
......
......@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/extensions/XI.h>
#include "inputstr.h"
#include "windowstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include "xkb.h"
/***====================================================================***/
......
......@@ -46,11 +46,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "opaque.h"
#include "property.h"
#include "scrnintstr.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <nx-X11/extensions/XKBgeom.h>
#include <xkbsrv.h>
#include "xkbgeom.h"
#include <nx-X11/extensions/XKMformat.h>
#include <nx-X11/extensions/XKBfile.h>
#include "xkbfile.h"
#include "xkb.h"
#define CREATE_ATOM(s) MakeAtom(s,sizeof(s)-1,1)
......
......@@ -37,7 +37,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "inputstr.h"
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include "xkb.h"
/***====================================================================***/
......
......@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/keysym.h>
#include "misc.h"
#include "inputstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <ctype.h>
......
......@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/keysym.h>
#include "misc.h"
#include "inputstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
#include <nx-X11/extensions/XIproto.h>
......
......@@ -33,8 +33,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/Xproto.h>
#include "misc.h"
#include "inputstr.h"
#include <nx-X11/extensions/XKBsrv.h>
#include <nx-X11/extensions/XKBstr.h>
#include <xkbsrv.h>
#include "xkbstr.h"
#include "extnsionst.h"
#include "xkb.h"
......
......@@ -38,9 +38,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "misc.h"
#include "inputstr.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <nx-X11/extensions/XKBgeom.h>
#include <xkbsrv.h>
#include "xkbgeom.h"
#include "xkb.h"
#ifdef MODE_SWITCH
......
......@@ -38,15 +38,6 @@
#include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xos.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h>
#include <nx-X11/keysym.h>
......@@ -54,9 +45,7 @@
#include "misc.h"
#include "inputstr.h"
#include "dix.h"
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#endif
#include <xkbsrv.h>
#include <nx-X11/extensions/XKBconfig.h>
......@@ -1339,14 +1328,8 @@ char * msg;
default:
msg= "unknown error on line %d"; break;
}
#ifndef XKB_IN_SERVER
fprintf(file,msg,line);
if (name) fprintf(file," of %s\n",name);
else fprintf(file,"\n");
#else
ErrorF(msg,line);
if (name) ErrorF(" of %s\n",name);
else ErrorF("\n");
#endif
return;
}
......@@ -37,16 +37,6 @@
#include <nx-X11/Xos.h>
#include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xlib.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h>
#include <nx-X11/keysym.h>
......@@ -54,13 +44,11 @@
#include "misc.h"
#include "inputstr.h"
#include "dix.h"
#include <nx-X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS 1
#include <nx-X11/extensions/XKBsrv.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "xkbstr.h"
#include <xkbsrv.h>
#include "xkbgeom.h"
#include "xkb.h"
#endif
unsigned
_XkbKSCheckCase(KeySym ks)
......
......@@ -35,16 +35,6 @@
#include <stdlib.h>
#include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xlib.h>
#include <nx-X11/XKBlib.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h>
#include <nx-X11/keysym.h>
......@@ -52,14 +42,12 @@
#include "misc.h"
#include "inputstr.h"
#include "dix.h"
#include <nx-X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS 1
#include <nx-X11/extensions/XKBsrv.h>
#include "xkbstr.h"
#include <xkbsrv.h>
#include <nx-X11/extensions/XKBgeom.h>
#include <nx-X11/extensions/XKBfile.h>
#include "xkbgeom.h"
#include "xkbfile.h"
#endif
#define VMOD_HIDE_VALUE 0
#define VMOD_SHOW_VALUE 1
......
......@@ -36,28 +36,16 @@
#include <nx-X11/Xos.h>
#ifndef XKB_IN_SERVER
#include <nx-X11/Xlib.h>
#include <nx-X11/XKBlib.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include "misc.h"
#include "inputstr.h"
#include "dix.h"
#include <nx-X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS 1
#include <nx-X11/extensions/XKBsrv.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "xkbstr.h"
#include <xkbsrv.h>
#include "xkbgeom.h"
#endif
/***====================================================================***/
......@@ -348,22 +336,10 @@ XkbKeysymText(KeySym sym,unsigned format)
{
static char buf[32],*rtrn;
#ifndef XKB_IN_SERVER
if (sym==NoSymbol)
strcpy(rtrn=buf,"NoSymbol");
else if ((rtrn=XKeysymToString(sym))==NULL)
sprintf(rtrn=buf, "0x%lx", (long)sym);
else if (format==XkbCFile) {
sprintf(buf,"XK_%s",rtrn);
rtrn= buf;
}
return rtrn;
#else /* def XKB_IN_SERVER */
if (sym==NoSymbol)
strcpy(rtrn=buf,"NoSymbol");
else sprintf(rtrn=buf, "0x%lx", (long)sym);
return rtrn;
#endif /* XKB_IN_SERVER */
}
char *
......@@ -1348,90 +1324,3 @@ register int i;
return buf;
}
#ifndef XKB_IN_SERVER
/***====================================================================***/
#define PIXEL_MAX 65535
Bool
XkbLookupCanonicalRGBColor(char *def,XColor *color)
{
int tmp;
if (_XkbStrCaseEqual(def,"black")) {
color->red= color->green= color->blue= 0;
return True;
}
else if (_XkbStrCaseEqual(def,"white")) {
color->red= color->green= color->blue= PIXEL_MAX;
return True;
}
else if ((sscanf(def,"grey%d",&tmp)==1)||
(sscanf(def,"gray%d",&tmp)==1)||
(sscanf(def,"Grey%d",&tmp)==1)||
(sscanf(def,"Gray%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->red= color->green= color->blue= tmp;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"red")*100))||
(sscanf(def,"red%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->red= tmp;
color->green= color->blue= 0;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"green")*100))||
(sscanf(def,"green%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->green= tmp;
color->red= color->blue= 0;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"blue")*100))||
(sscanf(def,"blue%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->blue= tmp;
color->red= color->green= 0;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"magenta")*100))||
(sscanf(def,"magenta%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->green= 0;
color->red= color->blue= tmp;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"cyan")*100))||
(sscanf(def,"cyan%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->red= 0;
color->green= color->blue= tmp;
return True;
}
}
else if ((tmp=(_XkbStrCaseEqual(def,"yellow")*100))||
(sscanf(def,"yellow%d",&tmp)==1)) {
if ((tmp>0)&&(tmp<=100)) {
tmp= (PIXEL_MAX*tmp)/100;
color->blue= 0;
color->red= color->green= tmp;
return True;
}
}
return False;
}
#endif
......@@ -35,29 +35,15 @@
#include <nx-X11/Xos.h>
#include <nx-X11/Xfuncs.h>
#ifndef XKB_IN_SERVER
#include <stdlib.h>
#include <nx-X11/Xlib.h>
#include <nx-X11/keysym.h>
#include <nx-X11/XKBlib.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "XKMformat.h"
#include "XKBfileInt.h"
#else
#include <nx-X11/X.h>
#include <nx-X11/Xproto.h>
#include <nx-X11/keysym.h>
#include "misc.h"
#include "inputstr.h"
#include <nx-X11/extensions/XKBstr.h>
#define XKBSRV_NEED_FILE_FUNCS
#include <nx-X11/extensions/XKBsrv.h>
#include <nx-X11/extensions/XKBgeom.h>
#include "xkbstr.h"
#include "xkbsrv.h"
#include "xkbgeom.h"
Atom
XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
......@@ -67,7 +53,6 @@ XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
return MakeAtom(str,strlen(str),!only_if_exists);
}
#endif
#ifndef SEEK_SET
#define SEEK_SET 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment