Skip to content
Snippets Groups Projects
Commit 82ff86ed authored by rswindell's avatar rswindell
Browse files

Created getfext() function to return a pointer the extension portion of a

path/filename (or NULL if no extension exists).
parent c8915395
No related branches found
No related tags found
No related merge requests found
...@@ -95,6 +95,20 @@ char* DLLCALL getfname(const char* path) ...@@ -95,6 +95,20 @@ char* DLLCALL getfname(const char* path)
return(fname); return(fname);
} }
/****************************************************************************/
/* Return a pointer to a file's extesion (beginning with '.') */
/****************************************************************************/
char* DLLCALL getfext(const char* path)
{
char *fname;
char *fext;
fname=getfname(path);
fext=strrchr(fname,'.');
if(fext==NULL || fext==fname)
return(NULL);
return(fext);
}
/****************************************************************************/ /****************************************************************************/
/* Break a path name into components. */ /* Break a path name into components. */
......
...@@ -210,6 +210,7 @@ DLLEXPORT time_t DLLCALL fdate(const char *filename); ...@@ -210,6 +210,7 @@ DLLEXPORT time_t DLLCALL fdate(const char *filename);
DLLEXPORT int DLLCALL setfdate(const char* filename, time_t t); DLLEXPORT int DLLCALL setfdate(const char* filename, time_t t);
DLLEXPORT BOOL DLLCALL isdir(const char *filename); DLLEXPORT BOOL DLLCALL isdir(const char *filename);
DLLEXPORT char* DLLCALL getfname(const char* path); DLLEXPORT char* DLLCALL getfname(const char* path);
DLLEXPORT char* DLLCALL getfext(const char* path);
DLLEXPORT int DLLCALL getfattr(const char* filename); DLLEXPORT int DLLCALL getfattr(const char* filename);
DLLEXPORT ulong DLLCALL getfreediskspace(const char* path, ulong unit); DLLEXPORT ulong DLLCALL getfreediskspace(const char* path, ulong unit);
DLLEXPORT ulong DLLCALL delfiles(char *inpath, char *spec); DLLEXPORT ulong DLLCALL delfiles(char *inpath, char *spec);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment