12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTMost applications and toolkits do not make random probes into a resource database to fetchresources. The Xtoolkit access pattern for a resource database is quite stylized. Aseries of from1to20probes is made with only the last name/class differing in each probe. The XrmGetResourcefunction is at worst a 2 n algorithm, where n is the length of the name/class list. This canbe improved upon by the application programmer by prefetching a list of database levels thatmight match the first part of a name/class list.To obtain a list of database levels, use XrmQGetSearchList.typedef XrmHashTable *XrmSearchList;Bool XrmQGetSearchList(database, names, classes, list_return, list_length)XrmDatabase database;XrmNameList names;XrmClassList classes;XrmSearchList list_return;int list_length;databasenamesclasseslist_returnlist_lengthSpecifies the database that is to be used.Specifies a list of resource names.Specifies a list of resource classes.Returns a search list for further use. The caller must allocate sufficient space forthe list before calling XrmQGetSearchList.Specifies the number of entries (not the byte size) allocated for list_return.The XrmQGetSearchList function takes a list of names and classes and returns a list of databaselevels where a match might occur. The returned list is in best-to-worst order and uses the samealgorithm as XrmGetResource for determining precedence. If list_return was large enough forthe search list, XrmQGetSearchList returns True; otherwise, it returns False.The size of the search list that the caller must allocate is dependent upon the number of levels andwildcards in the resource specifiers that are stored in the database. The worst case length is 3 n ,where n is the number of name or class components in names or classes.When using XrmQGetSearchList followed by multiple probes for resources with a commonname and class prefix, only the common prefix should be specified in the name and class list toXrmQGetSearchList.To search resource database levels for a given resource, use XrmQGetSearchResource.393

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!