Blame doc/man/man3/Uil.3

Packit b099d7
'\" t
Packit b099d7
...\" Uil.sgm /main/11 1996/09/08 21:42:50 rws $
Packit b099d7
.de P!
Packit b099d7
.fl
Packit b099d7
\!!1 setgray
Packit b099d7
.fl
Packit b099d7
\\&.\"
Packit b099d7
.fl
Packit b099d7
\!!0 setgray
Packit b099d7
.fl			\" force out current output buffer
Packit b099d7
\!!save /psv exch def currentpoint translate 0 0 moveto
Packit b099d7
\!!/showpage{}def
Packit b099d7
.fl			\" prolog
Packit b099d7
.sy sed -e 's/^/!/' \\$1\" bring in postscript file
Packit b099d7
\!!psv restore
Packit b099d7
.
Packit b099d7
.de pF
Packit b099d7
.ie     ?\\*(f1?? .ds f1 \\n(.f
Packit b099d7
.el .ie ?\\*(f2?? .ds f2 \\n(.f
Packit b099d7
.el .ie ?\\*(f3?? .ds f3 \\n(.f
Packit b099d7
.el .ie ?\\*(f4?? .ds f4 \\n(.f
Packit b099d7
.el .tm ? font overflow
Packit b099d7
.ft \\$1
Packit b099d7
..
Packit b099d7
.de fP
Packit b099d7
.ie     !?\\*(f4?? \{\
Packit b099d7
.	ft \\*(f4
Packit b099d7
.	ds f4\"
Packit b099d7
'	br \}
Packit b099d7
.el .ie !?\\*(f3?? \{\
Packit b099d7
.	ft \\*(f3
Packit b099d7
.	ds f3\"
Packit b099d7
'	br \}
Packit b099d7
.el .ie !?\\*(f2?? \{\
Packit b099d7
.	ft \\*(f2
Packit b099d7
.	ds f2\"
Packit b099d7
'	br \}
Packit b099d7
.el .ie !?\\*(f1?? \{\
Packit b099d7
.	ft \\*(f1
Packit b099d7
.	ds f1\"
Packit b099d7
'	br \}
Packit b099d7
.el .tm ? font underflow
Packit b099d7
..
Packit b099d7
.ds f1\"
Packit b099d7
.ds f2\"
Packit b099d7
.ds f3\"
Packit b099d7
.ds f4\"
Packit b099d7
.ta 8n 16n 24n 32n 40n 48n 56n 64n 72n 
Packit b099d7
.TH "Uil" "library call"
Packit b099d7
.SH "NAME"
Packit b099d7
\fBUil\fP \(em Invokes the UIL compiler from within an application
Packit b099d7
.iX "Uil"
Packit b099d7
.iX "uil functions" "Uil"
Packit b099d7
.iX "uil compiler"
Packit b099d7
.SH "SYNOPSIS"
Packit b099d7
.PP
Packit b099d7
.nf
Packit b099d7
#include <uil/UilDef\&.h>
Packit b099d7
.sp \n(PDu
Packit b099d7
\fBUil_status_type \fBUil\fP\fR(
Packit b099d7
\fBUil_command_type *\fBcommand_desc\fR\fR,
Packit b099d7
\fBUil_compile_desc_type *\fB*compile_desc\fR\fR,
Packit b099d7
\fBUil_continue_type (*\fBmessage_cb\fR) ()\fR,
Packit b099d7
\fBchar *\fBmessage_data\fR\fR,
Packit b099d7
\fBUil_continue_type (*\fBstatus_cb\fR) ()\fR,
Packit b099d7
\fBchar *\fBstatus_data\fR\fR);
Packit b099d7
.fi
Packit b099d7
.SH "DESCRIPTION"
Packit b099d7
.PP
Packit b099d7
The \fBUil\fP function provides a callable entry point for the UIL
Packit b099d7
compiler\&. The
Packit b099d7
\fBUil\fP callable interface can be used to process
Packit b099d7
a UIL source file and to
Packit b099d7
generate UID files, as well as return a detailed description of the
Packit b099d7
UIL source module in the form of a symbol table (parse tree)\&.
Packit b099d7
.IP "\fIcommand_desc\fP" 10
Packit b099d7
Specifies the \fBuil\fP command line\&.
Packit b099d7
.IP "\fIcompile_desc\fP" 10
Packit b099d7
Returns the results of the compilation\&.
Packit b099d7
.IP "\fImessage_cb\fP" 10
Packit b099d7
Specifies a callback function that is called when the compiler
Packit b099d7
encounters errors in the UIL source\&.
Packit b099d7
.IP "\fImessage_data\fP" 10
Packit b099d7
Specifies user data that is passed to the message callback function
Packit b099d7
(\fImessage_cb)\fP\&. Note that this argument is not interpreted by UIL, and is
Packit b099d7
used exclusively by the calling application\&.
Packit b099d7
.IP "\fIstatus_cb\fP" 10
Packit b099d7
Specifies a callback function that is called to allow X applications to service
Packit b099d7
X events such as updating the screen\&. This function is called
Packit b099d7
at various check points, which have been hard coded into the UIL compiler\&.
Packit b099d7
The \fIstatus_update_delay\fP argument in \fIcommand_desc\fP
Packit b099d7
specifies the number of
Packit b099d7
check points to be passed before the \fIstatus_cb\fP function is invoked\&.
Packit b099d7
.IP "\fIstatus_data\fP" 10
Packit b099d7
Specifies user data that is passed to the status callback function
Packit b099d7
(\fIstatus_cb)\&.\fP
Packit b099d7
Note that this argument is not interpreted by the UIL compiler
Packit b099d7
and is used exclusively by the calling application\&.
Packit b099d7
.PP
Packit b099d7
Following are the data structures \fBUil_command_type\fP and
Packit b099d7
\fBUil_compile_desc_type\fP:
Packit b099d7
.PP
Packit b099d7
.nf
Packit b099d7
\f(CWtypedef struct Uil_command_type {
Packit b099d7
char *source_file;
Packit b099d7
    /* single source to compile */
Packit b099d7
char *resource_file; /* name of output file */
Packit b099d7
char *listing_file; /* name of listing file */
Packit b099d7
unsigned int *include_dir_count;
Packit b099d7
    /* number of dirs\&. in include_dir */
Packit b099d7
char *((*include_dir) []);
Packit b099d7
    /* dir\&. to search for include files */
Packit b099d7
unsigned listing_file_flag: 1;
Packit b099d7
    /* produce a listing */
Packit b099d7
unsigned resource_file_flag: 1;
Packit b099d7
    /* generate UID output */
Packit b099d7
unsigned machine_code_flag: 1;
Packit b099d7
    /* generate machine code */
Packit b099d7
unsigned report_info_msg_flag: 1;
Packit b099d7
    /* report info messages */
Packit b099d7
unsigned report_warn_msg_flag: 1;
Packit b099d7
    /* report warnings */
Packit b099d7
unsigned parse_tree_flag: 1;
Packit b099d7
    /* generate parse tree */
Packit b099d7
unsigned int status_update_delay;
Packit b099d7
    /* number of times a status point is */
Packit b099d7
    /* passed before calling status_cb */
Packit b099d7
    /* function 0 means called every time */
Packit b099d7
char *database;
Packit b099d7
    /* name of database file */
Packit b099d7
unsigned database_flag: 1;
Packit b099d7
    /* read a new database file */
Packit b099d7
unsigned use_setlocale_flag: 1;
Packit b099d7
    /* enable calls to setlocale */
Packit b099d7
};
Packit b099d7
typedef struct Uil_compile_desc_type {
Packit b099d7
unsigned int compiler_version;
Packit b099d7
    /* version number of compiler */
Packit b099d7
unsigned int data_version;
Packit b099d7
    /* version number of structures */
Packit b099d7
char *parse_tree_root; /* parse tree output */
Packit b099d7
unsigned int message_count [Uil_k_max_status+1];
Packit b099d7
/* array of severity counts */
Packit b099d7
};\fR
Packit b099d7
.fi
Packit b099d7
.PP
Packit b099d7
.PP
Packit b099d7
Following is a description of the message callback function specified by
Packit b099d7
\fImessage_cb\fP:
Packit b099d7
.PP
Packit b099d7
.nf
Packit b099d7
Uil_continue_type (\fI*message_cb\fP) (\fImessage_data, message_number, severity, msg_buffer,
Packit b099d7
src_buffer, ptr_buffer, loc_buffer, message_count\fP)
Packit b099d7
        char \fI*message_data\fP;
Packit b099d7
        int \fImessage_number\fP;
Packit b099d7
        int \fIseverity\fP;
Packit b099d7
        char \fI*msg_buffer\fP, \fI*src_buffer\fP;
Packit b099d7
        char \fI*ptr_buffer\fP, \fI*loc_buffer\fP;
Packit b099d7
        int \fImessage_count\fP[];
Packit b099d7
.fi
Packit b099d7
.PP
Packit b099d7
This function specifies a callback function that UIL
Packit b099d7
invokes instead of printing an
Packit b099d7
error message when the compiler encounters an error in the UIL source\&.
Packit b099d7
The callback should return one of the following values:
Packit b099d7
.IP "\fBUil_k_terminate\fP" 10
Packit b099d7
Terminate processing of the source file
Packit b099d7
.IP "\fBUil_k_continue\fP" 10
Packit b099d7
Continue processing the source file
Packit b099d7
.PP
Packit b099d7
The arguments are
Packit b099d7
.IP "\fImessage_data\fP" 10
Packit b099d7
Data supplied by the application as the \fImessage_data\fP argument to
Packit b099d7
the \fBUil\fP function\&.
Packit b099d7
UIL does not interpret this data in any way; it just passes it to the
Packit b099d7
callback\&.
Packit b099d7
.IP "\fImessage_number\fP" 10
Packit b099d7
An index into a table of error messages and severities for internal use
Packit b099d7
by UIL\&.
Packit b099d7
.IP "\fIseverity\fP" 10
Packit b099d7
An integer that indicates the severity of the error\&.
Packit b099d7
The possible values are the status constants returned by the \fBUil\fP
Packit b099d7
function\&.
Packit b099d7
See \fBReturn Value\fP for more information\&.
Packit b099d7
.IP "\fImsg_buffer\fP" 10
Packit b099d7
A string that describes the error\&.
Packit b099d7
.IP "\fIsrc_buffer\fP" 10
Packit b099d7
A string consisting of the source line where the error occurred\&.
Packit b099d7
This string is not always available\&. In this case, the argument is NULL\&.
Packit b099d7
.IP "\fIptr_buffer\fP" 10
Packit b099d7
A string consisting of whitespace and a printing character in the
Packit b099d7
character position corresponding to the column of the source line where
Packit b099d7
the error occurred\&.
Packit b099d7
This string may be printed beneath the source line to provide a visual
Packit b099d7
indication of the column where the error occurred\&.
Packit b099d7
This string is not always available\&. In this case, the argument is NULL\&.
Packit b099d7
.IP "\fIloc_buffer\fP" 10
Packit b099d7
A string identifying the line number and file of the source line where
Packit b099d7
the error occurred\&.
Packit b099d7
This is not always available; the argument is then NULL\&.
Packit b099d7
.IP "\fImessage_count\fP" 10
Packit b099d7
An array of integers containing the number of diagnostic messages issued
Packit b099d7
thus far for each severity level\&.
Packit b099d7
To find the number of messages issued for the current severity level,
Packit b099d7
use the \fIseverity\fP argument as the index into this array\&.
Packit b099d7
.PP
Packit b099d7
Following is a description of the status callback function specified by
Packit b099d7
\fIstatus_cb\fP:
Packit b099d7
.PP
Packit b099d7
.nf
Packit b099d7
Uil_continue_type (\fI*status_cb\fP) (\fIstatus_data, percent_complete,
Packit b099d7
        lines_processed, current_file, message_count\fP)
Packit b099d7
        char \fI*status_data\fP;
Packit b099d7
        int \fIpercent_complete\fP;
Packit b099d7
        int \fIlines_processed\fP;
Packit b099d7
        char \fI*current_file\fP;
Packit b099d7
        int \fImessage_count\fP[];
Packit b099d7
.fi
Packit b099d7
.PP
Packit b099d7
This function specifies a callback function that is
Packit b099d7
invoked to allow X applications to
Packit b099d7
service X events such as updating the screen\&.
Packit b099d7
The callback should return one of the following values:
Packit b099d7
.IP "\fBUil_k_terminate\fP" 10
Packit b099d7
Terminate processing of the source file
Packit b099d7
.IP "\fBUil_k_continue\fP" 10
Packit b099d7
Continue processing the source file
Packit b099d7
.PP
Packit b099d7
The arguments are
Packit b099d7
.IP "\fIstatus_data\fP" 10
Packit b099d7
Data supplied by the application as the \fIstatus_data\fP argument to
Packit b099d7
the \fBUil\fP function\&.
Packit b099d7
UIL does not interpret this data in any way; it just passes it to the
Packit b099d7
callback\&.
Packit b099d7
.IP "\fIpercent_complete\fP" 10
Packit b099d7
An integer indicating what percentage of the current source file has
Packit b099d7
been processed so far\&.
Packit b099d7
.IP "\fIlines_processed\fP" 10
Packit b099d7
An integer indicating how many lines of the current source file have
Packit b099d7
been read so far\&.
Packit b099d7
.IP "\fIcurrent_file\fP" 10
Packit b099d7
A string containing the pathname of the current source file\&.
Packit b099d7
.IP "\fImessage_count\fP" 10
Packit b099d7
An array of integers containing the number of diagnostic messages issued
Packit b099d7
thus far for each severity level\&.
Packit b099d7
To find the number of messages issued for a given severity level, use
Packit b099d7
the severity level as the index into this array\&.
Packit b099d7
The possible severity levels
Packit b099d7
are the status constants returned by the
Packit b099d7
\fBUil\fP function\&.
Packit b099d7
See \fBReturn Value\fP for more information\&.
Packit b099d7
.SH "RETURN"
Packit b099d7
.PP
Packit b099d7
This function returns one of the following
Packit b099d7
status return constants:
Packit b099d7
.IP "\fBUil_k_success_status\fP" 10
Packit b099d7
The operation succeeded\&.
Packit b099d7
.IP "\fBUil_k_info_status\fP" 10
Packit b099d7
The operation succeeded\&. An informational
Packit b099d7
message is returned\&.
Packit b099d7
.IP "\fBUil_k_warning_status\fP" 10
Packit b099d7
The operation succeeded\&. A warning
Packit b099d7
message is returned\&.
Packit b099d7
.IP "\fBUil_k_error_status\fP" 10
Packit b099d7
The operation failed due to an error\&.
Packit b099d7
.IP "\fBUil_k_severe_status\fP" 10
Packit b099d7
The operation failed due to an error\&.
Packit b099d7
.SH "RELATED"
Packit b099d7
.PP
Packit b099d7
\fBUilDumpSymbolTable\fP(3) and
Packit b099d7
\fBuil\fP(1)\&.
Packit b099d7
...\" created by instant / docbook-to-man, Sun 22 Dec 1996, 20:16