Commit Graph

19 Commits

Author SHA1 Message Date
Keith Packard 69d8572ae4 Build required portions of registry.c automatically [v2]
Instead of making the inclusion of the registry code a global
conditional, split the registry into two pieces; the bits required by
the X-Resource extension (the resource names) and the bits required by
the XCSECURITY extension (the protocol names). Build each set of code
if the related extension is being built.

v2: Check for both XCSECURITY and XSELINUX.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-09-18 15:29:29 -07:00
Keith Packard a11fc2493e dix: Close protocol.txt after we're done loading extension names
Don't leave this file open during the whole server execution process;
close it once all of the extensions are initialized.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-09-18 15:29:27 -07:00
Peter Hutterer d3d4af5f9e dix: reset the registry before quitting
Heaps of these:
==2042== 15,360 bytes in 120 blocks are still reachable in loss record 94 of
97
==2042==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
==2042==    by 0x4C2A657: realloc (vg_replace_malloc.c:525)
==2042==    by 0x45FB91: double_size (registry.c:65)
==2042==    by 0x45FC97: RegisterRequestName (registry.c:85)
==2042==    by 0x460095: RegisterExtensionNames (registry.c:179)
==2042==    by 0x460729: dixResetRegistry (registry.c:334)
==2042==    by 0x5AC992: main (main.c:201)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-07 09:41:02 +10:00
Alan Coopersmith 1622dd8ab2 Use C99 designated initializers in dix registry
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-09 22:52:30 -07:00
Keith Packard 9838b7032e Introduce a consistent coding style
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-03-21 13:54:42 -07:00
Alan Coopersmith 2ddae8f0bd constify strings in resource name registry
LookupResourceName already returned a const char *, so just needed
to change the variable we're storing the list in to be a const char **
and then add const to the name argument to RegisterResourceName
(which just stores name in the array) and CreateNewResourceType
(which just passes name to RegisterResourceName).

Clears a bunch of gcc warnings of the form:
registry.c:319:5: warning: passing argument 2 of 'RegisterResourceName' discards qualifiers from pointer target type
registry.c:200:1: note: expected 'char *' but argument is of type 'const char *'

and from all the extensions:
damageext.c: In function 'DamageExtensionInit':
damageext.c:490:5: warning: passing argument 2 of 'CreateNewResourceType' discards qualifiers from pointer target type
../include/resource.h:159:26: note: expected 'char *' but argument is of type 'const char *'

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:08 -08:00
Mikhail Gusarov 3f3ff971ec Replace X-allocation functions with their C89 counterparts
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>
2010-05-13 00:22:37 +07:00
Jon TURNEY 9b18f7ac0b Cygwin/X: Tidy up some cosmetic issues in log strings
Tidy up some cosmetic issues in log strings:
- Add missing '\n'
- Fix some strings starting with '\n'
- Remove '\f' from some log strings

These all just look daft in a log with timestamps.

Also clarify log message about screen origin coordinates

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2010-03-16 13:55:20 +00:00
Eamon Walsh a470e8426e Correct outdated e-mail address in "Author" statements.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2009-09-02 17:56:52 -04:00
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
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-12-03 05:43:34 -02:00
Paulo Cesar Pereira de Andrade d6cbd4511e Export symbols defined in the sdk.
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-11-29 23:56:06 -02:00
Eamon Walsh a3ec226273 Fix a leak in the code that parses the protocol names.
Also added some comments.
Reported by Ben Gamari (bug #16492).
2008-06-24 22:00:55 -04:00
Eamon Walsh 54cb729ecc registry: Add a call for DTRACE compatibility. 2007-11-26 15:59:01 -05:00
Eamon Walsh decd5a7c60 registry: Rebase registry to use the server config file of protocol names. 2007-11-26 15:26:49 -05:00
Eamon Walsh 5f9095f0d2 registry: Remove synthetic bit from event types in lookup function. 2007-10-25 19:09:26 -04:00
Eamon Walsh 0388a59a6e Revert "registry: special case minor number when looking up core requests."
This reverts commit 31110d6837.

This is handled properly by StandardMinorOpcode().
2007-10-23 20:59:21 -04:00
Eamon Walsh 31110d6837 registry: special case minor number when looking up core requests. 2007-10-18 10:30:44 -04:00
Eamon Walsh e3fd90ae9c registry: Add "X11:" prefix to core protocol names. 2007-10-18 10:29:10 -04:00
Eamon Walsh 6adeba1730 dix: Add a new "registry" mechanism for registering string names of things.
Supports protocol requests, events, and errors, and resource names.
Modify XRES extension to use it.
2007-10-11 14:18:59 -04:00