II.7 Coding API Calls When Using Geosupport C/C++ Header Files

This section describes the source code statements that users must code in application programs that use the Geosupport header file. The required statements consist of a declarative statement to reference the header file and statements calling the DLL.

In Chapter II.5, the forms of calls to the DLL were given using arbitrary data names for the work areas. In programs that do not use the Geosupport header file, those names are user-selectable. In the present section, the forms of the DLL calls are given again, this time with the specific data names that are required for compatibility with the header file. The C/C++ languages permit header file users to select their own names for the work areas (but not for the fields within the work areas). Prior to each call to the DLL, the program must prime Work Area 1 with the input data to be processed by Geosupport, as described in Chapter II.3.

II.7.1 C/C++ Source Code Statement

To reference the Geosupport C/C++ header file which contains the work area layouts, the C/C++ program must contain the following statement:

    #include "pac.h"  

The work area layouts must be declared using the typedefs in the Geosupport header file. For example:

C_WA1 anyname_wa1; WA1, all functions
C_WA2_F1 anyname_wa2_f1; WA2, Functions 1 & 1E
C_WA2_F1A anyname_wa2_f1a; WA2, Functions 1A & BL (regular & long WA2), BN
C_WA2_F2 anyname_wa2_f2; WA2, Function 2
C_WA2_F2 anyname_wa2_f3; WA2, Function 3
C_WA2_F3C anyname_wa2_f3c; WA2, Function 3C
C_WA2_F3S anyname_wa2_f3s; WA2, Function 3S

For C/C++ programs that use the Geosupport header file, API calls may be coded as follows:

NYCgeo (&anyname_wa1); One-work-area calls, all functions.
NYCgeo (&anyname_wa1,&anyname_wa2_f1); Two-work-area calls, Functions 1 & 1E
NYCgeo (&anyname_wa1,&anyname_wa2_f1a); Two-work-area calls, Functions 1A & BL (regular & long WA2), BN
NYCgeo (&anyname_wa1,&anyname_wa2_f2); Two-work-area calls, Function 2
NYCgeo (&anyname_wa1,&anyname_wa2_f3); Two-work-area calls, Function 3
NYCgeo (&anyname_wa1,&anyname_wa2_f3c); Two-work-area calls, Function 3C
NYCgeo (&anyname_wa1,&anyname_wa2_f3s); Two-work-area calls, Function 3S

An alternative method of calling NYCgeo from C/C++ appears in the sample program. Please see Chapter II.9.