Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transform a c++ function into vfp script
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01163785
Message ID:
01163791
Views:
8
A big Thank borislav, that functions very well !

bernhart


>>
>>
>>
>> /*! \brief Extract the public data files from a SIS image and parse the content.
>>  *
>>  * This function will extract the two public files - the PBDF (Public Data File) and the
>>  * ISDF (Issuer Data File) - from the SIS image. PBDF and ISDF are parsed and the relevant
>>  * data fields are made available in 2 data structures, resp. of type Pbdf and Isdf.
>>  *
>>  * \param pucBuffer    the buffer (SIS_LEN bytes) containing the SIS card image read
>>  * \param pxPbdf       the resulting PBDF file
>>  * \param pxIsdf       the resulting ISDF file
>>  *
>>  * \note  dates are always in "YYYYMMDD" format
>>  *
>>  * \return ERR_OK if ok
>>  * \return ERR_PARAM if parameter error
>>  * \return ERR_BNCS if SIS parse error
>>  * \return ERR_INTERNAL if internal error
>>  *
>>  */
>>SISPUBLIC_API SisPublicError SisPublicParse(const unsigned char *pucBuffer, Pbdf *pxPbdf, Isdf *pxIsdf);
>>
>>
>>euh... and this ?...:)
>>
>>
>>bernhart
>
>
>#define SIS_LEN        404
>#define BCDDATE_LEN    (8+1)
>#define FIDN_LEN       (4+1)
>#define FSKI_LEN       (2+1)
>#define FCTF_LEN       (8+1)
>#define FCSM_LEN       (2+1)
>#define PBDF_NAME_LEN  (48+1)
>#define PBDF_SNME_LEN  (24+1)
>#define PBDF_SSIN_LEN  (11+1)
>#define PBDF_INIT_LEN  (1+1)
>#define PBDF_SEXE_LEN  (1+1)
>#define ISDF_SSIN_LEN  PBDF_SSIN_LEN
>#define ISDF_CNME_LEN  (10+1)
>#define ISDF_CLAN_LEN  (1+1)
>#define ISDF_CLGN_LEN  (10+1)
>
>*! Public Data File
>*
>*
>*typedef struct
>*{
>*unsigned char FIDN[FIDN_LEN];       //!< File Identification Number(0012)            5
>*unsigned char FSKI[FSKI_LEN];       //!< File Secret Key Index                       3
>*unsigned char SSIN[PBDF_SSIN_LEN];  //!< Social Security Identification Number      12
>*unsigned char DCDT[BCDDATE_LEN];    //!< Data Capture Date                           9
>*unsigned char NAME[PBDF_NAME_LEN];  //!< Holder's Firstname                         49
>*unsigned char SNME[PBDF_SNME_LEN];  //!< Holder's Surname                           25
>*unsigned char INIT[PBDF_INIT_LEN];  //!< Holder's initial                            2
>*unsigned char SEXE[PBDF_SEXE_LEN];  //!< Holder's Sex                                2
>*unsigned char BRDT[BCDDATE_LEN];    //!< Holder's Birthdate                          9
>*unsigned char FCTF[FCTF_LEN];       //!< File Certificate                            9
>*unsigned char FCSM[FCSM_LEN];       //!< File Checksum                               3
>*} Pbdf;                                                                          -----
>*                                                                                   128
>*! Issuer Data File
>*
>*/
>*typedef struct
>*{
>*unsigned char FIDN[FIDN_LEN];       //!< File Identification Number
>*unsigned char FSKI[FSKI_LEN];       //!< File Secret Key Index
>*unsigned char SSIN[ISDF_SSIN_LEN];  //!< Social Security Identification Number
>*unsigned char DCDT[BCDDATE_LEN];    //!< Data Capture Date
>*unsigned char CNME[ISDF_CNME_LEN];  //!< Card Name
>*unsigned char CLAN[ISDF_CLAN_LEN];  //!< Card Language
>*unsigned char CLGN[ISDF_CLGN_LEN];  //!< Card Logical Number
>*unsigned char CBDT[BCDDATE_LEN];    //!< Card Begin Date
>*unsigned char CEDT[BCDDATE_LEN];    //!< Card End Date
>*unsigned char FCTF[FCTF_LEN];       //!< File Certificate
>*unsigned char FCSM[FCSM_LEN];       //!< File Checksum
>*} Isdf;
>
>Try:
><pre>
>DECLARE LONG SisPublicParse IN SisPublic.dll STRING @, STRING @, STRING @
>STORE REPLICATE(CHR(0), SIS_LEN) TO lcTest
>STORE REPLICATE(CHR(0), 128) TO lcPbdf, lcIsdf
>? SisPublicParse(@lcTest, @lcPbdf, @lcIsdf)
>? lcTest
>? lcPbdf
>? lcIsdf
>
Previous
Reply
Map
View

Click here to load this message in the networking platform