Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

filename.c File Reference

Implementation of the functions operating on sets of Tfilename. More...

#include "filename.h"
#include "error.h"
#include "defines.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

Go to the source code of this file.

Functions

void CreateFileName (char *path, char *name, char *suffix, char *ext, Tfilename *fn)
 Constructor.
char * GetFileFullName (Tfilename *fn)
 Gets the file full name (paht+name+extension).
char * GetFilePath (Tfilename *fn)
 Gets the file path.
char * GetFileName (Tfilename *fn)
 Gets the file name.
char * GetFileBaseName (Tfilename *fn)
 Gets the file base name (paht+name) .
char * GetFileExtension (Tfilename *fn)
 Gets the file extension.
void DeleteFileName (Tfilename *fn)
 Destructor.

Detailed Description

Functions to deal with Tfilename.

See also:
filename.h, Tfilename .

Definition in file filename.c.


Function Documentation

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

Generates a Tfilename structure.

Parameters:
path The path. If not given we get it from the system and is the path from of the directory from where the application is exeucted.
name The 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.
suffix A suffix to add to the name. Possibly NULL.
ext The extension for the file.
fn The filename structure to create.

Definition at line 21 of file filename.c.

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

Referenced by InitParametersFromFile(), main(), PrintWorldCS(), and SampleCuikSystemInBox().

Here is the call graph for this function:

Here is the caller graph for this function:

char* GetFileFullName ( Tfilename fn  ) 

Gets the file full name (paht+name+extension).

Parameters:
fn The filename structure.
Returns:
Returns the full name for the file.

Definition at line 130 of file filename.c.

References Tfilename::fullName.

Referenced by InitParametersFromFile(), main(), PrintWorldCS(), and SampleCuikSystemInBox().

Here is the caller graph for this function:

char* GetFilePath ( Tfilename fn  ) 

Gets the file path.

Parameters:
fn The filename structure.
Returns:
Returns the path for the file.

Definition at line 135 of file filename.c.

References Tfilename::path.

Referenced by PrintWorldCS().

Here is the caller graph for this function:

char* GetFileName ( Tfilename fn  ) 

Gets the file name.

Parameters:
fn The filename structure.
Returns:
Returns the name for the file.

Definition at line 140 of file filename.c.

References Tfilename::name.

Referenced by PrintWorldCS().

Here is the caller graph for this function:

char* GetFileBaseName ( Tfilename fn  ) 

Gets the file base name (paht+name).

Parameters:
fn The filename structure.
Returns:
Returns the base name (paht+name) for the file.

Definition at line 145 of file filename.c.

References Tfilename::baseName.

char* GetFileExtension ( Tfilename fn  ) 

Gets the file extension.

Parameters:
fn The filename structure.
Returns:
Returns the extension for the file.

Definition at line 150 of file filename.c.

References Tfilename::ext.

void DeleteFileName ( Tfilename fn  ) 

Deleltes the Tfilename structure.

Parameters:
fn The filename structure to delete.

Definition at line 155 of file filename.c.

References Tfilename::ext, Tfilename::fullName, Tfilename::name, and Tfilename::path.

Referenced by InitParametersFromFile(), main(), PrintWorldCS(), and SampleCuikSystemInBox().

Here is the caller graph for this function: