acl_compile_c
status.i4.v = acl_compile_c(command_text.i1a.r, command_length.i4.v,
subst_devices.i1a.r, num_devices.i4.v,
default_ftd.i2.v, options.u4.v,
compiled_code.gp.r, error_string.i1a.r
[,subst_strings.i1pa.r]
[,num_subst_str.i4.v] [,procs.sa.r]
[,num_procs.i4.v])
This routine compiles Accelerator Command Language (ACL) commands
for later execution. The commands are ASCII strings with one command
per string. Each line should be terminated by a new line or null
character.
command_text ASCII commands to compile
command_length total length of command text (If a value of zero
is passed for this argument, the command text will
be treated as a single null terminated string.)
subst_devices array of substitute device names which replace
device names in the source code of the form "G:DEVnnn"
(DEVICE_NAME_LEN characters per entry)
(If the option ACL_OPT_SUBST_ARRAY_DEVICES is
selected, there should be C_STYLE_LONG_DEVICE_NAME_LEN
characters per entry.)
(A value of NULL can be passed for this argument
if no substitute device names are needed.)
num_devices number of substitute devices
default_ftd default reading FTD for any devices in the code
options execution options
(ACL_OPT_NONE -> no options selected, parse and
compile the code,
ACL_OPT_INFO_PARSE -> build information on symbols
and devices accessed,
ACL_OPT_SAVE_SOURCE -> save source code with
compiled code,
ACL_OPT_SUBST_ARRAY_DEVICES -> substitute device names
can include array
indices
(C_STYLE_LONG_DEVICE_NAME_LEN
characters per entry))
compiled_code returned compiled code (Note: The memory for this
allocated by this routine and should be freed by
the caller by calling the routine 'acl_free_c'.)
error_string returned error string (Allow at least 133 characters.)
(A value of NULL can be passed for this argument
if this information is not needed.)
[subst_strings] array of null terminated strings which will replace
strings in the source code of the form "STRINGnnn"
(default is NULL)
[num_subst_str] number of substitute strings supplied
(default is 0)
[procs] array of calling process procedure information
(array of structures of type ACL_PROC_DATA)
(default is NULL)
[num_procs] number of calling process procedures
(default is 0)
This function returns ACNET status values as follows:
CLIB_OK success
CLIB_MEMFAIL failed in allocating dynamic memory
CLIB_SYNTAX syntax error
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_execute_c, acl_free_c, acl_file_execute_c,
acl_file_read_c, acl_file_write_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,
acl_script_is_executing, acl_register_host_request_func,
acl_unregister_host_request_func, acl_translate_command_string
C usage:
static const char command_text[] = "set B:HB812 700.0";
char *subst_devices = (char *) NULL;
char error_string[133];
char **subst_strings = (char **) NULL;
short default_ftd = FTD_ONESHOT;
int status;
int command_length = 0;
int num_devices = 0;
int num_subst_str = 0;
int num_procs = 0;
unsigned int options = ACL_OPT_NONE;
void *compiled_code;
ACL_PROC_DATA *procs = (ACL_PROC_DATA *) NULL;
status = acl_compile_c(command_text,command_length,subst_devices,
num_devices,default_ftd,options,&compiled_code,
error_string,subst_strings,num_subst_str,
procs,num_procs);