Main Page | Data Structures | File List | Data Fields | Globals

clp.c File Reference

Fault-tolerant structure to store the values of all command line arguments. More...

Go to the source code of this file.

Data Structures

struct  CommandLineParameters

Defines

#define CLP_VERSION   "1.0.4"
#define CLP_DATE   "29-Jan-2004"

Typedefs

typedef CommandLineParametersCLP_Ptr
 A pointer to structure CommandLineParameters is assigned the name CLP_Ptr.


Functions

CLP_Ptr CLP_create (void)
 Creates a CommandLineParameters structure.

void CLP_destroy (CLP_Ptr clpPtr)
 Destroys a structure CommandLineParameters.

void CLP_display (const CLP_Ptr clpPtr, FILE *outputStream)
 Displays a structure CommandLineParameters.

void CLP_setOutputFile (const CLP_Ptr clpPtr, const char *const name)
 The name of the output file is set.

char * CLP_getOutputFile (const CLP_Ptr clpPtr)
 The name of the output file is returned.

void CLP_setReactionFile (const CLP_Ptr clpPtr, const char *const name)
 The name of the reaction file is set.

char * CLP_getReactionFile (const CLP_Ptr clpPtr)
 The name of the reaction file is returned.

void CLP_setErrorLogFile (const CLP_Ptr clpPtr, const char *const name)
 The name of the error log file is set.

char * CLP_getErrorLogFile (const CLP_Ptr clpPtr)
 The name of the error log file is returned.

void CLP_setFilterFile (const CLP_Ptr clpPtr, const char *const name)
 The name of the filter file is set.

char * CLP_getFilterFile (const CLP_Ptr clpPtr)
 The name of the filter file is returned.

void CLP_setSmartsFile (const CLP_Ptr clpPtr, const char *const name)
 The name of the Smarts file is set.

char * CLP_getSmartsFile (const CLP_Ptr clpPtr)
 The name of the Smarts file is returned.


Detailed Description

Fault-tolerant structure to store the values of all command line arguments.

This structure provides a fault-tolerant way to store the values of all command line arguments. The values are set to their default values during the creation of the structure via CLP_create. The memory allocation of the members of the structure is managed automatically.

The structure is created with CLP_create, destroyed with CLP_destroy and displayed with CLP_display. With CLP_setnameOfVariable and CLP_getnameOfVariable the values of the individual members of the structure CommandLineParameters could be set or gotten.

Whenever a string is set the provided string is copied via strncpy. Hence, the string provided as an argument has to be freed by the caller of the function.

Description of the members:

outputFile - string containing the name of the output file.
reactionFile - string storing the name of the reaction file.
errorLogFile - string storing the name of the SMILES error log file.

Author:
Uli Fechner
Version:
05/13/2003 - Uli Fechner - v1.0.0 - initial release

24/11/2003 - Uli Fechner - v1.0.1 - modified according to the needs of retroflux

03/12/2003 - Uli Fechner - v1.0.2 - added the member errorLogFile

07/01/2004 - Uli Fechner - v1.0.3 - added the member filterFile

29/01/2004 - Tina Grabowski - v1.0.4 - added the member smartsFile and the corresponding functions CLP_getSmartsFile and CLP_setSmartsFile; consideration of smartsFile in CLP_create, CLP_display and CLP_destroy \code

Definition in file clp.c.


Define Documentation

#define CLP_DATE   "29-Jan-2004"
 

Definition at line 3 of file clp.c.

Referenced by displayVersionInformation().

#define CLP_VERSION   "1.0.4"
 

Definition at line 2 of file clp.c.

Referenced by displayVersionInformation().


Typedef Documentation

typedef CommandLineParameters* CLP_Ptr
 

A pointer to structure CommandLineParameters is assigned the name CLP_Ptr.

Definition at line 48 of file clp.c.

Referenced by CLP_create(), displayHelpText(), main(), and parseClp().


Function Documentation

CLP_Ptr CLP_create void   ) 
 

Creates a CommandLineParameters structure.

The structure CommandLineParameters is created. The memory of the structure itself and the members of the structure is allocated automatically. The values of the individual command line parameters are set to default values as written in the help text.

Return values:
CLP_Ptr pointer on the newly created structure CommandLineParameters
Author:
Uli Fechner
Version:
13/05/2003 - Uli Fechner - initial release

24/11/2003 - Uli Fechner - adjusted to the needs of flux

03/12/2003 - Uli Fechner - added support for the member errorLogFile

07/01/2004 - Uli Fechner - added support for the member filterFile

29/01/2004 - Tina Grabowski - added support for the member smartsFile

Definition at line 93 of file clp.c.

References CLP_Ptr, CLP_setErrorLogFile(), CLP_setFilterFile(), CLP_setOutputFile(), CLP_setReactionFile(), CLP_setSmartsFile(), and MemoryError.

Referenced by main().

void CLP_destroy CLP_Ptr  clpPtr  ) 
 

Destroys a structure CommandLineParameters.

The structure CommandLineParameters the pointer clpPtr refers to is destroyed. All allocated memory of the structure and its members is automatically freed.

Attention:
The two strings (outputFile and catsTypeExpression) are freed here, too.
Parameters:
clpPtr pointer on the structure CommandLineParameters that should be destroyed
Author:
Uli Fechner
Version:
13/05/2003 - Uli Fechner - initial release

24/11/2003 - Uli Fechner - adjusted to the needs of retroflux

07/01/2004 - Uli Fechner - added support for the member filterFile

29/01/2004 - Tina Grabowski - added support for the member smartsFile

Definition at line 123 of file clp.c.

References AbortProgram, CLP_getFilterFile(), CLP_getOutputFile(), CLP_getReactionFile(), and CLP_getSmartsFile().

Referenced by main().

void CLP_display CLP_Ptr  clpPtr,
FILE *  outputStream
 

Displays a structure CommandLineParameters.

The structure CommandLineParameters the pointer clpPtr refers to is displayed on the FILE* outputStream.

Parameters:
clpPtr pointer on the structure CommandLineParameters that should be displayed
outputStream FILE* on the stream the output should be sent to
Author:
Uli Fechner
Version:
13/05/2003 - Uli Fechner - initial release

24/11/2003 - Uli Fechner - adjusted to the needs of flux

03/12/2003 - Uli Fechner - added support for the member errorLogFile

07/01/2004 - Uli Fechner - added support for the member filterFile

29/01/2004 - Tina Grabowski - added support for the member smartsFile

Definition at line 159 of file clp.c.

References CLP_getErrorLogFile(), CLP_getFilterFile(), CLP_getOutputFile(), CLP_getReactionFile(), CLP_getSmartsFile(), CommandLineParameters::filterFile, CommandLineParameters::reactionFile, and CommandLineParameters::smartsFile.

Referenced by main().

char * CLP_getErrorLogFile const CLP_Ptr  clpPtr  ) 
 

The name of the error log file is returned.

Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
Return values:
char name of the error log file
Author:
Uli Fechner
Version:
03/12/2003 - Uli Fechner - initial release

Definition at line 272 of file clp.c.

References CommandLineParameters::errorLogFile.

Referenced by CLP_display(), and main().

char * CLP_getFilterFile const CLP_Ptr  clpPtr  ) 
 

The name of the filter file is returned.

Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
Return values:
char name of the filter file
Author:
Uli Fechner
Version:
07/01/2004 - Uli Fechner - initial release

Definition at line 307 of file clp.c.

References CommandLineParameters::filterFile.

Referenced by CLP_destroy(), CLP_display(), and main().

char * CLP_getOutputFile const CLP_Ptr  clpPtr  ) 
 

The name of the output file is returned.

Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
Return values:
char name of the output data file
Author:
Uli Fechner
Version:
13/05/2003 - Uli Fechner - initial release

Definition at line 202 of file clp.c.

References CommandLineParameters::outputFile.

Referenced by CLP_destroy(), CLP_display(), main(), and parseClp().

char * CLP_getReactionFile const CLP_Ptr  clpPtr  ) 
 

The name of the reaction file is returned.

Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
Return values:
char name of the reaction data file
Author:
Uli Fechner
Version:
24/11/2003 - Uli Fechner - initial release

Definition at line 237 of file clp.c.

References CommandLineParameters::reactionFile.

Referenced by CLP_destroy(), CLP_display(), and main().

char * CLP_getSmartsFile const CLP_Ptr  clpPtr  ) 
 

The name of the Smarts file is returned.

Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
Return values:
char name of the Smarts file
Author:
Tina Grabowski
Version:
29/01/2004 - Tina Grabowski - initial release

Definition at line 342 of file clp.c.

References CommandLineParameters::smartsFile.

Referenced by CLP_destroy(), and CLP_display().

void CLP_setErrorLogFile const CLP_Ptr  clpPtr,
const char *const  name
 

The name of the error log file is set.

Attention:
The provided parameter name is copied. name is NOT freed afterwards. This has to be done by the caller of this function.
Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
name name of the error log file
Author:
Uli Fechner
Version:
03/12/2003 - Uli Fechner - initial release

Definition at line 253 of file clp.c.

References CommandLineParameters::errorLogFile, and MemoryError.

Referenced by CLP_create(), and parseClp().

void CLP_setFilterFile const CLP_Ptr  clpPtr,
const char *const  name
 

The name of the filter file is set.

Attention:
The provided parameter name is copied. name is NOT freed afterwards. This has to be done by the caller of this function.
Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
name name of the filter file
Author:
Uli Fechner
Version:
07/01/2004 - Uli Fechner - initial release

Definition at line 288 of file clp.c.

References CommandLineParameters::filterFile, and MemoryError.

Referenced by CLP_create(), and parseClp().

void CLP_setOutputFile const CLP_Ptr  clpPtr,
const char *const  name
 

The name of the output file is set.

Attention:
The provided parameter name is copied. name is NOT freed afterwards. This has to be done by the caller of this function.
Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
name name of the output file
Author:
Uli Fechner
Version:
13/05/2003 - Uli Fechner - initial release

Definition at line 183 of file clp.c.

References MemoryError, and CommandLineParameters::outputFile.

Referenced by CLP_create(), and parseClp().

void CLP_setReactionFile const CLP_Ptr  clpPtr,
const char *const  name
 

The name of the reaction file is set.

Attention:
The provided parameter name is copied. name is NOT freed afterwards. This has to be done by the caller of this function.
Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
name name of the reaction file
Author:
Uli Fechner
Version:
24/11/2003 - Uli Fechner - initial release

Definition at line 218 of file clp.c.

References MemoryError, and CommandLineParameters::reactionFile.

Referenced by CLP_create(), and parseClp().

void CLP_setSmartsFile const CLP_Ptr  clpPtr,
const char *const  name
 

The name of the Smarts file is set.

Attention:
The provided parameter name is copied. name is NOT freed afterwards. This has to be done by the caller of this function.
Parameters:
clpPtr pointer on the structure CommandLineParameters that contains the value
name name of the Smarts file
Author:
Tina Grabowski
Version:
29/01/2004 - Tina Grabowski - initial release

Definition at line 323 of file clp.c.

References MemoryError, and CommandLineParameters::smartsFile.

Referenced by CLP_create().


Generated on Tue Nov 9 16:27:11 2004 for retroflux by doxygen 1.3.6