filename.c File Reference

Detailed Description

Functions to deal with Tfilename.

See Also
filename.h, Tfilename .

Definition in file filename.c.

Functions

void CreateFileName (char *path, char *name, char *suffix, char *ext, Tfilename *fn)
 Constructor. More...
 
char * GetFileFullName (Tfilename *fn)
 Gets the file full name (paht+name+extension). More...
 
char * GetFilePath (Tfilename *fn)
 Gets the file path. More...
 
char * GetFileName (Tfilename *fn)
 Gets the file name. More...
 
char * GetFileBaseName (Tfilename *fn)
 Gets the file base name (paht+name) . More...
 
char * GetFileExtension (Tfilename *fn)
 Gets the file extension. More...
 
void LinkFileNmeWithExtension (Tfilename *fn1, char *ext, Tfilename *fn2)
 Creates a link to a given filename. More...
 
void DeleteFileName (Tfilename *fn)
 Destructor. More...
 

Function Documentation

void CreateFileName ( char *  path,
char *  name,
char *  suffix,
char *  ext,
Tfilename fn 
)

Generates a Tfilename structure.

Parameters
pathThe path. If not given we get it from the system and is the path from of the directory from where the application is exeucted.
nameThe name of the file. If the given name includes part of a path, it is removed from the name and added to the path data field.
suffixA suffix to add to the name. Possibly NULL.
extThe extension for the file.
fnThe filename structure to create.

Definition at line 22 of file filename.c.

References Tfilename::baseName, Error(), Tfilename::ext, FALSE, Tfilename::fullName, Tfilename::name, NEW, and Tfilename::path.

Referenced by GetAtomPositions(), IncrementalSampleCuikSystemInBox(), InitCSWDFromFile(), InitParametersFromFile(), LinkFileNmeWithExtension(), LoadAtlasRRT(), main(), on_cuikexplore_save(), on_cuikmove_save(), PlotAtlasRRT(), PlotConnection(), PlotQrand(), PrintPolyhedron(), PrintWorld(), PrintWorldCS(), ReadOneSample(), ReadResidueList(), ReadRigidsAndHinges(), ReadTwoSamples(), SampleCuikSystemInBox(), SaveAtlasRRT(), SaveChartCenters(), SaveRRTCosts(), SaveRRTNodes(), SaveSamples(), SaveSamplesN(), and SaveSingularCharts().

char* GetFilePath ( Tfilename fn)

Gets the file path.

Parameters
fnThe filename structure.
Returns
Returns the path for the file.

Definition at line 156 of file filename.c.

References Tfilename::path.

Referenced by LinkFileNmeWithExtension(), on_cuikmove_save(), PrintWorld(), and PrintWorldCS().

char* GetFileName ( Tfilename fn)

Gets the file name.

Parameters
fnThe filename structure.
Returns
Returns the name for the file.

Definition at line 161 of file filename.c.

References Tfilename::name.

Referenced by LinkFileNmeWithExtension(), main(), PrintWorld(), and PrintWorldCS().

char* GetFileBaseName ( Tfilename fn)

Gets the file base name (paht+name).

Parameters
fnThe filename structure.
Returns
Returns the base name (paht+name) for the file.

Definition at line 166 of file filename.c.

References Tfilename::baseName.

Referenced by main().

char* GetFileExtension ( Tfilename fn)

Gets the file extension.

Parameters
fnThe filename structure.
Returns
Returns the extension for the file.

Definition at line 171 of file filename.c.

References Tfilename::ext.

Referenced by InitPolyhedronFromFile(), and PrintWorld().

void LinkFileNmeWithExtension ( Tfilename fn1,
char *  ext,
Tfilename fn2 
)

Creates a link to a given filename with a given extension.

Parameters
fn1File to link.
extExtension of the files.
fn2File name of the link.

Definition at line 177 of file filename.c.

References CreateFileName(), DeleteFileName(), GetFileFullName(), GetFileName(), and GetFilePath().

Referenced by main().