<s>
In	O
the	O
X	B-Operating_System
Window	I-Operating_System
System	I-Operating_System
,	O
the	O
X	B-Device
resources	I-Device
are	O
parameters	O
of	O
computer	B-Application
programs	I-Application
such	O
as	O
the	O
name	O
of	O
the	O
font	O
used	O
in	O
the	O
buttons	O
,	O
the	O
background	O
color	O
of	O
menus	O
,	O
etc	O
.	O
</s>
<s>
They	O
are	O
used	O
in	O
conjunction	O
with	O
or	O
as	O
an	O
alternative	O
to	O
command	B-Application
line	I-Application
parameters	O
and	O
configuration	B-Protocol
files	I-Protocol
.	O
</s>
<s>
At	O
the	B-Protocol
X	I-Protocol
protocol	I-Protocol
level	O
,	O
resources	O
are	O
strings	O
that	O
are	O
stored	O
in	O
the	O
server	O
and	O
have	O
no	O
special	O
meaning	O
.	O
</s>
<s>
Every	O
X	B-Device
resource	I-Device
specifies	O
a	O
parameter	O
for	O
a	O
program	O
or	O
one	O
of	O
its	O
components	O
.	O
</s>
<s>
Since	O
these	O
widgets	O
are	O
arranged	O
in	O
a	O
tree	B-Application
,	O
the	O
sequence	O
of	O
component/subcomponent	O
names	O
is	O
used	O
to	O
identify	O
a	O
widget	O
by	O
giving	O
its	O
path	O
within	O
the	O
tree	B-Application
.	O
</s>
<s>
X	B-Device
resources	I-Device
are	O
also	O
used	O
to	O
specify	O
parameters	O
for	O
the	O
program	O
that	O
are	O
not	O
directly	O
related	O
to	O
its	O
widgets	O
,	O
using	O
the	O
same	O
syntax	O
.	O
</s>
<s>
X	B-Device
resources	I-Device
are	O
designed	O
to	O
allow	O
the	O
same	O
parameter	O
to	O
be	O
specified	O
for	O
more	O
than	O
one	O
program	O
or	O
component	O
.	O
</s>
<s>
This	O
is	O
realized	O
by	O
allowing	O
wildcard	B-Algorithm
characters	I-Algorithm
in	O
a	O
resource	O
specification	O
.	O
</s>
<s>
In	O
particular	O
,	O
the	O
?	B-Device
</s>
<s>
The	O
*	B-Language
character	O
is	O
used	O
to	O
match	O
any	O
number	O
of	O
components	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
an	O
attribute	O
cannot	O
be	O
replaced	O
by	O
a	O
wildcard	B-Algorithm
character	I-Algorithm
.	O
</s>
<s>
While	O
the	O
resources	O
can	O
be	O
loosely	O
specified	O
via	O
the	O
wildcard	B-Algorithm
characters	I-Algorithm
,	O
queries	O
for	O
the	O
value	O
of	O
a	O
resource	O
must	O
specify	O
that	O
resource	O
exactly	O
.	O
</s>
<s>
However	O
,	O
when	O
a	O
program	O
(	O
e.g.	O
,	O
the	O
xmail	O
program	O
itself	O
,	O
when	O
it	O
wants	O
to	O
find	O
out	O
which	O
background	O
color	O
to	O
use	O
)	O
accesses	O
the	O
resource	O
database	O
via	O
Xlib	B-Language
functions	O
,	O
it	O
can	O
only	O
request	O
the	O
value	O
of	O
a	O
specific	O
resource	O
.	O
</s>
<s>
Contrary	O
to	O
most	O
databases	O
,	O
the	O
stored	O
data	O
can	O
be	O
specified	O
loosely	O
(	O
via	O
wildcard	B-Algorithm
characters	I-Algorithm
)	O
,	O
but	O
the	O
interrogation	O
cannot	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
program	O
can	O
query	O
for	O
the	O
value	O
of	O
xmail.main.background	O
or	O
of	O
xmail.toc.buttons.background	O
,	O
but	O
cannot	O
use	O
?	B-Device
</s>
<s>
or	O
*	B-Language
to	O
check	O
the	O
background	O
color	O
of	O
several	O
components	O
at	O
once	O
.	O
</s>
<s>
During	O
X	B-Operating_System
display	O
server	O
execution	O
,	O
the	O
X	B-Device
resources	I-Device
are	O
stored	O
in	O
two	O
standard	O
locations	O
,	O
depending	O
on	O
whether	O
they	O
apply	O
to	O
all	O
screens	O
or	O
to	O
a	O
particular	O
one	O
:	O
</s>
<s>
X	B-Device
resources	I-Device
are	O
stored	O
in	O
the	O
server	O
rather	O
than	O
in	O
a	O
configuration	B-Protocol
file	I-Protocol
to	O
allow	O
programs	O
started	O
from	O
other	O
computers	O
to	O
use	O
them	O
.	O
</s>
<s>
Indeed	O
,	O
a	O
program	O
connecting	O
to	O
an	O
X	B-Operating_System
display	O
server	O
from	O
another	O
computer	O
can	O
access	O
the	O
resources	O
via	O
the	B-Protocol
X	I-Protocol
protocol	I-Protocol
.	O
</s>
<s>
Resources	O
are	O
manipulated	O
by	O
the	O
xrdb	B-Device
program	O
.	O
</s>
<s>
In	O
particular	O
,	O
many	O
X	B-Operating_System
display	O
server	O
configurations	O
run	O
xrdb	B-Device
at	O
start	O
up	O
,	O
instructing	O
it	O
to	O
read	O
the	O
resources	O
from	O
the	O
.Xresources	B-Device
file	O
in	O
the	O
user	O
's	O
home	B-Application
directory	I-Application
.	O
</s>
<s>
You	O
can	O
view	O
the	O
current	O
resources	O
from	O
a	O
console	O
with	O
xrdb	B-Device
-query	O
.	O
</s>
<s>
Xlib	B-Language
contains	O
a	O
number	O
of	O
convenience	B-General_Concept
functions	I-General_Concept
for	O
accessing	O
the	O
resources	O
on	O
the	O
server	O
and	O
manipulating	O
them	O
locally	O
.	O
</s>
<s>
These	O
functions	O
are	O
used	O
both	O
by	O
xrdb	B-Device
and	O
by	O
every	O
other	O
program	O
that	O
needs	O
these	O
resources	O
.	O
</s>
<s>
The	O
Xlib	B-Language
functions	O
for	O
resource	O
management	O
are	O
:	O
</s>
<s>
In	O
particular	O
,	O
the	O
function	O
XrmParseCommand	O
allow	O
parsing	O
the	O
command	B-Application
line	I-Application
arguments	O
,	O
reading	O
resources	O
that	O
are	O
then	O
added	O
to	O
a	O
local	O
resource	O
database	O
.	O
</s>
<s>
This	O
way	O
,	O
the	O
resources	O
can	O
be	O
read	O
from	O
the	O
server	O
and	O
used	O
as	O
defaults	O
that	O
are	O
overridden	O
by	O
command	B-Application
line	I-Application
arguments	O
.	O
</s>
<s>
For	O
the	O
sake	O
of	O
efficiency	O
,	O
integers	O
called	O
quarks	B-Device
are	O
defined	O
to	O
represent	O
local	O
strings	O
.	O
</s>
<s>
Quarks	B-Device
are	O
similar	O
to	O
atoms	O
,	O
but	O
they	O
represent	O
strings	O
stored	O
locally	O
rather	O
than	O
on	O
the	O
server	O
.	O
</s>
<s>
A	O
number	O
of	O
Xlib	B-Language
functions	O
create	O
an	O
association	O
between	O
strings	O
and	O
quarks	B-Device
.	O
</s>
<s>
Quarks	B-Device
can	O
be	O
used	O
in	O
place	O
of	O
component	O
names	O
when	O
using	O
one	O
of	O
the	O
above	O
functions	O
;	O
resource	O
names	O
therefore	O
correspond	O
to	O
quark	B-Device
lists	O
.	O
</s>
