Files
modules/xref/cmdXResource.c.html
2006-01-18 05:27:50 +00:00

990 lines
40 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- This HTML file generated by cxref (version 1.6a). -->
<!-- cxref program (c) Andrew M. Bishop 1995,96,97,98,99,2000,01,02,03,04,05. -->
<!--
Cxref: cxref -block-comments -verbatim-comments -xref-all -index-all -html-src -Oxref cmdXResource.c
CPP : cxref-cpp -lang-c -C -dD -dI
-->
<HTML>
<HEAD>
<TITLE>Cross reference for cmdXResource.c of cxref.</TITLE>
<LINK rel="stylesheet" href="cxref.css" type="text/css">
</HEAD>
<BODY>
<h1><a name="file" href="cmdXResource.c.src.html">File cmdXResource.c</a></h1>
<pre>
** ** Module Header ******************************************************* **
** **
** Modules Revision 3.0 **
** Providing a flexible user environment **
** **
** File: cmdXResource.c **
** First Edition: 1991/10/23 **
** **
** Authors: John Furlan, jlf@behere.com **
** Leif Hedstrom&lt;hedstrom"@boot.org&gt; **
** Jens Hamisch, jens@Strawberry.COM **
** **
** Description: Module command to merge/remove resources from the X11**
** resource manager. The database is update internally, **
** ie. its not done at evaluation of string modulecmd **
** returns. It will do something like "xrdb -merge" **
** using the default display ($DISPLAY). **
** **
** Exports: xresourceFinish **
** cmdXResource **
** **
** Notes: Fragments of this code are from the original xrdb **
** source, Copyright 1987 &amp; 1991 by DIGITAL EQUIPMENT **
** CORPORATION. Xrdb was written and modified by: **
** **
** Jim Gettys, August 28, 1987 **
** Phil Karlton, January 5, 1987 **
** Bob Scheifler, February, 1991 **
** **
** ToDo/Bugs: + The command only handles screen independant re- **
** sources. **
** ************************************************************************ **
</pre>
<table>
<tr>
<td>References Variables:
<td><a href="cmdXResource.c.html#var-Id">Id</a>
<td><a href="cmdXResource.c.html#var-Id">cmdXResource.c</a>
</tr>
</table>
<hr>
<h2>Included Files</h2>
<ul class="cxref-include">
<li class="cxref-include-local"><tt><span class="cxref-include-local"><a href="modules_def.h.html#file">#include "modules_def.h"</a></span></tt>
<ul class="cxref-include">
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdio.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdarg.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;tcl.h&gt;</span></tt>
<li class="cxref-include-local"><tt><span class="cxref-include-local"><a href="config.h.html#file">#include "config.h"</a></span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;stdlib.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;string.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;unistd.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/types.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;ctype.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/stat.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/termios.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;fcntl.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;sys/ioctl.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;dirent.h&gt;</span></tt>
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;errno.h&gt;</span></tt>
</ul>
</ul>
<ul class="cxref-include">
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;X11/Xlib.h&gt;</span></tt>
</ul>
<ul class="cxref-include">
<li class="cxref-include-system"><tt><span class="cxref-include-system">#include &lt;X11/Xatom.h&gt;</span></tt>
</ul>
<hr>
<h2>Preprocessor definitions</h2>
<tt><span class="cxref-define"><a href="cmdXResource.c.src.html#line85">#define MAXHOSTNAME</a> 255</span></tt><br>
<p>
<tt><span class="cxref-define"><a href="cmdXResource.c.src.html#line86">#define Resolution</a>( pixels, mm )</span></tt><br>
<hr>
<h2><a name="type-ResourceDB">Typedef ResourceDB</a></h2>
<tt><span class="cxref-type"><a href="cmdXResource.c.src.html#line62">typedef struct _ResourceDB ResourceDB</a></span></tt><br>
<table>
<tr>
<td><tt><span class="cxref-type">struct _ResourceDB</span></tt>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;<tt><span class="cxref-type">{</span></tt>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<tt><span class="cxref-type">Tcl_HashTable* data;</span></tt>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<tt><span class="cxref-type">Window root;</span></tt>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<tt><span class="cxref-type">Atom prop;</span></tt>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;<tt><span class="cxref-type">}</span></tt>
<td>&nbsp;
</tr>
</table>
<hr>
<h2>Local Variables</h2>
<b><a name="var-Id">Id</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line43">static char Id[]</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td>&nbsp; <td><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
</table>
<p>
<b><a name="var-UseId">UseId</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line44">static void* UseId[]</a></span></tt><br>
<p>
<b><a name="var-module_name">module_name</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line93">static char module_name[]</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-cmdXResource">cmdXResource()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-getEntries">getEntries()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-getOld">getOld()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-initBuffers">initBuffers()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-readFile">readFile()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-dpy">dpy</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line114">static Display* dpy</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-doDisplayDefines">doDisplayDefines()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-doScreenDefines">doScreenDefines()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-getOld">getOld()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-initBuffers">initBuffers()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-storeResProp">storeResProp()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-xresourceFinish">xresourceFinish()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-defines">defines</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line115">static char* defines</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-addDef">addDef()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-cmdXResource">cmdXResource()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-initBuffers">initBuffers()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-def_base">def_base</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line116">static int def_base</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-initBuffers">initBuffers()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-buffer">buffer</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line117">static Tcl_DString* buffer</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-cmdXResource">cmdXResource()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-initBuffers">initBuffers()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-readFile">readFile()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-storeResProp">storeResProp()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-xresourceFinish">xresourceFinish()</a>
<td>&nbsp;
</tr>
</table>
<p>
<b><a name="var-resDB">resDB</a></b><br>
<tt><span class="cxref-variable"><a href="cmdXResource.c.src.html#line118">static ResourceDB resDB</a></span></tt><br>
<table>
<tr>
<td>Used in:
<td><a href="#func-cmdXResource">cmdXResource()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-getOld">getOld()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-initBuffers">initBuffers()</a>
<td>&nbsp;
</tr>
<tr>
<td>&nbsp;
<td><a href="#func-xresourceFinish">xresourceFinish()</a>
<td>&nbsp;
</tr>
</table>
<hr>
<h2><a name="func-cmdXResource">Global Function cmdXResource()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: cmdXResource **
** **
** Description: Callback function for 'x-resource'. The function **
** sets up a hash table containing all resources to be **
** passed to the X server. This hash table will be **
** flushed whenever the function xresourceFinish is cal-**
** led. **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: ClientData client_data **
** Tcl_Interp *interp According Tcl interp.**
** int argc Number of arguments **
** char *argv[] Argument array **
** **
** Result: int TCL_OK Successfull completion **
** TCL_ERROR Any error **
** **
** Attached Globals: g_flags These are set up accordingly before **
** this function is called in order to **
** control everything **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line860">int cmdXResource ( ClientData client_data, Tcl_Interp* interp, int argc, const char* argv[] )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="modules_def.h.html#file">modules_def.h</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">Module_Error()</a></span>
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">error.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-getEntries">getEntries()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-getEntries">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-readFile">readFile()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-readFile">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">Tcl_DStringAppend(), access(), fopen(), fprintf(), getenv(), popen(), strcat(), strcmp()</span>
</tr>
<tr>
<td>Used in:
<td><span class="cxref-reference-local"><a href="init.c.html#func-InitializeModuleCommands">InitializeModuleCommands()</a></span>
<td><span class="cxref-reference-local"><a href="init.c.html#func-InitializeModuleCommands">init.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">buffer</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-defines">defines</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-defines">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="main.c.html#var-g_flags">g_flags</a></span>
<td><span class="cxref-reference-local"><a href="main.c.html#var-g_flags">main.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">module_name</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">resDB</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-xresourceFinish">Global Function xresourceFinish()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: xresourceFinish **
** **
** Description: Update the resource property if everything is ok. **
** This routine should be called when all properies have**
** been defines or updated. Remember that this routine **
** always will be called, even if there was no **
** "x-resource" command in the module! **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: **
** **
** Result: **
** **
** Attached Globals: - **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line802">void xresourceFinish ( int no_errors )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="modules_def.h.html#file">modules_def.h</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-storeResProp">storeResProp()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-storeResProp">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">Tcl_DStringFree(), XCloseDisplay()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="main.c.html#func-main">main()</a></span>
<td><span class="cxref-reference-local"><a href="main.c.html#func-main">main.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">buffer</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">dpy</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">resDB</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-addDef">Local Function addDef()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: addDef, addNum **
** **
** Description: Adds DEFINES to the define buffer. This code is main-**
** ly the same as in the original xrdb.c **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: char *title Name of the resource **
** char *value and its value **
** **
** Result: - **
** **
** Attached Globals: defines Buffer for all DEFINES which will be **
** written here in command lien syntax: **
** -D &lt;titel&gt;=&lt;value&gt; **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line161">static void addDef ( char* title, char* value )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td colspan=2><span class="cxref-reference-system">strcat(), strchr()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addNum">addNum()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addNum">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doDisplayDefines">doDisplayDefines()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doDisplayDefines">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doScreenDefines">doScreenDefines()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doScreenDefines">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-defines">defines</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-defines">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-addNum">Local Function addNum()</a></h2>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line196">static void addNum ( char* title, int value )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addDef">addDef()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addDef">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">sprintf()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doDisplayDefines">doDisplayDefines()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doDisplayDefines">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doScreenDefines">doScreenDefines()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doScreenDefines">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-doDisplayDefines">Local Function doDisplayDefines()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: doDisplayDefines **
** **
** Description: Put the client and server specific defines on the **
** define buffer **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: - **
** **
** Result: - **
** **
** Attached Globals: dpy For seeking the name of the display **
** defines (via addDef and addNum) **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line230">static void doDisplayDefines ( void )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addDef">addDef()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addDef">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addNum">addNum()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addNum">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">XDisplayName(), gethostname(), strchr(), strcpy()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">dpy</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-doScreenDefines">Local Function doScreenDefines()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: doScreenDefines **
** **
** Description: Put the screen specific defines on the define buffer **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: int scrno Screen number **
** **
** Result: - **
** **
** Attached Globals: dpy For seeking the name of the display **
** defines (via addDef and addNum) **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line287">static void doScreenDefines ( int scrno )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addDef">addDef()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addDef">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addNum">addNum()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-addNum">cmdXResource.c</a></span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">dpy</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-getEntries">Local Function getEntries()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: getEntries **
** **
** Description: Updates the resources database (which is a Tcl hash **
** table) with the resources passed in the buffer. The **
** buffer contains a X resource lookalike text image. **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: Tcl_Interp *interp According Tcl interp.**
** Tcl_HashTable *data The hash tables holding the **
** resource data **
** register char *buf The buffer containing the **
** resources to be modified in **
** X resource syntax **
** int remove Remove or add resources **
** **
** Result: ErrType NO_ERR Success **
** ERR_PARSE Parse error **
** **
** Attached Globals: - **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line425">static ErrType getEntries ( Tcl_Interp* interp, Tcl_HashTable* data, char* buf, int remove )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">Module_Error()</a></span>
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">error.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="utility.c.html#func-null_free">null_free()</a></span>
<td><span class="cxref-reference-local"><a href="utility.c.html#func-null_free">utility.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">Tcl_DeleteHashEntry(), Tcl_RegExpCompile(), Tcl_RegExpExec(), Tcl_RegExpRange(), strdup()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">module_name</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-getOld">Local Function getOld()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: getOld **
** **
** Description: First, we have to find the resources already loaded **
** into the X11 resource property. This routine current-**
** ly only handles one screen, the default screen for **
** the DISPLAY. This routine should only be called if **
** resDB.data is NULL. **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: register char **buf Buffer for the old resource **
** database **
** **
** Result: ErrType ERR_PARAM resDB.data != NULL **
** ERR_ALLOC out of memory **
** NO_ERR Success **
** **
** Attached Globals: resDB The data area will be installed as a **
** Tcl hash table **
** dpy The current display **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line640">static ErrType getOld ( char** buf )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">Module_Error()</a></span>
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">error.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">Tcl_InitHashTable(), XResourceManagerString(), malloc()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">dpy</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">module_name</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">resDB</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-initBuffers">Local Function initBuffers()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: initBuffers **
** **
** Description: Initilize buffers if not already done, or reinitia- **
** lize some variables if buffers already exists. **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: Tcl_Interp *interp According Tcl interp.**
** register int is_file Differs between a single X **
** resource to be modified or **
** a resource file to be merged**
** **
** Result: ErrType ERR_DISPLAY Cannot open DISPLAY **
** ERR_ALLOC ALLOC failure **
** ERR_EXTRACT **
** NO_ERR Success **
** **
** Attached Globals: dpy Display will be openend **
** resDB Resource database will be filled up **
** with the current setup **
** defines **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line704">static ErrType initBuffers ( Tcl_Interp* interp, int is_file )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">Module_Error()</a></span>
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">error.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doDisplayDefines">doDisplayDefines()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doDisplayDefines">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doScreenDefines">doScreenDefines()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-doScreenDefines">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-getEntries">getEntries()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-getEntries">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-getOld">getOld()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-getOld">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">Tcl_DStringInit(), Tcl_DStringSetLength(), XOpenDisplay(), malloc(), strcat(), strcpy(), strlen()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">buffer</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-def_base">def_base</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-def_base">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-defines">defines</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-defines">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">dpy</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">module_name</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">resDB</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-readFile">Local Function readFile()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: readFile **
** **
** Description: Read resource from a file, which normally is a pipe **
** opened with popen. **
** The file will be closed, when reading is finished **
** **
** Note: This routine uses the global variable 'line', declar-**
** ed in another file!!! **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: register FILE *input The stream to be read from **
** int do_cpp Differs betweem a pipe or a **
** file being assigned to input **
** **
** Result: - **
** **
** Attached Globals: line Buffer for a line to be read **
** buffer Buffer for the whole resource file **
** image **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line372">static int readFile ( FILE* input, int do_cpp )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">Module_Error()</a></span>
<td><span class="cxref-reference-local"><a href="error.c.html#func-Module_Error">error.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td colspan=2><span class="cxref-reference-system">Tcl_DStringAppend(), fclose(), feof(), fread(), pclose()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">buffer</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="main.c.html#var-line">line</a></span>
<td><span class="cxref-reference-local"><a href="main.c.html#var-line">main.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">module_name</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a></span>
</tr>
</table>
<hr>
<h2><a name="func-storeResProp">Local Function storeResProp()</a></h2>
<pre>
** ** Function-Header ***************************************************** **
** **
** Function: storeResProp **
** **
** Description: Update the X11 resource property, adding new resour- **
** ces. **
** **
** First Edition: 1991/10/23 **
** **
** Parameters: register ResourceDB *rdb Resource database **
** **
** Result: - **
** **
** Attached Globals: - **
** **
** ************************************************************************ **
</pre>
<tt><span class="cxref-function"><a href="cmdXResource.c.src.html#line555">static void storeResProp ( ResourceDB* rdb )</a></span></tt><br>
<table>
<tr>
<td>Prototyped in:
<td colspan=2><span class="cxref-reference-local"><a href="cmdXResource.c.html#file">cmdXResource.c</a></span>
</tr>
<tr>
<td>Calls:
<td colspan=2><span class="cxref-reference-system">Tcl_DStringAppend(), Tcl_DStringSetLength(), Tcl_FirstHashEntry(), Tcl_NextHashEntry(), XChangeProperty(), XGrabServer(), XMaxRequestSize(), XUngrabServer()</span>
</tr>
<tr>
<td>Called by:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-xresourceFinish">xresourceFinish()</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#func-xresourceFinish">cmdXResource.c</a></span>
</tr>
<tr>
<td>References Variables:
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">buffer</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a></span>
</tr>
<tr>
<td>&nbsp;
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">dpy</a></span>
<td><span class="cxref-reference-local"><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a></span>
</tr>
</table>
</BODY>
</HTML>