UIL(3)
π Uil β the library call, bestie π
okay so you already know uil(1) the command, right? Well this is the library call version of that whole situation β same energy, but you're calling it from inside your own app. Let's get into it. β¨
π NAME π
Uil β invokes the UIL compiler from within an application. yes, from within. it's giving embedded-compiler realness. π
πΈ SYNOPSIS πΈ
#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);
π¦ DESCRIPTION π¦
Uil is your callable entry point for the UIL compiler, periodt. You can use this callable interface to process a UIL source file and generate UID files, and it'll hand you back a detailed description of the UIL source module as a symbol table (that's the parse tree, bestie β iconic). π
Now let's meet the arguments, one by one, no skipping:
command_descβ specifies theuilcommand line.compile_descβ returns the results of the compilation.message_cbβ specifies a callback function that gets called when the compiler encounters errors in the UIL source.message_dataβ specifies user data that gets passed to the message callback function (message_cb). Note that this argument is not interpreted by UIL, and is used exclusively by the calling application.status_cbβ specifies a callback function that's called to allow X applications to service X events, like updating the screen. This function gets called at various check points, which have been hard coded into the UIL compiler (fr fr, hard coded). Thestatus_update_delayargument incommand_descspecifies the number of check points to be passed before thestatus_cbfunction is invoked.status_dataβ specifies user data that gets passed to the status callback function (status_cb). Note that this argument is not interpreted by the UIL compiler and is used exclusively by the calling application.
π the data structures, come get your data structures π
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 */
};
like, look at those bit fields. main character energy, honestly. π
π the message callback (message_cb)
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 these values:
Uil_k_terminateβ terminate processing of the source fileUil_k_continueβ continue processing of the source file
The arguments are:
message_dataβ data supplied by the application as themessage_dataargument to theUilfunction. UIL does not interpret this data in any way; it just passes it to the callback.message_numberβ an index into a table of error messages and severities for internal use by UIL.severityβ an integer that indicates the severity of the error. The possible values are the status constants returned by theUilfunction. See Return for more information.msg_bufferβ a string that describes the error.src_bufferβ a string consisting of the source line where the error occurred. This string is not always available. In this case, the argument isNULL.ptr_bufferβ a string consisting of whitespace and a printing character in the character position corresponding to the column of the source line where the error occurred. This string may be printed beneath the source line to provide a visual indication of the column where the error occurred. This string is not always available. In this case, the argument isNULL.loc_bufferβ a string identifying the line number and file of the source line where the error occurred. This is not always available; the argument is thenNULL.message_countβ an array of integers containing the number of diagnostic messages issued thus far for each severity level. To find the number of messages issued for the current severity level, use theseverityargument as the index into this array.
π§ the status callback (status_cb)
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 these values:
Uil_k_terminateβ terminate processing of the source fileUil_k_continueβ continue processing of the source file
The arguments are:
status_dataβ data supplied by the application as thestatus_dataargument to theUilfunction. UIL does not interpret this data in any way; it just passes it to the callback.percent_completeβ an integer indicating what percentage of the current source file has been processed so far.lines_processedβ an integer indicating how many lines of the current source file have been read so far.current_fileβ a string containing the pathname of the current source file.message_countβ an array of integers containing the number of diagnostic messages issued thus far for each severity level. To find the number of messages issued for a given severity level, use the severity level as the index into this array. The possible severity levels are the status constants returned by theUilfunction. See Return for more information.
π RETURN π
This function returns one of the following status return constants:
Uil_k_success_statusβ the operation succeeded. πUil_k_info_statusβ the operation succeeded. An informational message is returned.Uil_k_warning_statusβ the operation succeeded. A warning message is returned.Uil_k_error_statusβ the operation failed due to an error. πUil_k_severe_statusβ the operation failed due to an error. π
lowkey important: notice thatUil_k_error_statusandUil_k_severe_statusare both "the operation failed due to an error". that's what it says, bestie, so that's what we're telling you. no cap.
π RELATED π
and that's the whole page, you ate it. this was Uil(library call), from the Uil(library call) manual β go forth and call your compiler from inside your app like the icon you are. mwah. ππ«ΆπΈ
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms