Pathmaker Programming Guide

The Structure of Pathmaker Custom Services and Servers
Creating Services and Servers
067868 Tandem Computers Incorporated 4–15
Custom C Services A Custom Source File is created by the Pathmaker product, if the file does not already
exist, when you add a C service using the Pathmaker Service Definition screen. A
Custom Source File initially contains empty definitions. You add data declarations
and functions to this file to perform the service’s business task. A Custom Source File
can contain code for several different services. A later subsection, “Custom Source File
Contents for a C Service,” provides additional information about the contents of such a
file.
The Pathmaker product supplies a common service utility library that contains
functions, constants, and definitions that can be referred to by code in a Custom
Source File. The common service library includes constants for common Enscribe and
NonStop SQL file system error codes and functions for formatting error messages,
manipulating certain character strings, and so on. (A table listing the contents of the
common service library, Table 4-3, appears later in this section.)
A generated source file is created by the Pathmaker product when a C custom service
is generated. A generated source file contains C source code that the Pathmaker
product creates for such items as the service’s request and reply message data
structure definitions, data structure definitions for each logical file accessed by the
service, and host variables for NonStop SQL tables. The generated source file for a
service includes an expanded copy of the service’s Custom Source File.
The Pathmaker product generates C services in two phases:
The first phase is completed before returning control to your terminal. In this
phase, the Pathmaker product reads all information in its project catalog about the
C service and verifies that it is valid for generation. The Pathmaker product then
returns control to the terminal and continues with phase two.
If the Pathmaker product encounters an error during phase one of C service
generation, an error message describing the problem will be displayed in the
advisory line of the Service Definition screen. The same message will appear in
the Last Attempted Generation Message field the next time you list the Service
Definition screen for this service.
In the second phase of C service generation, the Pathmaker product generates the
C programming language source code, compiles the service, and enters the results
of the generation (whether successful or unsuccessful) into the project catalog.
If the Pathmaker product encounters an error during phase two of C service
generation, a general error message is displayed in the Last Attempted Generation
Message field of the Service Definition Screen. You must inspect the compiler
listing to find the specific errors encountered during this phase.