JWM Source Documentation

misc.h File Reference

Miscellaneous functions and macros. More...

Go to the source code of this file.

Defines

#define Min(x, y)   ( (x) > (y) ? (y) : (x) )
 Return the minimum of two values.
#define Max(x, y)   ( (x) > (y) ? (x) : (y) )
 Return the maximum of two values.

Functions

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.

Detailed Description

Miscellaneous functions and macros.

Author:
Joe Wingbermuehle
Date:
2004-2006

Definition in file misc.h.


Define Documentation

#define Max (   x,
 
)    ( (x) > (y) ? (x) : (y) )

Return the maximum of two values.

Definition at line 17 of file misc.h.

#define Min (   x,
 
)    ( (x) > (y) ? (y) : (x) )

Return the minimum of two values.

Definition at line 14 of file misc.h.


Function Documentation

char* CopyString ( const char *  str)

Copy a string.

Note that NULL is accepted. When provided NULL, NULL will be returned.

Parameters:
strThe string to copy.
Returns:
A copy of the string.
void ExpandPath ( char **  path)

Perform shell-like macro path expansion.

Parameters:
pathThe path to expand (possibly reallocated).
void Trim ( char *  str)

Trim leading and trailing whitespace from a string.

Parameters:
strThe string to trim.