1<?xml version="1.0" encoding="UTF-8" ?> 2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> 3 4<appendix id='Resource_File_Format'> 5<title>Resource File Format</title> 6<para> 7A resource file contains text representing the default resource values for an 8application or set of applications. 9</para> 10 11<para> 12The format of resource files is defined by 13<emphasis remap='I'>Xlib — C Language X Interface.</emphasis> and is reproduced here 14for convenience only. 15</para> 16 17<para>The format of a resource specification is</para> 18<informaltable frame='none'> 19 <?dbfo keep-together="always" ?> 20 <tgroup cols='2' align='left' colsep='0' rowsep='0'> 21 <colspec colwidth='0.3*' colname='c1'/> 22 <colspec colwidth='1.0*' colname='c2'/> 23 <tbody> 24 <row> 25 <entry>ResourceLine</entry> 26 <entry>= Comment | IncludeFile | ResourceSpec | <empty line></entry> 27 </row> 28 <row> 29 <entry>Comment</entry> 30 <entry>=“!” {<any character except null or newline>}</entry> 31 </row> 32 <row> 33 <entry>IncludeFile</entry> 34 <entry>= “#” WhiteSpace “include” WhiteSpace FileName WhiteSpace</entry> 35 </row> 36 <row> 37 <entry>FileName</entry> 38 <entry>= <valid filename for operating system></entry> 39 </row> 40 <row> 41 <entry>ResourceSpec</entry> 42 <entry>= WhiteSpace ResourceName WhiteSpace “:” WhiteSpace Value</entry> 43 </row> 44 <row> 45 <entry>ResourceName</entry> 46 <entry>= [Binding] {Component Binding} ComponentName</entry> 47 </row> 48 <row> 49 <entry>Binding</entry> 50 <entry>=“.” | “*”</entry> 51 </row> 52 <row> 53 <entry>WhiteSpace</entry> 54 <entry>= {<space> | <horizontal tab>}</entry> 55 </row> 56 <row> 57 <entry>Component</entry> 58 <entry>= “?” | ComponentName</entry> 59 </row> 60 <row> 61 <entry>ComponentName</entry> 62 <entry>= NameChar {NameChar}</entry> 63 </row> 64 <row> 65 <entry>NameChar</entry> 66 <entry>= “a”–“z” | “A”–“Z” | “0”–“9” | “_” | “-”</entry> 67 </row> 68 <row> 69 <entry>Value</entry> 70 <entry>={<any character except null or unescaped newline>}</entry> 71 </row> 72 </tbody> 73 </tgroup> 74</informaltable> 75 76<para> 77Elements separated by vertical bar (|) are alternatives. 78Curly braces ({...}) indicate zero or more repetitions 79of the enclosed elements. 80Square brackets ([...]) indicate that the enclosed element is optional. 81Quotes (“...”) are used around literal characters. 82</para> 83 84<para> 85If the last character on a line is a backslash (\), 86that line is assumed to continue on the next line. 87</para> 88 89<para> 90To allow a Value to begin with whitespace, 91the two-character sequence “\<emphasis remap='I'>space</emphasis>” (backslash followed by space) 92is recognized and replaced by a space character, 93and the two-character sequence “\<emphasis remap='I'>tab</emphasis>” 94(backslash followed by horizontal tab) 95is recognized and replaced by a horizontal tab character. 96</para> 97<para> 98To allow a Value to contain embedded newline characters, 99the two-character sequence “\n” is recognized and replaced by a 100newline character. 101To allow a Value to be broken across multiple lines in a text file, 102the two-character sequence “\<emphasis remap='I'>newline</emphasis>” 103(backslash followed by newline) is 104recognized and removed from the value. 105</para> 106<para> 107To allow a Value to contain arbitrary character codes, 108the four-character sequence “\<emphasis remap='I'>nnn</emphasis>”, 109where each <emphasis remap='I'>n</emphasis> is a digit character in the range of “0”–“7”, 110is recognized and replaced with a single byte that contains 111the octal value specified by the sequence. 112Finally, the two-character sequence “\\” is recognized 113and replaced with a single backslash. 114</para> 115</appendix> 116