diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e1bd836834..4d586a97e3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2000-07-24 13:59 GMT+3 Alexander Kresin + * contrib/rdd_ads/adsfunc.c + * added full set of encryption/decryption functions + 2000-07-24 13:59 GMT+3 Alexander Kresin * include/hbapirdd.h * uncommented relational methods in functions table diff --git a/harbour/contrib/rdd_ads/adsfunc.c b/harbour/contrib/rdd_ads/adsfunc.c index 895d22f001..f81a500fe5 100644 --- a/harbour/contrib/rdd_ads/adsfunc.c +++ b/harbour/contrib/rdd_ads/adsfunc.c @@ -433,4 +433,148 @@ HB_FUNC( ADSGETRELKEYPOS ) } else hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSREFRESHAOF" ); +} + +HB_FUNC( ADSENABLEENCRYPTION ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + char *pucPassword = hb_parc( 1 ); + + if( strlen( pucPassword ) == 0 ) + { + hb_errRT_DBCMD( EG_ARG, 1014, NULL, "ADSENABLEENCRYPTION" ); + return; + } + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + ulRetVal = AdsEnableEncryption( pArea->hTable,pucPassword ); + hb_retni( ulRetVal ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, " ADSENABLEENCRYPTION" ); +} + +HB_FUNC( ADSDISABLEENCRYPTION ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + ulRetVal = AdsDisableEncryption( pArea->hTable ); + hb_retni( ulRetVal ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, " ADSDISABLEENCRYPTION" ); +} + +HB_FUNC( ADSENCRYPTTABLE ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + ulRetVal = AdsEncryptTable( pArea->hTable ); + hb_retni( ulRetVal ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSENCRYPTTABLE" ); +} + +HB_FUNC( ADSDECRYPTTABLE ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + ulRetVal = AdsDecryptTable( pArea->hTable ); + hb_retni( ulRetVal ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSDECRYPTTABLE" ); +} + +HB_FUNC( ADSENCRYPTRECORD ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + ulRetVal = AdsEncryptRecord( pArea->hTable ); + hb_retni( ulRetVal ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSENCRYPTRECORD" ); +} + +HB_FUNC( ADSDECRYPTRECORD ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + ulRetVal = AdsDecryptRecord( pArea->hTable ); + hb_retni( ulRetVal ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "ADSDECRYPTRECORD" ); +} + +HB_FUNC( ADSISENCRYPTIONENABLED ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + UNSIGNED16 usIsEnabled; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + AdsIsEncryptionEnabled( pArea->hTable, &usIsEnabled ); + hb_retl( usIsEnabled ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, " ADSISENCRYPTIONENABLED" ); +} + +HB_FUNC( ADSISRECORDENCRYPTED ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + UNSIGNED16 usIsEnabled; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + AdsIsRecordEncrypted( pArea->hTable, &usIsEnabled ); + hb_retl( usIsEnabled ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, " ADSISRECORDENCRYPTED" ); +} + +HB_FUNC( ADSISTABLEENCRYPTED ) +{ + ADSAREAP pArea; + UNSIGNED32 ulRetVal; + UNSIGNED16 usIsEnabled; + + pArea = (ADSAREAP) hb_rddGetCurrentWorkAreaPointer(); + if( pArea ) + { + AdsIsTableEncrypted( pArea->hTable, &usIsEnabled ); + hb_retl( usIsEnabled ); + } + else + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, " ADSISTABLEENCRYPTED" ); } \ No newline at end of file