


XrmGetFileDatabase(3X11)			     XrmGetFileDatabase(3X11)
X11R5									X11R5



NAME
  XrmGetFileDatabase, XrmPutFileDatabase, XrmGetStringDatabase,	XrmLocaleOf-
  Database, XrmGetDatabase, XrmSetDatabase, XrmDestroyDatabase - retrieve and
  store	resource databases

SYNTAX
  XrmDatabase XrmGetFileDatabase(_f_i_l_e_n_a_m_e)
       char *_f_i_l_e_n_a_m_e;

  void XrmPutFileDatabase(_d_a_t_a_b_a_s_e, _s_t_o_r_e_d__d_b)
       XrmDatabase _d_a_t_a_b_a_s_e;
       char *_s_t_o_r_e_d__d_b;

  XrmDatabase XrmGetStringDatabase(_d_a_t_a)
       char *_d_a_t_a;

  char *XrmLocaleOfDatabase(_d_a_t_a_b_a_s_e)
	XrmDatabase _d_a_t_a_b_a_s_e;

  XrmDatabase XrmGetDatabase(_d_i_s_p_l_a_y)
	Display	*_d_i_s_p_l_a_y;

  void XrmSetDatabase(_d_i_s_p_l_a_y, _d_a_t_a_b_a_s_e)
	Display	*_d_i_s_p_l_a_y;
	XrmDatabase _d_a_t_a_b_a_s_e;

  void XrmDestroyDatabase(_d_a_t_a_b_a_s_e)
	XrmDatabase _d_a_t_a_b_a_s_e;

ARGUMENTS

  _f_i_l_e_n_a_m_e  Specifies the resource database file name.

  _d_a_t_a_b_a_s_e  Specifies the database that	is to be used.

  _s_t_o_r_e_d__d_b Specifies the file name for	the stored database.

  _d_a_t_a	    Specifies the database contents using a string.

  _d_a_t_a_b_a_s_e  Specifies the resource database.

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

DESCRIPTION
  The _X_r_m_G_e_t_F_i_l_e_D_a_t_a_b_a_s_e function opens	the specified file, creates a new
  resource database, and loads it with the specifications read in from the
  specified file.  The specified file must contain a sequence of entries in
  valid	ResourceLine format (see section 15.1).	 The file is parsed in the
  current locale, and the database is created in the current locale.  If it
  cannot open the specified file, _X_r_m_G_e_t_F_i_l_e_D_a_t_a_b_a_s_e returns NULL.


  The _X_r_m_P_u_t_F_i_l_e_D_a_t_a_b_a_s_e function stores a copy	of the specified database in
  the specified	file.  Text is written 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
  in the Host Portable Character Encoding, or containing values	that are not
  in the encoding of the database locale, are written in an implementation-
  dependent manner.  The order in which	entries	are written is implementation
  dependent.  Entries with representation types	other than ``String'' are
  ignored.

  The _X_r_m_G_e_t_S_t_r_i_n_g_D_a_t_a_b_a_s_e function creates a new database and stores the
  resources specified in the specified null-terminated string.	_X_r_m_G_e_t_S_t_r_i_n_g_-
  _D_a_t_a_b_a_s_e is similar to _X_r_m_G_e_t_F_i_l_e_D_a_t_a_b_a_s_e except that	it reads the informa-
  tion out of a	string instead of out of a file.  The string must contain a
  sequence of entries in valid ResourceLine format (see	section	15.1).	The
  string is parsed in the current locale, and the database is created in the
  current locale.

  If database is NULL, _X_r_m_D_e_s_t_r_o_y_D_a_t_a_b_a_s_e returns immediately.

  The _X_r_m_L_o_c_a_l_e_O_f_D_a_t_a_b_a_s_e function returns the name of the locale bound	to
  the specified	database, as a null-terminated string.	The returned locale
  name string is owned by Xlib and should not be modified or freed by the
  client.  Xlib	is not permitted to free the string until the database is
  destroyed.  Until the	string is freed, it will not be	modified by Xlib.

  The _X_r_m_G_e_t_D_a_t_a_b_a_s_e function returns the database associated with the speci-
  fied display.	 It returns NULL if a database has not yet been	set.

  The _X_r_m_S_e_t_D_a_t_a_b_a_s_e function associates the specified resource	database (or
  NULL)	with the specified display.  The database previously associated	with
  the display (if any) is not destroyed.  A client or toolkit may find this
  function convenient for retaining a database once it is constructed.

FILE SYNTAX
  The syntax of	a resource file	is a sequence of resource lines	terminated by
  newline characters or	end of file.  The syntax of an individual resource
  line is:

  ResourceLine	  =	  Comment | IncludeFile	| ResourceSpec | <empty	line>
  Comment =	  "!" {<any character except null or newline>}
  IncludeFile	  =	  "#" WhiteSpace "include" WhiteSpace FileName WhiteSpace
  FileName	  =	  <valid filename for operating	system>
  ResourceSpec	  =	  WhiteSpace ResourceName WhiteSpace ":" WhiteSpace Value
  ResourceName	  =	  [Binding] {Component Binding}	ComponentName
  Binding =	  "." |	"*"
  WhiteSpace	  =	  {<space> | <horizontal tab>}
  Component	  =	  "?" |	ComponentName
  ComponentName	  =	  NameChar {NameChar}
  NameChar	  =	  "a"-"z" | "A"-"Z" | "0"-"9" |	"_" | "-"
  Value	  =	  {<any	character except null or unescaped newline>}

  Elements separated by	vertical bar (|) are alternatives.  Curly braces
  ({...}) indicate zero	or more	repetitions of the enclosed elements.  Square
  brackets ([...]) indicate that the enclosed element is optional.  Quotes
  ("...") are used around literal characters.

  IncludeFile lines are	interpreted by replacing the line with the contents
  of the specified file.  The word "include" must be in	lowercase.  The
  filename is interpreted relative to the directory of the file	in which the
  line occurs (for example, if the filename contains no	directory or contains
  a relative directory specification).

  If a ResourceName contains a contiguous sequence of two or more Binding
  characters, the sequence will	be replaced with single	"." character if the
  sequence contains only "." characters, otherwise the sequence	will be
  replaced with	a single "*" character.

  A resource database never contains more than one entry for a given Resour-
  ceName.  If a	resource file contains multiple	lines with the same Resour-
  ceName, the last line	in the file is used.

  Any whitespace character before or after the name or colon in	a Resour-
  ceSpec are ignored.  To allow	a Value	to begin with whitespace, the two-
  character sequence ``\_s_p_a_c_e''	(backslash followed by space) is recognized
  and replaced by a space character, and the two-character sequence ``\_t_a_b''
  (backslash followed by horizontal tab) is recognized and replaced by a hor-
  izontal tab character.  To allow a Value to contain embedded newline char-
  acters, the two-character sequence ``\n'' is recognized and replaced by a
  newline character.  To allow a Value to be broken across multiple lines in
  a text file, the two-character sequence ``\_n_e_w_l_i_n_e'' (backslash followed by
  newline) is recognized and removed from the value.  To allow a Value to
  contain arbitrary character codes, the four-character	sequence ``\_n_n_n'',
  where	each _n is a digit character in the range of ``0''-``7'', is recog-
  nized	and replaced with a single byte	that contains the octal	value speci-
  fied by the sequence.	 Finally, the two-character sequence ``\\'' is recog-
  nized	and replaced with a single backslash.

SEE ALSO
  XrmGetResource(3X11),	XrmInitialize(3X11), XrmPutResource(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e















































