mirror of
https://github.com/envmodules/modules.git
synced 2026-06-10 00:56:30 +08:00
for "module use", "module use --append", and "module unuse". * Changed the global variable names (flags,current_module) to (g_flags, g_current_module) to identify their ubiquity in the module source.
687 lines
27 KiB
HTML
687 lines
27 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
|
|
<!-- This HTML file generated by cxref. -->
|
|
<!-- cxref program (c) Andrew M. Bishop 1995,96,97,98,99. -->
|
|
|
|
<!--
|
|
Cxref: cxref -block-comments -verbatim-comments -xref-all -index-all -html -Oxref cmdXResource.c
|
|
CPP : gcc -E -C -dD -dI
|
|
-->
|
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
<TITLE>Cross reference for cmdXResource.c of cxref.</TITLE>
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
|
|
<h1><a name="file">File cmdXResource.c</a></h1>
|
|
<pre>
|
|
** ** Module Header ******************************************************* **
|
|
** **
|
|
** Modules Revision 3.0 **
|
|
** Providing a flexible user environment **
|
|
** **
|
|
** File: cmdXResource.c **
|
|
** First Edition: 91/10/23 **
|
|
** **
|
|
** Authors: John Furlan, jlf@behere.com **
|
|
** Leif Hedstrom<hedstrom"@boot.org> **
|
|
** 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 & 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>
|
|
</table>
|
|
|
|
<hr>
|
|
<h2>Included Files</h2>
|
|
|
|
<ul>
|
|
<li><tt><a href="modules_def.h.html#file">#include "modules_def.h"</a></tt>
|
|
<ul>
|
|
<li><tt>#include <stdio.h></tt>
|
|
<li><tt>#include <tcl.h></tt>
|
|
<li><tt><a href="config.h.html#file">#include "config.h"</a></tt>
|
|
<li><tt>#include <stdlib.h></tt>
|
|
<li><tt>#include <string.h></tt>
|
|
<li><tt>#include <unistd.h></tt>
|
|
<li><tt>#include <sys/types.h></tt>
|
|
<li><tt>#include <ctype.h></tt>
|
|
<li><tt>#include <sys/stat.h></tt>
|
|
<li><tt>#include <sys/termios.h></tt>
|
|
<li><tt>#include <fcntl.h></tt>
|
|
<li><tt>#include <sys/ioctl.h></tt>
|
|
<li><tt>#include <dirent.h></tt>
|
|
<li><tt>#include <errno.h></tt>
|
|
</ul>
|
|
</ul>
|
|
<ul>
|
|
<li><tt>#include <X11/Xlib.h></tt>
|
|
</ul>
|
|
<ul>
|
|
<li><tt>#include <X11/Xatom.h></tt>
|
|
</ul>
|
|
<ul>
|
|
<li><tt>#include <X11/Xmu/SysUtil.h></tt>
|
|
</ul>
|
|
|
|
<hr>
|
|
<h2>Preprocessor definitions</h2>
|
|
|
|
<tt>#define MAXHOSTNAME 255</tt><br>
|
|
<p>
|
|
<tt>#define Resolution( pixels, mm )</tt><br>
|
|
|
|
<hr>
|
|
<h2><a name="type-ResourceDB">Typedef ResourceDB</a></h2>
|
|
<tt>typedef struct _ResourceDB ResourceDB</tt><br>
|
|
<table>
|
|
<tr><td><tt>struct _ResourceDB</tt><td>
|
|
<tr><td> <tt>{</tt><td>
|
|
<tr><td> <tt>Tcl_HashTable* data;</tt><td>
|
|
<tr><td> <tt>Window root;</tt><td>
|
|
<tr><td> <tt>Atom prop;</tt><td>
|
|
<tr><td> <tt>}</tt><td>
|
|
</table>
|
|
|
|
<hr>
|
|
<h2>Local Variables</h2>
|
|
|
|
<b><a name="var-Id">Id</a></b><br>
|
|
<tt>static char Id[]</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td> <td><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-UseId">UseId</a></b><br>
|
|
<tt>static void* UseId[]</tt><br>
|
|
<p>
|
|
<b><a name="var-module_name">module_name</a></b><br>
|
|
<tt>static char module_name[]</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-cmdXResource">cmdXResource()</a>
|
|
<tr><td>
|
|
<td><a href="#func-getEntries">getEntries()</a>
|
|
<tr><td>
|
|
<td><a href="#func-getOld">getOld()</a>
|
|
<tr><td>
|
|
<td><a href="#func-initBuffers">initBuffers()</a>
|
|
<tr><td>
|
|
<td><a href="#func-readFile">readFile()</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-dpy">dpy</a></b><br>
|
|
<tt>static Display* dpy</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-doDisplayDefines">doDisplayDefines()</a>
|
|
<tr><td>
|
|
<td><a href="#func-doScreenDefines">doScreenDefines()</a>
|
|
<tr><td>
|
|
<td><a href="#func-getOld">getOld()</a>
|
|
<tr><td>
|
|
<td><a href="#func-initBuffers">initBuffers()</a>
|
|
<tr><td>
|
|
<td><a href="#func-storeResProp">storeResProp()</a>
|
|
<tr><td>
|
|
<td><a href="#func-xresourceFinish">xresourceFinish()</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-defines">defines</a></b><br>
|
|
<tt>static char* defines</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-addDef">addDef()</a>
|
|
<tr><td>
|
|
<td><a href="#func-cmdXResource">cmdXResource()</a>
|
|
<tr><td>
|
|
<td><a href="#func-initBuffers">initBuffers()</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-def_base">def_base</a></b><br>
|
|
<tt>static int def_base</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-initBuffers">initBuffers()</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-buffer">buffer</a></b><br>
|
|
<tt>static Tcl_DString* buffer</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-cmdXResource">cmdXResource()</a>
|
|
<tr><td>
|
|
<td><a href="#func-initBuffers">initBuffers()</a>
|
|
<tr><td>
|
|
<td><a href="#func-readFile">readFile()</a>
|
|
<tr><td>
|
|
<td><a href="#func-storeResProp">storeResProp()</a>
|
|
<tr><td>
|
|
<td><a href="#func-xresourceFinish">xresourceFinish()</a>
|
|
|
|
</table>
|
|
<p>
|
|
<b><a name="var-resDB">resDB</a></b><br>
|
|
<tt>static ResourceDB resDB</tt><br>
|
|
<table>
|
|
<tr><td>Used in:
|
|
<td><a href="#func-cmdXResource">cmdXResource()</a>
|
|
<tr><td>
|
|
<td><a href="#func-getOld">getOld()</a>
|
|
<tr><td>
|
|
<td><a href="#func-initBuffers">initBuffers()</a>
|
|
<tr><td>
|
|
<td><a href="#func-xresourceFinish">xresourceFinish()</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-cmdXResource">Global Function cmdXResource()</a></h2>
|
|
<pre>
|
|
** ** Function-Header ***************************************************** **
|
|
** **
|
|
** Function: cmdXResource **
|
|
** **
|
|
** Description: Callback function for 'x-ressource'. The function **
|
|
** sets up a hash table containing all ressources to be **
|
|
** passed to the X server. This hash table will be **
|
|
** flushed whenever the function xresourceFinish is cal-**
|
|
** led. **
|
|
** **
|
|
** First Edition: 91/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>int cmdXResource ( ClientData client_data, Tcl_Interp* interp, int argc, char* argv[] )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="modules_def.h.html#file">modules_def.h</a>
|
|
<tr><td>Calls:
|
|
<td><a href="error.c.html#func-Module_Error">Module_Error()</a><td><a href="error.c.html#func-Module_Error">error.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-getEntries">getEntries()</a><td><a href="cmdXResource.c.html#func-getEntries">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a><td><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-readFile">readFile()</a><td><a href="cmdXResource.c.html#func-readFile">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_DStringAppend(), access(), fopen(), fprintf(), popen(), strcat(), strcmp()
|
|
<tr><td>Used in:
|
|
<td><a href="init.c.html#func-InitializeModuleCommands">InitializeModuleCommands()</a><td><a href="init.c.html#func-InitializeModuleCommands">init.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-buffer">buffer</a><td><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-defines">defines</a><td><a href="cmdXResource.c.html#var-defines">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="main.c.html#var-g_flags">g_flags</a><td><a href="main.c.html#var-g_flags">main.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-module_name">module_name</a><td><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-resDB">resDB</a><td><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a>
|
|
|
|
</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: 91/10/23 **
|
|
** **
|
|
** Parameters: **
|
|
** **
|
|
** Result: **
|
|
** **
|
|
** Attached Globals: - **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>void xresourceFinish ( int no_errors )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="modules_def.h.html#file">modules_def.h</a>
|
|
<tr><td>Calls:
|
|
<td><a href="cmdXResource.c.html#func-storeResProp">storeResProp()</a><td><a href="cmdXResource.c.html#func-storeResProp">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_DStringFree(), XCloseDisplay()
|
|
<tr><td>Called by:
|
|
<td><a href="main.c.html#func-main">main()</a><td><a href="main.c.html#func-main">main.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-buffer">buffer</a><td><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-dpy">dpy</a><td><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-resDB">resDB</a><td><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a>
|
|
|
|
</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: 91/10/23 **
|
|
** **
|
|
** Parameters: char *title Name of the ressource **
|
|
** char *value and its value **
|
|
** **
|
|
** Result: - **
|
|
** **
|
|
** Attached Globals: defines Buffer for all DEFINES which will be **
|
|
** written here in command lien syntax: **
|
|
** -D <titel>=<value> **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>static void addDef ( char* title, char* value )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td colspan=2>strcat(), strchr()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-addNum">addNum()</a><td><a href="cmdXResource.c.html#func-addNum">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-doDisplayDefines">doDisplayDefines()</a><td><a href="cmdXResource.c.html#func-doDisplayDefines">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-doScreenDefines">doScreenDefines()</a><td><a href="cmdXResource.c.html#func-doScreenDefines">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-defines">defines</a><td><a href="cmdXResource.c.html#var-defines">cmdXResource.c</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-addNum">Local Function addNum()</a></h2>
|
|
<tt>static void addNum ( char* title, int value )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td><a href="cmdXResource.c.html#func-addDef">addDef()</a><td><a href="cmdXResource.c.html#func-addDef">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td colspan=2>sprintf()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-doDisplayDefines">doDisplayDefines()</a><td><a href="cmdXResource.c.html#func-doDisplayDefines">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-doScreenDefines">doScreenDefines()</a><td><a href="cmdXResource.c.html#func-doScreenDefines">cmdXResource.c</a>
|
|
|
|
</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: 91/10/23 **
|
|
** **
|
|
** Parameters: - **
|
|
** **
|
|
** Result: - **
|
|
** **
|
|
** Attached Globals: dpy For seeking the name of the display **
|
|
** defines (via addDef and addNum) **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>static void doDisplayDefines ( void )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td><a href="cmdXResource.c.html#func-addDef">addDef()</a><td><a href="cmdXResource.c.html#func-addDef">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-addNum">addNum()</a><td><a href="cmdXResource.c.html#func-addNum">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td colspan=2>XDisplayName(), XmuGetHostname(), strchr(), strcpy()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a><td><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-dpy">dpy</a><td><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a>
|
|
|
|
</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: 91/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>static void doScreenDefines ( int scrno )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td><a href="cmdXResource.c.html#func-addDef">addDef()</a><td><a href="cmdXResource.c.html#func-addDef">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-addNum">addNum()</a><td><a href="cmdXResource.c.html#func-addNum">cmdXResource.c</a>
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a><td><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-dpy">dpy</a><td><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
<h2><a name="func-getEntries">Local Function getEntries()</a></h2>
|
|
<pre>
|
|
** ** Function-Header ***************************************************** **
|
|
** **
|
|
** Function: getEntries **
|
|
** **
|
|
** Description: Updates the ressources database (which is a Tcl hash **
|
|
** table) with the ressources passed in the buffer. The **
|
|
** buffer contains a X ressource lookalike text image. **
|
|
** **
|
|
** First Edition: 91/10/23 **
|
|
** **
|
|
** Parameters: Tcl_Interp *interp According Tcl interp.**
|
|
** Tcl_HashTable *data The hash tables holding the **
|
|
** ressource data **
|
|
** register char *buf The buffer containing the **
|
|
** ressources to be modified in **
|
|
** X ressource syntax **
|
|
** int remove Remove or add ressources **
|
|
** **
|
|
** Result: ErrType NO_ERR Success **
|
|
** ERR_PARSE Parse error **
|
|
** **
|
|
** Attached Globals: - **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>static ErrType getEntries ( Tcl_Interp* interp, Tcl_HashTable* data, char* buf, int remove )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td><a href="error.c.html#func-Module_Error">Module_Error()</a><td><a href="error.c.html#func-Module_Error">error.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_DeleteHashEntry(), Tcl_RegExpCompile(), Tcl_RegExpExec(), Tcl_RegExpRange(), strdup()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource()</a><td><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a><td><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-module_name">module_name</a><td><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a>
|
|
|
|
</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: 91/10/23 **
|
|
** **
|
|
** Parameters: register char **buf Buffer for the old ressource **
|
|
** 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>static ErrType getOld ( char** buf )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td><a href="error.c.html#func-Module_Error">Module_Error()</a><td><a href="error.c.html#func-Module_Error">error.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_InitHashTable(), XResourceManagerString(), malloc()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-initBuffers">initBuffers()</a><td><a href="cmdXResource.c.html#func-initBuffers">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-dpy">dpy</a><td><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-module_name">module_name</a><td><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-resDB">resDB</a><td><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a>
|
|
|
|
</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: 91/10/23 **
|
|
** **
|
|
** Parameters: Tcl_Interp *interp According Tcl interp.**
|
|
** register int is_file Differs between a single X **
|
|
** ressource to be modified or **
|
|
** a ressource 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 Ressource database will be filled up **
|
|
** with the current setup **
|
|
** defines **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>static ErrType initBuffers ( Tcl_Interp* interp, int is_file )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td><a href="error.c.html#func-Module_Error">Module_Error()</a><td><a href="error.c.html#func-Module_Error">error.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-doDisplayDefines">doDisplayDefines()</a><td><a href="cmdXResource.c.html#func-doDisplayDefines">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-doScreenDefines">doScreenDefines()</a><td><a href="cmdXResource.c.html#func-doScreenDefines">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-getEntries">getEntries()</a><td><a href="cmdXResource.c.html#func-getEntries">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#func-getOld">getOld()</a><td><a href="cmdXResource.c.html#func-getOld">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_DStringInit(), Tcl_DStringSetLength(), XOpenDisplay(), malloc(), strcat(), strcpy(), strlen()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource()</a><td><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-buffer">buffer</a><td><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-def_base">def_base</a><td><a href="cmdXResource.c.html#var-def_base">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-defines">defines</a><td><a href="cmdXResource.c.html#var-defines">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-dpy">dpy</a><td><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-module_name">module_name</a><td><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-resDB">resDB</a><td><a href="cmdXResource.c.html#var-resDB">cmdXResource.c</a>
|
|
|
|
</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: 91/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 ressource file **
|
|
** image **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>static int readFile ( FILE* input, int do_cpp )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td><a href="error.c.html#func-Module_Error">Module_Error()</a><td><a href="error.c.html#func-Module_Error">error.c</a>
|
|
<tr><td>
|
|
<td colspan=2>Tcl_DStringAppend(), fclose(), feof(), fread(), pclose()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource()</a><td><a href="cmdXResource.c.html#func-cmdXResource">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-buffer">buffer</a><td><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="main.c.html#var-line">line</a><td><a href="main.c.html#var-line">main.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-module_name">module_name</a><td><a href="cmdXResource.c.html#var-module_name">cmdXResource.c</a>
|
|
|
|
</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: 91/10/23 **
|
|
** **
|
|
** Parameters: register ResourceDB *rdb Ressource database **
|
|
** **
|
|
** Result: - **
|
|
** **
|
|
** Attached Globals: - **
|
|
** **
|
|
** ************************************************************************ **
|
|
</pre>
|
|
|
|
<tt>static void storeResProp ( ResourceDB* rdb )</tt><br>
|
|
<table>
|
|
<tr><td>Prototyped in:
|
|
<td colspan=2><a href="cmdXResource.c.html#file">cmdXResource.c</a>
|
|
<tr><td>Calls:
|
|
<td colspan=2>Tcl_DStringAppend(), Tcl_DStringSetLength(), Tcl_FirstHashEntry(), Tcl_NextHashEntry(), XChangeProperty(), XGrabServer(), XMaxRequestSize(), XUngrabServer()
|
|
<tr><td>Called by:
|
|
<td><a href="cmdXResource.c.html#func-xresourceFinish">xresourceFinish()</a><td><a href="cmdXResource.c.html#func-xresourceFinish">cmdXResource.c</a>
|
|
<tr><td>References Variables:
|
|
<td><a href="cmdXResource.c.html#var-buffer">buffer</a><td><a href="cmdXResource.c.html#var-buffer">cmdXResource.c</a>
|
|
<tr><td>
|
|
<td><a href="cmdXResource.c.html#var-dpy">dpy</a><td><a href="cmdXResource.c.html#var-dpy">cmdXResource.c</a>
|
|
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|