extname for clib
Install with clib:
$ clib install jb55/extname.c
// build with -Ideps
#include "extname/extname.h"
strcmp(extname("some/extension.ext"), ".ext") == 0
strcmp(extname(".derp"), ".derp") == 0
strcmp(extname("."), ".") == 0
strcmp(extname("nothing"), "") == 0
arguments
filename
a filename
returns
- pointer to the part of the filename which holds the extension, otherwise, a pointer to an empty string.
MIT