📄 looking-up.html
字号:
<HTML><HEAD><TITLE>Xlib Programming Manual: Looking Up Resources</TITLE></HEAD><BODY><H1 ALIGN=center>15.6 Looking Up Resources</H1>To retrieve a resource from a resource database, use<B><A HREF="XrmGetResource.html">XrmGetResource()</A></B>,<B><A HREF="XrmQGetResource.html">XrmQGetResource()</A></B>,or<B><A HREF="XrmQGetSearchResource.html">XrmQGetSearchResource()</A></B>.<P>The database only frees or overwrites entries on<B><A HREF="XrmPutResource.html">XrmPutResource()</A></B>, <B><A HREF="XrmQPutResource.html">XrmQPutResource()</A></B>,or <B><A HREF="XrmMergeDatabases.html">XrmMergeDatabases()</A></B>.A client that is not storing new values into the database oris not merging the database should be safe using the address passed back at any time until it exits.If a resource was found, both<B><A HREF="XrmGetResource.html">XrmGetResource()</A></B>and<B><A HREF="XrmQGetResource.html">XrmQGetResource()</A></B>return <B>True</B>;otherwise, they return <B>False</B>.<P>Most applications and toolkits do not make random probesinto a resource database to fetch resources.The X toolkit access pattern for a resource database is quite stylized.A series of from 1 to 20 probes are made with only the last name/class differing in each probe.The <B><A HREF="XrmGetResource.html">XrmGetResource()</A></B>function is at worst a <I>2<SUP>n</SUP></I> algorithm,where <I>n</I> is the length of the name/class list.This can be improved upon by the application programmer by prefetching a listof database levels that might match the first part of a name/class list.<P>To obtain a list of database levels, use<B><A HREF="XrmQGetSearchList.html">XrmQGetSearchList()</A></B>.<P>To search resource database levels for a given resource, use<B><A HREF="XrmQGetSearchResource.html">XrmQGetSearchResource()</A></B>.<H5 ALIGN=right><I>Next: <A HREF="storing.html">Storing Into a Resource Database</A></I></H5><HR><ADDRESS><A HREF="http://tronche.com/">Christophe Tronche</A>, <A HREF="mailto:ch.tronche@computer.org">ch.tronche@computer.org</A></ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -