[gnu.gcc.bug] GCC 1.31 problem on VAX

weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) (12/01/88)

GCC 1.31 aborts in insn_extract() on the following program, on a
VAX-11/750 running 4.3bsd.  The code below is cpp output of part of
the file clients/x10tox11/proto1.c in the X11R3 distribution.  You
need to compile with -O to get the error.  Here is a stack trace of
the crash:

% adb /usr/local/lib/gcc-cc1 core
$c
_kill(69b,4) from _abort+39
_abort() from _insn_extract+17
_insn_extract(5caac) from _regclass+ee
_regclass(5bd1c,2e) from 17c2
_rest_of_compilation(a4ff8) from _finish_function+63
_finish_function() from	5aca
_yyparse() from	eaa
_set_float_handler(7fffeac7) from 2285
_main(8,7fffea64,7fffea88) from	start+3d
% 

Here is the code:

# 1 "tmp.c"


























# 1 "resource.h"



























# 1 "../.././X11/Xos.h"




































# 1 "/usr/include/sys/types.h"























typedef	unsigned char	u_char;
typedef	unsigned short	u_short;
typedef	unsigned int	u_int;
typedef	unsigned long	u_long;
typedef	unsigned short	ushort;		


typedef	struct	_physadr { int r[1]; } *physadr;
typedef	struct	label_t	{
	int	val[14];
} label_t;

typedef	struct	_quad { long val[2]; } quad;
typedef	long	daddr_t;
typedef	char *	caddr_t;
typedef	u_long	ino_t;
typedef	long	swblk_t;
typedef	long	size_t;
typedef	long	time_t;
typedef	short	dev_t;
typedef	long	off_t;
typedef	u_int	uid_t;
typedef	u_int	gid_t;












typedef long	fd_mask;





typedef	struct fd_set {
	fd_mask	fds_bits[(((256)+(( (sizeof(fd_mask) * 8		)	)-1))/( (sizeof(fd_mask) * 8		)	))];
} fd_set;







# 37 "../.././X11/Xos.h"































# 1 "/usr/include/strings.h"












char	*strcat();
char	*strncat();
int	strcmp();
int	strncmp();
char	*strcpy();
char	*strncpy();
int	strlen();
char	*index();
char	*rindex();
# 68 "../.././X11/Xos.h"











# 1 "/usr/include/sys/file.h"








# 34 "/usr/include/sys/file.h"















































































# 122 "/usr/include/sys/file.h"

# 79 "../.././X11/Xos.h"

















# 1 "/usr/include/sys/time.h"












struct timeval {
	long	tv_sec;		
	long	tv_usec;	
};

struct timezone {
	int	tz_minuteswest;	
	int	tz_dsttime;	
};



























struct	itimerval {
	struct	timeval it_interval;	
	struct	timeval it_value;	
};


# 1 "/usr/include/time.h"





struct tm {
	int	tm_sec;
	int	tm_min;
	int	tm_hour;
	int	tm_mday;
	int	tm_mon;
	int	tm_year;
	int	tm_wday;
	int	tm_yday;
	int	tm_isdst;
};

extern	struct tm *gmtime(), *localtime();
extern	char *asctime(), *ctime();
# 55 "/usr/include/sys/time.h"



# 96 "../.././X11/Xos.h"





























# 28 "resource.h"

# 1 "../.././X11/Xlib.h"

































# 1 "/usr/include/sys/types.h"








# 74 "/usr/include/sys/types.h"

# 34 "../.././X11/Xlib.h"



# 1 "../.././X11/X.h"





































typedef unsigned long XID;

typedef XID Window;
typedef XID Drawable;
typedef XID Font;
typedef XID Pixmap;
typedef XID Cursor;
typedef XID Colormap;
typedef XID GContext;
typedef XID KeySym;

typedef unsigned long Mask;

typedef unsigned long Atom;

typedef unsigned long VisualID;

typedef unsigned long Time;

typedef unsigned char KeyCode;

































































































































































		       



















































































# 311 "../.././X11/X.h"





























































































































































































































































































































































# 37 "../.././X11/Xlib.h"




































































typedef struct _XExtData {
	int number;		
	struct _XExtData *next;	
	int (*free_private)();	
	char *private_data;	
} XExtData;




typedef struct {		
	int extension;		
	int major_opcode;	
	int first_event;	
	int first_error;	
} XExtCodes;




typedef struct _XExten {	
	struct _XExten *next;	
	XExtCodes codes;	
	int (*create_GC)();	
	int (*copy_GC)();	
	int (*flush_GC)();	
	int (*free_GC)();	
	int (*create_Font)();	
	int (*free_Font)();	
	int (*close_display)();	
	int (*error)();		
	int (*error_string)();  
} _XExtension;




typedef struct {
	int function;		
	unsigned long plane_mask;
	unsigned long foreground;
	unsigned long background;
	int line_width;		
	int line_style;	 	
	int cap_style;	  	

	int join_style;	 	
	int fill_style;	 	

	int fill_rule;	  	
	int arc_mode;		
	Pixmap tile;		
	Pixmap stipple;		
	int ts_x_origin;	
	int ts_y_origin;
        Font font;	        
	int subwindow_mode;     
	int graphics_exposures;
	int clip_x_origin;	
	int clip_y_origin;
	Pixmap clip_mask;	
	int dash_offset;	
	char dashes;
} XGCValues;








typedef struct _XGC {
    XExtData *ext_data;	
    GContext gid;	
    int rects;		
    int dashes;	
    unsigned long dirty;
    XGCValues values;	
} *GC;





typedef struct {
	XExtData *ext_data;	
	VisualID visualid;	
	int class;		
	unsigned long red_mask, green_mask, blue_mask;	
	int bits_per_rgb;	
	int map_entries;	
} Visual;



	
typedef struct {
	int depth;		
	int nvisuals;		
	Visual *visuals;	
} Depth;




typedef struct {
	XExtData *ext_data;	
	struct _XDisplay *display;
	Window root;		
	int width, height;	
	int mwidth, mheight;	
	int ndepths;		
	Depth *depths;		
	int root_depth;		
	Visual *root_visual;	
	GC default_gc;		
	Colormap cmap;		
	unsigned long white_pixel;
	unsigned long black_pixel;	
	int max_maps, min_maps;	
	int backing_store;	
	int save_unders;	
	long root_input_mask;	
} Screen;




typedef struct {
	XExtData *ext_data;	
	int depth;		
	int bits_per_pixel;	
	int scanline_pad;	
} ScreenFormat;





typedef struct {
    Pixmap background_pixmap;	
    unsigned long background_pixel;	
    Pixmap border_pixmap;	
    unsigned long border_pixel;	
    int bit_gravity;		
    int win_gravity;		
    int backing_store;		
    unsigned long backing_planes;
    unsigned long backing_pixel;
    int save_under;		
    long event_mask;		
    long do_not_propagate_mask;	
    int override_redirect;	
    Colormap colormap;		
    Cursor cursor;		
} XSetWindowAttributes;

typedef struct {
    int x, y;			
    int width, height;		
    int border_width;		
    int depth;          	
    Visual *visual;		
    Window root;        	
    int class;			
    int bit_gravity;		
    int win_gravity;		
    int backing_store;		
    unsigned long backing_planes;
    unsigned long backing_pixel;
    int save_under;		
    Colormap colormap;		
    int map_installed;		
    int map_state;		
    long all_event_masks;	
    long your_event_mask;	
    long do_not_propagate_mask; 
    int override_redirect;	
    Screen *screen;		
} XWindowAttributes;






typedef struct {
	int family;		
	int length;		
	char *address;		
} XHostAddress;




typedef struct _XImage {
    int width, height;		
    int xoffset;		
    int format;			
    char *data;			
    int byte_order;		
    int bitmap_unit;		
    int bitmap_bit_order;	
    int bitmap_pad;		
    int depth;			
    int bytes_per_line;		
    int bits_per_pixel;		
    unsigned long red_mask;	
    unsigned long green_mask;
    unsigned long blue_mask;
    char *obdata;		
    struct funcs {		
	struct _XImage *(*create_image)();
	int (*destroy_image)();
	unsigned long (*get_pixel)();
	int (*put_pixel)();
	struct _XImage *(*sub_image)();
	int (*add_pixel)();
	} f;
} XImage;




typedef struct {
    int x, y;
    int width, height;
    int border_width;
    Window sibling;
    int stack_mode;
} XWindowChanges;




typedef struct {
	unsigned long pixel;
	unsigned short red, green, blue;
	char flags;  
	char pad;
} XColor;






typedef struct {
    short x1, y1, x2, y2;
} XSegment;

typedef struct {
    short x, y;
} XPoint;
    
typedef struct {
    short x, y;
    unsigned short width, height;
} XRectangle;
    
typedef struct {
    short x, y;
    unsigned short width, height;
    short angle1, angle2;
} XArc;




typedef struct {
        int key_click_percent;
        int bell_percent;
        int bell_pitch;
        int bell_duration;
        int led;
        int led_mode;
        int key;
        int auto_repeat_mode;   
} XKeyboardControl;



typedef struct {
        int key_click_percent;
	int bell_percent;
	unsigned int bell_pitch, bell_duration;
	unsigned long led_mask;
	int global_auto_repeat;
	char auto_repeats[32];
} XKeyboardState;



typedef struct {
        Time time;
	short x, y;
} XTimeCoord;



typedef struct {
 	int max_keypermod;	
 	KeyCode *modifiermap;	
} XModifierKeymap;

XModifierKeymap *XNewModifiermap(),
		*XGetModifierMapping(),
		*XDeleteModifiermapEntry(),
		*XInsertModifiermapEntry();





typedef struct _XDisplay {
	XExtData *ext_data;	
	struct _XDisplay *next; 
	int fd;			
	int lock;		
	int proto_major_version;
	int proto_minor_version;
	char *vendor;		
        long resource_base;	
	long resource_mask;	
	long resource_id;	
	int resource_shift;	
	XID (*resource_alloc)(); 
	int byte_order;		
	int bitmap_unit;	
	int bitmap_pad;		
	int bitmap_bit_order;	
	int nformats;		
	ScreenFormat *pixmap_format;	
	int vnumber;		
	int release;		
	struct _XSQEvent *head, *tail;	
	int qlen;		
	unsigned long last_request_read; 
	unsigned long request;	
	char *last_req;		
	char *buffer;		
	char *bufptr;		
	char *bufmax;		
	unsigned max_request_size; 
	struct _XrmHashBucketRec *db;
	int (*synchandler)();	
	char *display_name;	
	int default_screen;	
	int nscreens;		
	Screen *screens;	
	unsigned long motion_buffer;	
	Window current;		
	int min_keycode;	
	int max_keycode;	
	KeySym *keysyms;	
	XModifierKeymap *modifiermap;	
	int keysyms_per_keycode;
	char *xdefaults;	
	char *scratch_buffer;	
	unsigned long scratch_length;	
	int ext_number;		
	_XExtension *ext_procs;	
	







	int (*event_vec[128])();  
	int (*wire_vec[128])(); 
	KeySym lock_meaning;	   
	struct XKeytrans *key_bindings; 
	Font cursor_font;	   
} Display;

















typedef struct {
	int type;		
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;	        
	Window root;	        
	Window subwindow;	
	Time time;		
	int x, y;		
	int x_root, y_root;	
	unsigned int state;	
	unsigned int keycode;	
	int same_screen;	
} XKeyEvent;
typedef XKeyEvent XKeyPressedEvent;
typedef XKeyEvent XKeyReleasedEvent;

typedef struct {
	int type;		
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;	        
	Window root;	        
	Window subwindow;	
	Time time;		
	int x, y;		
	int x_root, y_root;	
	unsigned int state;	
	unsigned int button;	
	int same_screen;	
} XButtonEvent;
typedef XButtonEvent XButtonPressedEvent;
typedef XButtonEvent XButtonReleasedEvent;

typedef struct {
	int type;		
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;	        
	Window root;	        
	Window subwindow;	
	Time time;		
	int x, y;		
	int x_root, y_root;	
	unsigned int state;	
	char is_hint;		
	int same_screen;	
} XMotionEvent;
typedef XMotionEvent XPointerMovedEvent;

typedef struct {
	int type;		
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;	        
	Window root;	        
	Window subwindow;	
	Time time;		
	int x, y;		
	int x_root, y_root;	
	int mode;		
	int detail;
	



	int same_screen;	
	int focus;		
	unsigned int state;	
} XCrossingEvent;
typedef XCrossingEvent XEnterWindowEvent;
typedef XCrossingEvent XLeaveWindowEvent;

typedef struct {
	int type;		
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;		
	int mode;		
	int detail;
	




} XFocusChangeEvent;
typedef XFocusChangeEvent XFocusInEvent;
typedef XFocusChangeEvent XFocusOutEvent;


typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	char key_vector[32];
} XKeymapEvent;	

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	int x, y;
	int width, height;
	int count;		
} XExposeEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Drawable drawable;
	int x, y;
	int width, height;
	int count;		
	int major_code;		
	int minor_code;		
} XGraphicsExposeEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Drawable drawable;
	int major_code;		
	int minor_code;		
} XNoExposeEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	int state;		
} XVisibilityEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window parent;		
	Window window;		
	int x, y;		
	int width, height;	
	int border_width;	
	int override_redirect;	
} XCreateWindowEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window event;
	Window window;
} XDestroyWindowEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window event;
	Window window;
	int from_configure;
} XUnmapEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window event;
	Window window;
	int override_redirect;	
} XMapEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window parent;
	Window window;
} XMapRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window event;
	Window window;
	Window parent;
	int x, y;
	int override_redirect;
} XReparentEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window event;
	Window window;
	int x, y;
	int width, height;
	int border_width;
	Window above;
	int override_redirect;
} XConfigureEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window event;
	Window window;
	int x, y;
} XGravityEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	int width, height;
} XResizeRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window parent;
	Window window;
	int x, y;
	int width, height;
	int border_width;
	Window above;
	int detail;		
	unsigned long value_mask;
} XConfigureRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window event;
	Window window;
	int place;		
} XCirculateEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window parent;
	Window window;
	int place;		
} XCirculateRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	Atom atom;
	Time time;
	int state;		
} XPropertyEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	Atom selection;
	Time time;
} XSelectionClearEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window owner;
	Window requestor;
	Atom selection;
	Atom target;
	Atom property;
	Time time;
} XSelectionRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window requestor;
	Atom selection;
	Atom target;
	Atom property;		
	Time time;
} XSelectionEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	Colormap colormap;	
	int new;
	int state;		
} XColormapEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;
	Atom message_type;
	int format;
	union {
		char b[20];
		short s[10];
		long l[5];
		} data;
} XClientMessageEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;	
	Window window;		
	int request;		

	int first_keycode;	
	int count;		
} XMappingEvent;

typedef struct {
	int type;
	Display *display;	
	XID resourceid;		
	unsigned long serial;	
	unsigned char error_code;	
	unsigned char request_code;	
	unsigned char minor_code;	
} XErrorEvent;

typedef struct {
	int type;
	unsigned long serial;	
	int send_event;	
	Display *display;
	Window window;	
} XAnyEvent;





typedef union _XEvent {
        int type;		
	XAnyEvent xany;
	XKeyEvent xkey;
	XButtonEvent xbutton;
	XMotionEvent xmotion;
	XCrossingEvent xcrossing;
	XFocusChangeEvent xfocus;
	XExposeEvent xexpose;
	XGraphicsExposeEvent xgraphicsexpose;
	XNoExposeEvent xnoexpose;
	XVisibilityEvent xvisibility;
	XCreateWindowEvent xcreatewindow;
	XDestroyWindowEvent xdestroywindow;
	XUnmapEvent xunmap;
	XMapEvent xmap;
	XMapRequestEvent xmaprequest;
	XReparentEvent xreparent;
	XConfigureEvent xconfigure;
	XGravityEvent xgravity;
	XResizeRequestEvent xresizerequest;
	XConfigureRequestEvent xconfigurerequest;
	XCirculateEvent xcirculate;
	XCirculateRequestEvent xcirculaterequest;
	XPropertyEvent xproperty;
	XSelectionClearEvent xselectionclear;
	XSelectionRequestEvent xselectionrequest;
	XSelectionEvent xselection;
	XColormapEvent xcolormap;
	XClientMessageEvent xclient;
	XMappingEvent xmapping;
	XErrorEvent xerror;
	XKeymapEvent xkeymap;
	long pad[24];
} XEvent;



typedef struct _XSQEvent {
    struct _XSQEvent *next;
    XEvent event;
} _XQEvent;







typedef struct {
    short	lbearing;	
    short	rbearing;	
    short	width;		
    short	ascent;		
    short	descent;	
    unsigned short attributes;	
} XCharStruct;





typedef struct {
    Atom name;
    unsigned long card32;
} XFontProp;

typedef struct {
    XExtData	*ext_data;	
    Font        fid;            
    unsigned	direction;	
    unsigned	min_char_or_byte2;
    unsigned	max_char_or_byte2;
    unsigned	min_byte1;	
    unsigned	max_byte1;	
    int	all_chars_exist;
    unsigned	default_char;	
    int         n_properties;   
    XFontProp	*properties;	
    XCharStruct	min_bounds;	
    XCharStruct	max_bounds;	
    XCharStruct	*per_char;	
    int		ascent;		
    int		descent;	
} XFontStruct;




typedef struct {
    char *chars;		
    int nchars;			
    int delta;			
    Font font;			
} XTextItem;

typedef struct {		
    unsigned char byte1;
    unsigned char byte2;
} XChar2b;

typedef struct {
    XChar2b *chars;		
    int nchars;			
    int delta;			
    Font font;			
} XTextItem16;


XFontStruct *XLoadQueryFont(), *XQueryFont();

XTimeCoord *XGetMotionEvents();

typedef union { Display *display;
		GC gc;
		Visual *visual;
		Screen *screen;
		ScreenFormat *pixmap_format;
		XFontStruct *font; } XEDataObject;




Display *XOpenDisplay();

char *XFetchBytes();
char *XFetchBuffer();
char *XGetAtomName();
char *XGetDefault();
char *XDisplayName();
char *XKeysymToString();

int (*XSynchronize())();
int (*XSetAfterFunction())();
Atom XInternAtom();
Colormap XCopyColormapAndFree(), XCreateColormap();
Cursor XCreatePixmapCursor(), XCreateGlyphCursor(), XCreateFontCursor();
Font XLoadFont();
GC XCreateGC();
GContext XGContextFromGC();
Pixmap XCreatePixmap();
Pixmap XCreateBitmapFromData(), XCreatePixmapFromBitmapData();
Window XCreateSimpleWindow(), XGetSelectionOwner();
Window XCreateWindow(); 
Colormap *XListInstalledColormaps();
char **XListFonts(), **XListFontsWithInfo(), **XGetFontPath();
char **XListExtensions();
Atom *XListProperties();
XImage *XCreateImage(), *XGetImage(), *XGetSubImage();
XHostAddress *XListHosts();
KeySym XKeycodeToKeysym(), XLookupKeysym(), *XGetKeyboardMapping();
KeySym XStringToKeysym();
long XMaxRequestSize();
char *XResourceManagerString();
unsigned long XDisplayMotionBufferSize();
VisualID XVisualIDFromVisual();


XExtCodes *XInitExtension();
int (*XESetCreateGC())(), (*XESetCopyGC())(), (*XESetFlushGC())(),
    (*XESetFreeGC())(), (*XESetCreateFont())(), (*XESetFreeFont())(), 
    (*XESetCloseDisplay())(),
    (*XESetError())(), (*XESetErrorString())();
int (*XESetWireToEvent())();
int (*XESetEventToWire())();
XExtCodes *XAddExtension();
XExtData *XFindOnExtensionList();
XExtData **XEHeadOfExtensionList();


Window XRootWindow(), XDefaultRootWindow(), XRootWindowOfScreen();
Visual *XDefaultVisual(), *XDefaultVisualOfScreen();
GC XDefaultGC(), XDefaultGCOfScreen();
unsigned long XBlackPixel(), XWhitePixel(), XAllPlanes();
unsigned long XBlackPixelOfScreen(), XWhitePixelOfScreen();
unsigned long XNextRequest(), XLastKnownRequestProcessed();
char *XServerVendor(), *XDisplayString();
Colormap XDefaultColormap(), XDefaultColormapOfScreen();
Display *XDisplayOfScreen();
Screen *XScreenOfDisplay(), *XDefaultScreenOfDisplay();
long XEventMaskOfScreen();

# 29 "resource.h"

# 1 "debug.h"


























# 99 "debug.h"



















# 30 "resource.h"

# 1 "X10struct.h"


























# 1 "../.././X11/copyright.h"



















# 27 "X10struct.h"


























# 62 "X10struct.h"





typedef struct _ColorDef {
	unsigned short pixel ;
	unsigned short red , green , blue ;
} X10ColorDef;

typedef struct _X10Req {
	unsigned char code;
	unsigned char func;
	unsigned short mask ;
	Window windowId;
	union {
	    long l[4];




	    short s[8];
	    unsigned short u[8];

	    char b[16];
	} param;
} X10Req;



typedef struct _X10Rep {
	long code;
	union {
	    long l[5];




	    short s[10];
	    unsigned short u[10];

	    char b[20];
	} param;
} X10Rep;



typedef struct _X10Vertex {
	short x, y;
	unsigned short flags;
} X10Vertex;










# 144 "X10struct.h"










































































































































































# 31 "resource.h"


typedef struct _SerialList SerialList, *SerialListptr;
typedef struct _RequestSerial {
	unsigned long	*serial;	
	int		count;		
} RequestSerial, *RequestSerialptr;





typedef struct _WinInfo *WinInfoptr;
typedef struct _WinInfo {
	Window		id;		
	Window		icon;		
					
					
	Pixmap		tile;
	unsigned long	mask;
	unsigned long	grabmask;
	RequestSerial	mapReq;		
	RequestSerial	configureReq;	
	Window		unmapTransparent;
	Window		originalParent;	
	short		width;		
	short		height;		
	short		borderWidth;
	short		x, y;		
	int		transparent;	
	int		hasTransparency;
					
	int		drawThrough;	
	int		mapped;		
	int		mapRequested;	
	int		foriegn;	
	int		tileModeRelative;
	int		isIcon;		
	int		neverMapped;	
	Pixmap		savedPixmap;	
	unsigned short	configured;	
					
	WinInfoptr	sibling;	
					
	WinInfoptr	child;		
	WinInfoptr	parent;		
	Window		gcWin;		
	GC		gc;
	int		client;		
} WinInfo;










typedef struct _PixmapInfo *PixmapInfoptr;
typedef struct _PixmapInfo {
	Pixmap		id;		
	XID		bitmapid;	
	unsigned int	width;
	unsigned int	height;
	unsigned int	depth;
	GC		gc;
	PixmapInfoptr	next;
	int		isSavedPixmap;	
	int		isBackingStore;	
	short		x, y;		
} PixmapInfo;

typedef struct _FontInfo *FontInfoptr;
typedef struct _FontInfo {
	Font		id;		
	XFontStruct	*info;
	FontInfoptr	next;
	unsigned int	ascent;		
	unsigned int	descent;	
} FontInfo;






# 132 "resource.h"






















typedef struct _sequencelist *SequenceListptr;
typedef struct _sequencelist {
	X10Req		*req;		
	unsigned long	*x11seq;	
	int		last;		
	int		head;		
	int		tail;		
} SequenceList;




























PixmapInfoptr	GetTextPixmap();
PixmapInfoptr	CreatePixmap();
PixmapInfoptr	PixmapLookup();
PixmapInfoptr	BitmapLookup();
PixmapInfoptr	StorePixmapOrBitmap();
FontInfoptr	FontLookup();
WinInfoptr	WinLookup();
WinInfoptr	AddWin();
WinInfoptr	FindDrawableParent();

typedef struct _Client {
	Display		*dpy;		
	PixmapInfoptr	pixmaps;	
	PixmapInfoptr	textBackground;	
	FontInfoptr	fontinfo;	
	Window		grabwin;	
	SequenceList	seq;		
	XEvent		buffer;		


					


	u_char		pendingFlags;

	






	GC		opaqueClippedGC;
	GC		opaqueUnclippedGC;
	GC		clearClippedGC;
	GC		clearUnclippedGC;
	GC		bitmapGC;
	GC		pixmapGC;
	RequestSerial	unmapTransReq;	
	unsigned long	lastEventDispatched; 
} Client, *Clientptr;

typedef struct _FontMap {
	char	*fontname;
	int	fontindex;
} FontMap, *FontMapptr;



























































int	AfterFunction();
char	**X11FontNames();
char	*ToLower();
char	*Xalloc();
char	*Xrealloc();
char	*StaticAlloc();
char	*X10ProcPixmapGet();
int	WindowMapped();
int	CausedByRequest();
int	InvalidHost();
unsigned long X10toX11EventMask();
unsigned long X11toX10EventMask();
unsigned long X11toX10KeyButState();
unsigned long X10ButtonMaskToX11KeyMask();
unsigned long X10ButtonMaskToX11Button();
unsigned long X10toX11pixel();
void	InvalidateClips();
void	SendEventsToX10Client();
void	SetClipMode();
void	SetTileMode();
void	UpdateWinTree();
void	FreePixmapInfo();
void	FreeFontInfo();
void	FreeWinInfo();
void	FreeClientWindows();
void	Reparent();
void	ResetCache();
void	SetCacheSize();
void	ShowCachePerformance();
void	ShowWinTree();
void	RaiseLowestChild();
void	LowerHighestChild();
void	LowerWindow();
void	RaiseWindow();
void	MarkMappedWinTree();
void	DeleteUnmapTransparentRequest();
void	AddRequestSerial();
void	ClearUnmappedTransparentTree();
void	ClearUnmappedTransparent();
void	MarkWindowDeleted();
XImage	*CreateX10Image();

extern Clientptr	clist[];
extern u_char		GXFunctionInvert[];
extern u_char		Xstatus;
extern int		LockToggleMode;
extern int		GrabUnviewable;
extern int		OverrideRedirect;
extern int		FocusKeyboardAllowed;
extern int		Bigendian;
extern int		NoTransform;
extern int		DoSync;
extern int		GrabServerAllowed;
extern int		ServerGrabbed;
extern int		GrabMouseAllowed;
extern int		MinimumTileSize;
extern int		FileDescriptors;
extern int		WindowsUnmappedTransparent;
extern unsigned int	BestWidth;
extern unsigned int	BestHeight;
extern Colormap		ScreenColormap;
extern Visual		*ScreenVisual;
extern unsigned long	ScreenWhitePixel;
extern unsigned long	ScreenBlackPixel;
extern int		ScreenColorCells;
extern int		ScreenDepth;
extern char		*VisualClassNames[];
extern Time		LastKnownServerTime;
extern Display		*PrimaryConnection;
extern int		PrimaryClient;
extern char		*X11EventNames[];
extern char		*program;




char *sprintf();
char *strncpy();
char *strcpy();
int strlen();
# 27 "tmp.c"

# 1 "../.././X11/Xatom.h"















































































# 28 "tmp.c"

# 1 "../.././X11/Xutil.h"










































typedef struct {
    	long flags;	
	int x, y;
	int width, height;
	int min_width, min_height;
	int max_width, max_height;
    	int width_inc, height_inc;
	struct {
		int x;	
		int y;	
	} min_aspect, max_aspect;
} XSizeHints;


















typedef struct {
	long flags;	
	int input;	

	int initial_state;	
	Pixmap icon_pixmap;	
	Window icon_window; 	
	int icon_x, icon_y; 	
	Pixmap icon_mask;	
	XID window_group;	
	
} XWMHints;























typedef struct {
	int min_width, min_height;
	int max_width, max_height;
	int width_inc, height_inc;
} XIconSize;

typedef struct {
	char *res_name;
	char *res_class;
} XClassHint;



















typedef struct _XComposeStatus {
    char *compose_ptr;		
    int chars_matched;		
} XComposeStatus;

























typedef struct _XRegion *Region; 


 



 






typedef struct {
  Visual *visual;
  VisualID visualid;
  int screen;
  int depth;
  int class;
  unsigned long red_mask;
  unsigned long green_mask;
  unsigned long blue_mask;
  int colormap_size;
  int bits_per_rgb;
} XVisualInfo;


















typedef struct {
	Colormap colormap;
	unsigned long red_max;
	unsigned long red_mult;
	unsigned long green_max;
	unsigned long green_mult;
	unsigned long blue_max;
	unsigned long blue_mult;
	unsigned long base_pixel;
} XStandardColormap;

























typedef int XContext;




extern int XSaveContext(); 
    
    
    

extern int XFindContext(); 
    
    
    
    

extern int XDeleteContext(); 
    
    


XWMHints *XGetWMHints();
Region XCreateRegion(), XPolygonRegion();
XImage *XCreateImage();

XVisualInfo *XGetVisualInfo();

# 29 "tmp.c"


int X10ProcGrabMouse(client, req)
	int	client;
	X10Req	*req;
{
	int		status,
			result = 0;
	unsigned long	mask = req->param.l[1];
	Cursor		cursor = req->param.l[0];
	Clientptr	cp = clist[ client ];
	Display 	*dpy = cp->dpy;
	Window		w = req->windowId;
	WinInfoptr  wp = WinLookup(client,  w);	if ( wp == 0) {	Xstatus = 3		;	 return(0);	};

	if (! GrabMouseAllowed)
		return(1);

	


	mask =    0x0004		
		| 0x0008	
		|  0x0010		
		|  0x0020		
		|  0x0040		
		| 0x0400	
		| 0x0800	
		| 0x1000	;
	mask = (req->param.l[1] & mask) | (wp->mask & ~mask);

	



	if (! WindowMapRequested(wp)) {
		GrabUnviewable = client;
		w = 	(((dpy)->screens[(dpy)->default_screen]).root);
	} else
		GrabUnviewable = 0;

	status = XGrabPointer(dpy,
			w,
			1,
			(unsigned int)(X10toX11EventMask(mask)
				|  (		(1L<<15) 	| 	(1L<<17) 	| 		(1L<<4)  	| 		(1L<<5)  )),
				1, 	1,
			                0L	,
			cursor == 0 ?                 0L	 : cursor,
			         0L	);
	return(result);
}