/****************************************************************************/
/*                                                                          */
/*         Copyright 1995-2002 SCM Microsystems                             */
/*                                                                          */
/*         This software is supplied under the terms of a license           */
/*         agreement or nondisclosure agreement and may not be copied       */
/*         or disclosed except in accordance with the terms of that         */
/*         agreement.                                                       */
/*                                                                          */
/****************************************************************************/
/*    Name: CTAPI.H                                                         */
/*                                                                          */
/*      Description: Header file for CT-API DLLs			                */
/*                                                                          */
/*--------------------------------------------------------------------------*/
/* History   :                                                              */
/*   Revision      Date            Author         Description               */
/*   -----------------------------------------------------------------------*/
/*   Version: 1.00: 22-Aug-1995  T.Maykranz   Initial version for SwapSmart */
/*   Version: 1.11: 25-JAN-1996  T.Maykranz   CT-API version                */
/*   Version: 1.12: 20-JUN-1996  T.Maykranz   *Lr handling corrected        */
/*   Version: 1.13: 25-JUN-1996  T.Maykranz   memory model independant      */
/*   Version: 1.14: 23-SEP-1996  T.Maykranz   CT-API from 20.09.96          */
/*   Version: 1.15  08-JAN-1997, T.Maykranz   3A0,3C0 added                 */
/*   Version: 1.16  16-JUN-2000, T.Maykranz   CTAPI-PC/SC wrapper version   */
/*   Version: 1.17  12-SEP-2002, T.Maykranz   cosmetics                     */
/****************************************************************************/

#ifndef CTAPIAPI
#define CTAPIAPI

#ifdef __cplusplus
extern "C" {
#endif

/****************************************************************************/
/* return codes for CT_init, CT_data, CT_close: */
/****************************************************************************/
#define OK               0              /* Operation successful */
#define ERR_INVALID     -1              /* parameter or data invalid */
#define ERR_CT          -8              /* CT error (CT not ready) */
#define ERR_TRANS       -10             /* transmission error */
#define ERR_MEMORY      -11             /* error on allocate buffer */
#define ERR_HOST        -127            /* abort by Host */
#define ERR_HTSI        -128            /* HTSI error */

/****************************************************************************/
/* CT-API export functions: */
/****************************************************************************/
extern char
  WINAPI CT_init (unsigned short Ctn,           /* logical terminal number */
           unsigned short Pn);           /* physical port number */
                                         /* 0: auto detect */
                                         /* 1: 1. reader */
                                         /* 2: 2. reader */
                                         /* 3: ...		 */

extern char WINAPI CT_close
          (unsigned short Ctn);          /* logical terminal number */

extern char WINAPI
   CT_data (unsigned short      Ctn,     /* logical terminal number */
            unsigned char  FAR *Dad,     /* destination address */
            unsigned char  FAR *Sad,     /* source address */
            unsigned short      Lc,      /* length of command in bytes */
            unsigned char  FAR *Cmd,     /* command&data buffer */
            unsigned short FAR *Lr,      /* length of response in bytes */
            unsigned char  FAR *Rsp);    /* answer */

/****************************************************************************/
#ifdef __cplusplus
}
#endif

#endif

