Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF

4 SunCGI Reference Manual 0 #include Ccoor box[5] = { 10000,10000, 10000,20000, 20000,20000 20000,10000, 10000, 10000 l; main() { Ccoorlist boxlist; Cint name; Cvwaurf device; boxlist.n = 5·; boxlist.ptlist = box; NORMAL_VWSURF(device, PIXWINDD); open_cgi (); open_vws(&narne, &device); polyline(&boxlist); sleep (10); close_vws(narne); close_cgi(); 0 Figure 1-1 Simple Example Program SunCGI uses a variety of structures and enumerated types shown in Appendix C. The file s. h> should be included in each SunCGI application pro- gram to provide necessary definitions and constants. Here is an example of a command line for compiling box. c to run in the Sun- View environment:

% cc box.c -o box -lcgi -lsunwindow -lpixrect -lrn The order in which the libraries are linked to the program is important. AIJ SunCGI functions can be called by one of two names: the expanded name ( default) or the C language binding name. See Appendix H for information on the list of names for the shorter C language binding. As a final note, do not name any user-defined function or variable starting with the letters cgi because doing so may disrupt the internal workings ofSunCGI. FORTRAN programmers can access SunCGI functions by using the include file in 0 cgidef s77. hand using the /usr/ lib/ libcgi 77. a library to link with.

Details of the FORTRAN interface to SunCGI are provided in Appendix G. Version C of 17 March 1986