Commit 687d44b6 authored by Ulrich Sibiller's avatar Ulrich Sibiller

update src files *[ch] to libX11 1.3.4

parent ea24f0b0
...@@ -24,19 +24,21 @@ in this Software without prior written authorization from The Open Group. ...@@ -24,19 +24,21 @@ in this Software without prior written authorization from The Open Group.
*/ */
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XAllocColorCells(dpy, cmap, contig, masks, nplanes, pixels, ncolors) Status XAllocColorCells(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
Bool contig; Bool contig,
unsigned int ncolors; /* CARD16 */ unsigned long *masks, /* LISTofCARD32 */ /* RETURN */
unsigned int nplanes; /* CARD16 */ unsigned int nplanes, /* CARD16 */
unsigned long *masks; /* LISTofCARD32 */ /* RETURN */ unsigned long *pixels, /* LISTofCARD32 */ /* RETURN */
unsigned long *pixels; /* LISTofCARD32 */ /* RETURN */ unsigned int ncolors) /* CARD16 */
{ {
Status status; Status status;
......
...@@ -29,15 +29,18 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,15 +29,18 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XAllocColorPlanes(dpy, cmap, contig, pixels, ncolors, nreds, ngreens, Status XAllocColorPlanes(
nblues, rmask, gmask, bmask) register Display *dpy,
register Display *dpy; Colormap cmap,
Colormap cmap; Bool contig,
Bool contig; unsigned long *pixels, /* LISTofCARD32 */ /* RETURN */
unsigned long *pixels; /* LISTofCARD32 */ /* RETURN */ int ncolors,
int ncolors; int nreds,
int nreds, ngreens, nblues; int ngreens,
unsigned long *rmask, *gmask, *bmask; /* CARD32 */ /* RETURN */ int nblues,
unsigned long *rmask,
unsigned long *gmask,
unsigned long *bmask) /* CARD32 */ /* RETURN */
{ {
xAllocColorPlanesReply rep; xAllocColorPlanesReply rep;
Status status; Status status;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XAllowEvents(dpy, mode, time) XAllowEvents(
register Display *dpy; register Display *dpy,
int mode; int mode,
Time time; Time time)
{ {
register xAllowEventsReq *req; register xAllowEventsReq *req;
......
...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XAutoRepeatOn (dpy) XAutoRepeatOn (register Display *dpy)
register Display *dpy;
{ {
XKeyboardControl values; XKeyboardControl values;
values.auto_repeat_mode = AutoRepeatModeOn; values.auto_repeat_mode = AutoRepeatModeOn;
...@@ -40,8 +39,7 @@ register Display *dpy; ...@@ -40,8 +39,7 @@ register Display *dpy;
} }
int int
XAutoRepeatOff (dpy) XAutoRepeatOff (register Display *dpy)
register Display *dpy;
{ {
XKeyboardControl values; XKeyboardControl values;
values.auto_repeat_mode = AutoRepeatModeOff; values.auto_repeat_mode = AutoRepeatModeOff;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBackground(dpy, w, pixel) XSetWindowBackground(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned long pixel; unsigned long pixel)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -33,10 +33,10 @@ from The Open Group. ...@@ -33,10 +33,10 @@ from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBorderWidth(dpy, w, width) XSetWindowBorderWidth(
Display *dpy; Display *dpy,
Window w; Window w,
unsigned int width; unsigned int width)
{ {
unsigned long lwidth = width; /* must be CARD32 */ unsigned long lwidth = width; /* must be CARD32 */
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XBell(dpy, percent) XBell(
register Display *dpy; register Display *dpy,
int percent; int percent)
{ {
register xBellReq *req; register xBellReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBorder(dpy, w, pixel) XSetWindowBorder(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned long pixel; unsigned long pixel)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -30,25 +30,21 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,25 +30,21 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XEnableAccessControl(dpy) XEnableAccessControl(register Display *dpy)
register Display *dpy;
{ {
return XSetAccessControl(dpy, EnableAccess); return XSetAccessControl(dpy, EnableAccess);
} }
int int
XDisableAccessControl(dpy) XDisableAccessControl(register Display *dpy)
register Display *dpy;
{ {
return XSetAccessControl(dpy, DisableAccess); return XSetAccessControl(dpy, DisableAccess);
} }
int int
XSetAccessControl(dpy, mode) XSetAccessControl(
register Display *dpy; register Display *dpy,
int mode; int mode)
{ {
register xSetAccessControlReq *req; register xSetAccessControlReq *req;
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangeActivePointerGrab(dpy, event_mask, curs, time) XChangeActivePointerGrab(
register Display *dpy; register Display *dpy,
unsigned int event_mask; /* CARD16 */ unsigned int event_mask, /* CARD16 */
Cursor curs; Cursor curs,
Time time; Time time)
{ {
register xChangeActivePointerGrabReq *req; register xChangeActivePointerGrabReq *req;
......
...@@ -30,10 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetCloseDownMode(dpy, mode) XSetCloseDownMode(
register Display *dpy; register Display *dpy,
int mode; int mode)
{ {
register xSetCloseDownModeReq *req; register xSetCloseDownModeReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowColormap(dpy, w, colormap) XSetWindowColormap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Colormap colormap; Colormap colormap)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
#include "Cr.h" #include "Cr.h"
int int
XChangeGC (dpy, gc, valuemask, values) XChangeGC (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long valuemask; unsigned long valuemask,
XGCValues *values; XGCValues *values)
{ {
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangeKeyboardControl(dpy, mask, value_list) XChangeKeyboardControl(
register Display *dpy; register Display *dpy,
unsigned long mask; unsigned long mask,
XKeyboardControl *value_list; XKeyboardControl *value_list)
{ {
unsigned long values[8]; unsigned long values[8];
register unsigned long *value = values; register unsigned long *value = values;
......
...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangePointerControl(dpy, do_acc, do_thresh, acc_numerator, XChangePointerControl(
acc_denominator, threshold) register Display *dpy,
register Display *dpy; Bool do_acc,
Bool do_acc, do_thresh; Bool do_thresh,
int acc_numerator, acc_denominator, threshold; int acc_numerator,
int acc_denominator,
int threshold)
{ {
register xChangePointerControlReq *req; register xChangePointerControlReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangeSaveSet(dpy, win, mode) XChangeSaveSet(
register Display *dpy; register Display *dpy,
Window win; Window win,
int mode; int mode)
{ {
register xChangeSaveSetReq *req; register xChangeSaveSetReq *req;
...@@ -47,17 +47,17 @@ int mode; ...@@ -47,17 +47,17 @@ int mode;
} }
int int
XAddToSaveSet(dpy, win) XAddToSaveSet(
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
return XChangeSaveSet(dpy,win,SetModeInsert); return XChangeSaveSet(dpy,win,SetModeInsert);
} }
int int
XRemoveFromSaveSet (dpy, win) XRemoveFromSaveSet (
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
return XChangeSaveSet(dpy,win,SetModeDelete); return XChangeSaveSet(dpy,win,SetModeDelete);
} }
...@@ -36,11 +36,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -36,11 +36,11 @@ in this Software without prior written authorization from The Open Group.
CWDontPropagate|CWColormap|CWCursor) CWDontPropagate|CWColormap|CWCursor)
int int
XChangeWindowAttributes (dpy, w, valuemask, attributes) XChangeWindowAttributes (
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned long valuemask; unsigned long valuemask,
XSetWindowAttributes *attributes; XSetWindowAttributes *attributes)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XResizeWindow(dpy, w, width, height) XResizeWindow(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned int width, height; unsigned int width,
unsigned int height)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
......
...@@ -41,22 +41,26 @@ extern long const _Xevent_to_mask[]; ...@@ -41,22 +41,26 @@ extern long const _Xevent_to_mask[];
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckMaskEvent (dpy, mask, event) Bool XCheckMaskEvent (
register Display *dpy; register Display *dpy,
long mask; /* Selected event mask. */ long mask, /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
qelt; qelt;
prev = qelt, qelt = qelt->next) { prev = qelt, qelt = qelt->next) {
if ((qelt->event.type < LASTEvent) && if ((qelt->event.type < GenericEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) && (_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) || ((qelt->event.type != MotionNotify) ||
(mask & AllPointers) || (mask & AllPointers) ||
......
...@@ -35,16 +35,20 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,16 +35,20 @@ in this Software without prior written authorization from The Open Group.
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckTypedEvent (dpy, type, event) Bool XCheckTypedEvent (
register Display *dpy; register Display *dpy,
int type; /* Selected event type. */ int type, /* Selected event type. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
......
...@@ -35,17 +35,21 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,17 +35,21 @@ in this Software without prior written authorization from The Open Group.
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckTypedWindowEvent (dpy, w, type, event) Bool XCheckTypedWindowEvent (
register Display *dpy; register Display *dpy,
Window w; /* Selected window. */ Window w, /* Selected window. */
int type; /* Selected event type. */ int type, /* Selected event type. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
......
...@@ -40,24 +40,28 @@ extern long const _Xevent_to_mask[]; ...@@ -40,24 +40,28 @@ extern long const _Xevent_to_mask[];
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckWindowEvent (dpy, w, mask, event) Bool XCheckWindowEvent (
register Display *dpy; register Display *dpy,
Window w; /* Selected window. */ Window w, /* Selected window. */
long mask; /* Selected event mask. */ long mask, /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
qelt; qelt;
prev = qelt, qelt = qelt->next) { prev = qelt, qelt = qelt->next) {
if ((qelt->event.xany.window == w) && if ((qelt->event.xany.window == w) &&
(qelt->event.type < LASTEvent) && (qelt->event.type < GenericEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) && (_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) || ((qelt->event.type != MotionNotify) ||
(mask & AllPointers) || (mask & AllPointers) ||
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCirculateSubwindows(dpy, w, direction) XCirculateSubwindows(
register Display *dpy; register Display *dpy,
Window w; Window w,
int direction; int direction)
{ {
register xCirculateWindowReq *req; register xCirculateWindowReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCirculateSubwindowsDown(dpy,w) XCirculateSubwindowsDown(
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xCirculateWindowReq *req; register xCirculateWindowReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCirculateSubwindowsUp(dpy, w) XCirculateSubwindowsUp(
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xCirculateWindowReq *req; register xCirculateWindowReq *req;
......
...@@ -30,7 +30,11 @@ from The Open Group. ...@@ -30,7 +30,11 @@ from The Open Group.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#if USE_XCB
#include "Xxcbint.h"
#else /* !USE_XCB */
#include <nx-X11/Xtrans/Xtrans.h> #include <nx-X11/Xtrans/Xtrans.h>
#endif /* USE_XCB */
#include "Xlib.h" #include "Xlib.h"
#include "Xlibint.h" #include "Xlibint.h"
#include "Xintconn.h" #include "Xintconn.h"
...@@ -68,7 +72,11 @@ XCloseDisplay ( ...@@ -68,7 +72,11 @@ XCloseDisplay (
if (dpy->request != dpy->last_request_read) if (dpy->request != dpy->last_request_read)
XSync(dpy, 1); XSync(dpy, 1);
} }
#if USE_XCB
xcb_disconnect(dpy->xcb->connection);
#else /* !USE_XCB */
_XDisconnectDisplay(dpy->trans_conn); _XDisconnectDisplay(dpy->trans_conn);
#endif /* USE_XCB */
_XFreeDisplayStructure (dpy); _XFreeDisplayStructure (dpy);
return 0; return 0;
} }
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XClearWindow(dpy, w) XClearWindow(
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xClearAreaReq *req; register xClearAreaReq *req;
......
...@@ -30,12 +30,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XClearArea (dpy, w, x, y, width, height, exposures) XClearArea (
register Display *dpy; register Display *dpy,
Window w; Window w,
int x, y; int x,
unsigned int width, height; int y,
Bool exposures; unsigned int width,
unsigned int height,
Bool exposures)
{ {
register xClearAreaReq *req; register xClearAreaReq *req;
......
/* $XFree86$ */
#ifndef _CMAP_H_ #ifndef _CMAP_H_
#define _CMAP_H_ #define _CMAP_H_
......
...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XMoveResizeWindow(dpy, w, x, y, width, height) XMoveResizeWindow(
register Display *dpy; register Display *dpy,
Window w; Window w,
int x, y; int x,
unsigned int width, height; int y,
unsigned int width,
unsigned int height)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
......
...@@ -233,11 +233,7 @@ int XSaveContext( ...@@ -233,11 +233,7 @@ int XSaveContext(
if an error has occured, 0 otherwise. Possible errors are Entry-not-found. if an error has occured, 0 otherwise. Possible errors are Entry-not-found.
*/ */
int XFindContext(display, rid, context, data) int XFindContext(Display *display, XID rid, XContext context, XPointer *data)
Display *display;
register XID rid;
register XContext context;
XPointer *data; /* RETURN */
{ {
register DB db; register DB db;
register TableEntry entry; register TableEntry entry;
...@@ -272,10 +268,7 @@ int XFindContext(display, rid, context, data) ...@@ -272,10 +268,7 @@ int XFindContext(display, rid, context, data)
with the same arguments. with the same arguments.
*/ */
int XDeleteContext(display, rid, context) int XDeleteContext(Display *display, XID rid, XContext context)
Display *display;
register XID rid;
register XContext context;
{ {
register DB db; register DB db;
register TableEntry entry, *prev; register TableEntry entry, *prev;
......
...@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XConvertSelection(dpy, selection, target, property, requestor, time) XConvertSelection(
register Display *dpy; register Display *dpy,
Atom selection, target; Atom selection,
Atom property; Atom target,
Window requestor; Atom property,
Time time; Window requestor,
Time time)
{ {
register xConvertSelectionReq *req; register xConvertSelectionReq *req;
......
...@@ -30,15 +30,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,15 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCopyArea(dpy, src_drawable, dst_drawable, gc, XCopyArea(
src_x, src_y, width, height, register Display *dpy,
dst_x, dst_y) Drawable src_drawable,
register Display *dpy; Drawable dst_drawable,
Drawable src_drawable, dst_drawable; GC gc,
GC gc; int src_x,
int src_x, src_y; int src_y,
unsigned int width, height; unsigned int width,
int dst_x, dst_y; unsigned int height,
int dst_x,
int dst_y)
{ {
register xCopyAreaReq *req; register xCopyAreaReq *req;
......
...@@ -40,9 +40,9 @@ extern XcmsCmapRec * _XcmsCopyCmapRecAndFree(Display *dpy, ...@@ -40,9 +40,9 @@ extern XcmsCmapRec * _XcmsCopyCmapRecAndFree(Display *dpy,
Colormap copy_cmap); Colormap copy_cmap);
#endif #endif
Colormap XCopyColormapAndFree(dpy, src_cmap) Colormap XCopyColormapAndFree(
register Display *dpy; register Display *dpy,
Colormap src_cmap; Colormap src_cmap)
{ {
Colormap mid; Colormap mid;
register xCopyColormapAndFreeReq *req; register xCopyColormapAndFreeReq *req;
......
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCopyGC (dpy, srcGC, mask, destGC) XCopyGC (
register Display *dpy; register Display *dpy,
unsigned long mask; /* which ones to set initially */ GC srcGC,
GC srcGC, destGC; unsigned long mask, /* which ones to set initially */
GC destGC)
{ {
register XGCValues *destgv = &destGC->values, register XGCValues *destgv = &destGC->values,
*srcgv = &srcGC->values; *srcgv = &srcGC->values;
......
...@@ -30,16 +30,18 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,16 +30,18 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCopyPlane(dpy, src_drawable, dst_drawable, gc, XCopyPlane(
src_x, src_y, width, height, register Display *dpy,
dst_x, dst_y, bit_plane) Drawable src_drawable,
register Display *dpy; Drawable dst_drawable,
Drawable src_drawable, dst_drawable; GC gc,
GC gc; int src_x,
int src_x, src_y; int src_y,
unsigned int width, height; unsigned int width,
int dst_x, dst_y; unsigned int height,
unsigned long bit_plane; int dst_x,
int dst_y,
unsigned long bit_plane)
{ {
register xCopyPlaneReq *req; register xCopyPlaneReq *req;
......
/* $XFree86$ */
#ifndef _CR_H_ #ifndef _CR_H_
#define _CR_H_ #define _CR_H_
......
...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
......
...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xcmsint.h" #include "Xcmsint.h"
Colormap XCreateColormap(dpy, w, visual, alloc) Colormap XCreateColormap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Visual *visual; Visual *visual,
int alloc; int alloc)
{ {
register xCreateColormapReq *req; register xCreateColormapReq *req;
Colormap mid; Colormap mid;
...@@ -51,7 +51,9 @@ int alloc; ...@@ -51,7 +51,9 @@ int alloc;
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
#ifdef XCMS
_XcmsAddCmapRec(dpy, mid, w, visual); _XcmsAddCmapRec(dpy, mid, w, visual);
#endif
return(mid); return(mid);
} }
...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -41,11 +40,14 @@ _XTryShapeBitmapCursor (Display *dpy, ...@@ -41,11 +40,14 @@ _XTryShapeBitmapCursor (Display *dpy,
unsigned int y); unsigned int y);
#endif #endif
Cursor XCreatePixmapCursor(dpy, source, mask, foreground, background, x, y) Cursor XCreatePixmapCursor(
register Display *dpy; register Display *dpy,
Pixmap source, mask; Pixmap source,
XColor *foreground, *background; Pixmap mask,
unsigned int x, y; XColor *foreground,
XColor *background,
unsigned int x,
unsigned int y)
{ {
register xCreateCursorReq *req; register xCreateCursorReq *req;
......
...@@ -61,11 +61,11 @@ static void _XGenerateGCList( ...@@ -61,11 +61,11 @@ static void _XGenerateGCList(
GC gc, GC gc,
xReq *req); xReq *req);
GC XCreateGC (dpy, d, valuemask, values) GC XCreateGC (
register Display *dpy; register Display *dpy,
Drawable d; /* Window or Pixmap for which depth matches */ Drawable d, /* Window or Pixmap for which depth matches */
unsigned long valuemask; /* which ones to set initially */ unsigned long valuemask, /* which ones to set initially */
XGCValues *values; /* the values themselves */ XGCValues *values) /* the values themselves */
{ {
register GC gc; register GC gc;
register xCreateGCReq *req; register xCreateGCReq *req;
...@@ -161,11 +161,11 @@ _XGenerateGCList ( ...@@ -161,11 +161,11 @@ _XGenerateGCList (
int int
_XUpdateGCCache (gc, mask, attr) _XUpdateGCCache (
register unsigned long mask; register GC gc,
register XGCValues *attr; register unsigned long mask,
register GC gc; register XGCValues *attr)
{ {
register XGCValues *gv = &gc->values; register XGCValues *gv = &gc->values;
if (mask & GCFunction) if (mask & GCFunction)
...@@ -308,13 +308,13 @@ _XUpdateGCCache (gc, mask, attr) ...@@ -308,13 +308,13 @@ _XUpdateGCCache (gc, mask, attr)
gc->dashes = 0; gc->dashes = 0;
} }
return 0; return 0;
} }
/* can only call when display is already locked. */ /* can only call when display is already locked. */
void _XFlushGCCache(dpy, gc) void _XFlushGCCache(
Display *dpy; Display *dpy,
GC gc; GC gc)
{ {
register xChangeGCReq *req; register xChangeGCReq *req;
register _XExtension *ext; register _XExtension *ext;
...@@ -331,13 +331,15 @@ void _XFlushGCCache(dpy, gc) ...@@ -331,13 +331,15 @@ void _XFlushGCCache(dpy, gc)
} }
} }
void XFlushGC(dpy, gc) void
Display *dpy; XFlushGC(
GC gc; Display *dpy,
GC gc)
{ {
FlushGC(dpy, gc); FlushGC(dpy, gc);
} }
GContext XGContextFromGC(gc) GContext XGContextFromGC(GC gc)
GC gc; {
{ return (gc->gid); } return (gc->gid);
}
...@@ -44,14 +44,18 @@ in this Software without prior written authorization from The Open Group. ...@@ -44,14 +44,18 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Cr.h" #include "Cr.h"
#ifdef __CYGWIN__
#define LIBXCURSOR "cygXcursor-1.dll"
#endif
#if defined(hpux) #if defined(hpux)
typedef shl_dt XModuleType; typedef shl_t XModuleType;
#else #else
typedef void *XModuleType; typedef void *XModuleType;
#endif #endif
#ifndef LIBXCURSOR #ifndef LIBXCURSOR
#define LIBXCURSOR "libXcursor.so" #define LIBXCURSOR "libXcursor.so.1"
#endif #endif
static char libraryName[] = LIBXCURSOR; static char libraryName[] = LIBXCURSOR;
...@@ -76,14 +80,14 @@ open_library (void) ...@@ -76,14 +80,14 @@ open_library (void)
break; break;
*dot = '\0'; *dot = '\0';
} }
return 0; return NULL;
} }
static void * static void *
fetch_symbol (XModuleType module, char *under_symbol) fetch_symbol (XModuleType module, const char *under_symbol)
{ {
void *result = NULL; void *result = NULL;
char *symbol = under_symbol + 1; const char *symbol = under_symbol + 1;
#if defined(hpux) #if defined(hpux)
int getsyms_cnt, i; int getsyms_cnt, i;
struct shl_symbol *symbols; struct shl_symbol *symbols;
...@@ -218,14 +222,14 @@ _XTryShapeBitmapCursor (Display *dpy, ...@@ -218,14 +222,14 @@ _XTryShapeBitmapCursor (Display *dpy,
} }
#endif #endif
Cursor XCreateGlyphCursor(dpy, source_font, mask_font, Cursor XCreateGlyphCursor(
source_char, mask_char, register Display *dpy,
foreground, background) Font source_font,
register Display *dpy; Font mask_font,
Font source_font, mask_font; unsigned int source_char,
unsigned int source_char, mask_char; unsigned int mask_char,
XColor _Xconst *foreground, *background; XColor _Xconst *foreground,
XColor _Xconst *background)
{ {
Cursor cid; Cursor cid;
register xCreateGlyphCursorReq *req; register xCreateGlyphCursorReq *req;
......
...@@ -48,13 +48,15 @@ in this Software without prior written authorization from The Open Group. ...@@ -48,13 +48,15 @@ in this Software without prior written authorization from The Open Group.
* xoffset=0 * xoffset=0
* no extra bytes per line * no extra bytes per line
*/ */
Pixmap XCreatePixmapFromBitmapData(display,d,data,width,height,fg,bg,depth) Pixmap XCreatePixmapFromBitmapData(
Display *display; Display *display,
Drawable d; Drawable d,
char *data; char *data,
unsigned int width, height; unsigned int width,
unsigned long fg, bg; unsigned int height,
unsigned int depth; unsigned long fg,
unsigned long bg,
unsigned int depth)
{ {
XImage ximage; XImage ximage;
GC gc; GC gc;
......
...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -38,10 +37,12 @@ _XNoticeCreateBitmap (Display *dpy, ...@@ -38,10 +37,12 @@ _XNoticeCreateBitmap (Display *dpy,
unsigned int height); unsigned int height);
#endif #endif
Pixmap XCreatePixmap (dpy, d, width, height, depth) Pixmap XCreatePixmap (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
unsigned int width, height, depth; unsigned int width,
unsigned int height,
unsigned int depth)
{ {
Pixmap pid; Pixmap pid;
register xCreatePixmapReq *req; register xCreatePixmapReq *req;
......
...@@ -29,14 +29,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,14 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Window XCreateSimpleWindow(dpy, parent, x, y, width, height, Window XCreateSimpleWindow(
borderWidth, border, background) register Display *dpy,
register Display *dpy; Window parent,
Window parent; int x,
int x, y; int y,
unsigned int width, height, borderWidth; unsigned int width,
unsigned long border; unsigned int height,
unsigned long background; unsigned int borderWidth,
unsigned long border,
unsigned long background)
{ {
Window wid; Window wid;
register xCreateWindowReq *req; register xCreateWindowReq *req;
......
...@@ -31,9 +31,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,9 +31,9 @@ in this Software without prior written authorization from The Open Group.
static XColor _Xconst foreground = { 0, 0, 0, 0 }; /* black */ static XColor _Xconst foreground = { 0, 0, 0, 0 }; /* black */
static XColor _Xconst background = { 0, 65535, 65535, 65535 }; /* white */ static XColor _Xconst background = { 0, 65535, 65535, 65535 }; /* white */
Cursor XCreateFontCursor(dpy, which) Cursor XCreateFontCursor(
Display *dpy; Display *dpy,
unsigned int which; unsigned int which)
{ {
/* /*
* the cursor font contains the shape glyph followed by the mask * the cursor font contains the shape glyph followed by the mask
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDefineCursor (dpy, w, cursor) XDefineCursor (
register Display *dpy; register Display *dpy,
Window w; Window w,
Cursor cursor; Cursor cursor)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDeleteProperty(dpy, window, property) XDeleteProperty(
register Display *dpy; register Display *dpy,
Window window; Window window,
Atom property; Atom property)
{ {
register xDeletePropertyReq *req; register xDeletePropertyReq *req;
......
...@@ -33,10 +33,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,10 +33,10 @@ in this Software without prior written authorization from The Open Group.
/* /*
* XListDepths - return info from connection setup * XListDepths - return info from connection setup
*/ */
int *XListDepths (dpy, scrnum, countp) int *XListDepths (
Display *dpy; Display *dpy,
int scrnum; int scrnum,
int *countp; int *countp)
{ {
Screen *scr; Screen *scr;
int count; int count;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDestroySubwindows(dpy, win) XDestroySubwindows(
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDestroyWindow (dpy, w) XDestroyWindow (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -36,13 +36,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -36,13 +36,16 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawArc(dpy, d, gc, x, y, width, height, angle1, angle2) XDrawArc(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
int angle1, angle2; /* INT16 */ unsigned int width,
unsigned int height, /* CARD16 */
int angle1,
int angle2) /* INT16 */
{ {
register xPolyArcReq *req; register xPolyArcReq *req;
register xArc *arc; register xArc *arc;
......
...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group.
#define arc_scale (SIZEOF(xArc) / 4) #define arc_scale (SIZEOF(xArc) / 4)
int int
XDrawArcs(dpy, d, gc, arcs, n_arcs) XDrawArcs(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XArc *arcs; XArc *arcs,
int n_arcs; int n_arcs)
{ {
register xPolyArcReq *req; register xPolyArcReq *req;
register long len; register long len;
......
...@@ -35,11 +35,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,11 +35,14 @@ in this Software without prior written authorization from The Open Group.
#define zsize (SIZEOF(xPolySegmentReq) + ZLNSPERBATCH * SIZEOF(xSegment)) #define zsize (SIZEOF(xPolySegmentReq) + ZLNSPERBATCH * SIZEOF(xSegment))
int int
XDrawLine (dpy, d, gc, x1, y1, x2, y2) XDrawLine (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x1, y1, x2, y2; int x1,
int y1,
int x2,
int y2)
{ {
register xSegment *segment; register xSegment *segment;
......
...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawLines (dpy, d, gc, points, npoints, mode) XDrawLines (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XPoint *points; XPoint *points,
int npoints; int npoints,
int mode; int mode)
{ {
register xPolyLineReq *req; register xPolyLineReq *req;
register long length; register long length;
......
...@@ -34,11 +34,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,11 +34,12 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyPointReq) + PTSPERBATCH * SIZEOF(xPoint)) #define size (SIZEOF(xPolyPointReq) + PTSPERBATCH * SIZEOF(xPoint))
int int
XDrawPoint(dpy, d, gc, x, y) XDrawPoint(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
int y) /* INT16 */
{ {
xPoint *point; xPoint *point;
......
...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawPoints(dpy, d, gc, points, n_points, mode) XDrawPoints(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XPoint *points; XPoint *points,
int n_points; int n_points,
int mode; /* CoordMode */ int mode) /* CoordMode */
{ {
register xPolyPointReq *req; register xPolyPointReq *req;
register long nbytes; register long nbytes;
......
...@@ -35,12 +35,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,12 +35,14 @@ in this Software without prior written authorization from The Open Group.
#define zsize (SIZEOF(xPolyRectangleReq) + ZRCTSPERBATCH * SIZEOF(xRectangle)) #define zsize (SIZEOF(xPolyRectangleReq) + ZRCTSPERBATCH * SIZEOF(xRectangle))
int int
XDrawRectangle(dpy, d, gc, x, y, width, height) XDrawRectangle(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
unsigned int width,
unsigned int height) /* CARD16 */
{ {
xRectangle *rect; xRectangle *rect;
......
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawRectangles(dpy, d, gc, rects, n_rects) XDrawRectangles(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XRectangle *rects; XRectangle *rects,
int n_rects; int n_rects)
{ {
register xPolyRectangleReq *req; register xPolyRectangleReq *req;
long len; long len;
......
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawSegments (dpy, d, gc, segments, nsegments) XDrawSegments (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XSegment *segments; XSegment *segments,
int nsegments; int nsegments)
{ {
register xPolySegmentReq *req; register xPolySegmentReq *req;
long len; long len;
......
/* /*
* $Xorg: ErrDes.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $
* $XdotOrg: xc/lib/X11/ErrDes.c,v 1.8 2005/08/26 05:16:46 daniels Exp $
*/ */
/*********************************************************** /***********************************************************
...@@ -70,34 +68,40 @@ SOFTWARE. ...@@ -70,34 +68,40 @@ SOFTWARE.
* descriptions of errors in Section 4 of Protocol doc (pp. 350-351); more * descriptions of errors in Section 4 of Protocol doc (pp. 350-351); more
* verbose descriptions are given in the error database * verbose descriptions are given in the error database
*/ */
static const char * const _XErrorList[] = { static const char _XErrorList[] =
/* No error */ "no error", /* No error */ "no error\0"
/* BadRequest */ "BadRequest", /* BadRequest */ "BadRequest\0"
/* BadValue */ "BadValue", /* BadValue */ "BadValue\0"
/* BadWindow */ "BadWindow", /* BadWindow */ "BadWindow\0"
/* BadPixmap */ "BadPixmap", /* BadPixmap */ "BadPixmap\0"
/* BadAtom */ "BadAtom", /* BadAtom */ "BadAtom\0"
/* BadCursor */ "BadCursor", /* BadCursor */ "BadCursor\0"
/* BadFont */ "BadFont", /* BadFont */ "BadFont\0"
/* BadMatch */ "BadMatch", /* BadMatch */ "BadMatch\0"
/* BadDrawable */ "BadDrawable", /* BadDrawable */ "BadDrawable\0"
/* BadAccess */ "BadAccess", /* BadAccess */ "BadAccess\0"
/* BadAlloc */ "BadAlloc", /* BadAlloc */ "BadAlloc\0"
/* BadColor */ "BadColor", /* BadColor */ "BadColor\0"
/* BadGC */ "BadGC", /* BadGC */ "BadGC\0"
/* BadIDChoice */ "BadIDChoice", /* BadIDChoice */ "BadIDChoice\0"
/* BadName */ "BadName", /* BadName */ "BadName\0"
/* BadLength */ "BadLength", /* BadLength */ "BadLength\0"
/* BadImplementation */ "BadImplementation", /* BadImplementation */ "BadImplementation"
;
/* offsets into _XErrorList */
static const unsigned char _XErrorOffsets[] = {
0, 9, 20, 29, 39, 49, 57, 67, 75, 84, 96,
106, 115, 124, 130, 142, 150, 160
}; };
int int
XGetErrorText(dpy, code, buffer, nbytes) XGetErrorText(
register int code; register Display *dpy,
register Display *dpy; register int code,
char *buffer; char *buffer,
int nbytes; int nbytes)
{ {
char buf[150]; char buf[150];
register _XExtension *ext; register _XExtension *ext;
...@@ -106,7 +110,8 @@ XGetErrorText(dpy, code, buffer, nbytes) ...@@ -106,7 +110,8 @@ XGetErrorText(dpy, code, buffer, nbytes)
if (nbytes == 0) return 0; if (nbytes == 0) return 0;
if (code <= BadImplementation && code > 0) { if (code <= BadImplementation && code > 0) {
sprintf(buf, "%d", code); sprintf(buf, "%d", code);
(void) XGetErrorDatabaseText(dpy, "XProtoError", buf, _XErrorList[code], (void) XGetErrorDatabaseText(dpy, "XProtoError", buf,
_XErrorList + _XErrorOffsets[code],
buffer, nbytes); buffer, nbytes);
} else } else
buffer[0] = '\0'; buffer[0] = '\0';
...@@ -115,7 +120,7 @@ XGetErrorText(dpy, code, buffer, nbytes) ...@@ -115,7 +120,7 @@ XGetErrorText(dpy, code, buffer, nbytes)
if (ext->error_string) if (ext->error_string)
(*ext->error_string)(dpy, code, &ext->codes, buffer, nbytes); (*ext->error_string)(dpy, code, &ext->codes, buffer, nbytes);
if (ext->codes.first_error && if (ext->codes.first_error &&
ext->codes.first_error < code && ext->codes.first_error <= code &&
(!bext || ext->codes.first_error > bext->codes.first_error)) (!bext || ext->codes.first_error > bext->codes.first_error))
bext = ext; bext = ext;
} }
......
...@@ -38,13 +38,15 @@ from The Open Group. ...@@ -38,13 +38,15 @@ from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
/* /*
* reformat a wire event into an XEvent structure of the right type. * Reformat an XEvent structure to a wire event of the right type.
* Return True on success. If the type is unrecognized, return what
* _XUnknownNativeEvent returns (i.e., False).
*/ */
Status Status
_XEventToWire( _XEventToWire(
register Display *dpy, /* pointer to display structure */ register Display *dpy,
register XEvent *re, /* pointer to where event should be reformatted */ register XEvent *re, /* in: from */
register xEvent *event) /* wire protocol event */ register xEvent *event) /* out: to */
{ {
switch (event->u.u.type = re->type) { switch (event->u.u.type = re->type) {
case KeyPress: case KeyPress:
......
...@@ -30,28 +30,23 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,28 +30,23 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XActivateScreenSaver(dpy) XActivateScreenSaver(register Display *dpy)
register Display *dpy;
{ {
XForceScreenSaver (dpy, ScreenSaverActive); XForceScreenSaver (dpy, ScreenSaverActive);
return 1; return 1;
} }
int int
XResetScreenSaver(dpy) XResetScreenSaver(register Display *dpy)
register Display *dpy;
{ {
XForceScreenSaver (dpy, ScreenSaverReset); XForceScreenSaver (dpy, ScreenSaverReset);
return 1; return 1;
} }
int int
XForceScreenSaver(dpy, mode) XForceScreenSaver(
register Display *dpy; register Display *dpy,
int mode; int mode)
{ {
register xForceScreenSaverReq *req; register xForceScreenSaverReq *req;
......
...@@ -206,10 +206,10 @@ XCreateFontSet ( ...@@ -206,10 +206,10 @@ XCreateFontSet (
} }
int int
XFontsOfFontSet(font_set, font_struct_list, font_name_list) XFontsOfFontSet(
XFontSet font_set; XFontSet font_set,
XFontStruct ***font_struct_list; XFontStruct ***font_struct_list,
char ***font_name_list; char ***font_name_list)
{ {
*font_name_list = font_set->core.font_info.font_name_list; *font_name_list = font_set->core.font_info.font_name_list;
*font_struct_list = font_set->core.font_info.font_struct_list; *font_struct_list = font_set->core.font_info.font_struct_list;
...@@ -217,50 +217,47 @@ XFontsOfFontSet(font_set, font_struct_list, font_name_list) ...@@ -217,50 +217,47 @@ XFontsOfFontSet(font_set, font_struct_list, font_name_list)
} }
char * char *
XBaseFontNameListOfFontSet(font_set) XBaseFontNameListOfFontSet(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.base_name_list; return font_set->core.base_name_list;
} }
char * char *
XLocaleOfFontSet(font_set) XLocaleOfFontSet(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.om->core.lcd->core->name; return font_set->core.om->core.lcd->core->name;
} }
extern Bool XContextDependentDrawing(font_set) Bool
XFontSet font_set; XContextDependentDrawing(XFontSet font_set)
{ {
return font_set->core.om->core.context_dependent; return font_set->core.om->core.context_dependent;
} }
Bool Bool
XDirectionalDependentDrawing(font_set) XDirectionalDependentDrawing(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.om->core.directional_dependent; return font_set->core.om->core.directional_dependent;
} }
Bool Bool
XContextualDrawing(font_set) XContextualDrawing(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.om->core.contextual_drawing; return font_set->core.om->core.contextual_drawing;
} }
XFontSetExtents * XFontSetExtents *
XExtentsOfFontSet(font_set) XExtentsOfFontSet(XFontSet font_set)
XFontSet font_set;
{ {
if (!font_set)
return NULL;
return &font_set->core.font_set_extents; return &font_set->core.font_set_extents;
} }
void void
XFreeFontSet(dpy, font_set) XFreeFontSet(
Display *dpy; Display *dpy,
XFontSet font_set; XFontSet font_set)
{ {
XCloseOM(font_set->core.om); XCloseOM(font_set->core.om);
} }
...@@ -33,10 +33,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,10 +33,10 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h> #include <stdio.h>
Status XFetchName (dpy, w, name) Status XFetchName (
register Display *dpy; register Display *dpy,
Window w; Window w,
char **name; char **name)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
...@@ -63,10 +63,10 @@ Status XFetchName (dpy, w, name) ...@@ -63,10 +63,10 @@ Status XFetchName (dpy, w, name)
return(0); return(0);
} }
Status XGetIconName (dpy, w, icon_name) Status XGetIconName (
register Display *dpy; register Display *dpy,
Window w; Window w,
char **icon_name; char **icon_name)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
......
...@@ -34,13 +34,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,13 +34,16 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyFillArcReq) + FARCSPERBATCH * SIZEOF(xArc)) #define size (SIZEOF(xPolyFillArcReq) + FARCSPERBATCH * SIZEOF(xArc))
int int
XFillArc(dpy, d, gc, x, y, width, height, angle1, angle2) XFillArc(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
int angle1, angle2; /* INT16 */ unsigned int width,
unsigned int height, /* CARD16 */
int angle1,
int angle2) /* INT16 */
{ {
xArc *arc; xArc *arc;
......
...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group.
#define arc_scale (SIZEOF(xArc) / 4) #define arc_scale (SIZEOF(xArc) / 4)
int int
XFillArcs(dpy, d, gc, arcs, n_arcs) XFillArcs(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XArc *arcs; XArc *arcs,
int n_arcs; int n_arcs)
{ {
register xPolyFillArcReq *req; register xPolyFillArcReq *req;
long len; long len;
......
...@@ -30,14 +30,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,14 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFillPolygon(dpy, d, gc, points, n_points, shape, mode) XFillPolygon(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XPoint *points; XPoint *points,
int n_points; int n_points,
int shape; int shape,
int mode; int mode)
{ {
register xFillPolyReq *req; register xFillPolyReq *req;
register long nbytes; register long nbytes;
......
...@@ -34,12 +34,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,12 +34,14 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyFillRectangleReq) + FRCTSPERBATCH * SIZEOF(xRectangle)) #define size (SIZEOF(xPolyFillRectangleReq) + FRCTSPERBATCH * SIZEOF(xRectangle))
int int
XFillRectangle(dpy, d, gc, x, y, width, height) XFillRectangle(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
unsigned int width,
unsigned int height) /* CARD16 */
{ {
xRectangle *rect; xRectangle *rect;
......
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFillRectangles(dpy, d, gc, rectangles, n_rects) XFillRectangles(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XRectangle *rectangles; XRectangle *rectangles,
int n_rects; int n_rects)
{ {
register xPolyFillRectangleReq *req; register xPolyFillRectangleReq *req;
long len; long len;
...@@ -63,4 +63,3 @@ int n_rects; ...@@ -63,4 +63,3 @@ int n_rects;
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -69,9 +69,9 @@ extern long const _Xevent_to_mask[]; ...@@ -69,9 +69,9 @@ extern long const _Xevent_to_mask[];
* Look up if there is a specified filter for the event. * Look up if there is a specified filter for the event.
*/ */
Bool Bool
XFilterEvent(ev, window) XFilterEvent(
XEvent *ev; XEvent *ev,
Window window; Window window)
{ {
#if XLOCALE #if XLOCALE
XFilterEventList p; XFilterEventList p;
...@@ -93,9 +93,9 @@ XFilterEvent(ev, window) ...@@ -93,9 +93,9 @@ XFilterEvent(ev, window)
if (win == p->window) { if (win == p->window) {
if ((mask & p->event_mask) || if ((mask & p->event_mask) ||
(ev->type >= p->start_type && ev->type <= p->end_type)) { (ev->type >= p->start_type && ev->type <= p->end_type)) {
UnlockDisplay(ev->xany.display);
ret = (*(p->filter))(ev->xany.display, p->window, ev, ret = (*(p->filter))(ev->xany.display, p->window, ev,
p->client_data); p->client_data);
UnlockDisplay(ev->xany.display);
return(ret); return(ret);
} }
} }
......
...@@ -33,9 +33,8 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,9 +33,8 @@ in this Software without prior written authorization from The Open Group.
/* NOTE: NOT necessary when calling any of the Xlib routines. */ /* NOTE: NOT necessary when calling any of the Xlib routines. */
int int
XFlush (dpy) XFlush (register Display *dpy)
register Display *dpy; {
{
LockDisplay(dpy); LockDisplay(dpy);
_XFlush (dpy); _XFlush (dpy);
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
...@@ -123,9 +123,9 @@ XFontStruct *XLoadQueryFont( ...@@ -123,9 +123,9 @@ XFontStruct *XLoadQueryFont(
return font_result; return font_result;
} }
XFontStruct *XQueryFont (dpy, fid) XFontStruct *XQueryFont (
register Display *dpy; register Display *dpy,
Font fid; Font fid)
{ {
XFontStruct *font_result; XFontStruct *font_result;
#ifdef USE_XF86BIGFONT #ifdef USE_XF86BIGFONT
...@@ -147,9 +147,9 @@ XFontStruct *XQueryFont (dpy, fid) ...@@ -147,9 +147,9 @@ XFontStruct *XQueryFont (dpy, fid)
} }
int int
XFreeFont(dpy, fs) XFreeFont(
register Display *dpy; register Display *dpy,
XFontStruct *fs; XFontStruct *fs)
{ {
register xResourceReq *req; register xResourceReq *req;
register _XExtension *ext; register _XExtension *ext;
...@@ -177,10 +177,10 @@ XFreeFont(dpy, fs) ...@@ -177,10 +177,10 @@ XFreeFont(dpy, fs)
static XFontStruct * static XFontStruct *
_XQueryFont (dpy, fid, seq) _XQueryFont (
register Display *dpy; register Display *dpy,
Font fid; Font fid,
unsigned long seq; unsigned long seq)
{ {
register XFontStruct *fs; register XFontStruct *fs;
register long nbytes; register long nbytes;
...@@ -384,11 +384,11 @@ _XF86BigfontFreeNop ( ...@@ -384,11 +384,11 @@ _XF86BigfontFreeNop (
} }
static XFontStruct * static XFontStruct *
_XF86BigfontQueryFont (dpy, extcodes, fid, seq) _XF86BigfontQueryFont (
register Display *dpy; register Display *dpy,
XF86BigfontCodes *extcodes; XF86BigfontCodes *extcodes,
Font fid; Font fid,
unsigned long seq; unsigned long seq)
{ {
register XFontStruct *fs; register XFontStruct *fs;
register long nbytes; register long nbytes;
...@@ -554,7 +554,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq) ...@@ -554,7 +554,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
signature. Then we set the CAP_VerifiedLocal bit to indicate signature. Then we set the CAP_VerifiedLocal bit to indicate
the verification was successful. */ the verification was successful. */
if ((addr = shmat(reply.shmid, 0, SHM_RDONLY)) == (char *)-1) { if ((addr = shmat(reply.shmid, NULL, SHM_RDONLY)) == (char *)-1) {
if (extcodes->serverCapabilities & CAP_VerifiedLocal) if (extcodes->serverCapabilities & CAP_VerifiedLocal)
fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n"); fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n");
Xfree((char *) pData); Xfree((char *) pData);
...@@ -606,8 +606,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq) ...@@ -606,8 +606,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
} }
void void
_XF86BigfontFreeFontMetrics (fs) _XF86BigfontFreeFontMetrics (XFontStruct *fs)
XFontStruct *fs;
{ {
#ifdef HAS_SHM #ifdef HAS_SHM
XExtData *pData; XExtData *pData;
...@@ -633,7 +632,7 @@ int _XF86LoadQueryLocaleFont( ...@@ -633,7 +632,7 @@ int _XF86LoadQueryLocaleFont(
Font *fidp) Font *fidp)
{ {
int l; int l;
char *charset, *p; const char *charset, *p;
char buf[256]; char buf[256];
XFontStruct *fs; XFontStruct *fs;
XLCd lcd; XLCd lcd;
...@@ -643,7 +642,7 @@ int _XF86LoadQueryLocaleFont( ...@@ -643,7 +642,7 @@ int _XF86LoadQueryLocaleFont(
l = strlen(name); l = strlen(name);
if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-') if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-')
return 0; return 0;
charset = 0; charset = NULL;
/* next three lines stolen from _XkbGetCharset() */ /* next three lines stolen from _XkbGetCharset() */
lcd = _XlcCurrentLC(); lcd = _XlcCurrentLC();
if ((lcd = _XlcCurrentLC()) != 0) if ((lcd = _XlcCurrentLC()) != 0)
......
...@@ -201,10 +201,10 @@ XFontStruct **info) /* RETURN */ ...@@ -201,10 +201,10 @@ XFontStruct **info) /* RETURN */
} }
int int
XFreeFontInfo (names, info, actualCount) XFreeFontInfo (
char **names; char **names,
XFontStruct *info; XFontStruct *info,
int actualCount; int actualCount)
{ {
register int i; register int i;
if (names) { if (names) {
......
...@@ -98,8 +98,7 @@ int *actualCount) /* RETURN */ ...@@ -98,8 +98,7 @@ int *actualCount) /* RETURN */
} }
int int
XFreeFontNames(list) XFreeFontNames(char **list)
char **list;
{ {
if (list) { if (list) {
if (!*(list[0]-1)) { /* from ListFontsWithInfo */ if (!*(list[0]-1)) { /* from ListFontsWithInfo */
......
...@@ -44,6 +44,9 @@ XFreeColormap( ...@@ -44,6 +44,9 @@ XFreeColormap(
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
#ifdef XCMS
_XcmsDeleteCmapRec(dpy, cmap); _XcmsDeleteCmapRec(dpy, cmap);
#endif
return 1; return 1;
} }
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreeColors(dpy, cmap, pixels, npixels, planes) XFreeColors(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
unsigned long *pixels; /* LISTofCARD32 */ unsigned long *pixels, /* LISTofCARD32 */
int npixels; int npixels,
unsigned long planes; /* CARD32 */ unsigned long planes) /* CARD32 */
{ {
register xFreeColorsReq *req; register xFreeColorsReq *req;
register long nbytes; register long nbytes;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreeCursor(dpy, cursor) XFreeCursor(
register Display *dpy; register Display *dpy,
Cursor cursor; Cursor cursor)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
_XFreeExtData (extension) _XFreeExtData (XExtData *extension)
XExtData *extension;
{ {
XExtData *temp; XExtData *temp;
while (extension) { while (extension) {
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreeGC (dpy, gc) XFreeGC (
register Display *dpy; register Display *dpy,
GC gc; GC gc)
{ {
register xResourceReq *req; register xResourceReq *req;
register _XExtension *ext; register _XExtension *ext;
...@@ -47,4 +47,3 @@ XFreeGC (dpy, gc) ...@@ -47,4 +47,3 @@ XFreeGC (dpy, gc)
Xfree ((char *) gc); Xfree ((char *) gc);
return 1; return 1;
} }
...@@ -30,10 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreePixmap(dpy, pixmap) XFreePixmap(
register Display *dpy; register Display *dpy,
Pixmap pixmap; Pixmap pixmap)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetArcMode (dpy, gc, arc_mode) XSetArcMode (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int arc_mode; int arc_mode)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.arc_mode != arc_mode) { if (gc->values.arc_mode != arc_mode) {
...@@ -46,10 +46,10 @@ int arc_mode; ...@@ -46,10 +46,10 @@ int arc_mode;
} }
int int
XSetFillRule (dpy, gc, fill_rule) XSetFillRule (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int fill_rule; int fill_rule)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.fill_rule != fill_rule) { if (gc->values.fill_rule != fill_rule) {
...@@ -62,10 +62,10 @@ int fill_rule; ...@@ -62,10 +62,10 @@ int fill_rule;
} }
int int
XSetFillStyle (dpy, gc, fill_style) XSetFillStyle (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int fill_style; int fill_style)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.fill_style != fill_style) { if (gc->values.fill_style != fill_style) {
...@@ -78,10 +78,10 @@ int fill_style; ...@@ -78,10 +78,10 @@ int fill_style;
} }
int int
XSetGraphicsExposures (dpy, gc, graphics_exposures) XSetGraphicsExposures (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
Bool graphics_exposures; Bool graphics_exposures)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.graphics_exposures != graphics_exposures) { if (gc->values.graphics_exposures != graphics_exposures) {
...@@ -94,10 +94,10 @@ Bool graphics_exposures; ...@@ -94,10 +94,10 @@ Bool graphics_exposures;
} }
int int
XSetSubwindowMode (dpy, gc, subwindow_mode) XSetSubwindowMode (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int subwindow_mode; int subwindow_mode)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.subwindow_mode != subwindow_mode) { if (gc->values.subwindow_mode != subwindow_mode) {
......
...@@ -26,7 +26,6 @@ other dealings in this Software without prior written authorization ...@@ -26,7 +26,6 @@ other dealings in this Software without prior written authorization
from The Open Group. from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
......
...@@ -56,9 +56,9 @@ char *_XGetAtomName( ...@@ -56,9 +56,9 @@ char *_XGetAtomName(
return (char *)NULL; return (char *)NULL;
} }
char *XGetAtomName(dpy, atom) char *XGetAtomName(
register Display *dpy; register Display *dpy,
Atom atom; Atom atom)
{ {
xGetAtomNameReply rep; xGetAtomNameReply rep;
char *name; char *name;
...@@ -139,11 +139,11 @@ Bool _XGetAtomNameHandler( ...@@ -139,11 +139,11 @@ Bool _XGetAtomNameHandler(
} }
Status Status
XGetAtomNames (dpy, atoms, count, names_return) XGetAtomNames (
Display *dpy; Display *dpy,
Atom *atoms; Atom *atoms,
int count; int count,
char **names_return; char **names_return)
{ {
_XAsyncHandler async; _XAsyncHandler async;
_XGetAtomNameState async_state; _XGetAtomNameState async_state;
......
...@@ -48,6 +48,7 @@ XColor *exact_def) /* RETURN */ ...@@ -48,6 +48,7 @@ XColor *exact_def) /* RETURN */
XcmsColor cmsColor_exact; XcmsColor cmsColor_exact;
Status ret; Status ret;
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms and i18n approach to Parse Color * Let's Attempt to use Xcms and i18n approach to Parse Color
*/ */
...@@ -73,6 +74,7 @@ XColor *exact_def) /* RETURN */ ...@@ -73,6 +74,7 @@ XColor *exact_def) /* RETURN */
break; break;
} }
} }
#endif
/* /*
* Xcms and i18n approach failed. * Xcms and i18n approach failed.
......
...@@ -96,16 +96,16 @@ GetHomeDir( ...@@ -96,16 +96,16 @@ GetHomeDir(
int len) int len)
{ {
#ifdef WIN32 #ifdef WIN32
register char *ptr1; register char *ptr1 = NULL;
register char *ptr2; register char *ptr2 = NULL;
int len1 = 0, len2 = 0; int len1 = 0, len2 = 0;
if (ptr1 = getenv("HOME")) { /* old, deprecated */ if ((ptr1 = getenv("HOME"))) { /* old, deprecated */
len1 = strlen (ptr1); len1 = strlen (ptr1);
} else if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) { } else if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) {
len1 = strlen (ptr1); len1 = strlen (ptr1);
len2 = strlen (ptr2); len2 = strlen (ptr2);
} else if (ptr2 = getenv("USERNAME")) { } else if ((ptr2 = getenv("USERNAME"))) {
len1 = strlen (ptr1 = "/users/"); len1 = strlen (ptr1 = "/users/");
len2 = strlen (ptr2); len2 = strlen (ptr2);
} }
...@@ -162,7 +162,7 @@ InitDefaults( ...@@ -162,7 +162,7 @@ InitDefaults(
*/ */
if (dpy->xdefaults == NULL) { if (dpy->xdefaults == NULL) {
char *slashDotXdefaults = "/.Xdefaults"; const char *slashDotXdefaults = "/.Xdefaults";
(void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaults) - 1); (void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaults) - 1);
(void) strcat (fname, slashDotXdefaults); (void) strcat (fname, slashDotXdefaults);
...@@ -172,7 +172,7 @@ InitDefaults( ...@@ -172,7 +172,7 @@ InitDefaults(
} }
if (!(xenv = getenv ("XENVIRONMENT"))) { if (!(xenv = getenv ("XENVIRONMENT"))) {
char *slashDotXdefaultsDash = "/.Xdefaults-"; const char *slashDotXdefaultsDash = "/.Xdefaults-";
int len; int len;
(void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaultsDash) - 1); (void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaultsDash) - 1);
......
...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
char **XGetFontPath(dpy, npaths) char **XGetFontPath(
register Display *dpy; register Display *dpy,
int *npaths; /* RETURN */ int *npaths) /* RETURN */
{ {
xGetFontPathReply rep; xGetFontPathReply rep;
register long nbytes; register long nbytes;
...@@ -81,8 +81,7 @@ int *npaths; /* RETURN */ ...@@ -81,8 +81,7 @@ int *npaths; /* RETURN */
} }
int int
XFreeFontPath (list) XFreeFontPath (char **list)
char **list;
{ {
if (list != NULL) { if (list != NULL) {
Xfree (list[0]-1); Xfree (list[0]-1);
......
...@@ -29,11 +29,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,11 +29,11 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Bool XGetFontProperty (fs, name, valuePtr) Bool XGetFontProperty (
XFontStruct *fs; XFontStruct *fs,
register Atom name; register Atom name,
unsigned long *valuePtr; unsigned long *valuePtr)
{ {
/* XXX this is a simple linear search for now. If the /* XXX this is a simple linear search for now. If the
protocol is changed to sort the property list, this should protocol is changed to sort the property list, this should
become a binary search. */ become a binary search. */
...@@ -50,6 +50,3 @@ Bool XGetFontProperty (fs, name, valuePtr) ...@@ -50,6 +50,3 @@ Bool XGetFontProperty (fs, name, valuePtr)
} }
...@@ -43,11 +43,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -43,11 +43,11 @@ in this Software without prior written authorization from The Open Group.
GCArcMode) GCArcMode)
/*ARGSUSED*/ /*ARGSUSED*/
Status XGetGCValues (dpy, gc, valuemask, values) Status XGetGCValues (
Display *dpy; Display *dpy,
GC gc; GC gc,
unsigned long valuemask; unsigned long valuemask,
XGCValues *values; XGCValues *values)
{ {
if (valuemask == ValidGCValuesBits) { if (valuemask == ValidGCValuesBits) {
char dashes = values->dashes; char dashes = values->dashes;
......
...@@ -29,12 +29,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XGetGeometry (dpy, d, root, x, y, width, height, borderWidth, depth) Status XGetGeometry (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
Window *root; /* RETURN */ Window *root, /* RETURN */
int *x, *y; /* RETURN */ int *x,
unsigned int *width, *height, *borderWidth, *depth; /* RETURN */ int *y, /* RETURN */
unsigned int *width,
unsigned int *height,
unsigned int *borderWidth,
unsigned int *depth) /* RETURN */
{ {
xGetGeometryReply rep; xGetGeometryReply rep;
register xResourceReq *req; register xResourceReq *req;
......
...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XAllocColor(dpy, cmap, def) Status XAllocColor(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *def; XColor *def)
{ {
Status status; Status status;
xAllocColorReply rep; xAllocColorReply rep;
......
...@@ -56,11 +56,11 @@ SOFTWARE. ...@@ -56,11 +56,11 @@ SOFTWARE.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <stdio.h> #include <stdio.h>
Status XGetSizeHints (dpy, w, hints, property) Status XGetSizeHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
Atom property; Atom property)
{ {
xPropSizeHints *prop = NULL; xPropSizeHints *prop = NULL;
Atom actual_type; Atom actual_type;
...@@ -103,9 +103,9 @@ Status XGetSizeHints (dpy, w, hints, property) ...@@ -103,9 +103,9 @@ Status XGetSizeHints (dpy, w, hints, property)
* on. * on.
*/ */
XWMHints *XGetWMHints (dpy, w) XWMHints *XGetWMHints (
Display *dpy; Display *dpy,
Window w; Window w)
{ {
xPropWMHints *prop = NULL; xPropWMHints *prop = NULL;
register XWMHints *hints; register XWMHints *hints;
...@@ -147,19 +147,19 @@ XWMHints *XGetWMHints (dpy, w) ...@@ -147,19 +147,19 @@ XWMHints *XGetWMHints (dpy, w)
} }
Status Status
XGetZoomHints (dpy, w, zhints) XGetZoomHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *zhints; XSizeHints *zhints)
{ {
return (XGetSizeHints(dpy, w, zhints, XA_WM_ZOOM_HINTS)); return (XGetSizeHints(dpy, w, zhints, XA_WM_ZOOM_HINTS));
} }
Status Status
XGetNormalHints (dpy, w, hints) XGetNormalHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints)
{ {
return (XGetSizeHints(dpy, w, hints, XA_WM_NORMAL_HINTS)); return (XGetSizeHints(dpy, w, hints, XA_WM_NORMAL_HINTS));
} }
...@@ -170,11 +170,11 @@ XGetNormalHints (dpy, w, hints) ...@@ -170,11 +170,11 @@ XGetNormalHints (dpy, w, hints)
* ICONSIZE_ATOM type: ICONSIZE_ATOM format: 32 * ICONSIZE_ATOM type: ICONSIZE_ATOM format: 32
*/ */
Status XGetIconSizes (dpy, w, size_list, count) Status XGetIconSizes (
Display *dpy; Display *dpy,
Window w; /* typically, root */ Window w, /* typically, root */
XIconSize **size_list; /* RETURN */ XIconSize **size_list, /* RETURN */
int *count; /* RETURN number of items on the list */ int *count) /* RETURN number of items on the list */
{ {
xPropIconSize *prop = NULL; xPropIconSize *prop = NULL;
register xPropIconSize *pp; register xPropIconSize *pp;
...@@ -227,11 +227,11 @@ Status XGetIconSizes (dpy, w, size_list, count) ...@@ -227,11 +227,11 @@ Status XGetIconSizes (dpy, w, size_list, count)
} }
Status XGetCommand (dpy, w, argvp, argcp) Status XGetCommand (
Display *dpy; Display *dpy,
Window w; Window w,
char ***argvp; char ***argvp,
int *argcp; int *argcp)
{ {
XTextProperty tp; XTextProperty tp;
int argc; int argc;
...@@ -267,10 +267,10 @@ Status XGetCommand (dpy, w, argvp, argcp) ...@@ -267,10 +267,10 @@ Status XGetCommand (dpy, w, argvp, argcp)
Status Status
XGetTransientForHint(dpy, w, propWindow) XGetTransientForHint(
Display *dpy; Display *dpy,
Window w; Window w,
Window *propWindow; Window *propWindow)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
...@@ -297,10 +297,10 @@ XGetTransientForHint(dpy, w, propWindow) ...@@ -297,10 +297,10 @@ XGetTransientForHint(dpy, w, propWindow)
} }
Status Status
XGetClassHint(dpy, w, classhint) XGetClassHint(
Display *dpy; Display *dpy,
Window w; Window w,
XClassHint *classhint; /* RETURN */ XClassHint *classhint) /* RETURN */
{ {
int len_name, len_class; int len_name, len_class;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetInputFocus(dpy, focus, revert_to) XGetInputFocus(
register Display *dpy; register Display *dpy,
Window *focus; Window *focus,
int *revert_to; int *revert_to)
{ {
xGetInputFocusReply rep; xGetInputFocusReply rep;
register xReq *req; register xReq *req;
......
...@@ -43,13 +43,15 @@ static unsigned int Ones( /* HACKMEM 169 */ ...@@ -43,13 +43,15 @@ static unsigned int Ones( /* HACKMEM 169 */
return ((unsigned int) (((y + (y >> 3)) & 030707070707) % 077)); return ((unsigned int) (((y + (y >> 3)) & 030707070707) % 077));
} }
XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format) XImage *XGetImage (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
int x, y; int x,
unsigned int width, height; int y,
unsigned long plane_mask; unsigned int width,
int format; /* either XYPixmap or ZPixmap */ unsigned int height,
unsigned long plane_mask,
int format) /* either XYPixmap or ZPixmap */
{ {
xGetImageReply rep; xGetImageReply rep;
register xGetImageReq *req; register xGetImageReq *req;
...@@ -102,16 +104,18 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format) ...@@ -102,16 +104,18 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format)
return (image); return (image);
} }
XImage *XGetSubImage(dpy, d, x, y, width, height, plane_mask, format, XImage *XGetSubImage(
dest_image, dest_x, dest_y) register Display *dpy,
register Display *dpy; Drawable d,
Drawable d; int x,
int x, y; int y,
unsigned int width, height; unsigned int width,
unsigned long plane_mask; unsigned int height,
int format; /* either XYPixmap or ZPixmap */ unsigned long plane_mask,
XImage *dest_image; int format, /* either XYPixmap or ZPixmap */
int dest_x, dest_y; XImage *dest_image,
int dest_x,
int dest_y)
{ {
XImage *temp_image; XImage *temp_image;
temp_image = XGetImage(dpy, d, x, y, width, height, temp_image = XGetImage(dpy, d, x, y, width, height,
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetKeyboardControl (dpy, state) XGetKeyboardControl (
register Display *dpy; register Display *dpy,
register XKeyboardState *state; register XKeyboardState *state)
{ {
xGetKeyboardControlReply rep; xGetKeyboardControlReply rep;
register xReq *req; register xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -29,11 +29,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,11 +29,12 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
XTimeCoord *XGetMotionEvents(dpy, w, start, stop, nEvents) XTimeCoord *XGetMotionEvents(
register Display *dpy; register Display *dpy,
Time start, stop; Window w,
Window w; Time start,
int *nEvents; /* RETURN */ Time stop,
int *nEvents) /* RETURN */
{ {
xGetMotionEventsReply rep; xGetMotionEventsReply rep;
register xGetMotionEventsReq *req; register xGetMotionEventsReq *req;
......
...@@ -60,12 +60,12 @@ from The Open Group. ...@@ -60,12 +60,12 @@ from The Open Group.
#include <nx-X11/Xutil.h> #include <nx-X11/Xutil.h>
#include <stdio.h> #include <stdio.h>
Status XGetWMSizeHints (dpy, w, hints, supplied, property) Status XGetWMSizeHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
long *supplied; long *supplied,
Atom property; Atom property)
{ {
xPropSizeHints *prop = NULL; xPropSizeHints *prop = NULL;
Atom actual_type; Atom actual_type;
...@@ -117,11 +117,11 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property) ...@@ -117,11 +117,11 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property)
} }
Status XGetWMNormalHints (dpy, w, hints, supplied) Status XGetWMNormalHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
long *supplied; long *supplied)
{ {
return (XGetWMSizeHints (dpy, w, hints, supplied, XA_WM_NORMAL_HINTS)); return (XGetWMSizeHints (dpy, w, hints, supplied, XA_WM_NORMAL_HINTS));
} }
...@@ -30,11 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetPointerControl(dpy, accel_numer, accel_denom, threshold) XGetPointerControl(
register Display *dpy; register Display *dpy,
/* the following are return only vars */ /* the following are return only vars */
int *accel_numer, *accel_denom; int *accel_numer,
int *threshold; int *accel_denom,
int *threshold)
{ {
xGetPointerControlReply rep; xGetPointerControlReply rep;
xReq *req; xReq *req;
......
...@@ -35,10 +35,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,10 +35,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b))
int XGetPointerMapping (dpy, map, nmaps) int XGetPointerMapping (
register Display *dpy; register Display *dpy,
unsigned char *map; /* RETURN */ unsigned char *map, /* RETURN */
int nmaps; int nmaps)
{ {
unsigned char mapping[256]; /* known fixed size */ unsigned char mapping[256]; /* known fixed size */
......
...@@ -30,19 +30,19 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,19 +30,19 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetWindowProperty(dpy, w, property, offset, length, delete, XGetWindowProperty(
req_type, actual_type, actual_format, nitems, bytesafter, prop) register Display *dpy,
register Display *dpy; Window w,
Window w; Atom property,
Atom property; long offset,
Bool delete; long length,
Atom req_type; Bool delete,
Atom *actual_type; /* RETURN */ Atom req_type,
int *actual_format; /* RETURN 8, 16, or 32 */ Atom *actual_type, /* RETURN */
long offset, length; int *actual_format, /* RETURN 8, 16, or 32 */
unsigned long *nitems; /* RETURN # of 8-, 16-, or 32-bit entities */ unsigned long *nitems, /* RETURN # of 8-, 16-, or 32-bit entities */
unsigned long *bytesafter; /* RETURN */ unsigned long *bytesafter, /* RETURN */
unsigned char **prop; /* RETURN */ unsigned char **prop) /* RETURN */
{ {
xGetPropertyReply reply; xGetPropertyReply reply;
register xGetPropertyReq *req; register xGetPropertyReq *req;
......
...@@ -35,12 +35,12 @@ from The Open Group. ...@@ -35,12 +35,12 @@ from The Open Group.
#include "Xatomtype.h" #include "Xatomtype.h"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
Status XGetRGBColormaps (dpy, w, stdcmap, count, property) Status XGetRGBColormaps (
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap **stdcmap; /* RETURN */ XStandardColormap **stdcmap, /* RETURN */
int *count; /* RETURN */ int *count, /* RETURN */
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
register int i; /* iterator variable */ register int i; /* iterator variable */
xPropStandardColormap *data = NULL; /* data read in from prop */ xPropStandardColormap *data = NULL; /* data read in from prop */
......
...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Window XGetSelectionOwner(dpy, selection) Window XGetSelectionOwner(
register Display *dpy; register Display *dpy,
Atom selection; Atom selection)
{ {
xGetSelectionOwnerReply rep; xGetSelectionOwnerReply rep;
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetScreenSaver(dpy, timeout, interval, prefer_blanking, allow_exp) XGetScreenSaver(
register Display *dpy; register Display *dpy,
/* the following are return only vars */ /* the following are return only vars */
int *timeout, *interval; int *timeout,
int *prefer_blanking, *allow_exp; /*boolean */ int *interval,
int *prefer_blanking,
int *allow_exp) /*boolean */
{ {
xGetScreenSaverReply rep; xGetScreenSaverReply rep;
......
...@@ -61,11 +61,11 @@ SOFTWARE. ...@@ -61,11 +61,11 @@ SOFTWARE.
* in the XStandardColormap structure. * in the XStandardColormap structure.
*/ */
Status XGetStandardColormap (dpy, w, cmap, property) Status XGetStandardColormap (
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap *cmap; XStandardColormap *cmap,
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
Status stat; /* return value */ Status stat; /* return value */
XStandardColormap *stdcmaps; /* will get malloced value */ XStandardColormap *stdcmaps; /* will get malloced value */
......
...@@ -57,11 +57,11 @@ from The Open Group. ...@@ -57,11 +57,11 @@ from The Open Group.
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
#include <stdio.h> #include <stdio.h>
Status XGetTextProperty (display, window, tp, property) Status XGetTextProperty (
Display *display; Display *display,
Window window; Window window,
XTextProperty *tp; XTextProperty *tp,
Atom property; Atom property)
{ {
Atom actual_type; Atom actual_type;
int actual_format = 0; int actual_format = 0;
...@@ -87,26 +87,26 @@ Status XGetTextProperty (display, window, tp, property) ...@@ -87,26 +87,26 @@ Status XGetTextProperty (display, window, tp, property)
return False; return False;
} }
Status XGetWMName (dpy, w, tp) Status XGetWMName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
return (XGetTextProperty (dpy, w, tp, XA_WM_NAME)); return (XGetTextProperty (dpy, w, tp, XA_WM_NAME));
} }
Status XGetWMIconName (dpy, w, tp) Status XGetWMIconName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
return (XGetTextProperty (dpy, w, tp, XA_WM_ICON_NAME)); return (XGetTextProperty (dpy, w, tp, XA_WM_ICON_NAME));
} }
Status XGetWMClientMachine (dpy, w, tp) Status XGetWMClientMachine (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
return (XGetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE)); return (XGetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE));
} }
......
...@@ -53,11 +53,11 @@ SOFTWARE. ...@@ -53,11 +53,11 @@ SOFTWARE.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <stdio.h> #include <stdio.h>
Status XGetWMColormapWindows (dpy, w, colormapWindows, countReturn) Status XGetWMColormapWindows (
Display *dpy; Display *dpy,
Window w; Window w,
Window **colormapWindows; Window **colormapWindows,
int *countReturn; int *countReturn)
{ {
Atom *data = NULL; Atom *data = NULL;
Atom actual_type; Atom actual_type;
......
...@@ -53,11 +53,11 @@ SOFTWARE. ...@@ -53,11 +53,11 @@ SOFTWARE.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <stdio.h> #include <stdio.h>
Status XGetWMProtocols (dpy, w, protocols, countReturn) Status XGetWMProtocols (
Display *dpy; Display *dpy,
Window w; Window w,
Atom **protocols; Atom **protocols,
int *countReturn; int *countReturn)
{ {
Atom *data = NULL; Atom *data = NULL;
Atom actual_type; Atom actual_type;
......
...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGrabButton(dpy, button, modifiers, grab_window, owner_events, event_mask, XGrabButton(
pointer_mode, keyboard_mode, confine_to, curs) register Display *dpy,
register Display *dpy; unsigned int button, /* CARD8 */
unsigned int modifiers; /* CARD16 */ unsigned int modifiers, /* CARD16 */
unsigned int button; /* CARD8 */ Window grab_window,
Window grab_window; Bool owner_events,
Bool owner_events; unsigned int event_mask, /* CARD16 */
unsigned int event_mask; /* CARD16 */ int pointer_mode,
int pointer_mode, keyboard_mode; int keyboard_mode,
Window confine_to; Window confine_to,
Cursor curs; Cursor curs)
{ {
register xGrabButtonReq *req; register xGrabButtonReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -30,14 +30,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,14 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGrabKey(dpy, key, modifiers, grab_window, owner_events, XGrabKey(
pointer_mode, keyboard_mode) register Display *dpy,
register Display *dpy; int key,
int key; unsigned int modifiers,
unsigned int modifiers; Window grab_window,
Window grab_window; Bool owner_events,
Bool owner_events; int pointer_mode,
int pointer_mode, keyboard_mode; int keyboard_mode)
{ {
register xGrabKeyReq *req; register xGrabKeyReq *req;
......
...@@ -28,12 +28,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -28,12 +28,13 @@ in this Software without prior written authorization from The Open Group.
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
int XGrabKeyboard (dpy, window, ownerEvents, pointerMode, keyboardMode, time) int XGrabKeyboard (
register Display *dpy; register Display *dpy,
Window window; Window window,
Bool ownerEvents; Bool ownerEvents,
int pointerMode, keyboardMode; int pointerMode,
Time time; int keyboardMode,
Time time)
{ {
xGrabKeyboardReply rep; xGrabKeyboardReply rep;
register xGrabKeyboardReq *req; register xGrabKeyboardReq *req;
......
...@@ -29,16 +29,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,16 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
int XGrabPointer(dpy, grab_window, owner_events, event_mask, pointer_mode, int XGrabPointer(
keyboard_mode, confine_to, curs, time) register Display *dpy,
register Display *dpy; Window grab_window,
Window grab_window; Bool owner_events,
Bool owner_events; unsigned int event_mask, /* CARD16 */
unsigned int event_mask; /* CARD16 */ int pointer_mode,
int pointer_mode, keyboard_mode; int keyboard_mode,
Window confine_to; Window confine_to,
Cursor curs; Cursor curs,
Time time; Time time)
{ {
xGrabPointerReply rep; xGrabPointerReply rep;
register xGrabPointerReq *req; register xGrabPointerReq *req;
......
...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGrabServer (dpy) XGrabServer (register Display *dpy)
register Display *dpy;
{ {
register xReq *req; register xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
/* /*
Copyright 1986, 1998 The Open Group Copyright 1986, 1998 The Open Group
Copyright 2004 Sun Microsystems, Inc.
All rights reserved. All rights reserved.
...@@ -34,6 +33,30 @@ X Window System is a trademark of The Open Group. ...@@ -34,6 +33,30 @@ X Window System is a trademark of The Open Group.
*/ */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/* this might be rightly regarded an os dependent file */ /* this might be rightly regarded an os dependent file */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
......
...@@ -62,10 +62,10 @@ from The Open Group. ...@@ -62,10 +62,10 @@ from The Open Group.
* This function instructs the window manager to change this window from * This function instructs the window manager to change this window from
* NormalState to IconicState. * NormalState to IconicState.
*/ */
Status XIconifyWindow (dpy, w, screen) Status XIconifyWindow (
Display *dpy; Display *dpy,
Window w; Window w,
int screen; int screen)
{ {
XClientMessageEvent ev; XClientMessageEvent ev;
Window root = RootWindow (dpy, screen); Window root = RootWindow (dpy, screen);
......
...@@ -305,20 +305,19 @@ void _XInitImageFuncPtrs ( ...@@ -305,20 +305,19 @@ void _XInitImageFuncPtrs (
* *
*/ */
XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, XImage *XCreateImage (
xpad, image_bytes_per_line) register Display *dpy,
register Display *dpy; register Visual *visual,
register Visual *visual; unsigned int depth,
unsigned int depth; int format,
int format; int offset, /*How many pixels from the start of the data does the
int offset; /*How many pixels from the start of the data does the
picture to be transmitted start?*/ picture to be transmitted start?*/
char *data; char *data,
unsigned int width; unsigned int width,
unsigned int height; unsigned int height,
int xpad; int xpad,
int image_bytes_per_line; int image_bytes_per_line)
/*How many bytes between a pixel on one line and the pixel with /*How many bytes between a pixel on one line and the pixel with
the same X coordinate on the next line? 0 means the same X coordinate on the next line? 0 means
XCreateImage can calculate it.*/ XCreateImage can calculate it.*/
...@@ -373,7 +372,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, ...@@ -373,7 +372,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height,
if (image_bytes_per_line == 0) { if (image_bytes_per_line == 0) {
image->bytes_per_line = min_bytes_per_line; image->bytes_per_line = min_bytes_per_line;
} else if (image_bytes_per_line < min_bytes_per_line) { } else if (image_bytes_per_line < min_bytes_per_line) {
return 0; return NULL;
} else { } else {
image->bytes_per_line = image_bytes_per_line; image->bytes_per_line = image_bytes_per_line;
} }
...@@ -385,8 +384,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, ...@@ -385,8 +384,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height,
return image; return image;
} }
Status XInitImage (image) Status XInitImage (XImage *image)
XImage *image;
{ {
int min_bytes_per_line; int min_bytes_per_line;
...@@ -433,9 +431,7 @@ Status XInitImage (image) ...@@ -433,9 +431,7 @@ Status XInitImage (image)
* entirely by the library. * entirely by the library.
*/ */
static int _XDestroyImage (ximage) static int _XDestroyImage (XImage *ximage)
XImage *ximage;
{ {
if (ximage->data != NULL) Xfree((char *)ximage->data); if (ximage->data != NULL) Xfree((char *)ximage->data);
if (ximage->obdata != NULL) Xfree((char *)ximage->obdata); if (ximage->obdata != NULL) Xfree((char *)ximage->obdata);
...@@ -470,10 +466,10 @@ static unsigned long const low_bits_table[] = { ...@@ -470,10 +466,10 @@ static unsigned long const low_bits_table[] = {
0xffffffff 0xffffffff
}; };
static unsigned long _XGetPixel (ximage, x, y) static unsigned long _XGetPixel (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
unsigned long pixel, px; unsigned long pixel, px;
...@@ -533,10 +529,10 @@ static unsigned long _XGetPixel (ximage, x, y) ...@@ -533,10 +529,10 @@ static unsigned long _XGetPixel (ximage, x, y)
static CARD32 const byteorderpixel = MSBFirst << 24; static CARD32 const byteorderpixel = MSBFirst << 24;
static unsigned long _XGetPixel32 (ximage, x, y) static unsigned long _XGetPixel32 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
register unsigned char *addr; register unsigned char *addr;
unsigned long pixel; unsigned long pixel;
...@@ -566,10 +562,10 @@ static unsigned long _XGetPixel32 (ximage, x, y) ...@@ -566,10 +562,10 @@ static unsigned long _XGetPixel32 (ximage, x, y)
} }
} }
static unsigned long _XGetPixel16 (ximage, x, y) static unsigned long _XGetPixel16 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
register unsigned char *addr; register unsigned char *addr;
unsigned long pixel; unsigned long pixel;
...@@ -590,10 +586,10 @@ static unsigned long _XGetPixel16 (ximage, x, y) ...@@ -590,10 +586,10 @@ static unsigned long _XGetPixel16 (ximage, x, y)
} }
} }
static unsigned long _XGetPixel8 (ximage, x, y) static unsigned long _XGetPixel8 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
unsigned char pixel; unsigned char pixel;
...@@ -609,10 +605,10 @@ static unsigned long _XGetPixel8 (ximage, x, y) ...@@ -609,10 +605,10 @@ static unsigned long _XGetPixel8 (ximage, x, y)
} }
} }
static unsigned long _XGetPixel1 (ximage, x, y) static unsigned long _XGetPixel1 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
unsigned char bit; unsigned char bit;
int xoff, yoff; int xoff, yoff;
...@@ -649,11 +645,11 @@ static unsigned long _XGetPixel1 (ximage, x, y) ...@@ -649,11 +645,11 @@ static unsigned long _XGetPixel1 (ximage, x, y)
* *
*/ */
static int _XPutPixel (ximage, x, y, pixel) static int _XPutPixel (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned long px, npixel; unsigned long px, npixel;
...@@ -722,11 +718,11 @@ static int _XPutPixel (ximage, x, y, pixel) ...@@ -722,11 +718,11 @@ static int _XPutPixel (ximage, x, y, pixel)
return 1; return 1;
} }
static int _XPutPixel32 (ximage, x, y, pixel) static int _XPutPixel32 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned char *addr; unsigned char *addr;
...@@ -754,11 +750,11 @@ static int _XPutPixel32 (ximage, x, y, pixel) ...@@ -754,11 +750,11 @@ static int _XPutPixel32 (ximage, x, y, pixel)
} }
} }
static int _XPutPixel16 (ximage, x, y, pixel) static int _XPutPixel16 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned char *addr; unsigned char *addr;
...@@ -779,11 +775,11 @@ static int _XPutPixel16 (ximage, x, y, pixel) ...@@ -779,11 +775,11 @@ static int _XPutPixel16 (ximage, x, y, pixel)
} }
} }
static int _XPutPixel8 (ximage, x, y, pixel) static int _XPutPixel8 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 8)) { if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 8)) {
ximage->data[y * ximage->bytes_per_line + x] = pixel; ximage->data[y * ximage->bytes_per_line + x] = pixel;
...@@ -794,11 +790,11 @@ static int _XPutPixel8 (ximage, x, y, pixel) ...@@ -794,11 +790,11 @@ static int _XPutPixel8 (ximage, x, y, pixel)
} }
} }
static int _XPutPixel1 (ximage, x, y, pixel) static int _XPutPixel1 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned char bit; unsigned char bit;
int xoff, yoff; int xoff, yoff;
...@@ -833,12 +829,12 @@ static int _XPutPixel1 (ximage, x, y, pixel) ...@@ -833,12 +829,12 @@ static int _XPutPixel1 (ximage, x, y, pixel)
* *
*/ */
static XImage *_XSubImage (ximage, x, y, width, height) static XImage *_XSubImage (
XImage *ximage; XImage *ximage,
register int x; /* starting x coordinate in existing image */ register int x, /* starting x coordinate in existing image */
register int y; /* starting y coordinate in existing image */ register int y, /* starting y coordinate in existing image */
unsigned int width; /* width in pixels of new subimage */ unsigned int width, /* width in pixels of new subimage */
unsigned int height;/* height in pixels of new subimage */ unsigned int height)/* height in pixels of new subimage */
{ {
register XImage *subimage; register XImage *subimage;
...@@ -965,9 +961,9 @@ int _XSetImage( ...@@ -965,9 +961,9 @@ int _XSetImage(
*/ */
static int static int
_XAddPixel (ximage, value) _XAddPixel (
register XImage *ximage; register XImage *ximage,
register long value; register long value)
{ {
register int x; register int x;
register int y; register int y;
......
...@@ -90,6 +90,12 @@ NX_XCOMPEXTCONFIGTARGET = $(NX_XCOMPEXTLIBDIR)/config.status ...@@ -90,6 +90,12 @@ NX_XCOMPEXTCONFIGTARGET = $(NX_XCOMPEXTLIBDIR)/config.status
SUBDIRS = xlibi18n SUBDIRS = xlibi18n
#endif #endif
/*
FIXME: This is switchable upstream via configure option, we leave it
on for now as this is the upstream default.
*/
XCMS_DEFINES = -DXCMS
#include <Threads.tmpl> #include <Threads.tmpl>
#ifndef MotifBC #ifndef MotifBC
...@@ -187,7 +193,7 @@ XCURSOR_DEFINES = -DUSE_DYNAMIC_XCURSOR -DLIBXCURSOR=\"libXcursor.so.$(SOXCURSOR ...@@ -187,7 +193,7 @@ XCURSOR_DEFINES = -DUSE_DYNAMIC_XCURSOR -DLIBXCURSOR=\"libXcursor.so.$(SOXCURSOR
POSTLOCALELIBDEFINES = -DPOSTLOCALELIBDIR=\"$(POSTLOCALELIBDIR)\" POSTLOCALELIBDEFINES = -DPOSTLOCALELIBDIR=\"$(POSTLOCALELIBDIR)\"
#endif #endif
DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(MISC_DEFINES)\ DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(MISC_DEFINES)\
$(POSTLOCALELIBDEFINES) $(NX_INCLUDES) $(NX_DEFINES) $(POSTLOCALELIBDEFINES) $(NX_INCLUDES) $(NX_DEFINES) ${XCMS_DEFINES}
OPEN_DEFINES = -I$(EXTINCSRC) $(K5INCL) $(K5DEFS) OPEN_DEFINES = -I$(EXTINCSRC) $(K5INCL) $(K5DEFS)
DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) DependDefines DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) DependDefines
AUTHOBJS = AuDispose.o AuGetBest.o AuFileName.o AuRead.o AUTHOBJS = AuDispose.o AuGetBest.o AuFileName.o AuRead.o
......
...@@ -67,8 +67,7 @@ XExtCodes *XInitExtension ( ...@@ -67,8 +67,7 @@ XExtCodes *XInitExtension (
return (&ext->codes); /* tell him which extension */ return (&ext->codes); /* tell him which extension */
} }
XExtCodes *XAddExtension (dpy) XExtCodes *XAddExtension (Display *dpy)
Display *dpy;
{ {
register _XExtension *ext; register _XExtension *ext;
...@@ -97,25 +96,24 @@ static _XExtension *XLookupExtension ( ...@@ -97,25 +96,24 @@ static _XExtension *XLookupExtension (
return (NULL); return (NULL);
} }
XExtData **XEHeadOfExtensionList(object) XExtData **XEHeadOfExtensionList(XEDataObject object)
XEDataObject object;
{ {
return *(XExtData ***)&object; return *(XExtData ***)&object;
} }
int int
XAddToExtensionList(structure, ext_data) XAddToExtensionList(
XExtData **structure; XExtData **structure,
XExtData *ext_data; XExtData *ext_data)
{ {
ext_data->next = *structure; ext_data->next = *structure;
*structure = ext_data; *structure = ext_data;
return 1; return 1;
} }
XExtData *XFindOnExtensionList(structure, number) XExtData *XFindOnExtensionList(
XExtData **structure; XExtData **structure,
int number; int number)
{ {
XExtData *ext; XExtData *ext;
...@@ -128,10 +126,10 @@ XExtData *XFindOnExtensionList(structure, number) ...@@ -128,10 +126,10 @@ XExtData *XFindOnExtensionList(structure, number)
/* /*
* Routines to hang procs on the extension structure. * Routines to hang procs on the extension structure.
*/ */
CreateGCType XESetCreateGC(dpy, extension, proc) CreateGCType XESetCreateGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CreateGCType proc; /* routine to call when GC created */ CreateGCType proc) /* routine to call when GC created */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CreateGCType oldproc; register CreateGCType oldproc;
...@@ -143,10 +141,10 @@ CreateGCType XESetCreateGC(dpy, extension, proc) ...@@ -143,10 +141,10 @@ CreateGCType XESetCreateGC(dpy, extension, proc)
return (CreateGCType)oldproc; return (CreateGCType)oldproc;
} }
CopyGCType XESetCopyGC(dpy, extension, proc) CopyGCType XESetCopyGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CopyGCType proc; /* routine to call when GC copied */ CopyGCType proc) /* routine to call when GC copied */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CopyGCType oldproc; register CopyGCType oldproc;
...@@ -158,10 +156,10 @@ CopyGCType XESetCopyGC(dpy, extension, proc) ...@@ -158,10 +156,10 @@ CopyGCType XESetCopyGC(dpy, extension, proc)
return (CopyGCType)oldproc; return (CopyGCType)oldproc;
} }
FlushGCType XESetFlushGC(dpy, extension, proc) FlushGCType XESetFlushGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
FlushGCType proc; /* routine to call when GC copied */ FlushGCType proc) /* routine to call when GC copied */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register FlushGCType oldproc; register FlushGCType oldproc;
...@@ -173,10 +171,10 @@ FlushGCType XESetFlushGC(dpy, extension, proc) ...@@ -173,10 +171,10 @@ FlushGCType XESetFlushGC(dpy, extension, proc)
return (FlushGCType)oldproc; return (FlushGCType)oldproc;
} }
FreeGCType XESetFreeGC(dpy, extension, proc) FreeGCType XESetFreeGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
FreeGCType proc; /* routine to call when GC freed */ FreeGCType proc) /* routine to call when GC freed */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register FreeGCType oldproc; register FreeGCType oldproc;
...@@ -188,10 +186,10 @@ FreeGCType XESetFreeGC(dpy, extension, proc) ...@@ -188,10 +186,10 @@ FreeGCType XESetFreeGC(dpy, extension, proc)
return (FreeGCType)oldproc; return (FreeGCType)oldproc;
} }
CreateFontType XESetCreateFont(dpy, extension, proc) CreateFontType XESetCreateFont(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CreateFontType proc; /* routine to call when font created */ CreateFontType proc) /* routine to call when font created */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CreateFontType oldproc; register CreateFontType oldproc;
...@@ -203,10 +201,10 @@ CreateFontType XESetCreateFont(dpy, extension, proc) ...@@ -203,10 +201,10 @@ CreateFontType XESetCreateFont(dpy, extension, proc)
return (CreateFontType)oldproc; return (CreateFontType)oldproc;
} }
FreeFontType XESetFreeFont(dpy, extension, proc) FreeFontType XESetFreeFont(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
FreeFontType proc; /* routine to call when font freed */ FreeFontType proc) /* routine to call when font freed */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register FreeFontType oldproc; register FreeFontType oldproc;
...@@ -218,10 +216,10 @@ FreeFontType XESetFreeFont(dpy, extension, proc) ...@@ -218,10 +216,10 @@ FreeFontType XESetFreeFont(dpy, extension, proc)
return (FreeFontType)oldproc; return (FreeFontType)oldproc;
} }
CloseDisplayType XESetCloseDisplay(dpy, extension, proc) CloseDisplayType XESetCloseDisplay(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CloseDisplayType proc; /* routine to call when display closed */ CloseDisplayType proc) /* routine to call when display closed */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CloseDisplayType oldproc; register CloseDisplayType oldproc;
...@@ -239,10 +237,10 @@ typedef Bool (*WireToEventType) ( ...@@ -239,10 +237,10 @@ typedef Bool (*WireToEventType) (
xEvent* /* event */ xEvent* /* event */
); );
WireToEventType XESetWireToEvent(dpy, event_number, proc) WireToEventType XESetWireToEvent(
Display *dpy; /* display */ Display *dpy, /* display */
WireToEventType proc; /* routine to call when converting event */ int event_number, /* event routine to replace */
int event_number; /* event routine to replace */ WireToEventType proc) /* routine to call when converting event */
{ {
register WireToEventType oldproc; register WireToEventType oldproc;
if (proc == NULL) proc = (WireToEventType)_XUnknownWireEvent; if (proc == NULL) proc = (WireToEventType)_XUnknownWireEvent;
...@@ -253,16 +251,59 @@ WireToEventType XESetWireToEvent(dpy, event_number, proc) ...@@ -253,16 +251,59 @@ WireToEventType XESetWireToEvent(dpy, event_number, proc)
return (WireToEventType)oldproc; return (WireToEventType)oldproc;
} }
typedef Bool (*WireToEventCookieType) (
Display* /* display */,
XGenericEventCookie* /* re */,
xEvent* /* event */
);
WireToEventCookieType XESetWireToEventCookie(
Display *dpy, /* display */
int extension, /* extension major opcode */
WireToEventCookieType proc /* routine to call for generic events */
)
{
WireToEventCookieType oldproc;
if (proc == NULL) proc = (WireToEventCookieType)_XUnknownWireEventCookie;
LockDisplay (dpy);
oldproc = dpy->generic_event_vec[extension & 0x7F];
dpy->generic_event_vec[extension & 0x7F] = proc;
UnlockDisplay (dpy);
return (WireToEventCookieType)oldproc;
}
typedef Bool (*CopyEventCookieType) (
Display* /* display */,
XGenericEventCookie* /* in */,
XGenericEventCookie* /* out */
);
CopyEventCookieType XESetCopyEventCookie(
Display *dpy, /* display */
int extension, /* extension major opcode */
CopyEventCookieType proc /* routine to copy generic events */
)
{
CopyEventCookieType oldproc;
if (proc == NULL) proc = (CopyEventCookieType)_XUnknownCopyEventCookie;
LockDisplay (dpy);
oldproc = dpy->generic_event_copy_vec[extension & 0x7F];
dpy->generic_event_copy_vec[extension & 0x7F] = proc;
UnlockDisplay (dpy);
return (CopyEventCookieType)oldproc;
}
typedef Status (*EventToWireType) ( typedef Status (*EventToWireType) (
Display* /* display */, Display* /* display */,
XEvent* /* re */, XEvent* /* re */,
xEvent* /* event */ xEvent* /* event */
); );
EventToWireType XESetEventToWire(dpy, event_number, proc) EventToWireType XESetEventToWire(
Display *dpy; /* display */ Display *dpy, /* display */
EventToWireType proc; /* routine to call when converting event */ int event_number, /* event routine to replace */
int event_number; /* event routine to replace */ EventToWireType proc) /* routine to call when converting event */
{ {
register EventToWireType oldproc; register EventToWireType oldproc;
if (proc == NULL) proc = (EventToWireType) _XUnknownNativeEvent; if (proc == NULL) proc = (EventToWireType) _XUnknownNativeEvent;
...@@ -279,10 +320,10 @@ typedef Bool (*WireToErrorType) ( ...@@ -279,10 +320,10 @@ typedef Bool (*WireToErrorType) (
xError* /* we */ xError* /* we */
); );
WireToErrorType XESetWireToError(dpy, error_number, proc) WireToErrorType XESetWireToError(
Display *dpy; /* display */ Display *dpy, /* display */
WireToErrorType proc; /* routine to call when converting error */ int error_number, /* error routine to replace */
int error_number; /* error routine to replace */ WireToErrorType proc) /* routine to call when converting error */
{ {
register WireToErrorType oldproc = NULL; register WireToErrorType oldproc = NULL;
if (proc == NULL) proc = (WireToErrorType)_XDefaultWireError; if (proc == NULL) proc = (WireToErrorType)_XDefaultWireError;
...@@ -301,10 +342,10 @@ WireToErrorType XESetWireToError(dpy, error_number, proc) ...@@ -301,10 +342,10 @@ WireToErrorType XESetWireToError(dpy, error_number, proc)
return (WireToErrorType)oldproc; return (WireToErrorType)oldproc;
} }
ErrorType XESetError(dpy, extension, proc) ErrorType XESetError(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
ErrorType proc; /* routine to call when X error happens */ ErrorType proc) /* routine to call when X error happens */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register ErrorType oldproc; register ErrorType oldproc;
...@@ -316,10 +357,10 @@ ErrorType XESetError(dpy, extension, proc) ...@@ -316,10 +357,10 @@ ErrorType XESetError(dpy, extension, proc)
return (ErrorType)oldproc; return (ErrorType)oldproc;
} }
ErrorStringType XESetErrorString(dpy, extension, proc) ErrorStringType XESetErrorString(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
ErrorStringType proc; /* routine to call when I/O error happens */ ErrorStringType proc) /* routine to call when I/O error happens */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register ErrorStringType oldproc; register ErrorStringType oldproc;
...@@ -331,10 +372,10 @@ ErrorStringType XESetErrorString(dpy, extension, proc) ...@@ -331,10 +372,10 @@ ErrorStringType XESetErrorString(dpy, extension, proc)
return (ErrorStringType)oldproc; return (ErrorStringType)oldproc;
} }
PrintErrorType XESetPrintErrorValues(dpy, extension, proc) PrintErrorType XESetPrintErrorValues(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
PrintErrorType proc; /* routine to call to print */ PrintErrorType proc) /* routine to call to print */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register PrintErrorType oldproc; register PrintErrorType oldproc;
...@@ -346,10 +387,10 @@ PrintErrorType XESetPrintErrorValues(dpy, extension, proc) ...@@ -346,10 +387,10 @@ PrintErrorType XESetPrintErrorValues(dpy, extension, proc)
return (PrintErrorType)oldproc; return (PrintErrorType)oldproc;
} }
BeforeFlushType XESetBeforeFlush(dpy, extension, proc) BeforeFlushType XESetBeforeFlush(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
BeforeFlushType proc; /* routine to call on flush */ BeforeFlushType proc) /* routine to call on flush */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register BeforeFlushType oldproc; register BeforeFlushType oldproc;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XInstallColormap(dpy, cmap) XInstallColormap(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -37,8 +37,7 @@ from The Open Group. ...@@ -37,8 +37,7 @@ from The Open Group.
#define REHASH(idx,rehash) ((idx + rehash) & (TABLESIZE-1)) #define REHASH(idx,rehash) ((idx + rehash) & (TABLESIZE-1))
void void
_XFreeAtomTable(dpy) _XFreeAtomTable(Display *dpy)
Display *dpy;
{ {
register Entry *table; register Entry *table;
register int i; register int i;
...@@ -113,13 +112,13 @@ nomatch: if (idx == firstidx) ...@@ -113,13 +112,13 @@ nomatch: if (idx == firstidx)
} }
void void
_XUpdateAtomCache(dpy, name, atom, sig, idx, n) _XUpdateAtomCache(
Display *dpy; Display *dpy,
const char *name; const char *name,
Atom atom; Atom atom,
unsigned long sig; unsigned long sig,
int idx; int idx,
int n; int n)
{ {
Entry e, oe; Entry e, oe;
register char *s1; register char *s1;
...@@ -238,12 +237,12 @@ Bool _XIntAtomHandler( ...@@ -238,12 +237,12 @@ Bool _XIntAtomHandler(
} }
Status Status
XInternAtoms (dpy, names, count, onlyIfExists, atoms_return) XInternAtoms (
Display *dpy; Display *dpy,
char **names; char **names,
int count; int count,
Bool onlyIfExists; Bool onlyIfExists,
Atom *atoms_return; Atom *atoms_return)
{ {
int i, idx, n, tidx; int i, idx, n, tidx;
unsigned long sig; unsigned long sig;
......
/* $XFree86$ */
#ifndef _KEY_H_ #ifndef _KEY_H_
#define _KEY_H_ #define _KEY_H_
......
...@@ -133,9 +133,9 @@ XKeycodeToKeysym(Display *dpy, ...@@ -133,9 +133,9 @@ XKeycodeToKeysym(Display *dpy,
} }
KeyCode KeyCode
XKeysymToKeycode(dpy, ks) XKeysymToKeycode(
Display *dpy; Display *dpy,
KeySym ks; KeySym ks)
{ {
register int i, j; register int i, j;
...@@ -151,9 +151,9 @@ XKeysymToKeycode(dpy, ks) ...@@ -151,9 +151,9 @@ XKeysymToKeycode(dpy, ks)
} }
KeySym KeySym
XLookupKeysym(event, col) XLookupKeysym(
register XKeyEvent *event; register XKeyEvent *event,
int col; int col)
{ {
if ((! event->display->keysyms) && (! _XKeyInitialize(event->display))) if ((! event->display->keysyms) && (! _XKeyInitialize(event->display)))
return NoSymbol; return NoSymbol;
...@@ -229,8 +229,7 @@ InitModMap( ...@@ -229,8 +229,7 @@ InitModMap(
} }
int int
XRefreshKeyboardMapping(event) XRefreshKeyboardMapping(register XMappingEvent *event)
register XMappingEvent *event;
{ {
if(event->request == MappingKeyboard) { if(event->request == MappingKeyboard) {
...@@ -642,10 +641,10 @@ UCSConvertCase( register unsigned code, ...@@ -642,10 +641,10 @@ UCSConvertCase( register unsigned code,
} }
void void
XConvertCase(sym, lower, upper) XConvertCase(
register KeySym sym; register KeySym sym,
KeySym *lower; KeySym *lower,
KeySym *upper; KeySym *upper)
{ {
/* Latin 1 keysym */ /* Latin 1 keysym */
if (sym < 0x100) { if (sym < 0x100) {
...@@ -817,12 +816,12 @@ _XTranslateKey( register Display *dpy, ...@@ -817,12 +816,12 @@ _XTranslateKey( register Display *dpy,
} }
int int
_XTranslateKeySym(dpy, symbol, modifiers, buffer, nbytes) _XTranslateKeySym(
Display *dpy; Display *dpy,
register KeySym symbol; register KeySym symbol,
unsigned int modifiers; unsigned int modifiers,
char *buffer; char *buffer,
int nbytes; int nbytes)
{ {
register struct _XKeytrans *p; register struct _XKeytrans *p;
int length; int length;
...@@ -877,12 +876,12 @@ _XTranslateKeySym(dpy, symbol, modifiers, buffer, nbytes) ...@@ -877,12 +876,12 @@ _XTranslateKeySym(dpy, symbol, modifiers, buffer, nbytes)
/*ARGSUSED*/ /*ARGSUSED*/
int int
XLookupString (event, buffer, nbytes, keysym, status) XLookupString (
register XKeyEvent *event; register XKeyEvent *event,
char *buffer; /* buffer */ char *buffer, /* buffer */
int nbytes; /* space in buffer for characters */ int nbytes, /* space in buffer for characters */
KeySym *keysym; KeySym *keysym,
XComposeStatus *status; /* not implemented */ XComposeStatus *status) /* not implemented */
{ {
unsigned int modifiers; unsigned int modifiers;
KeySym symbol; KeySym symbol;
......
...@@ -69,8 +69,7 @@ SameValue( ...@@ -69,8 +69,7 @@ SameValue(
return False; return False;
} }
char *XKeysymToString(ks) char *XKeysymToString(KeySym ks)
KeySym ks;
{ {
register int i, n; register int i, n;
int h; int h;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XKillClient(dpy, resource) XKillClient(
register Display *dpy; register Display *dpy,
XID resource; XID resource)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
/* /*
Copyright 1986, 1998 The Open Group Copyright 1986, 1998 The Open Group
Copyright 2004 Sun Microsystems, Inc.
All rights reserved. All rights reserved.
...@@ -34,8 +33,32 @@ X Window System is a trademark of The Open Group. ...@@ -34,8 +33,32 @@ X Window System is a trademark of The Open Group.
*/ */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/* This can really be considered an os dependent routine */ /* This can really be considered an os dependent routine */
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
...@@ -49,7 +72,7 @@ XHostAddress *XListHosts ( ...@@ -49,7 +72,7 @@ XHostAddress *XListHosts (
int *nhosts, /* RETURN */ int *nhosts, /* RETURN */
Bool *enabled) /* RETURN */ Bool *enabled) /* RETURN */
{ {
register XHostAddress *outbuf = 0, *op; register XHostAddress *outbuf = NULL, *op;
xListHostsReply reply; xListHostsReply reply;
long nbytes; long nbytes;
unsigned char *buf, *bp; unsigned char *buf, *bp;
...@@ -69,6 +92,7 @@ XHostAddress *XListHosts ( ...@@ -69,6 +92,7 @@ XHostAddress *XListHosts (
if (reply.nHosts) { if (reply.nHosts) {
nbytes = reply.length << 2; /* compute number of bytes in reply */ nbytes = reply.length << 2; /* compute number of bytes in reply */
op = outbuf = (XHostAddress *) op = outbuf = (XHostAddress *)
Xmalloc((unsigned) (nbytes + Xmalloc((unsigned) (nbytes +
(reply.nHosts * sizeof(XHostAddress)) + (reply.nHosts * sizeof(XHostAddress)) +
...@@ -123,4 +147,3 @@ XHostAddress *XListHosts ( ...@@ -123,4 +147,3 @@ XHostAddress *XListHosts (
...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Colormap *XListInstalledColormaps(dpy, win, n) Colormap *XListInstalledColormaps(
register Display *dpy; register Display *dpy,
Window win; Window win,
int *n; /* RETURN */ int *n) /* RETURN */
{ {
long nbytes; long nbytes;
Colormap *cmaps; Colormap *cmaps;
......
...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Atom *XListProperties(dpy, window, n_props) Atom *XListProperties(
register Display *dpy; register Display *dpy,
Window window; Window window,
int *n_props; /* RETURN */ int *n_props) /* RETURN */
{ {
long nbytes; long nbytes;
xListPropertiesReply rep; xListPropertiesReply rep;
......
...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
char **XListExtensions(dpy, nextensions) char **XListExtensions(
register Display *dpy; register Display *dpy,
int *nextensions; /* RETURN */ int *nextensions) /* RETURN */
{ {
xListExtensionsReply rep; xListExtensionsReply rep;
char **list; char **list;
...@@ -87,8 +87,7 @@ int *nextensions; /* RETURN */ ...@@ -87,8 +87,7 @@ int *nextensions; /* RETURN */
} }
int int
XFreeExtensionList (list) XFreeExtensionList (char **list)
char **list;
{ {
if (list != NULL) { if (list != NULL) {
Xfree (list[0]-1); Xfree (list[0]-1);
......
...@@ -24,7 +24,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -24,7 +24,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
/* /*
* Author: Stephen Gildea, MIT X Consortium * Author: Stephen Gildea, MIT X Consortium
......
...@@ -46,6 +46,7 @@ XLookupColor ( ...@@ -46,6 +46,7 @@ XLookupColor (
XcmsCCC ccc; XcmsCCC ccc;
XcmsColor cmsColor_exact; XcmsColor cmsColor_exact;
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms and i18n approach to Parse Color * Let's Attempt to use Xcms and i18n approach to Parse Color
*/ */
...@@ -70,6 +71,7 @@ XLookupColor ( ...@@ -70,6 +71,7 @@ XLookupColor (
break; break;
} }
} }
#endif
/* /*
* Xcms and i18n methods failed, so lets pass it to the server * Xcms and i18n methods failed, so lets pass it to the server
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XLowerWindow(dpy, w) XLowerWindow(
Display *dpy; Display *dpy,
Window w; Window w)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
unsigned long val = Below; /* needed for macro */ unsigned long val = Below; /* needed for macro */
......
...@@ -37,151 +37,182 @@ in this Software without prior written authorization from The Open Group. ...@@ -37,151 +37,182 @@ in this Software without prior written authorization from The Open Group.
* need them. * need them.
*/ */
int XConnectionNumber(dpy) Display *dpy; { return (ConnectionNumber(dpy)); } int XConnectionNumber(Display *dpy) { return (ConnectionNumber(dpy)); }
Window XRootWindow (dpy, scr) Window XRootWindow (Display *dpy, int scr)
Display *dpy; int scr; {
{ return (RootWindow(dpy,scr)); } return (RootWindow(dpy,scr));
}
int XDefaultScreen(dpy) Display *dpy; { return (DefaultScreen(dpy)); } int XDefaultScreen(Display *dpy) { return (DefaultScreen(dpy)); }
Window XDefaultRootWindow (dpy) Window XDefaultRootWindow (Display *dpy)
Display *dpy; {
{ return (RootWindow(dpy,DefaultScreen(dpy))); } return (RootWindow(dpy,DefaultScreen(dpy)));
}
Visual *XDefaultVisual(dpy, scr) Visual *XDefaultVisual(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DefaultVisual(dpy, scr)); } return (DefaultVisual(dpy, scr));
}
GC XDefaultGC(dpy, scr) GC XDefaultGC(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DefaultGC(dpy,scr)); } return (DefaultGC(dpy,scr));
}
unsigned long XBlackPixel(dpy, scr) unsigned long XBlackPixel(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (BlackPixel(dpy, scr)); } return (BlackPixel(dpy, scr));
}
unsigned long XWhitePixel(dpy, scr) unsigned long XWhitePixel(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (WhitePixel(dpy,scr)); } return (WhitePixel(dpy,scr));
}
unsigned long XAllPlanes() { return AllPlanes; } unsigned long XAllPlanes(void) { return AllPlanes; }
int XQLength(dpy) Display *dpy; { return (QLength(dpy)); } int XQLength(Display *dpy) { return (QLength(dpy)); }
int XDisplayWidth(dpy, scr) int XDisplayWidth(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayWidth(dpy,scr)); } return (DisplayWidth(dpy,scr));
}
int XDisplayHeight(dpy, scr) int XDisplayHeight(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayHeight(dpy, scr)); } return (DisplayHeight(dpy, scr));
}
int XDisplayWidthMM(dpy, scr) int XDisplayWidthMM(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayWidthMM(dpy, scr)); } return (DisplayWidthMM(dpy, scr));
}
int XDisplayHeightMM(dpy, scr) int XDisplayHeightMM(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayHeightMM(dpy, scr)); } return (DisplayHeightMM(dpy, scr));
}
int XDisplayPlanes(dpy, scr) int XDisplayPlanes(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayPlanes(dpy, scr)); } return (DisplayPlanes(dpy, scr));
}
int XDisplayCells(dpy, scr) int XDisplayCells(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayCells (dpy, scr)); } return (DisplayCells (dpy, scr));
}
int XScreenCount(dpy) Display *dpy; { return (ScreenCount(dpy)); } int XScreenCount(Display *dpy) { return (ScreenCount(dpy)); }
char *XServerVendor(dpy) Display *dpy; { return (ServerVendor(dpy)); } char *XServerVendor(Display *dpy) { return (ServerVendor(dpy)); }
int XProtocolVersion(dpy) Display *dpy; { return (ProtocolVersion(dpy)); } int XProtocolVersion(Display *dpy) { return (ProtocolVersion(dpy)); }
int XProtocolRevision(dpy) Display *dpy; { return (ProtocolRevision(dpy));} int XProtocolRevision(Display *dpy) { return (ProtocolRevision(dpy));}
int XVendorRelease(dpy) Display *dpy; { return (VendorRelease(dpy)); } int XVendorRelease(Display *dpy) { return (VendorRelease(dpy)); }
char *XDisplayString(dpy) Display *dpy; { return (DisplayString(dpy)); } char *XDisplayString(Display *dpy) { return (DisplayString(dpy)); }
int XDefaultDepth(dpy, scr) int XDefaultDepth(Display *dpy, int scr)
Display *dpy; int scr; {
{ return(DefaultDepth(dpy, scr)); } return(DefaultDepth(dpy, scr));
}
Colormap XDefaultColormap(dpy, scr) Colormap XDefaultColormap(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DefaultColormap(dpy, scr)); } return (DefaultColormap(dpy, scr));
}
int XBitmapUnit(dpy) Display *dpy; { return (BitmapUnit(dpy)); } int XBitmapUnit(Display *dpy) { return (BitmapUnit(dpy)); }
int XBitmapBitOrder(dpy) Display *dpy; { return (BitmapBitOrder(dpy)); } int XBitmapBitOrder(Display *dpy) { return (BitmapBitOrder(dpy)); }
int XBitmapPad(dpy) Display *dpy; { return (BitmapPad(dpy)); } int XBitmapPad(Display *dpy) { return (BitmapPad(dpy)); }
int XImageByteOrder(dpy) Display *dpy; { return (ImageByteOrder(dpy)); } int XImageByteOrder(Display *dpy) { return (ImageByteOrder(dpy)); }
unsigned long XNextRequest(dpy) unsigned long XNextRequest(Display *dpy)
Display *dpy; {
{
return (NextRequest(dpy)); return (NextRequest(dpy));
} }
unsigned long XLastKnownRequestProcessed(dpy) unsigned long XLastKnownRequestProcessed(Display *dpy)
Display *dpy; {
{ return (LastKnownRequestProcessed(dpy)); } return (LastKnownRequestProcessed(dpy));
}
/* screen oriented macros (toolkit) */ /* screen oriented macros (toolkit) */
Screen *XScreenOfDisplay(dpy, scr) Display *dpy; int scr; Screen *XScreenOfDisplay(Display *dpy, int scr)
{ return (ScreenOfDisplay(dpy, scr)); } {
return (ScreenOfDisplay(dpy, scr));
}
Screen *XDefaultScreenOfDisplay(dpy) Display *dpy; Screen *XDefaultScreenOfDisplay(Display *dpy)
{ return (DefaultScreenOfDisplay(dpy)); } {
return (DefaultScreenOfDisplay(dpy));
}
Display *XDisplayOfScreen(s) Screen *s; { return (DisplayOfScreen(s)); } Display *XDisplayOfScreen(Screen *s) { return (DisplayOfScreen(s)); }
Window XRootWindowOfScreen(s) Screen *s; { return (RootWindowOfScreen(s)); } Window XRootWindowOfScreen(Screen *s) { return (RootWindowOfScreen(s)); }
unsigned long XBlackPixelOfScreen(s) Screen *s; unsigned long XBlackPixelOfScreen(Screen *s)
{ return (BlackPixelOfScreen(s)); } {
return (BlackPixelOfScreen(s));
}
unsigned long XWhitePixelOfScreen(s) Screen *s; unsigned long XWhitePixelOfScreen(Screen *s)
{ return (WhitePixelOfScreen(s)); } {
return (WhitePixelOfScreen(s));
}
Colormap XDefaultColormapOfScreen(s) Screen *s; Colormap XDefaultColormapOfScreen(Screen *s)
{ return (DefaultColormapOfScreen(s)); } {
return (DefaultColormapOfScreen(s));
}
int XDefaultDepthOfScreen(s) Screen *s; { return (DefaultDepthOfScreen(s)); } int XDefaultDepthOfScreen(Screen *s)
{
return (DefaultDepthOfScreen(s));
}
GC XDefaultGCOfScreen(s) Screen *s; { return (DefaultGCOfScreen(s)); } GC XDefaultGCOfScreen(Screen *s)
{
return (DefaultGCOfScreen(s));
}
Visual *XDefaultVisualOfScreen(s) Screen *s; Visual *XDefaultVisualOfScreen(Screen *s)
{ return (DefaultVisualOfScreen(s)); } {
return (DefaultVisualOfScreen(s));
}
int XWidthOfScreen(s) Screen *s; { return (WidthOfScreen(s)); } int XWidthOfScreen(Screen *s) { return (WidthOfScreen(s)); }
int XHeightOfScreen(s) Screen *s; { return (HeightOfScreen(s)); } int XHeightOfScreen(Screen *s) { return (HeightOfScreen(s)); }
int XWidthMMOfScreen(s) Screen *s; { return (WidthMMOfScreen(s)); } int XWidthMMOfScreen(Screen *s) { return (WidthMMOfScreen(s)); }
int XHeightMMOfScreen(s) Screen *s; { return (HeightMMOfScreen(s)); } int XHeightMMOfScreen(Screen *s) { return (HeightMMOfScreen(s)); }
int XPlanesOfScreen(s) Screen *s; { return (PlanesOfScreen(s)); } int XPlanesOfScreen(Screen *s) { return (PlanesOfScreen(s)); }
int XCellsOfScreen(s) Screen *s; { return (CellsOfScreen(s)); } int XCellsOfScreen(Screen *s) { return (CellsOfScreen(s)); }
int XMinCmapsOfScreen(s) Screen *s; { return (MinCmapsOfScreen(s)); } int XMinCmapsOfScreen(Screen *s) { return (MinCmapsOfScreen(s)); }
int XMaxCmapsOfScreen(s) Screen *s; { return (MaxCmapsOfScreen(s)); } int XMaxCmapsOfScreen(Screen *s) { return (MaxCmapsOfScreen(s)); }
Bool XDoesSaveUnders(s) Screen *s; { return (DoesSaveUnders(s)); } Bool XDoesSaveUnders(Screen *s) { return (DoesSaveUnders(s)); }
int XDoesBackingStore(s) Screen *s; { return (DoesBackingStore(s)); } int XDoesBackingStore(Screen *s) { return (DoesBackingStore(s)); }
long XEventMaskOfScreen(s) Screen *s; { return (EventMaskOfScreen(s)); } long XEventMaskOfScreen(Screen *s) { return (EventMaskOfScreen(s)); }
int XScreenNumberOfScreen (scr) int XScreenNumberOfScreen (register Screen *scr)
register Screen *scr;
{ {
register Display *dpy = scr->display; register Display *dpy = scr->display;
register Screen *dpyscr = dpy->screens; register Screen *dpyscr = dpy->screens;
...@@ -238,8 +269,7 @@ int XAddPixel( ...@@ -238,8 +269,7 @@ int XAddPixel(
int int
XNoOp (dpy) XNoOp (register Display *dpy)
register Display *dpy;
{ {
register xReq *req; register xReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XMapRaised (dpy, w) XMapRaised (
Window w; register Display *dpy,
register Display *dpy; Window w)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
register xResourceReq *req2; register xResourceReq *req2;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XMapSubwindows(dpy, win) XMapSubwindows(
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XMapWindow (dpy, w) XMapWindow (
Window w; register Display *dpy,
register Display *dpy; Window w)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay (dpy); LockDisplay (dpy);
......
...@@ -29,42 +29,38 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,42 +29,38 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
long XMaxRequestSize(dpy) long XMaxRequestSize(Display *dpy)
Display *dpy;
{ {
return dpy->max_request_size; return dpy->max_request_size;
} }
char *XResourceManagerString(dpy) char *XResourceManagerString(Display *dpy)
Display *dpy;
{ {
return dpy->xdefaults; return dpy->xdefaults;
} }
unsigned long XDisplayMotionBufferSize(dpy) unsigned long XDisplayMotionBufferSize(Display *dpy)
Display *dpy;
{ {
return dpy->motion_buffer; return dpy->motion_buffer;
} }
int int
XDisplayKeycodes(dpy, min_keycode_return, max_keycode_return) XDisplayKeycodes(
Display *dpy; Display *dpy,
int *min_keycode_return, *max_keycode_return; int *min_keycode_return,
int *max_keycode_return)
{ {
*min_keycode_return = dpy->min_keycode; *min_keycode_return = dpy->min_keycode;
*max_keycode_return = dpy->max_keycode; *max_keycode_return = dpy->max_keycode;
return 1; return 1;
} }
VisualID XVisualIDFromVisual(visual) VisualID XVisualIDFromVisual(Visual *visual)
Visual *visual;
{ {
return visual->visualid; return visual->visualid;
} }
long XExtendedMaxRequestSize(dpy) long XExtendedMaxRequestSize(Display *dpy)
Display *dpy;
{ {
return dpy->bigreq_size; return dpy->bigreq_size;
} }
...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
XModifierKeymap * XModifierKeymap *
XGetModifierMapping(dpy) XGetModifierMapping(register Display *dpy)
register Display *dpy;
{ {
xGetModifierMappingReply rep; xGetModifierMappingReply rep;
register xReq *req; register xReq *req;
...@@ -66,9 +65,9 @@ XGetModifierMapping(dpy) ...@@ -66,9 +65,9 @@ XGetModifierMapping(dpy)
* 2 Failed - one or more new modifiers unacceptable * 2 Failed - one or more new modifiers unacceptable
*/ */
int int
XSetModifierMapping(dpy, modifier_map) XSetModifierMapping(
register Display *dpy; register Display *dpy,
register XModifierKeymap *modifier_map; register XModifierKeymap *modifier_map)
{ {
register xSetModifierMappingReq *req; register xSetModifierMappingReq *req;
xSetModifierMappingReply rep; xSetModifierMappingReply rep;
...@@ -91,8 +90,7 @@ XSetModifierMapping(dpy, modifier_map) ...@@ -91,8 +90,7 @@ XSetModifierMapping(dpy, modifier_map)
} }
XModifierKeymap * XModifierKeymap *
XNewModifiermap(keyspermodifier) XNewModifiermap(int keyspermodifier)
int keyspermodifier;
{ {
XModifierKeymap *res = (XModifierKeymap *) Xmalloc((sizeof (XModifierKeymap))); XModifierKeymap *res = (XModifierKeymap *) Xmalloc((sizeof (XModifierKeymap)));
if (res) { if (res) {
...@@ -110,8 +108,7 @@ XNewModifiermap(keyspermodifier) ...@@ -110,8 +108,7 @@ XNewModifiermap(keyspermodifier)
int int
XFreeModifiermap(map) XFreeModifiermap(XModifierKeymap *map)
XModifierKeymap *map;
{ {
if (map) { if (map) {
if (map->modifiermap) if (map->modifiermap)
......
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XMoveWindow (dpy, w, x, y) XMoveWindow (
register Display *dpy; register Display *dpy,
Window w; Window w,
int x, y; int x,
int y)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
......
...@@ -61,8 +61,7 @@ XCreateOC(XOM om, ...) ...@@ -61,8 +61,7 @@ XCreateOC(XOM om, ...)
} }
void void
XDestroyOC(oc) XDestroyOC(XOC oc)
XOC oc;
{ {
XOC prev, oc_list; XOC prev, oc_list;
...@@ -83,8 +82,7 @@ XDestroyOC(oc) ...@@ -83,8 +82,7 @@ XDestroyOC(oc)
} }
XOM XOM
XOMOfOC(oc) XOMOfOC(XOC oc)
XOC oc;
{ {
return oc->core.om; return oc->core.om;
} }
......
...@@ -45,8 +45,7 @@ XOpenOM(Display *dpy, XrmDatabase rdb, _Xconst char *res_name, ...@@ -45,8 +45,7 @@ XOpenOM(Display *dpy, XrmDatabase rdb, _Xconst char *res_name,
} }
Status Status
XCloseOM(om) XCloseOM(XOM om)
XOM om;
{ {
XOC oc, next; XOC oc, next;
XLCd lcd = om->core.lcd; XLCd lcd = om->core.lcd;
...@@ -118,15 +117,13 @@ XGetOMValues(XOM om, ...) ...@@ -118,15 +117,13 @@ XGetOMValues(XOM om, ...)
} }
Display * Display *
XDisplayOfOM(om) XDisplayOfOM(XOM om)
XOM om;
{ {
return om->core.display; return om->core.display;
} }
char * char *
XLocaleOfOM(om) XLocaleOfOM(XOM om)
XOM om;
{ {
return om->core.lcd->core->name; return om->core.lcd->core->name;
} }
...@@ -63,7 +63,7 @@ SOFTWARE. ...@@ -63,7 +63,7 @@ SOFTWARE.
#include <stdio.h> #include <stdio.h>
static void _XReportParseError(XrmOptionDescRec *arg, char *msg) static void _XReportParseError(XrmOptionDescRec *arg, const char *msg)
{ {
(void) fprintf(stderr, "Error parsing argument \"%s\" (%s); %s\n", (void) fprintf(stderr, "Error parsing argument \"%s\" (%s); %s\n",
arg->option, arg->specifier, msg); arg->option, arg->specifier, msg);
......
...@@ -83,6 +83,7 @@ XParseColor ( ...@@ -83,6 +83,7 @@ XParseColor (
} }
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms and i18n approach to Parse Color * Let's Attempt to use Xcms and i18n approach to Parse Color
*/ */
...@@ -106,6 +107,7 @@ XParseColor ( ...@@ -106,6 +107,7 @@ XParseColor (
break; break;
} }
} }
#endif
/* /*
* Xcms and i18n methods failed, so lets pass it to the server * Xcms and i18n methods failed, so lets pass it to the server
......
...@@ -33,24 +33,6 @@ from The Open Group. ...@@ -33,24 +33,6 @@ from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
#include "Xutil.h" #include "Xutil.h"
#ifdef notdef
/*
*Returns pointer to first char ins search which is also in what, else NULL.
*/
static char *strscan (search, what)
char *search, *what;
{
int i, len = strlen (what);
char c;
while ((c = *(search++)) != NULL)
for (i = 0; i < len; i++)
if (c == what [i])
return (--search);
return (NULL);
}
#endif
/* /*
* XParseGeometry parses strings of the form * XParseGeometry parses strings of the form
* "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
......
...@@ -34,9 +34,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,9 +34,9 @@ in this Software without prior written authorization from The Open Group.
* XListPixmapFormats - return info from connection setup * XListPixmapFormats - return info from connection setup
*/ */
XPixmapFormatValues *XListPixmapFormats (dpy, count) XPixmapFormatValues *XListPixmapFormats (
Display *dpy; Display *dpy,
int *count; /* RETURN */ int *count) /* RETURN */
{ {
XPixmapFormatValues *formats = (XPixmapFormatValues *) XPixmapFormatValues *formats = (XPixmapFormatValues *)
Xmalloc((unsigned) (dpy->nformats * sizeof (XPixmapFormatValues))); Xmalloc((unsigned) (dpy->nformats * sizeof (XPixmapFormatValues)));
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBackgroundPixmap(dpy, w, pixmap) XSetWindowBackgroundPixmap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Pixmap pixmap; Pixmap pixmap)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
LockDisplay (dpy); LockDisplay (dpy);
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBorderPixmap(dpy, w, pixmap) XSetWindowBorderPixmap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Pixmap pixmap; Pixmap pixmap)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -471,10 +471,10 @@ static int PtsToRegion( ...@@ -471,10 +471,10 @@ static int PtsToRegion(
* encoding is in the form of an array of rectangles. * encoding is in the form of an array of rectangles.
*/ */
Region Region
XPolygonRegion(Pts, Count, rule) XPolygonRegion(
int Count; /* number of pts */ XPoint *Pts, /* the pts */
XPoint *Pts; /* the pts */ int Count, /* number of pts */
int rule; /* winding rule */ int rule) /* winding rule */
{ {
Region region; Region region;
register EdgeTableEntry *pAET; /* Active Edge Table */ register EdgeTableEntry *pAET; /* Active Edge Table */
...@@ -522,8 +522,10 @@ XPolygonRegion(Pts, Count, rule) ...@@ -522,8 +522,10 @@ XPolygonRegion(Pts, Count, rule)
if (Count < 2) return region; if (Count < 2) return region;
if (! (pETEs = (EdgeTableEntry *) if (! (pETEs = (EdgeTableEntry *)
Xmalloc((unsigned) (sizeof(EdgeTableEntry) * Count)))) Xmalloc((unsigned) (sizeof(EdgeTableEntry) * Count)))) {
XDestroyRegion(region);
return (Region) NULL; return (Region) NULL;
}
pts = FirstPtBlock.pts; pts = FirstPtBlock.pts;
CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock); CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock);
......
...@@ -30,13 +30,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawText(dpy, d, gc, x, y, items, nitems) XDrawText(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; int x,
XTextItem *items; int y,
int nitems; XTextItem *items,
int nitems)
{ {
register int i; register int i;
register XTextItem *item; register XTextItem *item;
......
...@@ -30,13 +30,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawText16(dpy, d, gc, x, y, items, nitems) XDrawText16(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; int x,
XTextItem16 *items; int y,
int nitems; XTextItem16 *items,
int nitems)
{ {
register int i; register int i;
register XTextItem16 *item; register XTextItem16 *item;
......
...@@ -37,26 +37,26 @@ in this Software without prior written authorization from The Open Group. ...@@ -37,26 +37,26 @@ in this Software without prior written authorization from The Open Group.
* longer at some point. * longer at some point.
*/ */
XSizeHints *XAllocSizeHints () XSizeHints *XAllocSizeHints (void)
{ {
return ((XSizeHints *) Xcalloc (1, (unsigned) sizeof (XSizeHints))); return ((XSizeHints *) Xcalloc (1, (unsigned) sizeof (XSizeHints)));
} }
XStandardColormap *XAllocStandardColormap () XStandardColormap *XAllocStandardColormap (void)
{ {
return ((XStandardColormap *) return ((XStandardColormap *)
Xcalloc (1, (unsigned) sizeof (XStandardColormap))); Xcalloc (1, (unsigned) sizeof (XStandardColormap)));
} }
XWMHints *XAllocWMHints () XWMHints *XAllocWMHints (void)
{ {
return ((XWMHints *) Xcalloc (1, (unsigned) sizeof (XWMHints))); return ((XWMHints *) Xcalloc (1, (unsigned) sizeof (XWMHints)));
} }
XClassHint *XAllocClassHint () XClassHint *XAllocClassHint (void)
{ {
register XClassHint *h; register XClassHint *h;
...@@ -67,7 +67,7 @@ XClassHint *XAllocClassHint () ...@@ -67,7 +67,7 @@ XClassHint *XAllocClassHint ()
} }
XIconSize *XAllocIconSize () XIconSize *XAllocIconSize (void)
{ {
return ((XIconSize *) Xcalloc (1, (unsigned) sizeof (XIconSize))); return ((XIconSize *) Xcalloc (1, (unsigned) sizeof (XIconSize)));
} }
......
...@@ -38,6 +38,7 @@ _XPutBackEvent ( ...@@ -38,6 +38,7 @@ _XPutBackEvent (
register XEvent *event) register XEvent *event)
{ {
register _XQEvent *qelt; register _XQEvent *qelt;
XEvent store = *event;
if (!dpy->qfree) { if (!dpy->qfree) {
if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) { if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) {
...@@ -45,11 +46,26 @@ _XPutBackEvent ( ...@@ -45,11 +46,26 @@ _XPutBackEvent (
} }
dpy->qfree->next = NULL; dpy->qfree->next = NULL;
} }
/* unclaimed cookie? */
if (_XIsEventCookie(dpy, event))
{
XEvent copy = {0};
/* if not claimed, then just fetch and store again */
if (!event->xcookie.data) {
_XFetchEventCookie(dpy, &event->xcookie);
store = *event;
} else { /* if claimed, copy, client must free */
_XCopyEventCookie(dpy, &event->xcookie, &copy.xcookie);
store = copy;
}
}
qelt = dpy->qfree; qelt = dpy->qfree;
dpy->qfree = qelt->next; dpy->qfree = qelt->next;
qelt->qserial_num = dpy->next_event_serial_num++; qelt->qserial_num = dpy->next_event_serial_num++;
qelt->next = dpy->head; qelt->next = dpy->head;
qelt->event = *event; qelt->event = store;
dpy->head = qelt; dpy->head = qelt;
if (dpy->tail == NULL) if (dpy->tail == NULL)
dpy->tail = qelt; dpy->tail = qelt;
......
...@@ -939,15 +939,17 @@ PutSubImage ( ...@@ -939,15 +939,17 @@ PutSubImage (
int int
XPutImage (dpy, d, gc, image, req_xoffset, req_yoffset, x, y, req_width, XPutImage (
req_height) register Display *dpy,
register Display *dpy; Drawable d,
Drawable d; GC gc,
GC gc; register XImage *image,
register XImage *image; int req_xoffset,
int x, y; int req_yoffset,
unsigned int req_width, req_height; int x,
int req_xoffset, req_yoffset; int y,
unsigned int req_width,
unsigned int req_height)
{ {
long width = req_width; long width = req_width;
......
...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestSize(dpy, class, drawable, width, height, ret_width, ret_height) Status XQueryBestSize(
register Display *dpy; register Display *dpy,
int class; int class,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
unsigned int *ret_width,
unsigned int *ret_height)
{ {
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -24,16 +24,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -24,16 +24,17 @@ in this Software without prior written authorization from The Open Group.
*/ */
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
int int
XQueryColor(dpy, cmap, def) XQueryColor(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *def; /* RETURN */ XColor *def) /* RETURN */
{ {
xrgb color; xrgb color;
xQueryColorsReply rep; xQueryColorsReply rep;
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XQueryColors(dpy, cmap, defs, ncolors) XQueryColors(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *defs; /* RETURN */ XColor *defs, /* RETURN */
int ncolors; int ncolors)
{ {
register int i; register int i;
xrgb *color; xrgb *color;
......
...@@ -29,11 +29,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,11 +29,13 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestCursor(dpy, drawable, width, height, ret_width, ret_height) Status XQueryBestCursor(
register Display *dpy; register Display *dpy,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
unsigned int *ret_width,
unsigned int *ret_height)
{ {
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
......
...@@ -34,10 +34,9 @@ struct kmap { ...@@ -34,10 +34,9 @@ struct kmap {
}; };
int int
XQueryKeymap(dpy, keys) XQueryKeymap(
register Display *dpy; register Display *dpy,
char keys[32]; char keys[32])
{ {
xQueryKeymapReply rep; xQueryKeymapReply rep;
register xReq *req; register xReq *req;
......
...@@ -29,12 +29,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Bool XQueryPointer(dpy, w, root, child, root_x, root_y, win_x, win_y, mask) Bool XQueryPointer(
register Display *dpy; register Display *dpy,
Window w, *root, *child; Window w,
int *root_x, *root_y, *win_x, *win_y; Window *root,
unsigned int *mask; Window *child,
int *root_x,
int *root_y,
int *win_x,
int *win_y,
unsigned int *mask)
{ {
xQueryPointerReply rep; xQueryPointerReply rep;
xResourceReq *req; xResourceReq *req;
......
...@@ -29,11 +29,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,11 +29,13 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestStipple(dpy, drawable, width, height, ret_width, ret_height) Status XQueryBestStipple(
register Display *dpy; register Display *dpy,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
unsigned int *ret_width,
unsigned int *ret_height)
{ {
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -29,11 +29,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,11 +29,13 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestTile(dpy, drawable, width, height, ret_width, ret_height) Status XQueryBestTile(
register Display *dpy; register Display *dpy,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
unsigned int *ret_width,
unsigned int *ret_height)
{ {
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -29,13 +29,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,13 +29,13 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryTree (dpy, w, root, parent, children, nchildren) Status XQueryTree (
register Display *dpy; register Display *dpy,
Window w; Window w,
Window *root; /* RETURN */ Window *root, /* RETURN */
Window *parent; /* RETURN */ Window *parent, /* RETURN */
Window **children; /* RETURN */ Window **children, /* RETURN */
unsigned int *nchildren; /* RETURN */ unsigned int *nchildren) /* RETURN */
{ {
long nbytes; long nbytes;
xQueryTreeReply rep; xQueryTreeReply rep;
......
...@@ -376,7 +376,7 @@ XrmPermStringToQuark( ...@@ -376,7 +376,7 @@ XrmPermStringToQuark(
return _XrmInternalStringToQuark(name, tname-(char *)name-1, sig, True); return _XrmInternalStringToQuark(name, tname-(char *)name-1, sig, True);
} }
XrmQuark XrmUniqueQuark() XrmQuark XrmUniqueQuark(void)
{ {
XrmQuark q; XrmQuark q;
...@@ -389,8 +389,7 @@ XrmQuark XrmUniqueQuark() ...@@ -389,8 +389,7 @@ XrmQuark XrmUniqueQuark()
return q; return q;
} }
XrmString XrmQuarkToString(quark) XrmString XrmQuarkToString(register XrmQuark quark)
register XrmQuark quark;
{ {
XrmString s; XrmString s;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XRaiseWindow (dpy, w) XRaiseWindow (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
unsigned long val = Above; /* needed for macro below */ unsigned long val = Above; /* needed for macro below */
......
...@@ -54,43 +54,23 @@ from The Open Group. ...@@ -54,43 +54,23 @@ from The Open Group.
#define MAX_SIZE 255 #define MAX_SIZE 255
/* shared data for the image read/parse logic */ /* shared data for the image read/parse logic */
static short hexTable[256]; /* conversion value */ static const short hexTable[256] = {
static Bool initialized = False; /* easier to fill in at run time */ ['0'] = 0, ['1'] = 1,
['2'] = 2, ['3'] = 3,
['4'] = 4, ['5'] = 5,
/* ['6'] = 6, ['7'] = 7,
* Table index for the hex values. Initialized once, first time. ['8'] = 8, ['9'] = 9,
* Used for translation value or delimiter significance lookup. ['A'] = 10, ['B'] = 11,
*/ ['C'] = 12, ['D'] = 13,
static void initHexTable(void) ['E'] = 14, ['F'] = 15,
{ ['a'] = 10, ['b'] = 11,
/* ['c'] = 12, ['d'] = 13,
* We build the table at run time for several reasons: ['e'] = 14, ['f'] = 15,
*
* 1. portable to non-ASCII machines. [' '] = -1, [','] = -1,
* 2. still reentrant since we set the init flag after setting table. ['}'] = -1, ['\n'] = -1,
* 3. easier to extend. ['\t'] = -1
* 4. less prone to bugs. };
*/
hexTable['0'] = 0; hexTable['1'] = 1;
hexTable['2'] = 2; hexTable['3'] = 3;
hexTable['4'] = 4; hexTable['5'] = 5;
hexTable['6'] = 6; hexTable['7'] = 7;
hexTable['8'] = 8; hexTable['9'] = 9;
hexTable['A'] = 10; hexTable['B'] = 11;
hexTable['C'] = 12; hexTable['D'] = 13;
hexTable['E'] = 14; hexTable['F'] = 15;
hexTable['a'] = 10; hexTable['b'] = 11;
hexTable['c'] = 12; hexTable['d'] = 13;
hexTable['e'] = 14; hexTable['f'] = 15;
/* delimiters of significance are flagged w/ negative value */
hexTable[' '] = -1; hexTable[','] = -1;
hexTable['}'] = -1; hexTable['\n'] = -1;
hexTable['\t'] = -1;
initialized = True;
}
/* /*
* read next hex value in the input stream, return -1 if EOF * read next hex value in the input stream, return -1 if EOF
...@@ -149,9 +129,6 @@ XReadBitmapFileData ( ...@@ -149,9 +129,6 @@ XReadBitmapFileData (
int hx = -1; /* x hotspot */ int hx = -1; /* x hotspot */
int hy = -1; /* y hotspot */ int hy = -1; /* y hotspot */
/* first time initialization */
if (initialized == False) initHexTable();
#ifdef __UNIXOS2__ #ifdef __UNIXOS2__
filename = __XOS2RedirRoot(filename); filename = __XOS2RedirRoot(filename);
#endif #endif
......
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XRecolorCursor(dpy, cursor, foreground, background) XRecolorCursor(
register Display *dpy; register Display *dpy,
Cursor cursor; Cursor cursor,
XColor *foreground, *background; XColor *foreground,
XColor *background)
{ {
register xRecolorCursorReq *req; register xRecolorCursorReq *req;
......
...@@ -34,12 +34,12 @@ from The Open Group. ...@@ -34,12 +34,12 @@ from The Open Group.
#define AllMaskBits (CWX|CWY|CWWidth|CWHeight|\ #define AllMaskBits (CWX|CWY|CWWidth|CWHeight|\
CWBorderWidth|CWSibling|CWStackMode) CWBorderWidth|CWSibling|CWStackMode)
Status XReconfigureWMWindow (dpy, w, screen, mask, changes) Status XReconfigureWMWindow (
register Display *dpy; register Display *dpy,
Window w; Window w,
int screen; int screen,
unsigned int mask; unsigned int mask,
XWindowChanges *changes; XWindowChanges *changes)
{ {
XConfigureRequestEvent ev; XConfigureRequestEvent ev;
Window root = RootWindow (dpy, screen); Window root = RootWindow (dpy, screen);
......
...@@ -33,12 +33,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,12 +33,12 @@ in this Software without prior written authorization from The Open Group.
CWBorderWidth|CWSibling|CWStackMode) CWBorderWidth|CWSibling|CWStackMode)
int int
XConfigureWindow(dpy, w, mask, changes) XConfigureWindow(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned int mask; unsigned int mask,
XWindowChanges *changes; XWindowChanges *changes)
{ {
unsigned long values[7]; unsigned long values[7];
register unsigned long *value = values; register unsigned long *value = values;
long nvalues; long nvalues;
......
...@@ -395,23 +395,6 @@ XShrinkRegion( ...@@ -395,23 +395,6 @@ XShrinkRegion(
return 0; return 0;
} }
#ifdef notdef
/***********************************************************
* Bop down the array of rects until we have passed
* scanline y. numRects is the size of the array.
***********************************************************/
static BOX
*IndexRects(
register BOX *rects,
register int numRects,
register int y)
{
while ((numRects--) && (rects->y2 <= y))
rects++;
return(rects);
}
#endif
/*====================================================================== /*======================================================================
* Region Intersection * Region Intersection
...@@ -553,135 +536,6 @@ miRegionCopy( ...@@ -553,135 +536,6 @@ miRegionCopy(
} }
} }
#ifdef notdef
/*
* combinRegs(newReg, reg1, reg2)
* if one region is above or below the other.
*/
static void
combineRegs(
register Region newReg,
Region reg1,
Region reg2)
{
register Region tempReg;
register BOX *rects;
register BOX *rects1;
register BOX *rects2;
register int total;
rects1 = reg1->rects;
rects2 = reg2->rects;
total = reg1->numRects + reg2->numRects;
if (! (tempReg = XCreateRegion()))
return;
tempReg->size = total;
/* region 1 is below region 2 */
if (reg1->extents.y1 > reg2->extents.y1)
{
miRegionCopy(tempReg, reg2);
rects = &tempReg->rects[tempReg->numRects];
total -= tempReg->numRects;
while (total--)
*rects++ = *rects1++;
}
else
{
miRegionCopy(tempReg, reg1);
rects = &tempReg->rects[tempReg->numRects];
total -= tempReg->numRects;
while (total--)
*rects++ = *rects2++;
}
tempReg->extents = reg1->extents;
tempReg->numRects = reg1->numRects + reg2->numRects;
EXTENTS(&reg2->extents, tempReg);
miRegionCopy(newReg, tempReg);
Xfree((char *)tempReg);
}
/*
* QuickCheck checks to see if it does not have to go through all the
* the ugly code for the region call. It returns 1 if it did all
* the work for Union, otherwise 0 - still work to be done.
*/
static int
QuickCheck(Region newReg, Region reg1, Region reg2)
{
/* if unioning with itself or no rects to union with */
if ( (reg1 == reg2) || (!(reg1->numRects)) )
{
miRegionCopy(newReg, reg2);
return TRUE;
}
/* if nothing to union */
if (!(reg2->numRects))
{
miRegionCopy(newReg, reg1);
return TRUE;
}
/* could put an extent check to see if add above or below */
if ((reg1->extents.y1 >= reg2->extents.y2) ||
(reg2->extents.y1 >= reg1->extents.y2) )
{
combineRegs(newReg, reg1, reg2);
return TRUE;
}
return FALSE;
}
/* TopRects(rects, reg1, reg2)
* N.B. We now assume that reg1 and reg2 intersect. Therefore we are
* NOT checking in the two while loops for stepping off the end of the
* region.
*/
static int
TopRects(
register Region newReg,
register BOX *rects,
register Region reg1,
register Region reg2,
BOX *FirstRect)
{
register BOX *tempRects;
/* need to add some rects from region 1 */
if (reg1->extents.y1 < reg2->extents.y1)
{
tempRects = reg1->rects;
while(tempRects->y1 < reg2->extents.y1)
{
MEMCHECK(newReg, rects, FirstRect);
ADDRECTNOX(newReg,rects, tempRects->x1, tempRects->y1,
tempRects->x2, MIN(tempRects->y2, reg2->extents.y1));
tempRects++;
}
}
/* need to add some rects from region 2 */
if (reg2->extents.y1 < reg1->extents.y1)
{
tempRects = reg2->rects;
while (tempRects->y1 < reg1->extents.y1)
{
MEMCHECK(newReg, rects, FirstRect);
ADDRECTNOX(newReg, rects, tempRects->x1,tempRects->y1,
tempRects->x2, MIN(tempRects->y2, reg1->extents.y1));
tempRects++;
}
}
return 1;
}
#endif
/*====================================================================== /*======================================================================
* Generic Region Operator * Generic Region Operator
*====================================================================*/ *====================================================================*/
......
...@@ -30,10 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XReparentWindow(dpy, w, p, x, y) XReparentWindow(
register Display *dpy; register Display *dpy,
Window w, p; Window w,
int x, y; Window p,
int x,
int y)
{ {
register xReparentWindowReq *req; register xReparentWindowReq *req;
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XRestackWindows (dpy, windows, n) XRestackWindows (
register Display *dpy; register Display *dpy,
register Window *windows; register Window *windows,
int n; int n)
{ {
int i = 0; int i = 0;
LockDisplay(dpy); LockDisplay(dpy);
...@@ -57,5 +57,3 @@ XRestackWindows (dpy, windows, n) ...@@ -57,5 +57,3 @@ XRestackWindows (dpy, windows, n)
} }
...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XRotateWindowProperties(dpy, w, properties, nprops, npositions) XRotateWindowProperties(
register Display *dpy; register Display *dpy,
Window w; Window w,
Atom *properties; Atom *properties,
register int nprops; register int nprops,
int npositions; int npositions)
{ {
register long nbytes; register long nbytes;
register xRotatePropertiesReq *req; register xRotatePropertiesReq *req;
......
...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
char *XScreenResourceString(screen) char *XScreenResourceString(Screen *screen)
Screen *screen;
{ {
Atom prop_name; Atom prop_name;
Atom actual_type; Atom actual_type;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSelectInput (dpy, w, mask) XSelectInput (
register Display *dpy; register Display *dpy,
Window w; Window w,
long mask; long mask)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -34,12 +34,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,12 +34,12 @@ in this Software without prior written authorization from The Open Group.
* event converter here if it has never been installed. * event converter here if it has never been installed.
*/ */
Status Status
XSendEvent(dpy, w, propagate, event_mask, event) XSendEvent(
register Display *dpy; register Display *dpy,
Window w; Window w,
Bool propagate; Bool propagate,
long event_mask; long event_mask,
XEvent *event; XEvent *event)
{ {
register xSendEventReq *req; register xSendEventReq *req;
xEvent ev; xEvent ev;
...@@ -49,6 +49,11 @@ XSendEvent(dpy, w, propagate, event_mask, event) ...@@ -49,6 +49,11 @@ XSendEvent(dpy, w, propagate, event_mask, event)
xEvent * /* event */); xEvent * /* event */);
Status status; Status status;
/* initialize all of the event's fields first, before setting
* the meaningful ones later.
*/
memset (&ev, 0, sizeof (ev));
LockDisplay (dpy); LockDisplay (dpy);
/* call through display to find proper conversion routine */ /* call through display to find proper conversion routine */
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetBackground (dpy, gc, background) XSetBackground (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long background; /* CARD32 */ unsigned long background) /* CARD32 */
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.background != background) { if (gc->values.background != background) {
......
...@@ -62,14 +62,14 @@ void _XSetClipRectangles ( ...@@ -62,14 +62,14 @@ void _XSetClipRectangles (
} }
int int
XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n, XSetClipRectangles (
ordering) register Display *dpy,
register Display *dpy; GC gc,
GC gc; int clip_x_origin,
int clip_x_origin, clip_y_origin; int clip_y_origin,
XRectangle *rectangles; XRectangle *rectangles,
int n; int n,
int ordering; int ordering)
{ {
LockDisplay(dpy); LockDisplay(dpy);
_XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n, _XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n,
...@@ -78,4 +78,3 @@ XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n, ...@@ -78,4 +78,3 @@ XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n,
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetClipMask (dpy, gc, mask) XSetClipMask (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Pixmap mask; Pixmap mask)
{ {
LockDisplay(dpy); LockDisplay(dpy);
/* always update, since client may have changed pixmap contents */ /* always update, since client may have changed pixmap contents */
......
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetClipOrigin (dpy, gc, xorig, yorig) XSetClipOrigin (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int xorig, yorig; int xorig,
int yorig)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -32,10 +32,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,10 +32,10 @@ in this Software without prior written authorization from The Open Group.
#define safestrlen(s) ((s) ? strlen(s) : 0) #define safestrlen(s) ((s) ? strlen(s) : 0)
int int
XSetFontPath (dpy, directories, ndirs) XSetFontPath (
register Display *dpy; register Display *dpy,
char **directories; char **directories,
int ndirs; int ndirs)
{ {
register int n = 0; register int n = 0;
register int i; register int i;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetFont (dpy, gc, font) XSetFont (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Font font; Font font)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.font != font) { if (gc->values.font != font) {
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetForeground (dpy, gc, foreground) XSetForeground (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long foreground; /* CARD32 */ unsigned long foreground) /* CARD32 */
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.foreground != foreground) { if (gc->values.foreground != foreground) {
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetFunction (dpy, gc, function) XSetFunction (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int function; int function)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.function != function) { if (gc->values.function != function) {
......
...@@ -58,28 +58,41 @@ SOFTWARE. ...@@ -58,28 +58,41 @@ SOFTWARE.
#define safestrlen(s) ((s) ? strlen(s) : 0) #define safestrlen(s) ((s) ? strlen(s) : 0)
int int
XSetSizeHints(dpy, w, hints, property) /* old routine */ XSetSizeHints( /* old routine */
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
Atom property; Atom property)
{ {
xPropSizeHints prop; xPropSizeHints prop;
memset(&prop, 0, sizeof(prop));
prop.flags = (hints->flags & (USPosition|USSize|PAllHints)); prop.flags = (hints->flags & (USPosition|USSize|PAllHints));
if (hints->flags & (USPosition|PPosition)) {
prop.x = hints->x; prop.x = hints->x;
prop.y = hints->y; prop.y = hints->y;
}
if (hints->flags & (USSize|PSize)) {
prop.width = hints->width; prop.width = hints->width;
prop.height = hints->height; prop.height = hints->height;
}
if (hints->flags & PMinSize) {
prop.minWidth = hints->min_width; prop.minWidth = hints->min_width;
prop.minHeight = hints->min_height; prop.minHeight = hints->min_height;
}
if (hints->flags & PMaxSize) {
prop.maxWidth = hints->max_width; prop.maxWidth = hints->max_width;
prop.maxHeight = hints->max_height; prop.maxHeight = hints->max_height;
}
if (hints->flags & PResizeInc) {
prop.widthInc = hints->width_inc; prop.widthInc = hints->width_inc;
prop.heightInc = hints->height_inc; prop.heightInc = hints->height_inc;
}
if (hints->flags & PAspect) {
prop.minAspectX = hints->min_aspect.x; prop.minAspectX = hints->min_aspect.x;
prop.minAspectY = hints->min_aspect.y; prop.minAspectY = hints->min_aspect.y;
prop.maxAspectX = hints->max_aspect.x; prop.maxAspectX = hints->max_aspect.x;
prop.maxAspectY = hints->max_aspect.y; prop.maxAspectY = hints->max_aspect.y;
}
return XChangeProperty (dpy, w, property, XA_WM_SIZE_HINTS, 32, return XChangeProperty (dpy, w, property, XA_WM_SIZE_HINTS, 32,
PropModeReplace, (unsigned char *) &prop, PropModeReplace, (unsigned char *) &prop,
OldNumPropSizeElements); OldNumPropSizeElements);
...@@ -91,20 +104,29 @@ XSetSizeHints(dpy, w, hints, property) /* old routine */ ...@@ -91,20 +104,29 @@ XSetSizeHints(dpy, w, hints, property) /* old routine */
*/ */
int int
XSetWMHints (dpy, w, wmhints) XSetWMHints (
Display *dpy; Display *dpy,
Window w; Window w,
XWMHints *wmhints; XWMHints *wmhints)
{ {
xPropWMHints prop; xPropWMHints prop;
memset(&prop, 0, sizeof(prop));
prop.flags = wmhints->flags; prop.flags = wmhints->flags;
if (wmhints->flags & InputHint)
prop.input = (wmhints->input == True ? 1 : 0); prop.input = (wmhints->input == True ? 1 : 0);
if (wmhints->flags & StateHint)
prop.initialState = wmhints->initial_state; prop.initialState = wmhints->initial_state;
if (wmhints->flags & IconPixmapHint)
prop.iconPixmap = wmhints->icon_pixmap; prop.iconPixmap = wmhints->icon_pixmap;
if (wmhints->flags & IconWindowHint)
prop.iconWindow = wmhints->icon_window; prop.iconWindow = wmhints->icon_window;
if (wmhints->flags & IconPositionHint) {
prop.iconX = wmhints->icon_x; prop.iconX = wmhints->icon_x;
prop.iconY = wmhints->icon_y; prop.iconY = wmhints->icon_y;
}
if (wmhints->flags & IconMaskHint)
prop.iconMask = wmhints->icon_mask; prop.iconMask = wmhints->icon_mask;
if (wmhints->flags & WindowGroupHint)
prop.windowGroup = wmhints->window_group; prop.windowGroup = wmhints->window_group;
return XChangeProperty (dpy, w, XA_WM_HINTS, XA_WM_HINTS, 32, return XChangeProperty (dpy, w, XA_WM_HINTS, XA_WM_HINTS, 32,
PropModeReplace, (unsigned char *) &prop, PropModeReplace, (unsigned char *) &prop,
...@@ -119,10 +141,10 @@ XSetWMHints (dpy, w, wmhints) ...@@ -119,10 +141,10 @@ XSetWMHints (dpy, w, wmhints)
*/ */
int int
XSetZoomHints (dpy, w, zhints) XSetZoomHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *zhints; XSizeHints *zhints)
{ {
return XSetSizeHints (dpy, w, zhints, XA_WM_ZOOM_HINTS); return XSetSizeHints (dpy, w, zhints, XA_WM_ZOOM_HINTS);
} }
...@@ -134,10 +156,10 @@ XSetZoomHints (dpy, w, zhints) ...@@ -134,10 +156,10 @@ XSetZoomHints (dpy, w, zhints)
*/ */
int int
XSetNormalHints (dpy, w, hints) /* old routine */ XSetNormalHints ( /* old routine */
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints)
{ {
return XSetSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS); return XSetSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS);
} }
...@@ -151,11 +173,11 @@ XSetNormalHints (dpy, w, hints) /* old routine */ ...@@ -151,11 +173,11 @@ XSetNormalHints (dpy, w, hints) /* old routine */
*/ */
int int
XSetIconSizes (dpy, w, list, count) XSetIconSizes (
Display *dpy; Display *dpy,
Window w; /* typically, root */ Window w, /* typically, root */
XIconSize *list; XIconSize *list,
int count; /* number of items on the list */ int count) /* number of items on the list */
{ {
register int i; register int i;
xPropIconSize *pp, *prop; xPropIconSize *pp, *prop;
...@@ -182,11 +204,11 @@ XSetIconSizes (dpy, w, list, count) ...@@ -182,11 +204,11 @@ XSetIconSizes (dpy, w, list, count)
} }
int int
XSetCommand (dpy, w, argv, argc) XSetCommand (
Display *dpy; Display *dpy,
Window w; Window w,
char **argv; char **argv,
int argc; int argc)
{ {
register int i; register int i;
register int nbytes; register int nbytes;
...@@ -254,20 +276,20 @@ XSetStandardProperties ( ...@@ -254,20 +276,20 @@ XSetStandardProperties (
} }
int int
XSetTransientForHint(dpy, w, propWindow) XSetTransientForHint(
Display *dpy; Display *dpy,
Window w; Window w,
Window propWindow; Window propWindow)
{ {
return XChangeProperty(dpy, w, XA_WM_TRANSIENT_FOR, XA_WINDOW, 32, return XChangeProperty(dpy, w, XA_WM_TRANSIENT_FOR, XA_WINDOW, 32,
PropModeReplace, (unsigned char *) &propWindow, 1); PropModeReplace, (unsigned char *) &propWindow, 1);
} }
int int
XSetClassHint(dpy, w, classhint) XSetClassHint(
Display *dpy; Display *dpy,
Window w; Window w,
XClassHint *classhint; XClassHint *classhint)
{ {
char *class_string; char *class_string;
char *s; char *s;
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetInputFocus(dpy, focus, revert_to, time) XSetInputFocus(
register Display *dpy; register Display *dpy,
Window focus; Window focus,
int revert_to; int revert_to,
Time time; Time time)
{ {
register xSetInputFocusReq *req; register xSetInputFocusReq *req;
......
...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetLineAttributes(dpy, gc, linewidth, linestyle, capstyle, joinstyle) XSetLineAttributes(
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned int linewidth; /* CARD16 */ unsigned int linewidth, /* CARD16 */
int linestyle; int linestyle,
int capstyle; int capstyle,
int joinstyle; int joinstyle)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -118,7 +118,7 @@ _Xsetlocale( ...@@ -118,7 +118,7 @@ _Xsetlocale(
#else /* X_LOCALE */ #else /* X_LOCALE */
#ifdef __DARWIN__ #if defined(__APPLE__) || defined(__CYGWIN__)
char * char *
_Xsetlocale( _Xsetlocale(
int category, int category,
...@@ -127,7 +127,7 @@ _Xsetlocale( ...@@ -127,7 +127,7 @@ _Xsetlocale(
{ {
return setlocale(category, name); return setlocale(category, name);
} }
#endif /* __DARWIN__ */ #endif /* __APPLE__ || __CYGWIN__ */
/* /*
* _XlcMapOSLocaleName is an implementation dependent routine that derives * _XlcMapOSLocaleName is an implementation dependent routine that derives
......
...@@ -59,14 +59,15 @@ from The Open Group. ...@@ -59,14 +59,15 @@ from The Open Group.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
void XSetWMSizeHints (dpy, w, hints, prop) void XSetWMSizeHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
Atom prop; Atom prop)
{ {
xPropSizeHints data; xPropSizeHints data;
memset(&data, 0, sizeof(data));
data.flags = (hints->flags & data.flags = (hints->flags &
(USPosition|USSize|PPosition|PSize|PMinSize|PMaxSize| (USPosition|USSize|PPosition|PSize|PMinSize|PMaxSize|
PResizeInc|PAspect|PBaseSize|PWinGravity)); PResizeInc|PAspect|PBaseSize|PWinGravity));
...@@ -75,24 +76,40 @@ void XSetWMSizeHints (dpy, w, hints, prop) ...@@ -75,24 +76,40 @@ void XSetWMSizeHints (dpy, w, hints, prop)
* The x, y, width, and height fields are obsolete; but, applications * The x, y, width, and height fields are obsolete; but, applications
* that want to work with old window managers might set them. * that want to work with old window managers might set them.
*/ */
if (hints->flags & (USPosition|PPosition)) {
data.x = hints->x; data.x = hints->x;
data.y = hints->y; data.y = hints->y;
}
if (hints->flags & (USSize|PSize)) {
data.width = hints->width; data.width = hints->width;
data.height = hints->height; data.height = hints->height;
}
if (hints->flags & PMinSize) {
data.minWidth = hints->min_width; data.minWidth = hints->min_width;
data.minHeight = hints->min_height; data.minHeight = hints->min_height;
}
if (hints->flags & PMaxSize) {
data.maxWidth = hints->max_width; data.maxWidth = hints->max_width;
data.maxHeight = hints->max_height; data.maxHeight = hints->max_height;
}
if (hints->flags & PResizeInc) {
data.widthInc = hints->width_inc; data.widthInc = hints->width_inc;
data.heightInc = hints->height_inc; data.heightInc = hints->height_inc;
}
if (hints->flags & PAspect) {
data.minAspectX = hints->min_aspect.x; data.minAspectX = hints->min_aspect.x;
data.minAspectY = hints->min_aspect.y; data.minAspectY = hints->min_aspect.y;
data.maxAspectX = hints->max_aspect.x; data.maxAspectX = hints->max_aspect.x;
data.maxAspectY = hints->max_aspect.y; data.maxAspectY = hints->max_aspect.y;
}
if (hints->flags & PBaseSize) {
data.baseWidth = hints->base_width; data.baseWidth = hints->base_width;
data.baseHeight = hints->base_height; data.baseHeight = hints->base_height;
}
if (hints->flags & PWinGravity) {
data.winGravity = hints->win_gravity; data.winGravity = hints->win_gravity;
}
XChangeProperty (dpy, w, prop, XA_WM_SIZE_HINTS, 32, XChangeProperty (dpy, w, prop, XA_WM_SIZE_HINTS, 32,
PropModeReplace, (unsigned char *) &data, PropModeReplace, (unsigned char *) &data,
...@@ -100,10 +117,10 @@ void XSetWMSizeHints (dpy, w, hints, prop) ...@@ -100,10 +117,10 @@ void XSetWMSizeHints (dpy, w, hints, prop)
} }
void XSetWMNormalHints (dpy, w, hints) void XSetWMNormalHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints)
{ {
XSetWMSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS); XSetWMSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS);
} }
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetPlaneMask (dpy, gc, planemask) XSetPlaneMask (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long planemask; /* CARD32 */ unsigned long planemask) /* CARD32 */
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.plane_mask != planemask) { if (gc->values.plane_mask != planemask) {
......
...@@ -52,14 +52,13 @@ XSetPointerMapping ( ...@@ -52,14 +52,13 @@ XSetPointerMapping (
} }
int int
XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode, XChangeKeyboardMapping (
keysyms, nkeycodes) register Display *dpy,
register Display *dpy; int first_keycode,
int first_keycode; int keysyms_per_keycode,
int keysyms_per_keycode; KeySym *keysyms,
KeySym *keysyms; int nkeycodes)
int nkeycodes; {
{
register long nbytes; register long nbytes;
register xChangeKeyboardMappingReq *req; register xChangeKeyboardMappingReq *req;
...@@ -68,7 +67,6 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode, ...@@ -68,7 +67,6 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode,
req->firstKeyCode = first_keycode; req->firstKeyCode = first_keycode;
req->keyCodes = nkeycodes; req->keyCodes = nkeycodes;
req->keySymsPerKeyCode = keysyms_per_keycode; req->keySymsPerKeyCode = keysyms_per_keycode;
req->firstKeyCode = first_keycode;
req->length += nkeycodes * keysyms_per_keycode; req->length += nkeycodes * keysyms_per_keycode;
nbytes = keysyms_per_keycode * nkeycodes * 4; nbytes = keysyms_per_keycode * nkeycodes * 4;
Data32 (dpy, (long *)keysyms, nbytes); Data32 (dpy, (long *)keysyms, nbytes);
...@@ -76,4 +74,3 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode, ...@@ -76,4 +74,3 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode,
SyncHandle(); SyncHandle();
return 0; return 0;
} }
...@@ -35,12 +35,12 @@ from The Open Group. ...@@ -35,12 +35,12 @@ from The Open Group.
#include "Xatomtype.h" #include "Xatomtype.h"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
void XSetRGBColormaps (dpy, w, cmaps, count, property) void XSetRGBColormaps (
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap *cmaps; XStandardColormap *cmaps,
int count; int count,
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
register int i; /* iterator variable */ register int i; /* iterator variable */
register xPropStandardColormap *map; /* tmp variable, data in prop */ register xPropStandardColormap *map; /* tmp variable, data in prop */
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetSelectionOwner(dpy, selection, owner, time) XSetSelectionOwner(
register Display *dpy; register Display *dpy,
Atom selection; Atom selection,
Window owner; Window owner,
Time time; Time time)
{ {
register xSetSelectionOwnerReq *req; register xSetSelectionOwnerReq *req;
......
...@@ -30,9 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetScreenSaver(dpy, timeout, interval, prefer_blank, allow_exp) XSetScreenSaver(
register Display *dpy; register Display *dpy,
int timeout, interval, prefer_blank, allow_exp; int timeout,
int interval,
int prefer_blank,
int allow_exp)
{ {
register xSetScreenSaverReq *req; register xSetScreenSaverReq *req;
......
...@@ -61,11 +61,11 @@ SOFTWARE. ...@@ -61,11 +61,11 @@ SOFTWARE.
* in the XStandardColormap structure. * in the XStandardColormap structure.
*/ */
void XSetStandardColormap(dpy, w, cmap, property) void XSetStandardColormap(
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap *cmap; XStandardColormap *cmap,
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
Screen *sp; Screen *sp;
XStandardColormap stdcmap; XStandardColormap stdcmap;
...@@ -87,6 +87,9 @@ void XSetStandardColormap(dpy, w, cmap, property) ...@@ -87,6 +87,9 @@ void XSetStandardColormap(dpy, w, cmap, property)
stdcmap.visualid = sp->root_visual->visualid; stdcmap.visualid = sp->root_visual->visualid;
stdcmap.killid = None; /* don't know how to kill this one */ stdcmap.killid = None; /* don't know how to kill this one */
#ifdef XCMS
XSetRGBColormaps (dpy, w, &stdcmap, 1, property); XSetRGBColormaps (dpy, w, &stdcmap, 1, property);
#endif
return; return;
} }
...@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetState(dpy, gc, foreground, background, function, planemask) XSetState(
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int function; unsigned long foreground,
unsigned long planemask; unsigned long background,
unsigned long foreground, background; int function,
unsigned long planemask)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetStipple (dpy, gc, stipple) XSetStipple (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Pixmap stipple; Pixmap stipple)
{ {
LockDisplay(dpy); LockDisplay(dpy);
/* always update, since client may have changed pixmap contents */ /* always update, since client may have changed pixmap contents */
......
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetTSOrigin (dpy, gc, x, y) XSetTSOrigin (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int x, y; int x,
int y)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetTile (dpy, gc, tile) XSetTile (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Pixmap tile; Pixmap tile)
{ {
LockDisplay(dpy); LockDisplay(dpy);
/* always update, since client may have changed pixmap contents */ /* always update, since client may have changed pixmap contents */
......
...@@ -57,36 +57,36 @@ from The Open Group. ...@@ -57,36 +57,36 @@ from The Open Group.
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
#include <stdio.h> #include <stdio.h>
void XSetTextProperty (dpy, w, tp, property) void XSetTextProperty (
Display *dpy; Display *dpy,
Window w; Window w,
Atom property; XTextProperty *tp,
XTextProperty *tp; Atom property)
{ {
XChangeProperty (dpy, w, property, tp->encoding, tp->format, XChangeProperty (dpy, w, property, tp->encoding, tp->format,
PropModeReplace, tp->value, tp->nitems); PropModeReplace, tp->value, tp->nitems);
} }
void XSetWMName (dpy, w, tp) void XSetWMName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
XSetTextProperty (dpy, w, tp, XA_WM_NAME); XSetTextProperty (dpy, w, tp, XA_WM_NAME);
} }
void XSetWMIconName (dpy, w, tp) void XSetWMIconName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
XSetTextProperty (dpy, w, tp, XA_WM_ICON_NAME); XSetTextProperty (dpy, w, tp, XA_WM_ICON_NAME);
} }
void XSetWMClientMachine (dpy, w, tp) void XSetWMClientMachine (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
XSetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE); XSetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE);
} }
......
...@@ -57,11 +57,11 @@ SOFTWARE. ...@@ -57,11 +57,11 @@ SOFTWARE.
* WM_COLORMAP_WINDOWS type: WINDOW format:32 * WM_COLORMAP_WINDOWS type: WINDOW format:32
*/ */
Status XSetWMColormapWindows (dpy, w, windows, count) Status XSetWMColormapWindows (
Display *dpy; Display *dpy,
Window w; Window w,
Window *windows; Window *windows,
int count; int count)
{ {
Atom prop; Atom prop;
......
...@@ -57,11 +57,11 @@ SOFTWARE. ...@@ -57,11 +57,11 @@ SOFTWARE.
* WM_PROTOCOLS type: ATOM format: 32 * WM_PROTOCOLS type: ATOM format: 32
*/ */
Status XSetWMProtocols (dpy, w, protocols, count) Status XSetWMProtocols (
Display *dpy; Display *dpy,
Window w; Window w,
Atom *protocols; Atom *protocols,
int count; int count)
{ {
Atom prop; Atom prop;
......
...@@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
/* insulate predefined atom numbers from cut routines */ /* insulate predefined atom numbers from cut routines */
static Atom n_to_atom[8] = { static const Atom n_to_atom[8] = {
XA_CUT_BUFFER0, XA_CUT_BUFFER0,
XA_CUT_BUFFER1, XA_CUT_BUFFER1,
XA_CUT_BUFFER2, XA_CUT_BUFFER2,
...@@ -42,17 +42,20 @@ static Atom n_to_atom[8] = { ...@@ -42,17 +42,20 @@ static Atom n_to_atom[8] = {
XA_CUT_BUFFER7}; XA_CUT_BUFFER7};
int int
XRotateBuffers (dpy, rotate) XRotateBuffers (
register Display *dpy; register Display *dpy,
int rotate; int rotate)
{ {
return XRotateWindowProperties(dpy, RootWindow(dpy, 0), n_to_atom, 8, rotate); /* XRotateWindowProperties wants a non-const Atom*, but it doesn't
* modify it, so this is safe.
*/
return XRotateWindowProperties(dpy, RootWindow(dpy, 0), (Atom *)n_to_atom, 8, rotate);
} }
char *XFetchBuffer (dpy, nbytes, buffer) char *XFetchBuffer (
register Display *dpy; register Display *dpy,
int *nbytes; int *nbytes,
register int buffer; register int buffer)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
...@@ -75,9 +78,9 @@ char *XFetchBuffer (dpy, nbytes, buffer) ...@@ -75,9 +78,9 @@ char *XFetchBuffer (dpy, nbytes, buffer)
return(NULL); return(NULL);
} }
char *XFetchBytes (dpy, nbytes) char *XFetchBytes (
register Display *dpy; register Display *dpy,
int *nbytes; int *nbytes)
{ {
return (XFetchBuffer (dpy, nbytes, 0)); return (XFetchBuffer (dpy, nbytes, 0));
} }
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XStoreColor(dpy, cmap, def) XStoreColor(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *def; XColor *def)
{ {
xColorItem *citem; xColorItem *citem;
register xStoreColorsReq *req; register xStoreColorsReq *req;
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XStoreColors(dpy, cmap, defs, ncolors) XStoreColors(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *defs; XColor *defs,
int ncolors; int ncolors)
{ {
register int i; register int i;
xColorItem citem; xColorItem citem;
......
...@@ -46,6 +46,7 @@ int flags) /* DoRed, DoGreen, DoBlue */ ...@@ -46,6 +46,7 @@ int flags) /* DoRed, DoGreen, DoBlue */
XcmsColor cmsColor_exact; XcmsColor cmsColor_exact;
XColor scr_def; XColor scr_def;
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms approach to Parse Color * Let's Attempt to use Xcms approach to Parse Color
*/ */
...@@ -62,6 +63,7 @@ int flags) /* DoRed, DoGreen, DoBlue */ ...@@ -62,6 +63,7 @@ int flags) /* DoRed, DoGreen, DoBlue */
* name. Thus pass name to the X Server. * name. Thus pass name to the X Server.
*/ */
} }
#endif
/* /*
* The Xcms and i18n methods failed, so lets pass it to the server * The Xcms and i18n methods failed, so lets pass it to the server
......
...@@ -53,7 +53,7 @@ _XInitKeysymDB(void) ...@@ -53,7 +53,7 @@ _XInitKeysymDB(void)
{ {
if (!initialized) if (!initialized)
{ {
char *dbname; const char *dbname;
XrmInitialize(); XrmInitialize();
/* use and name of this env var is not part of the standard */ /* use and name of this env var is not part of the standard */
......
...@@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group.
* count. * count.
*/ */
Status XStringListToTextProperty (argv, argc, textprop) Status XStringListToTextProperty (
char **argv; char **argv,
int argc; int argc,
XTextProperty *textprop; XTextProperty *textprop)
{ {
register int i; register int i;
register unsigned int nbytes; register unsigned int nbytes;
......
...@@ -32,9 +32,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,9 +32,9 @@ in this Software without prior written authorization from The Open Group.
/* Synchronize with errors and events, optionally discarding pending events */ /* Synchronize with errors and events, optionally discarding pending events */
int int
XSync (dpy, discard) XSync (
register Display *dpy; register Display *dpy,
Bool discard; Bool discard)
{ {
xGetInputFocusReply rep; xGetInputFocusReply rep;
register xReq *req; register xReq *req;
......
...@@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group.
* null-separated STRING property. * null-separated STRING property.
*/ */
Status XTextPropertyToStringList (tp, list_return, count_return) Status XTextPropertyToStringList (
XTextProperty *tp; XTextProperty *tp,
char ***list_return; char ***list_return,
int *count_return; int *count_return)
{ {
char **list; /* return value */ char **list; /* return value */
int nelements; /* return value */ int nelements; /* return value */
...@@ -107,8 +107,7 @@ Status XTextPropertyToStringList (tp, list_return, count_return) ...@@ -107,8 +107,7 @@ Status XTextPropertyToStringList (tp, list_return, count_return)
} }
void XFreeStringList (list) void XFreeStringList (char **list)
char **list;
{ {
if (list) { if (list) {
if (list[0]) Xfree (list[0]); if (list[0]) Xfree (list[0]);
......
...@@ -29,13 +29,15 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,13 +29,15 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Bool XTranslateCoordinates(dpy, src_win, dest_win, src_x, src_y, Bool XTranslateCoordinates(
dst_x, dst_y, child) register Display *dpy,
register Display *dpy; Window src_win,
Window src_win, dest_win; Window dest_win,
int src_x, src_y; int src_x,
int *dst_x, *dst_y; int src_y,
Window *child; int *dst_x,
int *dst_y,
Window *child)
{ {
register xTranslateCoordsReq *req; register xTranslateCoordsReq *req;
xTranslateCoordsReply rep; xTranslateCoordsReply rep;
......
/* /*
* $XFree86: xc/lib/XThrStub/UIThrStubs.c,v 3.3 2001/11/18 21:13:26 herrb Exp $
* *
* Copyright (c) 1995 David E. Wexelblat. All rights reserved * Copyright (c) 1995 David E. Wexelblat. All rights reserved
* *
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUndefineCursor (dpy,w) XUndefineCursor (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
unsigned long defcurs = None; unsigned long defcurs = None;
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUngrabButton(dpy, button, modifiers, grab_window) XUngrabButton(
register Display *dpy; register Display *dpy,
unsigned int button; /* CARD8 */ unsigned int button, /* CARD8 */
unsigned int modifiers; /* CARD16 */ unsigned int modifiers, /* CARD16 */
Window grab_window; Window grab_window)
{ {
register xUngrabButtonReq *req; register xUngrabButtonReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUngrabKeyboard (dpy, time) XUngrabKeyboard (
register Display *dpy; register Display *dpy,
Time time; Time time)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUngrabKey(dpy, key, modifiers, grab_window) XUngrabKey(
register Display *dpy; register Display *dpy,
int key; int key,
unsigned int modifiers; unsigned int modifiers,
Window grab_window; Window grab_window)
{ {
register xUngrabKeyReq *req; register xUngrabKeyReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUngrabPointer(dpy, time) XUngrabPointer(
register Display *dpy; register Display *dpy,
Time time; Time time)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUngrabServer (dpy) XUngrabServer (
register Display *dpy; register Display *dpy)
{ {
register xReq *req; register xReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUninstallColormap(dpy, cmap) XUninstallColormap(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUnloadFont(dpy, font) XUnloadFont(
register Display *dpy; register Display *dpy,
Font font; Font font)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUnmapSubwindows(dpy, win) XUnmapSubwindows(
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUnmapWindow (dpy, w) XUnmapWindow (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -53,12 +53,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -53,12 +53,11 @@ in this Software without prior written authorization from The Open Group.
* VisualAllMask * VisualAllMask
*/ */
XVisualInfo *XGetVisualInfo( dpy, visual_info_mask, XVisualInfo *XGetVisualInfo(
visual_info_template, nitems) Display *dpy,
Display *dpy; register long visual_info_mask,
register long visual_info_mask; register XVisualInfo *visual_info_template,
register XVisualInfo *visual_info_template; int *nitems) /* RETURN */
int *nitems; /* RETURN */
{ {
register Visual *vp; register Visual *vp;
...@@ -189,12 +188,12 @@ int *nitems; /* RETURN */ ...@@ -189,12 +188,12 @@ int *nitems; /* RETURN */
* otherwise False is returned. * otherwise False is returned.
*/ */
Status XMatchVisualInfo( dpy, screen, depth, class, visual_info) Status XMatchVisualInfo(
Display *dpy; Display *dpy,
int screen; int screen,
int depth; int depth,
int class; int class,
XVisualInfo *visual_info; /* RETURNED */ XVisualInfo *visual_info) /* RETURNED */
{ {
Visual *vp; Visual *vp;
......
...@@ -69,19 +69,19 @@ SOFTWARE. ...@@ -69,19 +69,19 @@ SOFTWARE.
* WM_CLIENT_MACHINE type: TEXT format: varies? * WM_CLIENT_MACHINE type: TEXT format: varies?
* WM_NORMAL_HINTS type: WM_SIZE_HINTS format: 32 * WM_NORMAL_HINTS type: WM_SIZE_HINTS format: 32
* WM_CLASS type: STRING/STRING format: 8 * WM_CLASS type: STRING/STRING format: 8
* WM_LOCALE_NAME type: STRING format: 8
*/ */
void XSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints, void XSetWMProperties (
wmHints, classHints) Display *dpy,
Display *dpy; Window w, /* window to decorate */
Window w; /* window to decorate */ XTextProperty *windowName, /* name of application */
XTextProperty *windowName; /* name of application */ XTextProperty *iconName, /* name string for icon */
XTextProperty *iconName; /* name string for icon */ char **argv, /* command line */
char **argv; /* command line */ int argc, /* size of command line */
int argc; /* size of command line */ XSizeHints *sizeHints, /* size hints for window in its normal state */
XSizeHints *sizeHints; /* size hints for window in its normal state */ XWMHints *wmHints, /* miscelaneous window manager hints */
XWMHints *wmHints; /* miscelaneous window manager hints */ XClassHint *classHints) /* resource name and class */
XClassHint *classHints; /* resource name and class */
{ {
XTextProperty textprop; XTextProperty textprop;
char hostName[256]; char hostName[256];
......
...@@ -30,13 +30,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,16 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XWarpPointer(dpy, src_win, dest_win, src_x, src_y, src_width, src_height, XWarpPointer(
dest_x, dest_y) register Display *dpy,
register Display *dpy; Window src_win,
Window src_win, dest_win; Window dest_win,
int src_x, src_y; int src_x,
unsigned int src_width, src_height; int src_y,
int dest_x, dest_y; unsigned int src_width,
unsigned int src_height,
int dest_x,
int dest_y)
{ {
register xWarpPointerReq *req; register xWarpPointerReq *req;
......
...@@ -97,17 +97,19 @@ void _XProcessWindowAttributes ( ...@@ -97,17 +97,19 @@ void _XProcessWindowAttributes (
CWOverrideRedirect|CWSaveUnder|CWEventMask|\ CWOverrideRedirect|CWSaveUnder|CWEventMask|\
CWDontPropagate|CWColormap|CWCursor) CWDontPropagate|CWColormap|CWCursor)
Window XCreateWindow(dpy, parent, x, y, width, height, Window XCreateWindow(
borderWidth, depth, class, visual, valuemask, attributes) register Display *dpy,
register Display *dpy; Window parent,
Window parent; int x,
int x, y; int y,
unsigned int width, height, borderWidth; unsigned int width,
int depth; unsigned int height,
unsigned int class; unsigned int borderWidth,
Visual *visual; int depth,
unsigned long valuemask; unsigned int class,
XSetWindowAttributes *attributes; Visual *visual,
unsigned long valuemask,
XSetWindowAttributes *attributes)
{ {
Window wid; Window wid;
register xCreateWindowReq *req; register xCreateWindowReq *req;
......
...@@ -62,10 +62,10 @@ from The Open Group. ...@@ -62,10 +62,10 @@ from The Open Group.
* This function instructs the window manager to change this window from * This function instructs the window manager to change this window from
* NormalState or IconicState to Withdrawn. * NormalState or IconicState to Withdrawn.
*/ */
Status XWithdrawWindow (dpy, w, screen) Status XWithdrawWindow (
Display *dpy; Display *dpy,
Window w; Window w,
int screen; int screen)
{ {
XUnmapEvent ev; XUnmapEvent ev;
Window root = RootWindow (dpy, screen); Window root = RootWindow (dpy, screen);
......
...@@ -34,7 +34,7 @@ from The Open Group. ...@@ -34,7 +34,7 @@ from The Open Group.
#include "Xutil.h" #include "Xutil.h"
#include <stdio.h> #include <stdio.h>
#define ERR_RETURN 0 #define ERR_RETURN NULL
static char *Format_Image( static char *Format_Image(
XImage *image, XImage *image,
......
/* $XFree86$ */
#ifndef _XINTATOM_H_ #ifndef _XINTATOM_H_
#define _XINTATOM_H_ 1 #define _XINTATOM_H_ 1
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
_XFUNCPROTOBEGIN _XFUNCPROTOBEGIN
#if !USE_XCB
/* ConnDis.c */ /* ConnDis.c */
int _XConnectDisplay ( int _XConnectDisplay (
...@@ -26,6 +27,7 @@ extern XtransConnInfo _X11TransConnectDisplay(char *display_name, ...@@ -26,6 +27,7 @@ extern XtransConnInfo _X11TransConnectDisplay(char *display_name,
int *screenp, char **auth_namep, int *screenp, char **auth_namep,
int *auth_namelenp, char **auth_datap, int *auth_namelenp, char **auth_datap,
int *auth_datalenp); int *auth_datalenp);
#endif /* !USE_XCB */
/* OpenDis.c */ /* OpenDis.c */
extern void _XFreeDisplayStructure(Display *dpy); extern void _XFreeDisplayStructure(Display *dpy);
......
/* $XFree86$ */
#ifndef _XRESINTERNAL_H_ #ifndef _XRESINTERNAL_H_
#define _XRESINTERNAL_H_ #define _XRESINTERNAL_H_
......
...@@ -333,7 +333,6 @@ void XrmInitialize(void) ...@@ -333,7 +333,6 @@ void XrmInitialize(void)
XrmQANY = XrmPermStringToQuark("?"); XrmQANY = XrmPermStringToQuark("?");
} }
#ifndef _XP_PRINT_SERVER_
XrmDatabase XrmGetDatabase( XrmDatabase XrmGetDatabase(
Display *display) Display *display)
{ {
...@@ -357,7 +356,6 @@ void XrmSetDatabase( ...@@ -357,7 +356,6 @@ void XrmSetDatabase(
display->db = database; display->db = database;
UnlockDisplay(display); UnlockDisplay(display);
} }
#endif /* !_XP_PRINT_SERVER_ */
void void
XrmStringToQuarkList( XrmStringToQuarkList(
...@@ -501,11 +499,7 @@ static XrmDatabase NewDatabase(void) ...@@ -501,11 +499,7 @@ static XrmDatabase NewDatabase(void)
_XCreateMutex(&db->linfo); _XCreateMutex(&db->linfo);
db->table = (NTable)NULL; db->table = (NTable)NULL;
db->mbstate = (XPointer)NULL; db->mbstate = (XPointer)NULL;
#ifdef _XP_PRINT_SERVER_
db->methods = NULL;
#else
db->methods = _XrmInitParseInfo(&db->mbstate); db->methods = _XrmInitParseInfo(&db->mbstate);
#endif
if (!db->methods) if (!db->methods)
db->methods = &mb_methods; db->methods = &mb_methods;
} }
...@@ -806,6 +800,7 @@ void XrmCombineDatabase( ...@@ -806,6 +800,7 @@ void XrmCombineDatabase(
} }
} }
(from->methods->destroy)(from->mbstate); (from->methods->destroy)(from->mbstate);
_XUnlockMutex(&from->linfo);
_XFreeMutex(&from->linfo); _XFreeMutex(&from->linfo);
Xfree((char *)from); Xfree((char *)from);
_XUnlockMutex(&(*into)->linfo); _XUnlockMutex(&(*into)->linfo);
...@@ -2570,12 +2565,8 @@ Bool XrmQGetResource( ...@@ -2570,12 +2565,8 @@ Bool XrmQGetResource(
} }
Bool Bool
XrmGetResource(db, name_str, class_str, pType_str, pValue) XrmGetResource(XrmDatabase db, _Xconst char *name_str, _Xconst char *class_str,
XrmDatabase db; XrmString *pType_str, XrmValuePtr pValue)
_Xconst char *name_str;
_Xconst char *class_str;
XrmString *pType_str; /* RETURN */
XrmValuePtr pValue; /* RETURN */
{ {
XrmName names[MAXDBDEPTH+1]; XrmName names[MAXDBDEPTH+1];
XrmClass classes[MAXDBDEPTH+1]; XrmClass classes[MAXDBDEPTH+1];
...@@ -2654,6 +2645,7 @@ void XrmDestroyDatabase( ...@@ -2654,6 +2645,7 @@ void XrmDestroyDatabase(
else else
DestroyNTable(table); DestroyNTable(table);
} }
_XUnlockMutex(&db->linfo);
_XFreeMutex(&db->linfo); _XFreeMutex(&db->linfo);
(*db->methods->destroy)(db->mbstate); (*db->methods->destroy)(db->mbstate);
Xfree((char *)db); Xfree((char *)db);
......
/* $TOG: imConv.c /main/20 1998/06/17 15:46:41 kaleb $ */
/****************************************************************** /******************************************************************
Copyright 1991, 1992 by Fuji Xerox Co.,Ltd. Copyright 1991, 1992 by Fuji Xerox Co.,Ltd.
...@@ -65,11 +64,11 @@ typedef int (*ucstocsConvProc)( ...@@ -65,11 +64,11 @@ typedef int (*ucstocsConvProc)(
); );
struct SubstRec { struct SubstRec {
char* encoding_name; const char encoding_name[8];
char* charset_name; const char charset_name[12];
}; };
static struct SubstRec SubstTable[] = { static const struct SubstRec SubstTable[] = {
{"STRING", "ISO8859-1"}, {"STRING", "ISO8859-1"},
{"TIS620", "TIS620-0"}, {"TIS620", "TIS620-0"},
{"UTF-8", "ISO10646-1"} {"UTF-8", "ISO10646-1"}
...@@ -156,13 +155,13 @@ static int lookup_string( ...@@ -156,13 +155,13 @@ static int lookup_string(
#define BUF_SIZE (20) #define BUF_SIZE (20)
int int
_XimLookupMBText(ic, event, buffer, nbytes, keysym, status) _XimLookupMBText(
Xic ic; Xic ic,
XKeyEvent* event; XKeyEvent* event,
char* buffer; char* buffer,
int nbytes; int nbytes,
KeySym* keysym; KeySym* keysym,
XComposeStatus* status; XComposeStatus* status)
{ {
int count; int count;
KeySym symbol; KeySym symbol;
...@@ -227,13 +226,13 @@ _XimLookupMBText(ic, event, buffer, nbytes, keysym, status) ...@@ -227,13 +226,13 @@ _XimLookupMBText(ic, event, buffer, nbytes, keysym, status)
} }
int int
_XimLookupWCText(ic, event, buffer, nbytes, keysym, status) _XimLookupWCText(
Xic ic; Xic ic,
XKeyEvent* event; XKeyEvent* event,
wchar_t* buffer; wchar_t* buffer,
int nbytes; int nbytes,
KeySym* keysym; KeySym* keysym,
XComposeStatus* status; XComposeStatus* status)
{ {
int count; int count;
KeySym symbol; KeySym symbol;
...@@ -299,13 +298,13 @@ _XimLookupWCText(ic, event, buffer, nbytes, keysym, status) ...@@ -299,13 +298,13 @@ _XimLookupWCText(ic, event, buffer, nbytes, keysym, status)
} }
int int
_XimLookupUTF8Text(ic, event, buffer, nbytes, keysym, status) _XimLookupUTF8Text(
Xic ic; Xic ic,
XKeyEvent* event; XKeyEvent* event,
char* buffer; char* buffer,
int nbytes; int nbytes,
KeySym* keysym; KeySym* keysym,
XComposeStatus* status; XComposeStatus* status)
{ {
int count; int count;
KeySym symbol; KeySym symbol;
......
...@@ -45,11 +45,23 @@ in this Software without prior written authorization from The Open Group. ...@@ -45,11 +45,23 @@ in this Software without prior written authorization from The Open Group.
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
#include "Xprivate.h"
#include "locking.h" #include "locking.h"
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
#include <stdio.h> /* for warn/debug stuff */ #include <stdio.h> /* for warn/debug stuff */
#endif #endif
/* Additional arguments for source code location lock call was made from */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
# define XTHREADS_FILE_LINE_ARGS \
, \
char* file, /* source file, from macro */ \
int line
#else
# define XTHREADS_FILE_LINE_ARGS /* None */
#endif
#define NUM_FREE_CVLS 4 #define NUM_FREE_CVLS 4
/* in lcWrap.c */ /* in lcWrap.c */
...@@ -58,14 +70,14 @@ extern LockInfoPtr _Xi18n_lock; ...@@ -58,14 +70,14 @@ extern LockInfoPtr _Xi18n_lock;
#ifdef WIN32 #ifdef WIN32
static DWORD _X_TlsIndex = (DWORD)-1; static DWORD _X_TlsIndex = (DWORD)-1;
_Xthread_init() void _Xthread_init(void)
{ {
if (_X_TlsIndex == (DWORD)-1) if (_X_TlsIndex == (DWORD)-1)
_X_TlsIndex = TlsAlloc(); _X_TlsIndex = TlsAlloc();
} }
struct _xthread_waiter * struct _xthread_waiter *
_Xthread_waiter() _Xthread_waiter(void)
{ {
struct _xthread_waiter *me; struct _xthread_waiter *me;
...@@ -87,28 +99,18 @@ static xthread_t _Xthread_self(void) ...@@ -87,28 +99,18 @@ static xthread_t _Xthread_self(void)
static LockInfoRec global_lock; static LockInfoRec global_lock;
static LockInfoRec i18n_lock; static LockInfoRec i18n_lock;
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XLockMutex(lip,file,line)
LockInfoPtr lip;
char* file;
int line;
#else
static void _XLockMutex( static void _XLockMutex(
LockInfoPtr lip) LockInfoPtr lip
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
xmutex_lock(lip->lock); xmutex_lock(lip->lock);
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XUnlockMutex( static void _XUnlockMutex(
LockInfoPtr lip, LockInfoPtr lip
char* file, XTHREADS_FILE_LINE_ARGS
int line) )
#else
static void _XUnlockMutex(
LockInfoPtr lip)
#endif
{ {
xmutex_unlock(lip->lock); xmutex_unlock(lip->lock);
} }
...@@ -200,15 +202,10 @@ static void _XLockDisplayWarn( ...@@ -200,15 +202,10 @@ static void _XLockDisplayWarn(
} }
#endif /* XTHREADS_WARN */ #endif /* XTHREADS_WARN */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XUnlockDisplay(dpy,file,line)
Display *dpy;
char *file;
int line;
#else
static void _XUnlockDisplay( static void _XUnlockDisplay(
Display *dpy) Display *dpy
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
xthread_t self = xthread_self(); xthread_t self = xthread_self();
...@@ -328,17 +325,11 @@ static void _XPopReader( ...@@ -328,17 +325,11 @@ static void _XPopReader(
} }
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XConditionWait(cv, mutex,file,line)
xcondition_t cv;
xmutex_t mutex;
char *file;
int line;
#else
static void _XConditionWait( static void _XConditionWait(
xcondition_t cv, xcondition_t cv,
xmutex_t mutex) xmutex_t mutex
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
xthread_t self = xthread_self(); xthread_t self = xthread_self();
...@@ -379,15 +370,10 @@ static void _XConditionWait( ...@@ -379,15 +370,10 @@ static void _XConditionWait(
#endif /* XTHREADS_WARN */ #endif /* XTHREADS_WARN */
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XConditionSignal(cv,file,line)
xcondition_t cv;
char *file;
int line;
#else
static void _XConditionSignal( static void _XConditionSignal(
xcondition_t cv) xcondition_t cv
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
#ifdef XTHREADS_DEBUG #ifdef XTHREADS_DEBUG
...@@ -398,15 +384,10 @@ static void _XConditionSignal( ...@@ -398,15 +384,10 @@ static void _XConditionSignal(
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XConditionBroadcast(cv,file,line)
xcondition_t cv;
char *file;
int line;
#else
static void _XConditionBroadcast( static void _XConditionBroadcast(
xcondition_t cv) xcondition_t cv
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
#ifdef XTHREADS_DEBUG #ifdef XTHREADS_DEBUG
...@@ -467,15 +448,10 @@ static void _XDisplayLockWait( ...@@ -467,15 +448,10 @@ static void _XDisplayLockWait(
} }
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XLockDisplay(dpy, file, line)
Display *dpy;
char *file; /* source file, from macro */
int line;
#else
static void _XLockDisplay( static void _XLockDisplay(
Display *dpy) Display *dpy
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
_XLockDisplayWarn(dpy, file, line); _XLockDisplayWarn(dpy, file, line);
...@@ -484,23 +460,19 @@ static void _XLockDisplay( ...@@ -484,23 +460,19 @@ static void _XLockDisplay(
#endif #endif
if (dpy->lock->locking_level > 0) if (dpy->lock->locking_level > 0)
_XDisplayLockWait(dpy); _XDisplayLockWait(dpy);
_XIDHandler(dpy);
_XSeqSyncFunction(dpy);
} }
/* /*
* _XReply is allowed to exit from select/poll and clean up even if a * _XReply is allowed to exit from select/poll and clean up even if a
* user-level lock is in force, so it uses this instead of _XFancyLockDisplay. * user-level lock is in force, so it uses this instead of _XFancyLockDisplay.
*/ */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XInternalLockDisplay(dpy, wskip, file, line)
Display *dpy;
Bool wskip;
char *file; /* source file, from macro */
int line;
#else
static void _XInternalLockDisplay( static void _XInternalLockDisplay(
Display *dpy, Display *dpy,
Bool wskip) Bool wskip
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
_XLockDisplayWarn(dpy, file, line); _XLockDisplayWarn(dpy, file, line);
...@@ -595,7 +567,7 @@ xthread_t (*_x11_thr_self)() = __x11_thr_self; ...@@ -595,7 +567,7 @@ xthread_t (*_x11_thr_self)() = __x11_thr_self;
#endif #endif
Status XInitThreads() Status XInitThreads(void)
{ {
if (_Xglobal_lock) if (_Xglobal_lock)
return 1; return 1;
...@@ -644,7 +616,7 @@ Status XInitThreads() ...@@ -644,7 +616,7 @@ Status XInitThreads()
} }
#else /* XTHREADS */ #else /* XTHREADS */
Status XInitThreads() Status XInitThreads(void)
{ {
return 0; return 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