TUM-Logo

libRASCH

 

Home
 

General

About libRASCH/News
Design
Screen shots
Sample programs (with source code)
License
 

Download

libRASCH
Tools
 

Documentation

User
Developer
 

Resources

Mailing list
Supported Formats
Plugins
Status
Links
 
Contact
About this site
 
Last updated
Tue Mar 27 23:03:52 2007
libRASCH: ra.c File Reference

ra.c File Reference

Include dependency graph for ra.c:

Go to the source code of this file.

Defines

#define _LIBRASCH_BUILD

Functions

LIBRAAPI ra_handle ra_lib_init (void)
 init libRASCH
void set_endian_type ()
 set endian of current system
void init_i18n (struct librasch *ra)
 call functions and set variables needed for i18n
LIBRAAPI int get_endian_type ()
 returns endian type
int read_config (struct librasch *ra)
 read libRASCH configuration
void init_config (struct config_info *conf)
 set configuration to values which work when no config-file is found
int find_config_file (char *fn)
 read libRASCH configuration from Registry (only on Win32) look for libRASCH configuration file
LIBRAAPI void ra_lib_close (ra_handle h)
 close libRASCH
LIBRAAPI long ra_lib_get_error (ra_handle h, char *text, int len)
 get last error
void get_error_text_ra (long err, char *text, int len)
 returns error-string for OS specific errors returns error-string for libRASCH errors
LIBRAAPI void _ra_set_error_int (any_handle h, long error, const char *error_from, const char *file, int line)
 set error number
LIBRAAPI ra_handle ra_lib_handle_from_any_handle (any_handle h)
 retrive handle of libRASCH instance from any handle
LIBRAAPI meas_handle ra_meas_handle_from_any_handle (any_handle h)
 retrive measurement-handle from any handle
LIBRAAPI int ra_lib_use_plugin (ra_handle h, int plugin_index, int use_it)
 set using a plugin (or not)
plugin_structget_plugin (struct librasch *ra, int number)
 returns plugin-handle
plugin_structget_plugin_by_name (struct librasch *ra, const char *name)
 returns plugin-handle
LIBRAAPI plugin_handle ra_plugin_get_by_num (ra_handle h, int plugin_num, int search_all)
 get plugin-handle
LIBRAAPI plugin_handle ra_plugin_get_by_name (ra_handle h, const char *name, int search_all)
 get plugin-handle
LIBRAAPI ra_find_handle ra_meas_find_first (ra_handle h, const char *dir, struct ra_find_struct *rfs)
 find libRASCH-handled measurements (return first one)
LIBRAAPI int ra_meas_find_next (ra_find_handle h, struct ra_find_struct *rfs)
 find libRASCH-handled measurements (returns next)
LIBRAAPI void ra_meas_close_find (ra_find_handle h)
 close the search for libRASCH-handled measurements
LIBRAAPI meas_handle ra_meas_open (ra_handle h, const char *file, const char *eval_file, int fast)
 open a measurement
int calc_x_scales (struct ra_meas *meas)
 do scaling calculations
LIBRAAPI meas_handle ra_meas_new (ra_handle h, const char *dir, const char *name)
 creates a new measurement
LIBRAAPI int ra_meas_save (meas_handle mh)
 saves a measurement
LIBRAAPI void ra_meas_close (meas_handle mh)
 close a measurement
LIBRAAPI int ra_info_get (any_handle h, int id, value_handle vh)
 get infos
int check_handle_type (any_handle h, int id)
 check handle type
int get_lib_info (ra_handle ra, int id, value_handle vh)
 returns informations about the core
int get_plugin_info (plugin_handle pl, int id, value_handle vh)
 returns informations about plugins
int get_meas_general_info (meas_handle mh, int id, value_handle vh)
 returns informations about a measurement
int get_session_info (any_handle h, int id, value_handle vh)
 returns informations about a session
int get_proc_info (any_handle h, int id, value_handle vh)
 returns informations about processing results
plugin_structget_plugin_from_handle (any_handle h)
 returns plugin-handle
LIBRAAPI int ra_info_get_by_name (any_handle h, const char *name, value_handle vh)
 get infos
LIBRAAPI int ra_info_get_by_idx (any_handle h, int info_type, int idx, value_handle vh)
 get infos
LIBRAAPI int ra_info_set (any_handle h, value_handle vh)
 set info
LIBRAAPI rec_handle ra_rec_get_first (meas_handle mh, long session)
 get root-recording
LIBRAAPI rec_handle ra_rec_get_next (rec_handle rh)
 get next recording
LIBRAAPI rec_handle ra_rec_get_first_child (rec_handle rh)
 get first sub-recording
LIBRAAPI rec_handle ra_rec_add (meas_handle mh, rec_handle parent)
 add a recording
LIBRAAPI int ra_dev_add (rec_handle rh)
 add a recording-device
LIBRAAPI int ra_ch_add (rec_handle rh)
 add a recording-channel
LIBRAAPI int ra_session_new (meas_handle mh)
 start a new recording session
LIBRAAPI size_t ra_raw_add (meas_handle mh, unsigned int ch, value_handle vh)
 add raw data
LIBRAAPI size_t ra_raw_get (rec_handle rh, unsigned int ch, size_t start, size_t num_data, DWORD *data, DWORD *data_high)
 get raw-signal data
LIBRAAPI size_t ra_raw_get_unit (rec_handle rh, unsigned int ch, size_t start, size_t num_data, double *data)
 get raw-signal data scaled to 'unit'-values
LIBRAAPI int ra_gui_call (any_handle h, plugin_handle pl)
 shows GUI-element of a plugin (if avail.)
LIBRAAPI proc_handle ra_proc_get (meas_handle mh, plugin_handle pl, void(*callback)(const char *, int))
 get a processing handle
LIBRAAPI void ra_proc_free (proc_handle proc)
 free a processing handle
LIBRAAPI int ra_proc_do (proc_handle proc)
 process the signal
LIBRAAPI int ra_proc_get_result (proc_handle proc, long res_num, long res_set, value_handle vh)
 get the processing results
LIBRAAPI int ra_view_get (view_handle vh)
 create/show view of view-plugin
LIBRAAPI int ra_lib_get_option (any_handle h, const char *opt_name, value_handle vh)
 returns an option value
int find_option (const char *name, struct ra_option_infos *infos, int num_opt)
 returns index of an option
int get_option (void *options, struct ra_option_infos *opt_info, value_handle vh, long num_offset)
 returns option value
LIBRAAPI int ra_lib_set_option (any_handle h, const char *opt_name, value_handle vh)
 set an option
int set_option (void *options, struct ra_option_infos *opt_info, value_handle vh, long num_offset)
 set option value
LIBRAAPI int ra_meas_copy (meas_handle mh, const char *dest_dir)
 copy measurement
LIBRAAPI meas_handle ra_meas_move (meas_handle mh, const char *dest_dir)
 move measurement
int copy_move_meas (meas_handle mh, const char *dest_dir, int copy)
 do a copy or move of a measurement
LIBRAAPI int ra_meas_delete (meas_handle mh)
 delete measurement

Variables

int ra_print_debug_infos
int ra_in_error
int ra_endian_type
char ra_i18n_codeset [MAX_I18N_LEN]


Detailed Description

This file provides most part of the libRASCH-API (the evaluation-API can be found in ./eval/eval.c).

Author:
Raphael Schneider (rasch@med1.med.tum.de)

Definition in file ra.c.


Define Documentation

#define _LIBRASCH_BUILD
 

Definition at line 30 of file ra.c.


Function Documentation

LIBRAAPI void _ra_set_error_int any_handle  h,
long  error,
const char *  error_from,
const char *  file,
int  line
 

Parameters:
<h> any libRASCH handle (except value_handle)
<error> error number
<error_from> source of error (short name)
<file> name of the source-file the function is called
<line> line in the source-file the function is called
Function is called when an error occured and set the error number. Additionally, the source of the error can be given. This function is called from the libRASCH core and from the plugins. This function should _not_ be called from the user-space.

Definition at line 556 of file ra.c.

References librasch::error_from, librasch::error_number, RA_ERR_NONE, ra_in_error, ra_lib_get_error(), ra_lib_handle_from_any_handle(), and ra_print_debug_infos.

int calc_x_scales struct ra_meas meas  ) 
 

Parameters:
<meas> pointer to a measurement struct
Function gets maximum samplerate used in a measurement and calculate for each recording channel the scaling factor to the max. samplerate.

Definition at line 1059 of file ra.c.

References ra_meas::max_samplerate, ra_meas::num_ch, ra_info_get(), RA_INFO_REC_CH_SAMPLERATE_D, RA_INFO_REC_GEN_NUM_CHANNEL_L, ra_rec_get_first(), ra_value_free(), ra_value_get_double(), ra_value_get_long(), ra_value_malloc(), ra_value_set_number(), and ra_meas::x_scale.

Referenced by ra_meas_new(), and ra_meas_open().

int check_handle_type any_handle  h,
int  id
 

Parameters:
<h> any libRASCH handle
<id> name of plugin
Function checks if the type handle 'h' is correct for the info-id 'id'.

Definition at line 1299 of file ra.c.

References _ra_set_error, RA_ERR_UNKNOWN_HANDLE, RA_ERR_UNSUPPORTED, RA_HANDLE_EVAL, RA_HANDLE_EVAL_CLASS, RA_HANDLE_EVAL_PROP, RA_HANDLE_EVAL_SUMMARY, RA_HANDLE_FIND, RA_HANDLE_LIB, RA_HANDLE_MEAS, RA_HANDLE_PLUGIN, RA_HANDLE_PROC, RA_HANDLE_REC, RA_HANDLE_VIEW, RA_INFO_CLASS_END, RA_INFO_CLASS_START, RA_INFO_EVAL_END, RA_INFO_EVAL_START, RA_INFO_LIB_END, RA_INFO_LIB_START, RA_INFO_MEASUREMENT_START, RA_INFO_OBJECT_END, RA_INFO_PLUGIN_END, RA_INFO_PLUGIN_START, RA_INFO_PROCESSING_END, RA_INFO_PROCESSING_START, RA_INFO_PROP_END, RA_INFO_PROP_START, RA_INFO_RECORDING_END, RA_INFO_RECORDING_START, RA_INFO_SUM_END, and RA_INFO_SUM_START.

Referenced by ra_info_get().

int copy_move_meas meas_handle  mh,
const char *  dest_dir,
int  copy
 

Parameters:
<mh> measurement-handle
<dest_dir> destination directory
<copy> flag if a copy (!= 0) or a move (== 0) should be done
Function copy or move a measurement.

Definition at line 2719 of file ra.c.

References copy_move_file(), delete_file(), make_dir(), MAX_PATH_RA, RA_INFO_DIR_L, RA_INFO_FILES_CA, ra_info_get(), RA_INFO_PATH_C, ra_value_free(), ra_value_get_num_elem(), ra_value_get_string(), ra_value_get_string_array(), and ra_value_malloc().

Referenced by ra_meas_copy(), and ra_meas_move().

int find_config_file char *  fn  ) 
 

Parameters:
<fn> contains path of config file if function ended successful
This function looks for the libRASCH configuration file. For the config file is first looked in the current directory. If there is none than it looks in '/etc'(Linux) resp. in the system directory (Win32). If not found, on Linux the $HOME directory is searched also.

Definition at line 346 of file ra.c.

References MAX_PATH_RA.

Referenced by read_config().

int find_option const char *  name,
struct ra_option_infos infos,
int  num_opt
 

Parameters:
<name> name of the option looked for
<infos> array of available options
<num_opt> number of the available options
Functions looks in the array 'infos' for the option named 'name'.

Definition at line 2395 of file ra.c.

Referenced by ra_lib_get_option(), and ra_lib_set_option().

LIBRAAPI int get_endian_type  ) 
 

This function returns the endian type for the running system.

Definition at line 190 of file ra.c.

References ra_endian_type.

void get_error_text_ra long  err,
char *  text,
int  len
 

Parameters:
<err> libRASCH error number
<text> array in which error-string will be set
<len> length of array 'text'
Function gets error-string for libRASCH error numbers.

Definition at line 521 of file ra.c.

References RA_WARNING.

int get_lib_info ra_handle  ra,
int  id,
value_handle  vh
 

Parameters:
<ra> handle to library instance
<id> info id
<vh> value-handle (will receive info)
Function returns informations about the library core.

Definition at line 1367 of file ra.c.

References _ra_set_error, meta_info::desc, get_meta_info(), meta_info::id, meta_info::name, RA_ERR_UNKNOWN_INFO, RA_INFO_LIB_END, RA_INFO_NUM_PLUGINS_L, RA_INFO_VERSION_C, ra_value_set_long(), ra_value_set_string_utf8(), and set_meta_info().

Referenced by ra_info_get().

int get_meas_general_info meas_handle  mh,
int  id,
value_handle  vh
 

Parameters:
<mh> handle to a measurement
<id> info id
<vh> value-handle (will receive info)
Function returns informations about a measurement.

Definition at line 1545 of file ra.c.

Referenced by ra_info_get().

int get_option void *  options,
struct ra_option_infos opt_info,
value_handle  vh,
long  num_offset
 

Parameters:
<options> pointer to an option struct
<opt_info> option looked for
<vh> value-handle (will receive option value)
<num_offset> offset where number of array elements is stored (only for array values needed)
Function returns the value for the option in 'vh'.

Definition at line 2422 of file ra.c.

References ra_option_infos::desc, ra_option_infos::name, ra_option_infos::offset, RA_INFO_NONE, ra_value_set_double(), ra_value_set_double_array(), ra_value_set_long(), ra_value_set_long_array(), ra_value_set_short(), ra_value_set_short_array(), ra_value_set_string_utf8(), RA_VALUE_TYPE_CHAR, RA_VALUE_TYPE_CHAR_ARRAY, RA_VALUE_TYPE_DOUBLE, RA_VALUE_TYPE_DOUBLE_ARRAY, RA_VALUE_TYPE_LONG, RA_VALUE_TYPE_LONG_ARRAY, RA_VALUE_TYPE_SHORT, RA_VALUE_TYPE_SHORT_ARRAY, set_meta_info(), and ra_option_infos::type.

Referenced by ra_lib_get_option().

struct plugin_struct* get_plugin struct librasch ra,
int  number
 

Parameters:
<ra> pointer to general libRASCH struct
<number> number of the plugin
Function returns the plugin-handle for the plugin #number (zero based).

Definition at line 766 of file ra.c.

References plugin_struct::next, and librasch::pl_head.

Referenced by ra_lib_use_plugin(), and ra_plugin_get_by_num().

struct plugin_struct* get_plugin_by_name struct librasch ra,
const char *  name
 

Parameters:
<ra> pointer to general libRASCH struct
<name> name of plugin
Function returns the plugin-handle for the plugin with the name 'name'.

Definition at line 786 of file ra.c.

References plugin_struct::info, plugin_infos::name, plugin_struct::next, and librasch::pl_head.

Referenced by ra_lib_init(), and ra_plugin_get_by_name().

struct plugin_struct* get_plugin_from_handle any_handle  h  ) 
 

Parameters:
<h> handle which belongs to a plugin
Function returns plugin-handle which is associated with the handle 'h'.

Definition at line 1680 of file ra.c.

References _ra_set_error, RA_ERR_ERROR, RA_HANDLE_EVAL, RA_HANDLE_EVAL_CLASS, RA_HANDLE_EVAL_PROP, RA_HANDLE_EVAL_SUMMARY, RA_HANDLE_MEAS, and RA_HANDLE_REC.

Referenced by ra_info_get(), ra_info_get_by_idx(), and ra_info_set().

int get_plugin_info plugin_handle  pl,
int  id,
value_handle  vh
 

Parameters:
<pl> handle to plugin
<id> info id
<vh> value-handle (will receive info)
Function returns informations about library plugins.

Definition at line 1420 of file ra.c.

References _ra_set_error, plugin_infos::build_ts, meta_info::desc, plugin_infos::desc, plugin_infos::file, get_meta_info(), meta_info::id, plugin_struct::info, plugin_infos::license, plugin_infos::name, meta_info::name, plugin_infos::num_options, plugin_infos::num_results, ra_value::number, plugin_infos::opt, RA_ERR_UNKNOWN_INFO, RA_INFO_PL_OPT_NAME_C, RA_INFO_PL_OPT_TYPE_L, RA_INFO_PL_RES_DEFAULT_L, RA_INFO_PL_RES_NAME_C, RA_INFO_PLUGIN_END, ra_value_set_long(), ra_value_set_string_utf8(), plugin_infos::res, set_meta_info(), plugin_infos::type, plugin_infos::use_plugin, and plugin_infos::version.

Referenced by ra_info_get().

int get_proc_info any_handle  h,
int  id,
value_handle  vh
 

Parameters:
<h> any handle belonging to a processing handle
<id> info id
<vh> value-handle (will receive info)
Function returns informations about processing results

Definition at line 1644 of file ra.c.

References proc_info::num_result_sets, proc_info::num_results, RA_INFO_PROC_NUM_RES_L, RA_INFO_PROC_NUM_RES_SETS_L, RA_INFO_PROCESSING_END, and ra_value_set_long().

Referenced by ra_info_get().

int get_session_info any_handle  h,
int  id,
value_handle  vh
 

Parameters:
<h> any handle belonging to a measurement
<id> info id
<vh> value-handle (will receive info)
Function returns informations about a measurement session.

Definition at line 1602 of file ra.c.

References ra_meas::num_sessions, ra_value::number, RA_INFO_SES_DESC_C, RA_INFO_SES_NAME_C, RA_INFO_SESSION_END, ra_meas_handle_from_any_handle(), ra_value_set_string_utf8(), and ra_meas::sessions.

Referenced by ra_info_get().

void init_config struct config_info conf  ) 
 

Parameters:
<conf> pointer to the configuration infos
The function set the configuration parameters to values which will work when no config-file is found.

Definition at line 286 of file ra.c.

References MAX_PATH_RA, config_info::plugin_dir, and config_info::po_dir.

Referenced by read_config().

void init_i18n struct librasch ra  ) 
 

Parameters:
<ra> pointer to general libRASCH struct
This function call functions for i18n handling and set global variables for i18n. The following variable(s) are set:

  • ra_i18n_codeset: the name of the current codeset ("" if locale is not working)

Definition at line 149 of file ra.c.

References librasch::config, MAX_I18N_LEN, config_info::po_dir, ra_i18n_codeset, and ra_print_debug_infos.

Referenced by ra_lib_init().

LIBRAAPI int ra_ch_add rec_handle  rh  ) 
 

Parameters:
<rh> handle of the recording
Adds a channel to the recording rh. The number of the channel will be returned.

Not implemented yet. !!!

Definition at line 1940 of file ra.c.

References _ra_set_error, plugin_struct::access, plugin_access_func::ch_add, ra_meas::p, RA_ERR_ERROR, RA_ERR_PL_API_NOT_AVAIL, and ra_meas_handle_from_any_handle().

LIBRAAPI int ra_dev_add rec_handle  rh  ) 
 

Parameters:
<rh> handle of the recording
Adds a device to the recording rh. The number of the device will be returned.

Not implemented yet. !!!

Definition at line 1907 of file ra.c.

References _ra_set_error, plugin_struct::access, plugin_access_func::dev_add, ra_meas::p, RA_ERR_ERROR, RA_ERR_PL_API_NOT_AVAIL, and ra_meas_handle_from_any_handle().

LIBRAAPI int ra_gui_call any_handle  h,
plugin_handle  pl
 

Parameters:
<h> processing-handle or view-handle
<pl> plugin-handle
If the plugin pl provides a GUI-element, this function shows this GUI-element and transfer control to it. The h variable contains some information, needed by the plugin. For more information if a plugin provides a GUI-element and what type/information is needed, please see the plugin specific documentation.

Definition at line 2126 of file ra.c.

References _ra_set_error, plugin_struct::call_gui, RA_ERR_ERROR, and RA_ERR_PL_API_NOT_AVAIL.

LIBRAAPI int ra_info_get any_handle  h,
int  id,
value_handle  vh
 

Parameters:
<h> handle
<id> id of information wanted
<vh> value_handle receiving the info
Returns 0 if the wanted information was found and != 0 if not. The information will be in vh. For usage of the function please see user-manual.

Definition at line 1244 of file ra.c.

References _ra_set_error, plugin_struct::access, check_handle_type(), eval_get_info(), plugin_access_func::get_info_id, get_lib_info(), get_meas_general_info(), get_plugin_from_handle(), get_plugin_info(), get_proc_info(), get_session_info(), RA_ERR_PL_API_NOT_AVAIL, RA_HANDLE_LIB, RA_HANDLE_MEAS, RA_HANDLE_PLUGIN, RA_INFO_EVALUATION, RA_INFO_EVALUATION_END, RA_INFO_MEASUREMENT_END, RA_INFO_MEASUREMENT_START, RA_INFO_PROCESSING_END, RA_INFO_PROCESSING_START, RA_INFO_SESSION_END, RA_INFO_SESSION_START, and ra_value_reset().

Referenced by calc_x_scales(), copy_move_meas(), get_eval_file(), get_eval_file_xml(), ra_info_get_by_name(), ra_meas_delete(), ra_meas_move(), and write_evals_xml().

LIBRAAPI int ra_info_get_by_idx any_handle  h,
int  info_type,
int  idx,
value_handle  vh
 

Parameters:
<h> measurement-handle
<info_type> type of information wanted
<idx> index of information wanted
<vh> value_handle receiving the info
Returns 0 if the wanted information was found and != 0 if not. The information will be in vh. For usage of the function please see user-manual.

Definition at line 1749 of file ra.c.

References _ra_set_error, plugin_struct::access, plugin_access_func::get_info_idx, get_plugin_from_handle(), RA_ERR_PL_API_NOT_AVAIL, RA_ERR_UNKNOWN_INFO, and ra_value_reset().

LIBRAAPI int ra_info_get_by_name any_handle  h,
const char *  name,
value_handle  vh
 

Parameters:
<h> handle
<name> name (text string) of information wanted
<vh> value_handle receiving the info
Returns 0 if the wanted information was found and != 0 if not. The information will be in vh. For usage of the function please see user-manual.

Definition at line 1724 of file ra.c.

References find_ra_info_by_name(), local_to_utf8(), ra_info_get(), and ra_value_get_info().

LIBRAAPI int ra_info_set any_handle  h,
value_handle  vh
 

Parameters:
<h> handle
<vh> value_handle with the info
Not implemented !!!

Definition at line 1783 of file ra.c.

References _ra_set_error, plugin_struct::access, meta_info::desc, get_meta_info(), get_plugin_from_handle(), ra_value::id, meta_info::id, meta_info::name, RA_ERR_PL_API_NOT_AVAIL, RA_ERR_UNKNOWN_INFO, plugin_access_func::set_info, and set_meta_info().

LIBRAAPI void ra_lib_close ra_handle  h  ) 
 

Parameters:
<h> handle to ra instance
Close libRASCH, close plugins and frees all allocated memory.

Definition at line 394 of file ra.c.

References close_plugins(), librasch::error_from, and librasch::pl_head.

LIBRAAPI long ra_lib_get_error ra_handle  h,
char *  text,
int  len
 

Parameters:
<h> handle to ra instance
<text> character buffer which receives error text
<len> size of character buffer text
This function returns the last error occured in libRASCH (or in one of the plugins). See 'ra_error.h' for meaning of returned number. If the number is negative, the last error was an OS specific error and the error number comes from the OS (just remove the minus sign). If text is not NULL, a short error description will be returned in text.

Definition at line 423 of file ra.c.

References librasch::error_from, librasch::error_number, get_error_text(), and utf8_to_local_inplace().

Referenced by _ra_set_error_int().

LIBRAAPI int ra_lib_get_option any_handle  h,
const char *  opt_name,
value_handle  vh
 

Parameters:
<h> return option from this object
<opt_name> name of the option
<vh> after function-call, contains option value
The function tries to return the option opt_name from the object h. At the moment only options for process-plugins (h needs to be a process-handle) are supported.

Definition at line 2327 of file ra.c.

References _ra_set_error, find_option(), get_option(), plugin_struct::info, local_to_utf8(), ra_option_infos::num_offset, plugin_infos::num_options, ra_option_infos::offset, plugin_infos::opt, proc_info::options, proc_info::plugin, RA_ERR_ERROR, RA_ERR_OPTION_NO_OFFSET, RA_ERR_OPTION_UNKNOWN, RA_ERR_UNSUPPORTED, RA_HANDLE_PROC, and ra_value_reset().

LIBRAAPI ra_handle ra_lib_handle_from_any_handle any_handle  h  ) 
 

Parameters:
<h> handle
Returns handle of libRASCH instance from any handle.

Definition at line 639 of file ra.c.

References ra_meas::ra, RA_HANDLE_EVAL, RA_HANDLE_EVAL_CLASS, RA_HANDLE_EVAL_PROP, RA_HANDLE_EVAL_SUMMARY, RA_HANDLE_FIND, RA_HANDLE_LIB, RA_HANDLE_MEAS, RA_HANDLE_PLUGIN, RA_HANDLE_PROC, RA_HANDLE_REC, RA_HANDLE_VIEW, and ra_meas_handle_from_any_handle().

Referenced by _ra_set_error_int(), post_process_ecg(), and ra_meas_move().

LIBRAAPI ra_handle ra_lib_init void   ) 
 

Init libRASCH, read config-file and init plugins; returns ra_handle.

Definition at line 71 of file ra.c.

References _ra_set_error, close_plugins(), get_plugin_by_name(), init_i18n(), RA_ERR_LOAD_PLUGINS, RA_ERR_NONE, RA_ERR_READ_CONFIG, RA_HANDLE_LIB, ra_in_error, ra_print_debug_infos, RA_WARN_NO_CONFIG_FILE, read_config(), read_plugins(), and set_endian_type().

LIBRAAPI int ra_lib_set_option any_handle  h,
const char *  opt_name,
value_handle  vh
 

Parameters:
<h> option will be set in this object
<opt_name> name of the option
<vh> option value
The function set the option opt_name in object h. At the moment only options for process-plugins (h needs to be a process-handle) are supported.

Definition at line 2478 of file ra.c.

References _ra_set_error, find_option(), plugin_struct::info, local_to_utf8(), ra_option_infos::num_offset, plugin_infos::num_options, ra_option_infos::offset, plugin_infos::opt, proc_info::options, proc_info::plugin, RA_ERR_ERROR, RA_ERR_OPTION_NO_OFFSET, RA_ERR_OPTION_UNKNOWN, RA_ERR_UNSUPPORTED, RA_HANDLE_PROC, and set_option().

Referenced by post_process_ecg().

LIBRAAPI int ra_lib_use_plugin ra_handle  h,
int  plugin_index,
int  use_it
 

Parameters:
<h> handle to libRASCH
<plugin_index> index of plugin to change
<use_it> flag using plugin (1: use plugin, !1: do not use plugin)
Use or do not use plugin.

Definition at line 741 of file ra.c.

References _ra_set_error, get_plugin(), plugin_struct::info, RA_ERR_UNKNOWN_PLUGIN, and plugin_infos::use_plugin.

LIBRAAPI void ra_meas_close meas_handle  mh  ) 
 

Parameters:
<mh> handle to measurement
Close a measurement.

Definition at line 1203 of file ra.c.

References plugin_struct::access, plugin_access_func::close_meas, ra_meas::eval, free_eval_infos(), free_session_rec(), ra_meas::num_sessions, ra_meas::p, ra_free_mem, ra_session::root_rec, ra_meas::sessions, and ra_meas::x_scale.

Referenced by ra_meas_delete(), and ra_meas_move().

LIBRAAPI void ra_meas_close_find ra_find_handle  h  ) 
 

Parameters:
<h> find-handle
End a search for libRASCH-handled measurements (frees some memory). Must be called if the ra_find_handle h returned from ra_meas_find_first() will no be longer used.

Definition at line 942 of file ra.c.

References find_meas::names, find_meas::num, and ra_free_mem.

LIBRAAPI int ra_meas_copy meas_handle  mh,
const char *  dest_dir
 

Parameters:
<mh> handle of measurement which should be copied
<dest_dir> destination directory
The function copy the files of measurement mh to directory dest_dir.

IMPORTANT!!! Function _not_ completely tested. Use at your own risk.

Definition at line 2642 of file ra.c.

References copy_move_meas(), local_to_utf8(), and MAX_PATH_RA.

LIBRAAPI int ra_meas_delete meas_handle  mh  ) 
 

Parameters:
<mh> handle of measurement which should be deleted
The function deletes the files of measurement mh. The measurement mh will be closed after the deletion. Therefore mh is no longer a valid measurement-handle.

IMPORTANT!!! Function _not_ completely tested. Use at your own risk.

Definition at line 2818 of file ra.c.

References delete_file(), MAX_PATH_RA, RA_INFO_DIR_L, RA_INFO_FILES_CA, ra_info_get(), RA_INFO_PATH_C, ra_meas_close(), ra_value_free(), ra_value_get_long(), ra_value_get_num_elem(), ra_value_get_string(), ra_value_get_string_array(), and ra_value_malloc().

LIBRAAPI ra_find_handle ra_meas_find_first ra_handle  h,
const char *  dir,
struct ra_find_struct rfs
 

Parameters:
<h> handle to libRASCH
<dir> directory which should be scanned for measurements
<rfs> pointer to ra_find_struct which will held the infos for the found measurement.
Search for libRASCH-handled measurements in dir. If at least on measurement was found a valid (!NULL) ra_find_handle will be returned and the infos about the measurement is in mfs.

Definition at line 865 of file ra.c.

References plugin_struct::access, find_meas::curr, plugin_access_func::find_meas, find_meas::handle_id, plugin_struct::info, local_to_utf8(), MAX_PATH_RA, ra_find_struct::name, find_meas::names, plugin_struct::next, find_meas::num, RA_HANDLE_FIND, plugin_infos::use_plugin, and utf8_to_local_inplace().

LIBRAAPI int ra_meas_find_next ra_find_handle  h,
struct ra_find_struct rfs
 

Parameters:
<h> find-handle
<rfs> pointer to ra_find_struct which will held the infos for the found measurement.
Returns 1 if another measurement was found (the information will be in mfs) or 0 if there are no more measurements searched with ra_meas_find_first().

Definition at line 918 of file ra.c.

References find_meas::curr, find_meas::handle_id, MAX_PATH_RA, ra_find_struct::name, find_meas::names, find_meas::num, RA_HANDLE_FIND, and utf8_to_local_inplace().

LIBRAAPI meas_handle ra_meas_handle_from_any_handle any_handle  h  ) 
 

Parameters:
<h> handle
Returns measurement-handle.

Definition at line 685 of file ra.c.

References _ra_set_error, ra_rec::meas, eval::meas, eval_class::meas, eval_property::meas, eval_summary::meas, RA_ERR_UNKNOWN_HANDLE, RA_HANDLE_EVAL, RA_HANDLE_EVAL_CLASS, RA_HANDLE_EVAL_PROP, RA_HANDLE_EVAL_SUMMARY, RA_HANDLE_MEAS, RA_HANDLE_REC, and eval_summary::sum.

Referenced by get_session_info(), ra_ch_add(), ra_dev_add(), ra_eval_set_default(), ra_lib_handle_from_any_handle(), ra_raw_get(), and ra_raw_get_unit().

LIBRAAPI meas_handle ra_meas_move meas_handle  mh,
const char *  dest_dir
 

Parameters:
<mh> handle of measurement which should be moved
<dest_dir> destination directory
The function move the files of measurement mh to directory dest_dir. After the move the measurement will be reopend (to be able to handle the new positions of the files) and the functions returns the new measurement-handle.

IMPORTANT!!! Function _not_ completely tested. Use at your own risk.

Definition at line 2664 of file ra.c.

References copy_move_meas(), ra_meas::eval, eval_info::filename, local_to_utf8(), MAX_PATH_RA, ra_info_get(), RA_INFO_PATH_C, ra_lib_handle_from_any_handle(), ra_meas_close(), ra_meas_open(), ra_value_free(), ra_value_get_string(), and ra_value_malloc().

LIBRAAPI meas_handle ra_meas_new ra_handle  h,
const char *  dir,
const char *  name
 

Parameters:
<h> handle to libRASCH
<dir> directory where the measurement-files should be stored
<name> name of the measurement
Creates a new measurement with the name name in the directory dir. The function returns the handle to the measurement. The measurement will be stored using the libRASCH file-format.

Not full implemented. !!!

Definition at line 1114 of file ra.c.

References _ra_set_error, plugin_struct::access, calc_x_scales(), ra_meas::handle_id, local_to_utf8(), plugin_access_func::new_meas, ra_meas::p, ra_meas::ra, RA_ERR_PL_API_NOT_AVAIL, RA_HANDLE_MEAS, and ra_plugin_get_by_name().

LIBRAAPI meas_handle ra_meas_open ra_handle  h,
const char *  file,
const char *  eval_file,
int  fast
 

Parameters:
<h> handle to libRASCH
<file> file-name of the measurement
<eval_file> file-name of the evaluation
<fast> flag if some init-code should be done (=0) or not (=1)
Opens the measurement file and returns a handle to the measurement. If the fast-flag is set, some initialisation-code (e.g. reading evaluation infos from the files) will not be done. This can be useful if only information about the measurment-object is needed but not about the evaluation. Getting the evaluation infos can be "very" time consuming.

Definition at line 976 of file ra.c.

References _ra_set_error, plugin_struct::access, calc_x_scales(), plugin_access_func::check_meas, ra_meas::handle_id, plugin_struct::info, load_eval(), local_to_utf8(), MAX_PATH_RA, plugin_struct::next, plugin_access_func::open_meas, ra_meas::p, librasch::pl_head, ra_meas::ra, RA_ERR_UNSUP_FORMAT, RA_HANDLE_MEAS, read_evaluation(), and plugin_infos::use_plugin.

Referenced by ra_meas_move().

LIBRAAPI int ra_meas_save meas_handle  mh  ) 
 

Parameters:
<mh> handle to measurement
Saves the changes to a measurement (NOT to the evaluation). Plugin must support this.

Not full implemented. !!!

Definition at line 1174 of file ra.c.

References _ra_set_error, plugin_struct::access, RA_ERR_PL_API_NOT_AVAIL, RA_ERR_WRONG_HANDLE, RA_HANDLE_MEAS, and plugin_access_func::save_meas.

LIBRAAPI plugin_handle ra_plugin_get_by_name ra_handle  h,
const char *  name,
int  search_all
 

Parameters:
<h> handle to libRASCH
<name> name of plugin
<search_all> flag if all plugins should be searched (or only those with the use-it-flag enabled)
Returns the plugin-handle for plugin with name name.

Definition at line 828 of file ra.c.

References _ra_set_error, get_plugin_by_name(), plugin_struct::info, local_to_utf8(), RA_ERR_ERROR_INTERNAL, RA_ERR_UNKNOWN_PLUGIN, and plugin_infos::use_plugin.

Referenced by post_process_ecg(), and ra_meas_new().

LIBRAAPI plugin_handle ra_plugin_get_by_num ra_handle  h,
int  plugin_num,
int  search_all
 

Parameters:
<h> handle to libRASCH
<plugin_num> number of plugin
<search_all> flag if all plugins should be searched (or only those with the use-it-flag enabled)
Returns the plugin-handle for plugin #plugin_num.

Definition at line 804 of file ra.c.

References _ra_set_error, get_plugin(), plugin_struct::info, RA_ERR_UNKNOWN_PLUGIN, and plugin_infos::use_plugin.

LIBRAAPI int ra_proc_do proc_handle  proc  ) 
 

Parameters:
<proc> processing-handle
This function calls the "processing" function of a process-plugin. For more information what information in proc is needed, please see the plugin specific documentation.

Definition at line 2215 of file ra.c.

References _ra_set_error, plugin_process_func::do_processing, proc_info::mh, proc_info::plugin, plugin_struct::proc, RA_ERR_ERROR, and RA_ERR_PL_API_NOT_AVAIL.

Referenced by post_process_ecg().

LIBRAAPI void ra_proc_free proc_handle  proc  ) 
 

Parameters:
<proc> processing-handle
This function frees a processing-handle and all associated memory.

Definition at line 2185 of file ra.c.

References _ra_set_error, plugin_process_func::free_proc_handle, proc_info::plugin, plugin_struct::proc, RA_ERR_ERROR, and RA_ERR_PL_API_NOT_AVAIL.

Referenced by post_process_ecg().

LIBRAAPI proc_handle ra_proc_get meas_handle  mh,
plugin_handle  pl,
void(*)(const char *, int)  callback
 

Parameters:
<pl> plugin-handle
This function returns a proc_handle for the plugin pl. The proc_handle will be returned initialized.

Definition at line 2153 of file ra.c.

References _ra_set_error, plugin_process_func::get_proc_handle, plugin_struct::proc, plugin_struct::ra, and RA_ERR_PL_API_NOT_AVAIL.

Referenced by post_process_ecg().

LIBRAAPI int ra_proc_get_result proc_handle  proc,
long  res_num,
long  res_set,
value_handle  vh
 

Parameters:
<proc> processing-handle
<res_num> number (zero-based index) of the wanted result
<res_set> number (zero-based index) of the wanted result-set
<vh> value-handle
This function returns in vh one result from a processing perfomed with ra_proc_do.

Definition at line 2247 of file ra.c.

References _ra_set_error, plugin_struct::info, plugin_infos::name, proc_info::num_result_sets, proc_info::num_results, proc_info::plugin, RA_ERR_ERROR, RA_ERR_OUT_OF_RANGE, ra_value_copy(), RA_VALUE_NAME_MAX, ra_value_reset(), and proc_info::results.

LIBRAAPI size_t ra_raw_add meas_handle  mh,
unsigned int  ch,
value_handle  vh
 

Parameters:
<mh> handle of the measurement
<ch> channel where data should be added
<vh> data to be added
Adds raw data to a measurement. The data is added to the current session.

Not implemented yet. !!!

Definition at line 2009 of file ra.c.

References _ra_set_error, plugin_struct::access, plugin_access_func::add_raw, ra_meas::p, RA_ERR_ERROR, and RA_ERR_PL_API_NOT_AVAIL.

LIBRAAPI size_t ra_raw_get rec_handle  rh,
unsigned int  ch,
size_t  start,
size_t  num_data,
DWORD data,
DWORD data_high
 

Parameters:
<rh> recording-handle
<ch> channel
<start> first sample
<num_data> number of samples
<data> buffer for samples
<data_high> buffer for higher 4 bytes of samples (if size of one sample > 4 bytes)
This function returns the sample's (raw-signal data) from the measurement mh and the recording rh. The first sample in data will be the sample number start (in sampleunits) and max. num_data are in data. The memory for buffer data must be allocated in calling function. The samples returned in this function are the samples as stored in the file. If the size of one sample is greater than 4 bytes, the upper part of the samples are stored in the data_high buffer. If the size is not greater than 4 bytes, the buffer is not needed.

Definition at line 2051 of file ra.c.

References _ra_set_error, plugin_struct::access, plugin_access_func::get_raw, ra_meas::p, RA_ERR_ERROR, RA_ERR_PL_API_NOT_AVAIL, and ra_meas_handle_from_any_handle().

LIBRAAPI size_t ra_raw_get_unit rec_handle  rh,
unsigned int  ch,
size_t  start,
size_t  num_data,
double *  data
 

Parameters:
<rh> recording-handle
<ch> channel
<start> first sample
<num_data> number of samples
<data> buffer for samples
This function returns the sample's (raw-signal data) from the measurement mh and the recording rh. The first sample in data will be the sample number start (in sampleunits) and max. num_data are in data. The memory for buffer data must be allocated in calling function. The values are scaled to the unit of the channel.

Definition at line 2091 of file ra.c.

References _ra_set_error, plugin_struct::access, plugin_access_func::get_raw_unit, ra_meas::p, RA_ERR_ERROR, RA_ERR_PL_API_NOT_AVAIL, and ra_meas_handle_from_any_handle().

LIBRAAPI rec_handle ra_rec_add meas_handle  mh,
rec_handle  parent
 

Parameters:
<mh> handle of the measurement
<parent> handle of the parent recording (or NULL)
Adds a recording to a measurement. The recording will be a child-recording of the parent-recording parent. The recording-handle will be returned.

Not implemented yet. !!!

Definition at line 1874 of file ra.c.

References _ra_set_error, plugin_struct::access, ra_meas::p, RA_ERR_ERROR, RA_ERR_PL_API_NOT_AVAIL, and plugin_access_func::rec_add.

LIBRAAPI rec_handle ra_rec_get_first meas_handle  mh,
long  session
 

Parameters:
<mh> measurement-handle
<session> session number
Returns the first recording-handle of session session.

Definition at line 1822 of file ra.c.

References _ra_set_error, ra_meas::num_sessions, RA_ERR_OUT_OF_RANGE, ra_session::root_rec, and ra_meas::sessions.

Referenced by calc_x_scales(), get_eval_file(), and get_eval_file_xml().

LIBRAAPI rec_handle ra_rec_get_first_child rec_handle  rh  ) 
 

Parameters:
<rh> recording-handle
Returns the first child-recording of recording rh.

Definition at line 1857 of file ra.c.

LIBRAAPI rec_handle ra_rec_get_next rec_handle  rh  ) 
 

Parameters:
<rh> recording-handle
Returns the next recording which follows recording rh.

Definition at line 1843 of file ra.c.

LIBRAAPI int ra_session_new meas_handle  mh  ) 
 

Parameters:
<mh> handle of the measurement
Starts a new recording session and close the previous one. The function returns the new session number.

Not implemented yet. !!!

Definition at line 1974 of file ra.c.

References _ra_set_error, plugin_struct::access, ra_meas::p, RA_ERR_ERROR, RA_ERR_PL_API_NOT_AVAIL, and plugin_access_func::session_new.

LIBRAAPI int ra_view_get view_handle  vh  ) 
 

Parameters:
<vh> view-handle
This function creates/shows the GUI-element/window provided by a view-plugin. Please check plugin specific documentation what additional information is needed.

Definition at line 2293 of file ra.c.

References _ra_set_error, plugin_view_func::get_view, view_info::plugin, view_info::ra, plugin_struct::ra, RA_ERR_ERROR, RA_ERR_PL_API_NOT_AVAIL, and plugin_struct::view.

int read_config struct librasch ra  ) 
 

Parameters:
<ra> pointer to general libRASCH struct
Read the configuration set for libRASCH. On Windows, first try to get configuration from Registry. Than try to get configuration from libRASCH config-file. (See find_config_file() in which locations is looked for.) When no config-file was found, '-1' will be returned. When an error inside the config-file was found, '-2' will be returned.

Definition at line 207 of file ra.c.

References librasch::config, EVAL_MAX_NAME, find_config_file(), init_config(), MAX_PATH_RA, config_info::plugin_dir, config_info::po_dir, and ra_print_debug_infos.

Referenced by ra_lib_init().

void set_endian_type  ) 
 

This function get the endianness of the current system on runtime and set the global variable 'ra_endian_type' accordingly.

Definition at line 124 of file ra.c.

References RA_BIG_ENDIAN, ra_endian_type, and RA_LITTLE_ENDIAN.

Referenced by ra_lib_init().

int set_option void *  options,
struct ra_option_infos opt_info,
value_handle  vh,
long  num_offset
 

Parameters:
<options> pointer to an option struct
<opt_info> used option
<vh> value-handle (has value which should be set)
<num_offset> offset where number of array elements will be set (only for array values needed)
Function set the value for the option given in 'vh'.

Definition at line 2541 of file ra.c.

References ra_option_infos::offset, ra_alloc_mem, ra_free_mem, ra_value_get_double(), ra_value_get_double_array(), ra_value_get_long(), ra_value_get_long_array(), ra_value_get_num_elem(), ra_value_get_short(), ra_value_get_short_array(), ra_value_get_string_utf8(), ra_value_get_voidp(), ra_value_get_voidp_array(), RA_VALUE_TYPE_CHAR, RA_VALUE_TYPE_CHAR_ARRAY, RA_VALUE_TYPE_DOUBLE, RA_VALUE_TYPE_DOUBLE_ARRAY, RA_VALUE_TYPE_LONG, RA_VALUE_TYPE_LONG_ARRAY, RA_VALUE_TYPE_SHORT, RA_VALUE_TYPE_SHORT_ARRAY, RA_VALUE_TYPE_VOIDP, RA_VALUE_TYPE_VOIDP_ARRAY, and ra_option_infos::type.

Referenced by ra_lib_set_option().


Variable Documentation

int ra_endian_type
 

A global variable which gives endian type on the running machine (set in ra_lib_init)

Definition at line 57 of file ra.c.

Referenced by get_endian_type(), and set_endian_type().

char ra_i18n_codeset[MAX_I18N_LEN]
 

A global variable with the name of the current codeset

Definition at line 62 of file ra.c.

Referenced by do_i18n_conversion(), init_i18n(), local_is_utf8(), local_to_utf8(), local_to_utf8_inplace(), utf8_to_local(), and utf8_to_local_inplace().

int ra_in_error
 

A global variable which controls if already in error-mode (needed to avoid circular calling).

Definition at line 52 of file ra.c.

Referenced by _ra_set_error_int(), and ra_lib_init().

int ra_print_debug_infos
 

A global variable which controls debug-infos.

Definition at line 47 of file ra.c.

Referenced by _ra_set_error_int(), _trace_sigdest(), _trace_signame(), dload_plugin(), init_i18n(), ra_lib_init(), read_config(), and read_plugins().


Generated on Fri May 27 11:33:10 2005 for libRASCH by  doxygen 1.4.2