sdsc - Compiles C structure definitions into SDS Calls.

Function

Compiles C structure definitions into SDS Calls.

Synopsis

    sdsc [ -nvlswT] [ -Dname ] [ -Dname=def ] [ -Uname ]
         \[ -ffunction ]  [ -ttype ] [ -Nname ]
         \[ -Idirectory ] [ -Pcpp ] [ input-file ] [ output-file]

Description

A C structure can be put and retrived from a similar SDS structure using SdsPut and SdsGet. This makes it desirable to be able to automatically generate SDS calls to produce an SDS structure equivalent to the C structure. sdsc does this job.

The input to sdsc is frist run through a C preprocessor. During this the macros 'SDS' and '___SDS___' will be defined (in addition) to any macros defined by default). The result should be a series of C definitions followed by one and only one structure declaration.

sdsc optionally accepts two filenames as arguments. input-file and output-file are, respectively, the input and output files. They default to the standard input and standard output (except under VMS, when you must specifiy the input file (due to problems with the C run time library under the current version of VMS)).

Options

-n
Do not run the input through the C preprocessor.
-v
Output the command used to run the C preprocessor to stderr.
-l
Treat ambiguous int declarations as 32bit ints.
-s
Treat ambiguous int declarations as short ints.
-w
Instead of outputing declarations, use the SdsWrite utility function to write the Sds structure to a file . In this case, an output file must be supplied.
-W
Output warning messages as well as error messages.
-T
Output Tcl code instead of C code. This requires the Sds commands in DRAMA's Dtcl package (DRAMA V1.2 and later only)
-Dname
Define name as 1 (one). This is the same as if a -Dname=1 option appeared on the command line, or as if a
                #define name 1
appeared in the source file.

-ffunction
Specify a function name. When specified, instead of outputing just the body of the function, then entire function is output, this is the name for the function.
-ttype
Specify a type, a declaration of which is to be assumed at the end of reading the input file if the input fie does not declare a variable. It should be a simple type or a typedef name.
-Nname
If -t is used, then this name is given to the variable created and hence to the top level structure. If not supplied, then the variable type is used as the variable name.
-Dname=def
Define name as if by a #define directive.
-Uname
Remove any initial definition of name where name is a symbol predefined by the C preprocessor.
-Idirectory
Insert directory into the search path for #include files.
-Pcpp
Use cpp as the C preprocessor. By default /usr/lib/cpp is used (utask_Dir:gnu_cpp on a vms machine)

Note that the -D, -U and -I options are passed directly to the C preprocessor. If -n is set, none of the other options have any effect (and C preprocessor statements may call errors) .

See Also

cpp(1), Sds manual.

Support

Tony Farrell, AAO

Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tjf@aaoepp.aao.gov.au