| 1 |
/* FILE: filenames.h |
| 2 |
* PURPOSE: functions for handling file names |
| 3 |
*/ |
| 4 |
|
| 5 |
/* |
| 6 |
* Determine extension of <str>. |
| 7 |
*/ |
| 8 |
char *extension(char *str); |
| 9 |
|
| 10 |
/* |
| 11 |
* Basename is the functional equivalent of BSD's basename utility. |
| 12 |
* When the suffix is NULL no suffix removal is done. When needed |
| 13 |
* a new string is allocated so that the original value of str is |
| 14 |
* not changed. |
| 15 |
*/ |
| 16 |
char *basename(char *str, const char *suffix); |
| 17 |
|
| 18 |
/* |
| 19 |
* Newname builds a new filename by adding or replacing the extension |
| 20 |
* of the given <name> with the new supplied <ext>. |
| 21 |
*/ |
| 22 |
char *newname(char *name, const char *ext); |
| 23 |
|
| 24 |
/* |
| 25 |
* ps_resource returns true if name can be treated as a PS resource |
| 26 |
*/ |
| 27 |
int ps_resource(const char *name); |