c_ptopen - Opens a tie point file and reads the header record

SYNTAX

#include "geompak.h"

FUNCTION c_ptopen (ptdesc, hname, pttype, acc, pthdr)

     int                          *ptdesc;
     char                         *hname;
     long                         *pttype;
     long                         *acc;
     long                         *pthdr;

PARAMETERS

ptdesc (output, integer)

File descriptor to be used internally by the tie point I/O routines.

hname (input, character, length(CMLEN))

Host name of the tie point file to be opened.

pttype (input, long)

The type of tie point file used. Allowable types are:

     PTTYPE	description	 	    structure    
    TPS (1) -->	Tie Point Selection file     TPSHEAD	
    MTP (2) --> Merged Tie Point file	     MTPHEAD	
    TPL (3) --> Tie Point Location file	     TPLHEAD	

acc (input, long)

Specifies whether the file is to be opened for read or write access.

          = IREAD :   (0) --> for read access
          = IWRITE:   (1) --> for write access

pthdr (input/output, long)

A pointer to a structure which contains/will contain the header record information for the type of tie point file as described by pttype.

DESCRIPTION

When acc = IWRITE, this routine will create a tie point file and open it for write access. The type of tie point file created is contained in the pttype parameter. The header record is written to the first record of the file. A file descriptor (ptdesc) is returned for subsequent I/O to this file via c_ptio().

When acc = IREAD, this routine opens an existing tie point file for read access. The type of tie point file created is contained in the pttype parameter. A file descriptor (ptdesc), as well as the file's header record is returned.

RETURN VALUE

c_ptopen() returns

     E_SUCC (0)  --> successful completion
     E_FAIL (-1) --> operation failed

SPECIAL CONSIDERATIONS:

The c_ptopen() call is for C only.