| Uil(3) | Library Functions Manual | Uil(3) |
Uil — Invokes the UIL compiler from within an application "Uil" "uil functions" "Uil" "uil compiler"
#include <uil/UilDef.h> Uil_status_type Uil( Uil_command_type *command_desc, Uil_compile_desc_type **compile_desc, Uil_continue_type (*message_cb) (), char *message_data, Uil_continue_type (*status_cb) (), char *status_data);
The Uil function provides a callable entry point for the UIL compiler. The Uil callable interface can be used to process a UIL source file and to generate UID files, as well as return a detailed description of the UIL source module in the form of a symbol table (parse tree).
Following are the data structures Uil_command_type and Uil_compile_desc_type:
typedef struct Uil_command_type { char *source_file; /* single source to compile */ char *resource_file; /* name of output file */ char *listing_file; /* name of listing file */ unsigned int *include_dir_count; /* number of dirs. in include_dir */ char *((*include_dir) []); /* dir. to search for include files */ unsigned listing_file_flag: 1; /* produce a listing */ unsigned resource_file_flag: 1; /* generate UID output */ unsigned machine_code_flag: 1; /* generate machine code */ unsigned report_info_msg_flag: 1; /* report info messages */ unsigned report_warn_msg_flag: 1; /* report warnings */ unsigned parse_tree_flag: 1; /* generate parse tree */ unsigned int status_update_delay; /* number of times a status point is */ /* passed before calling status_cb */ /* function 0 means called every time */ char *database; /* name of database file */ unsigned database_flag: 1; /* read a new database file */ unsigned use_setlocale_flag: 1; /* enable calls to setlocale */ }; typedef struct Uil_compile_desc_type { unsigned int compiler_version; /* version number of compiler */ unsigned int data_version; /* version number of structures */ char *parse_tree_root; /* parse tree output */ unsigned int message_count [Uil_k_max_status+1]; /* array of severity counts */ };
Following is a description of the message callback function specified by message_cb:
Uil_continue_type (*message_cb) (message_data, message_number, severity, msg_buffer,
src_buffer, ptr_buffer, loc_buffer, message_count)
char *message_data;
int message_number;
int severity;
char *msg_buffer, *src_buffer;
char *ptr_buffer, *loc_buffer;
int message_count[];
This function specifies a callback function that UIL invokes instead of printing an error message when the compiler encounters an error in the UIL source. The callback should return one of the following values:
The arguments are
Following is a description of the status callback function specified by status_cb:
Uil_continue_type (*status_cb) (status_data, percent_complete,
lines_processed, current_file, message_count)
char *status_data;
int percent_complete;
int lines_processed;
char *current_file;
int message_count[];
This function specifies a callback function that is invoked to allow X applications to service X events such as updating the screen. The callback should return one of the following values:
The arguments are
This function returns one of the following status return constants:
UilDumpSymbolTable(3) and uil(1).