sr_file_devices_c
status.i4.v = sr_file_devices_c(file_number.i4.v, data_source.i4.v,
usage.i1a.r, case_number.i4.v,
subcase_number.i4.v, num_scalars.i4.r,
scalar_dis.i4p.r, scalar_pis.i2p.r,
num_snapshots.i4.r, snapshot_dis.i4p.r,
snapshot_pis.i2p.r [,num_ftps.i4.r]
[,ftp_dis.i4p.r] [,ftp_pis.i2p.r])
This routine will return the list of devices actually present
in a save/restore or SDA file. A value of NULL can be passed
for any of the returned arguments if that value is not needed.
file_number desired file number
data_source source of data
(SRMNGR_NORMAL -> normal save/restore files,
SRMNGR_SDA_DATA -> SDA data)
usage null terminated SDA usage string
(SDA_USAGE_NAME_LEN characters)
case_number desired case number (SDA only)
(If a value of CLIB_DEFAULT_ARG is passed,
data will be collected for all cases.)
subcase_number desired subcase number (SDA only)
(If a value of CLIB_DEFAULT_ARG is passed,
data will be collected for all subcases.)
num_scalars returned number of scalar devices
scalar_dis returned array of scalar device indices
(This memory should be freed by the caller.)
scalar_pis returned array of scalar device property indices
(This memory should be freed by the caller.)
num_snapshots returned number of snapshot devices
snapshot_dis returned array of snapshot device indices
(This memory should be freed by the caller.)
snapshot_pis returned array of snapshot device property indices
(This memory should be freed by the caller.)
[num_ftps] returned number of fast time plot devices
(default is NULL)
[ftp_dis] returned array of fast time plot device indices
(This memory should be freed by the caller.)
(default is NULL)
[ftp_pis] returned array of fast time plot device property indices
(This memory should be freed by the caller.)
(default is NULL)
This function returns status values as follows:
OK success
CLIB_INVARG invalid data source
CLIB_NO_SUCH no such SDA usage, case number, or subcase
number or no devices found
CLIB_MEMFAIL dynamic memory allocation failure
SQL_xxx error reading database
This function requires the following include files:
cbslib_h, cns_data_structs_h, acnet_errors_h
Related functions:
sr_file_has_device_c, sr_file_has_devices_c, sr_data_length_c,
sr_sda_data_lengths_c, sr_file_menu_c, sr_sda_cases_present_c,
sr_sda_subcases_present_c, sr_sda_num_subcases_c, sr_get_device_c,
sr_get_device_raw_c, sr_get_array_device_c, sr_get_snapshot_c,
sr_read_snapshot_c, sr_snapshot_header_c, sr_snapshot_info_c,
sr_snapshot_info_list_c, sr_is_on_c, sr_is_positive_c, sr_status_c,
sr_status_text_c, sr_restore_device_c, sr_sda_case_times_c
C/C++ usage:
static const char usage[] = "ColliderShot";
short *scalar_pis;
short *snapshot_pis;
short *ftp_pis;
int status;
int file_number = 1;
int data_source = SRMNGR_NORMAL;
int case_number = CLIB_DEFAULT_ARG;
int subcase_number = CLIB_DEFAULT_ARG;
int num_scalars;
int num_snapshots;
int num_ftps;
int *scalar_dis;
int *snapshot_dis;
int *ftp_dis;
status = sr_file_devices_c(file_number,data_source,usage,case_number,
subcase_number,&num_scalars,&scalar_dis,
&scalar_pis,&num_snapshots,&snapshot_dis,
&snapshot_pis,&num_ftps,&ftp_dis,&ftp_pis);