JWM Source Documentation
|
Miscellaneous functions and macros. More...
Go to the source code of this file.
Functions | |
static char | ToLower (char ch) |
Convert to lower case. | |
static char | IsSymbolic (char ch) |
Determine if a character is a valid for a shell variable. | |
static char * | GetSymbolName (const char *str) |
Get the name of a shell variable (returns a copy). | |
static void | ReplaceSymbol (char **str, unsigned int offset, const char *name, const char *value) |
Replace "name" with "value" at offset in str (reallocates if needed). | |
char | IsSpace (char ch, unsigned int *lineNumber) |
Determine if a character is a space character. | |
void | ExpandPath (char **path) |
Perform shell-like macro path expansion. | |
void | Trim (char *str) |
Trim leading and trailing whitespace from a string. | |
char * | CopyString (const char *str) |
Copy a string. | |
float | ParseFloat (const char *str) |
Parse a float. | |
int | FindValue (const StringMappingType *mapping, int count, const char *key) |
Find a value in a string mapping. | |
const char * | FindKey (const StringMappingType *mapping, int count, int value) |
Find a key in a string mapping. | |
int | StrCmpNoCase (const char *a, const char *b) |
Case insensitive string compare. | |
char* CopyString | ( | const char * | str | ) |
Copy a string.
Definition at line 210 of file misc.c.
References Allocate.
Referenced by AddAction(), AddCommand(), AddGroupOptionString(), AddPattern(), AddWindowMenuItem(), CreateClock(), CreateSwallow(), CreateTrayButton(), CreateWindowLayerMenu(), GetDefaultIcon(), InsertBinding(), LoadNamedIcon(), LoadNamedIconHelper(), LookupType(), main(), MeasurePopupText(), ParseError(), ParseMenu(), ParseMenuItem(), ParseRootMenu(), RunRootCommand(), SetBackground(), SetBorderIcon(), SetColor(), SetDefaultIcon(), SetDesktopName(), SetFont(), SetPathString(), ShowClientList(), ShowConfirmDialog(), ShowPopup(), StartupColors(), StartupFonts(), TokenizeFile(), and TokenizePipe().
void ExpandPath | ( | char ** | path | ) |
Perform shell-like macro path expansion.
Definition at line 151 of file misc.c.
References Assert, GetSymbolName(), Release, ReplaceSymbol(), and ScreenType::x.
Referenced by AddIconPath(), LoadImageBackground(), SetPathString(), TokenizeFile(), and TokenizePipe().
const char* FindKey | ( | const StringMappingType * | mapping, |
int | count, | ||
int | value | ||
) |
Find a key in a string mapping.
Definition at line 264 of file misc.c.
References StringMappingType::key, and ScreenType::x.
Referenced by GetTokenTypeName().
int FindValue | ( | const StringMappingType * | mapping, |
int | count, | ||
const char * | key | ||
) |
Find a value in a string mapping.
Definition at line 243 of file misc.c.
References Assert, StringMappingType::value, and ScreenType::x.
Referenced by LookupType(), ParseAttribute(), ParseGroupOption(), ParseKey(), ParseLayer(), ParsePopupStyle(), ParseTextAlignment(), ParseTokenValue(), SetBackground(), SetTrayHorizontalAlignment(), and SetTrayVerticalAlignment().
|
static |
Get the name of a shell variable (returns a copy).
Definition at line 75 of file misc.c.
References Allocate, and IsSymbolic().
Referenced by ExpandPath().
char IsSpace | ( | char | ch, |
unsigned int * | lineNumber | ||
) |
Determine if a character is a space character.
Definition at line 21 of file misc.c.
Referenced by GetRootMenuIndexFromString(), Tokenize(), and Trim().
|
static |
Determine if a character is a valid for a shell variable.
Definition at line 50 of file misc.c.
Referenced by GetSymbolName().
float ParseFloat | ( | const char * | str | ) |
Parse a float.
Read a float in a locale-independent way.
Definition at line 229 of file misc.c.
Referenced by ParseOpacity().
|
static |
int StrCmpNoCase | ( | const char * | a, |
const char * | b | ||
) |
Case insensitive string compare.
Definition at line 276 of file misc.c.
References ToLower().
Referenced by LoadImage().
|
static |
void Trim | ( | char * | str | ) |
Trim leading and trailing whitespace from a string.
Definition at line 177 of file misc.c.
References Assert, IsSpace(), and ScreenType::x.
Referenced by AddIconPath(), and ReadValue().
joewing.net / Projects / JWM