Sitelet https://github.com/jb55/extname.c
Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

extname in c

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages