PURPOSE
tidl - Interface Definition Language compiler
SYNOPSIS
tidl [option] ... filename [option] ...
DESCRIPTION
tidl parses the input IDL and related ACF source
file, and optionally generates a header file, and client and
server stubs and auxiliary files. The generated source code can
be compiled using compilers for Classic C, ANSI C, or C++.
The command line arguments include the input IDL source file
and options to control the actions of the IDL compiler. The
options are as follows:
- -client type
- This option specifies the client-side files to be
generated. The values for type are as follows:
- all
- Generates client stub and auxiliary files. This
is the default if the -client option
is not specified.
- stub
- Generates client stub file only
- aux
- Generates client auxiliary file only. Currently,
auxiliary files are not generated so this option
has no effect.
- none
- Generates no client files.
- -server type
- This option specifies the server-side files to be
generated. The values for type are as follows:
- all
- Generates server stub and auxiliary files. This
is the default if the -server option
is not specified.
- stub
- Generates server stub file only
- aux
- Generates server auxiliary file only. Currently,
auxiliary files are not generated so this option
has no effect.
- none
- Generates no server files.
- -cstub filename
- Specifies the filename for the client stub file. If the
filename does not have a .c extension, the IDL
compiler will add it. The default client stub name (if -cstub
is not specified) is the base name of the IDL source file
(the simple file name without any directory prefix, or
any suffix following a period) with _cstub.c
appended. The associated client stub object file is the
name of the client stub file with .c changed
to .o.
- -sstub filename
- Specifies the filename for the server stub file. If the
filename does not have a .c extension, the IDL
compiler will add it. The default server stub name (if -sstub
is not specified) is the base name of the IDL source file
(the simple file name without any directory prefix, or
any suffix following a period) with _sstub.c
appended. The associated server stub object file is the
name of the server stub file with .c changed
to .o.
- -caux filename
- Specifies the filename for the client auxiliary file. If
the filename does not have a .c extension, the
IDL compiler will add it. The default client auxiliary
name (if -caux is not specified) is the base
name of the IDL source file (the simple file name without
any directory prefix, or any suffix following a period)
with _caux.c appended. The associated client
auxiliary object file is the name of the client auxiliary
file with .c changed to .o.
- -saux filename
- Specifies the filename for the server auxiliary file. If
the filename does not have a .c extension, the
IDL compiler will add it. The default server auxiliary
name (if -saux is not specified) is the base
name of the IDL source file (the simple file name without
any directory prefix, or any suffix following a period)
with _saux.c appended. The associated server
auxiliary object file is the name of the server auxiliary
file with .c changed to .o.
- -header filename
- Specifies the filename for the generated header file. The
default header file name (if -header is not
specified) is the base name of the IDL source file (the
simple file name without any directory prefix, or any
suffix following a period) with .h appended.
- -out directory
- Specifies the directory in which output files are
created. The default (if -out is not
specified) is to put the files in the present working
directory.
- -keep type
- Specifies which file types to retain. By default, the IDL
compiler creates a C source file (for example, a client
stub), uses the C compiler to produce an object file, and
deletes the C source file. The file types that can be
retained are as follows:
- none
- Does not create any files or invoke the C
compiler.
- c_source
- Saves only the C source files and does not invoke
the C compiler.
- object
- Saves only the object files, deleting the C
source files (this is the default).
- all
- Saves both the C source and object files.
- -I directory
- Specifies a directory in which to search for imported IDL
files and include files. White space following the -I
is optional. The -I option can be specified
multiple times to list multiple directories. The default
behavior is to search the present working directory, then
the directories specified with the -I option
in the order specified, and then the system IDL directory
($TUXDIR/include). This order is also used to
pass include directories to the C preprocessor and C
compiler. If a file exists in more than one directory,
the first one that is found in the search order is used.
- -no_def_idir
- When used with no -I options, specifies that
only the present working directory be searched for import
and include files. When used with one or more -I
options, specifies that only the -I
directories be searched (not the present working
directory or the system IDL directory).
- -cpp_cmd "cmd"
- Specifies the C preprocessor command to invoke for
expanding source files. By default, the C preprocessor is
not invoked on DOS and OS2, and defaults to /lib/cpp,
/usr/ccs/lib/cpp, or /usr/lib/cpp
(in that order) otherwise.
- -no_cpp
- Specifies that the C preprocessor not be invoked to
expand source files. This implies that the source files
cannot have preprocessor directives (such as macro
replacements and #include).
- -cpp_opt "opt"
- Specifies additional options to be passed to the C
preprocessor. The default value is the null string. The
IDL compiler invokes a command line composed of the
values for -cpp_cmd, -cpp_opt, -D
and -U arguments (in the order specified), -I
arguments (in the order specified), and the source file
name (the IDL or ACF file name).
- -D name[=def]
- Defines a name and optionally a value that is passed to
the C preprocessor. More than one symbol can be defined
by specifying the -D option more than once.
White space following the -D is optional.
- -U name
- Undefines a name for C preprocessor. More than one symbol
can be undefined by specifying the -U option
more than once. White space following the -U
is optional.
- -cc_cmd "cmd"
- Specifies the C compiler command for creating object
files. The default (if -cc_cmd is not
specified) is "cc -c".
- -cc_opt "opt"
- Specifies additional C compiler options. The default (if -cc_opt
is not specified) is the null string. The IDL compiler
invokes a command line composed of the values for -cc_cmd,
-cc_opt, -I arguments (in the order
specified), and the source file name (the stub or
auxiliary file name).
- -syntax_check
- Specifies that the input source file be checked for
syntax errors without generating any output files.
- -no_warn
- Specifies that warning messages from the compiler are not
to be printed.
- -confirm
- Displays IDL compiler options chosen (either explicitly
or implicitly) without compilation of the source file.
When used with the -v option, it indicates
what actions would be taken without the -confirm
option without executing them (for example, messages are
printed for parsing input files, creating and compiling
output files).
- -v
- Specifies verbose mode. Messages are printed to the
standard error output indicating actions being taken (for
example, parsing input files, creating and compiling
output files).
- -version
- Displays the version of the IDL compiler.
- -stdin
- Take the IDL source input from standard input instead of
a file. Default file names are generated as if the input
IDL source file is named "a.idl"
(for example, the default client stub file will be named
"a_cstub.c").
- -cepv
- Generate a Client Entry Point Vector (CEPV). By default,
functions in the client stub module are named the same as
the operation names in the interface definition. However,
this will not allow for multiple versions of the
interface, interfaces with the same operation names, or
both local and remote versions of the same functions to
be linked into the same client program (the operation
names will be multiply defined). When the -cepv
option is specified, the function names will be declared
local to the client stub and a Client Entry Point Vector
(array of function pointers) will be defined (globally)
in the client stub with the name interface_vmajor_minor_c_epv,
where interface is the interface name, major
is the major version number, and minor is the
minor version number. The interface operations must be
called indirectly using the addresses in the CEPV.
- -no_mepv
- Does not generate a Manager (server) Entry Point Vector
(MEPV). By default, it is assumed that the application
functions in the server are named the same as the
operation names in the interface definition. However,
this will not allow for multiple versions of the
interface, interfaces with the same operation names, or
both local and remote versions of the same functions to
be linked into the same server program (the operation
names will be multiply defined). Normally, a Manager
Entry Point Vector (array of function pointers) is
defined (globally) in the server stub with the name name interface_vmajor_minor_s_epv,
where interface is the interface name, major
is the major version number, and minor is the
minor version number, and initialized with the operation
names. It is used to call the application service
functions. When the -no_mepv option is
specified, the MEPV is not generated in the server stub
and the application is responsible for setting up the
structure. In this way, the application can set the entry
point names to whatever is used by the application
instead of names based on the operations.
- -error all
- Specifies additional error checking. By default, the IDL
compiler quits after 50 errors are detected.
- -port level
- Specifies the level of portability checking. The
following levels are supported:
- case
- Specifies that warnings messages are to be
printed if two identifiers differ only in case.
- none
- Specifies no additional portability checking is
to be done. This is the default.
- -no_enum_lit
- Specifies that enumeration literals are not to be
generated in the stub files. By default, enumeration
literals are generated.
- -use_const
- Specifies that ANSI C const declarations are to be used
for constant values instead of #define definitions.
For the IDL source file and any imported IDL files, the
compiler searches for a related ACF with a .acf suffix
added to the basename of the IDL source file. The directories
that are searched are the same directories specified for the C
preprocessor (see -I and -no_def_idir
above), plus ACF files are searched for in the directory
specified in the IDL source file name.
NOTICES
The IDL filename tbase.idl is reserved for use by
the IDL compiler.
EXAMPLES
Here is an example IDL source file:
math1.idl. [uuid(2048A080-0B0F-14F8-26E0-930269220000)]
interface math1
{
import "math2.idl";
long add_op([in] long first1, [in] long second);
long sub_op([in] long first1, [in] long second);
}
Here is a sample ACF source file:
math1.acf. [auto_handle]
interface math1
{
include "stdio";
[code] add_op([fault_status,comm_status] result);
}
The following command line will compile math1.idl generating client side
only files out/math1_cs.c and out/math1_cs.o (no auxiliary files are needed),
along with out/math1.h.
The IDL compiler will look for math2.idl
(which might have the division and multiplication operations)
in the current directory,
in the app subdirectory, and in $TUXDIR/include.
tidl math1.idl -Iapp -client all -server none -keep all
-cstub math1_cs -out app
SEE ALSO
uuidgen(1)