Property Lists

Data Structures

struct  _uves_propertylist_
struct  _uves_regexp_

Typedefs

typedef struct _uves_regexp_ uves_regexp
typedef struct _uves_propertylist_ uves_propertylist
 The opaque property list data type.

Enumerations

enum  { FITS_STDKEY_MAX = 8, FITS_SVALUE_MAX = 68 }

Functions

static void propertylist_append_property (uves_propertylist *plist, const cpl_property *p)
static void propertylist_prepend_property_cpl (cpl_propertylist *plist, const cpl_property *p)
static cpl_propertylist * uves_propertylist_to_cpl (const uves_propertylist *self)
static void uves_propertylist_from_cpl (uves_propertylist *self, const cpl_propertylist *list_cpl)
cpl_error_code uves_vector_save (const cpl_vector *v, const char *f, cpl_type_bpp bpp, const uves_propertylist *header, unsigned mode)
cpl_error_code uves_image_save (const cpl_image *image, const char *f, cpl_type_bpp bpp, const uves_propertylist *header, unsigned mode)
cpl_error_code uves_imagelist_save (const cpl_imagelist *imagelist, const char *f, cpl_type_bpp bpp, const uves_propertylist *header, unsigned mode)
cpl_error_code uves_table_save (const cpl_table *table, const uves_propertylist *header, const uves_propertylist *ext_header, const char *filename, unsigned mode)
cpl_error_code uves_dfs_setup_product_header (uves_propertylist *header, const cpl_frame *product_frame, const cpl_frameset *framelist, const cpl_parameterlist *parlist, const char *recid, const char *pipeline_id, const char *dictionary_id)
cpl_error_code uves_table_sort (cpl_table *t, const uves_propertylist *list)
static void error_push (void)
static void error_pop (void)
static cxint _uves_propertylist_filter_regexp (cxcptr key, cxcptr filter)
static cxbool _uves_propertylist_compare (const cpl_property *property, const char *name)
static cxbool _uves_propertylist_compare_regexp (const cpl_property *property, uves_regexp *re)
static uves_deque_iterator _uves_propertylist_find (const uves_propertylist *self, const char *name)
static cpl_property * _uves_propertylist_get (const uves_propertylist *self, const char *name)
static int _uves_propertylist_insert (uves_propertylist *self, const cxchar *where, cxbool after, const cxchar *name, cpl_type type, cxptr value)
static cxint _uves_propertylist_decode_fits (const qfits_header *header, cxint i, cxchar *key, cxint *type, cxchar *value, cxchar *comment)
static cxint _uves_propertylist_from_fits (uves_propertylist *self, const qfits_header *header, cx_compare_func filter, cxcptr data)
uves_propertylistuves_propertylist_new (void)
 Create an empty property list.
uves_propertylistuves_propertylist_duplicate (const uves_propertylist *self)
 Create a copy of the given property list.
void uves_propertylist_delete (const uves_propertylist *self)
 Destroy a property list.
long uves_propertylist_get_size (const uves_propertylist *self)
 Get the current size of a property list.
int uves_propertylist_is_empty (const uves_propertylist *self)
 Check whether a property list is empty.
cpl_type uves_propertylist_get_type (const uves_propertylist *self, const char *name)
 Get the the type of a property list entry.
int uves_propertylist_contains (const uves_propertylist *self, const char *name)
 Check whether a property is present in a property list.
int my_uves_propertylist_contains (const cpl_propertylist *self, const char *name)
 Check whether a property is present in a property list.
cpl_error_code uves_propertylist_set_comment (uves_propertylist *self, const char *name, const char *comment)
 Modify the comment field of the given property list entry.
cpl_error_code uves_propertylist_set_char (uves_propertylist *self, const char *name, char value)
 Set the value of the given character property list entry.
cpl_error_code uves_propertylist_set_bool (uves_propertylist *self, const char *name, int value)
 Set the value of the given boolean property list entry.
cpl_error_code uves_propertylist_set_int (uves_propertylist *self, const char *name, int value)
 Set the value of the given integer property list entry.
cpl_error_code uves_propertylist_set_long (uves_propertylist *self, const char *name, long value)
 Set the value of the given long property list entry.
cpl_error_code uves_propertylist_set_float (uves_propertylist *self, const char *name, float value)
 Set the value of the given float property list entry.
cpl_error_code uves_propertylist_set_double (uves_propertylist *self, const char *name, double value)
 Set the value of the given double property list entry.
cpl_error_code uves_propertylist_set_string (uves_propertylist *self, const char *name, const char *value)
 Set the value of the given string property list entry.
const cpl_property * uves_propertylist_get_const (const uves_propertylist *self, long position)
 Access property list elements by index.
cpl_property * uves_propertylist_get (uves_propertylist *self, long position)
const char * uves_propertylist_get_comment (const uves_propertylist *self, const char *name)
 Get the comment of the given property list entry.
char uves_propertylist_get_char (const uves_propertylist *self, const char *name)
 Get the character value of the given property list entry.
int uves_propertylist_get_bool (const uves_propertylist *self, const char *name)
 Get the boolean value of the given property list entry.
int uves_propertylist_get_int (const uves_propertylist *self, const char *name)
 Get the integer value of the given property list entry.
long uves_propertylist_get_long (const uves_propertylist *self, const char *name)
 Get the long value of the given property list entry.
float uves_propertylist_get_float (const uves_propertylist *self, const char *name)
 Get the float value of the given property list entry.
double uves_propertylist_get_double (const uves_propertylist *self, const char *name)
 Get the double value of the given property list entry.
const char * uves_propertylist_get_string (const uves_propertylist *self, const char *name)
 Get the string value of the given property list entry.
cpl_error_code uves_propertylist_insert_char (uves_propertylist *self, const char *here, const char *name, char value)
 Insert a character value into a property list at the given position.
cpl_error_code uves_propertylist_insert_bool (uves_propertylist *self, const char *here, const char *name, int value)
 Insert a boolean value into a property list at the given position.
cpl_error_code uves_propertylist_insert_int (uves_propertylist *self, const char *here, const char *name, int value)
 Insert a integer value into a property list at the given position.
int uves_propertylist_has (const uves_propertylist *self, const char *name)
 Check whether a property is present in a property list.
cpl_error_code uves_propertylist_insert_long (uves_propertylist *self, const char *here, const char *name, long value)
 Insert a long value into a property list at the given position.
cpl_error_code uves_propertylist_insert_float (uves_propertylist *self, const char *here, const char *name, float value)
 Insert a float value into a property list at the given position.
cpl_error_code uves_propertylist_insert_double (uves_propertylist *self, const char *here, const char *name, double value)
 Insert a double value into a property list at the given position.
cpl_error_code uves_propertylist_insert_string (uves_propertylist *self, const char *here, const char *name, const char *value)
 Insert a string value into a property list at the given position.
cpl_error_code uves_propertylist_insert_after_char (uves_propertylist *self, const char *after, const char *name, char value)
 Insert a character value into a property list after the given position.
cpl_error_code uves_propertylist_insert_after_bool (uves_propertylist *self, const char *after, const char *name, int value)
 Insert a boolean value into a property list after the given position.
cpl_error_code uves_propertylist_insert_after_int (uves_propertylist *self, const char *after, const char *name, int value)
 Insert a integer value into a property list after the given position.
cpl_error_code uves_propertylist_insert_after_long (uves_propertylist *self, const char *after, const char *name, long value)
 Insert a long value into a property list after the given position.
cpl_error_code uves_propertylist_insert_after_float (uves_propertylist *self, const char *after, const char *name, float value)
 Insert a float value into a property list after the given position.
cpl_error_code uves_propertylist_insert_after_double (uves_propertylist *self, const char *after, const char *name, double value)
 Insert a double value into a property list after the given position.
cpl_error_code uves_propertylist_insert_after_string (uves_propertylist *self, const char *after, const char *name, const char *value)
 Insert a string value into a property list after the given position.
cpl_error_code uves_propertylist_prepend_char (uves_propertylist *self, const char *name, char value)
 Prepend a character value to a property list.
cpl_error_code uves_propertylist_prepend_bool (uves_propertylist *self, const char *name, int value)
 Prepend a boolean value to a property list.
cpl_error_code uves_propertylist_prepend_int (uves_propertylist *self, const char *name, int value)
 Prepend a integer value to a property list.
cpl_error_code uves_propertylist_prepend_long (uves_propertylist *self, const char *name, long value)
 Prepend a long value to a property list.
cpl_error_code uves_propertylist_prepend_float (uves_propertylist *self, const char *name, float value)
 Prepend a float value to a property list.
cpl_error_code uves_propertylist_prepend_double (uves_propertylist *self, const char *name, double value)
 Prepend a double value to a property list.
cpl_error_code uves_propertylist_prepend_string (uves_propertylist *self, const char *name, const char *value)
 Prepend a string value to a property list.
cpl_error_code uves_propertylist_append_char (uves_propertylist *self, const char *name, char value)
cpl_error_code uves_propertylist_append_bool (uves_propertylist *self, const char *name, int value)
cpl_error_code uves_propertylist_append_int (uves_propertylist *self, const char *name, int value)
cpl_error_code uves_propertylist_append_long (uves_propertylist *self, const char *name, long value)
cpl_error_code uves_propertylist_append_float (uves_propertylist *self, const char *name, float value)
cpl_error_code uves_propertylist_append_double (uves_propertylist *self, const char *name, double value)
cpl_error_code uves_propertylist_append_string (uves_propertylist *self, const char *name, const char *value)
cpl_error_code uves_propertylist_append_c_char (uves_propertylist *self, const char *name, char value, const char *comment)
 Append a character value to a property list.
cpl_error_code uves_propertylist_append_c_bool (uves_propertylist *self, const char *name, int value, const char *comment)
 Append a boolean value to a property list.
cpl_error_code uves_propertylist_append_c_int (uves_propertylist *self, const char *name, int value, const char *comment)
 Append an integer value to a property list.
cpl_error_code uves_propertylist_append_c_long (uves_propertylist *self, const char *name, long value, const char *comment)
 Append a long value to a property list.
cpl_error_code uves_propertylist_append_c_float (uves_propertylist *self, const char *name, float value, const char *comment)
 Append a float value to a property list.
cpl_error_code uves_propertylist_append_c_double (uves_propertylist *self, const char *name, double value, const char *comment)
 Append a double value to a property list.
cpl_error_code uves_propertylist_append_c_string (uves_propertylist *self, const char *name, const char *value, const char *comment)
 Append a string value to a property list.
cpl_error_code uves_propertylist_append (uves_propertylist *self, const uves_propertylist *other)
 Append a property list..
int uves_propertylist_erase (uves_propertylist *self, const char *name)
 Erase the given property from a property list.
int uves_propertylist_erase_regexp (uves_propertylist *self, const char *regexp, int invert)
 Erase all properties with name matching a given regular expression.
void uves_propertylist_empty (uves_propertylist *self)
 Remove all properties from a property list.
cpl_error_code uves_propertylist_update_char (uves_propertylist *self, const char *name, char value)
 Update a property list with a character value.
cpl_error_code uves_propertylist_update_bool (uves_propertylist *self, const char *name, int value)
 Update a property list with a boolean value.
cpl_error_code uves_propertylist_update_int (uves_propertylist *self, const char *name, int value)
 Update a property list with a integer value.
cpl_error_code uves_propertylist_update_long (uves_propertylist *self, const char *name, long value)
 Update a property list with a long value.
cpl_error_code uves_propertylist_update_float (uves_propertylist *self, const char *name, float value)
 Update a property list with a float value.
cpl_error_code uves_propertylist_update_double (uves_propertylist *self, const char *name, double value)
 Update a property list with a double value.
cpl_error_code uves_propertylist_update_string (uves_propertylist *self, const char *name, const char *value)
 Update a property list with a string value.
cpl_error_code uves_propertylist_copy_property (uves_propertylist *self, const uves_propertylist *other, const char *name)
 Copy a property from another property list.
cpl_error_code uves_propertylist_copy_property_regexp (uves_propertylist *self, const uves_propertylist *other, const char *regexp, int invert)
 Copy matching properties from another property list.
uves_propertylistuves_propertylist_load (const char *name, int position)
 Create a property list from a file.
uves_propertylistuves_propertylist_load_regexp (const char *name, int position, const char *regexp, int invert)
 Create a filtered property list from a file.
qfits_header * uves_propertylist_to_fits (const uves_propertylist *self)
uves_propertylistuves_propertylist_from_fits (const qfits_header *header)

Variables

static cpl_error_code push_pop_error

Detailed Description

This module is the same as CPL-3.1 property lists but implemented using a deque (a vector that can grow in both ends in amortized constant time) rather than a linked list.

This was a necessary change in order for property lists to be usable with MIDAS generated FLAMES calibration data (a simple loop is now O(n), not O(n^2), for FLAMES data we have n ~= 10^5)

This module still uses the cpl_property module


Function Documentation

uves_propertylist* uves_propertylist_new ( void   ) 
uves_propertylist* uves_propertylist_duplicate ( const uves_propertylist self  ) 

Create a copy of the given property list.

Parameters:
self The property list to be copied.
Returns:
The created copy or NULL in case an error occurred.

CPL_ERROR_NULL_INPUT

The parameter self is a NULL pointer.

The function creates a deep copy of the given property list self, i.e the created copy and the original property list do not share any resources.

Definition at line 809 of file uves_propertylist.c.

References uves_propertylist_new().

Referenced by convert_to_history(), extract_ff_rebin_merge(), and uves_reduce_mflat_combine().

void uves_propertylist_delete ( const uves_propertylist self  ) 

Destroy a property list.

Parameters:
self The property list to destroy.
Returns:
Nothing.

The function destroys the property list self and its whole contents.

Definition at line 858 of file uves_propertylist.c.

Referenced by table_erase_selected(), uves_propertylist_load(), and uves_propertylist_load_regexp().

long uves_propertylist_get_size ( const uves_propertylist self  ) 

Get the current size of a property list.

Parameters:
self A property list.
Returns:
The property list's current size, or 0 if the list is empty. If an error occurs the function returns 0 and sets an appropriate error code.

CPL_ERROR_NULL_INPUT

The parameter self is a NULL pointer.

The function reports the current number of elements stored in the property list self.

Definition at line 898 of file uves_propertylist.c.

Referenced by convert_to_history(), load_frame_header(), load_header(), parse_history(), scdcop(), test_bad_corr(), uves_find_property_const(), and uves_print_uves_propertylist().

int uves_propertylist_is_empty ( const uves_propertylist self  ) 

Check whether a property list is empty.

Parameters:
self A property list.
Returns:
The function returns 1 if the list is empty, and 0 otherwise. In case an error occurs the function returns -1 and sets an appropriate error code.

CPL_ERROR_NULL_INPUT

The parameter self is a NULL pointer.

The function checks if self contains any properties.

Definition at line 940 of file uves_propertylist.c.

Referenced by uves_print_uves_propertylist().

cpl_type uves_propertylist_get_type ( const uves_propertylist self,
const char *  name 
)

Get the the type of a property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The type of the stored value. If an error occurs the function returns CPL_TYPE_INVALID and sets an appropriate error code.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function returns the type of the value stored in self with the name name.

Definition at line 991 of file uves_propertylist.c.

int uves_propertylist_contains ( const uves_propertylist self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters:
self A property list.
name The property name to look up.
Returns:
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

Definition at line 1045 of file uves_propertylist.c.

Referenced by flames_midas_sccget(), set_column_format_unit_tnull(), uves_define_noise(), uves_pfits_put_qc(), uves_qclog_init(), uves_reduce(), and uves_save_paf().

int my_uves_propertylist_contains ( const cpl_propertylist *  self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters:
self A property list.
name The property name to look up.
Returns:
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

Definition at line 1093 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_comment ( uves_propertylist self,
const char *  name,
const char *  comment 
)

Modify the comment field of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
comment New comment string.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment is replaced by the string comment. The provided comment string may be NULL. In this case an already existing comment is deleted.

Definition at line 1153 of file uves_propertylist.c.

Referenced by uves_pfits_put_qc().

cpl_error_code uves_propertylist_set_char ( uves_propertylist self,
const char *  name,
char  value 
)

Set the value of the given character property list entry.

Parameters:
self A property list.
name The property name to look up.
value New character value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its character value is replaced with the character value.

Definition at line 1218 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_bool ( uves_propertylist self,
const char *  name,
int  value 
)

Set the value of the given boolean property list entry.

Parameters:
self A property list.
name The property name to look up.
value New boolean value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is replaced with the boolean value.

Definition at line 1281 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_int ( uves_propertylist self,
const char *  name,
int  value 
)

Set the value of the given integer property list entry.

Parameters:
self A property list.
name The property name to look up.
value New integer value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its integer value is replaced with the integer value.

Definition at line 1343 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_long ( uves_propertylist self,
const char *  name,
long  value 
)

Set the value of the given long property list entry.

Parameters:
self A property list.
name The property name to look up.
value New long value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its long value is replaced with the long value.

Definition at line 1405 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_float ( uves_propertylist self,
const char *  name,
float  value 
)

Set the value of the given float property list entry.

Parameters:
self A property list.
name The property name to look up.
value New float value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its float value is replaced with the float value.

Definition at line 1468 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_double ( uves_propertylist self,
const char *  name,
double  value 
)

Set the value of the given double property list entry.

Parameters:
self A property list.
name The property name to look up.
value New double value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its double value is replaced with the double value.

Definition at line 1531 of file uves_propertylist.c.

cpl_error_code uves_propertylist_set_string ( uves_propertylist self,
const char *  name,
const char *  value 
)

Set the value of the given string property list entry.

Parameters:
self A property list.
name The property name to look up.
value New string value.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its string value is replaced with the string value.

Definition at line 1594 of file uves_propertylist.c.

const cpl_property* uves_propertylist_get_const ( const uves_propertylist self,
long  position 
)

Access property list elements by index.

Parameters:
self The property list to query.
position Index of the element to retrieve.
Returns:
The function returns the property with index position, or NULL if position is out of range.

CPL_ERROR_NULL_INPUT

The parameter self is a NULL pointer.

The function returns a handle for the property list element, the property, with the index position. Numbering of property list elements extends from 0 to uves_propertylist_get_size() - 1. If position is less than 0 or greater equal than uves_propertylist_get_size() the function returns NULL.

Definition at line 1650 of file uves_propertylist.c.

Referenced by parse_history(), uves_find_property_const(), and uves_print_uves_propertylist().

const char* uves_propertylist_get_comment ( const uves_propertylist self,
const char *  name 
)

Get the comment of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The comment of the property list entry, or NULL.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

The function searches the property list self for a property named name. If it is present in the list, its comment string is returned. If an entry with the name name is not found, or if the entry has no comment the function returns NULL.

Definition at line 1729 of file uves_propertylist.c.

char uves_propertylist_get_char ( const uves_propertylist self,
const char *  name 
)

Get the character value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The character value stored in the list entry. The function returns '\0' if an error occurs and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The sought-after property name is not of type CPL_TYPE_CHAR.

The function searches the property list self for a property named name. If it is present in the list, its character value is returned.

Definition at line 1796 of file uves_propertylist.c.

int uves_propertylist_get_bool ( const uves_propertylist self,
const char *  name 
)

Get the boolean value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The integer representation of the boolean value stored in the list entry. TRUE is represented as non-zero value while 0 indicates FALSE. The function returns 0 if an error occurs and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The sought-after property name is not of type CPL_TYPE_BOOL.

The function searches the property list self for a property named name. If it is present in the list, its boolean value is returned.

Definition at line 1885 of file uves_propertylist.c.

int uves_propertylist_get_int ( const uves_propertylist self,
const char *  name 
)

Get the integer value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The integer value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The sought-after property name is not of type CPL_TYPE_INT.

The function searches the property list self for a property named name. If it is present in the list, its integer value is returned.

Definition at line 1972 of file uves_propertylist.c.

Referenced by scdcop(), and set_column_format_unit_tnull().

long uves_propertylist_get_long ( const uves_propertylist self,
const char *  name 
)

Get the long value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The long value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The sought-after property name is not of type CPL_TYPE_LONG.

The function searches the property list self for a property named name. If it is present in the list, its long value is returned.

Definition at line 2059 of file uves_propertylist.c.

float uves_propertylist_get_float ( const uves_propertylist self,
const char *  name 
)

Get the float value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The float value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The sought-after property name is not of type CPL_TYPE_FLOAT.

The function searches the property list self for a property named name. If it is present in the list, its float value is returned.

Definition at line 2146 of file uves_propertylist.c.

double uves_propertylist_get_double ( const uves_propertylist self,
const char *  name 
)

Get the double value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
The double value stored in the list entry. The function returns 0 if an error occurs and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The sought-after property name is not of type CPL_TYPE_DOUBLE.

The function searches the property list self for a property named name. If it is present in the list, its double value is returned.

Definition at line 2233 of file uves_propertylist.c.

Referenced by uves_define_noise(), and uves_reduce().

const char* uves_propertylist_get_string ( const uves_propertylist self,
const char *  name 
)

Get the string value of the given property list entry.

Parameters:
self A property list.
name The property name to look up.
Returns:
A handle to the string value stored in the list entry. The function returns NULL if an error occurs and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list self does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The sought-after property name is not of type CPL_TYPE_STRING.

The function searches the property list self for a property named name. If it is present in the list, a handle to its string value is returned.

Definition at line 2322 of file uves_propertylist.c.

Referenced by flames_midas_sccget(), set_column_format_unit_tnull(), and uves_save_paf().

cpl_error_code uves_propertylist_insert_char ( uves_propertylist self,
const char *  here,
const char *  name,
char  value 
)

Insert a character value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, here or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2405 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_bool ( uves_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a boolean value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, here or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2470 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_int ( uves_propertylist self,
const char *  here,
const char *  name,
int  value 
)

Insert a integer value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, here or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2535 of file uves_propertylist.c.

int uves_propertylist_has ( const uves_propertylist self,
const char *  name 
)

Check whether a property is present in a property list.

Parameters:
self A property list.
name The property name to look up.
Returns:
The function returns 1 if the property is present, or 0 otherwise. If an error occurs the function returns 0 and sets an appropriate error code.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function searches the property list self for a property with the name name and reports whether it was found or not.

Definition at line 2589 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_long ( uves_propertylist self,
const char *  here,
const char *  name,
long  value 
)

Insert a long value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, here or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2643 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_float ( uves_propertylist self,
const char *  here,
const char *  name,
float  value 
)

Insert a float value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, here or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2708 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_double ( uves_propertylist self,
const char *  here,
const char *  name,
double  value 
)

Insert a double value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, here or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2773 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_string ( uves_propertylist self,
const char *  here,
const char *  name,
const char *  value 
)

Insert a string value into a property list at the given position.

Parameters:
self A property list.
here Name indicating the position at which the value is inserted.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, here or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self at the position of the property named here.

Definition at line 2838 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_char ( uves_propertylist self,
const char *  after,
const char *  name,
char  value 
)

Insert a character value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, after or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new character property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 2903 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_bool ( uves_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a boolean value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, after or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new boolean property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 2968 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_int ( uves_propertylist self,
const char *  after,
const char *  name,
int  value 
)

Insert a integer value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, after or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new integer property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3033 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_long ( uves_propertylist self,
const char *  after,
const char *  name,
long  value 
)

Insert a long value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, after or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new long property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3098 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_float ( uves_propertylist self,
const char *  after,
const char *  name,
float  value 
)

Insert a float value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, after or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new float property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3163 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_double ( uves_propertylist self,
const char *  after,
const char *  name,
double  value 
)

Insert a double value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, after or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new double property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3228 of file uves_propertylist.c.

cpl_error_code uves_propertylist_insert_after_string ( uves_propertylist self,
const char *  after,
const char *  name,
const char *  value 
)

Insert a string value into a property list after the given position.

Parameters:
self A property list.
after Name of the property after which the value is inserted.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, after or name is a NULL pointer.

CPL_ERROR_UNSPECIFIED

A property with the name name could not be inserted into self.

The function creates a new string property with name name and value value. The property is inserted into the property list self after the property named after.

Definition at line 3294 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_char ( uves_propertylist self,
const char *  name,
char  value 
)

Prepend a character value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is prepended to the property list self.

Definition at line 3351 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_bool ( uves_propertylist self,
const char *  name,
int  value 
)

Prepend a boolean value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is prepended to the property list self.

Definition at line 3405 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_int ( uves_propertylist self,
const char *  name,
int  value 
)

Prepend a integer value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is prepended to the property list self.

Definition at line 3459 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_long ( uves_propertylist self,
const char *  name,
long  value 
)

Prepend a long value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is prepended to the property list self.

Definition at line 3513 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_float ( uves_propertylist self,
const char *  name,
float  value 
)

Prepend a float value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is prepended to the property list self.

Definition at line 3567 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_double ( uves_propertylist self,
const char *  name,
double  value 
)

Prepend a double value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is prepended to the property list self.

Definition at line 3621 of file uves_propertylist.c.

cpl_error_code uves_propertylist_prepend_string ( uves_propertylist self,
const char *  name,
const char *  value 
)

Prepend a string value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new string property with name name and value value. The property is prepended to the property list self.

Definition at line 3675 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_char ( uves_propertylist self,
const char *  name,
char  value,
const char *  comment 
)

Append a character value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new character property with name name and value value. The property is appended to the property list self.

Definition at line 3795 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_bool ( uves_propertylist self,
const char *  name,
int  value,
const char *  comment 
)

Append a boolean value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new boolean property with name name and value value. The property is appended to the property list self.

Definition at line 3851 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_int ( uves_propertylist self,
const char *  name,
int  value,
const char *  comment 
)

Append an integer value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new integer property with name name and value value. The property is appended to the property list self.

Definition at line 3907 of file uves_propertylist.c.

Referenced by create_descr(), and load_header().

cpl_error_code uves_propertylist_append_c_long ( uves_propertylist self,
const char *  name,
long  value,
const char *  comment 
)

Append a long value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new long property with name name and value value. The property is appended to the property list self.

Definition at line 3963 of file uves_propertylist.c.

cpl_error_code uves_propertylist_append_c_float ( uves_propertylist self,
const char *  name,
float  value,
const char *  comment 
)

Append a float value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new float property with name name and value value. The property is appended to the property list self.

Definition at line 4019 of file uves_propertylist.c.

Referenced by create_descr(), and load_header().

cpl_error_code uves_propertylist_append_c_double ( uves_propertylist self,
const char *  name,
double  value,
const char *  comment 
)

Append a double value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new double property with name name and value value. The property is appended to the property list self.

Definition at line 4075 of file uves_propertylist.c.

Referenced by create_descr(), load_header(), uves_mflat_process_chip(), and uves_reduce().

cpl_error_code uves_propertylist_append_c_string ( uves_propertylist self,
const char *  name,
const char *  value,
const char *  comment 
)

Append a string value to a property list.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function creates a new string property with name name and value value. The property is appended to the property list self.

Definition at line 4131 of file uves_propertylist.c.

Referenced by create_descr(), and load_header().

cpl_error_code uves_propertylist_append ( uves_propertylist self,
const uves_propertylist other 
)

Append a property list..

Parameters:
self A property list.
other The property to append.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self is a NULL pointer.

The function appends the property list other to the property list self.

Definition at line 4185 of file uves_propertylist.c.

Referenced by scdcop(), and uves_reduce_scired().

int uves_propertylist_erase ( uves_propertylist self,
const char *  name 
)

Erase the given property from a property list.

Parameters:
self A property list.
name Name of the property to erase.
Returns:
On success the function returns the number of erased entries. If an error occurs the function returns 0 and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

The function searches the property with the name name in the property list self and removes it. The property is destroyed. If self contains multiple duplicates of a property named name, only the first one is erased.

Definition at line 4247 of file uves_propertylist.c.

int uves_propertylist_erase_regexp ( uves_propertylist self,
const char *  regexp,
int  invert 
)

Erase all properties with name matching a given regular expression.

Parameters:
self A property list.
regexp Regular expression.
invert Flag inverting the sense of matching.
Returns:
On success the function returns the number of erased entries. If an error occurs the function returns 0 and an appropriate error code is set.

CPL_ERROR_NULL_INPUT

The parameter self or regexp is a NULL pointer.

The function searches for all the properties matching in the list self and removes them. Whether a property matches or not depends on the given regular expression regexp, and the flag invert. If invert is 0, all properties matching regexp are removed from the list. If invert is set to a non-zero value, all properties which do not match regexp are erased. The removed properties are destroyed.

The function expects POSIX 1003.2 compliant extended regular expressions.

Definition at line 4308 of file uves_propertylist.c.

Referenced by flames_midas_scddel(), and uves_utl_physmod().

void uves_propertylist_empty ( uves_propertylist self  ) 

Remove all properties from a property list.

Parameters:
self A property list.
Returns:
Nothing.

CPL_ERROR_NULL_INPUT

The parameter self is a NULL pointer.

The function removes all properties from self. Each property is properly deallocated. After calling this function self is empty.

Definition at line 4390 of file uves_propertylist.c.

Referenced by test_bad_corr().

cpl_error_code uves_propertylist_update_char ( uves_propertylist self,
const char *  name,
char  value 
)

Update a property list with a character value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The character value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of type CPL_TYPE_CHAR.

The function updates the property list self with the character value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_CHAR.

Definition at line 4461 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_bool ( uves_propertylist self,
const char *  name,
int  value 
)

Update a property list with a boolean value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The boolean value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of type CPL_TYPE_BOOL.

The function updates the property list self with the boolean value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_BOOL.

Definition at line 4547 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_int ( uves_propertylist self,
const char *  name,
int  value 
)

Update a property list with a integer value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The integer value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of type CPL_TYPE_INT.

The function updates the property list self with the integer value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_INT.

Definition at line 4633 of file uves_propertylist.c.

Referenced by uves_reduce_scired().

cpl_error_code uves_propertylist_update_long ( uves_propertylist self,
const char *  name,
long  value 
)

Update a property list with a long value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The long value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of type CPL_TYPE_LONG.

The function updates the property list self with the long value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_LONG.

Definition at line 4719 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_float ( uves_propertylist self,
const char *  name,
float  value 
)

Update a property list with a float value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The float value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of type CPL_TYPE_FLOAT.

The function updates the property list self with the float value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_FLOAT.

Definition at line 4805 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_double ( uves_propertylist self,
const char *  name,
double  value 
)

Update a property list with a double value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The double value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of type CPL_TYPE_DOUBLE.

The function updates the property list self with the double value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_DOUBLE.

Definition at line 4891 of file uves_propertylist.c.

cpl_error_code uves_propertylist_update_string ( uves_propertylist self,
const char *  name,
const char *  value 
)

Update a property list with a string value.

Parameters:
self A property list.
name The property name to be assigned to the value.
value The string value to store.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self or name is a NULL pointer.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of type CPL_TYPE_STRING.

The function updates the property list self with the string value value. This means, if a property with the name name exists already its value is updated, otherwise a property with the name name is created and added to self. The update will fail if a property with the name name exists already which is not of type CPL_TYPE_STRING.

Definition at line 4977 of file uves_propertylist.c.

cpl_error_code uves_propertylist_copy_property ( uves_propertylist self,
const uves_propertylist other,
const char *  name 
)

Copy a property from another property list.

Parameters:
self A property list.
other The property list from which a property is copied.
name The name of the property to copy.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, other or name is a NULL pointer.

CPL_ERROR_DATA_NOT_FOUND

The property list other does not contain a property with the name name.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies the property name from the property list other to the property list self. If the property list self does not already contain a property name the property is appended to self. If a property name exists already in self the function overwrites the contents of this property if and only if this property is of the same type as the property to be copied from other.

Definition at line 5072 of file uves_propertylist.c.

cpl_error_code uves_propertylist_copy_property_regexp ( uves_propertylist self,
const uves_propertylist other,
const char *  regexp,
int  invert 
)

Copy matching properties from another property list.

Parameters:
self A property list.
other The property list from which a property is copied.
regexp The regular expression used to select properties.
invert Flag inverting the sense of matching.
Returns:
The function returns CPL_ERROR_NONE on success or a CPL error code otherwise.

CPL_ERROR_NULL_INPUT

The parameter self, other or regexp is a NULL pointer.

CPL_ERROR_ILLEGAL_INPUT

The parameter regexp is an invalid regular expression.

CPL_ERROR_TYPE_MISMATCH

The property list self contains a property with the name name which is not of the same type as the property which should be copied from other.

The function copies all properties with matching names from the property list other to the property list self. If the flag invert is zero, all properties whose names match the regular expression regexp are copied. If invert is set to a non-zero value, all properties with names not matching regexp are copied rather. The function expects POSIX 1003.2 compliant extended regular expressions.

If the property list self does not already contain one of the properties to be copied this property is appended to self. If a property to be copied exists already in self the function overwrites the contents of this property.

Before properties are copied from the property list other to self the types of the properties are checked and if any type mismatch is detected the function stops processing immediately. The property list self is not at all modified in this case.

See also:
uves_propertylist_copy_property()

Definition at line 5221 of file uves_propertylist.c.

Referenced by extract_ff_rebin_merge(), and scdcop().

uves_propertylist* uves_propertylist_load ( const char *  name,
int  position 
)

Create a property list from a file.

Parameters:
name Name of the input file.
position Index of the data set to read.
Returns:
The function returns the newly created property list or NULL if an error occurred.

CPL_ERROR_NULL_INPUT

The parameter name is a NULL pointer.

CPL_ERROR_ILLEGAL_INPUT

The position is less than 0 or the properties cannot be read from the file name.

CPL_ERROR_FILE_IO

The file name does not exist.

CPL_ERROR_BAD_FILE_FORMAT

The file name is not a valid FITS file.

CPL_ERROR_DATA_NOT_FOUND

The requested data set at index position does not exist.

The function reads the properties of the data set with index position from the file name.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0. When creating the property list from a FITS header, any keyword without a value like undefined keywords for instance are not transformed into a property.

See also:
uves_propertylist_load_regexp()

Definition at line 5449 of file uves_propertylist.c.

References uves_propertylist_delete(), and uves_propertylist_new().

Referenced by flames_midas_sccget(), flames_midas_scfinf(), flames_utl_unpack(), load_frame(), load_header(), test_load_3dtable(), uves_mflat_at_ypos(), uves_reduce_mflat_combine(), uves_reduce_scired(), uves_tablename_remove_units(), and uves_tablenames_unify_units().

uves_propertylist* uves_propertylist_load_regexp ( const char *  name,
int  position,
const char *  regexp,
int  invert 
)

Create a filtered property list from a file.

Parameters:
name Name of the input file.
position Index of the data set to read.
regexp Regular expression used to filter properties.
invert Flag inverting the sense of matching property names.
Returns:
The function returns the newly created property list or NULL if an error occurred.

CPL_ERROR_NULL_INPUT

The parameter name or the parameter regexp is a NULL pointer.

CPL_ERROR_ILLEGAL_INPUT

The position is less than 0, the properties cannot be read from the file name, or regexp is not a valid extended regular expression.

CPL_ERROR_FILE_IO

The file name does not exist.

CPL_ERROR_BAD_FILE_FORMAT

The file name is not a valid FITS file.

CPL_ERROR_DATA_NOT_FOUND

The requested data set at index position does not exist.

The function reads all properties of the data set with index position with matching names from the file name. If the flag invert is zero, all properties whose names match the regular expression regexp are read. If invert is set to a non-zero value, all properties with names not matching regexp are read rather. The function expects POSIX 1003.2 compliant extended regular expressions.

Currently only the FITS file format is supported. The property list is created by reading the FITS keywords from extension position. The numbering of the data sections starts from 0.

When creating the property list from a FITS header, any keyword without a value like undefined keywords for instance are not transformed into a property. FITS format specific keyword prefixes (e.g. HIERARCH) must not be part of the given pattern string regexp, but only the actual FITS keyword name may be given.

See also:
uves_propertylist_load()

Definition at line 5596 of file uves_propertylist.c.

References uves_propertylist_delete(), and uves_propertylist_new().


Generated on 9 Mar 2012 for UVES Pipeline Reference Manual by  doxygen 1.6.1