gpp4  1.3.1
Macros | Typedefs | Functions
ccp4_program.h File Reference

Header file for utilies to set and fetch program information. More...

Go to the source code of this file.

Macros

#define CCP4_VERSION_NO   "6.1"
 
#define CCP4_PATCH_LEVEL   "6.1.24"
 
#define GPP4_VERSION_NO   "1.3.1"
 
#define MAXLEN_PROGNAME   80
 
#define MAXLEN_PROGVERSION   80
 
#define MAXLEN_RCSDATE   80
 

Typedefs

typedef int(* CCP4INTFUNCPTR) (int, char *)
 

Functions

char * ccp4_prog_vers (const char *progvers)
 
char * ccp4ProgramName (const char *progname)
 
char * ccp4RCSDate (const char *rcs_string)
 
void ccp4ProgramTime (int init)
 
int ccp4VerbosityLevel (int level)
 
int ccp4Callback (CCP4INTFUNCPTR mycallback, char *mode, int ierr, char *message)
 
int ccp4SetCallback (CCP4INTFUNCPTR mycallback)
 
int ccp4InvokeCallback (int ierr, char *message)
 
int ccp4NullCallback (int level, char *message)
 
int ccp4_licence_exists (const char *name)
 
int html_log_output (int ihtml_in)
 
int summary_output (int isumm_in)
 

Detailed Description

Header file for utilies to set and fetch program information.

Author
Peter Briggs, CCP4
Date
May 2001

Macro Definition Documentation

#define CCP4_PATCH_LEVEL   "6.1.24"

Patch level of CCP4 that gpp4 is derived from

Referenced by ccp4_banner().

#define CCP4_VERSION_NO   "6.1"

CCP4 library version this version is derived from

#define GPP4_VERSION_NO   "1.3.1"

GPP4 version is defined by autoconf

Referenced by ccp4_banner(), and ccp4fyp().

#define MAXLEN_PROGNAME   80

Maximum length of program name

Referenced by ccp4ProgramName().

#define MAXLEN_PROGVERSION   80

Maximum length of program version string

Referenced by ccp4_prog_vers().

#define MAXLEN_RCSDATE   80

Maximum length of date string

Referenced by ccp4RCSDate().

Typedef Documentation

typedef int(* CCP4INTFUNCPTR) (int, char *)

Define a type which is a pointer to a function taking an integer and a pointer to character, and returning an integer

Function Documentation

int ccp4_licence_exists ( const char *  name)

Check existence of licence agreement

Parameters
nameName of licence, e.g. "CCP4".
Returns
1 for licence exists, else 0.

Check existence of licence agreement

Parameters
nameName of licence, e.g. "CCP4".
Returns
always return 1. This is a dummy routine in gpp4.
char* ccp4_prog_vers ( const char *  progvers)

Register or query program version.

Parameters
progversProgram version string, or NULL to query existing value.
Returns
Program version string.

References MAXLEN_PROGVERSION.

Referenced by ccp4_banner(), and ccp4fyp().

int ccp4Callback ( CCP4INTFUNCPTR  mycallback,
char *  mode,
int  ierr,
char *  message 
)

Set or invoke a user-defined callback function The callback must be of the form "function(const int, const char *)" This is essentially an internal function which operates in one of two modes - in "set" mode the named function is stored and the remaining arguments are discarded; in "invoke" mode the stored function is executed with the supplied values (the supplied name is discarded).

Parameters
mycallbackCallback function (discarded in "invoke" mode)
modeEither "set" or "invoke"
ierrAn error level equivalent to that used in ccperror
messageA message string equivalent to that used in ccperror
Returns
Result of the executed function (invoke mode)

Set or invoke a user-defined callback function. Internal function: applications should use the API functions ccp4SetCallback and ccp4InvokeCallback

References ccp4NullCallback().

Referenced by ccp4InvokeCallback(), and ccp4SetCallback().

int ccp4InvokeCallback ( int  ierr,
char *  message 
)

Invoke the user-defined callback function This is a wrapper to ccp4Callback - it executes the user-defined callback function previously stored.

Parameters
ierrAn error level equivalent to that used in ccperror
messageA message string equivalent to that used in ccperror
Returns
Result of the executed function

Execute the user-defined callback function (previously set up using ccp4SetCallback) with the supplied arguments. This is a wrapper to ccp4Callback in "invoke" mode.

References ccp4Callback(), and ccp4NullCallback().

int ccp4NullCallback ( int  level,
char *  message 
)

A dummy callback function used by default in ccp4CallOnExit Internal function. This function does nothing.

Parameters
levelSeverity level supplied from ccperror
messageMessage text supplied from ccperror
Returns
Always returns 1

Default null callback function Internal function: this is the default callback function used by ccp4Callback if no user-defined function has been specified.

Referenced by ccp4Callback(), and ccp4InvokeCallback().

char* ccp4ProgramName ( const char *  progname)

Set or return program name.

Parameters
prognameProgram name, or NULL to query existing value.
Returns
Program name

Set or return program name.

Parameters
prognameProgram name, or NULL to query existing value.
Returns
Program name

Always returns a pointer to the program name If progname is not NULL then set the program name to progname.

Note
Default program name will be returned as "CCP4", until reset by the calling subprogram.

References MAXLEN_PROGNAME.

Referenced by ccp4_banner(), ccp4fyp(), and ccperror_noexit().

void ccp4ProgramTime ( int  init)

Set or print program time information

Parameters
initSet or print program time information
initThe timer is started when this routine is called with a non-zero argument. When the routine is called with a 0 argument, timing information is printed to stdout.
Note
Only one timer can be handled.

References ccp4_utils_etime().

Referenced by ccp4fyp(), ccperror_noexit(), and FORTRAN_SUBR().

char* ccp4RCSDate ( const char *  rcs_string)

Set or return program RCS date

Parameters
rcs_stringDate string, or NULL to query existing value.
Returns
Date string

Set or return program RCS date

Parameters
rcs_stringDate string, or NULL to query existing value.
Returns
Date string

If the input string is not a NULL pointer then it is assumed to be an RCS string This is processed to extract a date string in the form "DD/MM/YY" (day/month/year), which is then stored.

ccp4RCSDate always returns the currently stored date string.

Note
This routine does not make sense in gpp4, since RCS idents are not expanede in the SCM system we are using.

References MAXLEN_RCSDATE.

int ccp4SetCallback ( CCP4INTFUNCPTR  mycallback)

Set a user-defined callback function This is a wrapper to ccp4Callback - it stores a user-defined callback function which must be of the form "function(const int, const char *)"

Parameters
mycallbackCallback function
Returns
1 (if the function is stored), 0 (if it is not)

Store a pointer to a user-defined callback function of the form "int func(int, char *)" This is a wrapper to ccp4Callback in "set" mode.

References ccp4Callback().

int ccp4VerbosityLevel ( int  level)

Set or return the reference verbosity level Always return the verbosity level - if verboselevel is between 0 and 9 then reset the verbosity level to verboselevel

Parameters
levelVerbosity level, or -1 to query existing value.
Returns
Verbosity level

Set or return the reference verbosity level

Parameters
levelVerbosity level, or -1 to query existing value.
Returns
Verbosity level Always return the verbosity level - if verboselevel is between 0 and 9 then reset the verbosity level to verboselevel

Referenced by ccp4fyp(), and ccp4printf().

int html_log_output ( int  ihtml_in)

Register or query html output level.

Parameters
ihtml_in0 = turn off html output, 1 = turn on html output, -1 = query existing value
Returns
0 = no html output, 1 = html output

Register or query html output level.

Parameters
ihtml_in0 = turn off html output, 1 = turn on html output, -1 = query existing value
Returns
0 = no html output, 1 = html output html_log_output and summary_output currently only used by ccperror to tidy up Fortran program output. Defaults are 0 for C programs.

Referenced by ccperror_noexit().

int summary_output ( int  isumm_in)

Register or query summary output level.

Parameters
isumm_in0 = turn off summary output, 1 = turn on summary output, -1 = query existing value
Returns
0 = no summary output, 1 = summary output

Referenced by ccperror_noexit().