12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTis specified in bytes. The representation type is a way for you to store data tagged by some application-definedtype (for example, the strings ‘‘font’’ or‘‘color’’). It has nothing to do with the Cdata type or with its class. The XrmValue structure is defined as:typedef struct {unsigned int size;XPointer addr;}XrmValue, *XrmValuePtr;To initialize the resource manager, use XrmInitialize.void XrmInitialize();To retrieve a database from disk, use XrmGetFileDatabase.XrmDatabase XrmGetFileDatabase(filename)char *filename;filenameSpecifies the resource database file name.The XrmGetFileDatabase function opens the specified file, creates a new resource database, andloads it with the specifications read in from the specified file. The specified file should contain asequence of entries in valid ResourceLine format (see section 15.1); the database that results fromreading a file with incorrect syntax is implementation-dependent. The file is parsed in the currentlocale, and the database is created in the current locale. If it cannot open the specified file,XrmGetFileDatabase returns NULL.To store a copy ofadatabase to disk, use XrmPutFileDatabase.void XrmPutFileDatabase(database, stored_db)XrmDatabase database;char *stored_db;databasestored_dbSpecifies the database that is to be used.Specifies the file name for the stored database.The XrmPutFileDatabase function stores a copy ofthe specified database in the specified file.Te xtiswritten to the file as a sequence of entries in valid ResourceLine format (see section 15.1).The file is written in the locale of the database. Entries containing resource names that are not inthe Host Portable Character Encoding or containing values that are not in the encoding of thedatabase locale, are written in an implementation-dependent manner. The order in which entriesare written is implementation-dependent. Entries with representation types other than ‘‘String’’are ignored.To obtain a pointer to the screen-independent resources of a display, use XResourceManager-String.388

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

Saved successfully!

Ooh no, something went wrong!