# 1 "colormap.c" # 1 "" # 1 "" # 1 "colormap.c" # 50 "colormap.c" # 1 "../include/dix-config.h" 1 # 51 "colormap.c" 2 # 1 "/usr/include/X11/X.h" 1 3 4 # 71 "/usr/include/X11/X.h" 3 4 typedef unsigned long XID; typedef unsigned long Mask; typedef unsigned long Atom; typedef unsigned long VisualID; typedef unsigned long Time; # 101 "/usr/include/X11/X.h" 3 4 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 char KeyCode; # 54 "colormap.c" 2 # 1 "/usr/include/X11/Xproto.h" 1 3 4 # 76 "/usr/include/X11/Xproto.h" 3 4 # 1 "/usr/include/X11/Xmd.h" 1 3 4 # 137 "/usr/include/X11/Xmd.h" 3 4 typedef long INT32; typedef short INT16; typedef signed char INT8; # 152 "/usr/include/X11/Xmd.h" 3 4 typedef unsigned long CARD32; typedef unsigned long long CARD64; typedef unsigned short CARD16; typedef unsigned char CARD8; typedef CARD32 BITS32; typedef CARD16 BITS16; typedef CARD8 BYTE; typedef CARD8 BOOL; # 77 "/usr/include/X11/Xproto.h" 2 3 4 # 1 "/usr/include/X11/Xprotostr.h" 1 3 4 # 55 "/usr/include/X11/Xprotostr.h" 3 4 typedef struct _xSegment { INT16 x1 , y1 , x2 , y2 ; } xSegment; typedef struct _xPoint { INT16 x , y ; } xPoint; typedef struct _xRectangle { INT16 x , y ; CARD16 width , height ; } xRectangle; typedef struct _xArc { INT16 x , y ; CARD16 width , height ; INT16 angle1 , angle2 ; } xArc; # 78 "/usr/include/X11/Xproto.h" 2 3 4 # 263 "/usr/include/X11/Xproto.h" 3 4 typedef CARD16 KeyButMask; typedef struct { CARD8 byteOrder; BYTE pad; CARD16 majorVersion , minorVersion ; CARD16 nbytesAuthProto ; CARD16 nbytesAuthString ; CARD16 pad2 ; } xConnClientPrefix; typedef struct { CARD8 success; BYTE lengthReason; CARD16 majorVersion , minorVersion ; CARD16 length ; } xConnSetupPrefix; typedef struct { CARD32 release ; CARD32 ridBase , ridMask ; CARD32 motionBufferSize ; CARD16 nbytesVendor ; CARD16 maxRequestSize ; CARD8 numRoots; CARD8 numFormats; CARD8 imageByteOrder; CARD8 bitmapBitOrder; CARD8 bitmapScanlineUnit, bitmapScanlinePad; CARD8 minKeyCode, maxKeyCode; CARD32 pad2 ; } xConnSetup; typedef struct { CARD8 depth; CARD8 bitsPerPixel; CARD8 scanLinePad; CARD8 pad1; CARD32 pad2 ; } xPixmapFormat; typedef struct { CARD8 depth; CARD8 pad1; CARD16 nVisuals ; CARD32 pad2 ; } xDepth; typedef struct { CARD32 visualID ; CARD8 class; CARD8 bitsPerRGB; CARD16 colormapEntries ; CARD32 redMask , greenMask , blueMask ; CARD32 pad ; } xVisualType; typedef struct { CARD32 windowId ; CARD32 defaultColormap ; CARD32 whitePixel , blackPixel ; CARD32 currentInputMask ; CARD16 pixWidth , pixHeight ; CARD16 mmWidth , mmHeight ; CARD16 minInstalledMaps , maxInstalledMaps ; CARD32 rootVisualID ; CARD8 backingStore; BOOL saveUnders; CARD8 rootDepth; CARD8 nDepths; } xWindowRoot; # 358 "/usr/include/X11/Xproto.h" 3 4 typedef struct { CARD32 time ; INT16 x , y ; } xTimecoord; typedef struct { CARD8 family; BYTE pad; CARD16 length ; } xHostEntry; typedef struct { INT16 leftSideBearing , rightSideBearing , characterWidth , ascent , descent ; CARD16 attributes ; } xCharInfo; typedef struct { CARD32 name ; CARD32 value ; } xFontProp; typedef struct { CARD8 len; INT8 delta; } xTextElt; typedef struct { CARD32 pixel ; CARD16 red , green , blue ; CARD8 flags; CARD8 pad; } xColorItem; typedef struct { CARD16 red , green , blue , pad ; } xrgb; typedef CARD8 KEYCODE; # 416 "/usr/include/X11/Xproto.h" 3 4 typedef struct { BYTE type; BYTE data1; CARD16 sequenceNumber ; CARD32 length ; CARD32 data00 ; CARD32 data01 ; CARD32 data02 ; CARD32 data03 ; CARD32 data04 ; CARD32 data05 ; } xGenericReply; typedef struct { BYTE type; CARD8 backingStore; CARD16 sequenceNumber ; CARD32 length ; CARD32 visualID ; CARD16 class ; CARD8 bitGravity; CARD8 winGravity; CARD32 backingBitPlanes ; CARD32 backingPixel ; BOOL saveUnder; BOOL mapInstalled; CARD8 mapState; BOOL override; CARD32 colormap ; CARD32 allEventMasks ; CARD32 yourEventMask ; CARD16 doNotPropagateMask ; CARD16 pad ; } xGetWindowAttributesReply; typedef struct { BYTE type; CARD8 depth; CARD16 sequenceNumber ; CARD32 length ; CARD32 root ; INT16 x , y ; CARD16 width , height ; CARD16 borderWidth ; CARD16 pad1 ; CARD32 pad2 ; CARD32 pad3 ; } xGetGeometryReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD32 root , parent ; CARD16 nChildren ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; } xQueryTreeReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD32 atom ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; } xInternAtomReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nameLength ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xGetAtomNameReply; typedef struct { BYTE type; CARD8 format; CARD16 sequenceNumber ; CARD32 length ; CARD32 propertyType ; CARD32 bytesAfter ; CARD32 nItems ; CARD32 pad1 ; CARD32 pad2 ; CARD32 pad3 ; } xGetPropertyReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nProperties ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xListPropertiesReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD32 owner ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; } xGetSelectionOwnerReply; typedef struct { BYTE type; BYTE status; CARD16 sequenceNumber ; CARD32 length ; CARD32 pad1 ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; } xGrabPointerReply; typedef xGrabPointerReply xGrabKeyboardReply; typedef struct { BYTE type; BOOL sameScreen; CARD16 sequenceNumber ; CARD32 length ; CARD32 root , child ; INT16 rootX , rootY , winX , winY ; CARD16 mask ; CARD16 pad1 ; CARD32 pad ; } xQueryPointerReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD32 nEvents ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; } xGetMotionEventsReply; typedef struct { BYTE type; BOOL sameScreen; CARD16 sequenceNumber ; CARD32 length ; CARD32 child ; INT16 dstX , dstY ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; } xTranslateCoordsReply; typedef struct { BYTE type; CARD8 revertTo; CARD16 sequenceNumber ; CARD32 length ; CARD32 focus ; CARD32 pad1 ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; } xGetInputFocusReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; BYTE map[32]; } xQueryKeymapReply; typedef struct _xQueryFontReply { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; xCharInfo minBounds; CARD32 walign1 ; xCharInfo maxBounds; CARD32 walign2 ; CARD16 minCharOrByte2 , maxCharOrByte2 ; CARD16 defaultChar ; CARD16 nFontProps ; CARD8 drawDirection; CARD8 minByte1, maxByte1; BOOL allCharsExist; INT16 fontAscent , fontDescent ; CARD32 nCharInfos ; } xQueryFontReply; typedef struct { BYTE type; CARD8 drawDirection; CARD16 sequenceNumber ; CARD32 length ; INT16 fontAscent , fontDescent ; INT16 overallAscent , overallDescent ; INT32 overallWidth , overallLeft , overallRight ; CARD32 pad ; } xQueryTextExtentsReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nFonts ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xListFontsReply; typedef struct { BYTE type; CARD8 nameLength; CARD16 sequenceNumber ; CARD32 length ; xCharInfo minBounds; CARD32 walign1 ; xCharInfo maxBounds; CARD32 walign2 ; CARD16 minCharOrByte2 , maxCharOrByte2 ; CARD16 defaultChar ; CARD16 nFontProps ; CARD8 drawDirection; CARD8 minByte1, maxByte1; BOOL allCharsExist; INT16 fontAscent , fontDescent ; CARD32 nReplies ; } xListFontsWithInfoReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nPaths ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xGetFontPathReply; typedef struct { BYTE type; CARD8 depth; CARD16 sequenceNumber ; CARD32 length ; CARD32 visual ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xGetImageReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nColormaps ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xListInstalledColormapsReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 red , green , blue ; CARD16 pad2 ; CARD32 pixel ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; } xAllocColorReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD32 pixel ; CARD16 exactRed , exactGreen , exactBlue ; CARD16 screenRed , screenGreen , screenBlue ; CARD32 pad2 ; CARD32 pad3 ; } xAllocNamedColorReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nPixels , nMasks ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xAllocColorCellsReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nPixels ; CARD16 pad2 ; CARD32 redMask , greenMask , blueMask ; CARD32 pad3 ; CARD32 pad4 ; } xAllocColorPlanesReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 nColors ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xQueryColorsReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 exactRed , exactGreen , exactBlue ; CARD16 screenRed , screenGreen , screenBlue ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; } xLookupColorReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 width , height ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xQueryBestSizeReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; BOOL present; CARD8 major_opcode; CARD8 first_event; CARD8 first_error; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xQueryExtensionReply; typedef struct { BYTE type; CARD8 nExtensions; CARD16 sequenceNumber ; CARD32 length ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xListExtensionsReply; typedef struct { BYTE type; CARD8 success; CARD16 sequenceNumber ; CARD32 length ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xSetMappingReply; typedef xSetMappingReply xSetPointerMappingReply; typedef xSetMappingReply xSetModifierMappingReply; typedef struct { BYTE type; CARD8 nElts; CARD16 sequenceNumber ; CARD32 length ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xGetPointerMappingReply; typedef struct { BYTE type; CARD8 keySymsPerKeyCode; CARD16 sequenceNumber ; CARD32 length ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xGetKeyboardMappingReply; typedef struct { BYTE type; CARD8 numKeyPerModifier; CARD16 sequenceNumber ; CARD32 length ; CARD32 pad1 ; CARD32 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; } xGetModifierMappingReply; typedef struct { BYTE type; BOOL globalAutoRepeat; CARD16 sequenceNumber ; CARD32 length ; CARD32 ledMask ; CARD8 keyClickPercent, bellPercent; CARD16 bellPitch , bellDuration ; CARD16 pad ; BYTE map[32]; } xGetKeyboardControlReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 accelNumerator , accelDenominator ; CARD16 threshold ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; } xGetPointerControlReply; typedef struct { BYTE type; BYTE pad1; CARD16 sequenceNumber ; CARD32 length ; CARD16 timeout , interval ; BOOL preferBlanking; BOOL allowExposures; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; } xGetScreenSaverReply; typedef struct { BYTE type; BOOL enabled; CARD16 sequenceNumber ; CARD32 length ; CARD16 nHosts ; CARD16 pad1 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xListHostsReply; # 975 "/usr/include/X11/Xproto.h" 3 4 typedef struct { BYTE type; BYTE errorCode; CARD16 sequenceNumber ; CARD32 resourceID ; CARD16 minorCode ; CARD8 majorCode; BYTE pad1; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xError; typedef struct _xEvent { union { struct { BYTE type; BYTE detail; CARD16 sequenceNumber ; } u; struct { CARD32 pad00 ; CARD32 time ; CARD32 root , event , child ; INT16 rootX , rootY , eventX , eventY ; KeyButMask state ; BOOL sameScreen; BYTE pad1; } keyButtonPointer; struct { CARD32 pad00 ; CARD32 time ; CARD32 root , event , child ; INT16 rootX , rootY , eventX , eventY ; KeyButMask state ; BYTE mode; BYTE flags; } enterLeave; struct { CARD32 pad00 ; CARD32 window ; BYTE mode; BYTE pad1, pad2, pad3; } focus; struct { CARD32 pad00 ; CARD32 window ; CARD16 x , y , width , height ; CARD16 count ; CARD16 pad2 ; } expose; struct { CARD32 pad00 ; CARD32 drawable ; CARD16 x , y , width , height ; CARD16 minorEvent ; CARD16 count ; BYTE majorEvent; BYTE pad1, pad2, pad3; } graphicsExposure; struct { CARD32 pad00 ; CARD32 drawable ; CARD16 minorEvent ; BYTE majorEvent; BYTE bpad; } noExposure; struct { CARD32 pad00 ; CARD32 window ; CARD8 state; BYTE pad1, pad2, pad3; } visibility; struct { CARD32 pad00 ; CARD32 parent , window ; INT16 x , y ; CARD16 width , height , borderWidth ; BOOL override; BYTE bpad; } createNotify; # 1073 "/usr/include/X11/Xproto.h" 3 4 struct { CARD32 pad00 ; CARD32 event , window ; } destroyNotify; struct { CARD32 pad00 ; CARD32 event , window ; BOOL fromConfigure; BYTE pad1, pad2, pad3; } unmapNotify; struct { CARD32 pad00 ; CARD32 event , window ; BOOL override; BYTE pad1, pad2, pad3; } mapNotify; struct { CARD32 pad00 ; CARD32 parent , window ; } mapRequest; struct { CARD32 pad00 ; CARD32 event , window , parent ; INT16 x , y ; BOOL override; BYTE pad1, pad2, pad3; } reparent; struct { CARD32 pad00 ; CARD32 event , window , aboveSibling ; INT16 x , y ; CARD16 width , height , borderWidth ; BOOL override; BYTE bpad; } configureNotify; struct { CARD32 pad00 ; CARD32 parent , window , sibling ; INT16 x , y ; CARD16 width , height , borderWidth ; CARD16 valueMask ; CARD32 pad1 ; } configureRequest; struct { CARD32 pad00 ; CARD32 event , window ; INT16 x , y ; CARD32 pad1 , pad2 , pad3 , pad4 ; } gravity; struct { CARD32 pad00 ; CARD32 window ; CARD16 width , height ; } resizeRequest; struct { CARD32 pad00 ; CARD32 event , window , parent ; BYTE place; BYTE pad1, pad2, pad3; } circulate; struct { CARD32 pad00 ; CARD32 window ; CARD32 atom ; CARD32 time ; BYTE state; BYTE pad1; CARD16 pad2 ; } property; struct { CARD32 pad00 ; CARD32 time ; CARD32 window ; CARD32 atom ; } selectionClear; struct { CARD32 pad00 ; CARD32 time ; CARD32 owner , requestor ; CARD32 selection , target , property ; } selectionRequest; struct { CARD32 pad00 ; CARD32 time ; CARD32 requestor ; CARD32 selection , target , property ; } selectionNotify; struct { CARD32 pad00 ; CARD32 window ; CARD32 colormap ; BOOL new; BYTE state; BYTE pad1, pad2; } colormap; struct { CARD32 pad00 ; CARD8 request; CARD8 firstKeyCode; CARD8 count; BYTE pad1; } mappingNotify; struct { CARD32 pad00 ; CARD32 window ; union { struct { CARD32 type ; INT32 longs0 ; INT32 longs1 ; INT32 longs2 ; INT32 longs3 ; INT32 longs4 ; } l; struct { CARD32 type ; INT16 shorts0 ; INT16 shorts1 ; INT16 shorts2 ; INT16 shorts3 ; INT16 shorts4 ; INT16 shorts5 ; INT16 shorts6 ; INT16 shorts7 ; INT16 shorts8 ; INT16 shorts9 ; } s; struct { CARD32 type ; INT8 bytes[20]; } b; } u; } clientMessage; } u; } xEvent; # 1230 "/usr/include/X11/Xproto.h" 3 4 typedef struct { BYTE type; CARD8 extension; CARD16 sequenceNumber ; CARD32 length ; CARD16 evtype ; CARD16 pad2 ; CARD32 pad3 ; CARD32 pad4 ; CARD32 pad5 ; CARD32 pad6 ; CARD32 pad7 ; } xGenericEvent; typedef struct { BYTE type; BYTE map[31]; } xKeymapEvent; # 1263 "/usr/include/X11/Xproto.h" 3 4 typedef union { xGenericReply generic; xGetGeometryReply geom; xQueryTreeReply tree; xInternAtomReply atom; xGetAtomNameReply atomName; xGetPropertyReply property; xListPropertiesReply listProperties; xGetSelectionOwnerReply selection; xGrabPointerReply grabPointer; xGrabKeyboardReply grabKeyboard; xQueryPointerReply pointer; xGetMotionEventsReply motionEvents; xTranslateCoordsReply coords; xGetInputFocusReply inputFocus; xQueryTextExtentsReply textExtents; xListFontsReply fonts; xGetFontPathReply fontPath; xGetImageReply image; xListInstalledColormapsReply colormaps; xAllocColorReply allocColor; xAllocNamedColorReply allocNamedColor; xAllocColorCellsReply colorCells; xAllocColorPlanesReply colorPlanes; xQueryColorsReply colors; xLookupColorReply lookupColor; xQueryBestSizeReply bestSize; xQueryExtensionReply extension; xListExtensionsReply extensions; xSetModifierMappingReply setModifierMapping; xGetModifierMappingReply getModifierMapping; xSetPointerMappingReply setPointerMapping; xGetKeyboardMappingReply getKeyboardMapping; xGetPointerMappingReply getPointerMapping; xGetPointerControlReply pointerControl; xGetScreenSaverReply screenSaver; xListHostsReply hosts; xError error; xEvent event; } xReply; # 1313 "/usr/include/X11/Xproto.h" 3 4 typedef struct _xReq { CARD8 reqType; CARD8 data; CARD16 length ; } xReq; # 1327 "/usr/include/X11/Xproto.h" 3 4 typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 id ; } xResourceReq; typedef struct { CARD8 reqType; CARD8 depth; CARD16 length ; CARD32 wid , parent ; INT16 x , y ; CARD16 width , height , borderWidth ; CARD16 class ; CARD32 visual ; CARD32 mask ; } xCreateWindowReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 window ; CARD32 valueMask ; } xChangeWindowAttributesReq; typedef struct { CARD8 reqType; BYTE mode; CARD16 length ; CARD32 window ; } xChangeSaveSetReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 window , parent ; INT16 x , y ; } xReparentWindowReq; typedef struct { CARD8 reqType; CARD8 pad; CARD16 length ; CARD32 window ; CARD16 mask ; CARD16 pad2 ; } xConfigureWindowReq; typedef struct { CARD8 reqType; CARD8 direction; CARD16 length ; CARD32 window ; } xCirculateWindowReq; typedef struct { CARD8 reqType; BOOL onlyIfExists; CARD16 length ; CARD16 nbytes ; CARD16 pad ; } xInternAtomReq; typedef struct { CARD8 reqType; CARD8 mode; CARD16 length ; CARD32 window ; CARD32 property , type ; CARD8 format; BYTE pad[3]; CARD32 nUnits ; } xChangePropertyReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 window ; CARD32 property ; } xDeletePropertyReq; typedef struct { CARD8 reqType; BOOL delete; CARD16 length ; CARD32 window ; CARD32 property , type ; CARD32 longOffset ; CARD32 longLength ; } xGetPropertyReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 window ; CARD32 selection ; CARD32 time ; } xSetSelectionOwnerReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 requestor ; CARD32 selection , target , property ; CARD32 time ; } xConvertSelectionReq; typedef struct { CARD8 reqType; BOOL propagate; CARD16 length ; CARD32 destination ; CARD32 eventMask ; xEvent event; } xSendEventReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length ; CARD32 grabWindow ; CARD16 eventMask ; BYTE pointerMode, keyboardMode; CARD32 confineTo ; CARD32 cursor ; CARD32 time ; } xGrabPointerReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length ; CARD32 grabWindow ; CARD16 eventMask ; BYTE pointerMode, keyboardMode; CARD32 confineTo ; CARD32 cursor ; CARD8 button; BYTE pad; CARD16 modifiers ; } xGrabButtonReq; typedef struct { CARD8 reqType; CARD8 button; CARD16 length ; CARD32 grabWindow ; CARD16 modifiers ; CARD16 pad ; } xUngrabButtonReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cursor ; CARD32 time ; CARD16 eventMask ; CARD16 pad2 ; } xChangeActivePointerGrabReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length ; CARD32 grabWindow ; CARD32 time ; BYTE pointerMode, keyboardMode; CARD16 pad ; } xGrabKeyboardReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length ; CARD32 grabWindow ; CARD16 modifiers ; CARD8 key; BYTE pointerMode, keyboardMode; BYTE pad1, pad2, pad3; } xGrabKeyReq; typedef struct { CARD8 reqType; CARD8 key; CARD16 length ; CARD32 grabWindow ; CARD16 modifiers ; CARD16 pad ; } xUngrabKeyReq; typedef struct { CARD8 reqType; CARD8 mode; CARD16 length ; CARD32 time ; } xAllowEventsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 window ; CARD32 start , stop ; } xGetMotionEventsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 srcWid , dstWid ; INT16 srcX , srcY ; } xTranslateCoordsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 srcWid , dstWid ; INT16 srcX , srcY ; CARD16 srcWidth , srcHeight ; INT16 dstX , dstY ; } xWarpPointerReq; typedef struct { CARD8 reqType; CARD8 revertTo; CARD16 length ; CARD32 focus ; CARD32 time ; } xSetInputFocusReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 fid ; CARD16 nbytes ; BYTE pad1, pad2; } xOpenFontReq; typedef struct { CARD8 reqType; BOOL oddLength; CARD16 length ; CARD32 fid ; } xQueryTextExtentsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD16 maxNames ; CARD16 nbytes ; } xListFontsReq; typedef xListFontsReq xListFontsWithInfoReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD16 nFonts ; BYTE pad1, pad2; } xSetFontPathReq; typedef struct { CARD8 reqType; CARD8 depth; CARD16 length ; CARD32 pid ; CARD32 drawable ; CARD16 width , height ; } xCreatePixmapReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 gc ; CARD32 drawable ; CARD32 mask ; } xCreateGCReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 gc ; CARD32 mask ; } xChangeGCReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 srcGC , dstGC ; CARD32 mask ; } xCopyGCReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 gc ; CARD16 dashOffset ; CARD16 nDashes ; } xSetDashesReq; typedef struct { CARD8 reqType; BYTE ordering; CARD16 length ; CARD32 gc ; INT16 xOrigin , yOrigin ; } xSetClipRectanglesReq; typedef struct { CARD8 reqType; BOOL exposures; CARD16 length ; CARD32 window ; INT16 x , y ; CARD16 width , height ; } xClearAreaReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 srcDrawable , dstDrawable ; CARD32 gc ; INT16 srcX , srcY , dstX , dstY ; CARD16 width , height ; } xCopyAreaReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 srcDrawable , dstDrawable ; CARD32 gc ; INT16 srcX , srcY , dstX , dstY ; CARD16 width , height ; CARD32 bitPlane ; } xCopyPlaneReq; typedef struct { CARD8 reqType; BYTE coordMode; CARD16 length ; CARD32 drawable ; CARD32 gc ; } xPolyPointReq; typedef xPolyPointReq xPolyLineReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 drawable ; CARD32 gc ; } xPolySegmentReq; typedef xPolySegmentReq xPolyArcReq; typedef xPolySegmentReq xPolyRectangleReq; typedef xPolySegmentReq xPolyFillRectangleReq; typedef xPolySegmentReq xPolyFillArcReq; typedef struct _FillPolyReq { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 drawable ; CARD32 gc ; BYTE shape; BYTE coordMode; CARD16 pad1 ; } xFillPolyReq; typedef struct _PutImageReq { CARD8 reqType; CARD8 format; CARD16 length ; CARD32 drawable ; CARD32 gc ; CARD16 width , height ; INT16 dstX , dstY ; CARD8 leftPad; CARD8 depth; CARD16 pad ; } xPutImageReq; typedef struct { CARD8 reqType; CARD8 format; CARD16 length ; CARD32 drawable ; INT16 x , y ; CARD16 width , height ; CARD32 planeMask ; } xGetImageReq; typedef struct { CARD8 reqType; CARD8 pad; CARD16 length ; CARD32 drawable ; CARD32 gc ; INT16 x , y ; } xPolyTextReq; typedef xPolyTextReq xPolyText8Req; typedef xPolyTextReq xPolyText16Req; typedef struct { CARD8 reqType; BYTE nChars; CARD16 length ; CARD32 drawable ; CARD32 gc ; INT16 x , y ; } xImageTextReq; typedef xImageTextReq xImageText8Req; typedef xImageTextReq xImageText16Req; typedef struct { CARD8 reqType; BYTE alloc; CARD16 length ; CARD32 mid ; CARD32 window ; CARD32 visual ; } xCreateColormapReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 mid ; CARD32 srcCmap ; } xCopyColormapAndFreeReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cmap ; CARD16 red , green , blue ; CARD16 pad2 ; } xAllocColorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cmap ; CARD16 nbytes ; BYTE pad1, pad2; } xAllocNamedColorReq; typedef struct { CARD8 reqType; BOOL contiguous; CARD16 length ; CARD32 cmap ; CARD16 colors , planes ; } xAllocColorCellsReq; typedef struct { CARD8 reqType; BOOL contiguous; CARD16 length ; CARD32 cmap ; CARD16 colors , red , green , blue ; } xAllocColorPlanesReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cmap ; CARD32 planeMask ; } xFreeColorsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cmap ; } xStoreColorsReq; typedef struct { CARD8 reqType; CARD8 flags; CARD16 length ; CARD32 cmap ; CARD32 pixel ; CARD16 nbytes ; BYTE pad1, pad2; } xStoreNamedColorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cmap ; } xQueryColorsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cmap ; CARD16 nbytes ; BYTE pad1, pad2; } xLookupColorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cid ; CARD32 source , mask ; CARD16 foreRed , foreGreen , foreBlue ; CARD16 backRed , backGreen , backBlue ; CARD16 x , y ; } xCreateCursorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cid ; CARD32 source , mask ; CARD16 sourceChar , maskChar ; CARD16 foreRed , foreGreen , foreBlue ; CARD16 backRed , backGreen , backBlue ; } xCreateGlyphCursorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 cursor ; CARD16 foreRed , foreGreen , foreBlue ; CARD16 backRed , backGreen , backBlue ; } xRecolorCursorReq; typedef struct { CARD8 reqType; CARD8 class; CARD16 length ; CARD32 drawable ; CARD16 width , height ; } xQueryBestSizeReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD16 nbytes ; BYTE pad1, pad2; } xQueryExtensionReq; typedef struct { CARD8 reqType; CARD8 numKeyPerModifier; CARD16 length ; } xSetModifierMappingReq; typedef struct { CARD8 reqType; CARD8 nElts; CARD16 length ; } xSetPointerMappingReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD8 firstKeyCode; CARD8 count; CARD16 pad1 ; } xGetKeyboardMappingReq; typedef struct { CARD8 reqType; CARD8 keyCodes; CARD16 length ; CARD8 firstKeyCode; CARD8 keySymsPerKeyCode; CARD16 pad1 ; } xChangeKeyboardMappingReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 mask ; } xChangeKeyboardControlReq; typedef struct { CARD8 reqType; INT8 percent; CARD16 length ; } xBellReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; INT16 accelNum , accelDenum ; INT16 threshold ; BOOL doAccel, doThresh; } xChangePointerControlReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; INT16 timeout , interval ; BYTE preferBlank, allowExpose; CARD16 pad2 ; } xSetScreenSaverReq; typedef struct { CARD8 reqType; BYTE mode; CARD16 length ; CARD8 hostFamily; BYTE pad; CARD16 hostLength ; } xChangeHostsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; } xListHostsReq; typedef struct { CARD8 reqType; BYTE mode; CARD16 length ; } xChangeModeReq; typedef xChangeModeReq xSetAccessControlReq; typedef xChangeModeReq xSetCloseDownModeReq; typedef xChangeModeReq xForceScreenSaverReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length ; CARD32 window ; CARD16 nAtoms ; INT16 nPositions ; } xRotatePropertiesReq; # 56 "colormap.c" 2 # 1 "/usr/include/stdio.h" 1 3 4 # 28 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 322 "/usr/include/features.h" 3 4 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 324 "/usr/include/sys/cdefs.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 325 "/usr/include/sys/cdefs.h" 2 3 4 # 323 "/usr/include/features.h" 2 3 4 # 345 "/usr/include/features.h" 3 4 # 1 "/usr/include/gnu/stubs.h" 1 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 5 "/usr/include/gnu/stubs.h" 2 3 4 # 1 "/usr/include/gnu/stubs-32.h" 1 3 4 # 8 "/usr/include/gnu/stubs.h" 2 3 4 # 346 "/usr/include/features.h" 2 3 4 # 29 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 214 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 3 4 typedef unsigned int size_t; # 35 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/bits/types.h" 1 3 4 # 28 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/bits/types.h" 2 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 32 "/usr/include/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; # 134 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/typesizes.h" 1 3 4 # 135 "/usr/include/bits/types.h" 2 3 4 __extension__ typedef __u_quad_t __dev_t; __extension__ typedef unsigned int __uid_t; __extension__ typedef unsigned int __gid_t; __extension__ typedef unsigned long int __ino_t; __extension__ typedef __u_quad_t __ino64_t; __extension__ typedef unsigned int __mode_t; __extension__ typedef unsigned int __nlink_t; __extension__ typedef long int __off_t; __extension__ typedef __quad_t __off64_t; __extension__ typedef int __pid_t; __extension__ typedef struct { int __val[2]; } __fsid_t; __extension__ typedef long int __clock_t; __extension__ typedef unsigned long int __rlim_t; __extension__ typedef __u_quad_t __rlim64_t; __extension__ typedef unsigned int __id_t; __extension__ typedef long int __time_t; __extension__ typedef unsigned int __useconds_t; __extension__ typedef long int __suseconds_t; __extension__ typedef int __daddr_t; __extension__ typedef long int __swblk_t; __extension__ typedef int __key_t; __extension__ typedef int __clockid_t; __extension__ typedef void * __timer_t; __extension__ typedef long int __blksize_t; __extension__ typedef long int __blkcnt_t; __extension__ typedef __quad_t __blkcnt64_t; __extension__ typedef unsigned long int __fsblkcnt_t; __extension__ typedef __u_quad_t __fsblkcnt64_t; __extension__ typedef unsigned long int __fsfilcnt_t; __extension__ typedef __u_quad_t __fsfilcnt64_t; __extension__ typedef int __ssize_t; typedef __off64_t __loff_t; typedef __quad_t *__qaddr_t; typedef char *__caddr_t; __extension__ typedef int __intptr_t; __extension__ typedef unsigned int __socklen_t; # 37 "/usr/include/stdio.h" 2 3 4 # 45 "/usr/include/stdio.h" 3 4 struct _IO_FILE; typedef struct _IO_FILE FILE; # 65 "/usr/include/stdio.h" 3 4 typedef struct _IO_FILE __FILE; # 75 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/libio.h" 1 3 4 # 32 "/usr/include/libio.h" 3 4 # 1 "/usr/include/_G_config.h" 1 3 4 # 14 "/usr/include/_G_config.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 326 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 3 4 typedef long int wchar_t; # 355 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 3 4 typedef unsigned int wint_t; # 15 "/usr/include/_G_config.h" 2 3 4 # 24 "/usr/include/_G_config.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 48 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 49 "/usr/include/wchar.h" 2 3 4 # 1 "/usr/include/bits/wchar.h" 1 3 4 # 51 "/usr/include/wchar.h" 2 3 4 # 76 "/usr/include/wchar.h" 3 4 typedef struct { int __count; union { wint_t __wch; char __wchb[4]; } __value; } __mbstate_t; # 25 "/usr/include/_G_config.h" 2 3 4 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; # 44 "/usr/include/_G_config.h" 3 4 # 1 "/usr/include/gconv.h" 1 3 4 # 28 "/usr/include/gconv.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 48 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 49 "/usr/include/wchar.h" 2 3 4 # 29 "/usr/include/gconv.h" 2 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 32 "/usr/include/gconv.h" 2 3 4 enum { __GCONV_OK = 0, __GCONV_NOCONV, __GCONV_NODB, __GCONV_NOMEM, __GCONV_EMPTY_INPUT, __GCONV_FULL_OUTPUT, __GCONV_ILLEGAL_INPUT, __GCONV_INCOMPLETE_INPUT, __GCONV_ILLEGAL_DESCRIPTOR, __GCONV_INTERNAL_ERROR }; enum { __GCONV_IS_LAST = 0x0001, __GCONV_IGNORE_ERRORS = 0x0002 }; struct __gconv_step; struct __gconv_step_data; struct __gconv_loaded_object; struct __gconv_trans_data; typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *, int, int); typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); typedef int (*__gconv_init_fct) (struct __gconv_step *); typedef void (*__gconv_end_fct) (struct __gconv_step *); typedef int (*__gconv_trans_fct) (struct __gconv_step *, struct __gconv_step_data *, void *, __const unsigned char *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *); typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, __const unsigned char *, unsigned char *, unsigned char *); typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, size_t *); typedef int (*__gconv_trans_init_fct) (void **, const char *); typedef void (*__gconv_trans_end_fct) (void *); struct __gconv_trans_data { __gconv_trans_fct __trans_fct; __gconv_trans_context_fct __trans_context_fct; __gconv_trans_end_fct __trans_end_fct; void *__data; struct __gconv_trans_data *__next; }; struct __gconv_step { struct __gconv_loaded_object *__shlib_handle; __const char *__modname; int __counter; char *__from_name; char *__to_name; __gconv_fct __fct; __gconv_btowc_fct __btowc_fct; __gconv_init_fct __init_fct; __gconv_end_fct __end_fct; int __min_needed_from; int __max_needed_from; int __min_needed_to; int __max_needed_to; int __stateful; void *__data; }; struct __gconv_step_data { unsigned char *__outbuf; unsigned char *__outbufend; int __flags; int __invocation_counter; int __internal_use; __mbstate_t *__statep; __mbstate_t __state; struct __gconv_trans_data *__trans; }; typedef struct __gconv_info { size_t __nsteps; struct __gconv_step *__steps; __extension__ struct __gconv_step_data __data []; } *__gconv_t; # 45 "/usr/include/_G_config.h" 2 3 4 typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); # 33 "/usr/include/libio.h" 2 3 4 # 53 "/usr/include/libio.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stdarg.h" 1 3 4 # 43 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 54 "/usr/include/libio.h" 2 3 4 # 167 "/usr/include/libio.h" 3 4 struct _IO_jump_t; struct _IO_FILE; # 177 "/usr/include/libio.h" 3 4 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 200 "/usr/include/libio.h" 3 4 }; enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; # 268 "/usr/include/libio.h" 3 4 struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; # 316 "/usr/include/libio.h" 3 4 __off64_t _offset; # 325 "/usr/include/libio.h" 3 4 void *__pad1; void *__pad2; void *__pad3; void *__pad4; size_t __pad5; int _mode; char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; typedef struct _IO_FILE _IO_FILE; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 361 "/usr/include/libio.h" 3 4 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; typedef struct { __io_read_fn *read; __io_write_fn *write; __io_seek_fn *seek; __io_close_fn *close; } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns); extern int __underflow (_IO_FILE *); extern int __uflow (_IO_FILE *); extern int __overflow (_IO_FILE *, int); extern wint_t __wunderflow (_IO_FILE *); extern wint_t __wuflow (_IO_FILE *); extern wint_t __woverflow (_IO_FILE *, wint_t); # 451 "/usr/include/libio.h" 3 4 extern int _IO_getc (_IO_FILE *__fp); extern int _IO_putc (int __c, _IO_FILE *__fp); extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_peekc_locked (_IO_FILE *__fp); extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); # 481 "/usr/include/libio.h" 3 4 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, __gnuc_va_list, int *__restrict); extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, __gnuc_va_list); extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t); extern size_t _IO_sgetn (_IO_FILE *, void *, size_t); extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int); extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int); extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); # 76 "/usr/include/stdio.h" 2 3 4 typedef __gnuc_va_list va_list; # 89 "/usr/include/stdio.h" 3 4 typedef _G_fpos_t fpos_t; typedef _G_fpos64_t fpos64_t; # 141 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 142 "/usr/include/stdio.h" 2 3 4 extern struct _IO_FILE *stdin; extern struct _IO_FILE *stdout; extern struct _IO_FILE *stderr; extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); extern int renameat (int __oldfd, __const char *__old, int __newfd, __const char *__new) __attribute__ ((__nothrow__)); extern FILE *tmpfile (void) ; # 182 "/usr/include/stdio.h" 3 4 extern FILE *tmpfile64 (void) ; extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)) ; extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)) ; # 204 "/usr/include/stdio.h" 3 4 extern char *tempnam (__const char *__dir, __const char *__pfx) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 229 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 239 "/usr/include/stdio.h" 3 4 extern int fcloseall (void); extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) ; extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) ; # 272 "/usr/include/stdio.h" 3 4 extern FILE *fopen64 (__const char *__restrict __filename, __const char *__restrict __modes) ; extern FILE *freopen64 (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) ; extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)) ; extern FILE *fopencookie (void *__restrict __magic_cookie, __const char *__restrict __modes, _IO_cookie_io_functions_t __io_funcs) __attribute__ ((__nothrow__)) ; extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) __attribute__ ((__nothrow__)) ; extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__)) ; extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int printf (__const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))) ; extern int __asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ; extern int asprintf (char **__restrict __ptr, __const char *__restrict __fmt, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))) ; extern int vdprintf (int __fd, __const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, __const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) ; extern int scanf (__const char *__restrict __format, ...) ; extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfscanf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (__const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (__const char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__scanf__, 2, 0))); extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); # 464 "/usr/include/stdio.h" 3 4 extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 475 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 508 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ; extern char *gets (char *__s) ; # 554 "/usr/include/stdio.h" 3 4 extern char *fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) ; # 570 "/usr/include/stdio.h" 3 4 extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) ; extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); extern int puts (__const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s) ; # 631 "/usr/include/stdio.h" 3 4 extern int fputs_unlocked (__const char *__restrict __s, FILE *__restrict __stream); # 642 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream) ; extern void rewind (FILE *__stream); # 678 "/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off_t __off, int __whence); extern __off_t ftello (FILE *__stream) ; # 697 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); extern int fsetpos (FILE *__stream, __const fpos_t *__pos); # 720 "/usr/include/stdio.h" 3 4 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); extern __off64_t ftello64 (FILE *__stream) ; extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos); extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void perror (__const char *__s); # 1 "/usr/include/bits/sys_errlist.h" 1 3 4 # 27 "/usr/include/bits/sys_errlist.h" 3 4 extern int sys_nerr; extern __const char *__const sys_errlist[]; extern int _sys_nerr; extern __const char *__const _sys_errlist[]; # 759 "/usr/include/stdio.h" 2 3 4 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; # 778 "/usr/include/stdio.h" 3 4 extern FILE *popen (__const char *__command, __const char *__modes) ; extern int pclose (FILE *__stream); extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); extern char *cuserid (char *__s); struct obstack; extern int obstack_printf (struct obstack *__restrict __obstack, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 3))); extern int obstack_vprintf (struct obstack *__restrict __obstack, __const char *__restrict __format, __gnuc_va_list __args) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 2, 0))); extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); # 839 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio.h" 1 3 4 # 33 "/usr/include/bits/stdio.h" 3 4 extern __inline int vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } extern __inline int getchar (void) { return _IO_getc (stdin); } extern __inline int fgetc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline int getc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline int getchar_unlocked (void) { return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline int putchar (int __c) { return _IO_putc (__c, stdout); } extern __inline int fputc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putchar_unlocked (int __c) { return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } extern __inline __ssize_t getline (char **__lineptr, size_t *__n, FILE *__stream) { return __getdelim (__lineptr, __n, '\n', __stream); } extern __inline int __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x10) != 0); } extern __inline int __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x20) != 0); } # 840 "/usr/include/stdio.h" 2 3 4 # 848 "/usr/include/stdio.h" 3 4 # 57 "colormap.c" 2 # 1 "/usr/include/string.h" 1 3 4 # 28 "/usr/include/string.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 34 "/usr/include/string.h" 2 3 4 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, __const void *__src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memchr (__const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern void *rawmemchr (__const void *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern void *memrchr (__const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); # 1 "/usr/include/xlocale.h" 1 3 4 # 28 "/usr/include/xlocale.h" 3 4 typedef struct __locale_struct { struct locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; } *__locale_t; # 119 "/usr/include/string.h" 2 3 4 extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n, __locale_t __l) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); extern char *strdup (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strndup (__const char *__string, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 165 "/usr/include/string.h" 3 4 extern char *strchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strrchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strchrnul (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strcspn (__const char *__s, __const char *__reject) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strpbrk (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strstr (__const char *__haystack, __const char *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strcasestr (__const char *__haystack, __const char *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmem (__const void *__haystack, size_t __haystacklen, __const void *__needle, size_t __needlelen) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3))); extern void *__mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *mempcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strnlen (__const char *__string, size_t __maxlen) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); # 281 "/usr/include/string.h" 3 4 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *strerror_l (int __errnum, __locale_t __l) __attribute__ ((__nothrow__)); extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void bcopy (__const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *index (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *rindex (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int ffsl (long int __l) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcasecmp_l (__const char *__s1, __const char *__s2, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int strncasecmp_l (__const char *__s1, __const char *__s2, size_t __n, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int strverscmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strsignal (int __sig) __attribute__ ((__nothrow__)); extern char *__stpcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *__stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *stpncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strfry (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void *memfrob (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern char *basename (__const char *__filename) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); # 420 "/usr/include/string.h" 3 4 # 1 "/usr/include/bits/string.h" 1 3 4 # 421 "/usr/include/string.h" 2 3 4 # 1 "/usr/include/bits/string2.h" 1 3 4 # 80 "/usr/include/bits/string2.h" 3 4 typedef struct { unsigned char __arr[2]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR2; typedef struct { unsigned char __arr[3]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR3; typedef struct { unsigned char __arr[4]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR4; typedef struct { unsigned char __arr[5]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR5; typedef struct { unsigned char __arr[6]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR6; typedef struct { unsigned char __arr[7]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR7; typedef struct { unsigned char __arr[8]; } __attribute__ ((__packed__)) __STRING2_COPY_ARR8; # 394 "/usr/include/bits/string2.h" 3 4 extern void *__rawmemchr (const void *__s, int __c); # 969 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); extern __inline size_t __strcspn_c1 (__const char *__s, int __reject) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject) ++__result; return __result; } extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2); extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2) ++__result; return __result; } extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3); extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3) ++__result; return __result; } # 1045 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strspn_c1 (__const char *__s, int __accept); extern __inline size_t __strspn_c1 (__const char *__s, int __accept) { register size_t __result = 0; while (__s[__result] == __accept) ++__result; return __result; } extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2); extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2) ++__result; return __result; } extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3) ++__result; return __result; } # 1121 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, int __accept2); extern __inline char * __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline char * __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } # 1173 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); extern __inline char * __strtok_r_1c (char *__s, char __sep, char **__nextp) { char *__result; if (__s == ((void *)0)) __s = *__nextp; while (*__s == __sep) ++__s; __result = ((void *)0); if (*__s != '\0') { __result = __s++; while (*__s != '\0') if (*__s++ == __sep) { __s[-1] = '\0'; break; } *__nextp = __s; } return __result; } # 1205 "/usr/include/bits/string2.h" 3 4 extern char *__strsep_g (char **__stringp, __const char *__delim); # 1223 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strsep_1c (char **__s, char __reject); extern __inline char * __strsep_1c (char **__s, char __reject) { register char *__retval = *__s; if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) *(*__s)++ = '\0'; return __retval; } extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); extern __inline char * __strsep_2c (char **__s, char __reject1, char __reject2) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3); extern __inline char * __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } # 1299 "/usr/include/bits/string2.h" 3 4 # 1 "/usr/include/stdlib.h" 1 3 4 # 33 "/usr/include/stdlib.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 34 "/usr/include/stdlib.h" 2 3 4 # 587 "/usr/include/stdlib.h" 3 4 extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; # 976 "/usr/include/stdlib.h" 3 4 # 1300 "/usr/include/bits/string2.h" 2 3 4 extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 1323 "/usr/include/bits/string2.h" 3 4 extern char *__strndup (__const char *__string, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 424 "/usr/include/string.h" 2 3 4 # 432 "/usr/include/string.h" 3 4 # 58 "colormap.c" 2 # 1 "/usr/include/strings.h" 1 3 4 # 59 "colormap.c" 2 # 1 "../include/misc.h" 1 # 75 "../include/misc.h" extern unsigned long globalSerialNumber; extern unsigned long serverGeneration; # 1 "/usr/include/X11/Xosdefs.h" 1 3 4 # 79 "../include/misc.h" 2 # 1 "/usr/include/X11/Xfuncproto.h" 1 3 4 # 80 "../include/misc.h" 2 # 1 "/usr/include/X11/Xdefs.h" 1 3 4 # 49 "/usr/include/X11/Xdefs.h" 3 4 typedef int Bool; typedef void *pointer; typedef struct _Client *ClientPtr; # 83 "/usr/include/X11/Xdefs.h" 3 4 typedef struct _Font *FontPtr; # 93 "/usr/include/X11/Xdefs.h" 3 4 typedef unsigned long FSID; typedef FSID AccContext; typedef struct timeval **OSTimePtr; typedef void (* BlockHandlerProcPtr)(pointer , OSTimePtr , pointer ); # 83 "../include/misc.h" 2 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 152 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 3 4 typedef int ptrdiff_t; # 85 "../include/misc.h" 2 # 95 "../include/misc.h" typedef unsigned long PIXEL; typedef unsigned long ATOM; # 105 "../include/misc.h" typedef struct _CallbackList *CallbackListPtr; typedef struct _xReq *xReqPtr; # 1 "../include/os.h" 1 # 52 "../include/os.h" # 1 "../include/misc.h" 1 # 53 "../include/os.h" 2 # 1 "/usr/include/X11/Xalloca.h" 1 3 4 # 72 "/usr/include/X11/Xalloca.h" 3 4 # 1 "/usr/include/alloca.h" 1 3 4 # 25 "/usr/include/alloca.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 26 "/usr/include/alloca.h" 2 3 4 extern void *alloca (size_t __size) __attribute__ ((__nothrow__)); # 73 "/usr/include/X11/Xalloca.h" 2 3 4 # 56 "../include/os.h" 2 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stdarg.h" 1 3 4 # 57 "../include/os.h" 2 # 72 "../include/os.h" typedef pointer FID; typedef struct _FontPathRec *FontPathPtr; typedef struct _NewClientRec *NewClientPtr; # 99 "../include/os.h" extern Bool OsDelayInitColors; extern void (*OsVendorVErrorFProc)(const char *, va_list args); extern int WaitForSomething( int* ); extern int ReadRequestFromClient(ClientPtr ); extern Bool InsertFakeRequest( ClientPtr , char* , int ); extern void ResetCurrentRequest(ClientPtr ); extern void FlushAllOutput(void); extern void FlushIfCriticalOutputPending(void); extern void SetCriticalOutputPending(void); extern int WriteToClient(ClientPtr , int , char* ); extern void ResetOsBuffers(void); extern void InitConnectionLimits(void); extern void CreateWellKnownSockets(void); extern void ResetWellKnownSockets(void); extern void CloseWellKnownConnections(void); extern XID AuthorizationIDOfClient(ClientPtr ); extern char *ClientAuthorized( ClientPtr , unsigned int , char* , unsigned int , char* ); extern Bool EstablishNewConnections( ClientPtr , pointer ); extern void CheckConnections(void); extern void CloseDownConnection(ClientPtr ); extern void AddGeneralSocket(int ); extern void RemoveGeneralSocket(int ); extern void AddEnabledDevice(int ); extern void RemoveEnabledDevice(int ); extern void OnlyListenToOneClient(ClientPtr ); extern void ListenToAllClients(void); extern void IgnoreClient(ClientPtr ); extern void AttendClient(ClientPtr ); extern void MakeClientGrabImpervious(ClientPtr ); extern void MakeClientGrabPervious(ClientPtr ); extern void AvailableClientInput(ClientPtr ); extern CARD32 GetTimeInMillis(void); extern void AdjustWaitForDelay( pointer , unsigned long ); typedef struct _OsTimerRec *OsTimerPtr; typedef CARD32 (*OsTimerCallback)( OsTimerPtr , CARD32 , pointer ); extern void TimerInit(void); extern Bool TimerForce(OsTimerPtr ); extern OsTimerPtr TimerSet( OsTimerPtr , int , CARD32 , OsTimerCallback , pointer ); extern void TimerCheck(void); extern void TimerCancel(OsTimerPtr ); extern void TimerFree(OsTimerPtr ); extern void SetScreenSaverTimer(void); extern void FreeScreenSaverTimer(void); extern void AutoResetServer(int ); extern void GiveUp(int ); extern void UseMsg(void); extern void InitGlobals(void); extern void ProcessCommandLine(int , char* []); extern int set_font_authorizations( char ** , int * , pointer ); extern pointer Xalloc(unsigned long ); extern pointer Xcalloc(unsigned long ); extern pointer Xrealloc(pointer , unsigned long ); extern void Xfree(pointer ); extern pointer XNFalloc(unsigned long ); extern pointer XNFcalloc(unsigned long ); extern pointer XNFrealloc(pointer , unsigned long ); extern void OsInitAllocator(void); extern char *Xstrdup(const char *s); extern char *XNFstrdup(const char *s); extern char *Xprintf(const char *fmt, ...); extern char *Xvprintf(const char *fmt, va_list va); extern char *XNFprintf(const char *fmt, ...); extern char *XNFvprintf(const char *fmt, va_list va); typedef void (*OsSigHandlerPtr)(int ); extern OsSigHandlerPtr OsSignal(int , OsSigHandlerPtr ); extern int auditTrailLevel; extern void LockServer(void); extern void UnlockServer(void); extern int OsLookupColor( int , char * , unsigned , unsigned short * , unsigned short * , unsigned short * ); extern void OsInit(void); extern void OsCleanup(Bool); extern void OsVendorFatalError(void); extern void OsVendorInit(void); extern int OsInitColors(void); void OsBlockSignals (void); void OsReleaseSignals (void); extern int System(char *); extern pointer Popen(char *, char *); extern int Pclose(pointer); extern pointer Fopen(char *, char *); extern int Fclose(pointer); # 289 "../include/os.h" extern void CheckUserParameters(int argc, char **argv, char **envp); extern void CheckUserAuthorization(void); extern int AddHost( ClientPtr , int , unsigned , pointer ); extern Bool ForEachHostInFamily ( int , Bool (* )( unsigned char * , short , pointer ), pointer ); extern int RemoveHost( ClientPtr , int , unsigned , pointer ); extern int GetHosts( pointer * , int * , int * , BOOL * ); typedef struct sockaddr * sockaddrPtr; extern int InvalidHost(sockaddrPtr , int , ClientPtr client); extern int LocalClient(ClientPtr ); extern int LocalClientCred(ClientPtr, int *, int *); extern int ChangeAccessControl(ClientPtr , int ); extern int GetAccessControl(void); extern void AddLocalHosts(void); extern void ResetHosts(char *display); extern void EnableLocalHost(void); extern void DisableLocalHost(void); extern void AccessUsingXdmcp(void); extern void DefineSelf(int ); extern void AugmentSelf(pointer , int ); extern void InitAuthorization(char * ); extern void RegisterAuthorizations(void); extern int AuthorizationFromID ( XID id, unsigned short *name_lenp, char **namep, unsigned short *data_lenp, char **datap); extern XID CheckAuthorization( unsigned int , char * , unsigned int , char * , ClientPtr , char ** ); extern void ResetAuthorization(void); extern int RemoveAuthorization ( unsigned short name_length, char *name, unsigned short data_length, char *data); extern int AddAuthorization( unsigned int , char * , unsigned int , char * ); extern XID GenerateAuthorization( unsigned int , char * , unsigned int , char * , unsigned int * , char ** ); extern void ddxInitGlobals(void); extern int ddxProcessArgument(int , char * [], int ); extern void ddxUseMsg(void); # 423 "../include/os.h" extern CallbackListPtr SkippedRequestsCallback; typedef struct { xReqPtr req; ClientPtr client; int numskipped; } SkippedRequestInfoRec; extern CallbackListPtr ReplyCallback; typedef struct { ClientPtr client; pointer replyData; unsigned long dataLenBytes; unsigned long bytesRemaining; Bool startOfReply; } ReplyInfoRec; extern CallbackListPtr FlushCallback; extern void AbortDDX(void); extern void ddxGiveUp(void); extern int TimeSinceLastInputEvent(void); typedef enum _LogParameter { XLOG_FLUSH, XLOG_SYNC, XLOG_VERBOSITY, XLOG_FILE_VERBOSITY } LogParameter; typedef enum { X_PROBED, X_CONFIG, X_DEFAULT, X_CMDLINE, X_NOTICE, X_ERROR, X_WARNING, X_INFO, X_NONE, X_NOT_IMPLEMENTED, X_UNKNOWN = -1 } MessageType; # 478 "../include/os.h" extern const char *LogInit(const char *fname, const char *backup); extern void LogClose(void); extern Bool LogSetParameter(LogParameter param, int value); extern void LogVWrite(int verb, const char *f, va_list args); extern void LogWrite(int verb, const char *f, ...) __attribute((format(__printf__,2,3))); extern void LogVMessageVerb(MessageType type, int verb, const char *format, va_list args); extern void LogMessageVerb(MessageType type, int verb, const char *format, ...) __attribute((format(__printf__,3,4))); extern void LogMessage(MessageType type, const char *format, ...) __attribute((format(__printf__,2,3))); extern void FreeAuditTimer(void); extern void AuditF(const char *f, ...) __attribute((format(__printf__,1,2))); extern void VAuditF(const char *f, va_list args); extern void FatalError(const char *f, ...) __attribute((format(__printf__,1,2))) __attribute((noreturn)) ; extern void VErrorF(const char *f, va_list args); extern void ErrorF(const char *f, ...) __attribute((format(__printf__,1,2))); extern void Error(char *str); extern void LogPrintMarkers(void); # 112 "../include/misc.h" 2 # 1 "/usr/include/X11/Xfuncs.h" 1 3 4 # 113 "../include/misc.h" 2 # 143 "../include/misc.h" # 1 "/usr/include/stdlib.h" 1 3 4 # 33 "/usr/include/stdlib.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 34 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitflags.h" 1 3 4 # 43 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/bits/waitstatus.h" 1 3 4 # 65 "/usr/include/bits/waitstatus.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 37 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/endian.h" 1 3 4 # 38 "/usr/include/endian.h" 2 3 4 # 66 "/usr/include/bits/waitstatus.h" 2 3 4 union wait { int w_status; struct { unsigned int:16; unsigned int __w_retcode:8; unsigned int __w_coredump:1; unsigned int __w_termsig:7; } __wait_terminated; struct { unsigned int:16; unsigned int __w_stopsig:8; unsigned int __w_stopval:8; } __wait_stopped; }; # 44 "/usr/include/stdlib.h" 2 3 4 # 68 "/usr/include/stdlib.h" 3 4 typedef union { union wait *__uptr; int *__iptr; } __WAIT_STATUS __attribute__ ((__transparent_union__)); # 96 "/usr/include/stdlib.h" 3 4 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; __extension__ typedef struct { long long int quot; long long int rem; } lldiv_t; # 140 "/usr/include/stdlib.h" 3 4 extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__)) ; extern double atof (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern int atoi (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern long int atol (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int atoll (__const char *__nptr) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern double strtod (__const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern float strtof (__const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern long double strtold (__const char *__restrict __nptr, char **__restrict __endptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern long int strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern unsigned long int strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern unsigned long long int strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern unsigned long long int strtoull (__const char *__restrict __nptr, char **__restrict __endptr, int __base) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 240 "/usr/include/stdlib.h" 3 4 extern long int strtol_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; extern unsigned long int strtoul_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; __extension__ extern long long int strtoll_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; __extension__ extern unsigned long long int strtoull_l (__const char *__restrict __nptr, char **__restrict __endptr, int __base, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 4))) ; extern double strtod_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; extern float strtof_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; extern long double strtold_l (__const char *__restrict __nptr, char **__restrict __endptr, __locale_t __loc) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))) ; extern double __strtod_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern float __strtof_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern long double __strtold_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern long int __strtol_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern unsigned long int __strtoul_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int __strtoll_internal (__const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern unsigned long long int __strtoull_internal (__const char * __restrict __nptr, char **__restrict __endptr, int __base, int __group) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern __inline double __attribute__ ((__nothrow__)) strtod (__const char *__restrict __nptr, char **__restrict __endptr) { return __strtod_internal (__nptr, __endptr, 0); } extern __inline long int __attribute__ ((__nothrow__)) strtol (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtol_internal (__nptr, __endptr, __base, 0); } extern __inline unsigned long int __attribute__ ((__nothrow__)) strtoul (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoul_internal (__nptr, __endptr, __base, 0); } extern __inline float __attribute__ ((__nothrow__)) strtof (__const char *__restrict __nptr, char **__restrict __endptr) { return __strtof_internal (__nptr, __endptr, 0); } extern __inline long double __attribute__ ((__nothrow__)) strtold (__const char *__restrict __nptr, char **__restrict __endptr) { return __strtold_internal (__nptr, __endptr, 0); } __extension__ extern __inline long long int __attribute__ ((__nothrow__)) strtoq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoll_internal (__nptr, __endptr, __base, 0); } __extension__ extern __inline unsigned long long int __attribute__ ((__nothrow__)) strtouq (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoull_internal (__nptr, __endptr, __base, 0); } __extension__ extern __inline long long int __attribute__ ((__nothrow__)) strtoll (__const char *__restrict __nptr, char **__restrict __endptr, int __base) { return __strtoll_internal (__nptr, __endptr, __base, 0); } __extension__ extern __inline unsigned long long int __attribute__ ((__nothrow__)) strtoull (__const char * __restrict __nptr, char **__restrict __endptr, int __base) { return __strtoull_internal (__nptr, __endptr, __base, 0); } extern __inline double __attribute__ ((__nothrow__)) atof (__const char *__nptr) { return strtod (__nptr, (char **) ((void *)0)); } extern __inline int __attribute__ ((__nothrow__)) atoi (__const char *__nptr) { return (int) strtol (__nptr, (char **) ((void *)0), 10); } extern __inline long int __attribute__ ((__nothrow__)) atol (__const char *__nptr) { return strtol (__nptr, (char **) ((void *)0), 10); } __extension__ extern __inline long long int __attribute__ ((__nothrow__)) atoll (__const char *__nptr) { return strtoll (__nptr, (char **) ((void *)0), 10); } # 429 "/usr/include/stdlib.h" 3 4 extern char *l64a (long int __n) __attribute__ ((__nothrow__)) ; extern long int a64l (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; # 1 "/usr/include/sys/types.h" 1 3 4 # 29 "/usr/include/sys/types.h" 3 4 typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino_t ino_t; typedef __ino64_t ino64_t; typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; typedef __off_t off_t; typedef __off64_t off64_t; typedef __pid_t pid_t; typedef __id_t id_t; typedef __ssize_t ssize_t; typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 133 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 # 59 "/usr/include/time.h" 3 4 typedef __clock_t clock_t; # 75 "/usr/include/time.h" 3 4 typedef __time_t time_t; # 93 "/usr/include/time.h" 3 4 typedef __clockid_t clockid_t; # 105 "/usr/include/time.h" 3 4 typedef __timer_t timer_t; # 134 "/usr/include/sys/types.h" 2 3 4 typedef __useconds_t useconds_t; typedef __suseconds_t suseconds_t; # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include/stddef.h" 1 3 4 # 148 "/usr/include/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 195 "/usr/include/sys/types.h" 3 4 typedef int int8_t __attribute__ ((__mode__ (__QI__))); typedef int int16_t __attribute__ ((__mode__ (__HI__))); typedef int int32_t __attribute__ ((__mode__ (__SI__))); typedef int int64_t __attribute__ ((__mode__ (__DI__))); typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); typedef int register_t __attribute__ ((__mode__ (__word__))); # 220 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/sys/select.h" 1 3 4 # 31 "/usr/include/sys/select.h" 3 4 # 1 "/usr/include/bits/select.h" 1 3 4 # 32 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/sigset.h" 1 3 4 # 24 "/usr/include/bits/sigset.h" 3 4 typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 35 "/usr/include/sys/select.h" 2 3 4 typedef __sigset_t sigset_t; # 1 "/usr/include/time.h" 1 3 4 # 121 "/usr/include/time.h" 3 4 struct timespec { __time_t tv_sec; long int tv_nsec; }; # 45 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 69 "/usr/include/bits/time.h" 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 47 "/usr/include/sys/select.h" 2 3 4 # 55 "/usr/include/sys/select.h" 3 4 typedef long int __fd_mask; # 67 "/usr/include/sys/select.h" 3 4 typedef struct { __fd_mask fds_bits[1024 / (8 * sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 99 "/usr/include/sys/select.h" 3 4 # 109 "/usr/include/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); # 121 "/usr/include/sys/select.h" 3 4 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); # 221 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/sys/sysmacros.h" 1 3 4 # 30 "/usr/include/sys/sysmacros.h" 3 4 __extension__ extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) __attribute__ ((__nothrow__)); __extension__ extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev) __attribute__ ((__nothrow__)); __extension__ extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__)); __extension__ extern __inline unsigned int __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev) { return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); } __extension__ extern __inline unsigned int __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev) { return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); } __extension__ extern __inline unsigned long long int __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32)); } # 224 "/usr/include/sys/types.h" 2 3 4 typedef __blksize_t blksize_t; typedef __blkcnt_t blkcnt_t; typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; # 262 "/usr/include/sys/types.h" 3 4 typedef __blkcnt64_t blkcnt64_t; typedef __fsblkcnt64_t fsblkcnt64_t; typedef __fsfilcnt64_t fsfilcnt64_t; # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 # 24 "/usr/include/bits/pthreadtypes.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 25 "/usr/include/bits/pthreadtypes.h" 2 3 4 # 51 "/usr/include/bits/pthreadtypes.h" 3 4 typedef unsigned long int pthread_t; typedef union { char __size[36]; long int __align; } pthread_attr_t; # 68 "/usr/include/bits/pthreadtypes.h" 3 4 typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; int __kind; unsigned int __nusers; __extension__ union { int __spins; __pthread_slist_t __list; }; } __data; char __size[24]; long int __align; } pthread_mutex_t; typedef union { char __size[4]; int __align; } pthread_mutexattr_t; typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[48]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[4]; int __align; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef int pthread_once_t; typedef union { # 171 "/usr/include/bits/pthreadtypes.h" 3 4 struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; unsigned int __flags; int __writer; } __data; char __size[32]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef union { char __size[20]; long int __align; } pthread_barrier_t; typedef union { char __size[4]; int __align; } pthread_barrierattr_t; # 271 "/usr/include/sys/types.h" 2 3 4 # 439 "/usr/include/stdlib.h" 2 3 4 extern long int random (void) __attribute__ ((__nothrow__)); extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__)); extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int srandom_r (unsigned int __seed, struct random_data *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 4))); extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int rand (void) __attribute__ ((__nothrow__)); extern void srand (unsigned int __seed) __attribute__ ((__nothrow__)); extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__)); extern double drand48 (void) __attribute__ ((__nothrow__)); extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern long int lrand48 (void) __attribute__ ((__nothrow__)); extern long int nrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern long int mrand48 (void) __attribute__ ((__nothrow__)); extern long int jrand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void srand48 (long int __seedval) __attribute__ ((__nothrow__)); extern unsigned short int *seed48 (unsigned short int __seed16v[3]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int srand48_r (long int __seedval, struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); # 597 "/usr/include/stdlib.h" 3 4 extern void *realloc (void *__ptr, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__warn_unused_result__)); extern void free (void *__ptr) __attribute__ ((__nothrow__)); extern void cfree (void *__ptr) __attribute__ ((__nothrow__)); # 617 "/usr/include/stdlib.h" 3 4 extern void *valloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern void abort (void) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); extern void _Exit (int __status) __attribute__ ((__nothrow__)) __attribute__ ((__noreturn__)); extern char *getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern char *__secure_getenv (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int putenv (char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int setenv (__const char *__name, __const char *__value, int __replace) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int unsetenv (__const char *__name) __attribute__ ((__nothrow__)); extern int clearenv (void) __attribute__ ((__nothrow__)); # 698 "/usr/include/stdlib.h" 3 4 extern char *mktemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 709 "/usr/include/stdlib.h" 3 4 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; # 719 "/usr/include/stdlib.h" 3 4 extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ; # 729 "/usr/include/stdlib.h" 3 4 extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; extern int system (__const char *__command) ; extern char *canonicalize_file_name (__const char *__name) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 755 "/usr/include/stdlib.h" 3 4 extern char *realpath (__const char *__restrict __name, char *__restrict __resolved) __attribute__ ((__nothrow__)) ; typedef int (*__compar_fn_t) (__const void *, __const void *); typedef __compar_fn_t comparison_fn_t; extern void *bsearch (__const void *__key, __const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 2, 5))) ; extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); extern int abs (int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; extern long int labs (long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; __extension__ extern long long int llabs (long long int __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; extern div_t div (int __numer, int __denom) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; extern ldiv_t ldiv (long int __numer, long int __denom) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; __extension__ extern lldiv_t lldiv (long long int __numer, long long int __denom) __attribute__ ((__nothrow__)) __attribute__ ((__const__)) ; # 820 "/usr/include/stdlib.h" 3 4 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *gcvt (double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4))) ; extern char *qgcvt (long double __value, int __ndigit, char *__buf) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3))) ; extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (3, 4, 5))); extern int mblen (__const char *__s, size_t __n) __attribute__ ((__nothrow__)) ; extern int mbtowc (wchar_t *__restrict __pwc, __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)) ; extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__)) ; extern size_t mbstowcs (wchar_t *__restrict __pwcs, __const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__)); extern size_t wcstombs (char *__restrict __s, __const wchar_t *__restrict __pwcs, size_t __n) __attribute__ ((__nothrow__)); extern int rpmatch (__const char *__response) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ; # 908 "/usr/include/stdlib.h" 3 4 extern int getsubopt (char **__restrict __optionp, char *__const *__restrict __tokens, char **__restrict __valuep) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2, 3))) ; extern void setkey (__const char *__key) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int posix_openpt (int __oflag) ; extern int grantpt (int __fd) __attribute__ ((__nothrow__)); extern int unlockpt (int __fd) __attribute__ ((__nothrow__)); extern char *ptsname (int __fd) __attribute__ ((__nothrow__)) ; extern int ptsname_r (int __fd, char *__buf, size_t __buflen) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern int getpt (void); extern int getloadavg (double __loadavg[], int __nelem) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); # 976 "/usr/include/stdlib.h" 3 4 # 144 "../include/misc.h" 2 # 160 "../include/misc.h" # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/limits.h" 1 3 4 # 11 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/limits.h" 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/syslimits.h" 1 3 4 # 1 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/limits.h" 1 3 4 # 122 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/limits.h" 3 4 # 1 "/usr/include/limits.h" 1 3 4 # 145 "/usr/include/limits.h" 3 4 # 1 "/usr/include/bits/posix1_lim.h" 1 3 4 # 153 "/usr/include/bits/posix1_lim.h" 3 4 # 1 "/usr/include/bits/local_lim.h" 1 3 4 # 36 "/usr/include/bits/local_lim.h" 3 4 # 1 "/usr/include/linux/limits.h" 1 3 4 # 37 "/usr/include/bits/local_lim.h" 2 3 4 # 154 "/usr/include/bits/posix1_lim.h" 2 3 4 # 146 "/usr/include/limits.h" 2 3 4 # 1 "/usr/include/bits/posix2_lim.h" 1 3 4 # 150 "/usr/include/limits.h" 2 3 4 # 1 "/usr/include/bits/xopen_lim.h" 1 3 4 # 34 "/usr/include/bits/xopen_lim.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 35 "/usr/include/bits/xopen_lim.h" 2 3 4 # 154 "/usr/include/limits.h" 2 3 4 # 123 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/limits.h" 2 3 4 # 8 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/syslimits.h" 2 3 4 # 12 "/usr/lib/gcc/powerpc-unknown-linux-gnu/4.3.1/include-fixed/limits.h" 2 3 4 # 161 "../include/misc.h" 2 # 1 "/usr/include/math.h" 1 3 4 # 30 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/huge_val.h" 1 3 4 # 35 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/huge_valf.h" 1 3 4 # 37 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/huge_vall.h" 1 3 4 # 38 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/inf.h" 1 3 4 # 41 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/nan.h" 1 3 4 # 44 "/usr/include/math.h" 2 3 4 # 1 "/usr/include/bits/mathdef.h" 1 3 4 # 38 "/usr/include/bits/mathdef.h" 3 4 typedef float float_t; typedef double double_t; # 48 "/usr/include/math.h" 2 3 4 # 71 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern double acos (double __x) __attribute__ ((__nothrow__)); extern double __acos (double __x) __attribute__ ((__nothrow__)); extern double asin (double __x) __attribute__ ((__nothrow__)); extern double __asin (double __x) __attribute__ ((__nothrow__)); extern double atan (double __x) __attribute__ ((__nothrow__)); extern double __atan (double __x) __attribute__ ((__nothrow__)); extern double atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double __atan2 (double __y, double __x) __attribute__ ((__nothrow__)); extern double cos (double __x) __attribute__ ((__nothrow__)); extern double __cos (double __x) __attribute__ ((__nothrow__)); extern double sin (double __x) __attribute__ ((__nothrow__)); extern double __sin (double __x) __attribute__ ((__nothrow__)); extern double tan (double __x) __attribute__ ((__nothrow__)); extern double __tan (double __x) __attribute__ ((__nothrow__)); extern double cosh (double __x) __attribute__ ((__nothrow__)); extern double __cosh (double __x) __attribute__ ((__nothrow__)); extern double sinh (double __x) __attribute__ ((__nothrow__)); extern double __sinh (double __x) __attribute__ ((__nothrow__)); extern double tanh (double __x) __attribute__ ((__nothrow__)); extern double __tanh (double __x) __attribute__ ((__nothrow__)); extern void sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__)); extern void __sincos (double __x, double *__sinx, double *__cosx) __attribute__ ((__nothrow__)); extern double acosh (double __x) __attribute__ ((__nothrow__)); extern double __acosh (double __x) __attribute__ ((__nothrow__)); extern double asinh (double __x) __attribute__ ((__nothrow__)); extern double __asinh (double __x) __attribute__ ((__nothrow__)); extern double atanh (double __x) __attribute__ ((__nothrow__)); extern double __atanh (double __x) __attribute__ ((__nothrow__)); extern double exp (double __x) __attribute__ ((__nothrow__)); extern double __exp (double __x) __attribute__ ((__nothrow__)); extern double frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double __frexp (double __x, int *__exponent) __attribute__ ((__nothrow__)); extern double ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double __ldexp (double __x, int __exponent) __attribute__ ((__nothrow__)); extern double log (double __x) __attribute__ ((__nothrow__)); extern double __log (double __x) __attribute__ ((__nothrow__)); extern double log10 (double __x) __attribute__ ((__nothrow__)); extern double __log10 (double __x) __attribute__ ((__nothrow__)); extern double modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); extern double __modf (double __x, double *__iptr) __attribute__ ((__nothrow__)); extern double exp10 (double __x) __attribute__ ((__nothrow__)); extern double __exp10 (double __x) __attribute__ ((__nothrow__)); extern double pow10 (double __x) __attribute__ ((__nothrow__)); extern double __pow10 (double __x) __attribute__ ((__nothrow__)); extern double expm1 (double __x) __attribute__ ((__nothrow__)); extern double __expm1 (double __x) __attribute__ ((__nothrow__)); extern double log1p (double __x) __attribute__ ((__nothrow__)); extern double __log1p (double __x) __attribute__ ((__nothrow__)); extern double logb (double __x) __attribute__ ((__nothrow__)); extern double __logb (double __x) __attribute__ ((__nothrow__)); extern double exp2 (double __x) __attribute__ ((__nothrow__)); extern double __exp2 (double __x) __attribute__ ((__nothrow__)); extern double log2 (double __x) __attribute__ ((__nothrow__)); extern double __log2 (double __x) __attribute__ ((__nothrow__)); extern double pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double __pow (double __x, double __y) __attribute__ ((__nothrow__)); extern double sqrt (double __x) __attribute__ ((__nothrow__)); extern double __sqrt (double __x) __attribute__ ((__nothrow__)); extern double hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double __hypot (double __x, double __y) __attribute__ ((__nothrow__)); extern double cbrt (double __x) __attribute__ ((__nothrow__)); extern double __cbrt (double __x) __attribute__ ((__nothrow__)); extern double ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __ceil (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __fabs (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __floor (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmod (double __x, double __y) __attribute__ ((__nothrow__)); extern int __isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinf (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double __drem (double __x, double __y) __attribute__ ((__nothrow__)); extern double significand (double __x) __attribute__ ((__nothrow__)); extern double __significand (double __x) __attribute__ ((__nothrow__)); extern double copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __copysign (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nan (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnan (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double j0 (double) __attribute__ ((__nothrow__)); extern double __j0 (double) __attribute__ ((__nothrow__)); extern double j1 (double) __attribute__ ((__nothrow__)); extern double __j1 (double) __attribute__ ((__nothrow__)); extern double jn (int, double) __attribute__ ((__nothrow__)); extern double __jn (int, double) __attribute__ ((__nothrow__)); extern double y0 (double) __attribute__ ((__nothrow__)); extern double __y0 (double) __attribute__ ((__nothrow__)); extern double y1 (double) __attribute__ ((__nothrow__)); extern double __y1 (double) __attribute__ ((__nothrow__)); extern double yn (int, double) __attribute__ ((__nothrow__)); extern double __yn (int, double) __attribute__ ((__nothrow__)); extern double erf (double) __attribute__ ((__nothrow__)); extern double __erf (double) __attribute__ ((__nothrow__)); extern double erfc (double) __attribute__ ((__nothrow__)); extern double __erfc (double) __attribute__ ((__nothrow__)); extern double lgamma (double) __attribute__ ((__nothrow__)); extern double __lgamma (double) __attribute__ ((__nothrow__)); extern double tgamma (double) __attribute__ ((__nothrow__)); extern double __tgamma (double) __attribute__ ((__nothrow__)); extern double gamma (double) __attribute__ ((__nothrow__)); extern double __gamma (double) __attribute__ ((__nothrow__)); extern double lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double __lgamma_r (double, int *__signgamp) __attribute__ ((__nothrow__)); extern double rint (double __x) __attribute__ ((__nothrow__)); extern double __rint (double __x) __attribute__ ((__nothrow__)); extern double nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nextafter (double __x, double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double nexttoward (double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __nexttoward (double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double __remainder (double __x, double __y) __attribute__ ((__nothrow__)); extern double scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern double __scalbn (double __x, int __n) __attribute__ ((__nothrow__)); extern int ilogb (double __x) __attribute__ ((__nothrow__)); extern int __ilogb (double __x) __attribute__ ((__nothrow__)); extern double scalbln (double __x, long int __n) __attribute__ ((__nothrow__)); extern double __scalbln (double __x, long int __n) __attribute__ ((__nothrow__)); extern double nearbyint (double __x) __attribute__ ((__nothrow__)); extern double __nearbyint (double __x) __attribute__ ((__nothrow__)); extern double round (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __round (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double trunc (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double __trunc (double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__)); extern double __remquo (double __x, double __y, int *__quo) __attribute__ ((__nothrow__)); extern long int lrint (double __x) __attribute__ ((__nothrow__)); extern long int __lrint (double __x) __attribute__ ((__nothrow__)); extern long long int llrint (double __x) __attribute__ ((__nothrow__)); extern long long int __llrint (double __x) __attribute__ ((__nothrow__)); extern long int lround (double __x) __attribute__ ((__nothrow__)); extern long int __lround (double __x) __attribute__ ((__nothrow__)); extern long long int llround (double __x) __attribute__ ((__nothrow__)); extern long long int __llround (double __x) __attribute__ ((__nothrow__)); extern double fdim (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fdim (double __x, double __y) __attribute__ ((__nothrow__)); extern double fmax (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmax (double __x, double __y) __attribute__ ((__nothrow__)); extern double fmin (double __x, double __y) __attribute__ ((__nothrow__)); extern double __fmin (double __x, double __y) __attribute__ ((__nothrow__)); extern int __fpclassify (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __signbit (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern double fma (double __x, double __y, double __z) __attribute__ ((__nothrow__)); extern double __fma (double __x, double __y, double __z) __attribute__ ((__nothrow__)); extern double scalb (double __x, double __n) __attribute__ ((__nothrow__)); extern double __scalb (double __x, double __n) __attribute__ ((__nothrow__)); # 72 "/usr/include/math.h" 2 3 4 # 94 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern float acosf (float __x) __attribute__ ((__nothrow__)); extern float __acosf (float __x) __attribute__ ((__nothrow__)); extern float asinf (float __x) __attribute__ ((__nothrow__)); extern float __asinf (float __x) __attribute__ ((__nothrow__)); extern float atanf (float __x) __attribute__ ((__nothrow__)); extern float __atanf (float __x) __attribute__ ((__nothrow__)); extern float atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float __atan2f (float __y, float __x) __attribute__ ((__nothrow__)); extern float cosf (float __x) __attribute__ ((__nothrow__)); extern float __cosf (float __x) __attribute__ ((__nothrow__)); extern float sinf (float __x) __attribute__ ((__nothrow__)); extern float __sinf (float __x) __attribute__ ((__nothrow__)); extern float tanf (float __x) __attribute__ ((__nothrow__)); extern float __tanf (float __x) __attribute__ ((__nothrow__)); extern float coshf (float __x) __attribute__ ((__nothrow__)); extern float __coshf (float __x) __attribute__ ((__nothrow__)); extern float sinhf (float __x) __attribute__ ((__nothrow__)); extern float __sinhf (float __x) __attribute__ ((__nothrow__)); extern float tanhf (float __x) __attribute__ ((__nothrow__)); extern float __tanhf (float __x) __attribute__ ((__nothrow__)); extern void sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__)); extern void __sincosf (float __x, float *__sinx, float *__cosx) __attribute__ ((__nothrow__)); extern float acoshf (float __x) __attribute__ ((__nothrow__)); extern float __acoshf (float __x) __attribute__ ((__nothrow__)); extern float asinhf (float __x) __attribute__ ((__nothrow__)); extern float __asinhf (float __x) __attribute__ ((__nothrow__)); extern float atanhf (float __x) __attribute__ ((__nothrow__)); extern float __atanhf (float __x) __attribute__ ((__nothrow__)); extern float expf (float __x) __attribute__ ((__nothrow__)); extern float __expf (float __x) __attribute__ ((__nothrow__)); extern float frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float __frexpf (float __x, int *__exponent) __attribute__ ((__nothrow__)); extern float ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float __ldexpf (float __x, int __exponent) __attribute__ ((__nothrow__)); extern float logf (float __x) __attribute__ ((__nothrow__)); extern float __logf (float __x) __attribute__ ((__nothrow__)); extern float log10f (float __x) __attribute__ ((__nothrow__)); extern float __log10f (float __x) __attribute__ ((__nothrow__)); extern float modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); extern float __modff (float __x, float *__iptr) __attribute__ ((__nothrow__)); extern float exp10f (float __x) __attribute__ ((__nothrow__)); extern float __exp10f (float __x) __attribute__ ((__nothrow__)); extern float pow10f (float __x) __attribute__ ((__nothrow__)); extern float __pow10f (float __x) __attribute__ ((__nothrow__)); extern float expm1f (float __x) __attribute__ ((__nothrow__)); extern float __expm1f (float __x) __attribute__ ((__nothrow__)); extern float log1pf (float __x) __attribute__ ((__nothrow__)); extern float __log1pf (float __x) __attribute__ ((__nothrow__)); extern float logbf (float __x) __attribute__ ((__nothrow__)); extern float __logbf (float __x) __attribute__ ((__nothrow__)); extern float exp2f (float __x) __attribute__ ((__nothrow__)); extern float __exp2f (float __x) __attribute__ ((__nothrow__)); extern float log2f (float __x) __attribute__ ((__nothrow__)); extern float __log2f (float __x) __attribute__ ((__nothrow__)); extern float powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __powf (float __x, float __y) __attribute__ ((__nothrow__)); extern float sqrtf (float __x) __attribute__ ((__nothrow__)); extern float __sqrtf (float __x) __attribute__ ((__nothrow__)); extern float hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __hypotf (float __x, float __y) __attribute__ ((__nothrow__)); extern float cbrtf (float __x) __attribute__ ((__nothrow__)); extern float __cbrtf (float __x) __attribute__ ((__nothrow__)); extern float ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __ceilf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __fabsf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __floorf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmodf (float __x, float __y) __attribute__ ((__nothrow__)); extern int __isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinff (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __dremf (float __x, float __y) __attribute__ ((__nothrow__)); extern float significandf (float __x) __attribute__ ((__nothrow__)); extern float __significandf (float __x) __attribute__ ((__nothrow__)); extern float copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __copysignf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float nanf (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nanf (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnanf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float j0f (float) __attribute__ ((__nothrow__)); extern float __j0f (float) __attribute__ ((__nothrow__)); extern float j1f (float) __attribute__ ((__nothrow__)); extern float __j1f (float) __attribute__ ((__nothrow__)); extern float jnf (int, float) __attribute__ ((__nothrow__)); extern float __jnf (int, float) __attribute__ ((__nothrow__)); extern float y0f (float) __attribute__ ((__nothrow__)); extern float __y0f (float) __attribute__ ((__nothrow__)); extern float y1f (float) __attribute__ ((__nothrow__)); extern float __y1f (float) __attribute__ ((__nothrow__)); extern float ynf (int, float) __attribute__ ((__nothrow__)); extern float __ynf (int, float) __attribute__ ((__nothrow__)); extern float erff (float) __attribute__ ((__nothrow__)); extern float __erff (float) __attribute__ ((__nothrow__)); extern float erfcf (float) __attribute__ ((__nothrow__)); extern float __erfcf (float) __attribute__ ((__nothrow__)); extern float lgammaf (float) __attribute__ ((__nothrow__)); extern float __lgammaf (float) __attribute__ ((__nothrow__)); extern float tgammaf (float) __attribute__ ((__nothrow__)); extern float __tgammaf (float) __attribute__ ((__nothrow__)); extern float gammaf (float) __attribute__ ((__nothrow__)); extern float __gammaf (float) __attribute__ ((__nothrow__)); extern float lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float __lgammaf_r (float, int *__signgamp) __attribute__ ((__nothrow__)); extern float rintf (float __x) __attribute__ ((__nothrow__)); extern float __rintf (float __x) __attribute__ ((__nothrow__)); extern float nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nextafterf (float __x, float __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __nexttowardf (float __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __remainderf (float __x, float __y) __attribute__ ((__nothrow__)); extern float scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern float __scalbnf (float __x, int __n) __attribute__ ((__nothrow__)); extern int ilogbf (float __x) __attribute__ ((__nothrow__)); extern int __ilogbf (float __x) __attribute__ ((__nothrow__)); extern float scalblnf (float __x, long int __n) __attribute__ ((__nothrow__)); extern float __scalblnf (float __x, long int __n) __attribute__ ((__nothrow__)); extern float nearbyintf (float __x) __attribute__ ((__nothrow__)); extern float __nearbyintf (float __x) __attribute__ ((__nothrow__)); extern float roundf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __roundf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float truncf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float __truncf (float __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__)); extern float __remquof (float __x, float __y, int *__quo) __attribute__ ((__nothrow__)); extern long int lrintf (float __x) __attribute__ ((__nothrow__)); extern long int __lrintf (float __x) __attribute__ ((__nothrow__)); extern long long int llrintf (float __x) __attribute__ ((__nothrow__)); extern long long int __llrintf (float __x) __attribute__ ((__nothrow__)); extern long int lroundf (float __x) __attribute__ ((__nothrow__)); extern long int __lroundf (float __x) __attribute__ ((__nothrow__)); extern long long int llroundf (float __x) __attribute__ ((__nothrow__)); extern long long int __llroundf (float __x) __attribute__ ((__nothrow__)); extern float fdimf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fdimf (float __x, float __y) __attribute__ ((__nothrow__)); extern float fmaxf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fmaxf (float __x, float __y) __attribute__ ((__nothrow__)); extern float fminf (float __x, float __y) __attribute__ ((__nothrow__)); extern float __fminf (float __x, float __y) __attribute__ ((__nothrow__)); extern int __fpclassifyf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __signbitf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern float fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__)); extern float __fmaf (float __x, float __y, float __z) __attribute__ ((__nothrow__)); extern float scalbf (float __x, float __n) __attribute__ ((__nothrow__)); extern float __scalbf (float __x, float __n) __attribute__ ((__nothrow__)); # 95 "/usr/include/math.h" 2 3 4 # 141 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathcalls.h" 1 3 4 # 53 "/usr/include/bits/mathcalls.h" 3 4 extern long double acosl (long double __x) __attribute__ ((__nothrow__)); extern long double __acosl (long double __x) __attribute__ ((__nothrow__)); extern long double asinl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinl (long double __x) __attribute__ ((__nothrow__)); extern long double atanl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanl (long double __x) __attribute__ ((__nothrow__)); extern long double atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); extern long double __atan2l (long double __y, long double __x) __attribute__ ((__nothrow__)); extern long double cosl (long double __x) __attribute__ ((__nothrow__)); extern long double __cosl (long double __x) __attribute__ ((__nothrow__)); extern long double sinl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinl (long double __x) __attribute__ ((__nothrow__)); extern long double tanl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanl (long double __x) __attribute__ ((__nothrow__)); extern long double coshl (long double __x) __attribute__ ((__nothrow__)); extern long double __coshl (long double __x) __attribute__ ((__nothrow__)); extern long double sinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __sinhl (long double __x) __attribute__ ((__nothrow__)); extern long double tanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __tanhl (long double __x) __attribute__ ((__nothrow__)); extern void sincosl (long double __x, long double *__sinx, long double *__cosx) __attribute__ ((__nothrow__)); extern void __sincosl (long double __x, long double *__sinx, long double *__cosx) __attribute__ ((__nothrow__)); extern long double acoshl (long double __x) __attribute__ ((__nothrow__)); extern long double __acoshl (long double __x) __attribute__ ((__nothrow__)); extern long double asinhl (long double __x) __attribute__ ((__nothrow__)); extern long double __asinhl (long double __x) __attribute__ ((__nothrow__)); extern long double atanhl (long double __x) __attribute__ ((__nothrow__)); extern long double __atanhl (long double __x) __attribute__ ((__nothrow__)); extern long double expl (long double __x) __attribute__ ((__nothrow__)); extern long double __expl (long double __x) __attribute__ ((__nothrow__)); extern long double frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); extern long double __frexpl (long double __x, int *__exponent) __attribute__ ((__nothrow__)); extern long double ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); extern long double __ldexpl (long double __x, int __exponent) __attribute__ ((__nothrow__)); extern long double logl (long double __x) __attribute__ ((__nothrow__)); extern long double __logl (long double __x) __attribute__ ((__nothrow__)); extern long double log10l (long double __x) __attribute__ ((__nothrow__)); extern long double __log10l (long double __x) __attribute__ ((__nothrow__)); extern long double modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); extern long double __modfl (long double __x, long double *__iptr) __attribute__ ((__nothrow__)); extern long double exp10l (long double __x) __attribute__ ((__nothrow__)); extern long double __exp10l (long double __x) __attribute__ ((__nothrow__)); extern long double pow10l (long double __x) __attribute__ ((__nothrow__)); extern long double __pow10l (long double __x) __attribute__ ((__nothrow__)); extern long double expm1l (long double __x) __attribute__ ((__nothrow__)); extern long double __expm1l (long double __x) __attribute__ ((__nothrow__)); extern long double log1pl (long double __x) __attribute__ ((__nothrow__)); extern long double __log1pl (long double __x) __attribute__ ((__nothrow__)); extern long double logbl (long double __x) __attribute__ ((__nothrow__)); extern long double __logbl (long double __x) __attribute__ ((__nothrow__)); extern long double exp2l (long double __x) __attribute__ ((__nothrow__)); extern long double __exp2l (long double __x) __attribute__ ((__nothrow__)); extern long double log2l (long double __x) __attribute__ ((__nothrow__)); extern long double __log2l (long double __x) __attribute__ ((__nothrow__)); extern long double powl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __powl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double sqrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __sqrtl (long double __x) __attribute__ ((__nothrow__)); extern long double hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __hypotl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double cbrtl (long double __x) __attribute__ ((__nothrow__)); extern long double __cbrtl (long double __x) __attribute__ ((__nothrow__)); extern long double ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __ceill (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __fabsl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __floorl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fmodl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern int __isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isinfl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int finitel (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __dreml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double significandl (long double __x) __attribute__ ((__nothrow__)); extern long double __significandl (long double __x) __attribute__ ((__nothrow__)); extern long double copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __copysignl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double nanl (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nanl (__const char *__tagb) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int isnanl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double j0l (long double) __attribute__ ((__nothrow__)); extern long double __j0l (long double) __attribute__ ((__nothrow__)); extern long double j1l (long double) __attribute__ ((__nothrow__)); extern long double __j1l (long double) __attribute__ ((__nothrow__)); extern long double jnl (int, long double) __attribute__ ((__nothrow__)); extern long double __jnl (int, long double) __attribute__ ((__nothrow__)); extern long double y0l (long double) __attribute__ ((__nothrow__)); extern long double __y0l (long double) __attribute__ ((__nothrow__)); extern long double y1l (long double) __attribute__ ((__nothrow__)); extern long double __y1l (long double) __attribute__ ((__nothrow__)); extern long double ynl (int, long double) __attribute__ ((__nothrow__)); extern long double __ynl (int, long double) __attribute__ ((__nothrow__)); extern long double erfl (long double) __attribute__ ((__nothrow__)); extern long double __erfl (long double) __attribute__ ((__nothrow__)); extern long double erfcl (long double) __attribute__ ((__nothrow__)); extern long double __erfcl (long double) __attribute__ ((__nothrow__)); extern long double lgammal (long double) __attribute__ ((__nothrow__)); extern long double __lgammal (long double) __attribute__ ((__nothrow__)); extern long double tgammal (long double) __attribute__ ((__nothrow__)); extern long double __tgammal (long double) __attribute__ ((__nothrow__)); extern long double gammal (long double) __attribute__ ((__nothrow__)); extern long double __gammal (long double) __attribute__ ((__nothrow__)); extern long double lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); extern long double __lgammal_r (long double, int *__signgamp) __attribute__ ((__nothrow__)); extern long double rintl (long double __x) __attribute__ ((__nothrow__)); extern long double __rintl (long double __x) __attribute__ ((__nothrow__)); extern long double nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nextafterl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __nexttowardl (long double __x, long double __y) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __remainderl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); extern long double __scalbnl (long double __x, int __n) __attribute__ ((__nothrow__)); extern int ilogbl (long double __x) __attribute__ ((__nothrow__)); extern int __ilogbl (long double __x) __attribute__ ((__nothrow__)); extern long double scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__)); extern long double __scalblnl (long double __x, long int __n) __attribute__ ((__nothrow__)); extern long double nearbyintl (long double __x) __attribute__ ((__nothrow__)); extern long double __nearbyintl (long double __x) __attribute__ ((__nothrow__)); extern long double roundl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __roundl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double truncl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double __truncl (long double __x) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__)); extern long double __remquol (long double __x, long double __y, int *__quo) __attribute__ ((__nothrow__)); extern long int lrintl (long double __x) __attribute__ ((__nothrow__)); extern long int __lrintl (long double __x) __attribute__ ((__nothrow__)); extern long long int llrintl (long double __x) __attribute__ ((__nothrow__)); extern long long int __llrintl (long double __x) __attribute__ ((__nothrow__)); extern long int lroundl (long double __x) __attribute__ ((__nothrow__)); extern long int __lroundl (long double __x) __attribute__ ((__nothrow__)); extern long long int llroundl (long double __x) __attribute__ ((__nothrow__)); extern long long int __llroundl (long double __x) __attribute__ ((__nothrow__)); extern long double fdiml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fdiml (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fmaxl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double fminl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern long double __fminl (long double __x, long double __y) __attribute__ ((__nothrow__)); extern int __fpclassifyl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern int __signbitl (long double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); extern long double fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__)); extern long double __fmal (long double __x, long double __y, long double __z) __attribute__ ((__nothrow__)); extern long double scalbl (long double __x, long double __n) __attribute__ ((__nothrow__)); extern long double __scalbl (long double __x, long double __n) __attribute__ ((__nothrow__)); # 142 "/usr/include/math.h" 2 3 4 # 157 "/usr/include/math.h" 3 4 extern int signgam; # 198 "/usr/include/math.h" 3 4 enum { FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL }; # 284 "/usr/include/math.h" 3 4 typedef enum { _IEEE_ = -1, _SVID_, _XOPEN_, _POSIX_, _ISOC_ } _LIB_VERSION_TYPE; extern _LIB_VERSION_TYPE _LIB_VERSION; # 309 "/usr/include/math.h" 3 4 struct exception { int type; char *name; double arg1; double arg2; double retval; }; extern int matherr (struct exception *__exc); # 409 "/usr/include/math.h" 3 4 # 1 "/usr/include/bits/mathinline.h" 1 3 4 # 63 "/usr/include/bits/mathinline.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) __signbitf (float __x) { __extension__ union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0; } extern __inline int __attribute__ ((__nothrow__)) __signbit (double __x) { __extension__ union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[0] < 0; } # 83 "/usr/include/bits/mathinline.h" 3 4 extern __inline long int lrint (double __x) __attribute__ ((__nothrow__)); extern __inline long int __attribute__ ((__nothrow__)) lrint (double __x) { union { double __d; int __ll[2]; } __u; __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x)); return __u.__ll[1]; } extern __inline long int lrintf (float __x) __attribute__ ((__nothrow__)); extern __inline long int __attribute__ ((__nothrow__)) lrintf (float __x) { union { double __d; int __ll[2]; } __u; __asm__ ("fctiw %0,%1" : "=f"(__u.__d) : "f"(__x)); return __u.__ll[1]; } extern __inline double fdim (double __x, double __y) __attribute__ ((__nothrow__)); extern __inline double __attribute__ ((__nothrow__)) fdim (double __x, double __y) { return __x <= __y ? 0 : __x - __y; } extern __inline float fdimf (float __x, float __y) __attribute__ ((__nothrow__)); extern __inline float __attribute__ ((__nothrow__)) fdimf (float __x, float __y) { return __x <= __y ? 0 : __x - __y; } # 410 "/usr/include/math.h" 2 3 4 # 465 "/usr/include/math.h" 3 4 # 169 "../include/misc.h" 2 # 178 "../include/misc.h" # 1 "/usr/include/assert.h" 1 3 4 # 179 "../include/misc.h" 2 # 1 "/usr/include/ctype.h" 1 3 4 # 30 "/usr/include/ctype.h" 3 4 # 48 "/usr/include/ctype.h" 3 4 enum { _ISupper = (1 << (0)), _ISlower = (1 << (1)), _ISalpha = (1 << (2)), _ISdigit = (1 << (3)), _ISxdigit = (1 << (4)), _ISspace = (1 << (5)), _ISprint = (1 << (6)), _ISgraph = (1 << (7)), _ISblank = (1 << (8)), _IScntrl = (1 << (9)), _ISpunct = (1 << (10)), _ISalnum = (1 << (11)) }; # 81 "/usr/include/ctype.h" 3 4 extern __const unsigned short int **__ctype_b_loc (void) __attribute__ ((__const)); extern __const __int32_t **__ctype_tolower_loc (void) __attribute__ ((__const)); extern __const __int32_t **__ctype_toupper_loc (void) __attribute__ ((__const)); # 96 "/usr/include/ctype.h" 3 4 extern int isalnum (int) __attribute__ ((__nothrow__)); extern int isalpha (int) __attribute__ ((__nothrow__)); extern int iscntrl (int) __attribute__ ((__nothrow__)); extern int isdigit (int) __attribute__ ((__nothrow__)); extern int islower (int) __attribute__ ((__nothrow__)); extern int isgraph (int) __attribute__ ((__nothrow__)); extern int isprint (int) __attribute__ ((__nothrow__)); extern int ispunct (int) __attribute__ ((__nothrow__)); extern int isspace (int) __attribute__ ((__nothrow__)); extern int isupper (int) __attribute__ ((__nothrow__)); extern int isxdigit (int) __attribute__ ((__nothrow__)); extern int tolower (int __c) __attribute__ ((__nothrow__)); extern int toupper (int __c) __attribute__ ((__nothrow__)); extern int isblank (int) __attribute__ ((__nothrow__)); extern int isctype (int __c, int __mask) __attribute__ ((__nothrow__)); extern int isascii (int __c) __attribute__ ((__nothrow__)); extern int toascii (int __c) __attribute__ ((__nothrow__)); extern int _toupper (int) __attribute__ ((__nothrow__)); extern int _tolower (int) __attribute__ ((__nothrow__)); # 190 "/usr/include/ctype.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) tolower (int __c) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; } extern __inline int __attribute__ ((__nothrow__)) toupper (int __c) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; } # 247 "/usr/include/ctype.h" 3 4 extern int isalnum_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isalpha_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int iscntrl_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int islower_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isgraph_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isprint_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int ispunct_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isspace_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isupper_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isxdigit_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int isblank_l (int, __locale_t) __attribute__ ((__nothrow__)); extern int __tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); extern int tolower_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); extern int __toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); extern int toupper_l (int __c, __locale_t __l) __attribute__ ((__nothrow__)); # 323 "/usr/include/ctype.h" 3 4 # 180 "../include/misc.h" 2 # 228 "../include/misc.h" extern void SwapLongs( CARD32 *list, unsigned long count); extern void SwapShorts( short *list, unsigned long count); extern void MakePredeclaredAtoms(void); extern int Ones( unsigned long ); typedef struct _xPoint *DDXPointPtr; typedef struct pixman_box16 *BoxPtr; typedef struct _xEvent *xEventPtr; typedef struct _xRectangle *xRectanglePtr; typedef struct _GrabRec *GrabPtr; typedef struct _CharInfo *CharInfoPtr; # 60 "colormap.c" 2 # 1 "../include/dix.h" 1 # 51 "../include/dix.h" # 1 "../include/gc.h" 1 # 54 "../include/gc.h" # 1 "../include/screenint.h" 1 # 53 "../include/screenint.h" typedef struct _PixmapFormat *PixmapFormatPtr; typedef struct _Visual *VisualPtr; typedef struct _Depth *DepthPtr; typedef struct _Screen *ScreenPtr; extern void ResetScreenPrivates(void); extern int AllocateScreenPrivateIndex(void); extern void ResetWindowPrivates(void); extern int AllocateWindowPrivateIndex(void); extern Bool AllocateWindowPrivate( ScreenPtr , int , unsigned ); extern void ResetGCPrivates(void); extern int AllocateGCPrivateIndex(void); extern Bool AllocateGCPrivate( ScreenPtr , int , unsigned ); extern int AddScreen( Bool (* )( int , ScreenPtr , int , char ** ), int , char** ); extern void ResetPixmapPrivates(void); extern int AllocatePixmapPrivateIndex(void); extern Bool AllocatePixmapPrivate( ScreenPtr , int , unsigned ); extern void ResetColormapPrivates(void); typedef struct _ColormapRec *ColormapPtr; typedef int (*InitCmapPrivFunc)(ColormapPtr, int); extern int AllocateColormapPrivateIndex( InitCmapPrivFunc ); # 55 "../include/gc.h" 2 # 1 "../include/pixmap.h" 1 # 76 "../include/pixmap.h" typedef struct _Drawable *DrawablePtr; typedef struct _Pixmap *PixmapPtr; typedef union _PixUnion { PixmapPtr pixmap; unsigned long pixel; } PixUnion; # 96 "../include/pixmap.h" extern PixmapPtr GetScratchPixmapHeader( ScreenPtr , int , int , int , int , int , pointer ); extern void FreeScratchPixmapHeader( PixmapPtr ); extern Bool CreateScratchPixmapsForScreen( int ); extern void FreeScratchPixmapsForScreen( int ); extern PixmapPtr AllocatePixmap( ScreenPtr , int ); # 56 "../include/gc.h" 2 # 83 "../include/gc.h" typedef struct _GCInterest *GCInterestPtr; typedef struct _GC *GCPtr; typedef struct _GCOps *GCOpsPtr; extern void ValidateGC( DrawablePtr , GCPtr ); extern int ChangeGC( GCPtr , BITS32 , XID* ); extern int DoChangeGC( GCPtr , BITS32 , XID* , int ); typedef union { CARD32 val; pointer ptr; } ChangeGCVal, *ChangeGCValPtr; extern int dixChangeGC( ClientPtr , GCPtr , BITS32 , CARD32 * , ChangeGCValPtr ); extern GCPtr CreateGC( DrawablePtr , BITS32 , XID* , int* ); extern int CopyGC( GCPtr , GCPtr , BITS32 ); extern int FreeGC( pointer , XID ); extern GCPtr CreateScratchGC( ScreenPtr , unsigned ); extern void FreeGCperDepth( int ); extern Bool CreateGCperDepth( int ); extern Bool CreateDefaultStipple( int ); extern void FreeDefaultStipple( int ); extern int SetDashes( GCPtr , unsigned , unsigned , unsigned char* ); extern int VerifyRectOrder( int , xRectangle* , int ); extern int SetClipRects( GCPtr , int , int , int , xRectangle* , int ); extern GCPtr GetScratchGC( unsigned , ScreenPtr ); extern void FreeScratchGC( GCPtr ); # 52 "../include/dix.h" 2 # 1 "../include/window.h" 1 # 52 "../include/window.h" # 1 "../include/region.h" 1 # 51 "../include/region.h" # 1 "../include/regionstr.h" 1 # 51 "../include/regionstr.h" typedef struct pixman_region16 RegionRec, *RegionPtr; # 1 "../include/miscstruct.h" 1 # 54 "../include/miscstruct.h" # 1 "/usr/include/pixman-1/pixman.h" 1 # 72 "/usr/include/pixman-1/pixman.h" # 1 "/usr/include/pixman-1/pixman-version.h" 1 # 73 "/usr/include/pixman-1/pixman.h" 2 # 92 "/usr/include/pixman-1/pixman.h" # 1 "/usr/include/stdint.h" 1 3 4 # 28 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/stdint.h" 2 3 4 # 49 "/usr/include/stdint.h" 3 4 typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; __extension__ typedef unsigned long long int uint64_t; typedef signed char int_least8_t; typedef short int int_least16_t; typedef int int_least32_t; __extension__ typedef long long int int_least64_t; typedef unsigned char uint_least8_t; typedef unsigned short int uint_least16_t; typedef unsigned int uint_least32_t; __extension__ typedef unsigned long long int uint_least64_t; typedef signed char int_fast8_t; typedef int int_fast16_t; typedef int int_fast32_t; __extension__ typedef long long int int_fast64_t; typedef unsigned char uint_fast8_t; typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; __extension__ typedef unsigned long long int uint_fast64_t; # 126 "/usr/include/stdint.h" 3 4 typedef int intptr_t; typedef unsigned int uintptr_t; # 138 "/usr/include/stdint.h" 3 4 __extension__ typedef long long int intmax_t; __extension__ typedef unsigned long long int uintmax_t; # 93 "/usr/include/pixman-1/pixman.h" 2 typedef int pixman_bool_t; typedef int64_t pixman_fixed_32_32_t; typedef pixman_fixed_32_32_t pixman_fixed_48_16_t; typedef uint32_t pixman_fixed_1_31_t; typedef uint32_t pixman_fixed_1_16_t; typedef int32_t pixman_fixed_16_16_t; typedef pixman_fixed_16_16_t pixman_fixed_t; # 128 "/usr/include/pixman-1/pixman.h" typedef struct pixman_color pixman_color_t; typedef struct pixman_point_fixed pixman_point_fixed_t; typedef struct pixman_line_fixed pixman_line_fixed_t; typedef struct pixman_vector pixman_vector_t; typedef struct pixman_transform pixman_transform_t; struct pixman_color { uint16_t red; uint16_t green; uint16_t blue; uint16_t alpha; }; struct pixman_point_fixed { pixman_fixed_t x; pixman_fixed_t y; }; struct pixman_line_fixed { pixman_point_fixed_t p1, p2; }; struct pixman_vector { pixman_fixed_t vector[3]; }; struct pixman_transform { pixman_fixed_t matrix[3][3]; }; typedef enum { PIXMAN_REPEAT_NONE, PIXMAN_REPEAT_NORMAL, PIXMAN_REPEAT_PAD, PIXMAN_REPEAT_REFLECT } pixman_repeat_t; typedef enum { PIXMAN_FILTER_FAST, PIXMAN_FILTER_GOOD, PIXMAN_FILTER_BEST, PIXMAN_FILTER_NEAREST, PIXMAN_FILTER_BILINEAR, PIXMAN_FILTER_CONVOLUTION } pixman_filter_t; typedef enum { PIXMAN_OP_CLEAR = 0x00, PIXMAN_OP_SRC = 0x01, PIXMAN_OP_DST = 0x02, PIXMAN_OP_OVER = 0x03, PIXMAN_OP_OVER_REVERSE = 0x04, PIXMAN_OP_IN = 0x05, PIXMAN_OP_IN_REVERSE = 0x06, PIXMAN_OP_OUT = 0x07, PIXMAN_OP_OUT_REVERSE = 0x08, PIXMAN_OP_ATOP = 0x09, PIXMAN_OP_ATOP_REVERSE = 0x0a, PIXMAN_OP_XOR = 0x0b, PIXMAN_OP_ADD = 0x0c, PIXMAN_OP_SATURATE = 0x0d, PIXMAN_OP_DISJOINT_CLEAR = 0x10, PIXMAN_OP_DISJOINT_SRC = 0x11, PIXMAN_OP_DISJOINT_DST = 0x12, PIXMAN_OP_DISJOINT_OVER = 0x13, PIXMAN_OP_DISJOINT_OVER_REVERSE = 0x14, PIXMAN_OP_DISJOINT_IN = 0x15, PIXMAN_OP_DISJOINT_IN_REVERSE = 0x16, PIXMAN_OP_DISJOINT_OUT = 0x17, PIXMAN_OP_DISJOINT_OUT_REVERSE = 0x18, PIXMAN_OP_DISJOINT_ATOP = 0x19, PIXMAN_OP_DISJOINT_ATOP_REVERSE = 0x1a, PIXMAN_OP_DISJOINT_XOR = 0x1b, PIXMAN_OP_CONJOINT_CLEAR = 0x20, PIXMAN_OP_CONJOINT_SRC = 0x21, PIXMAN_OP_CONJOINT_DST = 0x22, PIXMAN_OP_CONJOINT_OVER = 0x23, PIXMAN_OP_CONJOINT_OVER_REVERSE = 0x24, PIXMAN_OP_CONJOINT_IN = 0x25, PIXMAN_OP_CONJOINT_IN_REVERSE = 0x26, PIXMAN_OP_CONJOINT_OUT = 0x27, PIXMAN_OP_CONJOINT_OUT_REVERSE = 0x28, PIXMAN_OP_CONJOINT_ATOP = 0x29, PIXMAN_OP_CONJOINT_ATOP_REVERSE = 0x2a, PIXMAN_OP_CONJOINT_XOR = 0x2b, PIXMAN_OP_NONE } pixman_op_t; typedef struct pixman_region16_data pixman_region16_data_t; typedef struct pixman_box16 pixman_box16_t; typedef struct pixman_rectangle16 pixman_rectangle16_t; typedef struct pixman_region16 pixman_region16_t; struct pixman_region16_data { long size; long numRects; }; struct pixman_rectangle16 { int16_t x, y; uint16_t width, height; }; struct pixman_box16 { int16_t x1, y1, x2, y2; }; struct pixman_region16 { pixman_box16_t extents; pixman_region16_data_t *data; }; typedef enum { PIXMAN_REGION_OUT, PIXMAN_REGION_IN, PIXMAN_REGION_PART } pixman_region_overlap_t; void pixman_region_set_static_pointers (pixman_box16_t *empty_box, pixman_region16_data_t *empty_data, pixman_region16_data_t *broken_data); void pixman_region_init (pixman_region16_t *region); void pixman_region_init_rect (pixman_region16_t *region, int x, int y, unsigned int width, unsigned int height); pixman_bool_t pixman_region_init_rects (pixman_region16_t *region, pixman_box16_t *boxes, int count); void pixman_region_init_with_extents (pixman_region16_t *region, pixman_box16_t *extents); void pixman_region_fini (pixman_region16_t *region); void pixman_region_translate (pixman_region16_t *region, int x, int y); pixman_bool_t pixman_region_copy (pixman_region16_t *dest, pixman_region16_t *source); pixman_bool_t pixman_region_intersect (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2); pixman_bool_t pixman_region_union (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_region16_t *reg2); pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest, pixman_region16_t *source, int x, int y, unsigned int width, unsigned int height); pixman_bool_t pixman_region_subtract (pixman_region16_t *regD, pixman_region16_t *regM, pixman_region16_t *regS); pixman_bool_t pixman_region_inverse (pixman_region16_t *newReg, pixman_region16_t *reg1, pixman_box16_t *invRect); pixman_bool_t pixman_region_contains_point (pixman_region16_t *region, int x, int y, pixman_box16_t *box); pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t, pixman_box16_t *prect); pixman_bool_t pixman_region_not_empty (pixman_region16_t *region); pixman_box16_t * pixman_region_extents (pixman_region16_t *region); int pixman_region_n_rects (pixman_region16_t *region); pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region, int *n_rects); pixman_bool_t pixman_region_equal (pixman_region16_t *region1, pixman_region16_t *region2); pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region); void pixman_region_reset (pixman_region16_t *region, pixman_box16_t *box); typedef struct pixman_region32_data pixman_region32_data_t; typedef struct pixman_box32 pixman_box32_t; typedef struct pixman_rectangle32 pixman_rectangle32_t; typedef struct pixman_region32 pixman_region32_t; struct pixman_region32_data { long size; long numRects; }; struct pixman_rectangle32 { int32_t x, y; uint32_t width, height; }; struct pixman_box32 { int32_t x1, y1, x2, y2; }; struct pixman_region32 { pixman_box32_t extents; pixman_region32_data_t *data; }; void pixman_region32_init (pixman_region32_t *region); void pixman_region32_init_rect (pixman_region32_t *region, int x, int y, unsigned int width, unsigned int height); pixman_bool_t pixman_region32_init_rects (pixman_region32_t *region, pixman_box32_t *boxes, int count); void pixman_region32_init_with_extents (pixman_region32_t *region, pixman_box32_t *extents); void pixman_region32_fini (pixman_region32_t *region); void pixman_region32_translate (pixman_region32_t *region, int x, int y); pixman_bool_t pixman_region32_copy (pixman_region32_t *dest, pixman_region32_t *source); pixman_bool_t pixman_region32_intersect (pixman_region32_t *newReg, pixman_region32_t *reg1, pixman_region32_t *reg2); pixman_bool_t pixman_region32_union (pixman_region32_t *newReg, pixman_region32_t *reg1, pixman_region32_t *reg2); pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest, pixman_region32_t *source, int x, int y, unsigned int width, unsigned int height); pixman_bool_t pixman_region32_subtract (pixman_region32_t *regD, pixman_region32_t *regM, pixman_region32_t *regS); pixman_bool_t pixman_region32_inverse (pixman_region32_t *newReg, pixman_region32_t *reg1, pixman_box32_t *invRect); pixman_bool_t pixman_region32_contains_point (pixman_region32_t *region, int x, int y, pixman_box32_t *box); pixman_region_overlap_t pixman_region32_contains_rectangle (pixman_region32_t *region, pixman_box32_t *prect); pixman_bool_t pixman_region32_not_empty (pixman_region32_t *region); pixman_box32_t * pixman_region32_extents (pixman_region32_t *region); int pixman_region32_n_rects (pixman_region32_t *region); pixman_box32_t * pixman_region32_rectangles (pixman_region32_t *region, int *n_rects); pixman_bool_t pixman_region32_equal (pixman_region32_t *region1, pixman_region32_t *region2); pixman_bool_t pixman_region32_selfcheck (pixman_region32_t *region); void pixman_region32_reset (pixman_region32_t *region, pixman_box32_t *box); pixman_bool_t pixman_blt (uint32_t *src_bits, uint32_t *dst_bits, int src_stride, int dst_stride, int src_bpp, int dst_bpp, int src_x, int src_y, int dst_x, int dst_y, int width, int height); pixman_bool_t pixman_fill (uint32_t *bits, int stride, int bpp, int x, int y, int width, int height, uint32_t _xor); pixman_bool_t pixman_transform_point_3d (pixman_transform_t *transform, pixman_vector_t *vector); int pixman_version (void); const char* pixman_version_string (void); typedef union pixman_image pixman_image_t; typedef struct pixman_indexed pixman_indexed_t; typedef struct pixman_gradient_stop pixman_gradient_stop_t; typedef uint32_t (* pixman_read_memory_func_t) (const void *src, int size); typedef void (* pixman_write_memory_func_t) (void *dst, uint32_t value, int size); struct pixman_gradient_stop { pixman_fixed_t x; pixman_color_t color; }; typedef uint8_t pixman_index_type; struct pixman_indexed { pixman_bool_t color; uint32_t rgba[256]; pixman_index_type ent[32768]; }; # 511 "/usr/include/pixman-1/pixman.h" typedef enum { PIXMAN_a8r8g8b8 = (((32) << 24) | ((2) << 16) | ((8) << 12) | ((8) << 8) | ((8) << 4) | ((8))), PIXMAN_x8r8g8b8 = (((32) << 24) | ((2) << 16) | ((0) << 12) | ((8) << 8) | ((8) << 4) | ((8))), PIXMAN_a8b8g8r8 = (((32) << 24) | ((3) << 16) | ((8) << 12) | ((8) << 8) | ((8) << 4) | ((8))), PIXMAN_x8b8g8r8 = (((32) << 24) | ((3) << 16) | ((0) << 12) | ((8) << 8) | ((8) << 4) | ((8))), PIXMAN_r8g8b8 = (((24) << 24) | ((2) << 16) | ((0) << 12) | ((8) << 8) | ((8) << 4) | ((8))), PIXMAN_b8g8r8 = (((24) << 24) | ((3) << 16) | ((0) << 12) | ((8) << 8) | ((8) << 4) | ((8))), PIXMAN_r5g6b5 = (((16) << 24) | ((2) << 16) | ((0) << 12) | ((5) << 8) | ((6) << 4) | ((5))), PIXMAN_b5g6r5 = (((16) << 24) | ((3) << 16) | ((0) << 12) | ((5) << 8) | ((6) << 4) | ((5))), PIXMAN_a1r5g5b5 = (((16) << 24) | ((2) << 16) | ((1) << 12) | ((5) << 8) | ((5) << 4) | ((5))), PIXMAN_x1r5g5b5 = (((16) << 24) | ((2) << 16) | ((0) << 12) | ((5) << 8) | ((5) << 4) | ((5))), PIXMAN_a1b5g5r5 = (((16) << 24) | ((3) << 16) | ((1) << 12) | ((5) << 8) | ((5) << 4) | ((5))), PIXMAN_x1b5g5r5 = (((16) << 24) | ((3) << 16) | ((0) << 12) | ((5) << 8) | ((5) << 4) | ((5))), PIXMAN_a4r4g4b4 = (((16) << 24) | ((2) << 16) | ((4) << 12) | ((4) << 8) | ((4) << 4) | ((4))), PIXMAN_x4r4g4b4 = (((16) << 24) | ((2) << 16) | ((0) << 12) | ((4) << 8) | ((4) << 4) | ((4))), PIXMAN_a4b4g4r4 = (((16) << 24) | ((3) << 16) | ((4) << 12) | ((4) << 8) | ((4) << 4) | ((4))), PIXMAN_x4b4g4r4 = (((16) << 24) | ((3) << 16) | ((0) << 12) | ((4) << 8) | ((4) << 4) | ((4))), PIXMAN_a8 = (((8) << 24) | ((1) << 16) | ((8) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_r3g3b2 = (((8) << 24) | ((2) << 16) | ((0) << 12) | ((3) << 8) | ((3) << 4) | ((2))), PIXMAN_b2g3r3 = (((8) << 24) | ((3) << 16) | ((0) << 12) | ((3) << 8) | ((3) << 4) | ((2))), PIXMAN_a2r2g2b2 = (((8) << 24) | ((2) << 16) | ((2) << 12) | ((2) << 8) | ((2) << 4) | ((2))), PIXMAN_a2b2g2r2 = (((8) << 24) | ((3) << 16) | ((2) << 12) | ((2) << 8) | ((2) << 4) | ((2))), PIXMAN_c8 = (((8) << 24) | ((4) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_g8 = (((8) << 24) | ((5) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_x4a4 = (((8) << 24) | ((1) << 16) | ((4) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_x4c4 = (((8) << 24) | ((4) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_x4g4 = (((8) << 24) | ((5) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_a4 = (((4) << 24) | ((1) << 16) | ((4) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_r1g2b1 = (((4) << 24) | ((2) << 16) | ((0) << 12) | ((1) << 8) | ((2) << 4) | ((1))), PIXMAN_b1g2r1 = (((4) << 24) | ((3) << 16) | ((0) << 12) | ((1) << 8) | ((2) << 4) | ((1))), PIXMAN_a1r1g1b1 = (((4) << 24) | ((2) << 16) | ((1) << 12) | ((1) << 8) | ((1) << 4) | ((1))), PIXMAN_a1b1g1r1 = (((4) << 24) | ((3) << 16) | ((1) << 12) | ((1) << 8) | ((1) << 4) | ((1))), PIXMAN_c4 = (((4) << 24) | ((4) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_g4 = (((4) << 24) | ((5) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_a1 = (((1) << 24) | ((1) << 16) | ((1) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_g1 = (((1) << 24) | ((5) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_yuy2 = (((16) << 24) | ((6) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))), PIXMAN_yv12 = (((12) << 24) | ((7) << 16) | ((0) << 12) | ((0) << 8) | ((0) << 4) | ((0))) } pixman_format_code_t; pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format); pixman_bool_t pixman_format_supported_source (pixman_format_code_t format); pixman_image_t *pixman_image_create_solid_fill (pixman_color_t *color); pixman_image_t *pixman_image_create_linear_gradient (pixman_point_fixed_t *p1, pixman_point_fixed_t *p2, const pixman_gradient_stop_t *stops, int n_stops); pixman_image_t *pixman_image_create_radial_gradient (pixman_point_fixed_t *inner, pixman_point_fixed_t *outer, pixman_fixed_t inner_radius, pixman_fixed_t outer_radius, const pixman_gradient_stop_t *stops, int n_stops); pixman_image_t *pixman_image_create_conical_gradient (pixman_point_fixed_t *center, pixman_fixed_t angle, const pixman_gradient_stop_t *stops, int n_stops); pixman_image_t *pixman_image_create_bits (pixman_format_code_t format, int width, int height, uint32_t *bits, int rowstride_bytes); pixman_image_t *pixman_image_ref (pixman_image_t *image); pixman_bool_t pixman_image_unref (pixman_image_t *image); pixman_bool_t pixman_image_set_clip_region (pixman_image_t *image, pixman_region16_t *region); pixman_bool_t pixman_image_set_clip_region32 (pixman_image_t *image, pixman_region32_t *region); void pixman_image_set_has_client_clip (pixman_image_t *image, pixman_bool_t clien_clip); pixman_bool_t pixman_image_set_transform (pixman_image_t *image, const pixman_transform_t *transform); void pixman_image_set_repeat (pixman_image_t *image, pixman_repeat_t repeat); pixman_bool_t pixman_image_set_filter (pixman_image_t *image, pixman_filter_t filter, const pixman_fixed_t *filter_params, int n_filter_params); void pixman_image_set_source_clipping (pixman_image_t *image, pixman_bool_t source_clipping); void pixman_image_set_alpha_map (pixman_image_t *image, pixman_image_t *alpha_map, int16_t x, int16_t y); void pixman_image_set_component_alpha (pixman_image_t *image, pixman_bool_t component_alpha); void pixman_image_set_accessors (pixman_image_t *image, pixman_read_memory_func_t read_func, pixman_write_memory_func_t write_func); void pixman_image_set_indexed (pixman_image_t *image, const pixman_indexed_t *indexed); uint32_t *pixman_image_get_data (pixman_image_t *image); int pixman_image_get_width (pixman_image_t *image); int pixman_image_get_height (pixman_image_t *image); int pixman_image_get_stride (pixman_image_t *image); int pixman_image_get_depth (pixman_image_t *image); pixman_bool_t pixman_image_fill_rectangles (pixman_op_t op, pixman_image_t *image, pixman_color_t *color, int n_rects, const pixman_rectangle16_t *rects); pixman_bool_t pixman_compute_composite_region (pixman_region16_t *pRegion, pixman_image_t *pSrc, pixman_image_t *pMask, pixman_image_t *pDst, int16_t xSrc, int16_t ySrc, int16_t xMask, int16_t yMask, int16_t xDst, int16_t yDst, uint16_t width, uint16_t height); void pixman_image_composite (pixman_op_t op, pixman_image_t *src, pixman_image_t *mask, pixman_image_t *dest, int16_t src_x, int16_t src_y, int16_t mask_x, int16_t mask_y, int16_t dest_x, int16_t dest_y, uint16_t width, uint16_t height); typedef struct pixman_edge pixman_edge_t; typedef struct pixman_trapezoid pixman_trapezoid_t; typedef struct pixman_trap pixman_trap_t; typedef struct pixman_span_fix pixman_span_fix_t; struct pixman_edge { pixman_fixed_t x; pixman_fixed_t e; pixman_fixed_t stepx; pixman_fixed_t signdx; pixman_fixed_t dy; pixman_fixed_t dx; pixman_fixed_t stepx_small; pixman_fixed_t stepx_big; pixman_fixed_t dx_small; pixman_fixed_t dx_big; }; struct pixman_trapezoid { pixman_fixed_t top, bottom; pixman_line_fixed_t left, right; }; # 706 "/usr/include/pixman-1/pixman.h" struct pixman_span_fix { pixman_fixed_t l, r, y; }; struct pixman_trap { pixman_span_fix_t top, bot; }; pixman_fixed_t pixman_sample_ceil_y (pixman_fixed_t y, int bpp); pixman_fixed_t pixman_sample_floor_y (pixman_fixed_t y, int bpp); void pixman_edge_step (pixman_edge_t *e, int n); void pixman_edge_init (pixman_edge_t *e, int bpp, pixman_fixed_t y_start, pixman_fixed_t x_top, pixman_fixed_t y_top, pixman_fixed_t x_bot, pixman_fixed_t y_bot); void pixman_line_fixed_edge_init (pixman_edge_t *e, int bpp, pixman_fixed_t y, const pixman_line_fixed_t *line, int x_off, int y_off); void pixman_rasterize_edges (pixman_image_t *image, pixman_edge_t *l, pixman_edge_t *r, pixman_fixed_t t, pixman_fixed_t b); void pixman_add_traps (pixman_image_t *image, int16_t x_off, int16_t y_off, int ntrap, pixman_trap_t *traps); void pixman_add_trapezoids (pixman_image_t *image, int16_t x_off, int y_off, int ntraps, const pixman_trapezoid_t *traps); void pixman_rasterize_trapezoid (pixman_image_t *image, const pixman_trapezoid_t *trap, int x_off, int y_off); # 55 "../include/miscstruct.h" 2 typedef xPoint DDXPointRec; typedef struct pixman_box16 BoxRec; typedef union _DevUnion { pointer ptr; long val; unsigned long uval; RegionPtr (*fptr)( DrawablePtr , DrawablePtr , GCPtr , int , int , int , int , int , int , unsigned long ); } DevUnion; # 54 "../include/regionstr.h" 2 # 67 "../include/regionstr.h" typedef struct pixman_region16_data RegDataRec, *RegDataPtr; extern BoxRec miEmptyBox; extern RegDataRec miEmptyData; extern RegDataRec miBrokenData; # 228 "../include/regionstr.h" extern void InitRegions (void); extern RegionPtr miRegionCreate( BoxPtr , int ); extern void miRegionInit( RegionPtr , BoxPtr , int ); extern void miRegionDestroy( RegionPtr ); extern void miRegionUninit( RegionPtr ); extern Bool miRegionCopy( RegionPtr , RegionPtr ); extern Bool miIntersect( RegionPtr , RegionPtr , RegionPtr ); extern Bool miUnion( RegionPtr , RegionPtr , RegionPtr ); extern Bool miRegionAppend( RegionPtr , RegionPtr ); extern Bool miRegionValidate( RegionPtr , Bool * ); extern RegionPtr miRectsToRegion( int , xRectanglePtr , int ); extern Bool miSubtract( RegionPtr , RegionPtr , RegionPtr ); extern Bool miInverse( RegionPtr , RegionPtr , BoxPtr ); extern int miRectIn( RegionPtr , BoxPtr ); extern void miTranslateRegion( RegionPtr , int , int ); extern void miRegionReset( RegionPtr , BoxPtr ); extern Bool miRegionBreak( RegionPtr ); extern Bool miPointInRegion( RegionPtr , int , int , BoxPtr ); extern Bool miRegionEqual( RegionPtr , RegionPtr ); extern Bool miRegionNotEmpty( RegionPtr ); extern void miRegionEmpty( RegionPtr ); extern BoxPtr miRegionExtents( RegionPtr ); extern void miPrintRegion( RegionPtr ); # 52 "../include/region.h" 2 # 53 "../include/window.h" 2 # 69 "../include/window.h" typedef struct _BackingStore *BackingStorePtr; typedef struct _Window *WindowPtr; typedef int (*VisitWindowProcPtr)( WindowPtr , pointer ); extern int TraverseTree( WindowPtr , VisitWindowProcPtr , pointer ); extern int WalkTree( ScreenPtr , VisitWindowProcPtr , pointer ); extern WindowPtr AllocateWindow( ScreenPtr ); extern Bool CreateRootWindow( ScreenPtr ); extern void InitRootWindow( WindowPtr ); typedef WindowPtr (* RealChildHeadProc) (WindowPtr pWin); void RegisterRealChildHeadProc (RealChildHeadProc proc); extern WindowPtr RealChildHead( WindowPtr ); extern WindowPtr CreateWindow( Window , WindowPtr , int , int , unsigned int , unsigned int , unsigned int , unsigned int , Mask , XID* , int , ClientPtr , VisualID , int* ); extern int DeleteWindow( pointer , XID ); extern void DestroySubwindows( WindowPtr , ClientPtr ); extern int ChangeWindowAttributes( WindowPtr , Mask , XID* , ClientPtr ); extern void GetWindowAttributes( WindowPtr , ClientPtr , xGetWindowAttributesReply* ); extern RegionPtr CreateUnclippedWinSize( WindowPtr ); extern void GravityTranslate( int , int , int , int , int , int , unsigned , int* , int* ); extern int ConfigureWindow( WindowPtr , Mask , XID* , ClientPtr ); extern int CirculateWindow( WindowPtr , int , ClientPtr ); extern int ReparentWindow( WindowPtr , WindowPtr , int , int , ClientPtr ); extern int MapWindow( WindowPtr , ClientPtr ); extern void MapSubwindows( WindowPtr , ClientPtr ); extern int UnmapWindow( WindowPtr , Bool ); extern void UnmapSubwindows( WindowPtr ); extern void HandleSaveSet( ClientPtr ); extern Bool PointInWindowIsVisible( WindowPtr , int , int ); extern RegionPtr NotClippedByChildren( WindowPtr ); extern void SendVisibilityNotify( WindowPtr ); extern void SaveScreens( int , int ); extern WindowPtr FindWindowWithOptional( WindowPtr ); extern void CheckWindowOptionalNeed( WindowPtr ); extern Bool MakeWindowOptional( WindowPtr ); extern WindowPtr MoveWindowInStack( WindowPtr , WindowPtr ); void SetWinSize( WindowPtr ); void SetBorderSize( WindowPtr ); void ResizeChildrenWinSize( WindowPtr , int , int , int , int ); extern void ShapeExtensionInit(void); extern void SendShapeNotify( WindowPtr , int ); extern RegionPtr CreateBoundingShape( WindowPtr ); extern RegionPtr CreateClipShape( WindowPtr ); extern void DisableMapUnmapEvents( WindowPtr ); extern void EnableMapUnmapEvents( WindowPtr ); # 53 "../include/dix.h" 2 # 1 "../include/input.h" 1 # 83 "../include/input.h" typedef unsigned long Leds; typedef struct _OtherClients *OtherClientsPtr; typedef struct _InputClients *InputClientsPtr; typedef struct _DeviceIntRec *DeviceIntPtr; typedef int (*DeviceProc)( DeviceIntPtr , int ); typedef void (*ProcessInputProc)( xEventPtr , DeviceIntPtr , int ); typedef Bool (*DeviceHandleProc)( DeviceIntPtr , void* ); typedef void (*DeviceUnwrapProc)( DeviceIntPtr , DeviceHandleProc , void* ); typedef struct _DeviceRec { pointer devicePrivate; ProcessInputProc processInputProc; ProcessInputProc realInputProc; ProcessInputProc enqueueInputProc; Bool on; } DeviceRec, *DevicePtr; typedef struct { int click, bell, bell_pitch, bell_duration; Bool autoRepeat; unsigned char autoRepeats[32]; Leds leds; unsigned char id; } KeybdCtrl; typedef struct { KeySym *map; KeyCode minKeyCode, maxKeyCode; int mapWidth; } KeySymsRec, *KeySymsPtr; typedef struct { int num, den, threshold; unsigned char id; } PtrCtrl; typedef struct { int resolution, min_value, max_value; int integer_displayed; unsigned char id; } IntegerCtrl; typedef struct { int max_symbols, num_symbols_supported; int num_symbols_displayed; KeySym *symbols_supported; KeySym *symbols_displayed; unsigned char id; } StringCtrl; typedef struct { int percent, pitch, duration; unsigned char id; } BellCtrl; typedef struct { Leds led_values; Mask led_mask; unsigned char id; } LedCtrl; extern int AllocateDevicePrivateIndex(void); extern Bool AllocateDevicePrivate(DeviceIntPtr device, int index); extern void ResetDevicePrivateIndex(void); extern KeybdCtrl defaultKeyboardControl; extern PtrCtrl defaultPointerControl; typedef struct _InputOption { char *key; char *value; struct _InputOption *next; } InputOption; extern void InitCoreDevices(void); extern DeviceIntPtr AddInputDevice( DeviceProc , Bool ); extern Bool EnableDevice( DeviceIntPtr ); extern Bool ActivateDevice( DeviceIntPtr ); extern Bool DisableDevice( DeviceIntPtr ); extern int InitAndStartDevices(void); extern void CloseDownDevices(void); extern int RemoveDevice( DeviceIntPtr ); extern int NumMotionEvents(void); extern void RegisterPointerDevice( DeviceIntPtr ); extern void RegisterKeyboardDevice( DeviceIntPtr ); extern DevicePtr LookupKeyboardDevice(void); extern DevicePtr LookupPointerDevice(void); extern DevicePtr LookupDevice( int ); extern void QueryMinMaxKeyCodes( KeyCode* , KeyCode* ); extern Bool SetKeySymsMap( KeySymsPtr , KeySymsPtr ); extern Bool InitKeyClassDeviceStruct( DeviceIntPtr , KeySymsPtr , CARD8 []); extern Bool InitButtonClassDeviceStruct( DeviceIntPtr , int , CARD8* ); typedef int (*ValuatorMotionProcPtr)( DeviceIntPtr , xTimecoord * , unsigned long , unsigned long , ScreenPtr ); extern Bool InitValuatorClassDeviceStruct( DeviceIntPtr , int , ValuatorMotionProcPtr , int , int ); extern Bool InitAbsoluteClassDeviceStruct( DeviceIntPtr ); extern Bool InitFocusClassDeviceStruct( DeviceIntPtr ); typedef void (*BellProcPtr)( int , DeviceIntPtr , pointer , int); typedef void (*KbdCtrlProcPtr)( DeviceIntPtr , KeybdCtrl * ); extern Bool InitKbdFeedbackClassDeviceStruct( DeviceIntPtr , BellProcPtr , KbdCtrlProcPtr ); typedef void (*PtrCtrlProcPtr)( DeviceIntPtr , PtrCtrl * ); extern Bool InitPtrFeedbackClassDeviceStruct( DeviceIntPtr , PtrCtrlProcPtr ); typedef void (*StringCtrlProcPtr)( DeviceIntPtr , StringCtrl * ); extern Bool InitStringFeedbackClassDeviceStruct( DeviceIntPtr , StringCtrlProcPtr , int , int , KeySym* ); typedef void (*BellCtrlProcPtr)( DeviceIntPtr , BellCtrl * ); extern Bool InitBellFeedbackClassDeviceStruct( DeviceIntPtr , BellProcPtr , BellCtrlProcPtr ); typedef void (*LedCtrlProcPtr)( DeviceIntPtr , LedCtrl * ); extern Bool InitLedFeedbackClassDeviceStruct( DeviceIntPtr , LedCtrlProcPtr ); typedef void (*IntegerCtrlProcPtr)( DeviceIntPtr , IntegerCtrl * ); extern Bool InitIntegerFeedbackClassDeviceStruct( DeviceIntPtr , IntegerCtrlProcPtr ); extern Bool InitPointerDeviceStruct( DevicePtr , CARD8* , int , ValuatorMotionProcPtr , PtrCtrlProcPtr , int , int ); extern Bool InitKeyboardDeviceStruct( DevicePtr , KeySymsPtr , CARD8 [], BellProcPtr , KbdCtrlProcPtr ); extern void SendMappingNotify( unsigned int , unsigned int , unsigned int , ClientPtr ); extern Bool BadDeviceMap( BYTE* , int , unsigned , unsigned , XID* ); extern Bool AllModifierKeysAreUp( DeviceIntPtr , CARD8* , int , CARD8* , int ); extern void NoteLedState( DeviceIntPtr , int , Bool ); extern void MaybeStopHint( DeviceIntPtr , ClientPtr ); extern void ProcessPointerEvent( xEventPtr , DeviceIntPtr , int ); extern void ProcessKeyboardEvent( xEventPtr , DeviceIntPtr , int ); extern void CoreProcessPointerEvent( xEventPtr , DeviceIntPtr , int ); extern void CoreProcessKeyboardEvent( xEventPtr , DeviceIntPtr , int ); extern Bool LegalModifier( unsigned int , DeviceIntPtr ); extern void ProcessInputEvents(void); extern void InitInput( int , char ** ); extern int GetMaximumEventsNum(void); extern int GetPointerEvents( xEvent *events, DeviceIntPtr pDev, int type, int buttons, int flags, int first_valuator, int num_valuators, int *valuators); extern int GetKeyboardEvents( xEvent *events, DeviceIntPtr pDev, int type, int key_code); extern int GetKeyboardValuatorEvents( xEvent *events, DeviceIntPtr pDev, int type, int key_code, int first_valuator, int num_valuator, int *valuators); extern int GetProximityEvents( xEvent *events, DeviceIntPtr pDev, int type, int first_valuator, int num_valuators, int *valuators); extern void PostSyntheticMotion( int x, int y, int screen, unsigned long time); extern int GetMotionHistorySize( void); extern void AllocateMotionHistory( DeviceIntPtr pDev); extern int GetMotionHistory( DeviceIntPtr pDev, xTimecoord *buff, unsigned long start, unsigned long stop, ScreenPtr pScreen); extern void SwitchCoreKeyboard(DeviceIntPtr pDev); extern void SwitchCorePointer(DeviceIntPtr pDev); extern DeviceIntPtr LookupDeviceIntRec( CARD8 deviceid); extern int NewInputDeviceRequest( InputOption *options, DeviceIntPtr *dev); extern void DeleteInputDeviceRequest( DeviceIntPtr dev); extern void DDXRingBell( int volume, int pitch, int duration); # 54 "../include/dix.h" 2 # 123 "../include/dix.h" typedef struct _TimeStamp *TimeStampPtr; typedef struct _WorkQueue *WorkQueuePtr; extern ClientPtr requestingClient; extern ClientPtr *clients; extern ClientPtr serverClient; extern int currentMaxClients; extern char dispatchExceptionAtReset; typedef int HWEventQueueType; typedef HWEventQueueType* HWEventQueuePtr; extern HWEventQueuePtr checkForInput[2]; typedef struct _TimeStamp { CARD32 months; CARD32 milliseconds; } TimeStamp; extern void SetInputCheck( HWEventQueuePtr , HWEventQueuePtr ); extern void CloseDownClient( ClientPtr ); extern void UpdateCurrentTime(void); extern void UpdateCurrentTimeIf(void); extern void InitSelections(void); extern void FlushClientCaches(XID ); extern int dixDestroyPixmap( pointer , XID ); extern void InitClient( ClientPtr , int , pointer ); extern ClientPtr NextAvailableClient( pointer ); extern void SendErrorToClient( ClientPtr , unsigned int , unsigned int , XID , int ); extern void DeleteWindowFromAnySelections( WindowPtr ); extern void MarkClientException( ClientPtr ); extern int SendConnSetup( ClientPtr , char* ); extern void CopyISOLatin1Lowered( unsigned char * , unsigned char * , int ); extern int CompareISOLatin1Lowered( unsigned char * , int alen, unsigned char * , int blen); extern int dixLookupWindow( WindowPtr *result, XID id, ClientPtr client, Mask access_mode); extern int dixLookupDrawable( DrawablePtr *result, XID id, ClientPtr client, Mask type_mask, Mask access_mode); extern int dixLookupGC( GCPtr *result, XID id, ClientPtr client, Mask access_mode); extern int dixLookupClient( ClientPtr *result, XID id, ClientPtr client, Mask access_mode); extern WindowPtr SecurityLookupWindow(XID, ClientPtr, Mask); extern WindowPtr LookupWindow(XID, ClientPtr); extern pointer SecurityLookupDrawable(XID, ClientPtr, Mask); extern pointer LookupDrawable(XID, ClientPtr); extern ClientPtr LookupClient(XID, ClientPtr); extern void NoopDDA(void); extern int AlterSaveSetForClient( ClientPtr , WindowPtr , unsigned , Bool , Bool ); extern void DeleteWindowFromAnySaveSet( WindowPtr ); extern void BlockHandler( pointer , pointer ); extern void WakeupHandler( int , pointer ); typedef void (* WakeupHandlerProcPtr)( pointer , int , pointer ); extern Bool RegisterBlockAndWakeupHandlers( BlockHandlerProcPtr , WakeupHandlerProcPtr , pointer ); extern void RemoveBlockAndWakeupHandlers( BlockHandlerProcPtr , WakeupHandlerProcPtr , pointer ); extern void InitBlockAndWakeupHandlers(void); extern void ProcessWorkQueue(void); extern void ProcessWorkQueueZombies(void); extern Bool QueueWorkProc( Bool (* )( ClientPtr , pointer ), ClientPtr , pointer ); typedef Bool (* ClientSleepProcPtr)( ClientPtr , pointer ); extern Bool ClientSleep( ClientPtr , ClientSleepProcPtr , pointer ); extern Bool ClientSignal( ClientPtr ); extern void ClientWakeup( ClientPtr ); extern Bool ClientIsAsleep( ClientPtr ); extern Atom MakeAtom( char * , unsigned , Bool ); extern Bool ValidAtom( Atom ); extern char *NameForAtom( Atom ); extern void AtomError(void); extern void FreeAllAtoms(void); extern void InitAtoms(void); extern void SetVendorRelease(int release); extern void SetVendorString(char *string); extern void SetMaskForEvent( Mask , int ); extern Bool IsParent( WindowPtr , WindowPtr ); extern WindowPtr GetCurrentRootWindow(void); extern WindowPtr GetSpriteWindow(void); extern void NoticeEventTime(xEventPtr ); extern void EnqueueEvent( xEventPtr , DeviceIntPtr , int ); extern void ComputeFreezes(void); extern void CheckGrabForSyncs( DeviceIntPtr , Bool , Bool ); extern void ActivatePointerGrab( DeviceIntPtr , GrabPtr , TimeStamp , Bool ); extern void DeactivatePointerGrab( DeviceIntPtr ); extern void ActivateKeyboardGrab( DeviceIntPtr , GrabPtr , TimeStamp , Bool ); extern void DeactivateKeyboardGrab( DeviceIntPtr ); extern void AllowSome( ClientPtr , TimeStamp , DeviceIntPtr , int ); extern void ReleaseActiveGrabs( ClientPtr client); extern int DeliverEventsToWindow( WindowPtr , xEventPtr , int , Mask , GrabPtr , int ); extern int DeliverDeviceEvents( WindowPtr , xEventPtr , GrabPtr , WindowPtr , DeviceIntPtr , int ); extern void DefineInitialRootWindow( WindowPtr ); extern void WindowHasNewCursor( WindowPtr ); extern Bool CheckDeviceGrabs( DeviceIntPtr , xEventPtr , int , int ); extern void DeliverFocusedEvent( DeviceIntPtr , xEventPtr , WindowPtr , int ); extern void DeliverGrabbedEvent( xEventPtr , DeviceIntPtr , Bool , int ); extern void FixKeyState( xEvent * , DeviceIntPtr ); extern void RecalculateDeliverableEvents( WindowPtr ); extern int OtherClientGone( pointer , XID ); extern void DoFocusEvents( DeviceIntPtr , WindowPtr , WindowPtr , int ); extern int SetInputFocus( ClientPtr , DeviceIntPtr , Window , CARD8 , Time , Bool ); extern int GrabDevice( ClientPtr , DeviceIntPtr , unsigned , unsigned , Window , unsigned , Time , Mask , CARD8 * ); extern void InitEvents(void); extern void CloseDownEvents(void); extern void DeleteWindowFromAnyEvents( WindowPtr , Bool ); extern Mask EventMaskForClient( WindowPtr , ClientPtr ); extern int DeliverEvents( WindowPtr , xEventPtr , int , WindowPtr ); extern void WriteEventsToClient( ClientPtr , int , xEventPtr ); extern int TryClientEvents( ClientPtr , xEventPtr , int , Mask , Mask , GrabPtr ); extern void WindowsRestructured(void); extern void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff); void ScreenRestructured (ScreenPtr pScreen); extern void ResetClientPrivates(void); extern int AllocateClientPrivateIndex(void); extern Bool AllocateClientPrivate( int , unsigned ); extern int ffs(int i); # 542 "../include/dix.h" typedef void (*CallbackProcPtr) ( CallbackListPtr *, pointer, pointer); typedef Bool (*AddCallbackProcPtr) ( CallbackListPtr *, CallbackProcPtr, pointer); typedef Bool (*DeleteCallbackProcPtr) ( CallbackListPtr *, CallbackProcPtr, pointer); typedef void (*CallCallbacksProcPtr) ( CallbackListPtr *, pointer); typedef void (*DeleteCallbackListProcPtr) ( CallbackListPtr *); typedef struct _CallbackProcs { AddCallbackProcPtr AddCallback; DeleteCallbackProcPtr DeleteCallback; CallCallbacksProcPtr CallCallbacks; DeleteCallbackListProcPtr DeleteCallbackList; } CallbackFuncsRec, *CallbackFuncsPtr; extern Bool AddCallback( CallbackListPtr * , CallbackProcPtr , pointer ); extern Bool DeleteCallback( CallbackListPtr * , CallbackProcPtr , pointer ); extern void CallCallbacks( CallbackListPtr * , pointer ); extern void DeleteCallbackList( CallbackListPtr * ); extern void InitCallbackManager(void); extern CallbackListPtr ServerGrabCallback; typedef enum {SERVER_GRABBED, SERVER_UNGRABBED, CLIENT_PERVIOUS, CLIENT_IMPERVIOUS } ServerGrabState; typedef struct { ClientPtr client; ServerGrabState grabstate; } ServerGrabInfoRec; extern CallbackListPtr EventCallback; typedef struct { ClientPtr client; xEventPtr events; int count; } EventInfoRec; extern CallbackListPtr DeviceEventCallback; typedef struct { xEventPtr events; int count; } DeviceEventInfoRec; extern CallbackListPtr SelectionCallback; typedef enum { SelectionSetOwner, SelectionWindowDestroy, SelectionClientClose } SelectionCallbackKind; typedef struct { struct _Selection *selection; SelectionCallbackKind kind; } SelectionInfoRec; # 61 "colormap.c" 2 # 1 "../include/colormapst.h" 1 # 51 "../include/colormapst.h" # 1 "/usr/include/X11/Xarch.h" 1 3 4 # 52 "../include/colormapst.h" 2 # 1 "../include/colormap.h" 1 # 74 "../include/colormap.h" typedef CARD32 Pixel; typedef struct _CMEntry *EntryPtr; typedef struct _colorResource *colorResourcePtr; extern int CreateColormap( Colormap , ScreenPtr , VisualPtr , ColormapPtr* , int , int ); extern int FreeColormap( pointer , XID ); extern int TellLostMap( WindowPtr , pointer ); extern int TellGainedMap( WindowPtr , pointer ); extern int CopyColormapAndFree( Colormap , ColormapPtr , int ); extern int AllocColor( ColormapPtr , unsigned short* , unsigned short* , unsigned short* , Pixel* , int ); extern void FakeAllocColor( ColormapPtr , xColorItem * ); extern void FakeFreeColor( ColormapPtr , Pixel ); typedef int (*ColorCompareProcPtr)( EntryPtr , xrgb * ); extern int FindColor( ColormapPtr , EntryPtr , int , xrgb* , Pixel* , int , int , ColorCompareProcPtr ); extern int QueryColors( ColormapPtr , int , Pixel* , xrgb* ); extern int FreeClientPixels( pointer , XID ); extern int AllocColorCells( int , ColormapPtr , int , int , Bool , Pixel* , Pixel* ); extern int AllocColorPlanes( int , ColormapPtr , int , int , int , int , Bool , Pixel* , Pixel* , Pixel* , Pixel* ); extern int FreeColors( ColormapPtr , int , int , Pixel* , Pixel ); extern int StoreColors( ColormapPtr , int , xColorItem* ); extern int IsMapInstalled( Colormap , WindowPtr ); # 54 "../include/colormapst.h" 2 typedef struct { unsigned short color; short refcnt; } SHAREDCOLOR; typedef struct { unsigned short red, green, blue; } LOCO; typedef struct { SHAREDCOLOR *red, *green, *blue; } SHCO; typedef struct _CMEntry { union { LOCO local; SHCO shco; } co; short refcnt; Bool fShared; } Entry; # 101 "../include/colormapst.h" typedef struct _ColormapRec { VisualPtr pVisual; short class; XID mid; ScreenPtr pScreen; short flags; int freeRed; int freeGreen; int freeBlue; int *numPixelsRed; int *numPixelsGreen; int *numPixelsBlue; Pixel **clientPixelsRed; Pixel **clientPixelsGreen; Pixel **clientPixelsBlue; Entry *red; Entry *green; Entry *blue; pointer devPriv; DevUnion *devPrivates; } ColormapRec; # 62 "colormap.c" 2 # 1 "../include/os.h" 1 # 63 "colormap.c" 2 # 1 "../include/scrnintstr.h" 1 # 53 "../include/scrnintstr.h" # 1 "../include/bstore.h" 1 # 20 "../include/bstore.h" # 1 "../include/bstorestr.h" 1 # 25 "../include/bstorestr.h" typedef void (* BackingStoreSaveAreasProcPtr)( PixmapPtr , RegionPtr , int , int , WindowPtr ); typedef void (* BackingStoreRestoreAreasProcPtr)( PixmapPtr , RegionPtr , int , int , WindowPtr ); typedef void (* BackingStoreSetClipmaskRgnProcPtr)( GCPtr , RegionPtr ); typedef PixmapPtr (* BackingStoreGetImagePixmapProcPtr)(void); typedef PixmapPtr (* BackingStoreGetSpansPixmapProcPtr)(void); typedef struct _BSFuncs { BackingStoreSaveAreasProcPtr SaveAreas; BackingStoreRestoreAreasProcPtr RestoreAreas; BackingStoreSetClipmaskRgnProcPtr SetClipmaskRgn; BackingStoreGetImagePixmapProcPtr GetImagePixmap; BackingStoreGetSpansPixmapProcPtr GetSpansPixmap; } BSFuncRec, *BSFuncPtr; # 21 "../include/bstore.h" 2 # 54 "../include/scrnintstr.h" 2 # 1 "../include/cursor.h" 1 # 62 "../include/cursor.h" typedef struct _Cursor *CursorPtr; typedef struct _CursorMetric *CursorMetricPtr; extern CursorPtr rootCursor; extern int FreeCursor( pointer , XID ); extern CursorPtr AllocCursor( unsigned char* , unsigned char* , CursorMetricPtr , unsigned , unsigned , unsigned , unsigned , unsigned , unsigned ); extern CursorPtr AllocCursorARGB( unsigned char* , unsigned char* , CARD32* , CursorMetricPtr , unsigned , unsigned , unsigned , unsigned , unsigned , unsigned ); extern int AllocGlyphCursor( Font , unsigned int , Font , unsigned int , unsigned , unsigned , unsigned , unsigned , unsigned , unsigned , CursorPtr* , ClientPtr ); extern CursorPtr CreateRootCursor( char* , unsigned int ); extern int ServerBitsFromGlyph( FontPtr , unsigned int , register CursorMetricPtr , unsigned char ** ); extern Bool CursorMetricsFromGlyph( FontPtr , unsigned , CursorMetricPtr ); extern void CheckCursorConfinement( WindowPtr ); extern void NewCurrentScreen( ScreenPtr , int , int ); extern Bool PointerConfinedToScreen(void); extern void GetSpritePosition( int * , int * ); extern int XineramaGetCursorScreen(void); # 56 "../include/scrnintstr.h" 2 # 1 "../include/validate.h" 1 # 33 "../include/validate.h" typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap, VTBroken } VTKind; typedef union _Validate *ValidatePtr; # 57 "../include/scrnintstr.h" 2 # 1 "../include/dix.h" 1 # 59 "../include/scrnintstr.h" 2 typedef struct _PixmapFormat { unsigned char depth; unsigned char bitsPerPixel; unsigned char scanlinePad; } PixmapFormatRec; typedef struct _Visual { VisualID vid; short class; short bitsPerRGBValue; short ColormapEntries; short nplanes; unsigned long redMask, greenMask, blueMask; int offsetRed, offsetGreen, offsetBlue; } VisualRec; typedef struct _Depth { unsigned char depth; short numVids; VisualID *vids; } DepthRec; # 91 "../include/scrnintstr.h" typedef Bool (* CloseScreenProcPtr)( int , ScreenPtr ); typedef void (* QueryBestSizeProcPtr)( int , unsigned short * , unsigned short * , ScreenPtr ); typedef Bool (* SaveScreenProcPtr)( ScreenPtr , int ); typedef void (* GetImageProcPtr)( DrawablePtr , int , int , int , int , unsigned int , unsigned long , char * ); typedef void (* GetSpansProcPtr)( DrawablePtr , int , DDXPointPtr , int* , int , char * ); typedef void (* PointerNonInterestBoxProcPtr)( ScreenPtr , BoxPtr ); typedef void (* SourceValidateProcPtr)( DrawablePtr , int , int , int , int ); typedef Bool (* CreateWindowProcPtr)( WindowPtr ); typedef Bool (* DestroyWindowProcPtr)( WindowPtr ); typedef Bool (* PositionWindowProcPtr)( WindowPtr , int , int ); typedef Bool (* ChangeWindowAttributesProcPtr)( WindowPtr , unsigned long ); typedef Bool (* RealizeWindowProcPtr)( WindowPtr ); typedef Bool (* UnrealizeWindowProcPtr)( WindowPtr ); typedef void (* RestackWindowProcPtr)( WindowPtr , WindowPtr ); typedef int (* ValidateTreeProcPtr)( WindowPtr , WindowPtr , VTKind ); typedef void (* PostValidateTreeProcPtr)( WindowPtr , WindowPtr , VTKind ); typedef void (* WindowExposuresProcPtr)( WindowPtr , RegionPtr , RegionPtr ); typedef void (* PaintWindowProcPtr)( WindowPtr , RegionPtr , int ); typedef PaintWindowProcPtr PaintWindowBackgroundProcPtr; typedef PaintWindowProcPtr PaintWindowBorderProcPtr; typedef void (* CopyWindowProcPtr)( WindowPtr , DDXPointRec , RegionPtr ); typedef void (* ClearToBackgroundProcPtr)( WindowPtr , int , int , int , int , Bool ); typedef void (* ClipNotifyProcPtr)( WindowPtr , int , int ); typedef PixmapPtr (* CreatePixmapProcPtr)( ScreenPtr , int , int , int ); typedef Bool (* DestroyPixmapProcPtr)( PixmapPtr ); typedef void (* SaveDoomedAreasProcPtr)( WindowPtr , RegionPtr , int , int ); typedef RegionPtr (* RestoreAreasProcPtr)( WindowPtr , RegionPtr ); typedef void (* ExposeCopyProcPtr)( WindowPtr , DrawablePtr , GCPtr , RegionPtr , int , int , int , int , unsigned long ); typedef RegionPtr (* TranslateBackingStoreProcPtr)( WindowPtr , int , int , RegionPtr , int , int ); typedef RegionPtr (* ClearBackingStoreProcPtr)( WindowPtr , int , int , int , int , Bool ); typedef void (* DrawGuaranteeProcPtr)( WindowPtr , GCPtr , int ); typedef Bool (* RealizeFontProcPtr)( ScreenPtr , FontPtr ); typedef Bool (* UnrealizeFontProcPtr)( ScreenPtr , FontPtr ); typedef void (* ConstrainCursorProcPtr)( ScreenPtr , BoxPtr ); typedef void (* CursorLimitsProcPtr)( ScreenPtr , CursorPtr , BoxPtr , BoxPtr ); typedef Bool (* DisplayCursorProcPtr)( ScreenPtr , CursorPtr ); typedef Bool (* RealizeCursorProcPtr)( ScreenPtr , CursorPtr ); typedef Bool (* UnrealizeCursorProcPtr)( ScreenPtr , CursorPtr ); typedef void (* RecolorCursorProcPtr)( ScreenPtr , CursorPtr , Bool ); typedef Bool (* SetCursorPositionProcPtr)( ScreenPtr , int , int , Bool ); typedef Bool (* CreateGCProcPtr)( GCPtr ); typedef Bool (* CreateColormapProcPtr)( ColormapPtr ); typedef void (* DestroyColormapProcPtr)( ColormapPtr ); typedef void (* InstallColormapProcPtr)( ColormapPtr ); typedef void (* UninstallColormapProcPtr)( ColormapPtr ); typedef int (* ListInstalledColormapsProcPtr) ( ScreenPtr , XID* ); typedef void (* StoreColorsProcPtr)( ColormapPtr , int , xColorItem * ); typedef void (* ResolveColorProcPtr)( unsigned short* , unsigned short* , unsigned short* , VisualPtr ); typedef RegionPtr (* BitmapToRegionProcPtr)( PixmapPtr ); typedef void (* SendGraphicsExposeProcPtr)( ClientPtr , RegionPtr , XID , int , int ); typedef void (* ScreenBlockHandlerProcPtr)( int , pointer , pointer , pointer ); typedef void (* ScreenWakeupHandlerProcPtr)( int , pointer , unsigned long , pointer ); typedef Bool (* CreateScreenResourcesProcPtr)( ScreenPtr ); typedef Bool (* ModifyPixmapHeaderProcPtr)( PixmapPtr , int , int , int , int , int , pointer ); typedef PixmapPtr (* GetWindowPixmapProcPtr)( WindowPtr ); typedef void (* SetWindowPixmapProcPtr)( WindowPtr , PixmapPtr ); typedef PixmapPtr (* GetScreenPixmapProcPtr)( ScreenPtr ); typedef void (* SetScreenPixmapProcPtr)( PixmapPtr ); typedef void (* MarkWindowProcPtr)( WindowPtr ); typedef Bool (* MarkOverlappedWindowsProcPtr)( WindowPtr , WindowPtr , WindowPtr * ); typedef Bool (* ChangeSaveUnderProcPtr)( WindowPtr , WindowPtr ); typedef void (* PostChangeSaveUnderProcPtr)( WindowPtr , WindowPtr ); typedef void (* MoveWindowProcPtr)( WindowPtr , int , int , WindowPtr , VTKind ); typedef void (* ResizeWindowProcPtr)( WindowPtr , int , int , unsigned int , unsigned int , WindowPtr ); typedef WindowPtr (* GetLayerWindowProcPtr)( WindowPtr ); typedef void (* HandleExposuresProcPtr)( WindowPtr ); typedef void (* ReparentWindowProcPtr)( WindowPtr , WindowPtr ); typedef void (* SetShapeProcPtr)( WindowPtr ); typedef void (* ChangeBorderWidthProcPtr)( WindowPtr , unsigned int ); typedef void (* MarkUnrealizedWindowProcPtr)( WindowPtr , WindowPtr , Bool ); typedef struct _Screen { int myNum; ATOM id; short width, height; short mmWidth, mmHeight; short numDepths; unsigned char rootDepth; DepthPtr allowedDepths; unsigned long rootVisual; unsigned long defColormap; short minInstalledCmaps, maxInstalledCmaps; char backingStoreSupport, saveUnderSupport; unsigned long whitePixel, blackPixel; unsigned long rgf; GCPtr GCperDepth[8 +1]; PixmapPtr PixmapPerDepth[1]; pointer devPrivate; short numVisuals; VisualPtr visuals; int WindowPrivateLen; unsigned *WindowPrivateSizes; unsigned totalWindowSize; int GCPrivateLen; unsigned *GCPrivateSizes; unsigned totalGCSize; CloseScreenProcPtr CloseScreen; QueryBestSizeProcPtr QueryBestSize; SaveScreenProcPtr SaveScreen; GetImageProcPtr GetImage; GetSpansProcPtr GetSpans; PointerNonInterestBoxProcPtr PointerNonInterestBox; SourceValidateProcPtr SourceValidate; CreateWindowProcPtr CreateWindow; DestroyWindowProcPtr DestroyWindow; PositionWindowProcPtr PositionWindow; ChangeWindowAttributesProcPtr ChangeWindowAttributes; RealizeWindowProcPtr RealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow; ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; WindowExposuresProcPtr WindowExposures; PaintWindowBackgroundProcPtr PaintWindowBackground; PaintWindowBorderProcPtr PaintWindowBorder; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; RestackWindowProcPtr RestackWindow; CreatePixmapProcPtr CreatePixmap; DestroyPixmapProcPtr DestroyPixmap; SaveDoomedAreasProcPtr SaveDoomedAreas; RestoreAreasProcPtr RestoreAreas; ExposeCopyProcPtr ExposeCopy; TranslateBackingStoreProcPtr TranslateBackingStore; ClearBackingStoreProcPtr ClearBackingStore; DrawGuaranteeProcPtr DrawGuarantee; BSFuncRec BackingStoreFuncs; RealizeFontProcPtr RealizeFont; UnrealizeFontProcPtr UnrealizeFont; ConstrainCursorProcPtr ConstrainCursor; CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; RealizeCursorProcPtr RealizeCursor; UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; SetCursorPositionProcPtr SetCursorPosition; CreateGCProcPtr CreateGC; CreateColormapProcPtr CreateColormap; DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; UninstallColormapProcPtr UninstallColormap; ListInstalledColormapsProcPtr ListInstalledColormaps; StoreColorsProcPtr StoreColors; ResolveColorProcPtr ResolveColor; BitmapToRegionProcPtr BitmapToRegion; SendGraphicsExposeProcPtr SendGraphicsExpose; ScreenBlockHandlerProcPtr BlockHandler; ScreenWakeupHandlerProcPtr WakeupHandler; pointer blockData; pointer wakeupData; DevUnion *devPrivates; CreateScreenResourcesProcPtr CreateScreenResources; ModifyPixmapHeaderProcPtr ModifyPixmapHeader; GetWindowPixmapProcPtr GetWindowPixmap; SetWindowPixmapProcPtr SetWindowPixmap; GetScreenPixmapProcPtr GetScreenPixmap; SetScreenPixmapProcPtr SetScreenPixmap; PixmapPtr pScratchPixmap; int PixmapPrivateLen; unsigned int *PixmapPrivateSizes; unsigned int totalPixmapSize; MarkWindowProcPtr MarkWindow; MarkOverlappedWindowsProcPtr MarkOverlappedWindows; ChangeSaveUnderProcPtr ChangeSaveUnder; PostChangeSaveUnderProcPtr PostChangeSaveUnder; MoveWindowProcPtr MoveWindow; ResizeWindowProcPtr ResizeWindow; GetLayerWindowProcPtr GetLayerWindow; HandleExposuresProcPtr HandleExposures; ReparentWindowProcPtr ReparentWindow; SetShapeProcPtr SetShape; ChangeBorderWidthProcPtr ChangeBorderWidth; MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; } ScreenRec; typedef struct _ScreenInfo { int imageByteOrder; int bitmapScanlineUnit; int bitmapScanlinePad; int bitmapBitOrder; int numPixmapFormats; PixmapFormatRec formats[8]; int arraySize; int numScreens; ScreenPtr screens[16]; int numVideoScreens; } ScreenInfo; extern ScreenInfo screenInfo; extern void InitOutput( ScreenInfo * , int , char ** ); # 64 "colormap.c" 2 # 1 "../include/resource.h" 1 # 58 "../include/resource.h" typedef unsigned long RESTYPE; # 123 "../include/resource.h" typedef int (*DeleteType)( pointer , XID ); typedef void (*FindResType)( pointer , XID , pointer ); typedef void (*FindAllRes)( pointer , XID , RESTYPE , pointer ); typedef Bool (*FindComplexResType)( pointer , XID , pointer ); extern RESTYPE CreateNewResourceType( DeleteType ); extern RESTYPE CreateNewResourceClass(void); extern Bool InitClientResources( ClientPtr ); extern XID FakeClientID( int ); extern Bool AddResource( XID , RESTYPE , pointer ); extern void FreeResource( XID , RESTYPE ); extern void FreeResourceByType( XID , RESTYPE , Bool ); extern Bool ChangeResourceValue( XID , RESTYPE , pointer ); extern void FindClientResourcesByType( ClientPtr , RESTYPE , FindResType , pointer ); extern void FindAllClientResources( ClientPtr , FindAllRes , pointer ); extern void FreeClientNeverRetainResources( ClientPtr ); extern void FreeClientResources( ClientPtr ); extern void FreeAllResources(void); extern Bool LegalNewID( XID , ClientPtr ); extern pointer LookupIDByType( XID , RESTYPE ); extern pointer LookupIDByClass( XID , RESTYPE ); extern pointer LookupClientResourceComplex( ClientPtr client, RESTYPE type, FindComplexResType func, pointer cdata); # 229 "../include/resource.h" extern pointer SecurityLookupIDByType( ClientPtr , XID , RESTYPE , Mask ); extern pointer SecurityLookupIDByClass( ClientPtr , XID , RESTYPE , Mask ); extern void GetXIDRange( int , Bool , XID * , XID * ); extern unsigned int GetXIDList( ClientPtr , unsigned int , XID * ); extern RESTYPE lastResourceType; extern RESTYPE TypeMask; extern Atom *ResourceNames; void RegisterResourceName(RESTYPE type, char* name); # 65 "colormap.c" 2 # 1 "../include/windowstr.h" 1 # 52 "../include/windowstr.h" # 1 "../include/pixmapstr.h" 1 # 59 "../include/pixmapstr.h" typedef struct _Drawable { unsigned char type; unsigned char class; unsigned char depth; unsigned char bitsPerPixel; XID id; short x; short y; unsigned short width; unsigned short height; ScreenPtr pScreen; unsigned long serialNumber; } DrawableRec; typedef struct _Pixmap { DrawableRec drawable; int refcnt; int devKind; DevUnion devPrivate; DevUnion *devPrivates; short screen_x; short screen_y; } PixmapRec; # 53 "../include/windowstr.h" 2 # 1 "../include/property.h" 1 # 53 "../include/property.h" typedef struct _Property *PropertyPtr; extern int ChangeWindowProperty( WindowPtr , Atom , Atom , int , int , unsigned long , pointer , Bool ); extern int DeleteProperty( WindowPtr , Atom ); extern void DeleteAllWindowProperties( WindowPtr ); # 56 "../include/windowstr.h" 2 # 1 "../include/resource.h" 1 # 57 "../include/windowstr.h" 2 # 1 "../include/opaque.h" 1 # 34 "../include/opaque.h" # 1 "../include/globals.h" 1 # 9 "../include/globals.h" extern CARD32 defaultScreenSaverTime; extern CARD32 defaultScreenSaverInterval; extern CARD32 ScreenSaverTime; extern CARD32 ScreenSaverInterval; extern Bool screenSaverSuspended; extern char *defaultFontPath; extern char *rgbPath; extern int monitorResolution; extern Bool loadableFonts; extern int defaultColorVisualClass; extern Bool Must_have_memory; extern WindowPtr *WindowTable; extern int GrabInProgress; extern Bool noTestExtensions; extern DDXPointRec dixScreenOrigins[16]; extern CARD32 defaultDPMSStandbyTime; extern CARD32 defaultDPMSSuspendTime; extern CARD32 defaultDPMSOffTime; extern CARD32 DPMSStandbyTime; extern CARD32 DPMSSuspendTime; extern CARD32 DPMSOffTime; extern CARD16 DPMSPowerLevel; extern Bool defaultDPMSEnabled; extern Bool DPMSEnabled; extern Bool DPMSEnabledSwitch; extern Bool DPMSDisabledSwitch; extern Bool DPMSCapableFlag; extern Bool PanoramiXExtensionDisabledHack; extern Bool noBigReqExtension; extern Bool noCompositeExtension; extern Bool noDamageExtension; extern Bool noDbeExtension; extern Bool noDPMSExtension; extern Bool noEVIExtension; extern Bool noGlxExtension; extern Bool noScreenSaverExtension; extern Bool noMITShmExtension; extern Bool noMITMiscExtension; extern Bool noRRExtension; extern Bool noRenderExtension; extern Bool noShapeExtension; extern Bool noSecurityExtension; extern Bool noSyncExtension; extern Bool noXcupExtension; extern Bool noResExtension; extern Bool noXagExtension; extern Bool noXCMiscExtension; extern Bool noXevieExtension; extern Bool noXFree86BigfontExtension; extern Bool noXFree86DGAExtension; extern Bool noXFree86DRIExtension; extern Bool noXFree86MiscExtension; extern Bool noXFree86VidModeExtension; extern Bool noXFixesExtension; extern Bool noXkbExtension; extern Bool noPanoramiXExtension; extern Bool noXInputExtension; extern Bool noXvExtension; # 35 "../include/opaque.h" 2 extern char *defaultTextFont; extern char *defaultCursorFont; extern int MaxClients; extern volatile char isItTimeToYield; extern volatile char dispatchException; extern CARD32 TimeOutValue; extern int ScreenSaverBlanking; extern int ScreenSaverAllowExposures; extern int defaultScreenSaverBlanking; extern int defaultScreenSaverAllowExposures; extern int argcGlobal; extern char **argvGlobal; extern char *display; extern int defaultBackingStore; extern Bool disableBackingStore; extern Bool enableBackingStore; extern Bool disableSaveUnders; extern Bool PartialNetwork; extern int logoScreenSaver; # 73 "../include/opaque.h" extern Bool defeatAccessControl; extern long maxBigRequestSize; extern Bool blackRoot; extern Bool whiteRoot; extern Bool CoreDump; # 61 "../include/windowstr.h" 2 # 73 "../include/windowstr.h" typedef struct _WindowOpt { VisualID visual; CursorPtr cursor; Colormap colormap; Mask dontPropagateMask; Mask otherEventMasks; struct _OtherClients *otherClients; struct _GrabRec *passiveGrabs; PropertyPtr userProps; unsigned long backingBitPlanes; unsigned long backingPixel; RegionPtr boundingShape; RegionPtr clipShape; RegionPtr inputShape; struct _OtherInputMasks *inputMasks; } WindowOptRec, *WindowOptPtr; # 124 "../include/windowstr.h" typedef struct _Window { DrawableRec drawable; WindowPtr parent; WindowPtr nextSib; WindowPtr prevSib; WindowPtr firstChild; WindowPtr lastChild; RegionRec clipList; RegionRec borderClip; union _Validate *valdata; RegionRec winSize; RegionRec borderSize; DDXPointRec origin; unsigned short borderWidth; unsigned short deliverableEvents; Mask eventMask; PixUnion background; PixUnion border; pointer backStorage; WindowOptPtr optional; unsigned backgroundState:2; unsigned borderIsPixel:1; unsigned cursorIsNone:1; unsigned backingStore:2; unsigned saveUnder:1; unsigned DIXsaveUnder:1; unsigned bitGravity:4; unsigned winGravity:4; unsigned overrideRedirect:1; unsigned visibility:2; unsigned mapped:1; unsigned realized:1; unsigned viewable:1; unsigned dontPropagate:3; unsigned forcedBS:1; unsigned redirectDraw:2; DevUnion *devPrivates; } WindowRec; extern Mask DontPropagateMasks[]; # 210 "../include/windowstr.h" typedef struct _ScreenSaverStuff { WindowPtr pWindow; XID wid; char blanked; Bool (*ExternalScreenSaver)( ScreenPtr , int , Bool ); } ScreenSaverStuffRec, *ScreenSaverStuffPtr; # 227 "../include/windowstr.h" extern int screenIsSaved; extern ScreenSaverStuffRec savedScreenInfo[16]; # 246 "../include/windowstr.h" extern int numSaveUndersViewable; extern int deltaSaveUndersViewable; extern WindowPtr xeviewin; # 66 "colormap.c" 2 extern XID clientErrorValue; extern int colormapPrivateCount; static Pixel FindBestPixel( EntryPtr , int , xrgb * , int ); static int AllComp( EntryPtr , xrgb * ); static int RedComp( EntryPtr , xrgb * ); static int GreenComp( EntryPtr , xrgb * ); static int BlueComp( EntryPtr , xrgb * ); static void FreePixels( ColormapPtr , int ); static void CopyFree( int , int , ColormapPtr , ColormapPtr ); static void FreeCell( ColormapPtr , Pixel , int ); static void UpdateColors( ColormapPtr ); static int AllocDirect( int , ColormapPtr , int , int , int , int , Bool , Pixel * , Pixel * , Pixel * , Pixel * ); static int AllocPseudo( int , ColormapPtr , int , int , Bool , Pixel * , Pixel * , Pixel ** ); static Bool AllocCP( ColormapPtr , EntryPtr , int , int , Bool , Pixel * , Pixel * ); static Bool AllocShared( ColormapPtr , Pixel * , int , int , int , int , Pixel , Pixel , Pixel , Pixel * ); static int FreeCo( ColormapPtr , int , int , int , Pixel * , Pixel ); static int TellNoMap( WindowPtr , Colormap * ); static void FindColorInRootCmap ( ColormapPtr , EntryPtr , int , xrgb* , Pixel* , int , ColorCompareProcPtr ); # 235 "colormap.c" typedef struct _colorResource { Colormap mid; int client; } colorResource; # 255 "colormap.c" __attribute__((visibility("default"))) int CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, ColormapPtr *ppcmap, int alloc, int client) { int class, size; unsigned long sizebytes; ColormapPtr pmap; EntryPtr pent; int i; Pixel *ppix, **pptr; class = pVisual->class; if(!(class & 1) && (alloc != 0) && (client != 0)) return (8); size = pVisual->ColormapEntries; sizebytes = (size * sizeof(Entry)) + (256 * sizeof(Pixel *)) + (256 * sizeof(int)); if ((class | 1) == 5) sizebytes *= 3; sizebytes += sizeof(ColormapRec); pmap = (ColormapPtr) Xalloc((unsigned long)(sizebytes)); if (!pmap) return (11); pmap->red = (EntryPtr)((char *)pmap + sizeof(ColormapRec)); sizebytes = size * sizeof(Entry); pmap->clientPixelsRed = (Pixel **)((char *)pmap->red + sizebytes); pmap->numPixelsRed = (int *)((char *)pmap->clientPixelsRed + (256 * sizeof(Pixel *))); pmap->mid = mid; pmap->flags = 0; if(mid == pScreen->defColormap) pmap->flags |= 1; pmap->pScreen = pScreen; pmap->pVisual = pVisual; pmap->class = class; if ((class | 1) == 5) size = ((pVisual->redMask >> pVisual->offsetRed) + 1); pmap->freeRed = size; memset((char *) pmap->red,0,(int)sizebytes); memset((char *) pmap->numPixelsRed,0,256 * sizeof(int)); for (pptr = &pmap->clientPixelsRed[256]; --pptr >= pmap->clientPixelsRed; ) *pptr = (Pixel *)((void *)0); if (alloc == 1) { if (class & 1) pmap->flags |= 2; for (pent = &pmap->red[size - 1]; pent >= pmap->red; pent--) pent->refcnt = (-1); pmap->freeRed = 0; ppix = (Pixel *)Xalloc((unsigned long)(size * sizeof(Pixel))); if (!ppix) { Xfree((pointer)(pmap)); return (11); } pmap->clientPixelsRed[client] = ppix; for(i = 0; i < size; i++) ppix[i] = i; pmap->numPixelsRed[client] = size; } if ((class | 1) == 5) { pmap->freeGreen = ((pVisual->greenMask >> pVisual->offsetGreen) + 1); pmap->green = (EntryPtr)((char *)pmap->numPixelsRed + (256 * sizeof(int))); pmap->clientPixelsGreen = (Pixel **)((char *)pmap->green + sizebytes); pmap->numPixelsGreen = (int *)((char *)pmap->clientPixelsGreen + (256 * sizeof(Pixel *))); pmap->freeBlue = ((pVisual->blueMask >> pVisual->offsetBlue) + 1); pmap->blue = (EntryPtr)((char *)pmap->numPixelsGreen + (256 * sizeof(int))); pmap->clientPixelsBlue = (Pixel **)((char *)pmap->blue + sizebytes); pmap->numPixelsBlue = (int *)((char *)pmap->clientPixelsBlue + (256 * sizeof(Pixel *))); memset((char *) pmap->green,0,(int)sizebytes); memset((char *) pmap->blue,0,(int)sizebytes); memmove((char *) pmap->clientPixelsGreen, (char *) pmap->clientPixelsRed, 256 * sizeof(Pixel *)); memmove((char *) pmap->clientPixelsBlue, (char *) pmap->clientPixelsRed, 256 * sizeof(Pixel *)); memset((char *) pmap->numPixelsGreen,0,256 * sizeof(int)); memset((char *) pmap->numPixelsBlue,0,256 * sizeof(int)); if (alloc == 1) { size = pmap->freeGreen; for(pent = &pmap->green[size-1]; pent >= pmap->green; pent--) pent->refcnt = (-1); pmap->freeGreen = 0; ppix = (Pixel *) Xalloc((unsigned long)(size * sizeof(Pixel))); if (!ppix) { Xfree((pointer)(pmap->clientPixelsRed[client])); Xfree((pointer)(pmap)); return(11); } pmap->clientPixelsGreen[client] = ppix; for(i = 0; i < size; i++) ppix[i] = i; pmap->numPixelsGreen[client] = size; size = pmap->freeBlue; for(pent = &pmap->blue[size-1]; pent >= pmap->blue; pent--) pent->refcnt = (-1); pmap->freeBlue = 0; ppix = (Pixel *) Xalloc((unsigned long)(size * sizeof(Pixel))); if (!ppix) { Xfree((pointer)(pmap->clientPixelsGreen[client])); Xfree((pointer)(pmap->clientPixelsRed[client])); Xfree((pointer)(pmap)); return(11); } pmap->clientPixelsBlue[client] = ppix; for(i = 0; i < size; i++) ppix[i] = i; pmap->numPixelsBlue[client] = size; } } if (!AddResource(mid, ((RESTYPE)6), (pointer)pmap)) return (11); pmap->flags |= 4; if (colormapPrivateCount == 0) pmap->devPrivates = ((void *)0); else { pmap->devPrivates = (DevUnion *) Xcalloc((unsigned long)(sizeof(DevUnion))*(unsigned long)(colormapPrivateCount)); if (!pmap->devPrivates) { FreeResource (mid, ((RESTYPE)0)); return 11; } } if (!(*pScreen->CreateColormap)(pmap)) { FreeResource (mid, ((RESTYPE)0)); return 11; } pmap->flags &= ~4; *ppcmap = pmap; return (0); } int FreeColormap (pointer value, XID mid) { int i; EntryPtr pent; ColormapPtr pmap = (ColormapPtr)value; if(((int)(((mid) & (((1 << 8) - 1) << (29 - 8))) >> (29 - 8))) != 0) { (*pmap->pScreen->UninstallColormap) (pmap); WalkTree(pmap->pScreen, (VisitWindowProcPtr)TellNoMap, (pointer) &mid); } (*pmap->pScreen->DestroyColormap)(pmap); if(pmap->clientPixelsRed) { for(i = 0; i < 256; i++) Xfree((pointer)(pmap->clientPixelsRed[i])); } if ((pmap->class == 3) || (pmap->class == 1)) { for(pent = &pmap->red[pmap->pVisual->ColormapEntries - 1]; pent >= pmap->red; pent--) { if(pent->fShared) { if (--pent->co.shco.red->refcnt == 0) Xfree((pointer)(pent->co.shco.red)); if (--pent->co.shco.green->refcnt == 0) Xfree((pointer)(pent->co.shco.green)); if (--pent->co.shco.blue->refcnt == 0) Xfree((pointer)(pent->co.shco.blue)); } } } if((pmap->class | 1) == 5) { for(i = 0; i < 256; i++) { Xfree((pointer)(pmap->clientPixelsGreen[i])); Xfree((pointer)(pmap->clientPixelsBlue[i])); } } if (pmap->devPrivates) Xfree((pointer)(pmap->devPrivates)); Xfree((pointer)(pmap)); return(0); } static int TellNoMap (WindowPtr pwin, Colormap *pmid) { xEvent xE; if (((pwin)->drawable.class == 2 ? 0L : ((pwin)->optional ? (pwin)->optional->colormap : FindWindowWithOptional(pwin)->optional->colormap)) == *pmid) { xE.u.u.type = 32; xE.u.colormap.window = pwin->drawable.id; xE.u.colormap.colormap = 0L; xE.u.colormap.new = 1; xE.u.colormap.state = 0; if(noPanoramiXExtension || !pwin->drawable.pScreen->myNum) DeliverEvents(pwin, &xE, 1, (WindowPtr)((void *)0)); if (pwin->optional) { pwin->optional->colormap = 0L; CheckWindowOptionalNeed (pwin); } } return (1); } __attribute__((visibility("default"))) int TellLostMap (WindowPtr pwin, pointer value) { Colormap *pmid = (Colormap *)value; xEvent xE; if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum) return 0; if (((pwin)->drawable.class == 2 ? 0L : ((pwin)->optional ? (pwin)->optional->colormap : FindWindowWithOptional(pwin)->optional->colormap)) == *pmid) { xE.u.u.type = 32; xE.u.colormap.window = pwin->drawable.id; xE.u.colormap.colormap = *pmid; xE.u.colormap.new = 0; xE.u.colormap.state = 0; DeliverEvents(pwin, &xE, 1, (WindowPtr)((void *)0)); } return (1); } __attribute__((visibility("default"))) int TellGainedMap (WindowPtr pwin, pointer value) { Colormap *pmid = (Colormap *)value; xEvent xE; if(!noPanoramiXExtension && pwin->drawable.pScreen->myNum) return 0; if (((pwin)->drawable.class == 2 ? 0L : ((pwin)->optional ? (pwin)->optional->colormap : FindWindowWithOptional(pwin)->optional->colormap)) == *pmid) { xE.u.u.type = 32; xE.u.colormap.window = pwin->drawable.id; xE.u.colormap.colormap = *pmid; xE.u.colormap.new = 0; xE.u.colormap.state = 1; DeliverEvents(pwin, &xE, 1, (WindowPtr)((void *)0)); } return (1); } int CopyColormapAndFree (Colormap mid, ColormapPtr pSrc, int client) { ColormapPtr pmap = (ColormapPtr) ((void *)0); int result, alloc, size; Colormap midSrc; ScreenPtr pScreen; VisualPtr pVisual; pScreen = pSrc->pScreen; pVisual = pSrc->pVisual; midSrc = pSrc->mid; alloc = ((pSrc->flags & 2) && ((int)(((midSrc) & (((1 << 8) - 1) << (29 - 8))) >> (29 - 8))) == client) ? 1 : 0; size = pVisual->ColormapEntries; result = CreateColormap (mid, pScreen, pVisual, &pmap, alloc, client); if(result != 0) return(result); if(alloc == 1) { memmove((char *)pmap->red, (char *)pSrc->red, size * sizeof(Entry)); if((pmap->class | 1) == 5) { memmove((char *)pmap->green, (char *)pSrc->green, size * sizeof(Entry)); memmove((char *)pmap->blue, (char *)pSrc->blue, size * sizeof(Entry)); } pSrc->flags &= ~2; FreePixels(pSrc, client); UpdateColors(pmap); return(0); } CopyFree(0, client, pSrc, pmap); if ((pmap->class | 1) == 5) { CopyFree(1, client, pSrc, pmap); CopyFree(2, client, pSrc, pmap); } if (pmap->class & 1) UpdateColors(pmap); return(0); } static void CopyFree (int channel, int client, ColormapPtr pmapSrc, ColormapPtr pmapDst) { int z, npix; EntryPtr pentSrcFirst, pentDstFirst; EntryPtr pentSrc, pentDst; Pixel *ppix; int nalloc; switch(channel) { default: case 0: ppix = (pmapSrc->clientPixelsRed)[client]; npix = (pmapSrc->numPixelsRed)[client]; pentSrcFirst = pmapSrc->red; pentDstFirst = pmapDst->red; break; case 1: ppix = (pmapSrc->clientPixelsGreen)[client]; npix = (pmapSrc->numPixelsGreen)[client]; pentSrcFirst = pmapSrc->green; pentDstFirst = pmapDst->green; break; case 2: ppix = (pmapSrc->clientPixelsBlue)[client]; npix = (pmapSrc->numPixelsBlue)[client]; pentSrcFirst = pmapSrc->blue; pentDstFirst = pmapDst->blue; break; } nalloc = 0; if (pmapSrc->class & 1) { for(z = npix; --z >= 0; ppix++) { pentSrc = pentSrcFirst + *ppix; pentDst = pentDstFirst + *ppix; if (pentDst->refcnt > 0) { pentDst->refcnt++; } else { *pentDst = *pentSrc; nalloc++; if (pentSrc->refcnt > 0) pentDst->refcnt = 1; else pentSrc->fShared = 0; } FreeCell(pmapSrc, *ppix, channel); } } switch(channel) { case 0: pmapDst->freeRed -= nalloc; (pmapDst->clientPixelsRed)[client] = (pmapSrc->clientPixelsRed)[client]; (pmapSrc->clientPixelsRed)[client] = (Pixel *) ((void *)0); (pmapDst->numPixelsRed)[client] = (pmapSrc->numPixelsRed)[client]; (pmapSrc->numPixelsRed)[client] = 0; break; case 1: pmapDst->freeGreen -= nalloc; (pmapDst->clientPixelsGreen)[client] = (pmapSrc->clientPixelsGreen)[client]; (pmapSrc->clientPixelsGreen)[client] = (Pixel *) ((void *)0); (pmapDst->numPixelsGreen)[client] = (pmapSrc->numPixelsGreen)[client]; (pmapSrc->numPixelsGreen)[client] = 0; break; case 2: pmapDst->freeBlue -= nalloc; pmapDst->clientPixelsBlue[client] = pmapSrc->clientPixelsBlue[client]; pmapSrc->clientPixelsBlue[client] = (Pixel *) ((void *)0); pmapDst->numPixelsBlue[client] = pmapSrc->numPixelsBlue[client]; pmapSrc->numPixelsBlue[client] = 0; break; } } static void FreeCell (ColormapPtr pmap, Pixel i, int channel) { EntryPtr pent; int *pCount; switch (channel) { default: case 3: case 0: pent = (EntryPtr) &pmap->red[i]; pCount = &pmap->freeRed; break; case 1: pent = (EntryPtr) &pmap->green[i]; pCount = &pmap->freeGreen; break; case 2: pent = (EntryPtr) &pmap->blue[i]; pCount = &pmap->freeBlue; break; } if (pent->refcnt > 1) pent->refcnt--; else { if (pent->fShared) { if(--pent->co.shco.red->refcnt == 0) Xfree((pointer)(pent->co.shco.red)); if(--pent->co.shco.green->refcnt == 0) Xfree((pointer)(pent->co.shco.green)); if(--pent->co.shco.blue->refcnt == 0) Xfree((pointer)(pent->co.shco.blue)); pent->fShared = 0; } pent->refcnt = 0; *pCount += 1; } } static void UpdateColors (ColormapPtr pmap) { xColorItem *defs; xColorItem *pdef; EntryPtr pent; VisualPtr pVisual; int i, n, size; pVisual = pmap->pVisual; size = pVisual->ColormapEntries; defs = (xColorItem *)__builtin_alloca ((int)(size * sizeof(xColorItem))); if (!defs) return; n = 0; pdef = defs; if (pmap->class == 5) { for (i = 0; i < size; i++) { if (!pmap->red[i].refcnt && !pmap->green[i].refcnt && !pmap->blue[i].refcnt) continue; pdef->pixel = ((Pixel)i << pVisual->offsetRed) | ((Pixel)i << pVisual->offsetGreen) | ((Pixel)i << pVisual->offsetBlue); pdef->red = pmap->red[i].co.local.red; pdef->green = pmap->green[i].co.local.green; pdef->blue = pmap->blue[i].co.local.blue; pdef->flags = (1<<0)|(1<<1)|(1<<2); pdef++; n++; } } else { for (i = 0, pent = pmap->red; i < size; i++, pent++) { if (!pent->refcnt) continue; pdef->pixel = i; if(pent->fShared) { pdef->red = pent->co.shco.red->color; pdef->green = pent->co.shco.green->color; pdef->blue = pent->co.shco.blue->color; } else { pdef->red = pent->co.local.red; pdef->green = pent->co.local.green; pdef->blue = pent->co.local.blue; } pdef->flags = (1<<0)|(1<<1)|(1<<2); pdef++; n++; } } if (n) (*pmap->pScreen->StoreColors)(pmap, n, defs); do {} while(0); } __attribute__((visibility("default"))) int AllocColor (ColormapPtr pmap, unsigned short *pred, unsigned short *pgreen, unsigned short *pblue, Pixel *pPix, int client) { Pixel pixR, pixG, pixB; int entries; xrgb rgb; int class; VisualPtr pVisual; int npix; Pixel *ppix; pVisual = pmap->pVisual; (*pmap->pScreen->ResolveColor) (pred, pgreen, pblue, pVisual); rgb.red = *pred; rgb.green = *pgreen; rgb.blue = *pblue; class = pmap->class; entries = pVisual->ColormapEntries; if(pmap->flags & 4) class |= 1; switch (class) { case 2: case 0: *pPix = pixR = FindBestPixel(pmap->red, entries, &rgb, 3); *pred = pmap->red[pixR].co.local.red; *pgreen = pmap->red[pixR].co.local.green; *pblue = pmap->red[pixR].co.local.blue; npix = pmap->numPixelsRed[client]; ppix = (Pixel *) Xrealloc((pointer)(pmap->clientPixelsRed[client]), (unsigned long)((npix + 1) * sizeof(Pixel))); if (!ppix) return (11); ppix[npix] = pixR; pmap->clientPixelsRed[client] = ppix; pmap->numPixelsRed[client]++; break; case 4: pixR = FindBestPixel(pmap->red, ((pVisual->redMask >> pVisual->offsetRed) + 1), &rgb, 0); pixG = FindBestPixel(pmap->green, ((pVisual->greenMask >> pVisual->offsetGreen) + 1), &rgb, 1); pixB = FindBestPixel(pmap->blue, ((pVisual->blueMask >> pVisual->offsetBlue) + 1), &rgb, 2); *pPix = (pixR << pVisual->offsetRed) | (pixG << pVisual->offsetGreen) | (pixB << pVisual->offsetBlue) | ((pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pVisual)->redMask|(pVisual)->greenMask|(pVisual)->blueMask)); *pred = pmap->red[pixR].co.local.red; *pgreen = pmap->green[pixG].co.local.green; *pblue = pmap->blue[pixB].co.local.blue; npix = pmap->numPixelsRed[client]; ppix = (Pixel *) Xrealloc((pointer)(pmap->clientPixelsRed[client]), (unsigned long)((npix + 1) * sizeof(Pixel))); if (!ppix) return (11); ppix[npix] = pixR; pmap->clientPixelsRed[client] = ppix; npix = pmap->numPixelsGreen[client]; ppix = (Pixel *) Xrealloc((pointer)(pmap->clientPixelsGreen[client]), (unsigned long)((npix + 1) * sizeof(Pixel))); if (!ppix) return (11); ppix[npix] = pixG; pmap->clientPixelsGreen[client] = ppix; npix = pmap->numPixelsBlue[client]; ppix = (Pixel *) Xrealloc((pointer)(pmap->clientPixelsBlue[client]), (unsigned long)((npix + 1) * sizeof(Pixel))); if (!ppix) return (11); ppix[npix] = pixB; pmap->clientPixelsBlue[client] = ppix; pmap->numPixelsRed[client]++; pmap->numPixelsGreen[client]++; pmap->numPixelsBlue[client]++; break; case 1: case 3: if (pmap->mid != pmap->pScreen->defColormap && pmap->pVisual->vid == pmap->pScreen->rootVisual) { ColormapPtr prootmap = (ColormapPtr) SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, ((RESTYPE)6), (1<<0)); if (pmap->class == prootmap->class) FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb, pPix, 3, AllComp); } if (FindColor(pmap, pmap->red, entries, &rgb, pPix, 3, client, AllComp) != 0) return (11); break; case 5: if (pmap->mid != pmap->pScreen->defColormap && pmap->pVisual->vid == pmap->pScreen->rootVisual) { ColormapPtr prootmap = (ColormapPtr) SecurityLookupIDByType (clients[client], pmap->pScreen->defColormap, ((RESTYPE)6), (1<<0)); if (pmap->class == prootmap->class) { pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed; FindColorInRootCmap (prootmap, prootmap->red, entries, &rgb, &pixR, 0, RedComp); pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen; FindColorInRootCmap (prootmap, prootmap->green, entries, &rgb, &pixG, 1, GreenComp); pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue; FindColorInRootCmap (prootmap, prootmap->blue, entries, &rgb, &pixB, 2, BlueComp); *pPix = pixR | pixG | pixB; } } pixR = (*pPix & pVisual->redMask) >> pVisual->offsetRed; if (FindColor(pmap, pmap->red, ((pVisual->redMask >> pVisual->offsetRed) + 1), &rgb, &pixR, 0, client, RedComp) != 0) return (11); pixG = (*pPix & pVisual->greenMask) >> pVisual->offsetGreen; if (FindColor(pmap, pmap->green, ((pVisual->greenMask >> pVisual->offsetGreen) + 1), &rgb, &pixG, 1, client, GreenComp) != 0) { (void)FreeCo(pmap, client, 0, 1, &pixR, (Pixel)0); return (11); } pixB = (*pPix & pVisual->blueMask) >> pVisual->offsetBlue; if (FindColor(pmap, pmap->blue, ((pVisual->blueMask >> pVisual->offsetBlue) + 1), &rgb, &pixB, 2, client, BlueComp) != 0) { (void)FreeCo(pmap, client, 1, 1, &pixG, (Pixel)0); (void)FreeCo(pmap, client, 0, 1, &pixR, (Pixel)0); return (11); } *pPix = pixR | pixG | pixB | ((pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pVisual)->redMask|(pVisual)->greenMask|(pVisual)->blueMask)); break; } if ((pmap->numPixelsRed[client] == 1) && (((int)(((pmap->mid) & (((1 << 8) - 1) << (29 - 8))) >> (29 - 8))) != client) && !(pmap->flags & 4)) { colorResource *pcr; pcr = (colorResource *) Xalloc((unsigned long)(sizeof(colorResource))); if (!pcr) { (void)FreeColors(pmap, client, 1, pPix, (Pixel)0); return (11); } pcr->mid = pmap->mid; pcr->client = client; if (!AddResource(FakeClientID(client), ((RESTYPE)7), (pointer)pcr)) return (11); } return (0); } # 995 "colormap.c" __attribute__((visibility("default"))) void FakeAllocColor (ColormapPtr pmap, xColorItem *item) { Pixel pixR, pixG, pixB; Pixel temp; int entries; xrgb rgb; int class; VisualPtr pVisual; pVisual = pmap->pVisual; rgb.red = item->red; rgb.green = item->green; rgb.blue = item->blue; (*pmap->pScreen->ResolveColor) (&rgb.red, &rgb.green, &rgb.blue, pVisual); class = pmap->class; entries = pVisual->ColormapEntries; switch (class) { case 1: case 3: item->pixel = 0; if (FindColor(pmap, pmap->red, entries, &rgb, &temp, 3, -1, AllComp) == 0) { item->pixel = temp; break; } case 2: case 0: item->pixel = FindBestPixel(pmap->red, entries, &rgb, 3); break; case 5: pixR = (item->pixel & pVisual->redMask) >> pVisual->offsetRed; pixG = (item->pixel & pVisual->greenMask) >> pVisual->offsetGreen; pixB = (item->pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (FindColor(pmap, pmap->red, ((pVisual->redMask >> pVisual->offsetRed) + 1), &rgb, &pixR, 0, -1, RedComp) != 0) pixR = FindBestPixel(pmap->red, ((pVisual->redMask >> pVisual->offsetRed) + 1), &rgb, 0) << pVisual->offsetRed; if (FindColor(pmap, pmap->green, ((pVisual->greenMask >> pVisual->offsetGreen) + 1), &rgb, &pixG, 1, -1, GreenComp) != 0) pixG = FindBestPixel(pmap->green, ((pVisual->greenMask >> pVisual->offsetGreen) + 1), &rgb, 1) << pVisual->offsetGreen; if (FindColor(pmap, pmap->blue, ((pVisual->blueMask >> pVisual->offsetBlue) + 1), &rgb, &pixB, 2, -1, BlueComp) != 0) pixB = FindBestPixel(pmap->blue, ((pVisual->blueMask >> pVisual->offsetBlue) + 1), &rgb, 2) << pVisual->offsetBlue; item->pixel = pixR | pixG | pixB; break; case 4: pixR = FindBestPixel(pmap->red, ((pVisual->redMask >> pVisual->offsetRed) + 1), &rgb, 0); pixG = FindBestPixel(pmap->green, ((pVisual->greenMask >> pVisual->offsetGreen) + 1), &rgb, 1); pixB = FindBestPixel(pmap->blue, ((pVisual->blueMask >> pVisual->offsetBlue) + 1), &rgb, 2); item->pixel = (pixR << pVisual->offsetRed) | (pixG << pVisual->offsetGreen) | (pixB << pVisual->offsetBlue); break; } } __attribute__((visibility("default"))) void FakeFreeColor(ColormapPtr pmap, Pixel pixel) { VisualPtr pVisual; Pixel pixR, pixG, pixB; switch (pmap->class) { case 1: case 3: if (pmap->red[pixel].refcnt == (-2)) pmap->red[pixel].refcnt = 0; break; case 5: pVisual = pmap->pVisual; pixR = (pixel & pVisual->redMask) >> pVisual->offsetRed; pixG = (pixel & pVisual->greenMask) >> pVisual->offsetGreen; pixB = (pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (pmap->red[pixR].refcnt == (-2)) pmap->red[pixR].refcnt = 0; if (pmap->green[pixG].refcnt == (-2)) pmap->green[pixG].refcnt = 0; if (pmap->blue[pixB].refcnt == (-2)) pmap->blue[pixB].refcnt = 0; break; } } typedef unsigned short BigNumUpper; typedef unsigned long BigNumLower; # 1098 "colormap.c" typedef struct _bignum { BigNumUpper upper; BigNumLower lower; } BigNumRec, *BigNumPtr; # 1112 "colormap.c" static void BigNumAdd (BigNumPtr x, BigNumPtr y, BigNumPtr r) { BigNumLower lower, carry = 0; lower = x->lower + y->lower; if (lower >= (1 << 24)) { lower -= (1 << 24); carry = 1; } r->lower = lower; r->upper = x->upper + y->upper + carry; } static Pixel FindBestPixel(EntryPtr pentFirst, int size, xrgb *prgb, int channel) { EntryPtr pent; Pixel pixel, final; long dr, dg, db; unsigned long sq; BigNumRec minval, sum, temp; final = 0; (((&minval)->upper = (1 << 16)-1), ((&minval)->lower = (1 << 24)-1)); for (pent = pentFirst, pixel = 0; pixel < size; pent++, pixel++) { dr = dg = db = 0; switch(channel) { case 3: dg = (long) pent->co.local.green - prgb->green; db = (long) pent->co.local.blue - prgb->blue; case 0: dr = (long) pent->co.local.red - prgb->red; break; case 1: dg = (long) pent->co.local.green - prgb->green; break; case 2: db = (long) pent->co.local.blue - prgb->blue; break; } sq = dr * dr; (((&sum)->upper = ((sq) >> 24)), ((&sum)->lower = ((sq) & ((1 << 24) - 1)))); sq = dg * dg; (((&temp)->upper = ((sq) >> 24)), ((&temp)->lower = ((sq) & ((1 << 24) - 1)))); BigNumAdd (&sum, &temp, &sum); sq = db * db; (((&temp)->upper = ((sq) >> 24)), ((&temp)->lower = ((sq) & ((1 << 24) - 1)))); BigNumAdd (&sum, &temp, &sum); if ((((&minval)->upper > (&sum)->upper) || ((&minval)->upper == (&sum)->upper && (&minval)->lower > (&sum)->lower))) { final = pixel; minval = sum; } } return(final); } static void FindColorInRootCmap (ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb *prgb, Pixel *pPixel, int channel, ColorCompareProcPtr comp) { EntryPtr pent; Pixel pixel; int count; if ((pixel = *pPixel) >= size) pixel = 0; for (pent = pentFirst + pixel, count = size; --count >= 0; pent++, pixel++) { if (pent->refcnt > 0 && (*comp) (pent, prgb)) { switch (channel) { case 0: pixel <<= pmap->pVisual->offsetRed; break; case 1: pixel <<= pmap->pVisual->offsetGreen; break; case 2: pixel <<= pmap->pVisual->offsetBlue; break; default: break; } *pPixel = pixel; } } } int FindColor (ColormapPtr pmap, EntryPtr pentFirst, int size, xrgb *prgb, Pixel *pPixel, int channel, int client, ColorCompareProcPtr comp) { EntryPtr pent; Bool foundFree; Pixel pixel, Free = 0; int npix, count, *nump = ((void *)0); Pixel **pixp = ((void *)0), *ppix; xColorItem def; foundFree = 0; if((pixel = *pPixel) >= size) pixel = 0; for (pent = pentFirst + pixel, count = size; --count >= 0; ) { if (pent->refcnt > 0) { if ((*comp) (pent, prgb)) { if (client >= 0) pent->refcnt++; *pPixel = pixel; switch(channel) { case 0: *pPixel <<= pmap->pVisual->offsetRed; case 3: break; case 1: *pPixel <<= pmap->pVisual->offsetGreen; break; case 2: *pPixel <<= pmap->pVisual->offsetBlue; break; } goto gotit; } } else if (!foundFree && pent->refcnt == 0) { Free = pixel; foundFree = 1; if(pmap->flags & 4) break; } pixel++; if(pixel >= size) { pent = pentFirst; pixel = 0; } else pent++; } if (!foundFree) return (11); pent = pentFirst + Free; pent->fShared = 0; pent->refcnt = (client >= 0) ? 1 : (-2); switch (channel) { case 3: pent->co.local.red = prgb->red; pent->co.local.green = prgb->green; pent->co.local.blue = prgb->blue; def.red = prgb->red; def.green = prgb->green; def.blue = prgb->blue; def.flags = ((1<<0)|(1<<1)|(1<<2)); if (client >= 0) pmap->freeRed--; def.pixel = Free; break; case 0: pent->co.local.red = prgb->red; def.red = prgb->red; def.green = pmap->green[0].co.local.green; def.blue = pmap->blue[0].co.local.blue; def.flags = (1<<0); if (client >= 0) pmap->freeRed--; def.pixel = Free << pmap->pVisual->offsetRed; break; case 1: pent->co.local.green = prgb->green; def.red = pmap->red[0].co.local.red; def.green = prgb->green; def.blue = pmap->blue[0].co.local.blue; def.flags = (1<<1); if (client >= 0) pmap->freeGreen--; def.pixel = Free << pmap->pVisual->offsetGreen; break; case 2: pent->co.local.blue = prgb->blue; def.red = pmap->red[0].co.local.red; def.green = pmap->green[0].co.local.green; def.blue = prgb->blue; def.flags = (1<<2); if (client >= 0) pmap->freeBlue--; def.pixel = Free << pmap->pVisual->offsetBlue; break; } (*pmap->pScreen->StoreColors) (pmap, 1, &def); pixel = Free; *pPixel = def.pixel; gotit: if (pmap->flags & 4 || client == -1) return(0); switch (channel) { case 3: case 0: nump = pmap->numPixelsRed; pixp = pmap->clientPixelsRed; break; case 1: nump = pmap->numPixelsGreen; pixp = pmap->clientPixelsGreen; break; case 2: nump = pmap->numPixelsBlue; pixp = pmap->clientPixelsBlue; break; } npix = nump[client]; ppix = (Pixel *) Xrealloc((pointer)(pixp[client]), (unsigned long)((npix + 1) * sizeof(Pixel))); if (!ppix) { pent->refcnt--; if (!pent->fShared) switch (channel) { case 3: case 0: pmap->freeRed++; break; case 1: pmap->freeGreen++; break; case 2: pmap->freeBlue++; break; } return(11); } ppix[npix] = pixel; pixp[client] = ppix; nump[client]++; return(0); } static int AllComp (EntryPtr pent, xrgb *prgb) { if((pent->co.local.red == prgb->red) && (pent->co.local.green == prgb->green) && (pent->co.local.blue == prgb->blue) ) return (1); return (0); } static int RedComp (EntryPtr pent, xrgb *prgb) { if (pent->co.local.red == prgb->red) return (1); return (0); } static int GreenComp (EntryPtr pent, xrgb *prgb) { if (pent->co.local.green == prgb->green) return (1); return (0); } static int BlueComp (EntryPtr pent, xrgb *prgb) { if (pent->co.local.blue == prgb->blue) return (1); return (0); } __attribute__((visibility("default"))) int QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) { Pixel *ppix, pixel; xrgb *prgb; VisualPtr pVisual; EntryPtr pent; Pixel i; int errVal = 0; pVisual = pmap->pVisual; if ((pmap->class | 1) == 5) { int numred, numgreen, numblue; Pixel rgbbad; numred = ((pVisual->redMask >> pVisual->offsetRed) + 1); numgreen = ((pVisual->greenMask >> pVisual->offsetGreen) + 1); numblue = ((pVisual->blueMask >> pVisual->offsetBlue) + 1); rgbbad = ~(pVisual->redMask | pVisual->greenMask | pVisual->blueMask | ((pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pVisual)->redMask|(pVisual)->greenMask|(pVisual)->blueMask))); for( ppix = ppixIn, prgb = prgbList; --count >= 0; ppix++, prgb++) { pixel = *ppix; if (pixel & rgbbad) { clientErrorValue = pixel; errVal = 2; continue; } i = (pixel & pVisual->redMask) >> pVisual->offsetRed; if (i >= numred) { clientErrorValue = pixel; errVal = 2; continue; } prgb->red = pmap->red[i].co.local.red; i = (pixel & pVisual->greenMask) >> pVisual->offsetGreen; if (i >= numgreen) { clientErrorValue = pixel; errVal = 2; continue; } prgb->green = pmap->green[i].co.local.green; i = (pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (i >= numblue) { clientErrorValue = pixel; errVal = 2; continue; } prgb->blue = pmap->blue[i].co.local.blue; } } else { for( ppix = ppixIn, prgb = prgbList; --count >= 0; ppix++, prgb++) { pixel = *ppix; if (pixel >= pVisual->ColormapEntries) { clientErrorValue = pixel; errVal = 2; } else { pent = (EntryPtr)&pmap->red[pixel]; if (pent->fShared) { prgb->red = pent->co.shco.red->color; prgb->green = pent->co.shco.green->color; prgb->blue = pent->co.shco.blue->color; } else { prgb->red = pent->co.local.red; prgb->green = pent->co.local.green; prgb->blue = pent->co.local.blue; } } } } return (errVal); } static void FreePixels(ColormapPtr pmap, int client) { Pixel *ppix, *ppixStart; int n; int class; class = pmap->class; ppixStart = pmap->clientPixelsRed[client]; if (class & 1) { n = pmap->numPixelsRed[client]; for (ppix = ppixStart; --n >= 0; ) { FreeCell(pmap, *ppix, 0); ppix++; } } Xfree((pointer)(ppixStart)); pmap->clientPixelsRed[client] = (Pixel *) ((void *)0); pmap->numPixelsRed[client] = 0; if ((class | 1) == 5) { ppixStart = pmap->clientPixelsGreen[client]; if (class & 1) for (ppix = ppixStart, n = pmap->numPixelsGreen[client]; --n >= 0;) FreeCell(pmap, *ppix++, 1); Xfree((pointer)(ppixStart)); pmap->clientPixelsGreen[client] = (Pixel *) ((void *)0); pmap->numPixelsGreen[client] = 0; ppixStart = pmap->clientPixelsBlue[client]; if (class & 1) for (ppix = ppixStart, n = pmap->numPixelsBlue[client]; --n >= 0; ) FreeCell(pmap, *ppix++, 2); Xfree((pointer)(ppixStart)); pmap->clientPixelsBlue[client] = (Pixel *) ((void *)0); pmap->numPixelsBlue[client] = 0; } } int FreeClientPixels (pointer value, XID fakeid) { ColormapPtr pmap; colorResource *pcr = (colorResource *)value; pmap = (ColormapPtr) LookupIDByType(pcr->mid, ((RESTYPE)6)); if (pmap) FreePixels(pmap, pcr->client); Xfree((pointer)(pcr)); return 0; } int AllocColorCells (int client, ColormapPtr pmap, int colors, int planes, Bool contig, Pixel *ppix, Pixel *masks) { Pixel rmask, gmask, bmask, *ppixFirst, r, g, b; int n, class; int ok; int oldcount; colorResource *pcr = (colorResource *)((void *)0); class = pmap->class; if (!(class & 1)) return (11); oldcount = pmap->numPixelsRed[client]; if (pmap->class == 5) oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; if (!oldcount && (((int)(((pmap->mid) & (((1 << 8) - 1) << (29 - 8))) >> (29 - 8))) != client)) { pcr = (colorResource *) Xalloc((unsigned long)(sizeof(colorResource))); if (!pcr) return (11); } if (pmap->class == 5) { ok = AllocDirect (client, pmap, colors, planes, planes, planes, contig, ppix, &rmask, &gmask, &bmask); if(ok == 0) { for (r = g = b = 1, n = planes; --n >= 0; r += r, g += g, b += b) { while(!(rmask & r)) r += r; while(!(gmask & g)) g += g; while(!(bmask & b)) b += b; *masks++ = r | g | b; } } } else { ok = AllocPseudo (client, pmap, colors, planes, contig, ppix, &rmask, &ppixFirst); if(ok == 0) { for (r = 1, n = planes; --n >= 0; r += r) { while(!(rmask & r)) r += r; *masks++ = r; } } } if ((ok == 0) && pcr) { pcr->mid = pmap->mid; pcr->client = client; if (!AddResource(FakeClientID(client), ((RESTYPE)7), (pointer)pcr)) ok = 11; } else if (pcr) Xfree((pointer)(pcr)); return (ok); } int AllocColorPlanes (int client, ColormapPtr pmap, int colors, int r, int g, int b, Bool contig, Pixel *pixels, Pixel *prmask, Pixel *pgmask, Pixel *pbmask) { int ok; Pixel mask, *ppixFirst; Pixel shift; int i; int class; int oldcount; colorResource *pcr = (colorResource *)((void *)0); class = pmap->class; if (!(class & 1)) return (11); oldcount = pmap->numPixelsRed[client]; if (class == 5) oldcount += pmap->numPixelsGreen[client] + pmap->numPixelsBlue[client]; if (!oldcount && (((int)(((pmap->mid) & (((1 << 8) - 1) << (29 - 8))) >> (29 - 8))) != client)) { pcr = (colorResource *) Xalloc((unsigned long)(sizeof(colorResource))); if (!pcr) return (11); } if (class == 5) { ok = AllocDirect (client, pmap, colors, r, g, b, contig, pixels, prmask, pgmask, pbmask); } else { ok = AllocPseudo (client, pmap, colors, r + g + b, contig, pixels, &mask, &ppixFirst); if(ok == 0) { *prmask = *pgmask = *pbmask = 0; shift = 1; for (i = r; --i >= 0; shift += shift) { while (!(mask & shift)) shift += shift; *prmask |= shift; } for (i = g; --i >= 0; shift += shift) { while (!(mask & shift)) shift += shift; *pgmask |= shift; } for (i = b; --i >= 0; shift += shift) { while (!(mask & shift)) shift += shift; *pbmask |= shift; } if (!AllocShared(pmap, pixels, colors, r, g, b, *prmask, *pgmask, *pbmask, ppixFirst)) { (void)FreeColors(pmap, client, colors, pixels, mask); ok = 11; } } } if ((ok == 0) && pcr) { pcr->mid = pmap->mid; pcr->client = client; if (!AddResource(FakeClientID(client), ((RESTYPE)7), (pointer)pcr)) ok = 11; } else if (pcr) Xfree((pointer)(pcr)); return (ok); } static int AllocDirect (int client, ColormapPtr pmap, int c, int r, int g, int b, Bool contig, Pixel *pixels, Pixel *prmask, Pixel *pgmask, Pixel *pbmask) { Pixel *ppixRed, *ppixGreen, *ppixBlue; Pixel *ppix, *pDst, *p; int npix, npixR, npixG, npixB; Bool okR, okG, okB; Pixel *rpix = 0, *gpix = 0, *bpix = 0; npixR = c << r; npixG = c << g; npixB = c << b; if ((r >= 32) || (g >= 32) || (b >= 32) || (npixR > pmap->freeRed) || (npixR < c) || (npixG > pmap->freeGreen) || (npixG < c) || (npixB > pmap->freeBlue) || (npixB < c)) return 11; for(p = pixels; p < pixels + c; p++) *p = 0; ppixRed = (Pixel *)__builtin_alloca ((int)(npixR * sizeof(Pixel))); ppixGreen = (Pixel *)__builtin_alloca ((int)(npixG * sizeof(Pixel))); ppixBlue = (Pixel *)__builtin_alloca ((int)(npixB * sizeof(Pixel))); if (!ppixRed || !ppixGreen || !ppixBlue) { if (ppixBlue) do {} while(0); if (ppixGreen) do {} while(0); if (ppixRed) do {} while(0); return(11); } okR = AllocCP(pmap, pmap->red, c, r, contig, ppixRed, prmask); okG = AllocCP(pmap, pmap->green, c, g, contig, ppixGreen, pgmask); okB = AllocCP(pmap, pmap->blue, c, b, contig, ppixBlue, pbmask); if (okR && okG && okB) { rpix = (Pixel *) Xrealloc((pointer)(pmap->clientPixelsRed[client]), (unsigned long)((pmap->numPixelsRed[client] + (c << r)) * sizeof(Pixel))); if (rpix) pmap->clientPixelsRed[client] = rpix; gpix = (Pixel *) Xrealloc((pointer)(pmap->clientPixelsGreen[client]), (unsigned long)((pmap->numPixelsGreen[client] + (c << g)) * sizeof(Pixel))); if (gpix) pmap->clientPixelsGreen[client] = gpix; bpix = (Pixel *) Xrealloc((pointer)(pmap->clientPixelsBlue[client]), (unsigned long)((pmap->numPixelsBlue[client] + (c << b)) * sizeof(Pixel))); if (bpix) pmap->clientPixelsBlue[client] = bpix; } if (!okR || !okG || !okB || !rpix || !gpix || !bpix) { if (okR) for(ppix = ppixRed, npix = npixR; --npix >= 0; ppix++) pmap->red[*ppix].refcnt = 0; if (okG) for(ppix = ppixGreen, npix = npixG; --npix >= 0; ppix++) pmap->green[*ppix].refcnt = 0; if (okB) for(ppix = ppixBlue, npix = npixB; --npix >= 0; ppix++) pmap->blue[*ppix].refcnt = 0; do {} while(0); do {} while(0); do {} while(0); return(11); } *prmask <<= pmap->pVisual->offsetRed; *pgmask <<= pmap->pVisual->offsetGreen; *pbmask <<= pmap->pVisual->offsetBlue; ppix = rpix + pmap->numPixelsRed[client]; for (pDst = pixels, p = ppixRed; p < ppixRed + npixR; p++) { *ppix++ = *p; if(p < ppixRed + c) *pDst++ |= *p << pmap->pVisual->offsetRed; } pmap->numPixelsRed[client] += npixR; pmap->freeRed -= npixR; ppix = gpix + pmap->numPixelsGreen[client]; for (pDst = pixels, p = ppixGreen; p < ppixGreen + npixG; p++) { *ppix++ = *p; if(p < ppixGreen + c) *pDst++ |= *p << pmap->pVisual->offsetGreen; } pmap->numPixelsGreen[client] += npixG; pmap->freeGreen -= npixG; ppix = bpix + pmap->numPixelsBlue[client]; for (pDst = pixels, p = ppixBlue; p < ppixBlue + npixB; p++) { *ppix++ = *p; if(p < ppixBlue + c) *pDst++ |= *p << pmap->pVisual->offsetBlue; } pmap->numPixelsBlue[client] += npixB; pmap->freeBlue -= npixB; for (pDst = pixels; pDst < pixels + c; pDst++) *pDst |= ((pmap->pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pmap->pVisual)->redMask|(pmap->pVisual)->greenMask|(pmap->pVisual)->blueMask)); do {} while(0); do {} while(0); do {} while(0); return (0); } static int AllocPseudo (int client, ColormapPtr pmap, int c, int r, Bool contig, Pixel *pixels, Pixel *pmask, Pixel **pppixFirst) { Pixel *ppix, *p, *pDst, *ppixTemp; int npix; Bool ok; npix = c << r; if ((r >= 32) || (npix > pmap->freeRed) || (npix < c)) return(11); if(!(ppixTemp = (Pixel *)__builtin_alloca ((int)(npix * sizeof(Pixel))))) return(11); ok = AllocCP(pmap, pmap->red, c, r, contig, ppixTemp, pmask); if (ok) { ppix = (Pixel *)Xrealloc((pointer)(pmap->clientPixelsRed[client]), (unsigned long)((pmap->numPixelsRed[client] + npix) * sizeof(Pixel))); if (!ppix) { for (p = ppixTemp; p < ppixTemp + npix; p++) pmap->red[*p].refcnt = 0; return (11); } pmap->clientPixelsRed[client] = ppix; ppix += pmap->numPixelsRed[client]; *pppixFirst = ppix; pDst = pixels; for (p = ppixTemp; p < ppixTemp + npix; p++) { *ppix++ = *p; if(p < ppixTemp + c) *pDst++ = *p; } pmap->numPixelsRed[client] += npix; pmap->freeRed -= npix; } do {} while(0); return (ok ? 0 : 11); } # 1906 "colormap.c" static Bool AllocCP (ColormapPtr pmap, EntryPtr pentFirst, int count, int planes, Bool contig, Pixel *pixels, Pixel *pMask) { EntryPtr ent; Pixel pixel, base, entries, maxp, save; int dplanes, found; Pixel *ppix; Pixel mask; Pixel finalmask; dplanes = pmap->pVisual->nplanes; if (planes == 0) { ppix = pixels; ent = pentFirst; pixel = 0; while (--count >= 0) { while (ent->refcnt) { ent++; pixel++; } ent->refcnt = (-1); *ppix++ = pixel; ent->fShared = 0; } *pMask = 0; return (1); } else if (planes > dplanes) { return (0); } ent = pentFirst; for (mask = (((Pixel)1) << planes) - 1, base = 1, dplanes -= (planes - 1); --dplanes >= 0; mask += mask, base += base) { ppix = pixels; found = 0; pixel = 0; entries = pmap->pVisual->ColormapEntries - mask; while (pixel < entries) { save = pixel; maxp = pixel + mask + base; while (pixel != maxp && ent[pixel].refcnt == 0) pixel += base; if (pixel == maxp) { *ppix++ = save; found++; if (found == count) { while (--count >= 0) { pixel = pixels[count]; maxp = pixel + mask; while (1) { ent[pixel].refcnt = (-1); ent[pixel].fShared = 0; if (pixel == maxp) break; pixel += base; *ppix++ = pixel; } } *pMask = mask; return (1); } } pixel = save + 1; if (pixel & mask) pixel += mask; } } dplanes = pmap->pVisual->nplanes; if (contig || planes == 1 || dplanes < 3) return (0); # 2025 "colormap.c" finalmask = (((((Pixel)1)<<(planes-1)) - 1) << (dplanes-planes+1)) + (((Pixel)1)<<(dplanes-planes-1)); for (mask = (((Pixel)3) << (planes -1)) - 1; mask <= finalmask; mask++) { pixel = (mask >> 1) & 033333333333; pixel = mask - pixel - ((pixel >> 1) & 033333333333); if ((((pixel + (pixel >> 3)) & 030707070707) % 077) != planes) continue; ppix = pixels; found = 0; entries = pmap->pVisual->ColormapEntries - mask; base = ((mask) & (~(mask) + 1)); for (pixel = 0; pixel < entries; pixel++) { if (pixel & mask) continue; maxp = 0; while (ent[pixel + maxp].refcnt == 0) { if((maxp) == (mask)) break; (maxp) += (base); while((maxp) & ~(mask)) (maxp) += ((maxp) & ~(mask));; } if ((maxp < mask) || (ent[pixel + mask].refcnt != 0)) continue; *ppix++ = pixel; found++; if (found < count) continue; while (--count >= 0) { pixel = (pixels)[count]; maxp = 0; while (1) { ent[pixel + maxp].refcnt = (-1); ent[pixel + maxp].fShared = 0; if((maxp) == (mask)) break; (maxp) += (base); while((maxp) & ~(mask)) (maxp) += ((maxp) & ~(mask));; *ppix++ = pixel + maxp; } } *pMask = mask; return (1); } } return (0); } static Bool AllocShared (ColormapPtr pmap, Pixel *ppix, int c, int r, int g, int b, Pixel rmask, Pixel gmask, Pixel bmask, Pixel *ppixFirst) { Pixel *pptr, *cptr; int npix, z, npixClientNew, npixShared; Pixel basemask, base, bits, common; SHAREDCOLOR *pshared, **ppshared, **psharedList; npixClientNew = c << (r + g + b); npixShared = (c << r) + (c << g) + (c << b); psharedList = (SHAREDCOLOR **)__builtin_alloca ((int)(npixShared * sizeof(SHAREDCOLOR *))); if (!psharedList) return 0; ppshared = psharedList; for (z = npixShared; --z >= 0; ) { if (!(ppshared[z] = (SHAREDCOLOR *)Xalloc((unsigned long)(sizeof(SHAREDCOLOR))))) { for (z++ ; z < npixShared; z++) Xfree((pointer)(ppshared[z])); return 0; } } for(pptr = ppix, npix = c; --npix >= 0; pptr++) { basemask = ~(gmask | bmask); common = *pptr & basemask; if (rmask) { bits = 0; base = ((rmask) & (~(rmask) + 1)); while(1) { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == (common | bits)) { pmap->red[*cptr].fShared = 1; pmap->red[*cptr].co.shco.red = pshared; } } if((bits) == (rmask)) break; (bits) += (base); while((bits) & ~(rmask)) (bits) += ((bits) & ~(rmask));; } } else { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == common) { pmap->red[*cptr].fShared = 1; pmap->red[*cptr].co.shco.red = pshared; } } } basemask = ~(rmask | bmask); common = *pptr & basemask; if (gmask) { bits = 0; base = ((gmask) & (~(gmask) + 1)); while(1) { pshared = *ppshared++; pshared->refcnt = 1 << (r + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == (common | bits)) { pmap->red[*cptr].co.shco.green = pshared; } } if((bits) == (gmask)) break; (bits) += (base); while((bits) & ~(gmask)) (bits) += ((bits) & ~(gmask));; } } else { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == common) { pmap->red[*cptr].co.shco.green = pshared; } } } basemask = ~(rmask | gmask); common = *pptr & basemask; if (bmask) { bits = 0; base = ((bmask) & (~(bmask) + 1)); while(1) { pshared = *ppshared++; pshared->refcnt = 1 << (r + g); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == (common | bits)) { pmap->red[*cptr].co.shco.blue = pshared; } } if((bits) == (bmask)) break; (bits) += (base); while((bits) & ~(bmask)) (bits) += ((bits) & ~(bmask));; } } else { pshared = *ppshared++; pshared->refcnt = 1 << (g + b); for (cptr = ppixFirst, z = npixClientNew; --z >= 0; cptr++) { if ((*cptr & basemask) == common) { pmap->red[*cptr].co.shco.blue = pshared; } } } } do {} while(0); return 1; } __attribute__((visibility("default"))) int FreeColors (ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask) { int rval, result, class; Pixel rmask; class = pmap->class; if (pmap->flags & 2) return(10); if ((class | 1) == 5) { rmask = mask & (pmap->pVisual->redMask | pmap->pVisual->greenMask | pmap->pVisual->blueMask | ((pmap->pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pmap->pVisual)->redMask|(pmap->pVisual)->greenMask|(pmap->pVisual)->blueMask))); result = FreeCo(pmap, client, 0, count, pixels, mask & pmap->pVisual->redMask); rval = FreeCo(pmap, client, 1, count, pixels, mask & pmap->pVisual->greenMask); if(rval != 0) result = rval; rval = FreeCo(pmap, client, 2, count, pixels, mask & pmap->pVisual->blueMask); if(rval != 0) result = rval; } else { rmask = mask & ((((Pixel)1) << pmap->pVisual->nplanes) - 1); result = FreeCo(pmap, client, 3, count, pixels, rmask); } if ((mask != rmask) && count) { clientErrorValue = *pixels | mask; result = 2; } return (result); } # 2265 "colormap.c" static int FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixel mask) { Pixel *ppixClient, pixTest; int npixClient, npixNew, npix; Pixel bits, base, cmask, rgbbad; Pixel *pptr, *cptr; int n, zapped; int errVal = 0; int offset, numents; if (npixIn == 0) return (errVal); bits = 0; zapped = 0; base = ((mask) & (~(mask) + 1)); switch(color) { case 0: cmask = pmap->pVisual->redMask; rgbbad = ~(pmap->pVisual->redMask | pmap->pVisual->greenMask | pmap->pVisual->blueMask | ((pmap->pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pmap->pVisual)->redMask|(pmap->pVisual)->greenMask|(pmap->pVisual)->blueMask))); offset = pmap->pVisual->offsetRed; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsRed[client]; npixClient = pmap->numPixelsRed[client]; break; case 1: cmask = pmap->pVisual->greenMask; rgbbad = ~(pmap->pVisual->redMask | pmap->pVisual->greenMask | pmap->pVisual->blueMask | ((pmap->pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pmap->pVisual)->redMask|(pmap->pVisual)->greenMask|(pmap->pVisual)->blueMask))); offset = pmap->pVisual->offsetGreen; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsGreen[client]; npixClient = pmap->numPixelsGreen[client]; break; case 2: cmask = pmap->pVisual->blueMask; rgbbad = ~(pmap->pVisual->redMask | pmap->pVisual->greenMask | pmap->pVisual->blueMask | ((pmap->pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pmap->pVisual)->redMask|(pmap->pVisual)->greenMask|(pmap->pVisual)->blueMask))); offset = pmap->pVisual->offsetBlue; numents = (cmask >> offset) + 1; ppixClient = pmap->clientPixelsBlue[client]; npixClient = pmap->numPixelsBlue[client]; break; default: case 3: cmask = ~((Pixel)0); rgbbad = 0; offset = 0; numents = pmap->pVisual->ColormapEntries; ppixClient = pmap->clientPixelsRed[client]; npixClient = pmap->numPixelsRed[client]; break; } while (1) { for (pptr = ppixIn, n = npixIn; --n >= 0; pptr++) { pixTest = ((*pptr | bits) & cmask) >> offset; if ((pixTest >= numents) || (*pptr & rgbbad)) { clientErrorValue = *pptr | bits; errVal = 2; continue; } for (cptr = ppixClient, npix = npixClient; --npix >= 0 && *cptr != pixTest; cptr++) ; if (npix >= 0) { if (pmap->class & 1) { FreeCell(pmap, pixTest, color); } *cptr = ~((Pixel)0); zapped++; } else errVal = 10; } if((bits) == (mask)) break; (bits) += (base); while((bits) & ~(mask)) (bits) += ((bits) & ~(mask));; } if (zapped) { npixNew = npixClient - zapped; if (npixNew) { pptr = cptr = ppixClient; for(npix = 0; npix < npixNew; cptr++) { if (*cptr != ~((Pixel)0)) { *pptr++ = *cptr; npix++; } } pptr = (Pixel *)Xrealloc((pointer)(ppixClient), (unsigned long)(npixNew * sizeof(Pixel))); if (pptr) ppixClient = pptr; npixClient = npixNew; } else { npixClient = 0; Xfree((pointer)(ppixClient)); ppixClient = (Pixel *)((void *)0); } switch(color) { case 3: case 0: pmap->clientPixelsRed[client] = ppixClient; pmap->numPixelsRed[client] = npixClient; break; case 1: pmap->clientPixelsGreen[client] = ppixClient; pmap->numPixelsGreen[client] = npixClient; break; case 2: pmap->clientPixelsBlue[client] = ppixClient; pmap->numPixelsBlue[client] = npixClient; break; } } return (errVal); } __attribute__((visibility("default"))) int StoreColors (ColormapPtr pmap, int count, xColorItem *defs) { Pixel pix; xColorItem *pdef; EntryPtr pent, pentT, pentLast; VisualPtr pVisual; SHAREDCOLOR *pred, *pgreen, *pblue; int n, ChgRed, ChgGreen, ChgBlue, idef; int class, errVal = 0; int ok; class = pmap->class; if(!(class & 1) && !(pmap->flags & 4)) { return(10); } pVisual = pmap->pVisual; idef = 0; if((class | 1) == 5) { int numred, numgreen, numblue; Pixel rgbbad; numred = ((pVisual->redMask >> pVisual->offsetRed) + 1); numgreen = ((pVisual->greenMask >> pVisual->offsetGreen) + 1); numblue = ((pVisual->blueMask >> pVisual->offsetBlue) + 1); rgbbad = ~(pVisual->redMask | pVisual->greenMask | pVisual->blueMask | ((pVisual)->nplanes < 32 ? 0 : (CARD32) ~((pVisual)->redMask|(pVisual)->greenMask|(pVisual)->blueMask))); for (pdef = defs, n = 0; n < count; pdef++, n++) { ok = 1; (*pmap->pScreen->ResolveColor) (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual); if (pdef->pixel & rgbbad) { errVal = 2; clientErrorValue = pdef->pixel; continue; } pix = (pdef->pixel & pVisual->redMask) >> pVisual->offsetRed; if (pix >= numred) { errVal = 2; ok = 0; } else if (pmap->red[pix].refcnt != (-1)) { errVal = 10; ok = 0; } else if (pdef->flags & (1<<0)) { pmap->red[pix].co.local.red = pdef->red; } else { pdef->red = pmap->red[pix].co.local.red; } pix = (pdef->pixel & pVisual->greenMask) >> pVisual->offsetGreen; if (pix >= numgreen) { errVal = 2; ok = 0; } else if (pmap->green[pix].refcnt != (-1)) { errVal = 10; ok = 0; } else if (pdef->flags & (1<<1)) { pmap->green[pix].co.local.green = pdef->green; } else { pdef->green = pmap->green[pix].co.local.green; } pix = (pdef->pixel & pVisual->blueMask) >> pVisual->offsetBlue; if (pix >= numblue) { errVal = 2; ok = 0; } else if (pmap->blue[pix].refcnt != (-1)) { errVal = 10; ok = 0; } else if (pdef->flags & (1<<2)) { pmap->blue[pix].co.local.blue = pdef->blue; } else { pdef->blue = pmap->blue[pix].co.local.blue; } if(ok) { if(idef != n) defs[idef] = defs[n]; idef++; } else clientErrorValue = pdef->pixel; } } else { for (pdef = defs, n = 0; n < count; pdef++, n++) { ok = 1; if (pdef->pixel >= pVisual->ColormapEntries) { clientErrorValue = pdef->pixel; errVal = 2; ok = 0; } else if (pmap->red[pdef->pixel].refcnt != (-1)) { errVal = 10; ok = 0; } if(ok) { if(idef != n) defs[idef] = defs[n]; idef++; } else continue; (*pmap->pScreen->ResolveColor) (&pdef->red, &pdef->green, &pdef->blue, pmap->pVisual); pent = &pmap->red[pdef->pixel]; if(pdef->flags & (1<<0)) { if(pent->fShared) { pent->co.shco.red->color = pdef->red; if (pent->co.shco.red->refcnt > 1) ok = 0; } else pent->co.local.red = pdef->red; } else { if(pent->fShared) pdef->red = pent->co.shco.red->color; else pdef->red = pent->co.local.red; } if(pdef->flags & (1<<1)) { if(pent->fShared) { pent->co.shco.green->color = pdef->green; if (pent->co.shco.green->refcnt > 1) ok = 0; } else pent->co.local.green = pdef->green; } else { if(pent->fShared) pdef->green = pent->co.shco.green->color; else pdef->green = pent->co.local.green; } if(pdef->flags & (1<<2)) { if(pent->fShared) { pent->co.shco.blue->color = pdef->blue; if (pent->co.shco.blue->refcnt > 1) ok = 0; } else pent->co.local.blue = pdef->blue; } else { if(pent->fShared) pdef->blue = pent->co.shco.blue->color; else pdef->blue = pent->co.local.blue; } if(!ok) { pred = pent->co.shco.red; pgreen = pent->co.shco.green; pblue = pent->co.shco.blue; ChgRed = pdef->flags & (1<<0); ChgGreen = pdef->flags & (1<<1); ChgBlue = pdef->flags & (1<<2); pentLast = pmap->red + pVisual->ColormapEntries; for(pentT = pmap->red; pentT < pentLast; pentT++) { if(pentT->fShared && (pentT != pent)) { xColorItem defChg; # 2642 "colormap.c" defChg.flags = 0; if(ChgRed && pentT->co.shco.red == pred) { defChg.flags |= (1<<0); } if(ChgGreen && pentT->co.shco.green == pgreen) { defChg.flags |= (1<<1); } if(ChgBlue && pentT->co.shco.blue == pblue) { defChg.flags |= (1<<2); } if(defChg.flags != 0) { defChg.pixel = pentT - pmap->red; defChg.red = pentT->co.shco.red->color; defChg.green = pentT->co.shco.green->color; defChg.blue = pentT->co.shco.blue->color; (*pmap->pScreen->StoreColors) (pmap, 1, &defChg); } } } } } } if (idef != 0) ( *pmap->pScreen->StoreColors) (pmap, idef, defs); return (errVal); } int IsMapInstalled(Colormap map, WindowPtr pWin) { Colormap *pmaps; int imap, nummaps, found; pmaps = (Colormap *) __builtin_alloca ((int)(pWin->drawable.pScreen->maxInstalledCmaps * sizeof(Colormap))); if(!pmaps) return(0); nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) (pWin->drawable.pScreen, pmaps); found = 0; for(imap = 0; imap < nummaps; imap++) { if(pmaps[imap] == map) { found = 1; break; } } do {} while(0); return (found); }