acl_file_read_c
status.i4.v = acl_file_read_c(file_name.i1a.r, file_type.i4.v,
command_text.i1p.r, command_length.i4.r,
num_symbols.i4.r, num_read_devs.i4.r,
num_set_devs.i4.r [,options.u4.v])
This routine reads Accelerator Command Language (ACL) code from
a file or database table. If the database option is chosen, the
table which contains the code must be ACL_DB_TABLE. A value of
NULL can be passed for any of the returned arguments whose values
are not needed.
file_name null terminated file name
file_type type of file
(ACL_FLAT_FILE -> ASCII text file,
ACL_DB_FILE -> "file_name" should be the database
table name from ACL_DB_TABLE)
command_text returned code text with each line terminated by
a new line character (The memory for this buffer
is allocated by this routine and must not be freed
the caller. It will be freed by the next call
to this routine.)
command_length returned total length of the command text
num_symbols returned number of symbols created
num_read_devs returned number of devices which will be read
num_set_devs returned number of devices which may be set
[options] read options
(ACL_OPT_NONE -> no options selected,
ACL_OPT_DONT_CLOSE -> leave database connection
open upon exit (close later
with 'db_close'))
This function returns ACNET status values as follows:
CLIB_OK success
CLIB_MEMFAIL failed in allocating dynamic memory
CLIB_NOTOPN failed to open file
CLIB_INVSIZ command line too long
otherwise other ACNET format error code
This function requires the following include files:
cbslib_h, acnet_errors.h
Related functions:
intro_acl, acl_file_write_c, acl_file_execute, acl_execute_c,
acl_compile_c, acl_free_c, acl_read_symbol_c, acl_read_symbol_info_c,
acl_read_symbol_names, acl_delete_symbol, acl_info_c,
acl_cancel_requests_c, acl_set_symbol_c, acl_default_data_source_c,
acl_log_file_c, acl_default_script_path_c, db_close,
acl_script_is_executing, acl_register_host_request_func,
acl_unregister_host_request_func, acl_translate_command_string
C usage:
static const char file_name[] = "acl_file.acl";
char *command_text;
int status;
int file_type = ACL_FLAT_FILE;
int command_length;
int num_symbols;
int num_read_devices;
int num_set_devices;
unsigned int options = ACL_OPT_NONE;
status = acl_file_read_c(file_name,file_type,&command_text,
&command_length,&num_symbols,
&num_read_devices,&num_set_devices,options);