SphinxBase 5prealpha
filename.h File Reference

File names related operation. More...

#include <sphinxbase/sphinxbase_export.h>
#include <sphinxbase/prim_type.h>

Go to the source code of this file.

Functions

SPHINXBASE_EXPORT const char * path2basename (const char *path)
 Returns the last part of the path, without modifying anything in memory.
 
SPHINXBASE_EXPORT void path2dirname (const char *path, char *dir)
 Strip off filename from the given path and copy the directory name into dir Caller must have allocated dir (hint: it's always shorter than path).
 
SPHINXBASE_EXPORT void strip_fileext (const char *file, char *root)
 Strip off the smallest trailing file-extension suffix and copy the rest into the given root argument.
 
SPHINXBASE_EXPORT int path_is_absolute (const char *file)
 Test whether a pathname is absolute for the current OS.
 

Detailed Description

File names related operation.

Definition in file filename.h.

Function Documentation

◆ path2basename()

SPHINXBASE_EXPORT const char * path2basename ( const char * path)

Returns the last part of the path, without modifying anything in memory.

Definition at line 53 of file filename.c.

References path2basename().

Referenced by path2basename().

◆ path2dirname()

SPHINXBASE_EXPORT void path2dirname ( const char * path,
char * dir )

Strip off filename from the given path and copy the directory name into dir Caller must have allocated dir (hint: it's always shorter than path).

Definition at line 68 of file filename.c.

References path2dirname().

Referenced by build_directory(), and path2dirname().

◆ path_is_absolute()

SPHINXBASE_EXPORT int path_is_absolute ( const char * file)

Test whether a pathname is absolute for the current OS.

Definition at line 105 of file filename.c.

References path_is_absolute().

Referenced by ngram_model_set_read(), and path_is_absolute().

◆ strip_fileext()

SPHINXBASE_EXPORT void strip_fileext ( const char * file,
char * root )

Strip off the smallest trailing file-extension suffix and copy the rest into the given root argument.

Caller must have allocated root.

Definition at line 90 of file filename.c.

References strip_fileext().

Referenced by strip_fileext().