read_logger_device_file
status.i4.v = read_logger_device_file(file_name.i1a.r,
device_names.i1p.r,
device_indices.i4p.r,
property_indices.i2p.r,
array_indices.i4p.r,
end_indices.i4p.r,
sda_cases.i4p.r,
sda_sets.i4p.r,
sda_final_data.i4p.r)
This routine reads an ASCII file containing Lumberjack device
specifications and returns the list of devices. This routine
allocates the memory for the returned data arrays. The caller
should NOT free this memory. It is cached until the next call
to this routine. Any of the returned arguments can be defaulted
by passing a value of NULL.
An example of a valid file is as follows:
! This is a comment
m:outtmp
g_sctime
t_ha11[12]
t_ha11[12:15]
t_ha11[]
m:outtmp,f,1 ! SDA final data from case 1
m:outtmp,f,1,2 ! SDA final data from case 1, set 2
file_name null terminated ASCII file name (including path)
device_names returned array of ACNET device names
(DEVICE_NAME_LEN characters per entry)
device_indices returned array of device indices
property_indices returned array of property indices
array_indices returned array of device array indices
end_indices returned array of ending device array indices
(A value of 0 indicates that no end index was supplied.)
sda_cases returned array of SDA cases
sda_sets returned array of SDA sets
sda_final_data returned array of SDA final data flags
This function returns status values as follows:
CLIB_NOTOPN failed to open the source file
CLIB_MEMFAIL failed in allocating dynamic memory
CLIB_NO_SUCH no devices found in the file
CLIB_SYNTAX invalid syntax encountered
DBM_xxx invalid, obsoleted, or deleted device
encountered
otherwise number of devices returned
This function requires the following include files:
cnsparam_h, cbslib_h, acnet_errors_h
Related functions:
read_device_file, read_c_style_device_file, read_device_spec_file,
read_tagged_value_file, dio_device_index(_c),
dio_parse_long_device_name_c
C/C++ usage:
static const char file_name[] = "myfile.txt";
char *device_names;
short *property_indices;
int status;
int *device_indices;
int *array_indices;
int *end_indices;
int *sda_cases;
int *sda_sets;
int *sda_final_data;
status = read_logger_device_file(file_name,&device_names,
&device_indices, &property_indices,
&array_indices,&end_indices,
&sda_cases,&sda_sets,&sda_final_data);