summaryrefslogtreecommitdiff
path: root/dix/property.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-12Replace 'pointer' type with 'void *'Keith Packard1-2/+2
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-09Use C99 designated initializers in dix EventsAlan Coopersmith1-7/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Use C99 designated initializers in dix RepliesAlan Coopersmith1-29/+33
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09Rework reply initialization in ProcGetProperty & NullPropertyReplyAlan Coopersmith1-13/+18
Don't need to pass an empty reply to NullPropertyReply, let it make it's own. Move reply initialization code in remaining replies in ProcGetProperty to group with the rest of the fields. (Prepares for coming C99 designated initializer conversion.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-03-21Introduce a consistent coding styleKeith Packard1-263/+243
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-01-09Revert "dix: don't return BadMatch from GetProperty (#23562)"Chris Halse Rogers1-1/+1
This reverts commit f04fe06ae244b851b38be824b1a80f2f8a030591. dixLookupWindow no longer returns BadMatch. No other caller was checking for it, so this problem is now fixed in the utility function. Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-12-31DIX: Reset window properties when freeing themDaniel Stone1-0/+3
This enables us to reliably inspect properties when destroying windows. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org>
2010-09-10Fix property and selection devPrivate allocation.Eamon Walsh1-1/+0
Selection objects were not being allocated with privates, and both objects had a stray statement that zeroed out the devPrivates field. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reported-by: Justin Mattock <justinmattock@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-16/+16
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Change the devPrivates API to require dixRegisterPrivateKeyKeith Packard1-9/+6
This patch only changes the API, not the implementation of the devPrivates infrastructure. This will permit a new devPrivates implementation to be layed into the server without requiring simultaneous changes in every devPrivates user. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-05-13Eliminate boilerplate around client->noClientException.Jamey Sharp1-9/+5
Just let Dispatch() check for a noClientException, rather than making every single dispatch procedure take care of it. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-22/+22
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-03dix: don't return BadMatch from GetProperty (#23562)Peter Hutterer1-1/+1
dixLookupWindow may return BadMatch if the window in question isn't actually a window. In this case, GetProperty needs to return BadWindow - not BadMatch. X.Org Bug 23562 <http://bugs.freedesktop.org/show_bug.cgi?id=23562> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-22Check if new space was actually allocated before freeing.Pierre Willenbrock1-3/+8
There will be no new space allocated, if mode != PropModeReplace and len == 0, or if mode is not one of the handled modes. This fixes freeing data that is still in use, leading to double frees and other memory corruption. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-14dix: switch to byte-counting functions.Peter Hutterer1-3/+3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-06-30dix/property.c: use memcpy where appropriate.Eamon Walsh1-11/+6
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-06-26xace: add a new hook for checking property content after it has been set.Eamon Walsh1-10/+22
Allows security modules to enforce what property contents can be set by clients. Uses the new DixPostAccess bit to distinguish between the existing call made during the lookup (with the old property data) and this new call. Note that this only applies to writes, prepends, or appends to existing properties; for new properties the existing DixCreateAccess hook call may be used since it includes the new data. Refer to the XACE-Spec document in xorg-docs, section "Property Access." Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-02-16xserver: Avoid sending uninitialized padding data over the networkPeter Åstrand1-0/+2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-01-22Remove a bunch of useless casts.Adam Jackson1-6/+6
We've had void * for twenty years now people let's try to act like we know how it works.
2008-12-12Remove #define NEED_EVENTS and NEED_REPLIESPeter Hutterer1-2/+0
A grep on xorg/* revealed there's no consumer of this define. Quote Alan Coopersmith: "The consumer was in past versions of the headers now located in proto/x11proto - for instance, in X11R6.0's xc/include/Xproto.h, all the event definitions were only available if NEED_EVENTS were defined, and all the reply definitions required NEED_REPLIES. Looks like Xproto.h dropped them by X11R6.3, which didn't have the #ifdef's anymore, so these are truly ancient now." Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-5/+5
Save in a few special cases, _X_EXPORT should not be used in C source files. Instead, it should be used in headers, and the proper C source include that header. Some special cases are symbols that need to be shared between modules, but not expected to be used by external drivers, and symbols that are accessible via LoaderSymbol/dlopen. This patch also adds conditionally some new sdk header files, depending on extensions enabled. These files were added to match pattern for other extensions/modules, that is, have the headers "deciding" symbol visibility in the sdk. These headers are: o Xext/panoramiXsrv.h, Xext/panoramiX.h o fbpict.h (unconditionally) o vidmodeproc.h o mioverlay.h (unconditionally, used only by xaa) o xfixes.h (unconditionally, symbols required by dri2) LoaderSymbol and similar functions now don't have different prototypes, in loaderProcs.h and xf86Module.h, so that both headers can be included, without the need of defining IN_LOADER. xf86NewInputDevice() device prototype readded to xf86Xinput.h, but not exported (and with a comment about it).
2008-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-2/+2
This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode()
2008-04-07Merge branch 'master' into dcdc_reworkPeter Hutterer1-118/+107
Conflicts: Xext/xevie.c dix/dispatch.c
2008-03-04Merge branch 'master' into mpxPeter Hutterer1-9/+7
This merge reverts Magnus' device coorindate scaling changes. MPX core event generation is very different, so we can't scale in GetPointerEvents. Conflicts: Xi/opendev.c dix/devices.c dix/dixfonts.c dix/getevents.c dix/resource.c dix/window.c hw/xfree86/common/xf86Xinput.c mi/mipointer.c xkb/ddxBeep.c xkb/ddxCtrls.c xkb/ddxKeyClick.c xkb/ddxList.c xkb/ddxLoad.c xkb/xkb.c xkb/xkbAccessX.c xkb/xkbEvents.c xkb/xkbInit.c xkb/xkbPrKeyEv.c xkb/xkbUtils.c
2008-02-29XACE: Add generic support for property and selection polyinstantiation.Eamon Walsh1-4/+6
2008-02-29dix: Refactoring of property code to allow for polyinstantiation.Eamon Walsh1-117/+104
Introduces dixLookupProperty() API.
2008-02-05XACE: Move the property access hook to its own function.Eamon Walsh1-9/+7
2008-01-03Merge branch 'master' into mpxPeter Hutterer1-70/+85
Conflicts: XTrap/xtrapddmi.c Xext/security.c Xext/xprint.c Xext/xtest.c Xext/xvdisp.c Xi/exevents.c Xi/grabdevb.c Xi/grabdevk.c Xi/opendev.c Xi/ungrdev.c Xi/ungrdevb.c Xi/ungrdevk.c dix/cursor.c dix/devices.c dix/dixutils.c dix/events.c dix/getevents.c dix/main.c dix/window.c hw/xfree86/ramdac/xf86Cursor.c include/dix.h include/input.h include/inputstr.h mi/midispcur.c mi/miinitext.c mi/misprite.c render/animcur.c xfixes/cursor.c xkb/xkbAccessX.c
2007-11-07Merge branch 'master' into mpxPeter Hutterer1-8/+8
Conflicts: Xi/extinit.c Xi/grabdev.c Xi/setmode.c Xi/ungrdev.c dix/devices.c dix/events.c dix/getevents.c include/dix.h mi/midispcur.c mi/misprite.c xkb/xkbActions.c xkb/xkbEvents.c xkb/xkbPrKeyEv.c
2007-11-05Merge branch 'master' into XACE-SELINUXEamon Walsh1-8/+8
Conflicts: dix/dispatch.c dix/property.c hw/xfree86/common/xf86VidMode.c include/xkbsrv.h render/glyph.c xkb/xkbActions.c
2007-11-05DIX: Remove usage of allocaDaniel Stone1-8/+8
Replace with heap allocations.
2007-10-10xace: move the property deletion hook inside the DeleteProperty function.Eamon Walsh1-9/+8
2007-10-10xace: remove the special-cased "ignore" functionality from the property code.Eamon Walsh1-6/+5
There will be no more faking of Success to hide things. XACE does not provide polyinstantiation.
2007-09-26dix: unify ErrorFs. prepend all with [dix].Peter Hutterer1-4/+4
2007-08-15xace: add hooks + new access codes: core protocol property requestsEamon Walsh1-8/+11
2007-08-02Merge branch 'master' into XACE-SELINUXEamon Walsh1-43/+21
Conflicts: dix/devices.c dix/property.c include/dix.h
2007-07-21Partial redundancy elimination in PropertyNotify generation.Adam Jackson1-43/+21
2007-04-17xace: change the semantics of the return value of XACE hooks to allowEamon Walsh1-40/+24
arbitrary X status codes instead of just TRUE/FALSE. The dix layer in most cases still does not propagate the return value of XACE hooks back to the client, however. There is more error propagation work to do.
2007-03-26Merge branch 'master' into XACE-SELINUXEamon Walsh1-3/+3
2007-03-23xace: pass serverClient as default argument to dixChangeWindowPropertyEamon Walsh1-1/+1
instead of NullClient.
2007-03-22xace: drop the name argument from the property callback.Eamon Walsh1-8/+6
2007-03-22dix: reorganize property code to better support xace hook; requires new API forEamon Walsh1-17/+38
changing a property, dixChangeWindowProperty, taking an additional client argument.
2007-03-22xace: add new argument to property hook for property structure itself.Eamon Walsh1-30/+37
2007-03-22dix: devPrivates support for PropertyRec.Eamon Walsh1-0/+4
2007-03-08dix: remove 'register' keyword for all variables.Peter Hutterer1-3/+3
2006-12-15Convert callers of SecurityLookupWindow() to dixLookupWindow().Eamon Walsh1-26/+19
2006-12-14Naming change: Security*Access -> Dix*AccessEamon Walsh1-10/+10
2006-12-01Naming change: Security*Operation -> Xace*OperationEamon Walsh1-8/+8
2006-12-01Define calls away when not building XACE, allowing ifdef's to be removed.Eamon Walsh1-47/+28
2006-08-10Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into ↵Alan Coopersmith1-2/+0
XACE-modular