From 8244462edb8a4586f508a5bc81688111ab304175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Ates?= Date: Fri, 9 Jan 2015 16:49:12 +0100 Subject: [PATCH] SV header files. --- cv2extractor/api_err.h | 100 ++++++++++++ cv2extractor/api_lec.h | 345 ++++++++++++++++++++++++++++++++++++++++ cv2extractor/linuxdef.h | 129 +++++++++++++++ 3 files changed, 574 insertions(+) create mode 100755 cv2extractor/api_err.h create mode 100755 cv2extractor/api_lec.h create mode 100755 cv2extractor/linuxdef.h diff --git a/cv2extractor/api_err.h b/cv2extractor/api_err.h new file mode 100755 index 0000000..d386235 --- /dev/null +++ b/cv2extractor/api_err.h @@ -0,0 +1,100 @@ +/* +%------------------------------------------------------------------------------------------------- +% PROJET : API LECTURE VITALE +% +% MODULE : LEC +% +% VERSION : 1.00 +% +% FICHIER : Api_Err.h +% +% Définitions des codes retournés par les fonctions des API de lecture V4 +% +%------------------------------------------------------------------------------------------------- +% Version 1.00 - JLD - 07/06/1999 - +%----------------------------------- +% +% Création +% +*/ + +#ifndef __LEC_H_ERR__ +#define __LEC_H_ERR__ + +/* Erreurs */ + +#define ERR_INCONNUE 10 /* erreur inconnue */ +#define ERR_CARTE_ABSENTE 11 +#define ERR_CARTE 12 /* erreur rendue par la carte */ +#define ERR_LECTEUR 13 /* erreur rendue par le lecteur */ +#define ERR_CARTE_INCONNUE 15 +#define ERR_CARTE_MUETTE 17 +#define ERR_LOGICIEL 18 +#define ERR_GALSS 20 +#define ERR_SESSION_OUVERTE 21 /* session deja ouverte */ +#define ERR_EXCLUSIVITE 23 /* exclusivite en cours */ +#define ERR_TIMEOUT 25 /* Temporisation écoulée */ +#define ERR_SESSION_INCONNUE 26 /* session inconnue */ +#define ERR_CPS_RETIREE 30 /* CPS retirée ou changée */ +#define ERR_VALIDITE_CPS 36 /* CPS ne permettant pas la lecture de carte Vitale */ +#define ERR_CARTE_INCORRECTE 37 /* Données en carte non exploitables */ +#define ERR_CARTE_INVALIDE 38 /* La carte est invalidée */ +#define ERR_CARTE_BLOQUEE 39 +#define ERR_CARTE_SATUREE 40 +#define ERR_PINCODE_INACTIF 41 /* Pin code CPS non actif, contrôle impossible */ +#define ERR_CARTE_TEST 42 /* Types de Carte CPS et Vitale non concordant */ +#define ERR_VERSION_APICPS 46 /* Version API GIP trop faible */ +#define ERR_APICPS 50 /* Erreur retournée par les API GIP-CPS */ +#define ERR_APICPS_NON_CHARGEE 51 /* Fonction CPS non disponible(API non chargée)*/ +#define ERR_PARAM_NULL 52 /* Le paramètre passé est null */ +#define ERR_PARAM_ADRESSE 53 /* Le paramètre passé a la même adresse qu'un autre paramètre */ +#define ERR_PARAM_VALEUR 54 /* Le paramètre passé a une valeur incorrecte */ +#define ERR_PARAM_TAILLE 55 /* Le paramètre passé n'a pas une taille suffisante */ + +/* Erreurs liées au fichier de configuration api_lec.ini */ +#define ERR_INIT_FICHIER 32 /* Fichier de configuration introuvable */ +#define ERR_INIT_MODE 33 /* Mode de fonctionnement incorrect dans le fichier de configuration */ +#define ERR_INIT_TIMER 34 /* Valeur timer incorrecte dans le fichier de configuration */ + +/* Erreurs liées au fichier table binaire tablebin.lec */ +#define ERR_INIT_TABLE 47 /* Table binaire introuvable */ +#define ERR_VERSION_TABLE 45 /* Problème de version de la table */ +#define ERR_STRUCTURE_TABLE 44 /* Problème de structure de la table binaire */ + +/* Erreurs liées au fichier csv pdt-cdc-011.csv */ +#define ERR_INIT_CSV 43 /* Fichier csv introuvable */ +#define ERR_STRUCTURE_CSV 48 /* Problème de structure du fichier csv */ + +/* Erreurs liées au fichier des habilitations tablebin.hab */ +#define ERR_INIT_HAB 56 /* Fichier non trouvé */ +#define ERR_VERSION_HAB 57 /* Version incorrecte */ +#define ERR_STRUCTURE_HAB 58 /* Pb structure fichier */ + +/* Erreurs liées au fichier sedica.ini */ +#define ERR_INIT_SEDICA 59 /* Fichier sedica.ini non trouvé */ + +/* Erreurs timer (Flip Flop) */ +#define ERR_TIMER_CTRL 60 /* Timer de contrôle écoulé (Mode Flip-Flop) */ +#define ERR_TIMER_INAC 61 /* Timer d'inactivité écoulé (Mode Flip-Flop) */ + +/* Warnings */ +#define WAR_APICPS_NON_DISPONIBLE 102 /* LEs API du gip ne sont pas disponible */ +#define WAR_VERSION_APICPS 103 /* La version des API GIP n'est pas correcte */ +#define WAR_DONNEES_ADM 104 /* Seules les données administratives sont retournées */ + + +/* Module d'origine de l'erreur (Valeur CodeErreur pour erreur ERR_LOGICIEL) */ +#define MODULE_LEC 1 /* module origine de l'erreur logicielle */ +#define MODULE_GALSS 2 /* module origine de l'erreur logicielle */ +#define MODULE_CPS 3 /* module origine de l'erreur logicielle */ + + +/* Codes complémentaires Erreurs carte */ +#define ERR_CARTE_ME1_ME2 0x1009 +#define ERR_CARTE_VIERGE 0x100A +#define ERR_CARTE_PLEINE 0x100B +#define ERR_CARTE_COMPAC 0x100C +#define ERR_CARTE_INEXISTANTE 0x100D + + +#endif diff --git a/cv2extractor/api_lec.h b/cv2extractor/api_lec.h new file mode 100755 index 0000000..b7b6123 --- /dev/null +++ b/cv2extractor/api_lec.h @@ -0,0 +1,345 @@ +/* +%------------------------------------------------------------------------------------------------- +% PROJET : API de Lecture +% +% MODULE : APILEC +% +% FICHIER : Api_lec.h +% +% Définitions communes à l'ensemble des fonctionnalités des API de lecture +% +%------------------------------------------------------------------------------------------------- +*/ + +#ifndef __LEC_H_VU__ +#define __LEC_H_VU__ + +#ifdef WIN32 + #include "win32def.h" +#else + #ifdef TARGET_API_MAC_OSX + #include "osxdef.h" + #else + #ifdef UNIX + #include "linuxdef.h" + #endif + #endif +#endif + +#ifdef IN + #undef IN +#endif +#define IN const + +#ifndef OUT + #define OUT +#endif + +#ifndef IN_OUT + #define IN_OUT +#endif + +/* +-------------------------------------------------------------------------------------------------- +*/ + +/* constantes relatives aux coupleurs */ +#define COUPLEUR_ABSENT 0xFFFF +#define COUPLEUR_VITALE 0x0001 +#define COUPLEUR_CPS 0x0002 + + +/* Constantes CPS */ + +#define TYPE_CPS "00" /* Carte de type CPS */ +#define TYPE_CPE "01" /* Carte de type CPE */ +#define TYPE_CPF "02" /* Carte de type CPF */ +#define TYPE_CDE "03" /* Carte de type CDE */ + +#define CPS_REELLE "00" /* CPS réelle */ +#define CPS_TEST "80" /* CPS de test */ + +#ifdef FULLPCSC +#define NOM_RESSOURCE_CPS "CPS" +#else +#define NOM_RESSOURCE_CPS "TRANSPA1" +#endif + +/* Tables pour la fonction Dictionnaire */ +#define TABLE_REGIME 1 /* Régimes */ +#define TABLE_CAISSE 2 /* Nom des caisses de rattachement */ +#define TABLE_GESTION 3 /* Code Gestion */ +#define TABLE_COUV 5 /* Libellé Code Couverture */ +#define TABLE_QUALITE 6 /* Qualité bénéficiaire */ +#define TABLE_CIVILITE 7 /* Civilité du PS */ +#define TABLE_DIVERS 11 /* Table divers */ +#define TABLE_DROIT 12 /* Période de droit AMO */ +#define TABLE_CMU 13 /* CMU */ +#define TABLE_CODEROUT 14 /* Code routage AMC */ +#define TABLE_INDICAMC 15 /* Indicateur de traitement AMC */ +#define TABLE_INDICMUT 16 /* Indicateur de traitement Mutuelle */ +#define TABLE_PRJEURO 17 /* Activité projet européen */ +#define TABLE_SERVAMO 18 /* Services AMO */ +#define TABLE_SERVMUTAMC 19 /* Services Mutuelle / AMC */ +#define TABLE_STS 20 /* Code aiguillage STS */ +#define TABLE_MEDECIN 21 /* Medecin traitant */ + + +/* Type de Timer */ +#define TIMER_CONTROLE 1 /* Timer de controle de la CPS */ +#define TIMER_INACTIVITE 2 /* Timer d'inactivité */ + + +/* Modes de fonctionnement */ +#define FLIP_FLOP 1 +#define CPS_EN_LIGNE 2 + + +/* Etats de la CPS (ces états peuvent se combiner) */ +#define CPS_RELLE 0x0000 +#define CPS_ABSENTE 0x0001 +#define CPS_BLOQUEE 0x0002 +#define CPS_CODE_ACTIF 0x0004 /* Le code porteur a été présenté */ +#define CPS_CODE_INACTIF 0x0000 +#define CPS_HORSVALIDITE 0x0008 /* La date de validité est expirée */ +#define CPS_IDENTINCORRECT 0x0010 /* CPS avec identificateur d'application incorrect */ +#define CPS_NONAUTORISEE 0x0020 /* Type de CPS non autorisée (CPA) */ +#define CPS_DETEST 0x0040 + +/* Etats de la carte VITALE */ +#define CARTE_REELLE 0x0000 +#define CARTE_INVALIDE 0x0001 +#define CARTE_BLOQUEE 0x0002 +#define CARTE_INCORRECTE 0x0003 +#define CARTE_SATUREE 0x0004 +#define CARTE_PERIMEE 0x0005 +#define CARTE_TEST 0x1000 +#define CARTE_DEMO 0x2000 + +/* états des coupleurs */ +#define ETAT_CABSENTE 0x00 +#define ETAT_CPRESENTE 0x01 +#define ETAT_CSOUSTENSION 0x02 + +/* Informations concernant la famille */ +#define LG_NIR 13 /* Longueur du NIR */ +#define LG_CLE 2 /* Longueur de la clé du NIR */ + +/* Informations concernant un bénéficiaire */ +/*#define BEN_DRT_INT_NB 3 /* nombre d'intervalles de droits au régime obligatoire */ + +/* Mutuelle */ +#define MUT_NUM_LG 8 /* longueur du numéro de mutuelle */ +#define MUT_TYP_NB 8 /* nombre de catégories du contrat */ +#define MUT_TYP_LG 25 /* longueur du libellé d'une catégorie */ +#define MUT_INT_NB 3 /* nombre d'intervalles de droits mutuelle */ + +/* Taille maxi buffer Infos poste*/ +#define MAX_SIZE_INFOPOSTECPS 30000 /* longueur maxi admissible du buffer retour CPS_InformationPoste */ + +#define APILECTURE "Api_Lec.dll" /* Nom de l'API de lecture */ + + + +typedef struct tagLANGANDCP +{ + WORD wLanguage; + WORD wCodePage; +} LANGANDCP; + + +#ifdef __cplusplus + /* Compatibilité avec un programme appelant écrit en C++ */ + #define _COMP_CPP "C" + #define _EXTERN extern +#else + #define _COMP_CPP + #define _EXTERN +#endif + + +/* Déclarations des fonctions de la bibliothéque API de Lecture */ +#ifdef _API_LEC + #define _DLL_PTR +#else + #ifdef API_ENTRY + #undef API_ENTRY + #endif + #if defined(UNIX) || defined(TARGET_API_MAC_OSX) + #define API_ENTRY /* API*/ + #define _DLL_PTR + #else + #define API_ENTRY API + #define _DLL_PTR * + #endif +#endif + +#if defined(UNIX) || defined(TARGET_API_MAC_OSX) +#define API_LEC_EXPORT API_ENTRY +#else +#define API_LEC_EXPORT API_IMPORT_EXPORT API +#endif + +/********************************************************************/ +/* Types des fonctions HAUT NIVEAU de la bibliothèque API de Lecture */ +/********************************************************************/ +typedef unsigned short (API_ENTRY _DLL_PTR T_Hn_Init) + ( IN unsigned char FARPTR pcChemin, + OUT unsigned short FARPTR pusMode, + OUT unsigned short FARPTR pusCodeErreur ); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Hn_Finir) + ( OUT unsigned short FARPTR pusCodeErreur ); + + +typedef unsigned short (API_ENTRY _DLL_PTR T_Hn_LectureVitale) + ( IN short sTempsAttente, + OUT char FARPTR pcDataOut, + IN_OUT unsigned int FARPTR puiLgDataOut, + OUT short FARPTR psEtatCarte, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Hn_IntroductionMstCPS) + + ( IN short sTempsAttente, + OUT char tcCodeCivilite[2], + OUT char szNomPatronymique[27], + OUT char FARPTR pcPresentPinCode, + OUT short FARPTR psEtatCarte, + OUT unsigned short FARPTR pusCodeErreur); + + +typedef unsigned short (API_ENTRY _DLL_PTR T_Hn_RetraitMhtCPS) + ( IN short sTempsAttente, + OUT unsigned short FARPTR pusCodeErreur); + + +typedef unsigned short (API_ENTRY _DLL_PTR T_Hn_ControleCPS) + ( IN char tcPinCode[4], + OUT char tcDateFinValidite[8], + OUT char tcTypeCarte[2], + OUT char FARPTR pcPresentPinCode, + OUT char tcCategorie[2], + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Hn_TestPresence) + ( IN unsigned short usCoupleur, + OUT unsigned char FARPTR pucStatut, + OUT unsigned short FARPTR pusCodeErreur); + +/********************************************************************/ +/* Types des fonctions BAS NIVEAU de la bibliothèque API de Lecture */ +/********************************************************************/ +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_OuvertureSessionVitale) + ( IN unsigned char FARPTR pcChemin, + IN char FARPTR szNomAppli, + OUT unsigned short FARPTR pusNoSession, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_FermetureSessionVitale) + ( IN unsigned short usNoSession, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_IntroductionMstVitale) + ( IN unsigned short usNoSession, + IN short sTempsAttente, + OUT short FARPTR psEtatCarte, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_RetraitMhtVitale) + ( IN unsigned short usNoSession, + IN short sTempsAttente, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_LectureVitale) + ( IN unsigned short usNoSession, + IN unsigned short usNoSessionCPS, + OUT char FARPTR pcDataOut, + IN_OUT unsigned int FARPTR puiLgDataOut, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_OuvertureSessionCPS) + ( IN unsigned char FARPTR pcChemin, + IN char FARPTR szNomAppli, + OUT unsigned short FARPTR pusNoSession, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_FermetureSessionCPS) + ( IN unsigned short usNoSession, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_IntroductionMstCPS) + ( IN unsigned short usNoSession, + IN short sTempsAttente, + OUT char tcCodeCivilite[2], + OUT char szNomPatronymique[27], + OUT short FARPTR psEtatCarte, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_RetraitMhtCPS) + ( IN unsigned short usNoSession, + IN short sTempsAttente, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_ControleCPS) + ( IN unsigned short usNoSession, + IN char tcPinCode[4], + OUT char tcDateFinValidite[8], + OUT char szIdentApplication[10], + OUT char tcTypeCarte[2], + OUT char FARPTR pcPresentPinCode, + OUT char tcCategorie[2], + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_Dictionnaire) + ( IN unsigned char FARPTR pcChemin, + IN short sNoTable, + IN char tcCode[9], + IN char tcPeriode[50], + OUT char FARPTR szLibelle, + IN_OUT short FARPTR psLgLibelle, + OUT unsigned short FARPTR pusCodeErreur); + +typedef unsigned short (API_ENTRY _DLL_PTR T_Lec_InformationsAPI) + ( IN unsigned char FARPTR pcChemin, + IN_OUT unsigned short FARPTR pusLgInformations, + OUT char FARPTR szInformations, + OUT unsigned short FARPTR pusCodeErreur); + +#if !defined(APILEC_EXPORTS) +/*********************************************************************************************/ +/* Déclaration des pointeurs sur les fonctions HAUT NIVEAU de la bibliothèque API de Lecture */ +/*********************************************************************************************/ +_EXTERN _COMP_CPP T_Hn_Init Hn_Init; +_EXTERN _COMP_CPP T_Hn_Finir Hn_Finir; +_EXTERN _COMP_CPP T_Hn_LectureVitale Hn_LectureVitale; +_EXTERN _COMP_CPP T_Hn_IntroductionMstCPS Hn_IntroductionMstCPS; +_EXTERN _COMP_CPP T_Hn_RetraitMhtCPS Hn_RetraitMhtCPS; +_EXTERN _COMP_CPP T_Hn_ControleCPS Hn_ControleCPS; +_EXTERN _COMP_CPP T_Hn_TestPresence Hn_TestPresence; + + +/*********************************************************************************************/ +/* Déclaration des pointeurs sur les fonctions BAS NIVEAU de la bibliothèque API de Lecture */ +/*********************************************************************************************/ +_EXTERN _COMP_CPP T_Lec_OuvertureSessionVitale Lec_OuvertureSessionVitale; +_EXTERN _COMP_CPP T_Lec_FermetureSessionVitale Lec_FermetureSessionVitale; +_EXTERN _COMP_CPP T_Lec_IntroductionMstVitale Lec_IntroductionMstVitale; +_EXTERN _COMP_CPP T_Lec_RetraitMhtVitale Lec_RetraitMhtVitale; +_EXTERN _COMP_CPP T_Lec_LectureVitale Lec_LectureVitale; +_EXTERN _COMP_CPP T_Lec_OuvertureSessionCPS Lec_OuvertureSessionCPS; +_EXTERN _COMP_CPP T_Lec_FermetureSessionCPS Lec_FermetureSessionCPS; +_EXTERN _COMP_CPP T_Lec_IntroductionMstCPS Lec_IntroductionMstCPS; +_EXTERN _COMP_CPP T_Lec_RetraitMhtCPS Lec_RetraitMhtCPS; +_EXTERN _COMP_CPP T_Lec_ControleCPS Lec_ControleCPS; +_EXTERN _COMP_CPP T_Lec_Dictionnaire Lec_Dictionnaire; +_EXTERN _COMP_CPP T_Lec_InformationsAPI Lec_InformationsAPI; +#endif + +#undef _DLL_PTR + +/* +-------------------------------------------------------------------------------------------------- +*/ +#endif + diff --git a/cv2extractor/linuxdef.h b/cv2extractor/linuxdef.h new file mode 100755 index 0000000..9461fe3 --- /dev/null +++ b/cv2extractor/linuxdef.h @@ -0,0 +1,129 @@ +/*--------------------------------------------------------------------------- + PROJET : Couche de portabilite multi-systeme + + PLATE-FORME: LINUX + + MODULE : Definition des macros et des types utilises par la couche + d'abstraction systeme pour la plate-forme LINUX. + + Le fichier de definition des types portable (ce fichier) doit + etre inclus avant tout autre .h de definitions d'APIS gip-cps. + Ce fichier definit tous les types et macros dependants du + systeme. + + FICHIER : linuxdef.h + + VERSION : 1.01 + + DATE : 6/06/2008 + + AUTEUR : ALVARO ROCHA modifications : Charles Puissant (GFI) + +----------------------------------------------------------------------------- + Modifications: (nouvelle version, date, auteur, explication) + ... + 24/08/2010 : GFI + Remplacement du #define d'inclusion linuxdef.h __CPSCASDF_H par __LINUXDF_H +----------------------------------------------------------------------------- +---------------------------------------------------------------------------*/ + + +#ifndef __LINUXDF_H +#define __LINUXDF_H + +/*----------------- definition des macros portables ------------------------*/ + +#define far +#define FAR + +#define PTR * + +#define PVOID void PTR +#define FARPTR PTR +#define FPVOID void FARPTR + +/* AROC 12/02/2001 debut : */ +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif +/* AROC 12/02/2001 fin */ + +#ifndef NULL +#define NULL ((void *)0) +#endif + +/*----------------- definition des types portables ------------------------*/ + +typedef char CHAR; +typedef CHAR PTR PCHAR; + +typedef CHAR PTR PSTRG; + +#ifndef __wintypes_h__ +typedef unsigned char UCHAR; +typedef UCHAR PTR PUCHAR; +#endif + +typedef char INT8; +typedef short INT16; +typedef long INT32; + +typedef INT8 PTR PINT8; +typedef INT16 PTR PINT16; +typedef INT32 PTR PINT32; + +typedef unsigned char UINT8; +typedef unsigned short UINT16; +typedef unsigned long UINT32; + +typedef UINT8 PTR PUINT8; +typedef UINT16 PTR PUINT16; +typedef UINT32 PTR PUINT32; + +/* 11/02/1997 : Ajout DRE pour CPSCAS */ +typedef void VOID; +typedef char PTR PSTR; +/* 11/02/1997 : Fin */ + +typedef long LONG; +typedef char far PTR LPSTR; + +#ifndef __wintypes_h__ +typedef unsigned short WORD; +typedef unsigned long DWORD; +typedef unsigned char BYTE; +typedef BYTE far * LPBYTE; + +#ifndef BOOL + typedef short int BOOL; +#endif + +#endif + +#define Unref( a) a=a + +#ifndef min +#define min(a,b) ((a)>(b)?(b):(a)) +#endif + +#ifndef max +#define max(a,b) ((a)<(b)?(b):(a)) +#endif + +/* Taille maximale allouée par la fonction "malloc" */ +#ifndef MAXBLOC +#define MAXBLOC 4294967295 +#endif + +#ifndef API_ENTRY +#define API_ENTRY +#endif + + +#endif + +