pmddamt.h - Access Module

Teradata® Tools and Utilities Access Module Programmer Guide

Product
Access Module
Release Number
16.20
Published
October 2018
Language
English (United States)
Last Update
2018-10-10
dita:mapPath
asf1527114222349.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2424
lifecycle
previous
Product Category
Teradata Tools and Utilities

This header file shows structure and symbol definitions required to interface with the Teradata PT DataConnector operator or an Access Module.

/* % TITLE pmddamt.h ... Device Dependent Access module structs/types       */
/****************************************************************************/
/*                                                                          */
/*  Copyright 1997-2014 Teradata Corporation. ALL RIGHTS RESERVED.          */
/*  Teradata Corporation CONFIDENTIAL AND TRADE SECRET                      */
/*  This copyrighted material is the Confidential, Unpublished              */
/*  Property of the Teradata Corporation.  This copyright notice            */
/*  and any other copyright notices included in machine readable            */
/*  copies must be reproduced on all authorized copies.                     */
/*                                                                          */
/* CRITICAL USAGE NOTE:                                                     */
/*  This header file is to be the EXACT same file for both SA & TPT.        */
/*  The cooresponding versions in /vob/tdcli & /vob/paralx must match       */
/*  The identiy will insure that the same access module will work with      */
/*  the standalone utilities AND the TPT DC oeprator                        */
/*                                                                          */
/****************************************************************************/

#ifndef PMDDAMT_H
#define PMDDAMT_H


#if defined(HPUX) && defined(PIOM64) && !defined(HPUX_IA64) 
#ifdef __cplusplus                    
#define pmddamt_packing "pack 8"                                   
#pragma pack 8 
#else
/*#define pmddamt_packing "HP_ALIGN NATURAL PUSH"*/     
/*#pragma HP_ALIGN NATURAL PUSH*/                                  
#endif                                
#elif defined(HPUX_IA64) && defined(PIOM64)   
#define pmddamt_packing "pack(8)"
#pragma pack(8)                               
#elif defined(SOLARIS) && defined(PIOM64)
#define pmddamt_packing "pack(8)"                                  
#pragma pack(8)
#elif defined (AIX)                                                
#define pmdcomt_packing "options align=packed"                     
#pragma options align=packed                                       
#elif defined(__MVS__)                                            
#pragma pack(packed)                                              
#define pmddamt_packing "pack(packed)"                            
#elif !defined(HPUX) && !defined(SOLARIS)                         \
      && !defined(_WIN64) && !defined(__APPLE__) 
#define pmddamt_packing "pack (push, 1)"                           
#pragma pack (push, 1)
#elif defined(_WIN64)                                              
#define pmdcomt_packing "pack (push, 1)"                           
#pragma pack (push, 1)                                             
#endif                                                             

#if !defined (pmddamt_packing)                                     
#define pmddamt_packing "none"                                     
#endif                                                             


#define pmddamt_HeaderVersion "Common 15.10.00.00"         
#define pmddamt_ID "pmddamt header version '" pmddamt_HeaderVersion \
 "', packing '" pmddamt_packing "'"

#ifdef PIOM64
#define pmiInterfaceVersion   2001
#else
#define pmiInterfaceVersion   2000
#endif


#define pmiMAX_EC_LEN        30
/*                               EyeCatcher strings for each structure type */
#define pmiEC_CmdBlock_t    "AXSMOD block:CmdBlock_t"
#define pmiEC_Init_t        "AXSMOD block:Init_t"
#define pmiEC_Open_t        "AXSMOD block:Open_t"
#define pmiEC_Close_t       "AXSMOD block:Close_t"
#define pmiEC_RW_t          "AXSMOD block:RW_t"
#define pmiEC_Pos_t         "AXSMOD block:Pos_t"
#define pmiEC_Shut_t        "AXSMOD block:Shut_t" 
#define pmiEC_ID_t          "AXSMOD block:ID_t"
#define pmiEC_Attr_t        "AXSMOD block:Attr_t"

#define pmiMAX_INIT_STR_LEN 512
#define pmiMAX_FNAME_LEN    32767                                  
#define pmiMAX_ETEXT_LEN    32000                                

/*                              the following defines are required only for */
/*                             communications between the DIAM and the DDAM */
#define pmiPIDMOptInit     1 
#define pmiPIDMOptOpen     2
#define pmiPIDMOptClose    3
#define pmiPIDMOptCloseR   10
#define pmiPIDMOptRead     4
#define pmiPIDMOptWrite    5
#define pmiPIDMOptGetPos   6
#define pmiPIDMOptSetPos   7
#define pmiPIDMOptShut     8
#define pmiPIDMOptID       9
#define pmiPIDMOptGetA_A   11
#define pmiPIDMOptGetF_A   12
#define pmiPIDMOptPutA_A   13
#define pmiPIDMOptPutF_A   14

typedef struct _pmiInit
{
 char      EyeCatcher[pmiMAX_EC_LEN];   /* Struct eyecatcher string */
 pmUInt32  StructLength;                /* Length of this structure */
 void     *PIData;	          /* Access module Internal Data Pointer */
 pmUInt16  InterfaceVerNo;          /* pmdcomt.h version identifier */
 pmUInt16  InterfaceVerNoD;         /* pmddamt.h version identifier */
 pmUInt32  ClientIDL;                   /* Length of ClientID field */
 pmUInt32  InitStrL;                     /* Length of InitStr field */
 char      ClientID[pmMAX_CLIENT_ID+1];        /* Client identifier */
 char      InitStr[pmiMAX_INIT_STR_LEN+1];  /* Initialization field */
} pmiInit_t;

typedef struct _pmiOpen
{
 char         EyeCatcher[pmiMAX_EC_LEN];        /* Struct eyecatcher string */
 pmUInt32     StructLength;                     /* Length of this structure */
 void        *PIData;                /* Access module Internal Data Pointer */
 pmOpenMode_t OpenMode;                                 /* provided to PIDM */
 pmUInt16     BlkHeaderLen;                              /* defined by PIDM */
 pmUInt32     BlkSize;                                   /* defined by PIDM */
 void        *FIData;         /* File Internal Data (returned/used by PIDM) */
 pmUInt16     FileNameL;                                /* provided to PIDM */
 char         FileName[pmiMAX_FNAME_LEN+1];             /* provided to PIDM */
} pmiOpen_t;

typedef struct _pmiClose
{
  char      EyeCatcher[pmiMAX_EC_LEN];   /* Struct eyecatcher string */
  pmUInt32  StructLength;                /* Length of this structure */
  void     *FIData;
} pmiClose_t;

typedef struct _pmiRW
{
  char      EyeCatcher[pmiMAX_EC_LEN];   /* Struct eyecatcher string */
  pmUInt32  StructLength;                /* Length of this structure */
  void     *FIData;
  pmUInt32  BufferLen;
  char     *Buffer;
} pmiRW_t;

typedef struct _pmiPos
{
  char      EyeCatcher[pmiMAX_EC_LEN];   /* Struct eyecatcher string */
  pmUInt32  StructLength;                /* Length of this structure */
  void     *FIData;
  pmPos_t   Position;
} pmiPos_t;

typedef struct _pmiShut
{
  char      EyeCatcher[pmiMAX_EC_LEN];   /* Struct eyecatcher string */
  pmUInt32  StructLength;                /* Length of this structure */
  void     *PIData;
  pmUInt16  Mode;
} pmiShut_t;

typedef struct _pmiID
{
  char       EyeCatcher[pmiMAX_EC_LEN];   /* Struct eyecatcher string */
  pmUInt32   StructLength;                /* Length of this structure */
  pmVerLst_t VerIDList;
} pmiID_t;

typedef struct _pmiAttribute
{
  char      EyeCatcher[pmiMAX_EC_LEN];   /* Struct eyecatcher string */
  pmUInt32  StructLength;                /* Length of this structure */
  void     *ObjData;            /* Object pointer (PIData or FIData) */
  pmUInt32  AttrNameLen;                 /* Length of attribute name */
  char      AttrName[pmMAX_ATR_NAME_LEN];         /* Attrribute name */
  pmUInt32  AttrValueLen;               /* Length of attribute value */
  char      AttrValue[pmMAX_ATR_VAL_LEN];         /* Attribute value */
} pmiAttr_t;

typedef struct _pmiCmdBlock
{
  char           EyeCatcher[pmiMAX_EC_LEN]; /* Struct eyecatcher string */
  pmUInt32       StructLength;              /* Length of this structure */
  pmUInt32       Reqtype;
  pmReturnType   Retcode;                                /* set by DDAM */
  pmTrceLvl_t    TraceLvl;
  pmNameBuf_t    ErrMsg;       /* Set by DDAM if retcode is pmrcFailure */
} pmiCmdBlock_t;

#ifdef WIN32
#ifdef CPP
extern "C"
      {
       __declspec(dllexport) void PIDMMain ( pmiCmdBlock_t *, void * );
      }
#else
__declspec(dllexport) void PIDMMain ( pmiCmdBlock_t *, void * );
#endif
#else
void PIDMMain ( pmiCmdBlock_t *, void * );
#endif

/* DR 58755, 58762 --> */

#if defined(HPUX) && defined(PIOM64) && !defined(HPUX_IA64) 
#ifdef __cplusplus                     
#pragma pack 
#else
/*#pragma HP_ALIGN POP*/               
#endif                                 
#elif defined(HPUX_IA64) && defined(PIOM64)   
#pragma pack()                                
#elif defined(SOLARIS) && defined(PIOM64)
#pragma pack()
#elif defined (AIX)                                                
#pragma options align=reset                                        
#elif defined(__MVS__)                                            
#pragma pack(reset)                                               
#elif !defined(HPUX) && !defined(SOLARIS)                         \
      && !defined(_WIN64) && !defined(__APPLE__) 
#pragma pack (pop)
#elif defined(_WIN64)                                             
#pragma pack (pop)                                                
#endif                                                            

#endif /* PMDDAMT_H */