X11 Work Bench Toolkit  1.0
conf_help.c File Reference

'configuration helper' implementation file for the X11 Work Bench Toolkit API More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <X11/Xlib.h>
#include "conf_help.h"
#include "file_help.h"
#include "window_helper.h"
#include "draw_text.h"

Go to the source code of this file.

Macros

#define DEFAULT_DOUBLE_CLICK_TIME   250 /* msec */
 
#define DEFAULT_DOUBLE_CLICK_DISTANCE   5 /* pixels */
 
#define DEFAULT_DRAG_THRESHOLD   9 /* pixels */
 
#define DEFAULT_CURSOR_BLINK   (!0) /* boolean */
 
#define DEFAULT_CURSOR_BLINK_TIME   1200 /* msec */
 

Typedefs

typedef struct _CONF_FILE_ CONF_FILE
 

Functions

static void __settings_cleanup (void)
 
static __inline__ void trim_ends (const char **ppLeft, const char **ppRight)
 
static __inline__ char * DoMakePath (char *pSrc, const char *szPath, const char *szName, const char *szExt)
 
void CHRegisterArgs (int argc, char **argv)
 registers arguments from the command line for later use More...
 
void CHOnExit (void)
 frees resources used by Configuration 'helper' functions More...
 
int CHGetResourceString_Old (Display *pDisplay, const char *szIdentifier, char *szData, int cbData)
 
static const char * TranslateColorRequest (const char *szIdentifier)
 
int CHGetResourceString (Display *pDisplay, const char *szIdentifier, char *szData, int cbData)
 Queries desktop resource strings (may become deprecated) More...
 
int CHGetResourceInt (Display *pDisplay, const char *szIdentifier)
 Queryies desktop resource integer values (from strings) (may become deprecated) More...
 
int CHGetArgC ()
 retrieves the argument count stored by CHRegisterArgs() More...
 
const char *const * CHGetArgV ()
 retrieves the array of arguments stored by CHRegisterArgs() More...
 
void * CHOpenConfFile (const char *szAppName, int iFlags)
 open configuration file for read/write, optionally creating it, based on application name More...
 
void CHCloseConfFile (void *pFile)
 close configuration file opened by CHOpenConfFile(), but does NOT free memory resources More...
 
void CHDestroyConfFile (void *pFile)
 destroy configuration file opened by CHOpenConfFile(), freeing memory resources (but not the files) More...
 
static void __get_line_strip_comments__ (const char **ppStart, const char **ppEnd)
 
static void __find_section__ (void *hFile, const char *szSection, const char **ppSection, const char **ppEndSection)
 
static int __enum_conf_file_sections__ (void *hFile, char *szData, int cbData)
 
int CHGetConfFileString (void *hFile, const char *szSection, const char *szIdentifier, char *szData, int cbData)
 obtain a string from a configuration file More...
 
int CHWriteConfFileString (void *hFile, const char *szSection, const char *szIdentifier, const char *szData)
 write a string to a configuration file More...
 
int CHGetConfFileInt (void *hFile, const char *szSection, const char *szIdentifier)
 obtain an integer value from a configuration file More...
 
int CHWriteConfFileInt (void *hFile, const char *szSection, const char *szIdentifier, int iData)
 write an integer value to a configuration file More...
 
struct __XSETTINGS_HEADER__ __attribute__ ((__packed__))
 
const CHXSettingCHGetXSetting (Display *pDisplay, const char *szSettingName)
 returns a pointer to a specific X setting entry by name More...
 
void CHSettingsRefresh (Display *pDisplay)
 refresh the internally cached X settings More...
 
int CHGetDoubleClickTime (Display *pDisplay)
 returns default double click time (from X settings) More...
 
int CHGetDoubleClickDistance (Display *pDisplay)
 returns default double click distance (from X settings) More...
 
int CHGetDragThreshold (Display *pDisplay)
 returns default drag threshold (from X settings) More...
 
int CHGetCursorBlink (Display *pDisplay)
 returns default cursor blink 'enable' flag (from X settings) More...
 
int CHGetCursorBlinkTime (Display *pDisplay)
 returns default cursor blink time (from X settings) More...
 
char * CHParseXMLTagContents (const char *pTagContents, int cbLength)
 Parses contents of an XML tag, returning as WBAlloc'd string list similar to environment strings. More...
 
const char * CHFindEndOfXMLTag (const char *pTagContents)
 Parses contents of an XML tag to find the end of it. More...
 
char * CHGetFileMimeType (const char *szFileName)
 Get the MIME type for a particular file name or extension. More...
 
char * CHGetMimeDefaultApp (const char *szMimeType)
 Get the default application for a particular MIME type. More...
 
char * CHGetDesktopFileInfo (const char *szDesktopFile, const char *szInfo)
 Get the default application for a particular MIME type. More...
 
void CHDumpConfig ()
 dump config information using debug output functions More...
 

Variables

static const char *const * argv_copy = NULL
 
static int argc_copy = 0
 
static CHXSettingspXSettings = NULL
 
char cByteOrder
 
char cUnused [3]
 
unsigned int uiSerial
 
unsigned int nSettings
 
 XSETTINGS_DATA_INT
 
unsigned int cbLength
 
char szData [4]
 

Detailed Description

'configuration helper' implementation file for the X11 Work Bench Toolkit API

X11 Work Bench Toolkit Toolkit API

Definition in file conf_help.c.