extname.c

extname in c

Stars
6

extname.c Build Status

extname for clib

Installation

Install with clib:

$ clib install jb55/extname.c

Example

// 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

API

const char *extname(const char *filename);

arguments

  • filename a filename

returns

  • pointer to the part of the filename which holds the extension,
    otherwise, a pointer to an empty string.

License

MIT

Badges
Extracted from project README
Build Status