API for use by librelaxisloader users.
More...
|
| void | rlx_project_free (struct rlx_project *proj) |
| | This frees a project struct.
|
| |
| void | rlx_project_free_array (struct rlx_project **proj_array) |
| | This frees an array of project structs.
|
| |
| void | rlx_spectra_free (struct rlx_spectra *spectra) |
| | This frees a spectra struct.
|
| |
| void | rlx_spectra_free_array (struct rlx_spectra **spectra_array) |
| | Frees an array of spectra structs.
|
| |
| void | rlx_fitparam_free (struct rlx_fitparam *param) |
| | Frees a fitparam struct.
|
| |
| void | rlx_fitparam_free_array (struct rlx_fitparam **param_array) |
| | Frees an array of fitparam structs.
|
| |
| struct rxfile * | rlx_open_file (const char *path, const char **error) |
| | Frees a project struct.
|
| |
|
void | rlx_close_file (struct rxfile *file) |
| |
| struct rlx_project ** | rlx_get_projects (struct rxfile *file, size_t *length) |
| | Gets all the projects in a given RelaxIS file.
|
| |
| struct rlx_spectra ** | rlx_get_all_spectra (struct rxfile *file, const struct rlx_project *project) |
| | Loads all spectra from file in given project.
|
| |
| int * | rlx_get_spectra_ids (struct rxfile *file, const struct rlx_project *project, size_t *length) |
| | Loads spectra ids that are associated with a given project.
|
| |
| struct rlx_spectra * | rlx_get_spectra (struct rxfile *file, const struct rlx_project *project, int id) |
| | Loads spectra with a given spectra id and project from file.
|
| |
| struct rlx_fitparam ** | rlx_get_fit_parameters (struct rxfile *file, const struct rlx_project *project, int id, size_t *length) |
| | Loads the parameters for a given spectra id from file.
|
| |
| int | rlx_get_errnum (const struct rxfile *file) |
| | Returns the last error returned on a file operation.
|
| |
| const char * | rlx_get_errnum_str (int errnum) |
| | Returns a human readable error string for a given error number.
|
| |
API for use by librelaxisloader users.
This API allows you to load RelaxIS files and get the data therein
◆ rlx_fitparam_free()
Frees a fitparam struct.
- Parameters
-
| fitparam | fitparam struct to be freed |
◆ rlx_fitparam_free_array()
| void rlx_fitparam_free_array |
( |
struct rlx_fitparam ** | param_array | ) |
|
Frees an array of fitparam structs.
- Parameters
-
| param_array | array of fitparam structs to be freed |
◆ rlx_get_all_spectra()
Loads all spectra from file in given project.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
- Parameters
-
| file | file to load spectra from |
| project | project to load spectra from |
- Returns
- A NULL terminated array of spectra structs will be allocated here, to be freed with rlx_spectra_free_array, or NULL on error
◆ rlx_get_errnum()
| int rlx_get_errnum |
( |
const struct rxfile * | file | ) |
|
Returns the last error returned on a file operation.
- Returns
- relaxisloader error number
◆ rlx_get_errnum_str()
| const char * rlx_get_errnum_str |
( |
int | errnum | ) |
|
Returns a human readable error string for a given error number.
- Returns
- Error string, static lifetime, owned by librelaxisloader do not free
◆ rlx_get_fit_parameters()
| struct rlx_fitparam ** rlx_get_fit_parameters |
( |
struct rxfile * | file, |
|
|
const struct rlx_project * | project, |
|
|
int | id, |
|
|
size_t * | length ) |
Loads the parameters for a given spectra id from file.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
- Parameters
-
| file | file to load spectra from |
| project | project to load spectra from |
| id | spectra id for which to load parameters |
| length | a pointer to a size_t where the number of parameters will be stored, or NULL |
- Returns
- A NULL terminated array of rlx_fitparam structs will be allocated here, to be freed with rlx_fitparam_free_array, or NULL on error
◆ rlx_get_projects()
| struct rlx_project ** rlx_get_projects |
( |
struct rxfile * | file, |
|
|
size_t * | length ) |
Gets all the projects in a given RelaxIS file.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
- Parameters
-
| file | file to load projects from |
| length | pointer to a size_t where the number of projects will be stored, or NULL |
- Returns
- A NULL terminated array of project structs will be allocated here, to be freed with rlx_project_free_array, or NULL on error
◆ rlx_get_spectra()
Loads spectra with a given spectra id and project from file.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
- Parameters
-
| file | file to load spectra from |
| project | project to load spectra from |
| id | spectra id to load |
- Returns
- spectra struct or NULL if unsuccessful, to be freed with rlx_spectra_free
◆ rlx_get_spectra_ids()
| int * rlx_get_spectra_ids |
( |
struct rxfile * | file, |
|
|
const struct rlx_project * | project, |
|
|
size_t * | length ) |
Loads spectra ids that are associated with a given project.
If this function encounters an error it will return NULL and set an error at rlx_get_errnum.
- Parameters
-
| file | file to load spectra from |
| project | project to load spectra from |
| id | spectra id for which to load parameters |
| length | pointer to size_t where the number of ids will be stored or NULL |
- Returns
- A a newly allocated array of integers with the ids, to be freed with free(), or NULL on error
◆ rlx_open_file()
| struct rxfile * rlx_open_file |
( |
const char * | path, |
|
|
const char ** | error ) |
Frees a project struct.
- Parameters
-
| path | the file system path where the file shall be opened |
| error | if an error occurs and NULL is returned, pointer to an error string is set here, owned by librelaxisloader, do not free, valid only until next call to librelaxisloader |
- Returns
- a rxfile struct or NULL if opening was unsuccessful, to be closed with rlx_close_file
◆ rlx_project_free()
This frees a project struct.
This function must always be used for every singular rlx_project struct to avoid memory leaks. It is safe to pass NULL to this function.
- Parameters
-
| proj | the Project struct to be freed, or NULL. |
◆ rlx_project_free_array()
| void rlx_project_free_array |
( |
struct rlx_project ** | proj_array | ) |
|
This frees an array of project structs.
This function must always be used for array of rlx_project structs to avoid memory leaks.
- Parameters
-
| proj_array | The Array of project structs to be freed. |
◆ rlx_spectra_free()
This frees a spectra struct.
This function must always be used for every singular rlx_spectra struct to avoid memory leaks. It is safe to pass NULL to this function.
- Parameters
-
| spectra | The spectra to be freed. |
◆ rlx_spectra_free_array()
| void rlx_spectra_free_array |
( |
struct rlx_spectra ** | spectra_array | ) |
|
Frees an array of spectra structs.
This function must always be used for every array of rlx_spectra structs to avoid memory leaks.
- Parameters
-
| spectra_array | The array of spectra structs to be freed. |