Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cps(1) — SunOS 4.1.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cpp(1V)

CPS(1)  —  USER COMMANDS

NAME

cps − construct C to POSTSCRIPT language interface

SYNOPSIS

cps [ −c| −C ] [ −D symbol ] [ −I filename ] [-s [number] ] [ −i ] [ file.cps ]

DESCRIPTION

cps compiles a specification file containing C procedure names and POSTSCRIPT language code into a header file (file.h) that can be included in C programs. The header file associates the C procedure names with macros that transmit a compressed form of the POSTSCRIPT language code to the X11/NeWS server stream.  Only one input file can be specified.  If the file.h file already exists, a backup copy of it will be generated of the form file.h.BAK before the new file is generated. 

The convention is for the input specification file to end with the suffix .cps. 

OPTIONS

−c Compiles the file of POSTSCRIPT language code for faster loading by NeWS, but does not generate a specification file for C programs.  For example, the command line

example% cps -c < input_file > output_file

converts the input file from the ASCII form of the POSTSCRIPT language to a compressed binary form.  When read by NeWS, the output file will execute exactly the same as input_file, except that it will be parsed faster.

NOTE: The −c option will not work if the input file uses constructs such as currentfile readstring, which are often used with the image primitive. 

Compiles the file of POSTSCRIPT language code in the same way that the -c
option does:  however, when -C is used, the file can contain usertoken specifications.  The tokens are automatically set up at the start of the output file; they are used throughout the output file to compress the POSTSCRIPT language even further than occurs with the -c option. 

−D symbol
Defines symbols to be passed to the C language preprocessor (cpp(1)), which processes the input file. 

−I filename
Specifies include files or include paths. Passed on to the C preprocessor.

−i Generates two specification files: the first file contains only the compressed form of the POSTSCRIPT language code; the second file contains the macro definitions required for the C-POSTSCRIPT interface.  For example, ps_open_PostScript() and ps_close_PostScript() would be defined in the second file. The second file references compressed POSTSCRIPT language code as extern char arrays.  The first file is of the form file.c; the second file is of the form file.h. If the files already exist, .BAK backup copies will be generated. 

This option is useful for minimizing the size impact of interfaces that contain procedures called from several places in the C code.  The file.c generated would only need to be compiled once.  Each file that needs to use the interface could then include only the file.h and use the macros in that file multiple times.  Each repeated invocation of the macro would refer to the shared POSTSCRIPT language code in the file.c rather than its own static copy of the POSTSCRIPT language code. 

-s [number]
Specifies the threshold at which compiled POSTSCRIPT language code will be output as decimal arrays instead of string constants.  If number is missing, all POSTSCRIPT language code will be ouput as string constants in the resulting file.h. This may be useful for debugging purposes, even though the POSTSCRIPT language code is in compressed form.  If number is 0, all POSTSCRIPT language code will be output as decimal arrays.  The default threshold is 400 characters, which is less than the maximum limit of string constants for most compilers.  Note that there must be no space before number, since it is optional. 

SEE ALSO

cpp(1V)

TRADEMARK

POSTSCRIPT is a registered trademark of Adobe Systems, Inc. 

{:heading=>"CPS\|(\|1\|)\0\0\(em\0\0\∗(]D"}  —  Last change: 28 June 1989  —  Last change: 28 June 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026