version 1.5, 2000/09/14 13:35:38 |
version 1.6, 2000/09/14 13:36:46 |
|
|
*/ |
*/ |
static Boolean |
static Boolean |
VarUppercase(word, addSpace, buf, dummy) |
VarUppercase(word, addSpace, buf, dummy) |
const char *word; /* Word to Upper Case */ |
const char *word; /* Word to Upper Case */ |
Boolean addSpace; /* True if need to add a space to the buffer |
Boolean addSpace; /* True if need to add a space to the buffer |
* before sticking in the head */ |
* before sticking in the head */ |
Buffer buf; /* Buffer in which to store it */ |
Buffer buf; /* Buffer in which to store it */ |
void *dummy; |
void *dummy UNUSED; |
{ |
{ |
size_t len = strlen(word); |
size_t len = strlen(word); |
|
|
|
|
*/ |
*/ |
static Boolean |
static Boolean |
VarLowercase(word, addSpace, buf, dummy) |
VarLowercase(word, addSpace, buf, dummy) |
const char *word; /* Word to Lower Case */ |
const char *word; /* Word to Lower Case */ |
Boolean addSpace; /* True if need to add a space to the buffer |
Boolean addSpace; /* True if need to add a space to the buffer |
* before sticking in the head */ |
* before sticking in the head */ |
Buffer buf; /* Buffer in which to store it */ |
Buffer buf; /* Buffer in which to store it */ |
void *dummy; |
void *dummy UNUSED; |
{ |
{ |
size_t len = strlen(word); |
size_t len = strlen(word); |
|
|
|
|
*/ |
*/ |
static Boolean |
static Boolean |
VarHead(word, addSpace, buf, dummy) |
VarHead(word, addSpace, buf, dummy) |
const char *word; /* Word to trim */ |
const char *word; /* Word to trim */ |
Boolean addSpace; /* True if need to add a space to the buffer |
Boolean addSpace; /* True if need to add a space to the buffer |
* before sticking in the head */ |
* before sticking in the head */ |
Buffer buf; /* Buffer in which to store it */ |
Buffer buf; /* Buffer in which to store it */ |
void *dummy; |
void *dummy UNUSED; |
{ |
{ |
const char *slash; |
const char *slash; |
|
|
slash = strrchr(word, '/'); |
slash = strrchr(word, '/'); |
if (slash != NULL) { |
if (slash != NULL) { |
|
|
else |
else |
Buf_AddChar(buf, '.'); |
Buf_AddChar(buf, '.'); |
} |
} |
return(dummy ? TRUE : TRUE); |
return TRUE; |
} |
} |
|
|
/*- |
/*- |
|
|
*/ |
*/ |
static Boolean |
static Boolean |
VarTail(word, addSpace, buf, dummy) |
VarTail(word, addSpace, buf, dummy) |
const char *word; /* Word to trim */ |
const char *word; /* Word to trim */ |
Boolean addSpace; /* TRUE if need to stick a space in the |
Boolean addSpace; /* TRUE if need to stick a space in the |
* buffer before adding the tail */ |
* buffer before adding the tail */ |
Buffer buf; /* Buffer in which to store it */ |
Buffer buf; /* Buffer in which to store it */ |
void *dummy; |
void *dummy UNUSED; |
{ |
{ |
const char *slash; |
const char *slash; |
|
|
if (addSpace) |
if (addSpace) |
Buf_AddSpace(buf); |
Buf_AddSpace(buf); |
|
|
Buf_AddString(buf, slash+1); |
Buf_AddString(buf, slash+1); |
else |
else |
Buf_AddString(buf, word); |
Buf_AddString(buf, word); |
return (dummy ? TRUE : TRUE); |
return TRUE; |
} |
} |
|
|
/*- |
/*- |
|
|
*/ |
*/ |
static Boolean |
static Boolean |
VarSuffix(word, addSpace, buf, dummy) |
VarSuffix(word, addSpace, buf, dummy) |
const char *word; /* Word to trim */ |
const char *word; /* Word to trim */ |
Boolean addSpace; /* TRUE if need to add a space before placing |
Boolean addSpace; /* TRUE if need to add a space before placing |
* the suffix in the buffer */ |
* the suffix in the buffer */ |
Buffer buf; /* Buffer in which to store it */ |
Buffer buf; /* Buffer in which to store it */ |
void *dummy; |
void *dummy UNUSED; |
{ |
{ |
const char *dot; |
const char *dot; |
|
|
dot = strrchr(word, '.'); |
dot = strrchr(word, '.'); |
if (dot != NULL) { |
if (dot != NULL) { |
|
|
Buf_AddString(buf, dot+1); |
Buf_AddString(buf, dot+1); |
addSpace = TRUE; |
addSpace = TRUE; |
} |
} |
return (dummy ? addSpace : addSpace); |
return addSpace; |
} |
} |
|
|
/*- |
/*- |
|
|
*/ |
*/ |
static Boolean |
static Boolean |
VarRoot(word, addSpace, buf, dummy) |
VarRoot(word, addSpace, buf, dummy) |
const char *word; /* Word to trim */ |
const char *word; /* Word to trim */ |
Boolean addSpace; /* TRUE if need to add a space to the buffer |
Boolean addSpace; /* TRUE if need to add a space to the buffer |
* before placing the root in it */ |
* before placing the root in it */ |
Buffer buf; /* Buffer in which to store it */ |
Buffer buf; /* Buffer in which to store it */ |
void *dummy; |
void *dummy UNUSED; |
{ |
{ |
const char *dot; |
const char *dot; |
|
|
if (addSpace) |
if (addSpace) |
Buf_AddSpace(buf); |
Buf_AddSpace(buf); |
|
|
Buf_AddInterval(buf, word, dot); |
Buf_AddInterval(buf, word, dot); |
else |
else |
Buf_AddString(buf, word); |
Buf_AddString(buf, word); |
return (dummy ? TRUE : TRUE); |
return TRUE; |
} |
} |
|
|
/*- |
/*- |