Main Page | Files | Data Structures | Functions | Global Variables |
gpiv-utils.h File Reference

miscellaneous utilities More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GPIV_FAIL_INT   -914
 

Functions

void gpiv_scan_parameter (const gchar *PAR_KEY, const gchar *parfile, void *pstruct, gboolean verbose)
 Reads parameters from local parameter file PARFILE. More...
 
gchar * gpiv_scan_resourcefiles (const gchar *PAR_KEY, void *pstruct, gint verbose)
 Opens resource files GPIV_HOME_RSC_FILE (hidden) and SYSTEM_RSC_DIR, GPIV_SYSTEM_RSC_FILE Reads parameters from it. More...
 
gchar * gpiv_add_datetime_to_comment (gchar *comment)
 Adds date and timesatmp to the comment for ASCII-formatted data. More...
 
gchar * gpiv_sort_3 (const unsigned long n, gfloat arr[], gfloat arr_2[], gfloat arr_3[])
 Orders array arr AND its belonging arrays arr_2 and arr_3 Also swaps accompanying arrays. More...
 
long gpiv_lmax (long a, long b)
 Calculates maximum of longs a and b. More...
 
long gpiv_lmin (long a, long b)
 Calculates minimum of longs a and b. More...
 
gint gpiv_max (gint a, gint b)
 Calculates maximum of integers a and b. More...
 
gint gpiv_min (gint a, gint b)
 Calculates minimum of integers a and b. More...
 
void gpiv_warning (gchar *message,...)
 Prints warning message with variable argumanent list. More...
 
void gpiv_error (gchar *message,...)
 Prints error handling with variable argumanent list to stdout and exits program. More...
 
gboolean gpiv_fscan_iph_nl (FILE *fp_h, const gchar *MOD_KEY, const gchar *PAR_KEY, const gboolean use_mod_key, gchar *line, const gchar *par_name, gint *parameter, const gboolean verbose, FILE *fp)
 Scans line string on integer parameter key and value or image header value (without program key). More...
 
gboolean gpiv_scan_iph (const gchar *MOD_KEY, const gchar *PAR_KEY, const gboolean use_mod_key, const gchar *line, const gchar *par_name, gint *parameter, const gboolean verbose, FILE *fp)
 Scans line string on int parameter key and value or image header value (without program key). More...
 
gboolean gpiv_scan_cph (const gchar *MOD_KEY, const gchar *PAR_KEY, const gboolean use_mod_key, const gchar *line, const gchar *par_name, gchar *parameter, const gboolean verbose, FILE *fp)
 Scans line string on char parameter key and value or image header value (without program key). More...
 
gboolean gpiv_scan_fph (const gchar *MOD_KEY, const gchar *PAR_KEY, const gboolean use_mod_key, const gchar *line, const gchar *par_name, gfloat *parameter, const gboolean verbose, FILE *fp)
 Scans line string on gfloat parameter/header key and value or image header value (without program key). More...
 
gboolean gpiv_scan_sph (const gchar *MOD_KEY, const gchar *PAR_KEY, const gboolean use_mod_key, const gchar *line, const gchar *par_name, gchar *parameter, const gboolean verbose, FILE *fp)
 Scans line string on string parameter key and value or image header value (without program key). More...
 

Detailed Description

miscellaneous utilities

SOURCES: lib/utils.c

LAST MODIFICATION DATE:

Id
gpiv-utils.h,v 1.1 2007-11-23 16:12:18 gerber Exp

Definition in file gpiv-utils.h.

Macro Definition Documentation

◆ GPIV_FAIL_INT

#define GPIV_FAIL_INT   -914

Definition at line 54 of file gpiv-utils.h.

Function Documentation

◆ gpiv_add_datetime_to_comment()

gchar* gpiv_add_datetime_to_comment ( gchar *  comment)

Adds date and timesatmp to the comment for ASCII-formatted data.

Parameters
[in]commentcharacter string
Returns
comment including date and time on success or NULL on failure

◆ gpiv_error()

void gpiv_error ( gchar *  message,
  ... 
)

Prints error handling with variable argumanent list to stdout and exits program.

Parameters
[in]messagewarning message
Returns
void

◆ gpiv_fscan_iph_nl()

gboolean gpiv_fscan_iph_nl ( FILE *  fp_h,
const gchar *  MOD_KEY,
const gchar *  PAR_KEY,
const gboolean  use_mod_key,
gchar *  line,
const gchar *  par_name,
gint *  parameter,
const gboolean  verbose,
FILE *  fp 
)

Scans line string on integer parameter key and value or image header value (without program key).

The value to be read is on the next line (_nl) of the key.

Parameters
[in]fp_hfile pointer of header to read the data from
[in]MOD_KEYModule key as part of parameter key
[in]PAR_KEYparameter key
[in]use_mod_keyflag to use program key
[in]lineline to be scanned
[in]par_nameparameter name which is scanned in line
[out]parameterparameter value to be returned
[in]verboseflag to print prarameter to stdout
[in]fpfile pointer to print parameter to
Returns
flag representing parameter__set. Set to TRUE if parameter has been read, else FALSE

◆ gpiv_lmax()

long gpiv_lmax ( long  a,
long  b 
)

Calculates maximum of longs a and b.

Parameters
[in]afirst variable to be tested
[in]bsecond variable to be tested
Returns
result of maximum

◆ gpiv_lmin()

long gpiv_lmin ( long  a,
long  b 
)

Calculates minimum of longs a and b.

Parameters
[in]afirst variable to be tested
[in]bsecond variable to be tested
Returns
result of minimum

◆ gpiv_max()

gint gpiv_max ( gint  a,
gint  b 
)

Calculates maximum of integers a and b.

Parameters
[in]afirst variable to be tested
[in]bsecond variable to be tested
Returns
result of maximum

◆ gpiv_min()

gint gpiv_min ( gint  a,
gint  b 
)

Calculates minimum of integers a and b.

Parameters
[in]afirst variable to be tested
[in]bsecond variable to be tested
Returns
result of minimum

◆ gpiv_scan_cph()

gboolean gpiv_scan_cph ( const gchar *  MOD_KEY,
const gchar *  PAR_KEY,
const gboolean  use_mod_key,
const gchar *  line,
const gchar *  par_name,
gchar *  parameter,
const gboolean  verbose,
FILE *  fp 
)

Scans line string on char parameter key and value or image header value (without program key).

Prints result to file.

Parameters
[in]MOD_KEYmodule key as part of parameter key
[in]PAR_KEYparameter key
[in]use_mod_keyflag to use module key
[in]lineline to be scanned
[in]par_nameparameter name which is scanned in line
[out]parameterparameter value to be returned
[in]verboseflag to print prarameter to stdout
[in]fpfile pointer to print parameter to
Returns
flag representing parameter__set. Set to TRUE if parameter has been read, else FALSE

◆ gpiv_scan_fph()

gboolean gpiv_scan_fph ( const gchar *  MOD_KEY,
const gchar *  PAR_KEY,
const gboolean  use_mod_key,
const gchar *  line,
const gchar *  par_name,
gfloat *  parameter,
const gboolean  verbose,
FILE *  fp 
)

Scans line string on gfloat parameter/header key and value or image header value (without program key).

Prints result to file.

Parameters
[in]MOD_KEYmodule key as part of parameter key
[in]PAR_KEYparameter key
[in]use_mod_keyflag to use module key
[in]lineline to be scanned
[in]par_nameparameter name which is scanned in line
[out]parameterparameter value to be returned
[in]verboseflag to print prarameter to stdout
[in]fpfile pointer to print parameter to
Returns
flag representing parameter__set. Set to TRUE if parameter has been read, else FALSE

◆ gpiv_scan_iph()

gboolean gpiv_scan_iph ( const gchar *  MOD_KEY,
const gchar *  PAR_KEY,
const gboolean  use_mod_key,
const gchar *  line,
const gchar *  par_name,
gint *  parameter,
const gboolean  verbose,
FILE *  fp 
)

Scans line string on int parameter key and value or image header value (without program key).

Prints result to file.

Parameters
[in]MOD_KEYmodule key as part of parameter key
[in]PAR_KEYparameter key
[in]use_mod_keyflag to use module key
[in]lineline to be scanned
[in]par_nameparameter name which is scanned in line
[out]parameterparameter value to be returned
[in]verboseflag to print prarameter to stdout
[in]fpfile pointer to print parameter to
Returns
flag representing parameter__set. Set to TRUE if parameter has been read, else FALSE

◆ gpiv_scan_parameter()

void gpiv_scan_parameter ( const gchar *  PAR_KEY,
const gchar *  parfile,
void *  pstruct,
gboolean  verbose 
)

Reads parameters from local parameter file PARFILE.

Parameters
[in]PAR_KEYParameter key, specific for each process
[in]parfileParameter file, specific for each process
[in]verboseflag for printing parameters
[out]pstructpointer to parameter structure
Returns
void

◆ gpiv_scan_resourcefiles()

gchar* gpiv_scan_resourcefiles ( const gchar *  PAR_KEY,
void *  pstruct,
gint  verbose 
)

Opens resource files GPIV_HOME_RSC_FILE (hidden) and SYSTEM_RSC_DIR, GPIV_SYSTEM_RSC_FILE Reads parameters from it.

Parameters
[in]PAR_KEYParameter key, specific for each process
[in]verboseparameter to print to stdout
[out]pstructpointer to parameter structure
Returns
NULL on success or error message on failure

◆ gpiv_scan_sph()

gboolean gpiv_scan_sph ( const gchar *  MOD_KEY,
const gchar *  PAR_KEY,
const gboolean  use_mod_key,
const gchar *  line,
const gchar *  par_name,
gchar *  parameter,
const gboolean  verbose,
FILE *  fp 
)

Scans line string on string parameter key and value or image header value (without program key).

Prints result to file.

Parameters
[in]MOD_KEYmodule key as part of parameter key
[in]PAR_KEYparameter key
[in]use_mod_keyflag to use module key
[in]lineline to be scanned
[in]par_nameparameter name which is scanned in line
[out]parameterparameter value to be returned
[in]verboseflag to print prarameter to stdout
[in]fpfile pointer to print parameter to
Returns
flag representing parameter__set. Set to TRUE if parameter has been read, else FALSE

◆ gpiv_sort_3()

gchar* gpiv_sort_3 ( const unsigned long  n,
gfloat  arr[],
gfloat  arr_2[],
gfloat  arr_3[] 
)

Orders array arr AND its belonging arrays arr_2 and arr_3 Also swaps accompanying arrays.

Parameters
[in]nlength of array
[in]arrarray to be sorted
[in]arr_2second belonging array to arr
[in]arr_3third belonging array to arr
Returns
NULL on success or error message on failure

◆ gpiv_warning()

void gpiv_warning ( gchar *  message,
  ... 
)

Prints warning message with variable argumanent list.

Parameters
[in]messagewarning message
Returns
void

Generated for libgpiv-0.6.1 by doxygen 1.8.13