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.
*/
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
Status XAllocColorCells(dpy, cmap, contig, masks, nplanes, pixels, ncolors)
register Display *dpy;
Colormap cmap;
Bool contig;
unsigned int ncolors; /* CARD16 */
unsigned int nplanes; /* CARD16 */
unsigned long *masks; /* LISTofCARD32 */ /* RETURN */
unsigned long *pixels; /* LISTofCARD32 */ /* RETURN */
Status XAllocColorCells(
register Display *dpy,
Colormap cmap,
Bool contig,
unsigned long *masks, /* LISTofCARD32 */ /* RETURN */
unsigned int nplanes, /* CARD16 */
unsigned long *pixels, /* LISTofCARD32 */ /* RETURN */
unsigned int ncolors) /* CARD16 */
{
Status status;
......
......@@ -29,15 +29,18 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
Status XAllocColorPlanes(dpy, cmap, contig, pixels, ncolors, nreds, ngreens,
nblues, rmask, gmask, bmask)
register Display *dpy;
Colormap cmap;
Bool contig;
unsigned long *pixels; /* LISTofCARD32 */ /* RETURN */
int ncolors;
int nreds, ngreens, nblues;
unsigned long *rmask, *gmask, *bmask; /* CARD32 */ /* RETURN */
Status XAllocColorPlanes(
register Display *dpy,
Colormap cmap,
Bool contig,
unsigned long *pixels, /* LISTofCARD32 */ /* RETURN */
int ncolors,
int nreds,
int ngreens,
int nblues,
unsigned long *rmask,
unsigned long *gmask,
unsigned long *bmask) /* CARD32 */ /* RETURN */
{
xAllocColorPlanesReply rep;
Status status;
......@@ -68,4 +71,4 @@ unsigned long *rmask, *gmask, *bmask; /* CARD32 */ /* RETURN */
UnlockDisplay(dpy);
SyncHandle();
return(status);
}
}
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XAllowEvents(dpy, mode, time)
register Display *dpy;
int mode;
Time time;
XAllowEvents(
register Display *dpy,
int mode,
Time time)
{
register xAllowEventsReq *req;
......
......@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XAutoRepeatOn (dpy)
register Display *dpy;
XAutoRepeatOn (register Display *dpy)
{
XKeyboardControl values;
values.auto_repeat_mode = AutoRepeatModeOn;
......@@ -40,8 +39,7 @@ register Display *dpy;
}
int
XAutoRepeatOff (dpy)
register Display *dpy;
XAutoRepeatOff (register Display *dpy)
{
XKeyboardControl values;
values.auto_repeat_mode = AutoRepeatModeOff;
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XSetWindowBackground(dpy, w, pixel)
register Display *dpy;
Window w;
unsigned long pixel;
XSetWindowBackground(
register Display *dpy,
Window w,
unsigned long pixel)
{
register xChangeWindowAttributesReq *req;
......
......@@ -33,10 +33,10 @@ from The Open Group.
#include "Xlibint.h"
int
XSetWindowBorderWidth(dpy, w, width)
Display *dpy;
Window w;
unsigned int width;
XSetWindowBorderWidth(
Display *dpy,
Window w,
unsigned int width)
{
unsigned long lwidth = width; /* must be CARD32 */
......
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XBell(dpy, percent)
register Display *dpy;
int percent;
XBell(
register Display *dpy,
int percent)
{
register xBellReq *req;
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XSetWindowBorder(dpy, w, pixel)
register Display *dpy;
Window w;
unsigned long pixel;
XSetWindowBorder(
register Display *dpy,
Window w,
unsigned long pixel)
{
register xChangeWindowAttributesReq *req;
......
......@@ -30,25 +30,21 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XEnableAccessControl(dpy)
register Display *dpy;
XEnableAccessControl(register Display *dpy)
{
return XSetAccessControl(dpy, EnableAccess);
}
int
XDisableAccessControl(dpy)
register Display *dpy;
XDisableAccessControl(register Display *dpy)
{
return XSetAccessControl(dpy, DisableAccess);
}
int
XSetAccessControl(dpy, mode)
register Display *dpy;
int mode;
XSetAccessControl(
register Display *dpy,
int mode)
{
register xSetAccessControlReq *req;
......
......@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XChangeActivePointerGrab(dpy, event_mask, curs, time)
register Display *dpy;
unsigned int event_mask; /* CARD16 */
Cursor curs;
Time time;
XChangeActivePointerGrab(
register Display *dpy,
unsigned int event_mask, /* CARD16 */
Cursor curs,
Time time)
{
register xChangeActivePointerGrabReq *req;
......
......@@ -30,10 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XSetCloseDownMode(dpy, mode)
register Display *dpy;
int mode;
XSetCloseDownMode(
register Display *dpy,
int mode)
{
register xSetCloseDownModeReq *req;
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XSetWindowColormap(dpy, w, colormap)
register Display *dpy;
Window w;
Colormap colormap;
XSetWindowColormap(
register Display *dpy,
Window w,
Colormap colormap)
{
register xChangeWindowAttributesReq *req;
......
......@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
#include "Cr.h"
int
XChangeGC (dpy, gc, valuemask, values)
register Display *dpy;
GC gc;
unsigned long valuemask;
XGCValues *values;
XChangeGC (
register Display *dpy,
GC gc,
unsigned long valuemask,
XGCValues *values)
{
LockDisplay(dpy);
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XChangeKeyboardControl(dpy, mask, value_list)
register Display *dpy;
unsigned long mask;
XKeyboardControl *value_list;
XChangeKeyboardControl(
register Display *dpy,
unsigned long mask,
XKeyboardControl *value_list)
{
unsigned long values[8];
register unsigned long *value = values;
......@@ -46,7 +46,7 @@ XChangeKeyboardControl(dpy, mask, value_list)
if (mask & KBKeyClickPercent)
*value++ = value_list->key_click_percent;
if (mask & KBBellPercent)
*value++ = value_list->bell_percent;
......
......@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XChangePointerControl(dpy, do_acc, do_thresh, acc_numerator,
acc_denominator, threshold)
register Display *dpy;
Bool do_acc, do_thresh;
int acc_numerator, acc_denominator, threshold;
XChangePointerControl(
register Display *dpy,
Bool do_acc,
Bool do_thresh,
int acc_numerator,
int acc_denominator,
int threshold)
{
register xChangePointerControlReq *req;
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XChangeSaveSet(dpy, win, mode)
register Display *dpy;
Window win;
int mode;
XChangeSaveSet(
register Display *dpy,
Window win,
int mode)
{
register xChangeSaveSetReq *req;
......@@ -47,17 +47,17 @@ int mode;
}
int
XAddToSaveSet(dpy, win)
register Display *dpy;
Window win;
XAddToSaveSet(
register Display *dpy,
Window win)
{
return XChangeSaveSet(dpy,win,SetModeInsert);
}
int
XRemoveFromSaveSet (dpy, win)
register Display *dpy;
Window win;
XRemoveFromSaveSet (
register Display *dpy,
Window win)
{
return XChangeSaveSet(dpy,win,SetModeDelete);
}
......@@ -36,11 +36,11 @@ in this Software without prior written authorization from The Open Group.
CWDontPropagate|CWColormap|CWCursor)
int
XChangeWindowAttributes (dpy, w, valuemask, attributes)
register Display *dpy;
Window w;
unsigned long valuemask;
XSetWindowAttributes *attributes;
XChangeWindowAttributes (
register Display *dpy,
Window w,
unsigned long valuemask,
XSetWindowAttributes *attributes)
{
register xChangeWindowAttributesReq *req;
......
......@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XResizeWindow(dpy, w, width, height)
register Display *dpy;
Window w;
unsigned int width, height;
XResizeWindow(
register Display *dpy,
Window w,
unsigned int width,
unsigned int height)
{
register xConfigureWindowReq *req;
......
......@@ -35,28 +35,32 @@ extern long const _Xevent_to_mask[];
#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\
Button4MotionMask|Button5MotionMask)
/*
/*
* Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found.
*/
Bool XCheckMaskEvent (dpy, mask, event)
register Display *dpy;
long mask; /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */
Bool XCheckMaskEvent (
register Display *dpy,
long mask, /* Selected event mask. */
register XEvent *event) /* XEvent to be filled in. */
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
int n; /* time through count */
LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL;
for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if ((qelt->event.type < LASTEvent) &&
if ((qelt->event.type < GenericEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) ||
(mask & AllPointers) ||
......
......@@ -29,22 +29,26 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
/*
/*
* Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found.
*/
Bool XCheckTypedEvent (dpy, type, event)
register Display *dpy;
int type; /* Selected event type. */
register XEvent *event; /* XEvent to be filled in. */
Bool XCheckTypedEvent (
register Display *dpy,
int type, /* Selected event type. */
register XEvent *event) /* XEvent to be filled in. */
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
int n; /* time through count */
LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL;
for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head;
......
......@@ -29,23 +29,27 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
/*
/*
* Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found.
*/
Bool XCheckTypedWindowEvent (dpy, w, type, event)
register Display *dpy;
Window w; /* Selected window. */
int type; /* Selected event type. */
register XEvent *event; /* XEvent to be filled in. */
Bool XCheckTypedWindowEvent (
register Display *dpy,
Window w, /* Selected window. */
int type, /* Selected event type. */
register XEvent *event) /* XEvent to be filled in. */
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
int n; /* time through count */
LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL;
for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head;
......
......@@ -34,30 +34,34 @@ extern long const _Xevent_to_mask[];
#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\
Button4MotionMask|Button5MotionMask)
/*
/*
* Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found.
*/
Bool XCheckWindowEvent (dpy, w, mask, event)
register Display *dpy;
Window w; /* Selected window. */
long mask; /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */
Bool XCheckWindowEvent (
register Display *dpy,
Window w, /* Selected window. */
long mask, /* Selected event mask. */
register XEvent *event) /* XEvent to be filled in. */
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
int n; /* time through count */
LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL;
for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if ((qelt->event.xany.window == w) &&
(qelt->event.type < LASTEvent) &&
(qelt->event.type < GenericEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) ||
(mask & AllPointers) ||
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XCirculateSubwindows(dpy, w, direction)
register Display *dpy;
Window w;
int direction;
XCirculateSubwindows(
register Display *dpy,
Window w,
int direction)
{
register xCirculateWindowReq *req;
......
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XCirculateSubwindowsDown(dpy,w)
register Display *dpy;
Window w;
XCirculateSubwindowsDown(
register Display *dpy,
Window w)
{
register xCirculateWindowReq *req;
......
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XCirculateSubwindowsUp(dpy, w)
register Display *dpy;
Window w;
XCirculateSubwindowsUp(
register Display *dpy,
Window w)
{
register xCirculateWindowReq *req;
......
......@@ -30,12 +30,16 @@ from The Open Group.
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if USE_XCB
#include "Xxcbint.h"
#else /* !USE_XCB */
#include <nx-X11/Xtrans/Xtrans.h>
#endif /* USE_XCB */
#include "Xlib.h"
#include "Xlibint.h"
#include "Xintconn.h"
/*
/*
* XCloseDisplay - XSync the connection to the X Server, close the connection,
* and free all associated storage. Extension close procs should only free
* memory and must be careful about the types of requests they generate.
......@@ -68,7 +72,11 @@ XCloseDisplay (
if (dpy->request != dpy->last_request_read)
XSync(dpy, 1);
}
#if USE_XCB
xcb_disconnect(dpy->xcb->connection);
#else /* !USE_XCB */
_XDisconnectDisplay(dpy->trans_conn);
#endif /* USE_XCB */
_XFreeDisplayStructure (dpy);
return 0;
}
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XClearWindow(dpy, w)
register Display *dpy;
Window w;
XClearWindow(
register Display *dpy,
Window w)
{
register xClearAreaReq *req;
......
......@@ -30,12 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XClearArea (dpy, w, x, y, width, height, exposures)
register Display *dpy;
Window w;
int x, y;
unsigned int width, height;
Bool exposures;
XClearArea (
register Display *dpy,
Window w,
int x,
int y,
unsigned int width,
unsigned int height,
Bool exposures)
{
register xClearAreaReq *req;
......
/* $XFree86$ */
#ifndef _CMAP_H_
#define _CMAP_H_
......
......@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XMoveResizeWindow(dpy, w, x, y, width, height)
register Display *dpy;
Window w;
int x, y;
unsigned int width, height;
XMoveResizeWindow(
register Display *dpy,
Window w,
int x,
int y,
unsigned int width,
unsigned int height)
{
register xConfigureWindowReq *req;
......
......@@ -4,13 +4,13 @@ Copyright 1987, 1988, 1990 by Digital Equipment Corporation, Maynard,
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
both that copyright notice and this permission notice appear in
supporting documentation, and that the name Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
......@@ -154,7 +154,7 @@ static void _XFreeContextDB(Display *display)
/* Save the given value of data to correspond with the keys XID and context.
Returns nonzero error code if an error has occured, 0 otherwise.
Possible errors are Out-of-memory.
*/
*/
int XSaveContext(
Display *display,
......@@ -228,16 +228,12 @@ int XSaveContext(
/* Given an XID and context, returns the associated data. Note that data
/* Given an XID and context, returns the associated data. Note that data
here is a pointer since it is a return value. Returns nonzero error code
if an error has occured, 0 otherwise. Possible errors are Entry-not-found.
*/
int XFindContext(display, rid, context, data)
Display *display;
register XID rid;
register XContext context;
XPointer *data; /* RETURN */
int XFindContext(Display *display, XID rid, XContext context, XPointer *data)
{
register DB db;
register TableEntry entry;
......@@ -272,10 +268,7 @@ int XFindContext(display, rid, context, data)
with the same arguments.
*/
int XDeleteContext(display, rid, context)
Display *display;
register XID rid;
register XContext context;
int XDeleteContext(Display *display, XID rid, XContext context)
{
register DB db;
register TableEntry entry, *prev;
......
......@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XConvertSelection(dpy, selection, target, property, requestor, time)
register Display *dpy;
Atom selection, target;
Atom property;
Window requestor;
Time time;
XConvertSelection(
register Display *dpy,
Atom selection,
Atom target,
Atom property,
Window requestor,
Time time)
{
register xConvertSelectionReq *req;
......
......@@ -30,15 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XCopyArea(dpy, src_drawable, dst_drawable, gc,
src_x, src_y, width, height,
dst_x, dst_y)
register Display *dpy;
Drawable src_drawable, dst_drawable;
GC gc;
int src_x, src_y;
unsigned int width, height;
int dst_x, dst_y;
XCopyArea(
register Display *dpy,
Drawable src_drawable,
Drawable dst_drawable,
GC gc,
int src_x,
int src_y,
unsigned int width,
unsigned int height,
int dst_x,
int dst_y)
{
register xCopyAreaReq *req;
......
......@@ -40,9 +40,9 @@ extern XcmsCmapRec * _XcmsCopyCmapRecAndFree(Display *dpy,
Colormap copy_cmap);
#endif
Colormap XCopyColormapAndFree(dpy, src_cmap)
register Display *dpy;
Colormap src_cmap;
Colormap XCopyColormapAndFree(
register Display *dpy,
Colormap src_cmap)
{
Colormap mid;
register xCopyColormapAndFreeReq *req;
......@@ -59,6 +59,6 @@ Colormap src_cmap;
#if XCMS
_XcmsCopyCmapRecAndFree(dpy, src_cmap, mid);
#endif
return(mid);
}
......@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XCopyGC (dpy, srcGC, mask, destGC)
register Display *dpy;
unsigned long mask; /* which ones to set initially */
GC srcGC, destGC;
XCopyGC (
register Display *dpy,
GC srcGC,
unsigned long mask, /* which ones to set initially */
GC destGC)
{
register XGCValues *destgv = &destGC->values,
*srcgv = &srcGC->values;
......@@ -43,7 +44,7 @@ XCopyGC (dpy, srcGC, mask, destGC)
LockDisplay(dpy);
mask &= (1L << (GCLastBit + 1)) - 1;
/* if some of the source values to be copied are "dirty", flush them
/* if some of the source values to be copied are "dirty", flush them
out before sending the CopyGC request. */
if (srcGC->dirty & mask)
_XFlushGCCache(dpy, srcGC);
......@@ -58,7 +59,7 @@ XCopyGC (dpy, srcGC, mask, destGC)
if (mask & GCFunction)
destgv->function = srcgv->function;
if (mask & GCPlaneMask)
destgv->plane_mask = srcgv->plane_mask;
......@@ -76,14 +77,14 @@ XCopyGC (dpy, srcGC, mask, destGC)
if (mask & GCCapStyle)
destgv->cap_style = srcgv->cap_style;
if (mask & GCJoinStyle)
destgv->join_style = srcgv->join_style;
if (mask & GCFillStyle)
destgv->fill_style = srcgv->fill_style;
if (mask & GCFillRule)
if (mask & GCFillRule)
destgv->fill_rule = srcgv->fill_rule;
if (mask & GCArcMode)
......@@ -101,19 +102,19 @@ XCopyGC (dpy, srcGC, mask, destGC)
if (mask & GCTileStipYOrigin)
destgv->ts_y_origin = srcgv->ts_y_origin;
if (mask & GCFont)
if (mask & GCFont)
destgv->font = srcgv->font;
if (mask & GCSubwindowMode)
if (mask & GCSubwindowMode)
destgv->subwindow_mode = srcgv->subwindow_mode;
if (mask & GCGraphicsExposures)
if (mask & GCGraphicsExposures)
destgv->graphics_exposures = srcgv->graphics_exposures;
if (mask & GCClipXOrigin)
if (mask & GCClipXOrigin)
destgv->clip_x_origin = srcgv->clip_x_origin;
if (mask & GCClipYOrigin)
if (mask & GCClipYOrigin)
destgv->clip_y_origin = srcgv->clip_y_origin;
if (mask & GCClipMask) {
......@@ -121,7 +122,7 @@ XCopyGC (dpy, srcGC, mask, destGC)
destgv->clip_mask = srcgv->clip_mask;
}
if (mask & GCDashOffset)
if (mask & GCDashOffset)
destgv->dash_offset = srcgv->dash_offset;
if (mask & GCDashList) {
......
......@@ -30,18 +30,20 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XCopyPlane(dpy, src_drawable, dst_drawable, gc,
src_x, src_y, width, height,
dst_x, dst_y, bit_plane)
register Display *dpy;
Drawable src_drawable, dst_drawable;
GC gc;
int src_x, src_y;
unsigned int width, height;
int dst_x, dst_y;
unsigned long bit_plane;
XCopyPlane(
register Display *dpy,
Drawable src_drawable,
Drawable dst_drawable,
GC gc,
int src_x,
int src_y,
unsigned int width,
unsigned int height,
int dst_x,
int dst_y,
unsigned long bit_plane)
{
{
register xCopyPlaneReq *req;
LockDisplay(dpy);
......
/* $XFree86$ */
#ifndef _CR_H_
#define _CR_H_
......
......@@ -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.
*/
/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
......@@ -31,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlib.h"
/*
* XCreateBitmapFromData: Routine to make a pixmap of depth 1 from user
* XCreateBitmapFromData: Routine to make a pixmap of depth 1 from user
* supplied data.
* D is any drawable on the same screen that the pixmap will be used in.
* Data is a pointer to the bit data, and
* Data is a pointer to the bit data, and
* width & height give the size in bits of the pixmap.
*
* The following format is assumed for data:
......@@ -46,7 +45,7 @@ in this Software without prior written authorization from The Open Group.
* bitmap_unit=8
* xoffset=0
* no extra bytes per line
*/
*/
Pixmap XCreateBitmapFromData(
Display *display,
Drawable d,
......
......@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xcmsint.h"
Colormap XCreateColormap(dpy, w, visual, alloc)
register Display *dpy;
Window w;
Visual *visual;
int alloc;
Colormap XCreateColormap(
register Display *dpy,
Window w,
Visual *visual,
int alloc)
{
register xCreateColormapReq *req;
Colormap mid;
......@@ -51,7 +51,9 @@ int alloc;
UnlockDisplay(dpy);
SyncHandle();
#ifdef XCMS
_XcmsAddCmapRec(dpy, mid, w, visual);
#endif
return(mid);
}
......@@ -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.
*/
/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
......@@ -40,19 +39,22 @@ _XTryShapeBitmapCursor (Display *dpy,
unsigned int x,
unsigned int y);
#endif
Cursor XCreatePixmapCursor(dpy, source, mask, foreground, background, x, y)
register Display *dpy;
Pixmap source, mask;
XColor *foreground, *background;
unsigned int x, y;
{
Cursor XCreatePixmapCursor(
register Display *dpy,
Pixmap source,
Pixmap mask,
XColor *foreground,
XColor *background,
unsigned int x,
unsigned int y)
{
register xCreateCursorReq *req;
Cursor cid;
#ifdef USE_DYNAMIC_XCURSOR
cid = _XTryShapeBitmapCursor (dpy, source, mask,
cid = _XTryShapeBitmapCursor (dpy, source, mask,
foreground, background, x, y);
if (cid)
return cid;
......
......@@ -61,11 +61,11 @@ static void _XGenerateGCList(
GC gc,
xReq *req);
GC XCreateGC (dpy, d, valuemask, values)
register Display *dpy;
Drawable d; /* Window or Pixmap for which depth matches */
unsigned long valuemask; /* which ones to set initially */
XGCValues *values; /* the values themselves */
GC XCreateGC (
register Display *dpy,
Drawable d, /* Window or Pixmap for which depth matches */
unsigned long valuemask, /* which ones to set initially */
XGCValues *values) /* the values themselves */
{
register GC gc;
register xCreateGCReq *req;
......@@ -148,10 +148,10 @@ _XGenerateGCList (
req->length += (nvalues = value - values);
/*
/*
* note: Data is a macro that uses its arguments multiple
* times, so "nvalues" is changed in a separate assignment
* statement
* statement
*/
nvalues <<= 2;
......@@ -161,11 +161,11 @@ _XGenerateGCList (
int
_XUpdateGCCache (gc, mask, attr)
register unsigned long mask;
register XGCValues *attr;
register GC gc;
{
_XUpdateGCCache (
register GC gc,
register unsigned long mask,
register XGCValues *attr)
{
register XGCValues *gv = &gc->values;
if (mask & GCFunction)
......@@ -173,7 +173,7 @@ _XUpdateGCCache (gc, mask, attr)
gv->function = attr->function;
gc->dirty |= GCFunction;
}
if (mask & GCPlaneMask)
if (gv->plane_mask != attr->plane_mask) {
gv->plane_mask = attr->plane_mask;
......@@ -209,7 +209,7 @@ _XUpdateGCCache (gc, mask, attr)
gv->cap_style = attr->cap_style;
gc->dirty |= GCCapStyle;
}
if (mask & GCJoinStyle)
if (gv->join_style != attr->join_style) {
gv->join_style = attr->join_style;
......@@ -308,13 +308,13 @@ _XUpdateGCCache (gc, mask, attr)
gc->dashes = 0;
}
return 0;
}
}
/* can only call when display is already locked. */
void _XFlushGCCache(dpy, gc)
Display *dpy;
GC gc;
void _XFlushGCCache(
Display *dpy,
GC gc)
{
register xChangeGCReq *req;
register _XExtension *ext;
......@@ -331,13 +331,15 @@ void _XFlushGCCache(dpy, gc)
}
}
void XFlushGC(dpy, gc)
Display *dpy;
GC gc;
void
XFlushGC(
Display *dpy,
GC gc)
{
FlushGC(dpy, gc);
}
GContext XGContextFromGC(gc)
GC gc;
{ return (gc->gid); }
GContext XGContextFromGC(GC gc)
{
return (gc->gid);
}
......@@ -44,14 +44,18 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Cr.h"
#ifdef __CYGWIN__
#define LIBXCURSOR "cygXcursor-1.dll"
#endif
#if defined(hpux)
typedef shl_dt XModuleType;
typedef shl_t XModuleType;
#else
typedef void *XModuleType;
#endif
#ifndef LIBXCURSOR
#define LIBXCURSOR "libXcursor.so"
#define LIBXCURSOR "libXcursor.so.1"
#endif
static char libraryName[] = LIBXCURSOR;
......@@ -76,18 +80,18 @@ open_library (void)
break;
*dot = '\0';
}
return 0;
return NULL;
}
static void *
fetch_symbol (XModuleType module, char *under_symbol)
fetch_symbol (XModuleType module, const char *under_symbol)
{
void *result = NULL;
char *symbol = under_symbol + 1;
const char *symbol = under_symbol + 1;
#if defined(hpux)
int getsyms_cnt, i;
struct shl_symbol *symbols;
getsyms_cnt = shl_getsymbols(module, TYPE_PROCEDURE,
EXPORT_SYMBOLS, malloc, &symbols);
......@@ -218,20 +222,20 @@ _XTryShapeBitmapCursor (Display *dpy,
}
#endif
Cursor XCreateGlyphCursor(dpy, source_font, mask_font,
source_char, mask_char,
foreground, background)
register Display *dpy;
Font source_font, mask_font;
unsigned int source_char, mask_char;
XColor _Xconst *foreground, *background;
{
Cursor XCreateGlyphCursor(
register Display *dpy,
Font source_font,
Font mask_font,
unsigned int source_char,
unsigned int mask_char,
XColor _Xconst *foreground,
XColor _Xconst *background)
{
Cursor cid;
register xCreateGlyphCursorReq *req;
#ifdef USE_DYNAMIC_XCURSOR
cid = _XTryShapeCursor (dpy, source_font, mask_font,
cid = _XTryShapeCursor (dpy, source_font, mask_font,
source_char, mask_char, foreground, background);
if (cid)
return cid;
......
......@@ -33,7 +33,7 @@ in this Software without prior written authorization from The Open Group.
/*
* XCreatePixmapFromBitmapData: Routine to make a pixmap from user supplied bitmap data.
* D is any drawable on the same screen that the pixmap will be used in.
* Data is a pointer to the bit data, and
* Data is a pointer to the bit data, and
* width & height give the size in bits of the pixmap.
* Fg and Bg are the pixel values to use for the two colors.
* Depth is the depth of the pixmap to create.
......@@ -47,14 +47,16 @@ in this Software without prior written authorization from The Open Group.
* bitmap_unit=8
* xoffset=0
* no extra bytes per line
*/
Pixmap XCreatePixmapFromBitmapData(display,d,data,width,height,fg,bg,depth)
Display *display;
Drawable d;
char *data;
unsigned int width, height;
unsigned long fg, bg;
unsigned int depth;
*/
Pixmap XCreatePixmapFromBitmapData(
Display *display,
Drawable d,
char *data,
unsigned int width,
unsigned int height,
unsigned long fg,
unsigned long bg,
unsigned int depth)
{
XImage ximage;
GC gc;
......
......@@ -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.
*/
/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
......@@ -38,10 +37,12 @@ _XNoticeCreateBitmap (Display *dpy,
unsigned int height);
#endif
Pixmap XCreatePixmap (dpy, d, width, height, depth)
register Display *dpy;
Drawable d;
unsigned int width, height, depth;
Pixmap XCreatePixmap (
register Display *dpy,
Drawable d,
unsigned int width,
unsigned int height,
unsigned int depth)
{
Pixmap pid;
register xCreatePixmapReq *req;
......
......@@ -29,14 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
Window XCreateSimpleWindow(dpy, parent, x, y, width, height,
borderWidth, border, background)
register Display *dpy;
Window parent;
int x, y;
unsigned int width, height, borderWidth;
unsigned long border;
unsigned long background;
Window XCreateSimpleWindow(
register Display *dpy,
Window parent,
int x,
int y,
unsigned int width,
unsigned int height,
unsigned int borderWidth,
unsigned long border,
unsigned long background)
{
Window wid;
register xCreateWindowReq *req;
......
......@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
static XColor _Xconst foreground = { 0, 0, 0, 0 }; /* black */
static XColor _Xconst background = { 0, 65535, 65535, 65535 }; /* white */
Cursor XCreateFontCursor(dpy, which)
Display *dpy;
unsigned int which;
Cursor XCreateFontCursor(
Display *dpy,
unsigned int which)
{
/*
/*
* the cursor font contains the shape glyph followed by the mask
* glyph; so character position 0 contains a shape, 1 the mask for 0,
* 2 a shape, etc. <X11/cursorfont.h> contains hash define names
......@@ -47,7 +47,7 @@ Cursor XCreateFontCursor(dpy, which)
if (dpy->cursor_font == None) return None;
}
return XCreateGlyphCursor (dpy, dpy->cursor_font, dpy->cursor_font,
return XCreateGlyphCursor (dpy, dpy->cursor_font, dpy->cursor_font,
which, which + 1, &foreground, &background);
}
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDefineCursor (dpy, w, cursor)
register Display *dpy;
Window w;
Cursor cursor;
XDefineCursor (
register Display *dpy,
Window w,
Cursor cursor)
{
register xChangeWindowAttributesReq *req;
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDeleteProperty(dpy, window, property)
register Display *dpy;
Window window;
Atom property;
XDeleteProperty(
register Display *dpy,
Window window,
Atom property)
{
register xDeletePropertyReq *req;
......
......@@ -33,10 +33,10 @@ in this Software without prior written authorization from The Open Group.
/*
* XListDepths - return info from connection setup
*/
int *XListDepths (dpy, scrnum, countp)
Display *dpy;
int scrnum;
int *countp;
int *XListDepths (
Display *dpy,
int scrnum,
int *countp)
{
Screen *scr;
int count;
......@@ -51,7 +51,7 @@ int *XListDepths (dpy, scrnum, countp)
depths = (int *) Xmalloc (count * sizeof(int));
if (!depths) return NULL;
for (i = 0, dp = scr->depths; i < count; i++, dp++)
for (i = 0, dp = scr->depths; i < count; i++, dp++)
depths[i] = dp->depth;
} else {
/* a screen must have a depth */
......
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDestroySubwindows(dpy, win)
register Display *dpy;
Window win;
XDestroySubwindows(
register Display *dpy,
Window win)
{
register xResourceReq *req;
......
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDestroyWindow (dpy, w)
register Display *dpy;
Window w;
XDestroyWindow (
register Display *dpy,
Window w)
{
register xResourceReq *req;
......
......@@ -29,14 +29,14 @@ from The Open Group.
/* $XFree86$ */
/* XDisplayName.c */
/*
/*
* Returns the name of the display XOpenDisplay would use. This is better
* than just printing the "display" variable in a program because that
* could be NULL and/or there could be an environment variable set.
* This makes it easier for programmers to provide meaningful error
* messages.
* messages.
*
*
*
* For example, this is used in XOpenDisplay() as
* strncpy( displaybuf, XDisplayName( display ), sizeof(displaybuf) );
* if ( *displaybuf == '\0' ) return( NULL );
......
......@@ -29,20 +29,23 @@ in this Software without prior written authorization from The Open Group.
We don't do this because X_PolyArc applies the GC's join-style if
the last point in one arc coincides with the first point in another.
The client wouldn't expect this and would have no easy way to defeat it. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
int
XDrawArc(dpy, d, gc, x, y, width, height, angle1, angle2)
register Display *dpy;
Drawable d;
GC gc;
int x, y; /* INT16 */
unsigned int width, height; /* CARD16 */
int angle1, angle2; /* INT16 */
XDrawArc(
register Display *dpy,
Drawable d,
GC gc,
int x,
int y, /* INT16 */
unsigned int width,
unsigned int height, /* CARD16 */
int angle1,
int angle2) /* INT16 */
{
register xPolyArcReq *req;
register xArc *arc;
......
......@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group.
#define arc_scale (SIZEOF(xArc) / 4)
int
XDrawArcs(dpy, d, gc, arcs, n_arcs)
register Display *dpy;
Drawable d;
GC gc;
XArc *arcs;
int n_arcs;
XDrawArcs(
register Display *dpy,
Drawable d,
GC gc,
XArc *arcs,
int n_arcs)
{
register xPolyArcReq *req;
register long len;
......
......@@ -35,11 +35,14 @@ in this Software without prior written authorization from The Open Group.
#define zsize (SIZEOF(xPolySegmentReq) + ZLNSPERBATCH * SIZEOF(xSegment))
int
XDrawLine (dpy, d, gc, x1, y1, x2, y2)
register Display *dpy;
Drawable d;
GC gc;
int x1, y1, x2, y2;
XDrawLine (
register Display *dpy,
Drawable d,
GC gc,
int x1,
int y1,
int x2,
int y2)
{
register xSegment *segment;
......
......@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDrawLines (dpy, d, gc, points, npoints, mode)
register Display *dpy;
Drawable d;
GC gc;
XPoint *points;
int npoints;
int mode;
XDrawLines (
register Display *dpy,
Drawable d,
GC gc,
XPoint *points,
int npoints,
int mode)
{
register xPolyLineReq *req;
register long length;
......
......@@ -34,11 +34,12 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyPointReq) + PTSPERBATCH * SIZEOF(xPoint))
int
XDrawPoint(dpy, d, gc, x, y)
register Display *dpy;
Drawable d;
GC gc;
int x, y; /* INT16 */
XDrawPoint(
register Display *dpy,
Drawable d,
GC gc,
int x,
int y) /* INT16 */
{
xPoint *point;
......
......@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDrawPoints(dpy, d, gc, points, n_points, mode)
register Display *dpy;
Drawable d;
GC gc;
XPoint *points;
int n_points;
int mode; /* CoordMode */
XDrawPoints(
register Display *dpy,
Drawable d,
GC gc,
XPoint *points,
int n_points,
int mode) /* CoordMode */
{
register xPolyPointReq *req;
register long nbytes;
......
......@@ -35,12 +35,14 @@ in this Software without prior written authorization from The Open Group.
#define zsize (SIZEOF(xPolyRectangleReq) + ZRCTSPERBATCH * SIZEOF(xRectangle))
int
XDrawRectangle(dpy, d, gc, x, y, width, height)
register Display *dpy;
Drawable d;
GC gc;
int x, y; /* INT16 */
unsigned int width, height; /* CARD16 */
XDrawRectangle(
register Display *dpy,
Drawable d,
GC gc,
int x,
int y, /* INT16 */
unsigned int width,
unsigned int height) /* CARD16 */
{
xRectangle *rect;
......
......@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDrawRectangles(dpy, d, gc, rects, n_rects)
register Display *dpy;
Drawable d;
GC gc;
XRectangle *rects;
int n_rects;
XDrawRectangles(
register Display *dpy,
Drawable d,
GC gc,
XRectangle *rects,
int n_rects)
{
register xPolyRectangleReq *req;
long len;
......
......@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XDrawSegments (dpy, d, gc, segments, nsegments)
register Display *dpy;
Drawable d;
GC gc;
XSegment *segments;
int nsegments;
XDrawSegments (
register Display *dpy,
Drawable d,
GC gc,
XSegment *segments,
int nsegments)
{
register xPolySegmentReq *req;
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 $
*/
/***********************************************************
......@@ -32,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
......@@ -70,34 +68,40 @@ SOFTWARE.
* descriptions of errors in Section 4 of Protocol doc (pp. 350-351); more
* verbose descriptions are given in the error database
*/
static const char * const _XErrorList[] = {
/* No error */ "no error",
/* BadRequest */ "BadRequest",
/* BadValue */ "BadValue",
/* BadWindow */ "BadWindow",
/* BadPixmap */ "BadPixmap",
/* BadAtom */ "BadAtom",
/* BadCursor */ "BadCursor",
/* BadFont */ "BadFont",
/* BadMatch */ "BadMatch",
/* BadDrawable */ "BadDrawable",
/* BadAccess */ "BadAccess",
/* BadAlloc */ "BadAlloc",
/* BadColor */ "BadColor",
/* BadGC */ "BadGC",
/* BadIDChoice */ "BadIDChoice",
/* BadName */ "BadName",
/* BadLength */ "BadLength",
/* BadImplementation */ "BadImplementation",
static const char _XErrorList[] =
/* No error */ "no error\0"
/* BadRequest */ "BadRequest\0"
/* BadValue */ "BadValue\0"
/* BadWindow */ "BadWindow\0"
/* BadPixmap */ "BadPixmap\0"
/* BadAtom */ "BadAtom\0"
/* BadCursor */ "BadCursor\0"
/* BadFont */ "BadFont\0"
/* BadMatch */ "BadMatch\0"
/* BadDrawable */ "BadDrawable\0"
/* BadAccess */ "BadAccess\0"
/* BadAlloc */ "BadAlloc\0"
/* BadColor */ "BadColor\0"
/* BadGC */ "BadGC\0"
/* BadIDChoice */ "BadIDChoice\0"
/* BadName */ "BadName\0"
/* BadLength */ "BadLength\0"
/* 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
XGetErrorText(dpy, code, buffer, nbytes)
register int code;
register Display *dpy;
char *buffer;
int nbytes;
XGetErrorText(
register Display *dpy,
register int code,
char *buffer,
int nbytes)
{
char buf[150];
register _XExtension *ext;
......@@ -106,7 +110,8 @@ XGetErrorText(dpy, code, buffer, nbytes)
if (nbytes == 0) return 0;
if (code <= BadImplementation && code > 0) {
sprintf(buf, "%d", code);
(void) XGetErrorDatabaseText(dpy, "XProtoError", buf, _XErrorList[code],
(void) XGetErrorDatabaseText(dpy, "XProtoError", buf,
_XErrorList + _XErrorOffsets[code],
buffer, nbytes);
} else
buffer[0] = '\0';
......@@ -115,10 +120,10 @@ XGetErrorText(dpy, code, buffer, nbytes)
if (ext->error_string)
(*ext->error_string)(dpy, code, &ext->codes, buffer, nbytes);
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;
}
}
if (!buffer[0] && bext) {
sprintf(buf, "%s.%d", bext->name, code - bext->codes.first_error);
(void) XGetErrorDatabaseText(dpy, "XProtoError", buf, "", buffer, nbytes);
......@@ -186,7 +191,7 @@ XGetErrorDatabaseText(
tptr = Xmalloc (tlen);
if (tptr) {
sprintf(tptr, "%s.%s", name, type);
XrmGetResource(db, tptr, "ErrorType.ErrorNumber",
XrmGetResource(db, tptr, "ErrorType.ErrorNumber",
&type_str, &result);
if (tptr != temp)
Xfree (tptr);
......
......@@ -38,13 +38,15 @@ from The Open Group.
#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
_XEventToWire(
register Display *dpy, /* pointer to display structure */
register XEvent *re, /* pointer to where event should be reformatted */
register xEvent *event) /* wire protocol event */
register Display *dpy,
register XEvent *re, /* in: from */
register xEvent *event) /* out: to */
{
switch (event->u.u.type = re->type) {
case KeyPress:
......@@ -351,12 +353,12 @@ register xEvent *event) /* wire protocol event */
case ClientMessage:
{
register int i;
register XClientMessageEvent *ev
register XClientMessageEvent *ev
= (XClientMessageEvent *) re;
event->u.clientMessage.window = ev->window;
event->u.u.detail = ev->format;
switch (ev->format) {
case 8:
case 8:
event->u.clientMessage.u.b.type = ev->message_type;
for (i = 0; i < 20; i++)
event->u.clientMessage.u.b.bytes[i] = ev->data.b[i];
......@@ -396,7 +398,7 @@ register xEvent *event) /* wire protocol event */
event->u.mappingNotify.count = ev->count;
}
break;
default:
return(_XUnknownNativeEvent(dpy, re, event));
}
......
......@@ -30,28 +30,23 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XActivateScreenSaver(dpy)
register Display *dpy;
XActivateScreenSaver(register Display *dpy)
{
XForceScreenSaver (dpy, ScreenSaverActive);
return 1;
}
int
XResetScreenSaver(dpy)
register Display *dpy;
XResetScreenSaver(register Display *dpy)
{
XForceScreenSaver (dpy, ScreenSaverReset);
return 1;
}
int
XForceScreenSaver(dpy, mode)
register Display *dpy;
int mode;
XForceScreenSaver(
register Display *dpy,
int mode)
{
register xForceScreenSaverReq *req;
......
......@@ -17,15 +17,15 @@
* OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* M. Collins OSF
*
* M. Collins OSF
*
* Katsuhisa Yano TOSHIBA Corp.
*/
*/
/*
......@@ -179,13 +179,13 @@ XCreateFontSet (
om = XOpenOM(dpy, NULL, NULL, NULL);
if (om == NULL)
return (XFontSet) NULL;
if ((oc = XCreateOC(om, XNBaseFontName, base_font_name_list, NULL))) {
list = &oc->core.missing_list;
oc->core.om_automatic = True;
} else
list = &om->core.required_charset;
*missing_charset_list = copy_string_list(list->charset_list,
list->charset_count);
*missing_charset_count = list->charset_count;
......@@ -198,7 +198,7 @@ XCreateFontSet (
if (!*def_string)
*def_string = "";
}
if (oc == NULL)
XCloseOM(om);
......@@ -206,10 +206,10 @@ XCreateFontSet (
}
int
XFontsOfFontSet(font_set, font_struct_list, font_name_list)
XFontSet font_set;
XFontStruct ***font_struct_list;
char ***font_name_list;
XFontsOfFontSet(
XFontSet font_set,
XFontStruct ***font_struct_list,
char ***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;
......@@ -217,50 +217,47 @@ XFontsOfFontSet(font_set, font_struct_list, font_name_list)
}
char *
XBaseFontNameListOfFontSet(font_set)
XFontSet font_set;
XBaseFontNameListOfFontSet(XFontSet font_set)
{
return font_set->core.base_name_list;
}
char *
XLocaleOfFontSet(font_set)
XFontSet font_set;
XLocaleOfFontSet(XFontSet font_set)
{
return font_set->core.om->core.lcd->core->name;
}
extern Bool XContextDependentDrawing(font_set)
XFontSet font_set;
Bool
XContextDependentDrawing(XFontSet font_set)
{
return font_set->core.om->core.context_dependent;
}
Bool
XDirectionalDependentDrawing(font_set)
XFontSet font_set;
XDirectionalDependentDrawing(XFontSet font_set)
{
return font_set->core.om->core.directional_dependent;
}
Bool
XContextualDrawing(font_set)
XFontSet font_set;
XContextualDrawing(XFontSet font_set)
{
return font_set->core.om->core.contextual_drawing;
}
XFontSetExtents *
XExtentsOfFontSet(font_set)
XFontSet font_set;
XExtentsOfFontSet(XFontSet font_set)
{
if (!font_set)
return NULL;
return &font_set->core.font_set_extents;
}
void
XFreeFontSet(dpy, font_set)
Display *dpy;
XFontSet font_set;
XFreeFontSet(
Display *dpy,
XFontSet font_set)
{
XCloseOM(font_set->core.om);
}
......@@ -33,17 +33,17 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h>
Status XFetchName (dpy, w, name)
register Display *dpy;
Window w;
char **name;
Status XFetchName (
register Display *dpy,
Window w,
char **name)
{
Atom actual_type;
int actual_format;
unsigned long nitems;
unsigned long leftover;
unsigned char *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_NAME, 0L, (long)BUFSIZ, False, XA_STRING,
if (XGetWindowProperty(dpy, w, XA_WM_NAME, 0L, (long)BUFSIZ, False, XA_STRING,
&actual_type,
&actual_format, &nitems, &leftover, &data) != Success) {
*name = NULL;
......@@ -63,10 +63,10 @@ Status XFetchName (dpy, w, name)
return(0);
}
Status XGetIconName (dpy, w, icon_name)
register Display *dpy;
Window w;
char **icon_name;
Status XGetIconName (
register Display *dpy,
Window w,
char **icon_name)
{
Atom actual_type;
int actual_format;
......@@ -74,7 +74,7 @@ Status XGetIconName (dpy, w, icon_name)
unsigned long leftover;
unsigned char *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_ICON_NAME, 0L, (long)BUFSIZ, False,
XA_STRING,
XA_STRING,
&actual_type,
&actual_format, &nitems, &leftover, &data) != Success) {
*icon_name = NULL;
......
......@@ -34,13 +34,16 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyFillArcReq) + FARCSPERBATCH * SIZEOF(xArc))
int
XFillArc(dpy, d, gc, x, y, width, height, angle1, angle2)
register Display *dpy;
Drawable d;
GC gc;
int x, y; /* INT16 */
unsigned int width, height; /* CARD16 */
int angle1, angle2; /* INT16 */
XFillArc(
register Display *dpy,
Drawable d,
GC gc,
int x,
int y, /* INT16 */
unsigned int width,
unsigned int height, /* CARD16 */
int angle1,
int angle2) /* INT16 */
{
xArc *arc;
......
......@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group.
#define arc_scale (SIZEOF(xArc) / 4)
int
XFillArcs(dpy, d, gc, arcs, n_arcs)
register Display *dpy;
Drawable d;
GC gc;
XArc *arcs;
int n_arcs;
XFillArcs(
register Display *dpy,
Drawable d,
GC gc,
XArc *arcs,
int n_arcs)
{
register xPolyFillArcReq *req;
long len;
......
......@@ -30,14 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XFillPolygon(dpy, d, gc, points, n_points, shape, mode)
register Display *dpy;
Drawable d;
GC gc;
XPoint *points;
int n_points;
int shape;
int mode;
XFillPolygon(
register Display *dpy,
Drawable d,
GC gc,
XPoint *points,
int n_points,
int shape,
int mode)
{
register xFillPolyReq *req;
register long nbytes;
......@@ -56,7 +56,7 @@ int mode;
/* shift (mult. by 4) before passing to the (possible) macro */
nbytes = n_points << 2;
Data16 (dpy, (short *) points, nbytes);
UnlockDisplay(dpy);
SyncHandle();
......
......@@ -34,12 +34,14 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyFillRectangleReq) + FRCTSPERBATCH * SIZEOF(xRectangle))
int
XFillRectangle(dpy, d, gc, x, y, width, height)
register Display *dpy;
Drawable d;
GC gc;
int x, y; /* INT16 */
unsigned int width, height; /* CARD16 */
XFillRectangle(
register Display *dpy,
Drawable d,
GC gc,
int x,
int y, /* INT16 */
unsigned int width,
unsigned int height) /* CARD16 */
{
xRectangle *rect;
......@@ -47,7 +49,7 @@ XFillRectangle(dpy, d, gc, x, y, width, height)
FlushGC(dpy, gc);
{
register xPolyFillRectangleReq *req
register xPolyFillRectangleReq *req
= (xPolyFillRectangleReq *) dpy->last_req;
/* if same as previous request, with same drawable, batch requests */
......
......@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XFillRectangles(dpy, d, gc, rectangles, n_rects)
register Display *dpy;
Drawable d;
GC gc;
XRectangle *rectangles;
int n_rects;
XFillRectangles(
register Display *dpy,
Drawable d,
GC gc,
XRectangle *rectangles,
int n_rects)
{
register xPolyFillRectangleReq *req;
long len;
......@@ -63,4 +63,3 @@ int n_rects;
SyncHandle();
return 1;
}
......@@ -18,12 +18,12 @@
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
* PERFORMANCE OF THIS SOFTWARE.
*
* Author: Seiji Kuwari OMRON Corporation
* kuwa@omron.co.jp
* kuwa%omron.co.jp@uunet.uu.net
*/
*/
/*
......@@ -69,9 +69,9 @@ extern long const _Xevent_to_mask[];
* Look up if there is a specified filter for the event.
*/
Bool
XFilterEvent(ev, window)
XEvent *ev;
Window window;
XFilterEvent(
XEvent *ev,
Window window)
{
#if XLOCALE
XFilterEventList p;
......@@ -93,9 +93,9 @@ XFilterEvent(ev, window)
if (win == p->window) {
if ((mask & p->event_mask) ||
(ev->type >= p->start_type && ev->type <= p->end_type)) {
UnlockDisplay(ev->xany.display);
ret = (*(p->filter))(ev->xany.display, p->window, ev,
p->client_data);
UnlockDisplay(ev->xany.display);
return(ret);
}
}
......
......@@ -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. */
int
XFlush (dpy)
register Display *dpy;
{
XFlush (register Display *dpy)
{
LockDisplay(dpy);
_XFlush (dpy);
UnlockDisplay(dpy);
......
......@@ -123,9 +123,9 @@ XFontStruct *XLoadQueryFont(
return font_result;
}
XFontStruct *XQueryFont (dpy, fid)
register Display *dpy;
Font fid;
XFontStruct *XQueryFont (
register Display *dpy,
Font fid)
{
XFontStruct *font_result;
#ifdef USE_XF86BIGFONT
......@@ -147,10 +147,10 @@ XFontStruct *XQueryFont (dpy, fid)
}
int
XFreeFont(dpy, fs)
register Display *dpy;
XFontStruct *fs;
{
XFreeFont(
register Display *dpy,
XFontStruct *fs)
{
register xResourceReq *req;
register _XExtension *ext;
......@@ -177,10 +177,10 @@ XFreeFont(dpy, fs)
static XFontStruct *
_XQueryFont (dpy, fid, seq)
register Display *dpy;
Font fid;
unsigned long seq;
_XQueryFont (
register Display *dpy,
Font fid,
unsigned long seq)
{
register XFontStruct *fs;
register long nbytes;
......@@ -227,13 +227,13 @@ _XQueryFont (dpy, fid, seq)
fs->all_chars_exist = reply.allCharsExist;
fs->ascent = cvtINT16toInt (reply.fontAscent);
fs->descent = cvtINT16toInt (reply.fontDescent);
/* XXX the next two statements won't work if short isn't 16 bits */
fs->min_bounds = * (XCharStruct *) &reply.minBounds;
fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
fs->n_properties = reply.nFontProps;
/*
/*
* if no properties defined for the font, then it is bad
* font, but shouldn't try to read nothing.
*/
......@@ -384,11 +384,11 @@ _XF86BigfontFreeNop (
}
static XFontStruct *
_XF86BigfontQueryFont (dpy, extcodes, fid, seq)
register Display *dpy;
XF86BigfontCodes *extcodes;
Font fid;
unsigned long seq;
_XF86BigfontQueryFont (
register Display *dpy,
XF86BigfontCodes *extcodes,
Font fid,
unsigned long seq)
{
register XFontStruct *fs;
register long nbytes;
......@@ -470,7 +470,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
fs->n_properties = reply.nFontProps;
/*
/*
* if no properties defined for the font, then it is bad
* font, but shouldn't try to read nothing.
*/
......@@ -554,7 +554,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
signature. Then we set the CAP_VerifiedLocal bit to indicate
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)
fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n");
Xfree((char *) pData);
......@@ -606,8 +606,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
}
void
_XF86BigfontFreeFontMetrics (fs)
XFontStruct *fs;
_XF86BigfontFreeFontMetrics (XFontStruct *fs)
{
#ifdef HAS_SHM
XExtData *pData;
......@@ -633,7 +632,7 @@ int _XF86LoadQueryLocaleFont(
Font *fidp)
{
int l;
char *charset, *p;
const char *charset, *p;
char buf[256];
XFontStruct *fs;
XLCd lcd;
......@@ -643,7 +642,7 @@ int _XF86LoadQueryLocaleFont(
l = strlen(name);
if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-')
return 0;
charset = 0;
charset = NULL;
/* next three lines stolen from _XkbGetCharset() */
lcd = _XlcCurrentLC();
if ((lcd = _XlcCurrentLC()) != 0)
......
......@@ -44,7 +44,7 @@ _Xconst char *pattern, /* null-terminated */
int maxNames,
int *actualCount, /* RETURN */
XFontStruct **info) /* RETURN */
{
{
register long nbytes;
register int i;
register XFontStruct *fs;
......@@ -65,7 +65,7 @@ XFontStruct **info) /* RETURN */
for (i = 0; ; i++) {
if (!_XReply (dpy, (xReply *) &reply,
((SIZEOF(xListFontsWithInfoReply) -
((SIZEOF(xListFontsWithInfoReply) -
SIZEOF(xGenericReply)) >> 2), xFalse)) {
for (j=(i-1); (j >= 0); j--) {
Xfree(flist[j]);
......@@ -83,7 +83,7 @@ XFontStruct **info) /* RETURN */
size = i + reply.nReplies + 1;
if (finfo) {
XFontStruct * tmp_finfo = (XFontStruct *)
XFontStruct * tmp_finfo = (XFontStruct *)
Xrealloc ((char *) finfo,
(unsigned) (sizeof(XFontStruct) * size));
char ** tmp_flist = (char **)
......@@ -131,7 +131,7 @@ XFontStruct **info) /* RETURN */
fs->all_chars_exist = reply.allCharsExist;
fs->ascent = cvtINT16toInt (reply.fontAscent);
fs->descent = cvtINT16toInt (reply.fontDescent);
/* XXX the next two statements won't work if short isn't 16 bits */
fs->min_bounds = * (XCharStruct *) &reply.minBounds;
fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
......@@ -201,10 +201,10 @@ XFontStruct **info) /* RETURN */
}
int
XFreeFontInfo (names, info, actualCount)
char **names;
XFontStruct *info;
int actualCount;
XFreeFontInfo (
char **names,
XFontStruct *info,
int actualCount)
{
register int i;
if (names) {
......
......@@ -36,7 +36,7 @@ register Display *dpy,
_Xconst char *pattern, /* null-terminated */
int maxNames,
int *actualCount) /* RETURN */
{
{
register long nbytes;
register unsigned i;
register int length;
......@@ -98,9 +98,8 @@ int *actualCount) /* RETURN */
}
int
XFreeFontNames(list)
char **list;
{
XFreeFontNames(char **list)
{
if (list) {
if (!*(list[0]-1)) { /* from ListFontsWithInfo */
register char **names;
......
......@@ -44,6 +44,9 @@ XFreeColormap(
UnlockDisplay(dpy);
SyncHandle();
#ifdef XCMS
_XcmsDeleteCmapRec(dpy, cmap);
#endif
return 1;
}
......@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XFreeColors(dpy, cmap, pixels, npixels, planes)
register Display *dpy;
Colormap cmap;
unsigned long *pixels; /* LISTofCARD32 */
int npixels;
unsigned long planes; /* CARD32 */
XFreeColors(
register Display *dpy,
Colormap cmap,
unsigned long *pixels, /* LISTofCARD32 */
int npixels,
unsigned long planes) /* CARD32 */
{
register xFreeColorsReq *req;
register long nbytes;
......
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XFreeCursor(dpy, cursor)
register Display *dpy;
Cursor cursor;
XFreeCursor(
register Display *dpy,
Cursor cursor)
{
register xResourceReq *req;
LockDisplay(dpy);
......
......@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
_XFreeExtData (extension)
XExtData *extension;
_XFreeExtData (XExtData *extension)
{
XExtData *temp;
while (extension) {
if (extension->free_private)
if (extension->free_private)
(*extension->free_private)(extension);
else Xfree ((char *)extension->private_data);
temp = extension->next;
......
......@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XFreeGC (dpy, gc)
register Display *dpy;
GC gc;
XFreeGC (
register Display *dpy,
GC gc)
{
register xResourceReq *req;
register _XExtension *ext;
......@@ -47,4 +47,3 @@ XFreeGC (dpy, gc)
Xfree ((char *) gc);
return 1;
}
......@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XFreePixmap(dpy, pixmap)
register Display *dpy;
Pixmap pixmap;
{
register xResourceReq *req;
XFreePixmap(
register Display *dpy,
Pixmap pixmap)
{
register xResourceReq *req;
LockDisplay(dpy);
GetResReq(FreePixmap, pixmap, req);
UnlockDisplay(dpy);
......
......@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XSetArcMode (dpy, gc, arc_mode)
register Display *dpy;
register GC gc;
int arc_mode;
XSetArcMode (
register Display *dpy,
register GC gc,
int arc_mode)
{
LockDisplay(dpy);
if (gc->values.arc_mode != arc_mode) {
......@@ -46,10 +46,10 @@ int arc_mode;
}
int
XSetFillRule (dpy, gc, fill_rule)
register Display *dpy;
register GC gc;
int fill_rule;
XSetFillRule (
register Display *dpy,
register GC gc,
int fill_rule)
{
LockDisplay(dpy);
if (gc->values.fill_rule != fill_rule) {
......@@ -62,10 +62,10 @@ int fill_rule;
}
int
XSetFillStyle (dpy, gc, fill_style)
register Display *dpy;
register GC gc;
int fill_style;
XSetFillStyle (
register Display *dpy,
register GC gc,
int fill_style)
{
LockDisplay(dpy);
if (gc->values.fill_style != fill_style) {
......@@ -78,10 +78,10 @@ int fill_style;
}
int
XSetGraphicsExposures (dpy, gc, graphics_exposures)
register Display *dpy;
register GC gc;
Bool graphics_exposures;
XSetGraphicsExposures (
register Display *dpy,
register GC gc,
Bool graphics_exposures)
{
LockDisplay(dpy);
if (gc->values.graphics_exposures != graphics_exposures) {
......@@ -94,10 +94,10 @@ Bool graphics_exposures;
}
int
XSetSubwindowMode (dpy, gc, subwindow_mode)
register Display *dpy;
register GC gc;
int subwindow_mode;
XSetSubwindowMode (
register Display *dpy,
register GC gc,
int subwindow_mode)
{
LockDisplay(dpy);
if (gc->values.subwindow_mode != subwindow_mode) {
......
......@@ -26,7 +26,6 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
......@@ -66,11 +65,11 @@ XGeometry (
dmask = XParseGeometry(def, &dx, &dy, &dwidth, &dheight);
/* set default values */
*x = (dmask & XNegative) ?
DisplayWidth(dpy, screen) + dx - dwidth * fwidth -
*x = (dmask & XNegative) ?
DisplayWidth(dpy, screen) + dx - dwidth * fwidth -
2 * bwidth - xadd : dx;
*y = (dmask & YNegative) ?
DisplayHeight(dpy, screen) + dy - dheight * fheight -
*y = (dmask & YNegative) ?
DisplayHeight(dpy, screen) + dy - dheight * fheight -
2 * bwidth - yadd : dy;
*width = dwidth;
*height = dheight;
......@@ -80,11 +79,11 @@ XGeometry (
if (pmask & XValue)
*x = (pmask & XNegative) ?
DisplayWidth(dpy, screen) + px - *width * fwidth -
DisplayWidth(dpy, screen) + px - *width * fwidth -
2 * bwidth - xadd : px;
if (pmask & YValue)
*y = (pmask & YNegative) ?
DisplayHeight(dpy, screen) + py - *height * fheight -
DisplayHeight(dpy, screen) + py - *height * fheight -
2 * bwidth - yadd : py;
return (pmask);
}
......@@ -49,16 +49,16 @@ char *_XGetAtomName(
if ((name = (char *)Xmalloc(idx)))
strcpy(name, EntryName(e));
return name;
}
}
}
}
GetResReq(GetAtomName, atom, req);
return (char *)NULL;
}
char *XGetAtomName(dpy, atom)
register Display *dpy;
Atom atom;
char *XGetAtomName(
register Display *dpy,
Atom atom)
{
xGetAtomNameReply rep;
char *name;
......@@ -67,7 +67,7 @@ char *XGetAtomName(dpy, atom)
if ((name = _XGetAtomName(dpy, atom))) {
UnlockDisplay(dpy);
return name;
}
}
if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
UnlockDisplay(dpy);
SyncHandle();
......@@ -139,11 +139,11 @@ Bool _XGetAtomNameHandler(
}
Status
XGetAtomNames (dpy, atoms, count, names_return)
Display *dpy;
Atom *atoms;
int count;
char **names_return;
XGetAtomNames (
Display *dpy,
Atom *atoms,
int count,
char **names_return)
{
_XAsyncHandler async;
_XGetAtomNameState async_state;
......
......@@ -48,6 +48,7 @@ XColor *exact_def) /* RETURN */
XcmsColor cmsColor_exact;
Status ret;
#ifdef XCMS
/*
* Let's Attempt to use Xcms and i18n approach to Parse Color
*/
......@@ -73,6 +74,7 @@ XColor *exact_def) /* RETURN */
break;
}
}
#endif
/*
* Xcms and i18n approach failed.
......
......@@ -28,13 +28,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
......@@ -96,16 +96,16 @@ GetHomeDir(
int len)
{
#ifdef WIN32
register char *ptr1;
register char *ptr2;
register char *ptr1 = NULL;
register char *ptr2 = NULL;
int len1 = 0, len2 = 0;
if (ptr1 = getenv("HOME")) { /* old, deprecated */
if ((ptr1 = getenv("HOME"))) { /* old, deprecated */
len1 = strlen (ptr1);
} else if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) {
len1 = strlen (ptr1);
len2 = strlen (ptr2);
} else if (ptr2 = getenv("USERNAME")) {
} else if ((ptr2 = getenv("USERNAME"))) {
len1 = strlen (ptr1 = "/users/");
len2 = strlen (ptr2);
}
......@@ -162,7 +162,7 @@ InitDefaults(
*/
if (dpy->xdefaults == NULL) {
char *slashDotXdefaults = "/.Xdefaults";
const char *slashDotXdefaults = "/.Xdefaults";
(void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaults) - 1);
(void) strcat (fname, slashDotXdefaults);
......@@ -172,7 +172,7 @@ InitDefaults(
}
if (!(xenv = getenv ("XENVIRONMENT"))) {
char *slashDotXdefaultsDash = "/.Xdefaults-";
const char *slashDotXdefaultsDash = "/.Xdefaults-";
int len;
(void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaultsDash) - 1);
......
......@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
char **XGetFontPath(dpy, npaths)
register Display *dpy;
int *npaths; /* RETURN */
char **XGetFontPath(
register Display *dpy,
int *npaths) /* RETURN */
{
xGetFontPathReply rep;
register long nbytes;
......@@ -81,8 +81,7 @@ int *npaths; /* RETURN */
}
int
XFreeFontPath (list)
char **list;
XFreeFontPath (char **list)
{
if (list != NULL) {
Xfree (list[0]-1);
......
......@@ -29,11 +29,11 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
Bool XGetFontProperty (fs, name, valuePtr)
XFontStruct *fs;
register Atom name;
unsigned long *valuePtr;
{
Bool XGetFontProperty (
XFontStruct *fs,
register Atom name,
unsigned long *valuePtr)
{
/* XXX this is a simple linear search for now. If the
protocol is changed to sort the property list, this should
become a binary search. */
......@@ -49,7 +49,4 @@ Bool XGetFontProperty (fs, name, valuePtr)
return (0);
}
......@@ -43,11 +43,11 @@ in this Software without prior written authorization from The Open Group.
GCArcMode)
/*ARGSUSED*/
Status XGetGCValues (dpy, gc, valuemask, values)
Display *dpy;
GC gc;
unsigned long valuemask;
XGCValues *values;
Status XGetGCValues (
Display *dpy,
GC gc,
unsigned long valuemask,
XGCValues *values)
{
if (valuemask == ValidGCValuesBits) {
char dashes = values->dashes;
......
......@@ -29,12 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
Status XGetGeometry (dpy, d, root, x, y, width, height, borderWidth, depth)
register Display *dpy;
Drawable d;
Window *root; /* RETURN */
int *x, *y; /* RETURN */
unsigned int *width, *height, *borderWidth, *depth; /* RETURN */
Status XGetGeometry (
register Display *dpy,
Drawable d,
Window *root, /* RETURN */
int *x,
int *y, /* RETURN */
unsigned int *width,
unsigned int *height,
unsigned int *borderWidth,
unsigned int *depth) /* RETURN */
{
xGetGeometryReply rep;
register xResourceReq *req;
......
......@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
Status XAllocColor(dpy, cmap, def)
register Display *dpy;
Colormap cmap;
XColor *def;
Status XAllocColor(
register Display *dpy,
Colormap cmap,
XColor *def)
{
Status status;
xAllocColorReply rep;
......
......@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
......@@ -56,11 +56,11 @@ SOFTWARE.
#include <nx-X11/Xatom.h>
#include <stdio.h>
Status XGetSizeHints (dpy, w, hints, property)
Display *dpy;
Window w;
XSizeHints *hints;
Atom property;
Status XGetSizeHints (
Display *dpy,
Window w,
XSizeHints *hints,
Atom property)
{
xPropSizeHints *prop = NULL;
Atom actual_type;
......@@ -97,15 +97,15 @@ Status XGetSizeHints (dpy, w, hints, property)
return(1);
}
/*
/*
* must return a pointer to the hint, in malloc'd memory, or routine is not
* extensible; any use of the caller's memory would cause things to be stepped
* on.
*/
XWMHints *XGetWMHints (dpy, w)
Display *dpy;
Window w;
XWMHints *XGetWMHints (
Display *dpy,
Window w)
{
xPropWMHints *prop = NULL;
register XWMHints *hints;
......@@ -113,7 +113,7 @@ XWMHints *XGetWMHints (dpy, w)
int actual_format;
unsigned long leftover;
unsigned long nitems;
if (XGetWindowProperty(dpy, w, XA_WM_HINTS,
if (XGetWindowProperty(dpy, w, XA_WM_HINTS,
0L, (long)NumPropWMHintsElements,
False, XA_WM_HINTS, &actual_type, &actual_format,
&nitems, &leftover, (unsigned char **)&prop)
......@@ -147,34 +147,34 @@ XWMHints *XGetWMHints (dpy, w)
}
Status
XGetZoomHints (dpy, w, zhints)
Display *dpy;
Window w;
XSizeHints *zhints;
XGetZoomHints (
Display *dpy,
Window w,
XSizeHints *zhints)
{
return (XGetSizeHints(dpy, w, zhints, XA_WM_ZOOM_HINTS));
}
Status
XGetNormalHints (dpy, w, hints)
Display *dpy;
Window w;
XSizeHints *hints;
XGetNormalHints (
Display *dpy,
Window w,
XSizeHints *hints)
{
return (XGetSizeHints(dpy, w, hints, XA_WM_NORMAL_HINTS));
}
/*
* XGetIconSizes reads the property
* XGetIconSizes reads the property
* ICONSIZE_ATOM type: ICONSIZE_ATOM format: 32
*/
Status XGetIconSizes (dpy, w, size_list, count)
Display *dpy;
Window w; /* typically, root */
XIconSize **size_list; /* RETURN */
int *count; /* RETURN number of items on the list */
Status XGetIconSizes (
Display *dpy,
Window w, /* typically, root */
XIconSize **size_list, /* RETURN */
int *count) /* RETURN number of items on the list */
{
xPropIconSize *prop = NULL;
register xPropIconSize *pp;
......@@ -203,7 +203,7 @@ Status XGetIconSizes (dpy, w, size_list, count)
/* static copies not allowed in library, due to reentrancy constraint*/
nitems /= NumPropIconSizeElements;
if (! (hp = hints = (XIconSize *)
if (! (hp = hints = (XIconSize *)
Xcalloc ((unsigned) nitems, (unsigned) sizeof(XIconSize)))) {
if (prop) Xfree ((char *) prop);
return 0;
......@@ -227,11 +227,11 @@ Status XGetIconSizes (dpy, w, size_list, count)
}
Status XGetCommand (dpy, w, argvp, argcp)
Display *dpy;
Window w;
char ***argvp;
int *argcp;
Status XGetCommand (
Display *dpy,
Window w,
char ***argvp,
int *argcp)
{
XTextProperty tp;
int argc;
......@@ -267,10 +267,10 @@ Status XGetCommand (dpy, w, argvp, argcp)
Status
XGetTransientForHint(dpy, w, propWindow)
Display *dpy;
Window w;
Window *propWindow;
XGetTransientForHint(
Display *dpy,
Window w,
Window *propWindow)
{
Atom actual_type;
int actual_format;
......@@ -278,7 +278,7 @@ XGetTransientForHint(dpy, w, propWindow)
unsigned long leftover;
Window *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_TRANSIENT_FOR, 0L, 1L, False,
XA_WINDOW,
XA_WINDOW,
&actual_type,
&actual_format, &nitems, &leftover, (unsigned char **) &data)
!= Success) {
......@@ -297,10 +297,10 @@ XGetTransientForHint(dpy, w, propWindow)
}
Status
XGetClassHint(dpy, w, classhint)
Display *dpy;
Window w;
XClassHint *classhint; /* RETURN */
XGetClassHint(
Display *dpy,
Window w,
XClassHint *classhint) /* RETURN */
{
int len_name, len_class;
......@@ -310,11 +310,11 @@ XGetClassHint(dpy, w, classhint)
unsigned long leftover;
unsigned char *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_CLASS, 0L, (long)BUFSIZ, False,
XA_STRING,
XA_STRING,
&actual_type,
&actual_format, &nitems, &leftover, &data) != Success)
return (0);
if ( (actual_type == XA_STRING) && (actual_format == 8) ) {
len_name = strlen((char *) data);
if (! (classhint->res_name = Xmalloc((unsigned) (len_name+1)))) {
......
......@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XGetInputFocus(dpy, focus, revert_to)
register Display *dpy;
Window *focus;
int *revert_to;
{
XGetInputFocus(
register Display *dpy,
Window *focus,
int *revert_to)
{
xGetInputFocusReply rep;
register xReq *req;
LockDisplay(dpy);
......
......@@ -43,13 +43,15 @@ static unsigned int Ones( /* HACKMEM 169 */
return ((unsigned int) (((y + (y >> 3)) & 030707070707) % 077));
}
XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format)
register Display *dpy;
Drawable d;
int x, y;
unsigned int width, height;
unsigned long plane_mask;
int format; /* either XYPixmap or ZPixmap */
XImage *XGetImage (
register Display *dpy,
Drawable d,
int x,
int y,
unsigned int width,
unsigned int height,
unsigned long plane_mask,
int format) /* either XYPixmap or ZPixmap */
{
xGetImageReply rep;
register xGetImageReq *req;
......@@ -68,14 +70,14 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format)
req->height = height;
req->planeMask = plane_mask;
req->format = format;
if (_XReply (dpy, (xReply *) &rep, 0, xFalse) == 0 ||
rep.length == 0) {
UnlockDisplay(dpy);
SyncHandle();
return (XImage *)NULL;
}
nbytes = (long)rep.length << 2;
data = (char *) Xmalloc((unsigned) nbytes);
if (! data) {
......@@ -102,23 +104,25 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format)
return (image);
}
XImage *XGetSubImage(dpy, d, x, y, width, height, plane_mask, format,
dest_image, dest_x, dest_y)
register Display *dpy;
Drawable d;
int x, y;
unsigned int width, height;
unsigned long plane_mask;
int format; /* either XYPixmap or ZPixmap */
XImage *dest_image;
int dest_x, dest_y;
XImage *XGetSubImage(
register Display *dpy,
Drawable d,
int x,
int y,
unsigned int width,
unsigned int height,
unsigned long plane_mask,
int format, /* either XYPixmap or ZPixmap */
XImage *dest_image,
int dest_x,
int dest_y)
{
XImage *temp_image;
temp_image = XGetImage(dpy, d, x, y, width, height,
temp_image = XGetImage(dpy, d, x, y, width, height,
plane_mask, format);
if (!temp_image)
return (XImage *)NULL;
_XSetImage(temp_image, dest_image, dest_x, dest_y);
XDestroyImage(temp_image);
return (dest_image);
}
}
......@@ -30,15 +30,15 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XGetKeyboardControl (dpy, state)
register Display *dpy;
register XKeyboardState *state;
{
XGetKeyboardControl (
register Display *dpy,
register XKeyboardState *state)
{
xGetKeyboardControlReply rep;
register xReq *req;
LockDisplay(dpy);
GetEmptyReq (GetKeyboardControl, req);
(void) _XReply (dpy, (xReply *) &rep,
(void) _XReply (dpy, (xReply *) &rep,
(SIZEOF(xGetKeyboardControlReply) - SIZEOF(xReply)) >> 2, xTrue);
state->key_click_percent = rep.keyClickPercent;
......
......@@ -29,12 +29,13 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "Xlibint.h"
XTimeCoord *XGetMotionEvents(dpy, w, start, stop, nEvents)
register Display *dpy;
Time start, stop;
Window w;
int *nEvents; /* RETURN */
{
XTimeCoord *XGetMotionEvents(
register Display *dpy,
Window w,
Time start,
Time stop,
int *nEvents) /* RETURN */
{
xGetMotionEventsReply rep;
register xGetMotionEventsReq *req;
XTimeCoord *tc = NULL;
......@@ -50,10 +51,10 @@ XTimeCoord *XGetMotionEvents(dpy, w, start, stop, nEvents)
SyncHandle();
return (NULL);
}
if (rep.nEvents) {
if (! (tc = (XTimeCoord *)
Xmalloc( (unsigned)
Xmalloc( (unsigned)
(nbytes = (long) rep.nEvents * sizeof(XTimeCoord))))) {
_XEatData (dpy, (unsigned long) nbytes);
UnlockDisplay(dpy);
......
......@@ -4,20 +4,20 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
both that copyright notice and this permission notice appear in
supporting documentation, and that the name Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
software without specific, written prior permission.
DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
******************************************************************/
......@@ -60,12 +60,12 @@ from The Open Group.
#include <nx-X11/Xutil.h>
#include <stdio.h>
Status XGetWMSizeHints (dpy, w, hints, supplied, property)
Display *dpy;
Window w;
XSizeHints *hints;
long *supplied;
Atom property;
Status XGetWMSizeHints (
Display *dpy,
Window w,
XSizeHints *hints,
long *supplied,
Atom property)
{
xPropSizeHints *prop = NULL;
Atom actual_type;
......@@ -73,10 +73,10 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property)
unsigned long leftover;
unsigned long nitems;
if (XGetWindowProperty (dpy, w, property, 0L,
if (XGetWindowProperty (dpy, w, property, 0L,
(long)NumPropSizeElements,
False, XA_WM_SIZE_HINTS, &actual_type,
&actual_format, &nitems, &leftover,
&actual_format, &nitems, &leftover,
(unsigned char **)&prop)
!= Success)
return False;
......@@ -117,11 +117,11 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property)
}
Status XGetWMNormalHints (dpy, w, hints, supplied)
Display *dpy;
Window w;
XSizeHints *hints;
long *supplied;
Status XGetWMNormalHints (
Display *dpy,
Window w,
XSizeHints *hints,
long *supplied)
{
return (XGetWMSizeHints (dpy, w, hints, supplied, XA_WM_NORMAL_HINTS));
}
......@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h"
int
XGetPointerControl(dpy, accel_numer, accel_denom, threshold)
register Display *dpy;
XGetPointerControl(
register Display *dpy,
/* the following are return only vars */
int *accel_numer, *accel_denom;
int *threshold;
{
int *accel_numer,
int *accel_denom,
int *threshold)
{
xGetPointerControlReply rep;
xReq *req;
LockDisplay(dpy);
......
......@@ -35,10 +35,10 @@ in this Software without prior written authorization from The Open Group.
#endif
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int XGetPointerMapping (dpy, map, nmaps)
register Display *dpy;
unsigned char *map; /* RETURN */
int nmaps;
int XGetPointerMapping (
register Display *dpy,
unsigned char *map, /* RETURN */
int nmaps)
{
unsigned char mapping[256]; /* known fixed size */
......@@ -64,11 +64,11 @@ int XGetPointerMapping (dpy, map, nmaps)
_XRead (dpy, (char *)mapping, nbytes);
/* don't return more data than the user asked for. */
if (rep.nElts) {
memcpy ((char *) map, (char *) mapping,
memcpy ((char *) map, (char *) mapping,
MIN((int)rep.nElts, nmaps) );
}
if (remainder)
if (remainder)
_XEatData(dpy, (unsigned long)remainder);
UnlockDisplay(dpy);
......
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