![]() |
00001 #ifndef PRAPI_INCL 00002 #define PRAPI_INCL 00003 /******************************************************************************* 00004 * PR API 2004-2021 (c) Adaptive Recognition 00005 * 2021.06.03 v2.1.10 00006 ******************************************************************************/ 00007 #ifdef GX_DOTNET 00008 #using "gxdotnet7.dll" 00009 #endif 00010 #ifndef __cplusplus 00011 #define USE_COMPAT_VARIANT_1 00012 #endif 00013 #include "gxsd.h" 00014 #include "prtypes.h" 00015 #include "prerror.h" 00016 #include "prdoctypes.h" 00017 #include "gximage.h" 00018 #include "gxtrafo.h" 00019 00020 #if defined(WIN32) && !defined(GX_DOTNET) 00021 #include <windows.h> 00022 #endif 00023 /******************************************************************************/ 00024 #ifdef _MSC_VER 00025 #pragma warning(push) 00026 #pragma warning(disable : 4786) /* truncated debug info */ 00027 #endif 00028 #ifdef __BORLANDC__ 00029 #pragma warn -rch 00030 #endif 00031 /******************************************************************************/ 00032 #ifdef GX_NAMESPACES 00033 namespace pr { 00034 #endif 00035 00120 #ifndef GX_MANUAL 00121 /* .NET Workarounds */ 00122 #ifdef GX_DOTNET 00123 #pragma unmanaged 00124 #define _GX_ENOENT 2 00125 #define _PR_UMODE_DISCONNECT 0 00126 #define _PR_PROP_TYPE_CONFIDENCE 3 00127 #define _PR_PROP_TYPE_RFID_FILES 2 00128 #define _PR_PROP_TYPE_BARCODE_TYPE 1 00129 #define _PR_DF_RFID_FACE 0x420000 00130 #define _PRV_RFIDDIR 0xd0500001 00131 #define _PRV_BARCODE 0xd0300000 00132 #define _PRV_CONFIDENCE 0xd0000005 00133 #define _GX_VARIANT_INT 1 00134 #define gxPG4 _gxPG4 00135 #ifdef WIN32 00136 #define HWND void* 00137 #define UINT unsigned int 00138 #endif 00139 #define GXVT GX_VARIANT_TYPES:: 00140 #define GXVF GX_VARIANT_FLAGS:: 00141 #define GXEC GX_ERROR_CODES:: 00142 #else 00143 #define _GX_ENOENT GX_ENOENT 00144 #define _PR_UMODE_DISCONNECT PR_UMODE_DISCONNECT 00145 #define _PR_PROP_TYPE_CONFIDENCE PR_PROP_TYPE_CONFIDENCE 00146 #define _PR_PROP_TYPE_RFID_FILES PR_PROP_TYPE_RFID_FILES 00147 #define _PR_PROP_TYPE_BARCODE_TYPE PR_PROP_TYPE_BARCODE_TYPE 00148 #define _PR_DF_RFID_FACE PR_DF_RFID_FACE 00149 #define _PRV_RFIDDIR PRV_RFIDDIR 00150 #define _PRV_BARCODE PRV_BARCODE 00151 #define _PRV_CONFIDENCE PRV_CONFIDENCE 00152 #define _GX_VARIANT_INT GX_VARIANT_INT 00153 #define GXVT 00154 #define GXVF 00155 #define GXEC 00156 #endif 00157 #endif/* GX_MANUAL */ 00158 00159 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL) /*(*/ 00160 00161 enum PR_MAXLEN_VALUES { 00162 MAX_LIGHTS = 8, /* Maximum number of available light types */ 00163 }; 00164 00165 /******************************************************************************* 00166 * call codes 00167 ******************************************************************************/ 00168 00169 /* Call codes for the Passport Reader routines. */ 00170 enum { 00171 PR_CALL_GROUP_PRAPI = 0x20080000, /* Caller ID of the prapi module */ 00172 PR_CALL_PRCM_BASE = 0x2008c000, /* Caller ID of the prcm module */ 00173 PR_CALL_PRAPI_GETDEVICELIST = PR_CALL_GROUP_PRAPI, /* Call code of the pr_getdevicelist() function (Unicode version). */ 00174 PR_CALL_PRAPI_GETDEVICELISTA = PR_CALL_GROUP_PRAPI+1, /* Call code of the pr_getdevicelist() function (ASCII version). */ 00175 PR_CALL_PRAPI_USEDEVICE = PR_CALL_GROUP_PRAPI+2, /* Call code of the pr_usedevice() function (Unicode version). */ 00176 PR_CALL_PRAPI_USEDEVICEA = PR_CALL_GROUP_PRAPI+3, /* Call code of the pr_usedevice() function (ASCII version). */ 00177 PR_CALL_PRAPI_GETCONTROLLERHANDLE = PR_CALL_GROUP_PRAPI+4, /* Call code of the pr_getctrlhandle() function */ 00178 PR_CALL_PRAPI_CALIBRATE = PR_CALL_GROUP_PRAPI+60, /* Call code of the pr_calibrate() function */ 00179 /* PR_CALL_PRAPI_CALIBRATE_START = PR_CALL_GROUP_PRAPI+6, 00180 // PR_CALL_PRAPI_CALIBRATE_GETSTATUS = PR_CALL_GROUP_PRAPI+7, 00181 // PR_CALL_PRAPI_CALIBRATE_WAIT = PR_CALL_GROUP_PRAPI+8, */ 00182 PR_CALL_PRAPI_ISCALIBRATED = PR_CALL_GROUP_PRAPI+61, /* Call code of the pr_iscalibrated() function */ 00183 PR_CALL_PRAPI_SETPAGELIGHT = PR_CALL_GROUP_PRAPI+62, /* Call code of the pr_setpagelight() function */ 00184 PR_CALL_PRAPI_SETEVENTFUNCTION = PR_CALL_GROUP_PRAPI+11, /* Call code of the pr_seteventfunction() function */ 00185 PR_CALL_PRAPI_TEST_DOCUMENT = PR_CALL_GROUP_PRAPI+63, /* Call code of the pr_testdocument() function */ 00186 PR_CALL_PRAPI_CAPTURE = PR_CALL_GROUP_PRAPI+13, /* Call code of the pr_capture() function */ 00187 PR_CALL_PRAPI_CAPTURE_START = PR_CALL_GROUP_PRAPI+14, /* Call code of the pr_capture_start() function */ 00188 PR_CALL_PRAPI_CAPTURE_GETSTATUS = PR_CALL_GROUP_PRAPI+15, /* Call code of the pr_capture_getstatus() function */ 00189 PR_CALL_PRAPI_CAPTURE_WAIT = PR_CALL_GROUP_PRAPI+16, /* Call code of the pr_capture_wait() function */ 00190 PR_CALL_PRAPI_CAPTURE_PREVIEW = PR_CALL_GROUP_PRAPI+64, /* Call code of the pr_capture_preview() function */ 00191 PR_CALL_PRAPI_SAVEIMAGE = PR_CALL_GROUP_PRAPI+19, /* Call code of the pr_saveimage() function (Unicode version). */ 00192 PR_CALL_PRAPI_SAVEIMAGEA = PR_CALL_GROUP_PRAPI+20, /* Call code of the pr_saveimage() function (ASCII version). */ 00193 PR_CALL_PRAPI_DRAWIMAGE = PR_CALL_GROUP_PRAPI+21, /* Call code of the pr_drawimage() function */ 00194 PR_CALL_PRAPI_RESETDOCUMENT = PR_CALL_GROUP_PRAPI+176, /* Call code of the pr_resetdocument() function */ 00195 PR_CALL_PRAPI_GETLIGHTNUMBER = PR_CALL_GROUP_PRAPI+51, /* Call code of the pr_getlightnumber() function */ 00196 PR_CALL_PRAPI_GETRFIDCARDLIST = PR_CALL_GROUP_PRAPI+126, /* Call code of the pr_getrfidcardlist() function (Unicode version). */ 00197 PR_CALL_PRAPI_GETRFIDCARDLISTA = PR_CALL_GROUP_PRAPI+127, /* Call code of the pr_getrfidcardlist() function (ASCII version). */ 00198 PR_CALL_PRAPI_GETRFIDFILE = PR_CALL_GROUP_PRAPI+73, /* Call code of the pr_getrfidfile() function (Unicode version). */ 00199 PR_CALL_PRAPI_GETRFIDFILEA = PR_CALL_GROUP_PRAPI+74, /* Call code of the pr_getrfidfile() function (ASCII version). */ 00200 PR_CALL_PRAPI_GETLIGHTMASK = PR_CALL_GROUP_PRAPI+65, /* Call code of the pr_getlightmask() function */ 00201 PR_CALL_PRAPI_GETWINDOWNUMBER = PR_CALL_GROUP_PRAPI+66, /* Call code of the pr_getwindownumber() function */ 00202 PR_CALL_PRAPI_GETLIGHTLIST = PR_CALL_GROUP_PRAPI+67, /* Call code of the pr_getlightlist() function */ 00203 PR_CALL_PRAPI_SET_STATUS_LED = PR_CALL_GROUP_PRAPI+68, /* Call code of the pr_setstatusled() function */ 00204 PR_CALL_PRAPI_TEST_POWER = PR_CALL_GROUP_PRAPI+69, /* Call code of the pr_testpower() function */ 00205 PR_CALL_PRAPI_TEST_BUTTON = PR_CALL_GROUP_PRAPI+70, /* Call code of the pr_testbutton() function */ 00206 PR_CALL_PRAPI_MAKEBAC = PR_CALL_GROUP_PRAPI+75, /* Call code of the pr_makebac() function (Unicode version). */ 00207 PR_CALL_PRAPI_MAKEBACA = PR_CALL_GROUP_PRAPI+76, /* Call code of the pr_makebac() function (ASCII version). */ 00208 PR_CALL_PRAPI_MAKEPASSIVEAUTH = PR_CALL_GROUP_PRAPI+77, /* Call code of the pr_makepassiveauth() function (Unicode version). */ 00209 PR_CALL_PRAPI_MAKEPASSIVEAUTHA = PR_CALL_GROUP_PRAPI+78, /* Call code of the pr_makepassiveauth() function (ASCII version). */ 00210 PR_CALL_PRAPI_MAKEACTIVEAUTH = PR_CALL_GROUP_PRAPI+79, /* Call code of the pr_makeactiveauth() function (Unicode version). */ 00211 PR_CALL_PRAPI_MAKEACTIVEAUTHA = PR_CALL_GROUP_PRAPI+80, /* Call code of the pr_makeactiveauth() function (ASCII version). */ 00212 PR_CALL_PRAPI_BEGIN_WINDOW_MESSAGING = PR_CALL_GROUP_PRAPI+82, /* Call code of the pr_beginwindowmessaging() function */ 00213 PR_CALL_PRAPI_END_WINDOW_MESSAGING = PR_CALL_GROUP_PRAPI+83, /* Call code of the pr_endwindowmessaging() function */ 00214 PR_CALL_PRAPI_GET_BUTTON_EVENT = PR_CALL_GROUP_PRAPI+84, /* Call code of the pr_getbuttonevent() function */ 00215 PR_CALL_PRAPI_SUSPEND = PR_CALL_GROUP_PRAPI+85, /* Call code of the pr_suspend() function */ 00216 PR_CALL_PRAPI_WAKEUP = PR_CALL_GROUP_PRAPI+86, /* Call code of the pr_wakeup() function */ 00217 PR_CALL_PRAPI_LOADCERTFILE = PR_CALL_GROUP_PRAPI+132, /* Call code of the pr_loadcertfile() function (Unicode version). */ 00218 PR_CALL_PRAPI_LOADCERTFILEA = PR_CALL_GROUP_PRAPI+133, /* Call code of the pr_loadcertfile() function (ASCII version). */ 00219 PR_CALL_PRAPI_GET_UDINFO = PR_CALL_GROUP_PRAPI+94, /* Call code of the pr_getudinfo() function */ 00220 PR_CALL_PRAPI_READ_UD = PR_CALL_GROUP_PRAPI+95, /* Call code of the pr_readudata() function */ 00221 PR_CALL_PRAPI_WRITE_UD = PR_CALL_GROUP_PRAPI+96, /* Call code of the pr_writeudata() function */ 00222 PR_CALL_PRAPI_GETOCR_V = PR_CALL_GROUP_PRAPI+97, /* Call code of the pr_getocr() function */ 00223 PR_CALL_PRAPI_GETMRZ_V = PR_CALL_GROUP_PRAPI+98, /* Call code of the pr_getmrz() function */ 00224 PR_CALL_PRAPI_GETBARCODE_V = PR_CALL_GROUP_PRAPI+99, /* Call code of the pr_getbarcode() function */ 00225 PR_CALL_PRAPI_GETDOCUMENTRECT_V = PR_CALL_GROUP_PRAPI+100, /* Call code of the pr_getdocumentrect() function */ 00226 PR_CALL_PRAPI_RECOGNIZE_V = PR_CALL_GROUP_PRAPI+101, /* Call code of the pr_recognize() function */ 00227 PR_CALL_PRAPI_RESOLVEMRZTEXT_V = PR_CALL_GROUP_PRAPI+102, /* Call code of the pr_resolvemrztext() function */ 00228 PR_CALL_PRAPI_RESOLVEMRZTEXTA_V = PR_CALL_GROUP_PRAPI+103, /* Call code of the pr_resolvemrztext() function */ 00229 PR_CALL_PRAPI_RESOLVERFIDDATA_V = PR_CALL_GROUP_PRAPI+104, /* Call code of the pr_resolverfiddata() function */ 00230 PR_CALL_PRAPI_GETDOCUMENTSTATUS_V = PR_CALL_GROUP_PRAPI+105, /* Call code of the pr_getdocumentstatus() function */ 00231 PR_CALL_PRAPI_GETFIELDFROMDOC_V = PR_CALL_GROUP_PRAPI+106, /* Call code of the pr_getfieldfromdoc() function */ 00232 PR_CALL_PRAPI_GETFIELDIMAGE_V = PR_CALL_GROUP_PRAPI+107, /* Call code of the pr_getfieldimage() function */ 00233 PR_CALL_PRAPI_COMPARE_FACE_V = PR_CALL_GROUP_PRAPI+108, /* Call code of the pr_compareface() function */ 00234 PR_CALL_PRAPI_SAVEDOCUMENT_V = PR_CALL_GROUP_PRAPI+109, /* Call code of the pr_savedocument() function */ 00235 PR_CALL_PRAPI_SAVEDOCUMENTA_V = PR_CALL_GROUP_PRAPI+110, /* Call code of the pr_savedocument() function */ 00236 PR_CALL_PRAPI_LOADDOCUMENT_V = PR_CALL_GROUP_PRAPI+111, /* Call code of the pr_loaddocument() function */ 00237 PR_CALL_PRAPI_LOADDOCUMENTA_V = PR_CALL_GROUP_PRAPI+112, /* Call code of the pr_loaddocument() function */ 00238 PR_CALL_PRAPI_GETDOCUMENTROOT_V = PR_CALL_GROUP_PRAPI+113, /* Call code of the pr_getdocumentroot() function */ 00239 PR_CALL_PRAPI_CONNECTRFIDCARD = PR_CALL_GROUP_PRAPI+118, /* Call code of the pr_connectrfidcard() function (Unicode version). */ 00240 PR_CALL_PRAPI_CONNECTRFIDCARDA = PR_CALL_GROUP_PRAPI+119, /* Call code of the pr_connectrfidcard() function (ASCII version). */ 00241 PR_CALL_PRAPI_DISCONNECTRFIDCARD = PR_CALL_GROUP_PRAPI+120, /* Call code of the pr_disconnectrfidcard() function (Unicode version). */ 00242 PR_CALL_PRAPI_DISCONNECTRFIDCARDA = PR_CALL_GROUP_PRAPI+121, /* Call code of the pr_disconnectrfidcard() function (ASCII version). */ 00243 PR_CALL_PRAPI_MAKECHIPAUTH = PR_CALL_GROUP_PRAPI+122, /* Call code of the pr_makechipauth() function (Unicode version). */ 00244 PR_CALL_PRAPI_MAKECHIPAUTHA = PR_CALL_GROUP_PRAPI+123, /* Call code of the pr_makechipauth() function (ASCII version). */ 00245 PR_CALL_PRAPI_MAKETERMINALAUTH = PR_CALL_GROUP_PRAPI+124, /* Call code of the pr_maketerminalauth() function (Unicode version). */ 00246 PR_CALL_PRAPI_MAKETERMINALAUTHA = PR_CALL_GROUP_PRAPI+125, /* Call code of the pr_maketerminalauth() function (ASCII version). */ 00247 PR_CALL_PRAPI_CHECKRFIDFILEHASH = PR_CALL_GROUP_PRAPI+128, /* Call code of the pr_checkrfidfilehash() function (Unicode version). */ 00248 PR_CALL_PRAPI_CHECKRFIDFILEHASHA = PR_CALL_GROUP_PRAPI+129, /* Call code of the pr_checkrfidfilehash() function (ASCII version). */ 00249 PR_CALL_PRAPI_GETIMAGE_V = PR_CALL_GROUP_PRAPI+130, /* Call code of the pr_getimage() function */ 00250 PR_CALL_PRAPI_GETDEVICEINFO = PR_CALL_GROUP_PRAPI+131, /* Call code of the pr_getdeviceinfo() function */ 00251 PR_CALL_PRAPI_GETRFIDCARDINFO = PR_CALL_GROUP_PRAPI+134, /* Call code of the pr_getrfidcardinfo() function (Unicode version). */ 00252 PR_CALL_PRAPI_GETRFIDCARDINFOA = PR_CALL_GROUP_PRAPI+135, /* Call code of the pr_getrfidcardinfo() function (ASCII version). */ 00253 PR_CALL_PRAPI_FINGERSTONIST = PR_CALL_GROUP_PRAPI+139, /* Call code of the pr_fingertonist() function */ 00254 PR_CALL_PRAPI_FINGERSTONISTA = PR_CALL_GROUP_PRAPI+140, /* Call code of the pr_fingertonista() function */ 00255 PR_CALL_PRAPI_FINGERSTONISTMEM = PR_CALL_GROUP_PRAPI+141, /* Call code of the pr_fingertonistmem() function */ 00256 PR_CALL_PRAPI_INITTERMINALAUTH = PR_CALL_GROUP_PRAPI+142, /* Call code of the pr_initta() function */ 00257 PR_CALL_PRAPI_INITTERMINALAUTHA = PR_CALL_GROUP_PRAPI+143, /* Call code of the pr_inittaa() function */ 00258 PR_CALL_PRAPI_COMPLETETERMINALAUTH = PR_CALL_GROUP_PRAPI+144, /* Call code of the pr_completeta() function */ 00259 PR_CALL_PRAPI_COMPLETETERMINALAUTHA = PR_CALL_GROUP_PRAPI+145, /* Call code of the pr_completetaa() function */ 00260 PR_CALL_PRAPI_CLEARCERTLIST = PR_CALL_GROUP_PRAPI+146, /* Call code of the pr_clearcertlist() function */ 00261 PR_CALL_PRAPI_BLINK_STATUS = PR_CALL_GROUP_PRAPI+151, /* Call code of the pr_blinkstatus() function */ 00262 PR_CALL_PRAPI_LOADCERTFROMMEM = PR_CALL_GROUP_PRAPI+152, /* Call code of the pr_loadcertfrommem() function */ 00263 PR_CALL_PRAPI_SELFTEST = PR_CALL_GROUP_PRAPI+153, /* Call code of the pr_selftest() function */ 00264 PR_CALL_PRAPI_DECODELATENTIMAGE = PR_CALL_GROUP_PRAPI+154, /* Call code of the pr_decodelatentimage() function */ 00265 PR_CALL_PRAPI_MAKEPACE = PR_CALL_GROUP_PRAPI+155, /* Call code of the pr_makepace() function */ 00266 PR_CALL_PRAPI_MAKEPACEA = PR_CALL_GROUP_PRAPI+156, /* Call code of the pr_makepacea() function */ 00267 PR_CALL_PRAPI_GETCERTIFICATEID = PR_CALL_GROUP_PRAPI+157, /* Call code of the pr_getcertificateid() function */ 00268 PR_CALL_PRAPI_GETCERTIFICATEIDA = PR_CALL_GROUP_PRAPI+158, /* Call code of the pr_getcertificateida() function */ 00269 PR_CALL_PRAPI_GETNEXTAUTHENTICATION = PR_CALL_GROUP_PRAPI+159, /* Call code of the pr_getnextauthentication() function */ 00270 PR_CALL_PRAPI_GETNEXTAUTHENTICATIONA = PR_CALL_GROUP_PRAPI+160, /* Call code of the pr_getnextauthenticationa() function */ 00271 PR_CALL_PRAPI_READMAGSTRIPE = PR_CALL_GROUP_PRAPI+163, /* Call code of the pr_readmagstripe() function */ 00272 PR_CALL_PRAPI_READMAGSTRIPEA = PR_CALL_GROUP_PRAPI+164, /* Call code of the pr_readmagstripea() function */ 00273 PR_CALL_PRAPI_LOADCERTFROMSTORE = PR_CALL_GROUP_PRAPI+165, /* Call code of the pr_loadcertfromstore() function */ 00274 PR_CALL_PRAPI_LOADCERTFROMSTOREA = PR_CALL_GROUP_PRAPI+166, /* Call code of the pr_loadcertfromstorea() function */ 00275 PR_CALL_PRAPI_RESOLVEMAGSTRIPE = PR_CALL_GROUP_PRAPI+167, /* Call code of the pr_resolvemagstripe() function */ 00276 PR_CALL_PRAPI_RESOLVEMAGSTRIPEA = PR_CALL_GROUP_PRAPI+168, /* Call code of the pr_resolvemagstripea() function */ 00277 PR_CALL_PRAPI_GETENHANCEDUV = PR_CALL_GROUP_PRAPI+169, /* Call code of the pr_getenhanceduv() function */ 00278 PR_CALL_PRAPI_DOAUTHENTICATION = PR_CALL_GROUP_PRAPI+170, /* Call code of the pr_doauthentication() function */ 00279 PR_CALL_PRAPI_DOAUTHENTICATIONA = PR_CALL_GROUP_PRAPI+171, /* Call code of the pr_doauthenticationa() function */ 00280 PR_CALL_PRAPI_SELECT_APPLICATION = PR_CALL_GROUP_PRAPI+172, /* Call code of the pr_selectapplication() function */ 00281 PR_CALL_PRAPI_SELECT_APPLICATIONA = PR_CALL_GROUP_PRAPI+173, /* Call code of the pr_selectapplicationa() function */ 00282 PR_CALL_PRAPI_GETAPPLICATIONS = PR_CALL_GROUP_PRAPI+174, /* Call code of the pr_selectapplication() function */ 00283 PR_CALL_PRAPI_GETAPPLICATIONSA = PR_CALL_GROUP_PRAPI+175, /* Call code of the pr_selectapplicationa() function */ 00284 PR_CALL_PRAPI_GETRFIDFILE_START = PR_CALL_GROUP_PRAPI+177, /* Call code of the pr_getrfidfile_start() function (Unicode version). */ 00285 PR_CALL_PRAPI_GETRFIDFILE_STARTA = PR_CALL_GROUP_PRAPI+178, /* Call code of the pr_getrfidfile_start() function (ASCII version). */ 00286 PR_CALL_PRAPI_GETRFIDFILE_GETSTATUS = PR_CALL_GROUP_PRAPI+179, /* Call code of the pr_getrfidfile_getstatus() function. */ 00287 PR_CALL_PRAPI_GETRFIDFILE_WAIT = PR_CALL_GROUP_PRAPI+180, /* Call code of the pr_getrfidfile_wait() function. */ 00288 PR_CALL_PRAPI_GETRFIDFILE_STOP = PR_CALL_GROUP_PRAPI+181, /* Call code of the pr_getrfidfile_stop() function. */ 00289 PR_CALL_PRAPI_SAVEDOCUMENTTOMEM = PR_CALL_GROUP_PRAPI+182, /* Call code of the pr_savedocumenttomem() function. */ 00290 PR_CALL_PRAPI_LOADDOCUMENTFROMMEM = PR_CALL_GROUP_PRAPI+183, /* Call code of the pr_loaddocumentfrommem() function. */ 00291 PR_CALL_PRAPI_ANALYZE = PR_CALL_GROUP_PRAPI+184, /* Call code of the pr_analyze() function */ 00292 PR_CALL_PRAPI_ANALYZED = PR_CALL_GROUP_PRAPI+185, /* Call code of the pr_analyze() function */ 00293 PR_CALL_PRAPI_GETREADERCARDLIST = PR_CALL_GROUP_PRAPI+186, /* Call code of the pr_getmagstripedatalength() function */ 00294 PR_CALL_PRAPI_GETFILELIST = PR_CALL_GROUP_PRAPI+187, /* Call code of the pr_getrfidfilelist() function */ 00295 PR_CALL_PRAPI_CLEARCERTLISTSCOPE = PR_CALL_GROUP_PRAPI+191, 00296 PR_CALL_PRAPI_LOADCERTSCOPE = PR_CALL_GROUP_PRAPI+192, 00297 PR_CALL_PRAPI_OPEN_CARDREADER = PR_CALL_GROUP_PRAPI+193, 00298 PR_CALL_PRAPI_CLOSE_CARDREADER = PR_CALL_GROUP_PRAPI+194, 00299 PR_CALL_PRAPI_CONVERTFID = PR_CALL_GROUP_PRAPI+195, /* Call code of the pr_convertfid() function (Unicode). */ 00300 PR_CALL_PRAPI_GETAUTHRESULT = PR_CALL_GROUP_PRAPI+196, /* Call code of the pr_getrfidauthresult() function (Unicode). */ 00301 PR_CALL_PRAPI_GETLICENSES = PR_CALL_GROUP_PRAPI+197, /* Call code of the pr_getlicenses() function. */ 00302 PR_CALL_PRAPI_GETLICENSEDATE = PR_CALL_GROUP_PRAPI+198, /* Call code of the pr_getlicensedate() function. */ 00303 PR_CALL_PRAPI_GETENGINEINFO = PR_CALL_GROUP_PRAPI+199, /* Call code of the pr_getengineinfo() function. */ 00304 PR_CALL_PRAPI_MERGEDOCUMENTS = PR_CALL_GROUP_PRAPI+200, /* Call code of the pr_mergedocuments() function. */ 00305 PR_CALL_PRAPI_ANALYZE_C = PR_CALL_GROUP_PRAPI+201, /* Call code of the pr_analyze() function. */ 00306 PR_CALL_PRAPI_GETDATAFORMAT = PR_CALL_GROUP_PRAPI+202, /* Call code of the pr_getdataformat() function. */ 00307 PR_CALL_PRAPI_STARTSCANNING = PR_CALL_GROUP_PRAPI+203, /* Call code of the pr_startscanning() function. */ 00308 PR_CALL_PRAPI_STARTECARDREADING = PR_CALL_GROUP_PRAPI+204, /* Call code of the pr_startreading() function. */ 00309 PR_CALL_PRAPI_SCAN = PR_CALL_GROUP_PRAPI+207, /* Call code of the pr_scan() function. */ 00310 PR_CALL_PRAPI_GETLICENSESI = PR_CALL_GROUP_PRAPI+209, /* Call code of the pr_getlicenses() function. */ 00311 PR_CALL_PRAPI_GETLICENSEDATEI = PR_CALL_GROUP_PRAPI+210, /* Call code of the pr_getlicensedate() function. */ 00312 00313 }; 00314 00315 /******************************************************************************* 00316 * module structures 00317 ******************************************************************************/ 00318 00319 /* 00320 Parameter structure for the pr_..._getstatus asynchronous functions. 00321 */ 00322 struct PR_PARM_PRAPI_GETSTATUS { 00323 int reqid; /* Id returned by the pr_..._start asynchronous function. */ 00324 int status; /* The state of the process in percent, it can be negative when the task is in 00325 preprocess state. */ 00326 }; 00327 00328 /* 00329 Parameter structure for the pr_getdevicelist() function (Unicode version). 00330 */ 00331 struct PR_PARM_PRAPI_GETDEVICELIST { 00332 wchar_t **devices; /* List of the device names. */ 00333 bool *calibrated; /* Obsolete parameter. */ 00334 int ndevices; /* Number of devices */ 00335 }; 00336 00337 /* 00338 Parameter structure for the pr_getdevicelist() function (ASCII version). 00339 */ 00340 struct PR_PARM_PRAPI_GETDEVICELISTA { 00341 char **devices; /* List of the device names. */ 00342 bool *calibrated; /* Obsolete parameter. */ 00343 int ndevices; /* Number of the devices. */ 00344 }; 00345 00346 /* 00347 Parameter structure for the pr_usedevice() function (Unicode version). 00348 */ 00349 struct PR_PARM_PRAPI_USEDEVICE { 00350 const wchar_t *device; /* Name of the device to connect to. */ 00351 int mode; /* Connection mode. The possible values are defined in the \ref PR_USAGEMODE 00352 enumeration. Generally the \ref PR_UMODE_FULL_CONTROL is recommended to use. */ 00353 }; 00354 00355 /* 00356 Parameter structure for the pr_usedevice() function (ASCII version). 00357 */ 00358 struct PR_PARM_PRAPI_USEDEVICEA { 00359 const char *device; /* Name of the device to connect to. */ 00360 int mode; /* Connection mode. The possible values are defined in the \ref PR_USAGEMODE 00361 enumeration. Generally the \ref PR_UMODE_FULL_CONTROL is recommended to use. */ 00362 }; 00363 00364 /* 00365 Parameter structure for the pr_getctrlhandle() function. 00366 */ 00367 struct PR_PARM_PRAPI_GETCONTROLLERHANDLE { 00368 gxHANDLE *handle; /* Handle for the hardware control module. */ 00369 }; 00370 00371 /* 00372 Parameter structure for the pr_calibrate() function. 00373 */ 00374 struct PR_PARM_PRAPI_CALIBRATE { 00375 int windowid; /* Id of the used window. The possible values are defined in the \ref PR_WINDOW_ID 00376 enumeration. */ 00377 }; 00378 00379 /* 00380 Parameter structure for the pr_iscalibrated() function. 00381 */ 00382 struct PR_PARM_PRAPI_ISCALIBRATED { 00383 int windowid; /* Id of the used window. The possible values are defined in the \ref PR_WINDOW_ID 00384 enumeration. */ 00385 }; 00386 00387 /* 00388 Parameter structure for the pr_setpagelight() function. 00389 */ 00390 struct PR_PARM_PRAPI_SETPAGELIGHT { 00391 int pages; /* Number of document pages to read. */ 00392 00393 /* Array of light masks where each integer represents a page. 00394 * Each lower bit of them represents a light mask bit. The upper 8 bits represent the 00395 * id of the object window. The light mask bits can be tested by the pr_getlightmask() 00396 * function. The object window ids are defined in the \ref PR_WINDOW_ID enumeration. */ 00397 unsigned int *lights; 00398 }; 00399 00400 /* 00401 Parameter structure for the pr_resetdocument() function. 00402 */ 00403 struct PR_PARM_PRAPI_RESETDOCUMENT { 00404 int lastpage; /* Reset only last page or all. */ 00405 }; 00406 00407 #endif/* GX_SWIGIF GX_MANUAL )*/ 00408 #if !defined(GX_SWIGIF) && !(defined(GX_MANUAL) && defined(GX_DOTNET)) /*(*/ 00409 00423 typedef void GXAPI PR_EVFUNC(int event,int param1,int param2,void* uparam); 00424 00427 #endif/* GX_SWIGIF GX_MANUAL GX_DOTNET )*/ 00428 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL) /*(*/ 00429 00430 /* 00431 Parameter structure for the pr_seteventfunction() function. 00432 */ 00433 struct PR_PARM_PRAPI_SETEVENTFUNCTION { 00434 PR_EVFUNC *func; /* Reference to the callback function. */ 00435 void *param; /* User parameter. */ 00436 }; 00437 00438 /* 00439 Parameter structure for the pr_testdocument() function. 00440 */ 00441 struct PR_PARM_PRAPI_TEST_DOCUMENT { 00442 int state; /* The result of the document (motion) test. */ 00443 int windowid; /* Id of the used window. The possible values are defined in the \ref PR_WINDOW_ID 00444 enumeration. */ 00445 }; 00446 00447 /* 00448 Parameter structure for the pr_capture_start() function. 00449 */ 00450 struct PR_PARM_PRAPI_CAPTURE_START { 00451 int reqid; /* Returned id for use in pr_capture_getstatus() and pr_capture_wait() 00452 functions. */ 00453 }; 00454 00455 /* 00456 Parameter structure for the pr_capture_wait() function. 00457 */ 00458 struct PR_PARM_PRAPI_CAPTURE_WAIT { 00459 int reqid; /* Id returned by the pr_capture_start() function. */ 00460 }; 00461 00462 struct PR_PARM_PRAPI_STARTSCANNING { 00463 int *lights; 00464 int nlight; 00465 int window; 00466 int position; 00467 int reqid; // output 00468 }; 00469 00470 /* 00471 Parameter structure for the pr_capture_preview() function. 00472 */ 00473 struct PR_PARM_PRAPI_CAPTURE_PREVIEW { 00474 int windowid; /* Id of the used window. The possible values are defined in the \ref PR_WINDOW_ID enumeration. */ 00475 }; 00476 00477 /* 00478 Parameter structure for the pr_getimage() function. 00479 */ 00480 struct PR_PARM_PRAPI_GETIMAGE_V { 00481 int page; /* The actual page of the image. */ 00482 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00483 int type; /* The type of the image. The possible values are defined in the \ref PR_IMAGE_TYPE 00484 enumeration. If the type is \ref PR_IT_PREVIEW the page and light parameters have no meanings. */ 00485 gxVARIANT img; /* Reference for the image. */ 00486 }; 00487 00488 /* 00489 Parameter structure for thr pr_getenhanceduv() function. 00490 */ 00491 struct PR_PARM_PRAPI_GETENHANCEDUV { 00492 int page; /* The actual page of the image. */ 00493 int imgtype; /* The type of the image. It must be \ref PR_IT_ORIGINAL. */ 00494 gxVARIANT result; /* The result uv image. */ 00495 }; 00496 00497 /* 00498 Parameter structure for the pr_saveimage() function (Unicode version). 00499 */ 00500 struct PR_PARM_PRAPI_SAVEIMAGE { 00501 int page; /* The actual page of the image. */ 00502 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00503 int type; /* The type of the image. The possible values are defined in the \ref PR_IMAGE_TYPE 00504 enumeration. If the type is \ref PR_IT_PREVIEW the page and light parameters have no meanings. */ 00505 const wchar_t *filename;/* The name of the file for saving the image. */ 00506 int filetype; /* The type of the file. The currently supported file types are defined in the file gximage.h . */ 00507 }; 00508 00509 /* 00510 Parameter structure for the pr_saveimage() function (ASCII version). 00511 */ 00512 struct PR_PARM_PRAPI_SAVEIMAGEA { 00513 int page; /* The actual page of the image. */ 00514 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00515 int type; /* The type of the image. The possible values are defined in the \ref PR_IMAGE_TYPE 00516 enumeration. If the type is \ref PR_IT_PREVIEW the page and light parameters have no meanings. */ 00517 const char *filename; /* The name of the file for saving the image. */ 00518 int filetype; /* The type of the file. The currently supported file types are defined in the file gximage.h . */ 00519 }; 00520 00521 #if defined(WIN32) && !defined(GX_DOTNET) 00522 00523 /* 00524 Parameter structure for the pr_drawimage() function. 00525 */ 00526 struct PR_PARM_PRAPI_DRAWIMAGE { 00527 int page; /* The actual page of the image. */ 00528 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00529 int type; /* The type of the image. The possible values are defined in the \ref PR_IMAGE_TYPE 00530 enumeration. If the type is \ref PR_IT_PREVIEW the page and light parameters have no meanings. */ 00531 HDC hdc; /* Handle to the device context. */ 00532 int x; /* Left side of the drawing area. */ 00533 int y; /* Upper side of the drawing area. */ 00534 int xsize; /* Horizontal size of the drawing area. */ 00535 int ysize; /* Vertical size of the drawing area. */ 00536 gxRCT *frame; /* Frame of the area of the image to display. */ 00537 }; 00538 00539 #endif/* WIN32 GX_DOTNET */ 00540 00541 /* 00542 Parameter structure for the pr_getlightnumber() function. 00543 */ 00544 struct PR_PARM_PRAPI_GETLIGHTNUMBER { 00545 int lights; /* The number of the usable lights of the device. */ 00546 }; 00547 00548 /* 00549 Parameter structure for the pr_getrfidcardlist() function (Unicode version). 00550 */ 00551 struct PR_PARM_PRAPI_GETRFIDCARDLIST { 00552 wchar_t **cards; /* List of card serial numbers. */ 00553 int ncards; /* Number of cards. */ 00554 }; 00555 00556 /* 00557 Parameter structure for the pr_getrfidcardlist() function (ASCII version). 00558 */ 00559 struct PR_PARM_PRAPI_GETRFIDCARDLISTA { 00560 char **cards; /* List of card serial numbers. */ 00561 int ncards; /* Number of cards. */ 00562 }; 00563 00564 struct PR_PARM_PRAPI_GETREADERCARDLIST { 00565 wchar_t *reader; /* Name of the selected cardreader. */ 00566 wchar_t **cards; 00567 int ncards; 00568 }; 00569 00570 struct PR_PARM_PRAPI_GETFILELIST { 00571 const wchar_t *card; /* Serial number of the selected card. */ 00572 int *files; 00573 int nfiles; 00574 }; 00575 00576 /* 00577 Parameter structure for the pr_getrfidfile() function (Unicode version). 00578 */ 00579 struct PR_PARM_PRAPI_GETRFIDFILE { 00580 const wchar_t *card; /* Serial number of the selected card. */ 00581 int fileid; /* Identifier of the requested file. */ 00582 void *data; /* File contents returned by the card. */ 00583 int sdata; /* Size of the returned data block. */ 00584 }; 00585 00586 /* 00587 Parameter structure for the pr_getrfidfile() function (ASCII version). 00588 */ 00589 struct PR_PARM_PRAPI_GETRFIDFILEA { 00590 const char *card; /* Serial number of the selected card. */ 00591 int fileid; /* Identifier of the requested file. */ 00592 void *data; /* File contents returned by the card. */ 00593 int sdata; /* Size of the returned data block. */ 00594 }; 00595 00596 /* 00597 Parameter structure for the pr_getrfidfile_start() function (Unicode version). 00598 */ 00599 struct PR_PARM_PRAPI_GETRFIDFILE_START { 00600 const wchar_t *card; /* Serial number of the selected card. */ 00601 int fileid; /* Identifier of the requested file. */ 00602 int reqid; /* Returned id for use in pr_getrfidfile_getstatus() and pr_getrfidfile_wait() 00603 functions. */ 00604 }; 00605 00606 /* 00607 Parameter structure for the pr_getrfidfile_start() function (ASCII version). 00608 */ 00609 struct PR_PARM_PRAPI_GETRFIDFILE_STARTA { 00610 const char *card; /* Serial number of the selected card. */ 00611 int fileid; /* Identifier of the requested file. */ 00612 int reqid; /* Returned id for use in pr_getrfidfile_getstatus() and pr_getrfidfile_wait() 00613 functions. */ 00614 }; 00615 00616 struct PR_PARM_PRAPI_STARTECARDREADING { 00617 const wchar_t *card; 00618 int *files; 00619 int nfile; 00620 int authlevel; 00621 int reqid; // output 00622 }; 00623 00624 /* 00625 Parameter structure for the pr_getrfidfile_wait() function. 00626 */ 00627 struct PR_PARM_PRAPI_GETRFIDFILE_WAIT { 00628 int reqid; /* Id returned by the pr_getrfidfile_start() function. */ 00629 void *data; /* File contents returned by the card. */ 00630 int sdata; /* Size of the returned data block. */ 00631 }; 00632 00633 struct PR_PARM_PRAPI_OPEN_CARDREADER { 00634 const wchar_t *devname; 00635 gxVARIANT *devinfo; 00636 }; 00637 00638 struct PR_PARM_PRAPI_CLOSE_CARDREADER { 00639 const wchar_t *devname; 00640 gxVARIANT *devinfo; 00641 }; 00642 00643 /* 00644 Parameter structure for the pr_getlightmask() function. 00645 */ 00646 struct PR_PARM_PRAPI_GETLIGHTMASK { 00647 int lightid; /* The id of the interesting light. The possible values are defined 00648 in the \ref PR_LIGHT enumeration. If this value is null the fuction returns the whole 00649 light mask of the given object window. */ 00650 int windowid; /* The id of the interesting object window. The possible values 00651 are defined in the \ref PR_WINDOW_ID enumeration. If the value is \ref PR_OW_DEFAULT (null) 00652 the fuction returns the light mask of the device. */ 00653 int lightmask; /* The result light mask. */ 00654 }; 00655 00656 /* 00657 Parameter structure for the pr_getwindownumber() function. 00658 */ 00659 struct PR_PARM_PRAPI_GETWINDOWNUMBER { 00660 int windows; /* The number of object windows of the device. */ 00661 }; 00662 00663 /* 00664 Parameter structure for the pr_getlightlist() function. 00665 */ 00666 struct PR_PARM_PRAPI_GETLIGHTLIST { 00667 int *lightbuf; /* Preallocated buffer for the lightlist items. */ 00668 int nlights; /* Size of the preallocated buffer. */ 00669 }; 00670 00671 /* 00672 Parameter structure for the pr_setstatusled() function. 00673 */ 00674 struct PR_PARM_PRAPI_SET_STATUS_LED { 00675 int ledmask; /* Mask representing the status leds. Each bit represents a status led on the device. */ 00676 int color; /* The color to display on the specified status leds. The predefined values of the lights 00677 are stored in the \ref PR_STATUS_LED_COLOR enumeration. Bit 7 represents the on/off 00678 parameter of the light so any value below 80 hex means led off.*/ 00679 }; 00680 00681 /* 00682 Parameter structure for the pr_blinkstatus() function. 00683 */ 00684 struct PR_PARM_PRAPI_BLINK_STATUS { 00685 int coding; /* Coding of the data. The possible values are: 00686 0: stop pulses, 00687 1: data[odd]: time duration output high level [ms], data[even]: time duration output low level [ms] 00688 */ 00689 int iteration; /* Number of repeat, 0 means forever. */ 00690 int mask; /* Mask representing the status leds and buzzer. Each bit represents a status led or buzzer on the device. */ 00691 int type; /* Led color id or buzzer id. Its predefined values are stored in the 00692 \ref PR_STATUS_LED_COLOR and \ref PR_BUZZER enumerations. */ 00693 unsigned int datalength;/* Length of the data, (maximum 16). */ 00694 unsigned int *data; /* Data of blinking. */ 00695 }; 00696 00697 /* 00698 Parameter structure for the pr_testpower() function. 00699 */ 00700 struct PR_PARM_PRAPI_TEST_POWER { 00701 int state; /* Device state mask. */ 00702 int level; /* Battery power level. */ 00703 }; 00704 00705 /* 00706 Parameter structure for the pr_testbutton() function. 00707 */ 00708 struct PR_PARM_PRAPI_TEST_BUTTON { 00709 int code; /* Code of the button. */ 00710 int state; /* State of the button. */ 00711 }; 00712 00713 /* 00714 Parameter structure for the pr_getbuttonevent() function. 00715 */ 00716 struct PR_PARM_PRAPI_GET_BUTTON_EVENT { 00717 int code; /* Code of the button. */ 00718 int state; /* State of the button. */ 00719 }; 00720 00721 /* 00722 Parameter structure for the pr_getapplications() function (Unicode version). 00723 */ 00724 struct PR_PARM_PRAPI_GET_APPLICATIONS { 00725 const wchar_t *card; /* Serial number of the selected card. */ 00726 int *apps; /* Array of the applications. The possible values are 00727 defined in the \ref PR_APP_TYPE enumeration. */ 00728 int napps; /* Number of items in the application array. */ 00729 }; 00730 00731 /* 00732 Parameter structure for the pr_getapplications() function (ASCII version). 00733 */ 00734 struct PR_PARM_PRAPI_GET_APPLICATIONSA { 00735 const char *card; /* Serial number of the selected card. */ 00736 int *apps; /* Array of the applications. The possible values are 00737 defined in the \ref PR_APP_TYPE enumeration. */ 00738 int napps; /* Number of items in the application array. */ 00739 }; 00740 00741 /* 00742 Parameter structure for the pr_selectapplication() function (Unicode version). 00743 */ 00744 struct PR_PARM_PRAPI_SELECT_APPLICATION { 00745 const wchar_t *card; /* Serial number of the selected card. */ 00746 int application; /* Application type. */ 00747 }; 00748 00749 /* 00750 Parameter structure for the pr_selectapplication() function (ASCII version). 00751 */ 00752 struct PR_PARM_PRAPI_SELECT_APPLICATIONA { 00753 const char *card; /* Serial number of the selected card. */ 00754 int application; /* Application type. */ 00755 }; 00756 00757 /* 00758 Parameter structure for the pr_makebac() function (Unicode version). 00759 */ 00760 struct PR_PARM_PRAPI_MAKEBAC { 00761 const wchar_t *card; /* Serial number of the selected card. */ 00762 const wchar_t **lines; /* Array of row string MRZ lines. */ 00763 int nlines; /* Number of rows. */ 00764 }; 00765 00766 /* 00767 Parameter structure for the pr_makebac() function (ASCII version). 00768 */ 00769 struct PR_PARM_PRAPI_MAKEBACA { 00770 const char *card; /* Serial number of the selected card. */ 00771 const char **lines; /* Array of row string MRZ lines. */ 00772 int nlines; /* Number of rows. */ 00773 }; 00774 00775 /* 00776 Parameter structure for the pr_makepace() function (Unicode version). 00777 */ 00778 struct PR_PARM_PRAPI_MAKEPACE { 00779 const wchar_t *card; 00780 const wchar_t **lines; 00781 int nlines; 00782 int PasswordType; 00784 }; 00785 00786 /* 00787 Parameter structure for the pr_rfid_makepace() function (ASCII version). 00788 */ 00789 struct PR_PARM_PRAPI_MAKEPACEA { 00790 const char *card; 00791 const char **lines; 00792 int nlines; 00793 int PasswordType; 00795 }; 00796 00797 00798 /* 00799 Parameter structure for the pr_loadcertfile() function (Unicode version). 00800 */ 00801 struct PR_PARM_PRAPI_LOADCERTFILE { 00802 const wchar_t *certificate; /* Name of the selected certificate file. */ 00803 const wchar_t *privateKey; /* Name of the private key file connected to the certificate. */ 00804 }; 00805 00806 /* 00807 Parameter structure for the pr_loadcertfile() function (ASCII version). 00808 */ 00809 struct PR_PARM_PRAPI_LOADCERTFILEA { 00810 const char *certificate; /* Name of the selected certificate file. */ 00811 const char *privateKey; /* Name of the private key file connected to the certificate. */ 00812 }; 00813 00814 /* 00815 Parameter structure for the pr_loadcertfromstore() function (Unicode version). 00816 */ 00817 struct PR_PARM_PRAPI_LOADCERTFROMSTORE { 00818 const wchar_t *storename; /* Name of the selected store. */ 00819 }; 00820 00821 /* 00822 Parameter structure for the pr_loadcertfromstore() function (ASCII version). 00823 */ 00824 struct PR_PARM_PRAPI_LOADCERTFROMSTOREA { 00825 const char *storename; /* Name of the selected store. */ 00826 }; 00827 00828 /* 00829 Parameter structure for the pr_loadcertfrommem() function. 00830 */ 00831 struct PR_PARM_PRAPI_LOADCERTFROMMEM{ 00832 void* certificate_data; 00833 unsigned int certificate_length; 00834 void* privateKey_data; 00835 unsigned int privateKey_length; 00836 }; 00837 00838 00839 struct PR_PARM_PRAPI_LOADCERTSCOPE { 00840 int scope; 00841 const wchar_t *owner; 00842 00843 void* certificate_data; 00844 unsigned int certificate_length; 00845 void* privateKey_data; 00846 unsigned int privateKey_length; 00847 00848 unsigned int Id; 00849 }; 00850 00851 /* 00852 Parameter structure for the pr_beginwindowmessaging() function. 00853 */ 00854 struct PR_PARM_PRAPI_BEGIN_WINDOW_MESSAGING { 00855 #if defined(WIN32) 00856 HWND hwnd; /* Window handle to send the messages to. */ 00857 UINT base_msg; /* Message id base. */ 00858 #else 00859 int rfu1; 00860 #endif 00861 }; 00862 00863 00864 /* 00865 Parameter structure for the pr_getudinfo() function. 00866 */ 00867 struct PR_PARM_PRAPI_GET_UDINFO { 00868 int nblocks; /* Number of blocks. */ 00869 int sblock; /* Size of a block. */ 00870 }; 00871 00872 /* 00873 Parameter structure for the pr_readudata() function. 00874 */ 00875 struct PR_PARM_PRAPI_READ_UD { 00876 int fblock; /* First block to read. */ 00877 int nblocks; /* Number of blocks to read. */ 00878 void *data; /* Bytes read. */ 00879 }; 00880 00881 /* 00882 Parameter structure for the pr_writeudata() function. 00883 */ 00884 struct PR_PARM_PRAPI_WRITE_UD { 00885 int fblock; /* First block to write. */ 00886 int nblocks; /* Number of blocks to write. */ 00887 const void *data; /* Bytes to write. */ 00888 }; 00889 00890 /* 00891 Parameter structure for the pr_getocr() function. 00892 */ 00893 struct PR_PARM_PRAPI_GETOCR_V { 00894 int page; /* The actual page of the image. */ 00895 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00896 int type; /* The type of the image. It must be \ref PR_IT_ORIGINAL. */ 00897 gxVARIANT doc; /* The result document structure. */ 00898 gxVARIANT params; /* OCR parameters */ 00899 }; 00900 00901 /* 00902 Parameter structure for the pr_getmrz() function. 00903 */ 00904 struct PR_PARM_PRAPI_GETMRZ_V { 00905 int page; /* The actual page of the image. */ 00906 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00907 int type; /* The type of the image. It must be \ref PR_IT_ORIGINAL. */ 00908 gxVARIANT doc; /* The result document structure. */ 00909 }; 00910 00911 /* 00912 Parameter structure for the pr_getbarcode() function. 00913 */ 00914 struct PR_PARM_PRAPI_GETBARCODE_V { 00915 int page; /* The actual page of the image. */ 00916 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00917 int type; /* The type of the image. It must be \ref PR_IT_ORIGINAL. */ 00918 int bctype; /* The needed barcode type. The possible values are defined in the \ref PR_BCTYPE 00919 enumeration. If this parameter is NULL any type of barcode can be returned. */ 00920 int index; /* The ordinal number of the barcode. If more barcodes found. */ 00921 gxVARIANT doc; /* The result document structure. */ 00922 }; 00923 00924 /* 00925 Parameter structure for the pr_getdocumentrect() function. 00926 */ 00927 struct PR_PARM_PRAPI_GETDOCUMENTRECT_V { 00928 int page; /* The actual page of the image. */ 00929 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 00930 int type; /* The type of the image. It must be \ref PR_IT_ORIGINAL. */ 00931 gxVARIANT doc; /* The result document structure. */ 00932 }; 00933 00934 /* 00935 Parameter structure for the pr_recognize() function. 00936 */ 00937 struct PR_PARM_PRAPI_RECOGNIZE_V { 00938 int page; /* The actual page of the image. */ 00939 gxVARIANT doc; /* The resulted document structure. */ 00940 }; 00941 00942 /* 00943 Parameter structure for the pr_resolvemrztext() function (Unicode version). 00944 */ 00945 struct PR_PARM_PRAPI_RESOLVEMRZTEXT_V { 00946 const wchar_t **lines; /* Array of row strings. */ 00947 int nlines; /* Number of rows. */ 00948 gxVARIANT doc; /* The resulted document structure. */ 00949 }; 00950 00951 /* 00952 Parameter structure for the pr_resolvemrztext() function (ASCII version). 00953 */ 00954 struct PR_PARM_PRAPI_RESOLVEMRZTEXTA_V { 00955 const char **lines; /* Array of row strings. */ 00956 int nlines; /* Number of rows. */ 00957 gxVARIANT doc; /* The resulted document structure. */ 00958 }; 00959 00960 /* 00961 Parameter structure for the pr_resolverfiddata() function. 00962 */ 00963 struct PR_PARM_PRAPI_RESOLVERFIDDATA_V { 00964 const void *data; /* Buffer to resolve data from. */ 00965 int sdata; /* The size of the data buffer. */ 00966 gxVARIANT doc; /* document to retrive the rfid data. */ 00967 }; 00968 00969 /* 00970 Parameter structure for the pr_getdocumentstatus() function. 00971 */ 00972 struct PR_PARM_PRAPI_GETDOCUMENTSTATUS_V { 00973 gxVARIANT doc; /* A document structure to analyse. */ 00974 int code; /* Code of the document. */ 00975 int status; /* The worst field error code in the document. The error codes are defined in 00976 \ref PR_CHKERR enumeration. */ 00977 }; 00978 00979 /* 00980 Parameter structure for the pr_getfieldfromdoc() function (Unicode version). 00981 */ 00982 struct PR_PARM_PRAPI_GETFIELDFROMDOC_V { 00983 gxVARIANT doc; /* A document structure to analyse. */ 00984 int field_code; /* The id of the needed field. The possible ids are defined in the \ref PR_DOCFIELD enumeration. */ 00985 int index; /* Ordinal number of field. */ 00986 gxVARIANT field; /* The field structure. */ 00987 }; 00988 00989 /* 00990 Parameter structure for the pr_getfieldimage() function. 00991 */ 00992 struct PR_PARM_PRAPI_GETFIELDIMAGE_V { 00993 gxVARIANT doc; /* A document structure to analyse. */ 00994 int field_code; /* The id of the needed field. The possible ids are defined in the \ref PR_DOCFIELD enumeration. */ 00995 int index; /* Ordinal number of field. */ 00996 gxVARIANT img; /* The image of the field. */ 00997 }; 00998 00999 /* 01000 Parameter structure for the pr_compareface() function. 01001 */ 01002 struct PR_PARM_PRAPI_COMPARE_FACE_V { 01003 int page; /* The actual page of the image. */ 01004 int face_no; /* The ordinal number of the face image in rfid data. */ 01005 gxVARIANT doc; /* The result document structure. */ 01006 }; 01007 01008 /* 01009 Parameter structure for the pr_savedocument() function (Unicode version). 01010 */ 01011 struct PR_PARM_PRAPI_SAVEDOCUMENT_V { 01012 gxVARIANT doc; /* Document to save. */ 01013 const wchar_t *filename;/* Name of the file. */ 01014 int filetype; /* Type of the file ( see \ref PR_DOCFILEFORMATS ). */ 01015 }; 01016 01017 /* 01018 Parameter structure for the pr_savedocumenta() function (ASCII version). 01019 */ 01020 struct PR_PARM_PRAPI_SAVEDOCUMENTA_V { 01021 gxVARIANT doc; /* Document to save. */ 01022 const char *filename; /* Name of the file. */ 01023 int filetype; /* Type of the file ( see \ref PR_DOCFILEFORMATS ). */ 01024 }; 01025 01026 /* 01027 Parameter structure for the pr_loaddocument() function (Unicode version). 01028 */ 01029 struct PR_PARM_PRAPI_LOADDOCUMENT_V { 01030 const wchar_t *filename;/* Name of the file to load the document from. */ 01031 gxVARIANT doc; /* Pointer to a document for returning the loaded document. */ 01032 }; 01033 01034 /* 01035 Parameter structure for the pr_loaddocumenta() function (ASCII version). 01036 */ 01037 struct PR_PARM_PRAPI_LOADDOCUMENTA_V { 01038 const char *filename; /* Name of the file to load the document from. */ 01039 gxVARIANT doc; /* Pointer to a document to return the loaded document. */ 01040 }; 01041 01042 /* 01043 Parameter structure for the pr_getdocumentroot() function. 01044 */ 01045 struct PR_PARM_PRAPI_GETDOCUMENTROOT_V { 01046 gxVARIANT doc; /* Pointer to a document for returning the requested document. */ 01047 }; 01048 01049 /* 01050 Parameter structure for the pr_mergedocuments() function. 01051 */ 01052 struct PR_PARM_PRAPI_MERGEDOCUMENTS { 01053 gxVARIANT doc1; 01054 gxVARIANT ndoc; 01055 int relation; 01056 }; 01057 01058 /* 01059 Parameter structure for the 01060 pr_connectrfidcard(), pr_disconnectrfidcard(), 01061 pr_makepassiveauth(), pr_makeactiveauth(), 01062 pr_makechipauth() and pr_maketerminalauth() 01063 functions (Unicode version). 01064 */ 01065 struct PR_PARM_PRAPI_RFIDCARD { 01066 const wchar_t *card; /* Serial number of the selected card. */ 01067 }; 01068 01069 /* 01070 Parameter structure for the 01071 pr_connectrfidcard(), pr_disconnectrfidcard(), 01072 pr_makepassiveauth(), pr_makeactiveauth(), 01073 pr_makechipauth() and pr_maketerminalauth() 01074 functions (ASCII version). 01075 */ 01076 struct PR_PARM_PRAPI_RFIDCARDA { 01077 const char *card; /* Serial number of the selected card. */ 01078 }; 01079 01080 /* 01081 Parameter structure for the pr_initta() and pr_completeta() functions (Unicode version). 01082 */ 01083 struct PR_PARM_PRAPI_TA { 01084 const wchar_t *card; 01085 void *data; 01086 int sdata; 01087 }; 01088 01089 /* 01090 Parameter structure for the pr_initta() and pr_completeta() functions (ASCII version). 01091 */ 01092 struct PR_PARM_PRAPI_TAA { 01093 const char *card; 01094 void *data; 01095 int sdata; 01096 }; 01097 01098 /* 01099 Parameter structure for the pr_checkrfidfilehash() function (Unicode version). 01100 */ 01101 struct PR_PARM_PRAPI_CHECKRFIDFILEHASH { 01102 const wchar_t *card; /* Serial number of the selected card. */ 01103 int fileid; /* Identifier of the requested file. */ 01104 }; 01105 01106 /* 01107 Parameter structure for the pr_checkrfidfilehash() function (ASCII version). 01108 */ 01109 struct PR_PARM_PRAPI_CHECKRFIDFILEHASHA { 01110 const char *card; /* Serial number of the selected card. */ 01111 int fileid; /* Identifier of the requested file. */ 01112 }; 01113 01114 /* 01115 Parameter structure for the pr_getdeviceinfo() function. 01116 */ 01117 struct PR_PARM_PRAPI_GETDEVICEINFO { 01118 gxVARIANT devinfo; /* Device info. */ 01119 }; 01120 01121 /* 01122 Parameter structure for the pr_getrfidcardinfo() function (Unicode version). 01123 */ 01124 struct PR_PARM_PRAPI_GETRFIDCARDINFO { 01125 const wchar_t *card; 01126 gxVARIANT cardinfo; 01127 }; 01128 01129 /* 01130 Parameter structure for the pr_getrfidcardinfo() function (ASCII version). 01131 */ 01132 struct PR_PARM_PRAPI_GETRFIDCARDINFOA { 01133 const char *card; 01134 gxVARIANT cardinfo; 01135 }; 01136 01137 /* 01138 Parameter structure for the pr_fingertonist() function. 01139 */ 01140 struct PR_PARM_PRAPI_FINGERSTONIST { 01141 const wchar_t *filename; /* The name of the file for saving the data. */ 01142 gxVARIANT fields; /* List of fields to add to the record. */ 01143 }; 01144 01145 /* 01146 Parameter structure for the pr_fingertonista() function. 01147 */ 01148 struct PR_PARM_PRAPI_FINGERSTONISTA { 01149 const char *filename; /* The name of the file for saving the data. */ 01150 gxVARIANT fields; /* List of fields to add to the record. */ 01151 }; 01152 01153 /* 01154 Parameter structure for the pr_fingertonistmem() function. 01155 */ 01156 struct PR_PARM_PRAPI_FINGERSTONISTMEM { 01157 void **buffer; /* Pointer to a memory area pointer. */ 01158 gxi32 *buflen; /* Size of memory area. */ 01159 gxVARIANT fields; /* List of fields to add to the record. */ 01160 }; 01161 01162 /* 01163 Parameter structure for the pr_clearcertlist() function. 01164 */ 01165 struct PR_PARM_PRAPI_CLEARCERTLIST { 01166 int sel; /* List selector. */ 01167 }; 01168 01169 struct PR_PARM_PRAPI_CLEARCERTLISTSCOPE { 01170 gxi32 sel; 01171 int scope; 01172 const wchar_t *owner; 01173 }; 01174 01175 /* 01176 Parameter structure for the pr_selftest() function. 01177 */ 01178 struct PR_PARM_PRAPI_SELFTEST { 01179 int condition; /* Test control condition that declares the type of object which is placed on the document window. */ 01180 gxVARIANT result; /* A list of partial test results. */ 01181 }; 01182 01183 /* 01184 Decodes a latent image from a stored image. 01185 */ 01186 struct PR_PARM_PRAPI_DECODELATENTIMAGE { 01187 int page; /* The actual page of the image. */ 01188 int light; /* The light settings. The possible values are defined in the \ref PR_LIGHT enumeration. */ 01189 int type; /* The type of the image. It must be \ref PR_IT_ORIGINAL. */ 01190 const wchar_t *decpar; /* Decoding parameter. */ 01191 gxVARIANT image; /* The latent image. */ 01192 }; 01193 01194 /* 01195 Parameter structure for the pr_getcertificateida() function. 01196 */ 01197 struct PR_PARM_PRAPI_GETCERTIFICATEIDA { 01198 const char *card; 01199 int Authentication; 01200 gxVARIANT CertId; 01201 }; 01202 01203 /* 01204 Parameter structure for the pr_getcertificateid() function. 01205 */ 01206 struct PR_PARM_PRAPI_GETCERTIFICATEID { 01207 const wchar_t *card; 01208 int Authentication; 01209 gxVARIANT CertId; 01210 }; 01211 01212 /* 01213 Parameter structure for the pr_getnextauthentication() function. 01214 */ 01215 struct PR_PARM_PRAPI_GETNEXTAUTHENTICATIONA { 01216 const char *card; 01217 int ProcessName; 01218 int ForceNext; 01219 }; 01220 01221 /* 01222 Parameter structure for the pr_getnextauthentication() function. 01223 */ 01224 struct PR_PARM_PRAPI_GETNEXTAUTHENTICATION { 01225 const wchar_t *card; 01226 int ProcessName; 01227 int ForceNext; 01228 }; 01229 01230 /* 01231 Parameter structure for the pr_doauthentication() function. 01232 */ 01233 struct PR_PARM_PRAPI_DOAUTHENTICATIONA { 01234 const char *card; 01235 int ProcessName; 01236 const char **AuthData; 01237 int Lines; 01238 int PasswordType; 01239 }; 01240 01241 /* 01242 Parameter structure for the pr_doauthentication() function. 01243 */ 01244 struct PR_PARM_PRAPI_DOAUTHENTICATION { 01245 const wchar_t *card; 01246 int ProcessName; 01247 const wchar_t **AuthData; 01248 int Lines; 01249 int PasswordType; 01250 }; 01251 01252 /* 01253 Parameter structure for the pr_readmagstripe() function. 01254 */ 01255 struct PR_PARM_PRAPI_READMAGSTRIPE { 01256 wchar_t **tracks; /* List of data tracks. */ 01257 int ntracks; /* Number of tracks. */ 01258 }; 01259 01260 /* 01261 Parameter structure for the pr_readmagstripea() function. 01262 */ 01263 struct PR_PARM_PRAPI_READMAGSTRIPEA { 01264 char **tracks; /* List of data tracks. */ 01265 int ntracks; /* Number of tracks. */ 01266 }; 01267 01268 /* 01269 Parameter structure for the pr_resolvemagstripe() function. 01270 */ 01271 struct PR_PARM_PRAPI_RESOLVEMAGSTRIPE { 01272 const wchar_t **tracks; /* List of data tracks. */ 01273 int ntracks; /* Number of tracks. */ 01274 gxVARIANT doc; /* The result document structure. */ 01275 }; 01276 01277 /* 01278 Parameter structure for the pr_resolvemagstripea() function. 01279 */ 01280 struct PR_PARM_PRAPI_RESOLVEMAGSTRIPEA { 01281 const char **tracks; /* List of data tracks. */ 01282 int ntracks; /* Number of tracks. */ 01283 gxVARIANT doc; /* The result document structure. */ 01284 }; 01285 01286 /* 01287 Parameter structure for the pr_savedocumenttomem() function. 01288 */ 01289 struct PR_PARM_PRAPI_SAVEDOCUMENTTOMEM { 01290 gxVARIANT doc; /* Document to save. */ 01291 int filetype; /* Type of the data ( see \ref PR_DOCFILEFORMATS ). */ 01292 gxu8 **buffer; /* Pointer to memory area pointer. */ 01293 int *buflen; /* Size of memory area. */ 01294 }; 01295 01296 /* 01297 Parameter structure for the pr_loaddocumentfrommem() function. 01298 */ 01299 struct PR_PARM_PRAPI_LOADDOCUMENTFROMMEM { 01300 gxVARIANT doc; /* Document to save. */ 01301 const gxu8 *buffer; /* Pointer to memory area. */ 01302 int buflen; /* Size of memory area. */ 01303 }; 01304 01305 /* 01306 Parameter structure for the pr_analyze() function. 01307 */ 01308 struct PR_PARM_PRAPI_ANALYZE { 01309 gxVARIANT page; /* Input image list. */ 01310 int tasklen; /* Number of item in the tasklist. */ 01311 int *task; /* The tasklist */ 01312 gxVARIANT doc; /* The resulted document structure. */ 01313 }; 01314 01315 /* 01316 Parameter structure for the pr_analyze() function. 01317 */ 01318 struct PR_PARM_PRAPI_ANALYZED { 01319 gxu8 *buffer; /* Input buffer. */ 01320 int buflen; /* Number of bytes in the buffer. */ 01321 gxVARIANT doc; /* The resulted document structure. */ 01322 }; 01323 01324 /* 01325 Parameter structure for the pr_analyze() function. 01326 */ 01327 struct PR_PARM_PRAPI_ANALYZE_C { 01328 gxu8 *buffer; /* Input buffer. */ 01329 int buflen; /* Number of bytes in the buffer. */ 01330 gxVARIANT doc; /* The resulted document structure. */ 01331 const wchar_t *comment; /* Comment string */ 01332 }; 01333 01334 /* 01335 Parameter structure for the pr_convertfid() function (Unicode). 01336 */ 01337 struct PR_PARM_PRAPI_CONVERTFID { 01338 const wchar_t *card; 01339 int fid; 01340 }; 01341 01342 /* 01343 Parameter structure for the pr_getrfidauthresult() function (Unicode). 01344 */ 01345 struct PR_PARM_PRAPI_GETAUTHRESULT { 01346 const wchar_t *card; 01347 gxVARIANT doc; 01348 }; 01349 01350 /* 01351 Parameter structure for the pr_getlicenses() function. 01352 */ 01353 struct PR_PARM_PRAPI_GETLICENSES { 01354 int *licenses; 01355 int nlicenses; 01356 }; 01357 01358 /* 01359 Parameter structure for the pr_getlicensedate() function. 01360 */ 01361 struct PR_PARM_PRAPI_GETLICENSEDATE { 01362 int license; 01363 wchar_t *date; 01364 }; 01365 01366 /* 01367 Parameter structure for the pr_getengineinfo() function. 01368 */ 01369 struct PR_PARM_PRAPI_GETENGINEINFO { 01370 gxVARIANT info; 01371 }; 01372 01373 /* 01374 Parameter structure for the pr_getdataformat() function. 01375 */ 01376 struct PR_PARM_PRAPI_GETDATAFORMAT { 01377 const gxu8 *buffer; 01378 int buflen; 01379 wchar_t *format; 01380 int formatlen; 01381 }; 01382 01383 #endif/* GX_SWIGIF GX_MANUAL )*/ 01384 01385 /******************************************************************************* 01386 * functions 01387 ******************************************************************************/ 01388 01389 #if !defined(NO_GX_FUNCTIONS) && !defined(GX_SWIGIF) /*(*/ 01390 01406 inline int pr_getdevicelist(gxHANDLE handle,wchar_t ***devices,int *ndevices) { 01407 struct PR_PARM_PRAPI_GETDEVICELIST gdl; 01408 int ret; 01409 assert(devices && ndevices); 01410 ret = gx_call(handle, PR_CALL_PRAPI_GETDEVICELIST, &gdl); 01411 *devices = gdl.devices; 01412 *ndevices = gdl.ndevices; 01413 return ret; 01414 } 01415 01427 inline int pr_getdevicelista(gxHANDLE handle,char ***devices,int *ndevices) { 01428 struct PR_PARM_PRAPI_GETDEVICELISTA gdl; 01429 int ret; 01430 assert(devices && ndevices); 01431 ret = gx_call(handle, PR_CALL_PRAPI_GETDEVICELISTA, &gdl); 01432 *devices = gdl.devices; 01433 *ndevices = gdl.ndevices; 01434 return ret; 01435 } 01436 01437 #ifdef __cplusplus 01438 01449 inline int pr_getdevicelist(gxHANDLE handle,char ***devices,int *ndevices) { 01450 return pr_getdevicelista(handle,devices,ndevices); 01451 } 01452 #endif 01453 01463 inline int pr_usedevice(gxHANDLE handle,const wchar_t *device,int mode) { 01464 struct PR_PARM_PRAPI_USEDEVICE ud; 01465 assert(device); 01466 ud.device = device; 01467 ud.mode = mode; 01468 return gx_call(handle, PR_CALL_PRAPI_USEDEVICE, &ud); 01469 } 01470 01480 inline int pr_usedevicea(gxHANDLE handle,const char *device,int mode) { 01481 struct PR_PARM_PRAPI_USEDEVICEA ud; 01482 assert(device); 01483 ud.device = device; 01484 ud.mode = mode; 01485 return gx_call(handle, PR_CALL_PRAPI_USEDEVICEA, &ud); 01486 } 01487 01496 inline int pr_usedevicen(gxHANDLE handle,int devno,int mode) { 01497 char **devlist; 01498 int ndev,ret; 01499 assert(devno>=0); 01500 01501 if(!pr_getdevicelista(handle,&devlist,&ndev))return 0; 01502 if(ndev<=devno){ 01503 if(ndev)gx_globalfree(devlist); 01504 gx_seterror(_GX_ENOENT,L"No device found"); 01505 return false; 01506 } 01507 01508 ret=pr_usedevicea(handle,devlist[devno],mode); 01509 gx_globalfree(devlist); 01510 return ret; 01511 } 01512 01513 #ifdef __cplusplus 01514 01524 inline int pr_usedevice(gxHANDLE handle,const char *device,int mode) { 01525 return pr_usedevicea(handle,device,mode); 01526 } 01527 01536 inline int pr_usedevice(gxHANDLE handle,int devno,int mode) { 01537 return pr_usedevicen(handle,devno,mode); 01538 } 01539 #endif 01540 01546 inline int pr_closedevice(gxHANDLE handle) { 01547 struct PR_PARM_PRAPI_USEDEVICEA ud; 01548 ud.device = 0; 01549 ud.mode=_PR_UMODE_DISCONNECT; 01550 return gx_call(handle, PR_CALL_PRAPI_USEDEVICEA, &ud); 01551 } 01552 01562 inline int pr_getctrlhandle(gxHANDLE handle,gxHANDLE **hctrl) { 01563 struct PR_PARM_PRAPI_GETCONTROLLERHANDLE gch; 01564 int ret; 01565 assert(hctrl); 01566 ret = gx_call(handle, PR_CALL_PRAPI_GETCONTROLLERHANDLE, &gch); 01567 *hctrl=gch.handle; 01568 return ret; 01569 } 01570 01582 inline int pr_calibrate(gxHANDLE handle,int windowid GX_DEFARG(0)) { 01583 struct PR_PARM_PRAPI_CALIBRATE cal; 01584 cal.windowid = windowid; 01585 return gx_call(handle, PR_CALL_PRAPI_CALIBRATE, &cal); 01586 } 01587 01596 inline int pr_iscalibrated(gxHANDLE handle,int windowid GX_DEFARG(0)) { 01597 struct PR_PARM_PRAPI_ISCALIBRATED cal; 01598 cal.windowid = windowid; 01599 return gx_call(handle, PR_CALL_PRAPI_ISCALIBRATED, &cal); 01600 } 01601 01616 inline int pr_testdocument(gxHANDLE handle,int *state,int windowid GX_DEFARG(0)) { 01617 struct PR_PARM_PRAPI_TEST_DOCUMENT td; 01618 int ret; 01619 assert(state); 01620 td.windowid = windowid; 01621 ret = gx_call(handle, PR_CALL_PRAPI_TEST_DOCUMENT, &td); 01622 if(state)*state = td.state; 01623 return ret; 01624 } 01625 01632 inline int pr_getlightnumber(gxHANDLE handle,int *lights) { 01633 struct PR_PARM_PRAPI_GETLIGHTNUMBER li; 01634 int ret; 01635 assert(lights); 01636 ret = gx_call(handle, PR_CALL_PRAPI_GETLIGHTNUMBER, &li); 01637 if(lights) *lights = li.lights; 01638 return ret; 01639 } 01640 01657 inline int pr_getlightmask(gxHANDLE handle,int *lightmask,int lightid,int windowid) { 01658 struct PR_PARM_PRAPI_GETLIGHTMASK ll; 01659 int ret; 01660 assert(lightmask); 01661 ll.lightid = lightid; 01662 ll.windowid = windowid; 01663 ret = gx_call(handle, PR_CALL_PRAPI_GETLIGHTMASK, &ll); 01664 if(lightmask) *lightmask = ll.lightmask; 01665 return ret; 01666 } 01667 01675 inline int pr_getlightlist(gxHANDLE handle,int *lightbuf,int nlights) { 01676 struct PR_PARM_PRAPI_GETLIGHTLIST ll; 01677 assert(lightbuf); 01678 ll.lightbuf = lightbuf; 01679 ll.nlights = nlights; 01680 return gx_call(handle, PR_CALL_PRAPI_GETLIGHTLIST, &ll); 01681 } 01682 01689 inline int pr_getwindownumber(gxHANDLE handle,int *windows) { 01690 struct PR_PARM_PRAPI_GETWINDOWNUMBER wi; 01691 int ret; 01692 assert(windows); 01693 ret = gx_call(handle, PR_CALL_PRAPI_GETWINDOWNUMBER, &wi); 01694 if(windows) *windows = wi.windows; 01695 return ret; 01696 } 01697 01707 inline int pr_setstatusled(gxHANDLE handle, int ledmask, int color) { 01708 struct PR_PARM_PRAPI_SET_STATUS_LED led; 01709 led.ledmask = ledmask; 01710 led.color = color; 01711 return gx_call(handle, PR_CALL_PRAPI_SET_STATUS_LED, &led); 01712 } 01713 01728 inline int pr_blinkstatus(gxHANDLE handle, int coding, int mask, int type, int iteration, unsigned int *data, unsigned int datalength) { 01729 01730 struct PR_PARM_PRAPI_BLINK_STATUS out_data; 01731 01732 out_data.coding = coding; 01733 out_data.mask = mask; 01734 out_data.type = type; 01735 out_data.iteration = iteration; 01736 out_data.data = data; 01737 out_data.datalength = datalength; 01738 01739 return gx_call(handle, PR_CALL_PRAPI_BLINK_STATUS, &out_data); 01740 } 01741 01750 inline int pr_testpower(gxHANDLE handle, int *state, int *level) { 01751 struct PR_PARM_PRAPI_TEST_POWER tp; 01752 int ret; 01753 assert(state); 01754 ret = gx_call(handle, PR_CALL_PRAPI_TEST_POWER, &tp); 01755 if(state)*state = tp.state; 01756 if(level)*level = tp.level; 01757 return ret; 01758 } 01759 01767 inline int pr_testbutton(gxHANDLE handle, int keycode, int *state) { 01768 struct PR_PARM_PRAPI_TEST_BUTTON bt; 01769 int ret; 01770 assert(state); 01771 bt.code = keycode; 01772 ret = gx_call(handle, PR_CALL_PRAPI_TEST_BUTTON, &bt); 01773 if(state)*state = bt.state; 01774 return ret; 01775 } 01776 01784 inline int pr_getbuttonevent(gxHANDLE handle, int *keycode, int *state) { 01785 struct PR_PARM_PRAPI_GET_BUTTON_EVENT bt; 01786 int ret; 01787 assert(state); 01788 assert(keycode); 01789 ret = gx_call(handle, PR_CALL_PRAPI_GET_BUTTON_EVENT, &bt); 01790 if(state)*state = bt.state; 01791 if(keycode)*keycode = bt.code; 01792 return ret; 01793 } 01794 01805 inline int pr_suspend(gxHANDLE handle) { 01806 return gx_call(handle,PR_CALL_PRAPI_SUSPEND,0); 01807 } 01808 01815 inline int pr_wakeup(gxHANDLE handle) { 01816 return gx_call(handle,PR_CALL_PRAPI_WAKEUP,0); 01817 } 01818 01827 inline int pr_getudinfo(gxHANDLE handle, int *nblocks, int *sblock) { 01828 struct PR_PARM_PRAPI_GET_UDINFO gi; 01829 int ret; 01830 assert(nblocks); 01831 assert(sblock); 01832 ret = gx_call(handle, PR_CALL_PRAPI_GET_UDINFO, &gi); 01833 if(nblocks)*nblocks = gi.nblocks; 01834 if(sblock)*sblock = gi.sblock; 01835 return ret; 01836 } 01837 01850 inline int pr_readudata(gxHANDLE handle, int fblock, int nblocks, void **data) { 01851 struct PR_PARM_PRAPI_READ_UD ru; 01852 int ret; 01853 assert(data); 01854 ru.fblock = fblock; 01855 ru.nblocks = nblocks; 01856 ret = gx_call(handle, PR_CALL_PRAPI_READ_UD, &ru); 01857 if(data)*data = ru.data; 01858 return ret; 01859 } 01860 01870 inline int pr_writeudata(gxHANDLE handle, int fblock, int nblocks, const void *data) { 01871 struct PR_PARM_PRAPI_WRITE_UD wu; 01872 wu.fblock = fblock; 01873 wu.nblocks = nblocks; 01874 wu.data = data; 01875 return gx_call(handle, PR_CALL_PRAPI_WRITE_UD, &wu); 01876 } 01877 01885 inline int pr_getdeviceinfo(gxHANDLE handle, gxVARIANT *devinfo) { 01886 struct PR_PARM_PRAPI_GETDEVICEINFO gdi; 01887 int ret; 01888 assert(devinfo); 01889 ret = gx_call(handle, PR_CALL_PRAPI_GETDEVICEINFO, &gdi); 01890 if(ret && devinfo)*devinfo = gdi.devinfo; 01891 return ret; 01892 } 01893 01903 inline int pr_selftest(gxHANDLE handle, int condition, gxVARIANT *result) 01904 { 01905 struct PR_PARM_PRAPI_SELFTEST self_test; 01906 int ret; 01907 assert(result); 01908 self_test.condition = condition; 01909 ret = gx_call(handle, PR_CALL_PRAPI_SELFTEST, &self_test); 01910 *result = self_test.result; 01911 return ret; 01912 } 01913 01924 inline int pr_readmagstripe(gxHANDLE handle, wchar_t ***tracks, int *ntracks) 01925 { 01926 struct PR_PARM_PRAPI_READMAGSTRIPE gms; 01927 int ret; 01928 assert(tracks && ntracks); 01929 ret = gx_call(handle, PR_CALL_PRAPI_READMAGSTRIPE, &gms); 01930 if(ret) { 01931 *tracks = gms.tracks; 01932 *ntracks = gms.ntracks; 01933 } 01934 return ret; 01935 } 01936 01947 inline int pr_readmagstripea(gxHANDLE handle, char ***tracks, int *ntracks) 01948 { 01949 struct PR_PARM_PRAPI_READMAGSTRIPEA gms; 01950 int ret; 01951 assert(tracks && ntracks); 01952 ret = gx_call(handle, PR_CALL_PRAPI_READMAGSTRIPEA, &gms); 01953 if(ret) { 01954 *tracks = gms.tracks; 01955 *ntracks = gms.ntracks; 01956 } 01957 return ret; 01958 } 01959 01960 #ifdef __cplusplus 01961 01971 inline int pr_readmagstripe(gxHANDLE handle, char ***tracks, int *ntracks) { 01972 return pr_readmagstripea(handle, tracks, ntracks); 01973 } 01974 #endif 01975 01986 inline int pr_getlicenses(gxHANDLE handle, int **licenses, int *nlicenses) 01987 { 01988 struct PR_PARM_PRAPI_GETLICENSES gl; 01989 if(!gx_call(handle, PR_CALL_PRAPI_GETLICENSES, &gl)) return false; 01990 if(licenses) *licenses = gl.licenses; 01991 if(nlicenses) *nlicenses = gl.nlicenses; 01992 return true; 01993 } 01994 02005 inline int pr_getlicensedate(gxHANDLE handle, int license, wchar_t **date) 02006 { 02007 struct PR_PARM_PRAPI_GETLICENSEDATE gld; 02008 gld.license = license; 02009 if(!gx_call(handle, PR_CALL_PRAPI_GETLICENSEDATE, &gld)) return false; 02010 if(date) *date = gld.date; 02011 else gx_globalfree(date); 02012 return true; 02013 } 02014 02021 inline int pr_getengineinfo(gxHANDLE handle, gxVARIANT *info) 02022 { 02023 struct PR_PARM_PRAPI_GETENGINEINFO gei; 02024 if(!gx_call(handle, PR_CALL_PRAPI_GETENGINEINFO, &gei)) return false; 02025 if(info) *info = gei.info; 02026 return true; 02027 }; 02028 02041 inline int pr_seteventfunction(gxHANDLE handle, PR_EVFUNC *eventhandler, void *param) { 02042 struct PR_PARM_PRAPI_SETEVENTFUNCTION sef; 02043 sef.func = eventhandler; 02044 sef.param = param; 02045 return gx_call(handle, PR_CALL_PRAPI_SETEVENTFUNCTION, &sef); 02046 } 02047 02048 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_SWIG) 02049 02067 inline int pr_beginwindowmessaging(gxHANDLE handle, HWND hwnd, UINT base_msg GX_DEFARG(WM_USER)) { 02068 struct PR_PARM_PRAPI_BEGIN_WINDOW_MESSAGING bwm; 02069 bwm.hwnd = hwnd; 02070 bwm.base_msg = base_msg; 02071 return gx_call(handle,PR_CALL_PRAPI_BEGIN_WINDOW_MESSAGING,&bwm); 02072 } 02073 02083 inline int pr_endwindowmessaging(gxHANDLE handle) { 02084 return gx_call(handle,PR_CALL_PRAPI_END_WINDOW_MESSAGING,0); 02085 } 02086 02087 #endif/* WIN32 GX_SWIG */ 02088 02089 #if (defined(LINUX) || defined(GX_MANUAL)) && !defined(GX_SWIG) 02090 02101 inline int pr_startbgprocesses(gxHANDLE handle) { 02102 struct PR_PARM_PRAPI_BEGIN_WINDOW_MESSAGING bwm; 02103 return gx_call(handle,PR_CALL_PRAPI_BEGIN_WINDOW_MESSAGING,&bwm); 02104 } 02105 02114 inline int pr_stopbgprocesses(gxHANDLE handle) { 02115 return gx_call(handle,PR_CALL_PRAPI_END_WINDOW_MESSAGING,0); 02116 } 02117 02118 #endif/* LINUX GX_SWIG */ 02119 02129 inline int pr_getdataformat(gxHANDLE handle, const gxu8 *databuf, int buflen, 02130 wchar_t *format, int fmtlen) 02131 { 02132 struct PR_PARM_PRAPI_GETDATAFORMAT gdf; 02133 gdf.buffer = databuf; 02134 gdf.buflen = buflen; 02135 gdf.format = format; 02136 gdf.formatlen = fmtlen; 02137 return gx_call(handle, PR_CALL_PRAPI_GETDATAFORMAT, &gdf); 02138 } 02139 02156 inline int pr_setpagelight(gxHANDLE handle,int pages,unsigned int *lights) { 02157 struct PR_PARM_PRAPI_SETPAGELIGHT spl; 02158 spl.pages = pages; 02159 spl.lights = lights; 02160 return gx_call(handle, PR_CALL_PRAPI_SETPAGELIGHT, &spl); 02161 } 02162 02173 inline int pr_capture(gxHANDLE handle) { 02174 return gx_call(handle, PR_CALL_PRAPI_CAPTURE, 0); 02175 } 02176 02186 inline int pr_capture_start(gxHANDLE handle,int *reqid) { 02187 struct PR_PARM_PRAPI_CAPTURE_START cap; 02188 int ret; 02189 assert(reqid); 02190 ret = gx_call(handle, PR_CALL_PRAPI_CAPTURE_START, &cap); 02191 if(reqid) *reqid = cap.reqid; 02192 return ret; 02193 } 02194 02204 inline int pr_capture_getstatus(gxHANDLE handle,int reqid,int *status) { 02205 struct PR_PARM_PRAPI_GETSTATUS stat; 02206 int ret; 02207 assert(status); 02208 stat.reqid = reqid; 02209 ret = gx_call(handle, PR_CALL_PRAPI_CAPTURE_GETSTATUS, &stat); 02210 if(status) *status = stat.status; 02211 return ret; 02212 } 02213 02222 inline int pr_capture_wait(gxHANDLE handle,int reqid) { 02223 struct PR_PARM_PRAPI_CAPTURE_WAIT cap; 02224 cap.reqid = reqid; 02225 return gx_call(handle, PR_CALL_PRAPI_CAPTURE_WAIT, &cap); 02226 } 02227 02238 inline int pr_capture_preview(gxHANDLE handle,int windowid GX_DEFARG(0)) { 02239 struct PR_PARM_PRAPI_CAPTURE_PREVIEW cap; 02240 cap.windowid = windowid; 02241 return gx_call(handle, PR_CALL_PRAPI_CAPTURE_PREVIEW, &cap); 02242 } 02243 02262 inline int pr_getimage(gxHANDLE handle,int page,int light,int type,gxVARIANT *img) { 02263 struct PR_PARM_PRAPI_GETIMAGE_V gi; 02264 int ret; 02265 assert(img); 02266 gi.page = page; 02267 gi.light = light; 02268 gi.type = type; 02269 ret = gx_call(handle, PR_CALL_PRAPI_GETIMAGE_V, &gi); 02270 *img = gi.img; 02271 return ret; 02272 } 02273 02282 inline int pr_getenhanceduv(gxHANDLE handle, int page, int imagetype, gxVARIANT *img) 02283 { 02284 struct PR_PARM_PRAPI_GETENHANCEDUV euv; 02285 int ret; 02286 assert(img); 02287 euv.page = page; 02288 euv.imgtype = imagetype; 02289 ret = gx_call(handle, PR_CALL_PRAPI_GETENHANCEDUV, &euv); 02290 *img = euv.result; 02291 return ret; 02292 } 02293 02307 inline int pr_saveimage(gxHANDLE handle,int page,int light,int type,const wchar_t *filename,int filetype) { 02308 struct PR_PARM_PRAPI_SAVEIMAGE si; 02309 si.page = page; 02310 si.light = light; 02311 si.type = type; 02312 si.filename = filename; 02313 si.filetype = filetype; 02314 return gx_call(handle, PR_CALL_PRAPI_SAVEIMAGE, &si); 02315 } 02316 02331 inline int pr_saveimagea(gxHANDLE handle,int page,int light,int type,const char *filename,int filetype) { 02332 struct PR_PARM_PRAPI_SAVEIMAGEA si; 02333 si.page = page; 02334 si.light = light; 02335 si.type = type; 02336 si.filename = filename; 02337 si.filetype = filetype; 02338 return gx_call(handle, PR_CALL_PRAPI_SAVEIMAGEA, &si); 02339 } 02340 02341 #ifdef __cplusplus 02342 02356 inline int pr_saveimage(gxHANDLE handle,int page,int light,int type,const char *filename,int filetype) { 02357 return pr_saveimagea(handle,page,light,type,filename,filetype); 02358 } 02359 #endif 02360 02361 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_DOTNET) 02362 02379 inline int pr_drawimage(gxHANDLE handle,int page,int light,int type,HDC hdc,int x,int y,int xsize,int ysize,gxRCT *frame) { 02380 struct PR_PARM_PRAPI_DRAWIMAGE di; 02381 di.page = page; 02382 di.light = light; 02383 di.type = type; 02384 di.hdc = hdc; 02385 di.x = x; 02386 di.y = y; 02387 di.xsize = xsize; 02388 di.ysize = ysize; 02389 di.frame = frame; 02390 return gx_call(handle, PR_CALL_PRAPI_DRAWIMAGE, &di); 02391 } 02392 #endif/* WIN32 GX_DOTNET */ 02393 02403 inline int pr_fingertonist(gxHANDLE handle,const wchar_t *filename,gxVARIANT fields) { 02404 struct PR_PARM_PRAPI_FINGERSTONIST fn; 02405 fn.filename = filename; 02406 fn.fields = fields; 02407 return gx_call(handle, PR_CALL_PRAPI_FINGERSTONIST, &fn); 02408 } 02409 02417 inline int pr_fingertonista(gxHANDLE handle,const char *filename,gxVARIANT fields) { 02418 struct PR_PARM_PRAPI_FINGERSTONISTA fn; 02419 fn.filename = filename; 02420 fn.fields = fields; 02421 return gx_call(handle, PR_CALL_PRAPI_FINGERSTONISTA, &fn); 02422 } 02423 02424 #ifdef __cplusplus 02425 02432 inline int pr_fingertonist(gxHANDLE handle,const char *filename,gxVARIANT fields) { 02433 return pr_fingertonista(handle,filename,fields); 02434 } 02435 #endif 02436 02445 inline int pr_fingertonistmem(gxHANDLE handle,void **buffer, int *buflen,gxVARIANT fields) { 02446 struct PR_PARM_PRAPI_FINGERSTONISTMEM fn; 02447 fn.buffer = buffer; 02448 fn.buflen = buflen; 02449 fn.fields = fields; 02450 return gx_call(handle, PR_CALL_PRAPI_FINGERSTONISTMEM, &fn); 02451 } 02452 02465 inline int pr_resetdocument(gxHANDLE handle, int lastpage GX_DEFARG(0)) { 02466 struct PR_PARM_PRAPI_RESETDOCUMENT rd; 02467 rd.lastpage = lastpage; 02468 return gx_call(handle, PR_CALL_PRAPI_RESETDOCUMENT, &rd); 02469 } 02470 02480 inline int pr_loaddocument(gxHANDLE handle, const wchar_t *filename, gxVARIANT *pdoc) { 02481 struct PR_PARM_PRAPI_LOADDOCUMENT_V ld; 02482 int st; 02483 assert(filename); 02484 ld.filename = filename; 02485 st = gx_call(handle,PR_CALL_PRAPI_LOADDOCUMENT_V,&ld); 02486 if(pdoc) *pdoc = ld.doc; 02487 return st; 02488 } 02489 02499 inline int pr_loaddocumenta(gxHANDLE handle, const char *filename, gxVARIANT *pdoc) { 02500 struct PR_PARM_PRAPI_LOADDOCUMENTA_V ld; 02501 int st; 02502 assert(filename); 02503 ld.filename = filename; 02504 st = gx_call(handle,PR_CALL_PRAPI_LOADDOCUMENTA_V,&ld); 02505 if(pdoc) *pdoc = ld.doc; 02506 return st; 02507 } 02508 02509 #ifdef __cplusplus 02510 02519 inline int pr_loaddocument(gxHANDLE handle, const char *filename, gxVARIANT *pdoc) { 02520 return pr_loaddocumenta(handle, filename, pdoc); 02521 } 02522 #endif 02523 02534 inline int pr_loaddocumentfrommem(gxHANDLE handle, const gxu8 *buffer, int buflen, gxVARIANT *pdoc) { 02535 struct PR_PARM_PRAPI_LOADDOCUMENTFROMMEM ld; 02536 int st; 02537 ld.buffer = buffer; 02538 ld.buflen = buflen; 02539 st = gx_call(handle, PR_CALL_PRAPI_LOADDOCUMENTFROMMEM, &ld); 02540 if(pdoc) *pdoc = ld.doc; 02541 return st; 02542 } 02543 02563 inline int pr_getocr(gxHANDLE handle, int page, int light, int type, gxVARIANT *doc, 02564 gxVARIANT ocrparams GX_DEFARG(0)) { 02565 struct PR_PARM_PRAPI_GETOCR_V gd; 02566 int ret; 02567 assert(doc); 02568 gd.page = page; 02569 gd.light = light; 02570 gd.type = type; 02571 gd.params = ocrparams; 02572 ret = gx_call(handle, PR_CALL_PRAPI_GETOCR_V, &gd); 02573 *doc = gd.doc; 02574 return ret; 02575 } 02576 02591 inline int pr_getmrz(gxHANDLE handle,int page,int light,int type,gxVARIANT *doc) { 02592 struct PR_PARM_PRAPI_GETMRZ_V gd; 02593 int ret; 02594 assert(doc); 02595 gd.page = page; 02596 gd.light = light; 02597 gd.type = type; 02598 ret = gx_call(handle, PR_CALL_PRAPI_GETMRZ_V, &gd); 02599 *doc = gd.doc; 02600 return ret; 02601 } 02602 02620 inline int pr_getbarcode(gxHANDLE handle,int page,int light,int type,int bctype,int index,gxVARIANT *doc) { 02621 struct PR_PARM_PRAPI_GETBARCODE_V gbc; 02622 int ret; 02623 assert(doc); 02624 gbc.page=page; 02625 gbc.light=light; 02626 gbc.type=type; 02627 gbc.bctype=bctype; 02628 gbc.index=index; 02629 ret = gx_call(handle, PR_CALL_PRAPI_GETBARCODE_V, &gbc); 02630 *doc = gbc.doc; 02631 return ret; 02632 } 02633 02647 inline int pr_getdocumentrect(gxHANDLE handle,int page,int light,int type,gxVARIANT *doc) { 02648 struct PR_PARM_PRAPI_GETDOCUMENTRECT_V gd; 02649 int ret; 02650 assert(doc); 02651 gd.page = page; 02652 gd.light = light; 02653 gd.type = type; 02654 ret = gx_call(handle, PR_CALL_PRAPI_GETDOCUMENTRECT_V, &gd); 02655 *doc = gd.doc; 02656 return ret; 02657 } 02658 02669 inline int pr_recognize(gxHANDLE handle,int page,gxVARIANT *doc) { 02670 struct PR_PARM_PRAPI_RECOGNIZE_V gd; 02671 int ret; 02672 assert(doc); 02673 gd.page = page; 02674 ret = gx_call(handle, PR_CALL_PRAPI_RECOGNIZE_V, &gd); 02675 *doc = gd.doc; 02676 return ret; 02677 } 02678 02688 inline int pr_analyze(gxHANDLE handle, gxVARIANT page, int tasklen, int *task, gxVARIANT *doc) { 02689 struct PR_PARM_PRAPI_ANALYZE an; 02690 int ret; 02691 assert(doc); 02692 an.page = page; 02693 an.tasklen = tasklen; 02694 an.task = task; 02695 ret = gx_call(handle, PR_CALL_PRAPI_ANALYZE, &an); 02696 if(ret) { 02697 *doc = an.doc; 02698 } 02699 return ret; 02700 } 02701 02711 inline int pr_analyzed(gxHANDLE handle, gxu8 *buffer, int buflen, gxVARIANT *doc, const wchar_t* comment GX_DEFARG(0)) { 02712 struct PR_PARM_PRAPI_ANALYZE_C an; 02713 int ret; 02714 assert(doc); 02715 an.buffer = buffer; 02716 an.buflen = buflen; 02717 an.comment = comment; 02718 ret = gx_call(handle, PR_CALL_PRAPI_ANALYZE_C, &an); 02719 if(ret) { 02720 *doc = an.doc; 02721 } 02722 return ret; 02723 } 02724 02725 #ifdef __cplusplus 02726 02735 inline int pr_analyze(gxHANDLE handle, gxu8 *buffer, int buflen, gxVARIANT *doc, const wchar_t *comment = 0) { 02736 return pr_analyzed(handle, buffer, buflen, doc, comment); 02737 } 02738 #endif 02739 02750 inline int pr_resolvemrztext(gxHANDLE handle,const wchar_t **lines,int nlines,gxVARIANT *doc) { 02751 struct PR_PARM_PRAPI_RESOLVEMRZTEXT_V rt; 02752 int ret; 02753 assert(doc); 02754 rt.lines = lines; 02755 rt.nlines = nlines; 02756 ret = gx_call(handle, PR_CALL_PRAPI_RESOLVEMRZTEXT_V, &rt); 02757 *doc = rt.doc; 02758 return ret; 02759 } 02760 02771 inline int pr_resolvemrztexta(gxHANDLE handle,const char **lines,int nlines,gxVARIANT *doc) { 02772 struct PR_PARM_PRAPI_RESOLVEMRZTEXTA_V rt; 02773 int ret; 02774 assert(doc); 02775 rt.lines = lines; 02776 rt.nlines = nlines; 02777 ret = gx_call(handle, PR_CALL_PRAPI_RESOLVEMRZTEXTA_V, &rt); 02778 *doc = rt.doc; 02779 return ret; 02780 } 02781 02782 #ifdef __cplusplus 02783 02793 inline int pr_resolvemrztext(gxHANDLE handle,const char **lines,int nlines,gxVARIANT *doc) { 02794 return pr_resolvemrztexta(handle,lines,nlines,doc); 02795 } 02796 #endif 02797 02808 inline int pr_getdocumentstatus(gxHANDLE handle,gxVARIANT doc,int *code,int *status) { 02809 struct PR_PARM_PRAPI_GETDOCUMENTSTATUS_V gds; 02810 int ret; 02811 gds.doc = doc; 02812 ret = gx_call(handle, PR_CALL_PRAPI_GETDOCUMENTSTATUS_V, &gds); 02813 if (code) *code = gds.code; 02814 if (status) *status = gds.status; 02815 return ret; 02816 } 02817 02829 inline int pr_getfieldfromdoc(gxHANDLE handle, gxVARIANT doc, int field_code, int index, gxVARIANT *field) { 02830 struct PR_PARM_PRAPI_GETFIELDFROMDOC_V gfd; 02831 int ret; 02832 assert(field); 02833 gfd.doc = doc; 02834 gfd.field_code = field_code; 02835 gfd.index = index; 02836 ret = gx_call(handle, PR_CALL_PRAPI_GETFIELDFROMDOC_V, &gfd); 02837 if(field) *field = gfd.field; 02838 return ret; 02839 } 02840 02841 #ifndef GX_DOTNET 02842 02857 inline int pr_getfieldfromdocw(gxHANDLE handle, gxVARIANT doc, int field_code, wchar_t *text, int *stext, 02858 int *status, gxPG4 *frame) { 02859 int ret = true; 02860 int s, t = 0; 02861 gxVARIANT field; 02862 if(!stext) stext = &t; 02863 02864 assert((!text && !*stext) || (text && *stext>0)); 02865 02866 if(text && *stext>0) text[0] = 0; 02867 if(status) *status = -1; 02868 if(frame) memset(frame, 0, sizeof(gxPG4)); 02869 if(!pr_getfieldfromdoc(handle, doc, field_code, 0, &field)) { 02870 if(gx_geterrorcode()==GX_ENOENT) { 02871 *stext = 0; 02872 return true; 02873 } 02874 return false; 02875 } 02876 02877 if(text && !gx_convertvariantchild(field, (int)PRV_FIELDVALUE, 0, GX_VARIANT_UNICODE, stext,0, text, *stext)) { 02878 if(gx_geterrorcode()==GX_ENOENT) { 02879 *stext = 0; 02880 } 02881 else ret = false; 02882 } 02883 s = sizeof(int); 02884 if(status && !gx_convertvariantchild(field, (int)PRV_CHECKSUM, 0, GX_VARIANT_INT, &s, 0, status, s)) { 02885 if(gx_geterrorcode()!=GX_ENOENT) ret = false; 02886 } 02887 s = sizeof(int); t = 8; 02888 if(frame && !gx_convertvariantchild(field, (int)PRV_WINDOWFRAME, 0, GX_VARIANT_INTARRAY, &s, &t, frame, 8*s)) { 02889 if(gx_geterrorcode()!=GX_ENOENT) ret = false; 02890 } 02891 if(!ret) gx_pusherror(); 02892 gx_disposevariant(&field); 02893 if(!ret) gx_poperror(); 02894 return ret; 02895 } 02896 02897 #ifdef __cplusplus 02898 02914 inline int pr_getfieldfromdoc(gxHANDLE handle, gxVARIANT doc, int field_code, wchar_t *text, int *stext, 02915 int *status, gxPG4 *frame) { 02916 return pr_getfieldfromdocw(handle, doc, field_code, text, stext, status, frame); 02917 } 02918 02933 inline int pr_getfieldfromdoc(gxHANDLE handle, const gxVARIANT doc, int field_code, wchar_t *text, int stext, 02934 int *status, gxPG4 *frame) { 02935 return pr_getfieldfromdocw(handle, doc, field_code, text, &stext, status, frame); 02936 } 02937 02938 #endif 02939 02955 inline int pr_getfieldfromdoca(gxHANDLE handle, gxVARIANT doc, int field_code, char *text, int *stext, 02956 int *status, gxPG4 *frame) { 02957 int ret = true; 02958 int s, t = 0; 02959 gxVARIANT field; 02960 if(!stext) stext = &t; 02961 02962 assert((!text && !*stext) || (text && *stext>0)); 02963 02964 if(text && *stext>0) text[0] = 0; 02965 if(status) *status = -1; 02966 if(frame) memset(frame, 0, sizeof(gxPG4)); 02967 if(!pr_getfieldfromdoc(handle, doc, field_code, 0, &field)) { 02968 if(gx_geterrorcode()==GX_ENOENT) { 02969 *stext = 0; 02970 return true; 02971 } 02972 return false; 02973 } 02974 02975 if(text && !gx_convertvariantchild(field, (int)PRV_FIELDVALUE, 0, GX_VARIANT_ASCII, stext, 0, text, *stext)) { 02976 if(gx_geterrorcode()==GX_ENOENT) { 02977 *stext = 0; 02978 } 02979 else ret = false; 02980 } 02981 s = sizeof(int); 02982 if(status && !gx_convertvariantchild(field, (int)PRV_CHECKSUM, 0, GX_VARIANT_INT, &s, 0, status, s)) { 02983 if(gx_geterrorcode()!=GX_ENOENT) ret = false; 02984 } 02985 s = sizeof(int); t = 8; 02986 if(frame && !gx_convertvariantchild(field, (int)PRV_WINDOWFRAME, 0, GX_VARIANT_INTARRAY, &s, &t, frame, 8*s)) { 02987 if(gx_geterrorcode()!=GX_ENOENT) ret = false; 02988 } 02989 if(!ret) gx_pusherror(); 02990 gx_disposevariant(&field); 02991 if(!ret) gx_poperror(); 02992 return ret; 02993 } 02994 02995 #ifdef __cplusplus 02996 03012 inline int pr_getfieldfromdoc(gxHANDLE handle, gxVARIANT doc, int field_code, char *text, int *stext, 03013 int *status, gxPG4 *frame) { 03014 return pr_getfieldfromdoca(handle, doc, field_code, text, stext, status, frame); 03015 } 03016 03031 inline int pr_getfieldfromdoc(gxHANDLE handle, gxVARIANT doc, int field_code, char *text, int stext, 03032 int *status, gxPG4 *frame) { 03033 return pr_getfieldfromdoc(handle, doc, field_code, text, &stext, status, frame); 03034 } 03035 03036 #endif 03037 03053 inline int pr_getfieldfromdocb(gxHANDLE handle, gxVARIANT doc, int field_code, void *data, int *sdata, 03054 int *status, gxPG4 *frame) { 03055 int ret = true; 03056 int s, t = 0; 03057 gxVARIANT field; 03058 if(!sdata) sdata = &t; 03059 03060 assert((!data && !*sdata) || (data && *sdata>0)); 03061 03062 if(status) *status = -1; 03063 if(frame) memset(frame, 0, sizeof(gxPG4)); 03064 if(!pr_getfieldfromdoc(handle, doc,field_code, 0, &field)) { 03065 if(gx_geterrorcode()==GX_ENOENT) { 03066 *sdata = 0; 03067 return true; 03068 } 03069 return false; 03070 } 03071 03072 if(data && !gx_convertvariantchild(field, (int)PRV_FIELDVALUE, 0, GX_VARIANT_BINARY, sdata, 0, data, *sdata)) { 03073 if(gx_geterrorcode()==GX_ENOENT) { 03074 *sdata = 0; 03075 } 03076 else ret = false; 03077 } 03078 s = sizeof(int); 03079 if(status && !gx_convertvariantchild(field, (int)PRV_CHECKSUM, 0, GX_VARIANT_INT, &s, 0, status, s)) { 03080 if(gx_geterrorcode()!=GX_ENOENT) ret = false; 03081 } 03082 s = sizeof(int); t = 8; 03083 if(frame && !gx_convertvariantchild(field, (int)PRV_WINDOWFRAME, 0, GX_VARIANT_INTARRAY, &s, &t, frame, 8*s)) { 03084 if(gx_geterrorcode()!=GX_ENOENT) ret = false; 03085 } 03086 if(!ret) gx_pusherror(); 03087 gx_disposevariant(&field); 03088 if(!ret) gx_poperror(); 03089 return ret; 03090 } 03091 03092 #ifdef __cplusplus 03093 03109 inline int pr_getfieldfromdoc(gxHANDLE handle, gxVARIANT doc, int field_code, void *data, int *sdata, 03110 int *status, gxPG4 *frame) { 03111 return pr_getfieldfromdocb(handle, doc, field_code, data, sdata, status, frame); 03112 } 03113 03128 inline int pr_getfieldfromdoc(gxHANDLE handle, gxVARIANT doc, int field_code, void *data, int sdata, 03129 int *status, gxPG4 *frame) { 03130 return pr_getfieldfromdoc(handle, doc, field_code, data, &sdata, status, frame); 03131 } 03132 03133 #endif 03134 #endif 03135 03146 inline int pr_getfieldimage(gxHANDLE handle,gxVARIANT doc,int field_code,int index,gxVARIANT *img) { 03147 struct PR_PARM_PRAPI_GETFIELDIMAGE_V parm; 03148 int ret; 03149 assert(img); 03150 parm.doc = doc; 03151 parm.field_code = field_code; 03152 parm.index = index; 03153 ret = gx_call(handle, PR_CALL_PRAPI_GETFIELDIMAGE_V, &parm); 03154 if (ret && img) *img = parm.img; 03155 return ret; 03156 } 03157 03167 inline int pr_getgximagefromdoc(gxHANDLE handle,gxVARIANT doc,int field_code, gxIMAGE **img) { 03168 int ret = true; 03169 gxVARIANT field; 03170 int ind=0; 03171 if(field_code>_PR_DF_RFID_FACE){ 03172 ind=(field_code&0xffff)-1; 03173 field_code&=~0xffff; 03174 } 03175 if(!pr_getfieldimage(handle,doc,field_code,ind,&field)) return false; 03176 ret = gx_imagefromvariant(gx_direct(GX_CALL_GROUP_GX_IMAGE),img,field); 03177 if(!ret)gx_pusherror(); 03178 gx_disposevariant(&field); 03179 if(!ret)gx_poperror(); 03180 return ret; 03181 } 03182 03195 inline int pr_getpropfromdoc(gxHANDLE handle, gxVARIANT doc, int field_code, int prop_code, 03196 void *data, int *sdata, int *data_type) { 03197 03198 gxVARIANT d = doc, field = 0; 03199 int dc = 0, s = sizeof(int); 03200 int ret; 03201 assert(sdata); 03202 if(!pr_getfieldfromdoc(handle,d,field_code,0,&field)) return false; 03203 03204 if(prop_code==_PR_PROP_TYPE_RFID_FILES) dc=(int)_PRV_RFIDDIR; 03205 if(prop_code==_PR_PROP_TYPE_BARCODE_TYPE) dc=(int)_PRV_BARCODE; 03206 if(prop_code==_PR_PROP_TYPE_CONFIDENCE) dc=(int)_PRV_CONFIDENCE; 03207 ret = gx_convertvariantchild(field,dc,0,_GX_VARIANT_INT,&s,0,data,*sdata); 03208 if(!ret)gx_pusherror(); 03209 gx_unrefvariant(field); 03210 if(data_type)*data_type=0x14; 03211 if(!ret)gx_poperror(); 03212 return ret; 03213 } 03214 03215 03226 inline int pr_compareface(gxHANDLE handle, int page, int face_no, gxVARIANT *doc) { 03227 int ret; 03228 struct PR_PARM_PRAPI_COMPARE_FACE_V param; 03229 assert(doc); 03230 param.page = page; 03231 param.face_no = face_no; 03232 ret = gx_call(handle, PR_CALL_PRAPI_COMPARE_FACE_V, ¶m); 03233 *doc = param.doc; 03234 return ret; 03235 } 03236 03246 inline int pr_savedocument(gxHANDLE handle, gxVARIANT pdoc, const wchar_t *filename, int filetype) { 03247 struct PR_PARM_PRAPI_SAVEDOCUMENT_V sd; 03248 assert(filename); 03249 sd.doc = pdoc; 03250 sd.filename = filename; 03251 sd.filetype = filetype; 03252 return gx_call(handle,PR_CALL_PRAPI_SAVEDOCUMENT_V,&sd); 03253 } 03254 03264 inline int pr_savedocumenta(gxHANDLE handle, gxVARIANT pdoc, const char *filename, int filetype) { 03265 struct PR_PARM_PRAPI_SAVEDOCUMENTA_V sd; 03266 assert(filename); 03267 sd.doc = pdoc; 03268 sd.filename = filename; 03269 sd.filetype = filetype; 03270 return gx_call(handle,PR_CALL_PRAPI_SAVEDOCUMENTA_V,&sd); 03271 } 03272 03273 #ifdef __cplusplus 03274 03283 inline int pr_savedocument(gxHANDLE handle, gxVARIANT pdoc, const char *filename, int filetype) { 03284 return pr_savedocumenta(handle, pdoc, filename, filetype); 03285 } 03286 #endif 03287 03296 inline int pr_savedocumenttomem(gxHANDLE handle, gxVARIANT pdoc, gxu8 **buffer, int *buflen, int filetype) { 03297 struct PR_PARM_PRAPI_SAVEDOCUMENTTOMEM stm; 03298 stm.doc = pdoc; 03299 stm.filetype = filetype; 03300 stm.buffer = buffer; 03301 stm.buflen = buflen; 03302 return gx_call(handle, PR_CALL_PRAPI_SAVEDOCUMENTTOMEM, &stm); 03303 } 03304 03312 inline int pr_getdocumentroot(gxHANDLE handle, gxVARIANT *pdoc) { 03313 struct PR_PARM_PRAPI_GETDOCUMENTROOT_V gd; 03314 int st; 03315 st = gx_call(handle, PR_CALL_PRAPI_GETDOCUMENTROOT_V, &gd); 03316 if(pdoc) *pdoc = gd.doc; 03317 return st; 03318 } 03319 03332 inline int pr_decodelatentimage(gxHANDLE handle, int page, int light, int type, const wchar_t *decpar, 03333 gxVARIANT *image) { 03334 struct PR_PARM_PRAPI_DECODELATENTIMAGE dli; 03335 int st; 03336 assert(image); 03337 dli.page = page; 03338 dli.light = light; 03339 dli.type = type; 03340 dli.decpar = decpar; 03341 st = gx_call(handle, PR_CALL_PRAPI_DECODELATENTIMAGE, &dli); 03342 if(st && image) *image = dli.image; 03343 return st; 03344 } 03345 03354 inline int pr_resolvemagstripe(gxHANDLE handle, const wchar_t **tracks, int ntracks, gxVARIANT *doc) { 03355 struct PR_PARM_PRAPI_RESOLVEMAGSTRIPE rms; 03356 int ret; 03357 assert(doc); 03358 rms.tracks = tracks; 03359 rms.ntracks = ntracks; 03360 ret = gx_call(handle, PR_CALL_PRAPI_RESOLVEMAGSTRIPE, &rms); 03361 *doc = rms.doc; 03362 return ret; 03363 } 03364 03373 inline int pr_resolvemagstripea(gxHANDLE handle, const char **tracks, int ntracks, gxVARIANT *doc) { 03374 struct PR_PARM_PRAPI_RESOLVEMAGSTRIPEA rms; 03375 int ret; 03376 assert(doc); 03377 rms.tracks = tracks; 03378 rms.ntracks = ntracks; 03379 ret = gx_call(handle, PR_CALL_PRAPI_RESOLVEMAGSTRIPEA, &rms); 03380 *doc = rms.doc; 03381 return ret; 03382 } 03383 03384 #ifdef __cplusplus 03385 03393 inline int pr_resolvemagstripe(gxHANDLE handle, const char **tracks, int ntracks, gxVARIANT *doc) { 03394 return pr_resolvemagstripea(handle, tracks, ntracks, doc); 03395 } 03396 #endif 03397 03406 inline int pr_mergedocument(gxHANDLE handle, gxVARIANT doc1, gxVARIANT doc2, gxVARIANT *pdoc) { 03407 struct PR_PARM_PRAPI_MERGEDOCUMENTS mds; 03408 assert(pdoc); 03409 mds.doc1 = doc1; 03410 mds.ndoc = doc2; 03411 mds.relation = 0; 03412 if(!gx_call(handle, PR_CALL_PRAPI_MERGEDOCUMENTS, &mds)) return 0; 03413 if(pdoc) *pdoc = mds.ndoc; 03414 else gx_unrefvariant(mds.ndoc); 03415 return 1; 03416 } 03417 03434 inline int pr_getrfidcardlist(gxHANDLE handle,wchar_t ***cards,int *ncards) { 03435 struct PR_PARM_PRAPI_GETRFIDCARDLIST gcl; 03436 int ret; 03437 assert(cards && ncards); 03438 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDCARDLIST, &gcl); 03439 *cards = gcl.cards; 03440 *ncards = gcl.ncards; 03441 return ret; 03442 } 03443 03454 inline int pr_getrfidcardlista(gxHANDLE handle,char ***cards,int *ncards) { 03455 struct PR_PARM_PRAPI_GETRFIDCARDLISTA gcl; 03456 int ret; 03457 assert(cards && ncards); 03458 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDCARDLISTA, &gcl); 03459 *cards = gcl.cards; 03460 *ncards = gcl.ncards; 03461 return ret; 03462 } 03463 03464 #ifdef __cplusplus 03465 03475 inline int pr_getrfidcardlist(gxHANDLE handle,char ***cards,int *ncards) { 03476 return pr_getrfidcardlista(handle,cards,ncards); 03477 } 03478 #endif 03479 03493 inline int pr_getrfidfile(gxHANDLE handle,const wchar_t *card,int fileid,void **data,int *sdata) { 03494 struct PR_PARM_PRAPI_GETRFIDFILE gf; 03495 int ret; 03496 assert(data && sdata); 03497 gf.card = card; 03498 gf.fileid = fileid; 03499 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDFILE, &gf); 03500 *data = gf.data; 03501 *sdata = gf.sdata; 03502 return ret; 03503 } 03504 03518 inline int pr_getrfidfilea(gxHANDLE handle,const char *card,int fileid,void **data,int *sdata) { 03519 struct PR_PARM_PRAPI_GETRFIDFILEA gf; 03520 int ret; 03521 assert(data && sdata); 03522 gf.card = card; 03523 gf.fileid = fileid; 03524 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDFILEA, &gf); 03525 *data = gf.data; 03526 *sdata = gf.sdata; 03527 return ret; 03528 } 03529 03530 #ifdef __cplusplus 03531 03544 inline int pr_getrfidfile(gxHANDLE handle,const char *card,int fileid,void **data,int *sdata) { 03545 return pr_getrfidfilea(handle,card,fileid,data,sdata); 03546 } 03547 #endif 03548 03557 inline int pr_getrfidfile_start(gxHANDLE handle, const wchar_t *card, int fileid, int *reqid) { 03558 struct PR_PARM_PRAPI_GETRFIDFILE_START param; 03559 int ret; 03560 param.card = card; 03561 param.fileid = fileid; 03562 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDFILE_START, ¶m); 03563 if(reqid) *reqid = param.reqid; 03564 return ret; 03565 } 03566 03575 inline int pr_getrfidfile_starta(gxHANDLE handle, const char *card, int fileid, int *reqid) { 03576 struct PR_PARM_PRAPI_GETRFIDFILE_STARTA param; 03577 int ret; 03578 param.card = card; 03579 param.fileid = fileid; 03580 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDFILE_STARTA, ¶m); 03581 if(reqid) *reqid = param.reqid; 03582 return ret; 03583 } 03584 03585 03586 #ifdef __cplusplus 03587 03595 inline int pr_getrfidfile_start(gxHANDLE handle,const char *card,int fileid,int *reqid) { 03596 return pr_getrfidfile_starta(handle,card,fileid,reqid); 03597 } 03598 #endif 03599 03609 inline int pr_getrfidfile_getstatus(gxHANDLE handle,int reqid,int *status) { 03610 struct PR_PARM_PRAPI_GETSTATUS stat; 03611 int ret; 03612 assert(status); 03613 stat.reqid = reqid; 03614 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDFILE_GETSTATUS, &stat); 03615 if(status) *status = stat.status; 03616 return ret; 03617 } 03618 03629 inline int pr_getrfidfile_wait(gxHANDLE handle, int reqid, void **data, int *sdata) { 03630 struct PR_PARM_PRAPI_GETRFIDFILE_WAIT param; 03631 int ret; 03632 assert(data && sdata); 03633 param.reqid = reqid; 03634 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDFILE_WAIT, ¶m); 03635 *data = param.data; 03636 *sdata = param.sdata; 03637 return ret; 03638 } 03639 03647 inline int pr_getrfidfile_stop(gxHANDLE handle) { 03648 int ret; 03649 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDFILE_STOP, 0); 03650 return ret; 03651 } 03652 03661 inline int pr_resolverfiddata(gxHANDLE handle, const void *data, int sdata, gxVARIANT *doc) { 03662 struct PR_PARM_PRAPI_RESOLVERFIDDATA_V rd; 03663 int ret; 03664 assert(doc); 03665 rd.data = data; 03666 rd.sdata = sdata; 03667 ret = gx_call(handle, PR_CALL_PRAPI_RESOLVERFIDDATA_V, &rd); 03668 *doc = rd.doc; 03669 return ret; 03670 } 03671 03681 inline int pr_getapplications(gxHANDLE handle, const wchar_t *card, int **apps, int *napps) { 03682 struct PR_PARM_PRAPI_GET_APPLICATIONS param; 03683 int ret; 03684 assert(apps && napps); 03685 param.card = card; 03686 ret = gx_call(handle, PR_CALL_PRAPI_GETAPPLICATIONS, ¶m); 03687 *apps = param.apps; 03688 *napps = param.napps; 03689 return ret; 03690 } 03691 03704 inline int pr_getapplicationsa(gxHANDLE handle, const char *card, int **apps, int *napps) { 03705 struct PR_PARM_PRAPI_GET_APPLICATIONSA param; 03706 int ret; 03707 param.card = card; 03708 ret = gx_call(handle, PR_CALL_PRAPI_GETAPPLICATIONSA, ¶m); 03709 *apps = param.apps; 03710 *napps = param.napps; 03711 return ret; 03712 } 03713 03714 #ifdef __cplusplus 03715 03724 inline int pr_getapplications(gxHANDLE handle, const char *card, int **apps, int *napps) { 03725 return pr_getapplicationsa(handle, card, apps, napps); 03726 } 03727 03728 #endif 03729 03738 inline int pr_selectapplication(gxHANDLE handle, const wchar_t *card, int application) { 03739 struct PR_PARM_PRAPI_SELECT_APPLICATION param; 03740 param.card = card; 03741 param.application = application; 03742 return gx_call(handle, PR_CALL_PRAPI_SELECT_APPLICATION, ¶m); 03743 } 03744 03753 inline int pr_selectapplicationa(gxHANDLE handle, const char *card, int application) { 03754 struct PR_PARM_PRAPI_SELECT_APPLICATIONA param; 03755 param.card = card; 03756 param.application = application; 03757 return gx_call(handle, PR_CALL_PRAPI_SELECT_APPLICATIONA, ¶m); 03758 } 03759 03760 #ifdef __cplusplus 03761 03769 inline int pr_selectapplication(gxHANDLE handle, const char *card, int application) { 03770 return pr_selectapplicationa(handle,card,application); 03771 } 03772 03773 #endif 03774 03783 inline int pr_makebac(gxHANDLE handle, const wchar_t *card, const wchar_t **lines, int nlines) { 03784 struct PR_PARM_PRAPI_MAKEBAC param; 03785 param.card = card; 03786 param.lines = lines; 03787 param.nlines = nlines; 03788 return gx_call(handle, PR_CALL_PRAPI_MAKEBAC, ¶m); 03789 } 03790 03799 inline int pr_makebaca(gxHANDLE handle, const char *card, const char **lines, int nlines) { 03800 struct PR_PARM_PRAPI_MAKEBACA param; 03801 param.card = card; 03802 param.lines = lines; 03803 param.nlines = nlines; 03804 return gx_call(handle, PR_CALL_PRAPI_MAKEBACA, ¶m); 03805 } 03806 03807 #ifdef __cplusplus 03808 03816 inline int pr_makebac(gxHANDLE handle, const char *card, const char **lines, int nlines) { 03817 return pr_makebaca(handle,card,lines,nlines); 03818 } 03819 03820 #endif 03821 03832 inline int pr_makepace(gxHANDLE handle, const wchar_t *card, const wchar_t **lines, int nlines, int PasswordType) { 03833 struct PR_PARM_PRAPI_MAKEPACE param; 03834 param.card = card; 03835 param.lines = lines; 03836 param.nlines = nlines; 03837 param.PasswordType = PasswordType; 03838 return gx_call(handle, PR_CALL_PRAPI_MAKEPACE, ¶m); 03839 } 03840 03851 inline int pr_makepacea(gxHANDLE handle, const char *card, const char **lines, int nlines, int PasswordType) { 03852 struct PR_PARM_PRAPI_MAKEPACEA param; 03853 param.card = card; 03854 param.lines = lines; 03855 param.nlines = nlines; 03856 param.PasswordType = PasswordType; 03857 return gx_call(handle, PR_CALL_PRAPI_MAKEPACEA, ¶m); 03858 } 03859 03860 #ifdef __cplusplus 03861 03871 inline int pr_makepace(gxHANDLE handle, const char *card, const char **lines, int nlines, int PasswordType) { 03872 return pr_makepacea(handle,card,lines,nlines,PasswordType); 03873 } 03874 #endif 03875 03876 03884 inline int pr_makepassiveauth(gxHANDLE handle, const wchar_t *card) { 03885 struct PR_PARM_PRAPI_RFIDCARD param; 03886 param.card = card; 03887 return gx_call(handle, PR_CALL_PRAPI_MAKEPASSIVEAUTH, ¶m); 03888 } 03889 03897 inline int pr_makepassiveautha(gxHANDLE handle, const char *card) { 03898 struct PR_PARM_PRAPI_RFIDCARDA param; 03899 param.card = card; 03900 return gx_call(handle, PR_CALL_PRAPI_MAKEPASSIVEAUTHA, ¶m); 03901 } 03902 03903 #ifdef __cplusplus 03904 03911 inline int pr_makepassiveauth(gxHANDLE handle, const char *card) { 03912 return pr_makepassiveautha(handle,card); 03913 } 03914 #endif 03915 03926 inline int pr_makeactiveauth(gxHANDLE handle, const wchar_t *card) { 03927 struct PR_PARM_PRAPI_RFIDCARD param; 03928 param.card = card; 03929 return gx_call(handle, PR_CALL_PRAPI_MAKEACTIVEAUTH, ¶m); 03930 } 03931 03942 inline int pr_makeactiveautha(gxHANDLE handle, const char *card) { 03943 struct PR_PARM_PRAPI_RFIDCARDA param; 03944 param.card = card; 03945 return gx_call(handle, PR_CALL_PRAPI_MAKEACTIVEAUTHA, ¶m); 03946 } 03947 03948 #ifdef __cplusplus 03949 03959 inline int pr_makeactiveauth(gxHANDLE handle, const char *card) { 03960 return pr_makeactiveautha(handle,card); 03961 } 03962 #endif 03963 03971 inline int pr_makechipauth(gxHANDLE handle, const wchar_t *card) { 03972 struct PR_PARM_PRAPI_RFIDCARD param; 03973 param.card = card; 03974 return gx_call(handle, PR_CALL_PRAPI_MAKECHIPAUTH, ¶m); 03975 } 03976 03984 inline int pr_makechipautha(gxHANDLE handle, const char *card) { 03985 struct PR_PARM_PRAPI_RFIDCARDA param; 03986 param.card = card; 03987 return gx_call(handle, PR_CALL_PRAPI_MAKECHIPAUTHA, ¶m); 03988 } 03989 03990 #ifdef __cplusplus 03991 03998 inline int pr_makechipauth(gxHANDLE handle, const char *card) { 03999 return pr_makechipautha(handle,card); 04000 } 04001 #endif 04002 04010 inline int pr_maketerminalauth(gxHANDLE handle, const wchar_t *card) { 04011 struct PR_PARM_PRAPI_RFIDCARD param; 04012 param.card = card; 04013 return gx_call(handle, PR_CALL_PRAPI_MAKETERMINALAUTH, ¶m); 04014 } 04015 04023 inline int pr_maketerminalautha(gxHANDLE handle, const char *card) { 04024 struct PR_PARM_PRAPI_RFIDCARDA param; 04025 param.card = card; 04026 return gx_call(handle, PR_CALL_PRAPI_MAKETERMINALAUTHA, ¶m); 04027 } 04028 04029 #ifdef __cplusplus 04030 04037 inline int pr_maketerminalauth(gxHANDLE handle, const char *card) { 04038 return pr_maketerminalautha(handle,card); 04039 } 04040 #endif 04041 04050 inline int pr_initta(gxHANDLE handle, const wchar_t *card, void **data, int *sdata) { 04051 struct PR_PARM_PRAPI_TA param; 04052 int ret; 04053 assert(data && sdata); 04054 param.card = card; 04055 ret = gx_call(handle, PR_CALL_PRAPI_INITTERMINALAUTH, ¶m); 04056 if (ret != 0) { 04057 *data = param.data; 04058 *sdata = param.sdata; 04059 } 04060 return ret; 04061 } 04062 04071 inline int pr_inittaa(gxHANDLE handle, const char *card, void **data, int *sdata) { 04072 struct PR_PARM_PRAPI_TAA param; 04073 int ret; 04074 assert(data && sdata); 04075 param.card = card; 04076 ret = gx_call(handle, PR_CALL_PRAPI_INITTERMINALAUTHA, ¶m); 04077 if (ret != 0) { 04078 *data = param.data; 04079 *sdata = param.sdata; 04080 } 04081 return ret; 04082 } 04083 04084 #ifdef __cplusplus 04085 04093 inline int pr_initta(gxHANDLE handle, const char *card, void **data, int *sdata) { 04094 return pr_inittaa(handle, card, data, sdata); 04095 } 04096 #endif 04097 04106 inline int pr_completeta(gxHANDLE handle, const wchar_t *card, const void *data, int sdata) { 04107 struct PR_PARM_PRAPI_TA param; 04108 param.card = card; 04109 param.data = (void*)data; 04110 param.sdata = sdata; 04111 return gx_call(handle, PR_CALL_PRAPI_COMPLETETERMINALAUTH, ¶m); 04112 } 04113 04122 inline int pr_completetaa(gxHANDLE handle, const char *card, const void *data, int sdata) { 04123 struct PR_PARM_PRAPI_TAA param; 04124 param.card = card; 04125 param.data = (void*)data; 04126 param.sdata = sdata; 04127 return gx_call(handle, PR_CALL_PRAPI_COMPLETETERMINALAUTHA, ¶m); 04128 } 04129 04130 #ifdef __cplusplus 04131 04139 inline int pr_completeta(gxHANDLE handle, const char *card, const void *data, int sdata) { 04140 return pr_completetaa(handle, card, data, sdata); 04141 } 04142 #endif 04143 04152 inline int pr_loadcertfile(gxHANDLE handle, const wchar_t *certificate, const wchar_t *privateKey GX_DEFARG(NULL)) { 04153 struct PR_PARM_PRAPI_LOADCERTFILE param; 04154 param.certificate = certificate; 04155 param.privateKey = privateKey; 04156 return gx_call(handle, PR_CALL_PRAPI_LOADCERTFILE, ¶m); 04157 } 04158 04167 inline int pr_loadcertfilea(gxHANDLE handle, const char *certificate, const char *privateKey GX_DEFARG(NULL)) { 04168 struct PR_PARM_PRAPI_LOADCERTFILEA param; 04169 param.certificate = certificate; 04170 param.privateKey = privateKey; 04171 return gx_call(handle, PR_CALL_PRAPI_LOADCERTFILEA, ¶m); 04172 } 04173 04174 #ifdef __cplusplus 04175 04183 inline int pr_loadcertfile(gxHANDLE handle, const char *certificate, const char *privateKey GX_DEFARG(NULL)) { 04184 return pr_loadcertfilea(handle, certificate, privateKey); 04185 } 04186 04187 #endif 04188 04196 inline int pr_loadcertfromstore(gxHANDLE handle, const wchar_t *storename) { 04197 struct PR_PARM_PRAPI_LOADCERTFROMSTORE param; 04198 param.storename = storename; 04199 return gx_call(handle, PR_CALL_PRAPI_LOADCERTFROMSTORE, ¶m); 04200 } 04201 04209 inline int pr_loadcertfromstorea(gxHANDLE handle, const char *storename) { 04210 struct PR_PARM_PRAPI_LOADCERTFROMSTOREA param; 04211 param.storename = storename; 04212 return gx_call(handle, PR_CALL_PRAPI_LOADCERTFROMSTOREA, ¶m); 04213 } 04214 04215 #ifdef __cplusplus 04216 04223 inline int pr_loadcertfromstore(gxHANDLE handle, const char *storename) { 04224 return pr_loadcertfromstorea(handle, storename); 04225 } 04226 04227 #endif 04228 04229 04240 inline int pr_loadcertfrommem(gxHANDLE handle, void *certificate_data, unsigned int certificate_length, void *privateKey_data GX_DEFARG(NULL), unsigned int privateKey_length GX_DEFARG(0)) { 04241 struct PR_PARM_PRAPI_LOADCERTFROMMEM param; 04242 param.certificate_data = certificate_data; 04243 param.certificate_length = certificate_length; 04244 param.privateKey_data = privateKey_data; 04245 param.privateKey_length = privateKey_length; 04246 04247 return gx_call(handle, PR_CALL_PRAPI_LOADCERTFROMMEM, ¶m); 04248 } 04249 04258 inline int pr_clearcertlist(gxHANDLE handle, int sel) { 04259 struct PR_PARM_PRAPI_CLEARCERTLIST ccl; 04260 ccl.sel = sel; 04261 return gx_call(handle, PR_CALL_PRAPI_CLEARCERTLIST, &ccl); 04262 } 04263 04271 inline int pr_connectrfidcard(gxHANDLE handle, const wchar_t *card) { 04272 struct PR_PARM_PRAPI_RFIDCARD param; 04273 param.card = card; 04274 return gx_call(handle, PR_CALL_PRAPI_CONNECTRFIDCARD, ¶m); 04275 } 04276 04284 inline int pr_connectrfidcarda(gxHANDLE handle, const char *card) { 04285 struct PR_PARM_PRAPI_RFIDCARDA param; 04286 param.card = card; 04287 return gx_call(handle, PR_CALL_PRAPI_CONNECTRFIDCARDA, ¶m); 04288 } 04289 04290 #ifdef __cplusplus 04291 04298 inline int pr_connectrfidcard(gxHANDLE handle, const char *card) { 04299 return pr_connectrfidcarda(handle, card); 04300 } 04301 #endif 04302 04310 inline int pr_disconnectrfidcard(gxHANDLE handle, const wchar_t *card) { 04311 struct PR_PARM_PRAPI_RFIDCARD param; 04312 param.card = card; 04313 return gx_call(handle, PR_CALL_PRAPI_DISCONNECTRFIDCARD, ¶m); 04314 } 04315 04323 inline int pr_disconnectrfidcarda(gxHANDLE handle, const char *card) { 04324 struct PR_PARM_PRAPI_RFIDCARDA param; 04325 param.card = card; 04326 return gx_call(handle, PR_CALL_PRAPI_DISCONNECTRFIDCARDA, ¶m); 04327 } 04328 04329 #ifdef __cplusplus 04330 04337 inline int pr_disconnectrfidcard(gxHANDLE handle, const char *card) { 04338 return pr_disconnectrfidcarda(handle, card); 04339 } 04340 #endif 04341 04350 inline int pr_checkrfidfilehash(gxHANDLE handle, const wchar_t *card, int fileid) { 04351 struct PR_PARM_PRAPI_CHECKRFIDFILEHASH param; 04352 param.card = card; 04353 param.fileid = fileid; 04354 return gx_call(handle, PR_CALL_PRAPI_CHECKRFIDFILEHASH, ¶m); 04355 } 04356 04365 inline int pr_checkrfidfilehasha(gxHANDLE handle, const char *card, int fileid) { 04366 struct PR_PARM_PRAPI_CHECKRFIDFILEHASHA param; 04367 param.card = card; 04368 param.fileid = fileid; 04369 return gx_call(handle, PR_CALL_PRAPI_CHECKRFIDFILEHASHA, ¶m); 04370 } 04371 04372 #ifdef __cplusplus 04373 04381 inline int pr_checkrfidfilehash(gxHANDLE handle, const char *card, int fileid) { 04382 return pr_checkrfidfilehasha(handle, card, fileid); 04383 } 04384 #endif 04385 04394 inline int pr_getrfidcardinfo(gxHANDLE handle, const wchar_t *card, gxVARIANT *cardinfo) { 04395 struct PR_PARM_PRAPI_GETRFIDCARDINFO grci; 04396 int ret; 04397 assert(cardinfo); 04398 grci.card = card; 04399 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDCARDINFO, &grci); 04400 if(ret && cardinfo) *cardinfo = grci.cardinfo; 04401 return ret; 04402 } 04403 04412 inline int pr_getrfidcardinfoa(gxHANDLE handle, const char *card, gxVARIANT *cardinfo) { 04413 struct PR_PARM_PRAPI_GETRFIDCARDINFOA grci; 04414 int ret; 04415 assert(cardinfo); 04416 grci.card = card; 04417 ret = gx_call(handle, PR_CALL_PRAPI_GETRFIDCARDINFOA, &grci); 04418 if(ret && cardinfo) *cardinfo = grci.cardinfo; 04419 return ret; 04420 } 04421 04422 #ifdef __cplusplus 04423 04431 inline int pr_getrfidcardinfo(gxHANDLE handle, const char *card, gxVARIANT *cardinfo) { 04432 return pr_getrfidcardinfoa(handle, card, cardinfo); 04433 } 04434 #endif 04435 04445 inline int pr_getcertificateid(gxHANDLE handle, const wchar_t *card,int Authentication, gxVARIANT *CertificateId) { 04446 struct PR_PARM_PRAPI_GETCERTIFICATEID cid; 04447 int ret; 04448 assert(CertificateId); 04449 cid.card = card; 04450 cid.Authentication = Authentication; 04451 ret = gx_call(handle, PR_CALL_PRAPI_GETCERTIFICATEID, &cid); 04452 if(ret && CertificateId) *CertificateId = cid.CertId; 04453 return ret; 04454 } 04455 04465 inline int pr_getcertificateida(gxHANDLE handle, const char *card, int Authentication, gxVARIANT *CertificateId) { 04466 struct PR_PARM_PRAPI_GETCERTIFICATEIDA cid; 04467 int ret; 04468 cid.card = card; 04469 cid.Authentication = Authentication; 04470 assert(CertificateId); 04471 ret = gx_call(handle, PR_CALL_PRAPI_GETCERTIFICATEIDA, &cid); 04472 if(ret && CertificateId) *CertificateId = cid.CertId; 04473 return ret; 04474 } 04475 04476 #ifdef __cplusplus 04477 04486 inline int pr_getcertificateid(gxHANDLE handle, const char *card, int Authentication, gxVARIANT *CertificateId) { 04487 return pr_getcertificateida(handle, card, Authentication, CertificateId); 04488 } 04489 #endif 04490 04491 04502 inline int pr_getnextauthentication(gxHANDLE handle, const wchar_t *card, int *Authentication, int ForceNext GX_DEFARG(false)) { 04503 struct PR_PARM_PRAPI_GETNEXTAUTHENTICATION authproc; 04504 int ret; 04505 authproc.card = card; 04506 authproc.ForceNext = ForceNext; 04507 ret = gx_call(handle, PR_CALL_PRAPI_GETNEXTAUTHENTICATION, &authproc); 04508 *Authentication = authproc.ProcessName; 04509 return ret; 04510 } 04511 04522 inline int pr_getnextauthenticationa(gxHANDLE handle, const char *card, int *Authentication, int ForceNext GX_DEFARG(false)) { 04523 struct PR_PARM_PRAPI_GETNEXTAUTHENTICATIONA authproc; 04524 int ret; 04525 authproc.card = card; 04526 authproc.ForceNext = ForceNext; 04527 ret = gx_call(handle, PR_CALL_PRAPI_GETNEXTAUTHENTICATIONA, &authproc); 04528 *Authentication = authproc.ProcessName; 04529 return ret; 04530 } 04531 04532 #ifdef __cplusplus 04533 04543 inline int pr_getnextauthentication(gxHANDLE handle, const char *card, int *Authentication, int ForceNext = false) { 04544 return pr_getnextauthenticationa(handle, card,Authentication, ForceNext); 04545 } 04546 #endif 04547 04561 inline int pr_doauthentication(gxHANDLE handle, const wchar_t *card, int Authentication, const wchar_t **AuthData GX_DEFARG(0), int Lines GX_DEFARG(0), int PasswordType GX_DEFARG(PR_PACE_PW_MRZ)) { 04562 struct PR_PARM_PRAPI_DOAUTHENTICATION params; 04563 int ret; 04564 params.card = card; 04565 params.ProcessName = Authentication; 04566 params.AuthData = AuthData; 04567 params.Lines = Lines; 04568 params.PasswordType = PasswordType; 04569 ret = gx_call(handle, PR_CALL_PRAPI_DOAUTHENTICATION, ¶ms); 04570 return ret; 04571 } 04572 04586 inline int pr_doauthenticationa(gxHANDLE handle, const char *card, int Authentication, const char **AuthData GX_DEFARG(0), int Lines GX_DEFARG(0), int PasswordType GX_DEFARG(PR_PACE_PW_MRZ)) { 04587 struct PR_PARM_PRAPI_DOAUTHENTICATIONA params; 04588 int ret; 04589 params.card = card; 04590 params.ProcessName = Authentication; 04591 params.AuthData = AuthData; 04592 params.Lines = Lines; 04593 params.PasswordType = PasswordType; 04594 ret = gx_call(handle, PR_CALL_PRAPI_DOAUTHENTICATIONA, ¶ms); 04595 return ret; 04596 } 04597 04598 #ifdef __cplusplus 04599 04612 inline int pr_doauthentication(gxHANDLE handle, const char *card, int Authentication, const char **AuthData GX_DEFARG(0), int Lines GX_DEFARG(0), int PasswordType GX_DEFARG(PR_PACE_PW_MRZ)) { 04613 return pr_doauthenticationa(handle, card,Authentication, AuthData, Lines, PasswordType); 04614 } 04615 #endif 04616 04629 inline int pr_getrfidfilelist(gxHANDLE handle, const wchar_t *card, int **files, int *nfiles) { 04630 struct PR_PARM_PRAPI_GETFILELIST gfl; 04631 int ret; 04632 gfl.card = card; 04633 ret = gx_call(handle, PR_CALL_PRAPI_GETFILELIST, &gfl); 04634 *files = gfl.files; 04635 *nfiles = gfl.nfiles; 04636 return ret; 04637 } 04638 04647 inline int pr_convertfid(gxHANDLE handle, const wchar_t *card, int *file_id) { 04648 int ret; 04649 struct PR_PARM_PRAPI_CONVERTFID cid; 04650 assert(file_id); 04651 cid.card = card; 04652 cid.fid = *file_id; 04653 ret = gx_call(handle, PR_CALL_PRAPI_CONVERTFID, &cid); 04654 if(ret) *file_id = cid.fid; 04655 return ret; 04656 } 04657 04666 inline int pr_getrfidauthresult(gxHANDLE handle, const wchar_t *card, gxVARIANT *pdoc) { 04667 int ret; 04668 struct PR_PARM_PRAPI_GETAUTHRESULT gad; 04669 assert(pdoc); 04670 gad.card = card; 04671 ret = gx_call(handle, PR_CALL_PRAPI_GETAUTHRESULT, &gad); 04672 if(ret) *pdoc = gad.doc; 04673 return ret; 04674 } 04675 04678 #endif /*)*/ 04679 04680 #ifdef GX_DOTNET 04681 #pragma managed 04682 #undef gxPG4 04683 #endif 04684 04685 /******************************************************************************/ 04686 #if !defined(NO_GX_CLASSES) /*(*/ 04687 04695 GX_CLASS prDoc : public gxHandle 04696 #ifdef GX_DOTNET 04697 ,public System::IDisposable 04698 #endif 04699 { 04700 /* Forbidden constructors. */ 04701 inline prDoc() {} 04702 inline prDoc(prDoc &src) {} 04703 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET) 04704 inline prDoc& operator= (prDoc /* src */) { return *this; } 04705 #endif 04706 04707 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL) /*(*/ 04708 protected: 04709 /* Pointer to a document structure of the PR system. */ 04710 gxVARIANT doc; 04711 04712 #endif /* GX_SWIGIF GX_MANUAL )*/ 04713 04714 public: 04715 04717 inline ~prDoc() gxFuncThrowsError { 04718 Free(); 04719 } 04720 04722 inline void Dispose(void) { 04723 #ifdef GX_DOTNET 04724 System::GC::SuppressFinalize(this); 04725 #endif 04726 Free(); 04727 gxHandle::Dispose(); 04728 } 04729 04730 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL) /*(*/ 04731 #ifndef GX_DOTNET 04732 04736 inline operator gxVARIANT () GX_CONST { 04737 return doc; 04738 } 04739 #else 04740 private public: 04741 #endif 04742 04747 inline prDoc(gxVARIANT src, gxHANDLE h) gxFuncThrowsError { 04748 doc = 0; 04749 if(!gx_refhandle(h)) { gxthrow; return; } 04750 #ifdef GX_DOTNET 04751 _set_handle(h.handle); 04752 #else 04753 handle = h.handle; 04754 #endif 04755 if(src && !gx_refvariant(src)) { 04756 gx_pusherror(); 04757 gx_unrefhandle(&h); 04758 #ifdef GX_DOTNET 04759 _handle = 0; 04760 #else 04761 handle = 0; 04762 #endif 04763 gx_poperror(); 04764 gxthrow; 04765 return; 04766 } 04767 doc = src; 04768 } 04769 public: 04770 04771 #endif/* GX_SWIGIF && GX_MANUAL )*/ 04772 04778 inline bool Copy(prDoc &src) gxFuncThrowsError { 04779 gxVARIANT d = doc; 04780 if(d) { 04781 if(!gx_unrefvariant(d)) { 04782 gxthrow; 04783 return false; 04784 } 04785 } 04786 #ifndef GX_DOTNET 04787 bool st = gx_duplicatevariant(&d,src)!=0; 04788 #else 04789 bool st = gx_duplicatevariant(&d,src.doc)!=0; 04790 #endif 04791 if(!st){ 04792 gxthrow; 04793 return false; 04794 } 04795 doc = d; 04796 return true; 04797 } 04798 04803 inline bool Free(void) gxFuncThrowsError { 04804 gxVARIANT d = doc; 04805 if(d) { 04806 if(!gx_unrefvariant(d)) { 04807 gxthrow; 04808 return false; 04809 } 04810 doc = 0; 04811 } 04812 return true; 04813 } 04814 04818 inline gxVariant * ToVariant() gxFuncThrowsError { 04819 gxVARIANT d = doc; 04820 if(!d) { 04821 gxSystem::ClearError(); 04822 return 0; 04823 } 04824 #ifndef GX_DOTNET 04825 gxVariant * vr = new gxVariant(d); 04826 #else 04827 gxVariant * vr = new gxVariant(); 04828 vr->_set_variant(d); 04829 gx_refvariant(d); 04830 #endif 04831 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 04832 return vr; 04833 } 04834 04842 inline prDoc * GetDocPart(int ix) gxFuncThrowsError { 04843 gxVARIANT task; 04844 prDoc *cdoc = 0; 04845 char path[50]; 04846 gx_snprintf(path, 50, "C,D=%i/L,X=%i", PRV_TASKLIST, ix); 04847 if(!gx_getvariantbypath(doc, path, &task)) { 04848 gxthrow; 04849 return cdoc; 04850 } 04851 04852 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 04853 if(task) { 04854 cdoc = new prDoc(task, *this); 04855 gx_unrefvariant(task); 04856 if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 04857 } 04858 #else 04859 GX_GETHANDLE(h); 04860 cdoc = new prDoc(task, h); 04861 if(task) gx_unrefvariant(task); 04862 if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 04863 #endif 04864 if(!task) gxSystem::ClearError(); 04865 return cdoc; 04866 } 04867 04875 inline int Code(void) GX_CONST gxFuncThrowsError { 04876 int code = -1; 04877 GX_GETHANDLE(h); 04878 gxVARIANT d = doc; 04879 if(!pr_getdocumentstatus(h,d,&code,0)) gxthrow; 04880 return code; 04881 } 04882 04891 inline int Status(void) GX_CONST gxFuncThrowsError { 04892 int status = -1; 04893 GX_GETHANDLE(h); 04894 gxVARIANT d = doc; 04895 if(!pr_getdocumentstatus(h,d,0,&status)) gxthrow; 04896 return status; 04897 } 04898 04899 #if !defined(GX_SWIG) && !defined(GX_DOTNET) /*(*/ 04900 04910 inline bool Field(int field_code, char *text, int stext, int index GX_DEFARG(0)) GX_CONST gxFuncThrowsError { 04911 gxassert(text && stext>0); 04912 return Field(field_code, text, &stext, index); 04913 } 04914 04926 inline bool Field(int field_code, char *text, int *stext, int index GX_DEFARG(0)) GX_CONST gxFuncThrowsError { 04927 gxassert(text && stext && *stext>0); 04928 gxVARIANT field=0; 04929 if(field_code>_PR_DF_RFID_FACE) { 04930 if(field_code&0xffff) index += (field_code&0xffff)-1; 04931 field_code &= ~0xffff; 04932 } 04933 if(!pr_getfieldfromdoc(*this, doc, field_code, index, &field)) { 04934 if(gx_geterror()==GX_ENOENT){ 04935 if(text && *stext>0)text[0]=0; 04936 *stext = 1; 04937 return true; 04938 } 04939 gxthrow; 04940 return false; 04941 } 04942 if(!gx_convertvariantchild(field,(int)PRV_FIELDVALUE,0,GXVT GX_VARIANT_ASCII, 04943 stext,0,text,*stext)) { 04944 if(gx_geterror()==GX_ENOENT){ 04945 if(text && *stext>0)text[0]=0; 04946 *stext = 1; 04947 gx_unrefvariant(field); 04948 return true; 04949 } 04950 gx_pusherror(); 04951 gx_unrefvariant(field); 04952 gx_poperror(); 04953 gxthrow; 04954 return false; 04955 } 04956 gx_unrefvariant(field); 04957 return true; 04958 } 04959 04970 inline bool Field(int field_code, wchar_t *text, int stext, int index GX_DEFARG(0)) GX_CONST gxFuncThrowsError { 04971 gxassert(text && stext>0); 04972 return Field(field_code, text, &stext, index); 04973 } 04974 04986 inline bool Field(int field_code, wchar_t *text, int *stext, int index GX_DEFARG(0)) GX_CONST gxFuncThrowsError { 04987 gxassert(text && stext && *stext>0); 04988 gxVARIANT field=0; 04989 if(field_code>_PR_DF_RFID_FACE) { 04990 if(field_code&0xffff) index += (field_code&0xffff)-1; 04991 field_code &= ~0xffff; 04992 } 04993 if(!pr_getfieldfromdoc(*this, doc, field_code, index, &field)) { 04994 if(gx_geterror()==GX_ENOENT){ 04995 if(text && *stext>0)text[0]=0; 04996 *stext = 1; 04997 return true; 04998 } 04999 gxthrow; 05000 return false; 05001 } 05002 if(!gx_convertvariantchild(field,(int)PRV_FIELDVALUE,0,GXVT GX_VARIANT_UNICODE, 05003 stext,0,text,*stext*sizeof(wchar_t))) { 05004 if(gx_geterror()==GX_ENOENT){ 05005 if(text && *stext>0)text[0]=0; 05006 *stext = 1; 05007 gx_unrefvariant(field); 05008 return true; 05009 } 05010 gx_pusherror(); 05011 gx_unrefvariant(field); 05012 gx_poperror(); 05013 gxthrow; 05014 return false; 05015 } 05016 gx_unrefvariant(field); 05017 return true; 05018 } 05019 05030 inline bool Field(int field_code, void *data, int sdata, int index GX_DEFARG(0)) GX_CONST gxFuncThrowsError { 05031 gxassert(data && sdata>0); 05032 return Field(field_code, data, &sdata, index); 05033 } 05034 05046 inline bool Field(int field_code, void *data, int *sdata, int index GX_DEFARG(0)) GX_CONST gxFuncThrowsError { 05047 gxassert(data && sdata && *sdata>0); 05048 gxVARIANT field=0; 05049 if(field_code>_PR_DF_RFID_FACE) { 05050 if(field_code&0xffff) index += (field_code&0xffff)-1; 05051 field_code &= ~0xffff; 05052 } 05053 if(!pr_getfieldfromdoc(*this, doc, field_code, index, &field)) { 05054 if(gx_geterror()==GX_ENOENT){ 05055 *sdata = 0; 05056 return true; 05057 } 05058 gxthrow; 05059 return false; 05060 } 05061 if(!gx_convertvariantchild(field,(int)PRV_FIELDVALUE,0,GXVT GX_VARIANT_BINARY, 05062 sdata,0,data,*sdata)) { 05063 if(gx_geterror()==GX_ENOENT){ 05064 *sdata = 0; 05065 gx_unrefvariant(field); 05066 return true; 05067 } 05068 gx_pusherror(); 05069 gx_unrefvariant(field); 05070 gx_poperror(); 05071 gxthrow; 05072 return false; 05073 } 05074 gx_unrefvariant(field); 05075 return true; 05076 } 05077 05078 #endif /* GX_SWIG GX_DOTNET )*/ 05079 05086 inline gxImage * FieldImage(int field_code) GX_CONST gxFuncThrowsError { 05087 int index = 0; 05088 if(field_code>_PR_DF_RFID_FACE) { 05089 if(field_code&0xffff) index = (field_code&0xffff)-1; 05090 field_code &= ~0xffff; 05091 } 05092 return FieldImage(field_code, index); 05093 } 05094 05103 inline gxImage * FieldImage(int field_code, int index) GX_CONST gxFuncThrowsError { 05104 gxVARIANT vimg = 0; 05105 gxIMAGE *img = 0; 05106 gxImage *cimg = 0; 05107 GX_GETHANDLE(h); 05108 gxVARIANT d = doc; 05109 05110 if(!pr_getfieldimage(h, d, field_code, index ,&vimg)) { 05111 if(gx_geterror()!=GX_ENOENT){ 05112 gxthrow; 05113 return cimg; 05114 } 05115 } 05116 bool ret = true; 05117 if(vimg) { 05118 ret = gx_imagefromvariant(&img,vimg)!=0; 05119 if(!ret)gx_pusherror(); 05120 gx_unrefvariant(vimg); 05121 if(!ret){ 05122 gx_poperror(); 05123 gxthrow; 05124 return cimg; 05125 } 05126 } 05127 05128 if(img){ 05129 #ifndef GX_DOTNET 05130 cimg = new gxImage(*img); 05131 gx_unrefimage(img); 05132 if(!cimg){gxSystem::SetError(GX_ENOMEM);gxthrow;} 05133 #else 05134 cimg = new gxImage(); 05135 if(!cimg){gxSystem::SetError(GX_ENOMEM);gxthrow;} 05136 else cimg->_set_image(img); 05137 #endif 05138 } 05139 else gxSystem::ClearError(); 05140 return cimg; 05141 } 05142 05143 #ifdef GX_UNICODE 05144 05150 inline gxOutStr Field(int field_code) GX_CONST gxFuncThrowsError { 05151 return Field(field_code, 0); 05152 } 05153 05162 inline gxOutStr Field(int field_code, int index) GX_CONST gxFuncThrowsError { 05163 wchar_t fieldbuf[GX_MAXLEN_STRING+1]; 05164 GX_GETHANDLE(h); 05165 gxVARIANT d = doc; 05166 gxVARIANT field=0; 05167 if(!pr_getfieldfromdoc(h, d, field_code, index, &field)) { 05168 if(gx_geterror()==GX_ENOENT){ 05169 fieldbuf[0]=0; 05170 return GX_PUTSTRING(fieldbuf); 05171 } 05172 gxthrow; 05173 return GX_PUTSTRING_NONE; 05174 } 05175 int s=GX_MAXLEN_STRING; 05176 if(!gx_convertvariantchild(field,(int)PRV_FIELDVALUE,0,GXVT GX_VARIANT_UNICODE, 05177 &s,0,fieldbuf,s*sizeof(wchar_t))) { 05178 if(gx_geterror()==GX_ENOENT){ 05179 fieldbuf[0]=0; 05180 gx_unrefvariant(field); 05181 return GX_PUTSTRING(fieldbuf); 05182 } 05183 gx_pusherror(); 05184 gx_unrefvariant(field); 05185 gx_poperror(); 05186 gxthrow; 05187 return GX_PUTSTRING_NONE; 05188 } 05189 gx_unrefvariant(field); 05190 fieldbuf[GX_MAXLEN_STRING] = 0; 05191 return GX_PUTSTRING(fieldbuf); 05192 } 05193 #endif/* GX_UNICODE */ 05194 05195 #ifdef GX_ASCII 05196 05202 inline gxOutAStr FieldA(int field_code) GX_CONST gxFuncThrowsError { 05203 return FieldA(field_code, 0); 05204 } 05205 05214 inline gxOutAStr FieldA(int field_code, int index) GX_CONST gxFuncThrowsError { 05215 char fieldbuf[GX_MAXLEN_STRING+1]; 05216 GX_GETHANDLE(h); 05217 gxVARIANT d = doc; 05218 gxVARIANT field=0; 05219 if(!pr_getfieldfromdoc(h, d, field_code, index, &field)) { 05220 if(gx_geterror()==GX_ENOENT){ 05221 fieldbuf[0]=0; 05222 return GX_PUTASTRING(fieldbuf); 05223 } 05224 gxthrow; 05225 return GX_PUTASTRING_NONE; 05226 } 05227 int s=GX_MAXLEN_STRING; 05228 if(!gx_convertvariantchild(field,(int)PRV_FIELDVALUE,0,GXVT GX_VARIANT_ASCII, 05229 &s,0,fieldbuf,s)) { 05230 if(gx_geterror()==GX_ENOENT){ 05231 fieldbuf[0]=0; 05232 gx_unrefvariant(field); 05233 return GX_PUTASTRING(fieldbuf); 05234 } 05235 gx_pusherror(); 05236 gx_unrefvariant(field); 05237 gx_poperror(); 05238 gxthrow; 05239 return GX_PUTASTRING_NONE; 05240 } 05241 gx_unrefvariant(field); 05242 fieldbuf[GX_MAXLEN_STRING] = 0; 05243 return GX_PUTASTRING(fieldbuf); 05244 } 05245 #endif/* GX_ASCII */ 05246 05247 #if defined(GX_SWIG) || defined(GX_DOTNET) 05248 05256 inline gxOutData FieldB(int field_code, int index) GX_CONST gxFuncThrowsError { 05257 GX_GETHANDLE(h); 05258 gxVARIANT d = doc; 05259 gxVARIANT field, data = 0; 05260 if(!pr_getfieldfromdoc(h, d, field_code, index, &field)) { 05261 if(gx_geterror()!=GX_ENOENT) { 05262 gxthrow; 05263 } 05264 return GX_PUTDATA_NONE; 05265 } 05266 int id = PRV_FIELDVALUE; 05267 if(!gx_getvariantchild(field, GXVF GX_VARIANT_BY_ID, &id, 0, &data)) { 05268 gx_pusherror(); 05269 gx_unrefvariant(field); 05270 gx_poperror(); 05271 if(gx_geterror()!=GX_ENOENT) { 05272 gxthrow; 05273 } 05274 return GX_PUTDATA_NONE; 05275 } 05276 gx_disposevariant(&field); 05277 05278 int size = 0; 05279 gxu8 *fieldbuf = 0; 05280 int ret = 0; 05281 if(gx_getvariant(data, 0, 0, &size, 0, 0)) { 05282 fieldbuf = new gxu8[size]; 05283 if(!fieldbuf) gx_seterror(GX_ENOENT); 05284 else if(gx_convertvariant(data, 0, GXVT GX_VARIANT_BINARY, &size, 0, fieldbuf, size)) 05285 ret = 1; 05286 } 05287 05288 if(!ret) gx_pusherror(); 05289 gx_unrefvariant(data); 05290 if(!ret) { 05291 delete [] fieldbuf; 05292 gx_poperror(); 05293 gxthrow; 05294 return GX_PUTDATA_NONE; 05295 } 05296 05297 gxOutData od = GX_PUTDATA(fieldbuf, size); 05298 delete [] fieldbuf; 05299 return od; 05300 } 05301 #endif/* GX_SWIG GX_DOTNET */ 05302 05311 inline gxVariant * FieldV(int field_code, int index) GX_CONST gxFuncThrowsError { 05312 GX_GETHANDLE(h); 05313 gxVARIANT d = doc; 05314 gxVARIANT field=0; 05315 if(!pr_getfieldfromdoc(h, d, field_code, index, &field)) { 05316 gxthrow; 05317 return 0; 05318 } 05319 #ifndef GX_DOTNET 05320 gxVariant * vr = new gxVariant(field); 05321 gx_unrefvariant(field); 05322 #else 05323 gxVariant * vr = new gxVariant(); 05324 vr->_set_variant(field); 05325 #endif 05326 if(!vr){gxSystem::SetError(GX_ENOMEM);gxthrow;} 05327 return vr; 05328 } 05329 05339 inline int FieldStatus(int field_code) GX_CONST gxFuncThrowsError { 05340 return FieldStatus(field_code, 0); 05341 } 05342 05354 inline int FieldStatus(int field_code, int index) GX_CONST gxFuncThrowsError { 05355 int status = -1; 05356 GX_GETHANDLE(h); 05357 gxVARIANT d = doc; 05358 gxVARIANT field=0; 05359 if(!pr_getfieldfromdoc(h, d, field_code, index, &field)) { 05360 if(gx_geterror()==GX_ENOENT){ 05361 return 1; 05362 } 05363 gxthrow; 05364 return -1; 05365 } 05366 int s=4; 05367 if(!gx_convertvariantchild(field,(int)PRV_CHECKSUM,0,GXVT GX_VARIANT_INT, 05368 &s,0,&status,s)) { 05369 if(gx_geterror()==GX_ENOENT){ 05370 gx_unrefvariant(field); 05371 return 1; 05372 } 05373 gx_pusherror(); 05374 gx_unrefvariant(field); 05375 gx_poperror(); 05376 gxthrow; 05377 return -1; 05378 } 05379 gx_unrefvariant(field); 05380 return status; 05381 } 05382 05383 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 05384 05394 inline bool Prop(int field_code, int prop_code, void* data, int *sdata, int *data_type) GX_CONST gxFuncThrowsError { 05395 GX_GETHANDLE(h); 05396 gxVARIANT d = doc; 05397 bool st = pr_getpropfromdoc(h,d,field_code, prop_code, data, sdata, data_type) != 0; 05398 gxcondthrow(!st); 05399 return st; 05400 } 05401 #else 05402 05408 inline gxOutData PropB(int field_code, int prop_code) GX_CONST gxFuncThrowsError { 05409 const int sdata = 200*1024; 05410 char data[sdata]; 05411 int data_type; 05412 int size = sdata; 05413 GX_GETHANDLE(h); 05414 gxVARIANT d = doc; 05415 if(!pr_getpropfromdoc(h,d,field_code, prop_code, data, &size, &data_type)) { 05416 gxthrow; 05417 return GX_PUTDATA_NONE; 05418 } 05419 return GX_PUTDATA(data, size); 05420 } 05421 #endif/* GX_SWIG GX_DOTNET */ 05422 05429 inline int PropI32(int field_code, int prop_code) GX_CONST gxFuncThrowsError { 05430 int data; 05431 int sdata = 4; 05432 int data_type; 05433 GX_GETHANDLE(h); 05434 gxVARIANT d = doc; 05435 bool st = pr_getpropfromdoc(h,d,field_code, prop_code, &data, &sdata, &data_type) != 0; 05436 gxcondthrow(!st); 05437 return st?data:0; 05438 } 05439 05447 inline int PropType(int field_code, int prop_code) GX_CONST gxFuncThrowsError { 05448 int data_type; 05449 int sdata; 05450 GX_GETHANDLE(h); 05451 gxVARIANT d = doc; 05452 bool st = pr_getpropfromdoc(h,d,field_code, prop_code, 0, &sdata, &data_type) != 0; 05453 gxcondthrow(!st); 05454 return st ? 0 : data_type; 05455 } 05456 05461 inline bool IsValid(void) GX_CONST { 05462 if(!gxHandle::IsValid())return false; 05463 return doc != 0 ? true : false; 05464 } 05465 05466 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 05467 05474 inline bool Save(const wchar_t *filename, int filetype = PR_DFF_ZIPPED) GX_CONST gxFuncThrowsError { 05475 bool st = pr_savedocument(*this,doc,filename,filetype)!=0; 05476 gxcondthrow(!st); 05477 return st; 05478 } 05479 05487 inline bool Save(const char *filename, int filetype = PR_DFF_ZIPPED) GX_CONST gxFuncThrowsError { 05488 bool st = pr_savedocument(*this,doc,filename,filetype)!=0; 05489 gxcondthrow(!st); 05490 return st; 05491 } 05492 05501 inline bool SaveToMem(gxu8 **buffer, int *buflen, int filetype = PR_DFF_XML) GX_CONST gxFuncThrowsError { 05502 bool st = pr_savedocumenttomem(*this, doc, buffer, buflen, filetype)!=0; 05503 gxcondthrow(!st); 05504 return st; 05505 } 05506 #endif 05507 05508 #ifdef GX_UNICODE 05509 05516 inline bool Save(gxInStr filename, int filetype GX_DEFARG(PR_DFF_ZIPPED)) GX_CONST gxFuncThrowsError { 05517 GX_GETHANDLE(h); 05518 gxVARIANT d = doc; 05519 GX_GETSTRING(_filename, filename); 05520 bool st = pr_savedocument(h,d,_filename,filetype)!=0; 05521 gxcondthrow(!st); 05522 return st; 05523 } 05524 #endif 05525 05526 #ifdef GX_ASCII 05527 05534 inline bool Save(gxInAStr filename, int filetype GX_DEFARG(PR_DFF_ZIPPED)) GX_CONST gxFuncThrowsError { 05535 GX_GETHANDLE(h); 05536 gxVARIANT d = doc; 05537 GX_GETASTRING(_filename, filename); 05538 bool st = pr_savedocument(h,d,_filename,filetype)!=0; 05539 gxcondthrow(!st); 05540 return st; 05541 } 05542 #endif 05543 05544 #if defined(GX_SWIG) || defined(GX_DOTNET) 05545 05550 inline gxOutData SaveToMem(int filetype GX_DEFARG(PR_DFF_XML)) GX_CONST gxFuncThrowsError { 05551 gxu8 *buffer; 05552 int buflen; 05553 GX_GETHANDLE(h); 05554 gxVARIANT d = doc; 05555 if(!pr_savedocumenttomem(h, d, &buffer, &buflen, filetype)) { 05556 gxthrow; 05557 return GX_PUTDATA_NONE; 05558 } 05559 gxOutData ret = GX_PUTDATA(buffer, buflen); 05560 if(buffer) gx_globalfree(buffer); 05561 return ret; 05562 } 05563 #endif 05564 05565 }; 05566 05569 /******************************************************************************/ 05570 05574 GX_CLASS prImage 05575 #ifdef GX_DOTNET 05576 : public System::IDisposable 05577 #endif 05578 { 05579 /* Forbidden constructors. */ 05580 inline prImage() {} 05581 inline prImage(prImage & /* src */) {} 05582 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET) 05583 inline prImage& operator= (prImage /* src */) { return *this; } 05584 #endif 05585 05586 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL) /*(*/ 05587 private: 05588 /* Pointer to the image structure in the PR system. */ 05589 gxVARIANT image; 05590 05591 #endif /* GX_SWIGIF GX_MANUAL )*/ 05592 05593 public: 05594 05596 inline ~prImage() gxFuncThrowsError { 05597 Detach(); 05598 } 05599 05601 inline void Dispose(void) { 05602 #ifdef GX_DOTNET 05603 System::GC::SuppressFinalize(this); 05604 #endif 05605 Detach(); 05606 } 05607 05608 #if !defined(GX_SWIGIF) /*(*/ 05609 #ifndef GX_DOTNET 05610 05614 inline operator gxVARIANT () GX_CONST { 05615 return image; 05616 } 05617 #else 05618 private public: 05619 #endif 05620 05625 inline prImage(gxVARIANT src) gxFuncThrowsError { 05626 image = 0; 05627 if(src && !gx_refvariant(src)) { 05628 gxthrow; 05629 return; 05630 } 05631 image = src; 05632 } 05633 public: 05634 05635 #endif/* GX_SWIGIF )*/ 05636 05637 #if !defined(GX_SWIG) && !defined(GX_DOTNET) /*(*/ 05638 05644 inline bool Attach(gxVARIANT src) gxFuncThrowsError { 05645 if(!gx_refvariant(src)){ 05646 gxthrow; 05647 return false; 05648 } 05649 if(image) 05650 if(!gx_unrefvariant(image)){ 05651 gx_pusherror(); 05652 gx_unrefvariant(src); 05653 gx_poperror(); 05654 gxthrow; 05655 return false; 05656 } 05657 image = src; 05658 return true; 05659 } 05660 #endif /*)*/ 05661 05667 inline bool Attach(prImage &src) gxFuncThrowsError { 05668 if(!gx_refvariant(src.image)) { 05669 gxthrow; 05670 return false; 05671 } 05672 if(image) { 05673 if(!gx_unrefvariant(image)) { 05674 gx_pusherror(); 05675 gx_unrefvariant(src.image); 05676 gx_poperror(); 05677 gxthrow; 05678 return false; 05679 } 05680 } 05681 #ifndef GX_DOTNET 05682 image = src; 05683 #else 05684 image = src.image; 05685 #endif 05686 return true; 05687 } 05688 05693 inline bool Detach(void) gxFuncThrowsError { 05694 if(image){ 05695 if(!gx_unrefvariant(image)) { 05696 gxthrow; 05697 return false; 05698 } 05699 image = 0; 05700 } 05701 return true; 05702 } 05703 05704 #if !defined(GX_SWIG) && !defined(GX_DOTNET) /*(*/ 05705 05710 inline gxIMAGE* GxImage(void) const gxFuncThrowsError { 05711 gxIMAGE *gim; 05712 gxassert(image); 05713 if(!image) return 0; 05714 if(!gx_imagefromvariant(&gim,image)){ 05715 gxthrow; 05716 return 0; 05717 } 05718 return gim; 05719 } 05720 05726 inline const gxTRAFO* Trafo(void) const gxFuncThrowsError { 05727 gxVARIANT vt; 05728 gxTRAFO *trf; 05729 gxassert(image); 05730 if(!image) return 0; 05731 if(!gx_getvariantchild(image,GX_VARIANT_BY_ID,(int)PRV_TRAFO,0,&vt)){ 05732 gxthrow; 05733 return 0; 05734 } 05735 if(!gx_trafofromvariant(&trf,vt)){ 05736 gx_pusherror(); 05737 gx_unrefvariant(vt); 05738 gx_poperror(); 05739 gxthrow; 05740 return 0; 05741 } 05742 gx_unrefvariant(vt); 05743 return trf; 05744 } 05745 #else /*)(*/ 05746 05751 inline gxImage * GxImage(void) GX_CONST gxFuncThrowsError { 05752 gxIMAGE *gim; 05753 gxassert(image); 05754 if(!image)return 0; 05755 if(!gx_imagefromvariant(&gim,image)){ 05756 gxthrow; 05757 return 0; 05758 } 05759 gxImage *im = new gxImage(); 05760 #ifndef GX_DOTNET 05761 gxtry { 05762 if(gim)im->Attach(gim); 05763 } gxcatch(...) { 05764 gx_pusherror(); 05765 if(gim)gx_unrefimage(gim); 05766 delete im; 05767 gx_poperror(); 05768 __gxthrow; 05769 return 0; 05770 } 05771 if(gim)gx_unrefimage(gim); 05772 #else 05773 if(gim) im->_set_image(gim); 05774 #endif 05775 return im; 05776 } 05777 05783 inline gxTrafo* Trafo(void) GX_CONST gxFuncThrowsError { 05784 gxVARIANT vt; 05785 gxTRAFO *trf; 05786 gxassert(image); 05787 if(!image)return 0; 05788 if(!gx_getvariantchild(image,GXVF GX_VARIANT_BY_ID,(int)PRV_TRAFO,0,&vt)){ 05789 gxthrow; 05790 return 0; 05791 } 05792 if(!gx_trafofromvariant(&trf,vt)){ 05793 gx_pusherror(); 05794 gx_unrefvariant(vt); 05795 gx_poperror(); 05796 gxthrow; 05797 return 0; 05798 } 05799 gx_unrefvariant(vt); 05800 gxTrafo *tr=new gxTrafo(); 05801 #ifndef GX_DOTNET 05802 gxtry { 05803 if(trf)tr->Attach(trf); 05804 } gxcatch(...) { 05805 gx_pusherror(); 05806 if(trf)gx_unreftrafo(trf); 05807 delete tr; 05808 gx_poperror(); 05809 __gxthrow; 05810 return 0; 05811 } 05812 if(trf)gx_unreftrafo(trf); 05813 #else 05814 tr->_set_trafo(trf); 05815 #endif 05816 return tr; 05817 } 05818 #endif /* GX_SWIG GX_DOTNET )*/ 05819 05820 05826 inline int CaptureTime(void) GX_CONST gxFuncThrowsError { 05827 int s=sizeof(gxi64); 05828 gxi64 captime; 05829 gxassert(image); 05830 if(!image) return 0; 05831 if(!gx_convertvariantchild(image,(int)PRV_CAPTIME,0,GX_VARIANT_INT,&s,0,&captime,s)) { 05832 gxthrow; 05833 return 0; 05834 } 05835 return int(captime/1000); 05836 } 05837 05843 inline int Page(void) GX_CONST gxFuncThrowsError { 05844 int s=sizeof(int), page; 05845 gxassert(image); 05846 if(!image) return 0; 05847 if(!gx_convertvariantchild(image,(int)PRV_PAGE,0,GX_VARIANT_INT,&s,0,&page,s)) { 05848 gxthrow; 05849 return 0; 05850 } 05851 return page; 05852 } 05853 05859 inline int Page(int page) gxFuncThrowsError { 05860 gxVARIANT vpage; 05861 gxassert(image); 05862 if(!image) return page; 05863 if(!gx_getvariantchild(image,GX_VARIANT_BY_ID,(int)PRV_PAGE,0,&vpage)) return page; 05864 if(!gx_updatevariantdata(vpage,(int)PRV_PAGE,GX_VARIANT_INT,sizeof(int),1,&page)) { 05865 gx_pusherror(); 05866 gx_unrefvariant(vpage); 05867 gx_poperror(); 05868 gxthrow; 05869 return page; 05870 } 05871 gx_unrefvariant(vpage); 05872 return page; 05873 } 05874 05881 inline int Light(void) GX_CONST gxFuncThrowsError { 05882 int s=sizeof(int), light; 05883 gxassert(image); 05884 if(!image) return 0; 05885 if(!gx_convertvariantchild(image,(int)PRV_LIGHT,0,GX_VARIANT_INT,&s,0,&light,s)) { 05886 gxthrow; 05887 return 0; 05888 } 05889 return light; 05890 } 05891 05897 inline int Camera(void) GX_CONST gxFuncThrowsError { 05898 int s=sizeof(int), camera; 05899 gxassert(image); 05900 if(!image) return 0; 05901 if(!gx_convertvariantchild(image,(int)PRV_CAMERA,0,GX_VARIANT_INT,&s,0,&camera,s)) { 05902 gxthrow; 05903 return 0; 05904 } 05905 return camera; 05906 } 05907 05912 inline bool IsValid(void) GX_CONST { 05913 size_t t = (size_t)this; 05914 if(!(t && t>>16)) return false; 05915 return image ? true : false; 05916 } 05917 05918 }; 05919 05920 /******************************************************************************/ 05921 05922 #ifndef GX_MANUAL 05923 #if !defined(GX_SWIG) && !defined(GX_DOTNET) // C++ 05924 #define ifDoc if(doc) 05925 #else 05926 #define ifDoc 05927 #endif 05928 #endif/* GX_MANUAL */ 05929 05934 GX_CLASS PassportReader : public gxHandle 05935 #ifdef GX_DOTNET 05936 ,public System::IDisposable 05937 #endif 05938 { 05939 05940 public: 05941 05943 inline PassportReader() gxFuncThrowsError { 05944 #ifndef GX_DOTNET 05945 if(!gx_openmodule(this, L"prapi", L"default")) gxthrow; 05946 #else 05947 GX_GETHANDLE(h); 05948 if(!gx_openmodule(&h, L"prapi", L"default")) gxthrow; 05949 _set_handle(h.handle); 05950 #endif 05951 } 05952 05953 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 05954 05957 inline PassportReader(const wchar_t *proppath) gxFuncThrowsError { 05958 if(!gx_openmodule(this, L"prapi", proppath)) gxthrow; 05959 } 05960 05964 inline PassportReader(const char *proppath) gxFuncThrowsError { 05965 if(!gx_openmodule(this, "prapi", proppath)) gxthrow; 05966 } 05967 #endif 05968 05969 #ifdef GX_UNICODE 05970 05973 inline PassportReader(gxInStr proppath) gxFuncThrowsError { 05974 GX_GETSTRING(_proppath, proppath); 05975 #ifndef GX_DOTNET 05976 if(!gx_openmodule(this, L"prapi", _proppath)) gxthrow; 05977 #else 05978 GX_GETHANDLE(h); 05979 if(!gx_openmodule(&h, L"prapi", _proppath)) gxthrow; 05980 _set_handle(h.handle); 05981 #endif 05982 } 05983 #endif 05984 05985 #ifdef GX_ASCII 05986 05989 inline PassportReader(gxInAStr proppath) gxFuncThrowsError { 05990 GX_GETASTRING(_proppath, proppath); 05991 if(!gx_openmodule(this, "prapi", _proppath)) gxthrow; 05992 } 05993 #endif 05994 05996 inline void Dispose(void) { 05997 #ifdef GX_DOTNET 05998 System::GC::SuppressFinalize(this); 05999 #endif 06000 gxHandle::Dispose(); 06001 } 06002 06003 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06004 06014 inline bool GetDeviceList(wchar_t ***devices,int *ndevices) gxFuncThrowsError { 06015 bool st = pr_getdevicelist(*this,devices,ndevices)!=0; 06016 gxcondthrow(!st); 06017 return st; 06018 } 06019 06030 inline bool GetDeviceList(char ***devices,int *ndevices) gxFuncThrowsError { 06031 bool st = pr_getdevicelist(*this,devices,ndevices)!=0; 06032 gxcondthrow(!st); 06033 return st; 06034 } 06035 #endif 06036 06037 #ifdef GX_UNICODE 06038 06042 inline gxOutStrArray GetDeviceList(void) gxFuncThrowsError { 06043 wchar_t **devices; 06044 int ndevices = 0; 06045 GX_GETHANDLE(h); 06046 if(!pr_getdevicelist(h,&devices,&ndevices)) { 06047 gxthrow; 06048 return GX_PUTGSTRINGARRAY_NONE; 06049 } 06050 return GX_PUTGSTRINGARRAY(devices, ndevices, true); 06051 } 06052 #endif 06053 06054 #ifdef GX_ASCII 06055 06059 inline gxOutAStrArray GetDeviceListA(void) gxFuncThrowsError { 06060 char **devices; 06061 int ndevices = 0; 06062 if(!pr_getdevicelist(*this,&devices,&ndevices)) { 06063 gxthrow; 06064 return GX_PUTGASTRINGARRAY_NONE; 06065 } 06066 return GX_PUTGASTRINGARRAY(devices, ndevices, true); 06067 } 06068 #endif 06069 06070 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06071 06082 inline bool UseDevice(wchar_t *device,int mode) gxFuncThrowsError { 06083 bool st = pr_usedevice(*this,device,mode)!=0; 06084 gxcondthrow(!st); 06085 return st; 06086 } 06087 06099 inline bool UseDevice(char *device,int mode) gxFuncThrowsError { 06100 bool st = pr_usedevice(*this,device,mode)!=0; 06101 gxcondthrow(!st); 06102 return st; 06103 } 06104 #endif 06105 06106 #ifdef GX_UNICODE 06107 06118 inline bool UseDevice(gxInStr device,int mode) gxFuncThrowsError { 06119 GX_GETSTRING(_device, device); 06120 GX_GETHANDLE(h); 06121 bool st = pr_usedevice(h, _device,mode)!=0; 06122 gxcondthrow(!st); 06123 return st; 06124 } 06125 #endif 06126 06127 #ifdef GX_ASCII 06128 06139 inline bool UseDevice(gxInAStr device,int mode) gxFuncThrowsError { 06140 GX_GETASTRING(_device, device); 06141 GX_GETHANDLE(h); 06142 bool st = pr_usedevice(h, _device,mode)!=0; 06143 gxcondthrow(!st); 06144 return st; 06145 } 06146 #endif 06147 06157 inline bool UseDevice(int devno,int mode) gxFuncThrowsError { 06158 GX_GETHANDLE(h); 06159 bool st = pr_usedevice(h,devno,mode)!=0; 06160 gxcondthrow(!st); 06161 return st; 06162 } 06163 06169 inline bool CloseDevice(void) gxFuncThrowsError { 06170 GX_GETHANDLE(h); 06171 bool st = pr_closedevice(h)!=0; 06172 gxcondthrow(!st); 06173 return st; 06174 } 06175 06176 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06177 06182 inline gxHANDLE * GetDeviceHandle(void) { 06183 gxHANDLE *hctrl; 06184 return pr_getctrlhandle(*this,&hctrl) ? hctrl : (gxHANDLE*)0; 06185 } 06186 #endif 06187 06199 inline bool Calibrate(int windowid GX_DEFARG(0)) gxFuncThrowsError { 06200 GX_GETHANDLE(h); 06201 bool st = pr_calibrate(h,windowid)!=0; 06202 gxcondthrow(!st); 06203 return st; 06204 } 06205 06214 inline bool IsCalibrated(int windowid GX_DEFARG(0)) { 06215 GX_GETHANDLE(h); 06216 return pr_iscalibrated(h,windowid)!=0; 06217 } 06218 06231 inline int TestDocument(int windowid GX_DEFARG(0)) { 06232 int state; 06233 GX_GETHANDLE(h); 06234 return pr_testdocument(h,&state,windowid) ? state : -1; 06235 } 06236 06242 inline int Lights(void) { 06243 int lights; 06244 GX_GETHANDLE(h); 06245 return pr_getlightnumber(h,&lights) ? lights : 0; 06246 } 06247 06254 inline int LightListItem(int itemno) { 06255 int lights[MAX_LIGHTS]; 06256 if(itemno>=MAX_LIGHTS)return 0; 06257 GX_GETHANDLE(h); 06258 return pr_getlightlist(h,lights,MAX_LIGHTS) ? lights[itemno] : 0; 06259 } 06260 06276 inline int LightMask(int lightid,int windowid) { 06277 int lightmask; 06278 GX_GETHANDLE(h); 06279 return pr_getlightmask(h,&lightmask,lightid,windowid) ? lightmask : 0; 06280 } 06281 06287 inline int ObjectWindows(void) { 06288 int windows; 06289 GX_GETHANDLE(h); 06290 return pr_getwindownumber(h,&windows) ? windows : 0; 06291 } 06292 06301 inline bool SetStatusLed(int ledmask, int color) gxFuncThrowsError { 06302 GX_GETHANDLE(h); 06303 bool st = pr_setstatusled(h, ledmask, color)!=0; 06304 gxcondthrow(!st); 06305 return st; 06306 } 06307 06308 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06309 06322 inline bool BlinkStatus(int coding, int mask, int type, int iteration, unsigned int *data, unsigned int datalength) gxFuncThrowsError { 06323 GX_GETHANDLE(h); 06324 bool st = pr_blinkstatus(h, coding, mask, type, iteration, data, datalength)!=0; 06325 gxcondthrow(!st); 06326 return st; 06327 } 06328 #endif 06329 06330 #ifndef NO_GX_STL 06331 06344 inline bool BlinkStatus(int coding, int mask, int type, int iteration, gxInIntArray data) gxFuncThrowsError { 06345 GX_GETHANDLE(h); 06346 GX_GETININTARRAY(data); 06347 bool st = pr_blinkstatus(h, coding, mask, type, iteration,(unsigned int *)GX_GETININTARRAY_PTR(data), GX_GETININTARRAY_LEN(data))!=0; 06348 GX_FREEININTARRAY(data); 06349 gxcondthrow(!st); 06350 return st; 06351 } 06352 #endif 06353 06358 inline int TestPowerState(void) { 06359 int state; 06360 GX_GETHANDLE(h); 06361 return pr_testpower(h,&state,0) ? state : -1; 06362 } 06363 06370 inline int TestPowerLevel(void) { 06371 int state,level; 06372 GX_GETHANDLE(h); 06373 return pr_testpower(h,&state,&level) ? level : -1; 06374 } 06375 06381 inline int TestButton(int keycode) { 06382 int state; 06383 GX_GETHANDLE(h); 06384 return pr_testbutton(h,keycode,&state) ? state : -1; 06385 } 06386 06396 inline bool Suspend() gxFuncThrowsError { 06397 GX_GETHANDLE(h); 06398 bool st = pr_suspend(h)!=0; 06399 gxcondthrow(!st); 06400 return st; 06401 } 06402 06408 inline bool WakeUp() gxFuncThrowsError { 06409 GX_GETHANDLE(h); 06410 bool st = pr_wakeup(h)!=0; 06411 gxcondthrow(!st); 06412 return st; 06413 } 06414 06415 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06416 06423 inline bool GetUDInfo(int *nblocks, int *sblock) gxFuncThrowsError { 06424 GX_GETHANDLE(h); 06425 bool st = pr_getudinfo(h, nblocks, sblock) != 0; 06426 gxcondthrow(!st); 06427 return st; 06428 } 06429 06441 inline bool ReadUData(int fblock, int nblocks, void **data) gxFuncThrowsError { 06442 GX_GETHANDLE(h); 06443 bool st = pr_readudata(h, fblock, nblocks, data) != 0; 06444 gxcondthrow(!st); 06445 return st; 06446 } 06447 06456 inline bool WriteUData(int fblock, int nblocks, const void *data) gxFuncThrowsError { 06457 GX_GETHANDLE(h); 06458 bool st = pr_writeudata(h, fblock, nblocks, data) != 0; 06459 gxcondthrow(!st); 06460 return st; 06461 } 06462 #else 06463 06471 inline gxOutData ReadUData(int fblock, int nblocks) gxFuncThrowsError { 06472 GX_GETHANDLE(h); 06473 void *data; 06474 if (pr_readudata(h, fblock, nblocks, &data) == 0) { 06475 gxthrow; 06476 return GX_PUTDATA_NONE; 06477 } 06478 int i,sblock; 06479 if (pr_getudinfo(h, &i, &sblock) == 0) { 06480 gxthrow; 06481 return GX_PUTDATA_NONE; 06482 } 06483 i=nblocks*sblock; 06484 gxOutData od = GX_PUTDATA(data, i); 06485 if(data) gx_globalfree(data); 06486 return od; 06487 } 06488 06497 inline bool WriteUData(int fblock, int nblocks, gxInData data) gxFuncThrowsError { 06498 GX_GETHANDLE(h); 06499 GX_GETDATA(data); 06500 bool st = pr_writeudata(h, fblock, nblocks, GX_DATAPTR(data)) != 0; 06501 gxcondthrow(!st); 06502 return st; 06503 } 06504 #endif /* GX_SWIG && GX_DOTNET */ 06505 06511 inline int GetUDNumberOfBlocks(void) gxFuncThrowsError { 06512 GX_GETHANDLE(h); 06513 int nblocks; 06514 int sblock; 06515 bool st = pr_getudinfo(h, &nblocks, &sblock) != 0; 06516 gxcondthrow(!st); 06517 return st ? nblocks : -1; 06518 } 06519 06525 inline int GetUDBlockSize(void) gxFuncThrowsError { 06526 GX_GETHANDLE(h); 06527 int nblocks; 06528 int sblock; 06529 bool st = pr_getudinfo(h, &nblocks, &sblock) != 0; 06530 gxcondthrow(!st); 06531 return st ? sblock : -1; 06532 } 06533 06538 inline gxVariant * GetDeviceInfo() gxFuncThrowsError { 06539 GX_GETHANDLE(h); 06540 gxVARIANT d; 06541 bool st = pr_getdeviceinfo(h,&d) != 0; 06542 gxcondthrow(!st); 06543 if(st) gxSystem::ClearError(); 06544 if(!d) return 0; 06545 #ifndef GX_DOTNET 06546 gxVariant * vr = new gxVariant(d); 06547 gx_unrefvariant(d); 06548 #else 06549 gxVariant * vr = new gxVariant(); 06550 vr->_set_variant(d); 06551 #endif 06552 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 06553 return vr; 06554 } 06555 06563 inline gxVariant * SelfTest(int condition) gxFuncThrowsError { 06564 GX_GETHANDLE(h); 06565 gxVARIANT result; 06566 bool st = pr_selftest(h, condition, &result)!=0; 06567 gxcondthrow(!st); 06568 if(st) gxSystem::ClearError(); 06569 if (!result) return 0; 06570 #ifndef GX_DOTNET 06571 gxVariant * vr = new gxVariant(result); 06572 gx_unrefvariant(result); 06573 #else 06574 gxVariant * vr = new gxVariant(); 06575 vr->_set_variant(result); 06576 #endif 06577 if (!vr) { gxSystem::SetError(GXEC GX_ENOMEM); gxthrow; } 06578 return vr; 06579 } 06580 06581 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06582 06591 inline bool ReadMagstripe(wchar_t ***tracks, int *ntracks) gxFuncThrowsError { 06592 bool st = pr_readmagstripe(*this, tracks, ntracks)!=0; 06593 gxcondthrow(!st); 06594 return st; 06595 } 06596 06606 inline bool ReadMagstripe(char ***tracks, int *ntracks) gxFuncThrowsError { 06607 bool st = pr_readmagstripe(*this, tracks, ntracks)!=0; 06608 gxcondthrow(!st); 06609 return st; 06610 } 06611 #endif 06612 06613 #ifdef GX_UNICODE 06614 06618 inline gxOutStrArray ReadMagstripe(void) gxFuncThrowsError { 06619 wchar_t **tracks; 06620 int ntracks = 0; 06621 GX_GETHANDLE(h); 06622 if(!pr_readmagstripe(h, &tracks, &ntracks)) { 06623 gxthrow; 06624 return GX_PUTGSTRINGARRAY_NONE; 06625 } 06626 return GX_PUTGSTRINGARRAY(tracks, ntracks, true); 06627 } 06628 #endif 06629 06630 #ifdef GX_ASCII 06631 06635 inline gxOutAStrArray ReadMagstripeA(void) gxFuncThrowsError { 06636 char **tracks; 06637 int ntracks = 0; 06638 GX_GETHANDLE(h); 06639 if(!pr_readmagstripe(h, &tracks, &ntracks)) { 06640 gxthrow; 06641 return GX_PUTGASTRINGARRAY_NONE; 06642 } 06643 return GX_PUTGASTRINGARRAY(tracks, ntracks, true); 06644 } 06645 #endif 06646 06647 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET) 06648 06659 inline bool SetEventFunction(PR_EVFUNC *eventhandler,void *param) { 06660 return pr_seteventfunction(*this,eventhandler,param)!=0; 06661 } 06662 #endif 06663 06664 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_SWIG) 06665 06682 #ifndef GX_DOTNET 06683 inline bool BeginWindowMessaging(HWND hwnd, UINT base_msg GX_DEFARG(WM_USER)) gxFuncThrowsError { 06684 bool st = pr_beginwindowmessaging(*this,hwnd, base_msg)!=0; 06685 gxcondthrow(!st); 06686 return st; 06687 } 06688 #else 06689 inline bool BeginWindowMessaging(gxInPtr hwnd, UINT base_msg GX_DEFARG(WM_USER)) gxFuncThrowsError { 06690 GX_GETHANDLE(h); 06691 bool st = pr_beginwindowmessaging(h,hwnd.ToPointer(), base_msg)!=0; 06692 gxcondthrow(!st); 06693 return st; 06694 } 06695 #endif 06696 06705 inline bool EndWindowMessaging() gxFuncThrowsError { 06706 GX_GETHANDLE(h); 06707 bool st = pr_endwindowmessaging(h)!=0; 06708 gxcondthrow(!st); 06709 return st; 06710 } 06711 06712 #endif/* WIN32 GX_SWIG */ 06713 06714 #if (defined(LINUX) || defined(GX_MANUAL)) && !defined(GX_SWIG) 06715 06725 inline int StartBGProcesses() gxFuncThrowsError { 06726 bool st = pr_startbgprocesses(*this); 06727 gxcondthrow(!st); 06728 return st; 06729 } 06730 06738 inline int StopBGProcesses() { 06739 return pr_stopbgprocesses(*this); 06740 } 06741 06742 #endif/* LINUX GX_SWIG */ 06743 06744 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06745 06758 inline bool SetPageLight(int pages,unsigned int *lights) gxFuncThrowsError { 06759 GX_GETHANDLE(h); 06760 bool st = pr_setpagelight(h,pages,lights)!=0; 06761 gxcondthrow(!st); 06762 return st; 06763 } 06764 #endif 06765 06766 #ifndef NO_GX_STL 06767 06780 inline bool SetPageLight(gxInIntArray lights) gxFuncThrowsError { 06781 GX_GETHANDLE(h); 06782 GX_GETININTARRAY(lights); 06783 bool st = pr_setpagelight(h,GX_GETININTARRAY_LEN(lights),(unsigned int *)GX_GETININTARRAY_PTR(lights))!=0; 06784 GX_FREEININTARRAY(lights); 06785 gxcondthrow(!st); 06786 return st; 06787 } 06788 #endif 06789 06800 inline bool Capture(void) gxFuncThrowsError { 06801 GX_GETHANDLE(h); 06802 bool st = pr_capture(h)!=0; 06803 gxcondthrow(!st); 06804 return st; 06805 } 06806 06817 inline int CaptureStart() gxFuncThrowsError { 06818 GX_GETHANDLE(h); 06819 int reqid; 06820 bool st = pr_capture_start(h,&reqid)!=0; 06821 gxcondthrow(!st); 06822 return st ? reqid : -1; 06823 } 06824 06834 inline int CaptureStatus(int reqid) gxFuncThrowsError { 06835 GX_GETHANDLE(h); 06836 int status; 06837 bool st = pr_capture_getstatus(h,reqid,&status)!=0; 06838 gxcondthrow(!st); 06839 return st ? status : -1; 06840 } 06841 06850 inline bool CaptureWait(int reqid) gxFuncThrowsError { 06851 GX_GETHANDLE(h); 06852 bool st = pr_capture_wait(h,reqid)!=0; 06853 gxcondthrow(!st); 06854 return st; 06855 } 06856 06869 inline bool CapturePreview(int windowid GX_DEFARG(0)) gxFuncThrowsError { 06870 GX_GETHANDLE(h); 06871 bool st = pr_capture_preview(h,windowid)!=0; 06872 gxcondthrow(!st); 06873 return st; 06874 } 06875 06890 inline prImage * GetImage(int page,int light,int type) gxFuncThrowsError { 06891 gxVARIANT img = 0; 06892 prImage *cimg = 0; 06893 GX_GETHANDLE(h); 06894 if(!pr_getimage(h,page,light,type,&img)) { 06895 gxthrow; 06896 return cimg; 06897 } 06898 06899 #if !defined(GX_DOTNET) && !defined(GX_SWIG) 06900 if(img) 06901 #endif 06902 cimg = new prImage(img); 06903 if(img)gx_unrefvariant(img); 06904 #if !defined(GX_DOTNET) && !defined(GX_SWIG) 06905 if(img) 06906 #endif 06907 if(!cimg){gxSystem::SetError(GX_ENOMEM);gxthrow;} 06908 if(!img) gxSystem::ClearError(); 06909 return cimg; 06910 } 06911 06924 inline gxVariant * GetEnhancedUV(int page, int imgtype) gxFuncThrowsError { 06925 gxVARIANT img = 0; 06926 GX_GETHANDLE(h); 06927 if(!pr_getenhanceduv(h, page, imgtype, &img)) { 06928 gxthrow; 06929 return 0; 06930 } 06931 #ifndef GX_DOTNET 06932 gxVariant * im = new gxVariant(img); 06933 gx_unrefvariant(img); 06934 #else 06935 gxVariant * im = new gxVariant(); 06936 im->_set_variant(img); 06937 #endif 06938 if(!im){gxSystem::SetError(GX_ENOMEM);gxthrow;} 06939 return im; 06940 } 06941 06942 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 06943 06956 inline bool SaveImage(int page,int light,int type,const wchar_t *filename,int filetype) gxFuncThrowsError { 06957 bool st = pr_saveimage(*this,page,light,type,filename,filetype)!=0; 06958 gxcondthrow(!st); 06959 return st; 06960 } 06961 06976 inline bool SaveImage(int page,int light,int type,const char *filename,int filetype) gxFuncThrowsError { 06977 bool st = pr_saveimage(*this,page,light,type,filename,filetype)!=0; 06978 gxcondthrow(!st); 06979 return st; 06980 } 06981 #endif 06982 06983 #ifdef GX_UNICODE 06984 06998 inline bool SaveImage(int page,int light,int type,gxInStr filename,int filetype) gxFuncThrowsError { 06999 GX_GETHANDLE(h); 07000 GX_GETSTRING(_filename, filename); 07001 bool st = pr_saveimage(h,page,light,type,_filename,filetype)!=0; 07002 gxcondthrow(!st); 07003 return st; 07004 } 07005 #endif 07006 07007 #ifdef GX_ASCII 07008 07022 inline bool SaveImage(int page,int light,int type,gxInAStr filename,int filetype) gxFuncThrowsError { 07023 GX_GETHANDLE(h); 07024 GX_GETASTRING(_filename, filename); 07025 bool st = pr_saveimage(h,page,light,type,_filename,filetype)!=0; 07026 gxcondthrow(!st); 07027 return st; 07028 } 07029 #endif 07030 07031 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_DOTNET) && !defined(GX_SWIG) 07032 07049 inline bool DisplayImage(int page,int light,int type,HDC hdc,int x,int y,int xsize,int ysize,gxRCT *frame) gxFuncThrowsError { 07050 bool st = pr_drawimage(*this,page,light,type,hdc,x,y,xsize,ysize,frame)!=0; 07051 gxcondthrow(!st); 07052 return st; 07053 } 07054 #endif 07055 07056 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 07057 07063 inline bool FingerToNist(const wchar_t *filename,gxVariant *fields) gxFuncThrowsError { 07064 bool st = pr_fingertonist(*this,filename,(fields)?fields->_variant:0)!=0; 07065 gxcondthrow(!st); 07066 return st; 07067 } 07068 07075 inline bool FingerToNist(const char *filename,gxVariant *fields) gxFuncThrowsError { 07076 bool st = pr_fingertonist(*this,filename,(fields)?fields->_variant:0)!=0; 07077 gxcondthrow(!st); 07078 return st; 07079 } 07080 07088 inline bool FingerToNistMem(void **buffer, int *buflen,gxVariant *fields) gxFuncThrowsError { 07089 bool st = pr_fingertonistmem(*this,buffer,buflen,fields?fields->_variant:0)!=0; 07090 gxcondthrow(!st); 07091 return st; 07092 } 07093 #endif 07094 07095 #ifdef GX_UNICODE 07096 07102 inline bool FingerToNist(gxInStr filename,gxVariant *fields) gxFuncThrowsError { 07103 GX_GETHANDLE(h); 07104 #ifdef GX_DOTNET 07105 gxVARIANT var = fields?(gxVARIANT)GX_GETPTR(fields->_get_variant()):0; 07106 #else 07107 gxVARIANT var = fields?fields->_variant:0; 07108 #endif 07109 GX_GETSTRING(_filename, filename); 07110 bool st = pr_fingertonist(h,_filename,var)!=0; 07111 gxcondthrow(!st); 07112 return st; 07113 } 07114 #endif 07115 07116 #ifdef GX_ASCII 07117 07123 inline bool FingerToNist(gxInAStr filename,gxVariant *fields) gxFuncThrowsError { 07124 GX_GETHANDLE(h); 07125 GX_GETASTRING(_filename, filename); 07126 bool st = pr_fingertonist(h,_filename,(fields)?fields->_variant:0)!=0; 07127 gxcondthrow(!st); 07128 return st; 07129 } 07130 #endif 07131 07132 #if defined(GX_SWIG) || defined(GX_DOTNET) 07133 07137 inline gxOutData FingerToNistMem(gxVariant *fields) gxFuncThrowsError { 07138 void *buffer = (void *)0; 07139 gxi32 buflen = 0; 07140 GX_GETHANDLE(h); 07141 #ifdef GX_DOTNET 07142 gxVARIANT var = fields?(gxVARIANT)GX_GETPTR(fields->_get_variant()):0; 07143 #else 07144 gxVARIANT var = fields?fields->_variant:0; 07145 #endif 07146 if(!pr_fingertonistmem(h,&buffer,&buflen,var)) { 07147 gxthrow; 07148 return GX_PUTDATA_NONE; 07149 } 07150 gxOutData ret = GX_PUTDATA(buffer, buflen); 07151 if(buffer) gx_globalfree(buffer); 07152 return ret; 07153 } 07154 #endif 07155 07167 inline bool ResetDocument(int lastpage GX_DEFARG(0)) gxFuncThrowsError { 07168 GX_GETHANDLE(h); 07169 bool st = pr_resetdocument(h, lastpage)!=0; 07170 gxcondthrow(!st); 07171 return st; 07172 } 07173 07187 inline prDoc * GetOcr(int page,int light,int type) gxFuncThrowsError { 07188 gxVARIANT doc = 0; 07189 prDoc *cdoc = 0; 07190 GX_GETHANDLE(h); 07191 if(!pr_getocr(h,page,light,type,&doc,0)) { 07192 gxthrow; 07193 return cdoc; 07194 } 07195 ifDoc cdoc = new prDoc(doc,h); 07196 if(doc) gx_unrefvariant(doc); 07197 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07198 if(!doc) gxSystem::ClearError(); 07199 return cdoc; 07200 } 07201 07216 inline prDoc * GetOcr(int page,int light,int type,gxVariant *ocrparams) gxFuncThrowsError { 07217 gxVARIANT doc = 0; 07218 prDoc *cdoc = 0; 07219 GX_GETHANDLE(h); 07220 #ifdef GX_DOTNET 07221 gxVARIANT var = ocrparams?(gxVARIANT)GX_GETPTR(ocrparams->_get_variant()):0; 07222 #else 07223 gxVARIANT var = ocrparams?ocrparams->_variant:0; 07224 #endif 07225 07226 if(!pr_getocr(h,page,light,type,&doc,var)) { 07227 gxthrow; 07228 return cdoc; 07229 } 07230 ifDoc cdoc = new prDoc(doc,h); 07231 if(doc) gx_unrefvariant(doc); 07232 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07233 if(!doc) gxSystem::ClearError(); 07234 return cdoc; 07235 } 07236 07250 inline prDoc * GetMrz(int page,int light,int type) gxFuncThrowsError { 07251 gxVARIANT doc = 0; 07252 prDoc *cdoc = 0; 07253 GX_GETHANDLE(h); 07254 if(!pr_getmrz(h,page,light,type,&doc)) { 07255 gxthrow; 07256 return cdoc; 07257 } 07258 ifDoc cdoc = new prDoc(doc,h); 07259 if(doc) gx_unrefvariant(doc); 07260 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07261 if(!doc) gxSystem::ClearError(); 07262 return cdoc; 07263 } 07264 07282 inline prDoc * GetBarcode(int page,int light,int type,int bctype,int index) gxFuncThrowsError { 07283 gxVARIANT doc = 0; 07284 prDoc *cdoc = 0; 07285 GX_GETHANDLE(h); 07286 if(!pr_getbarcode(h,page,light,type,bctype,index,&doc)) { 07287 gxthrow; 07288 return cdoc; 07289 } 07290 ifDoc cdoc = new prDoc(doc,h); 07291 if(doc) gx_unrefvariant(doc); 07292 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07293 if(!doc) gxSystem::ClearError(); 07294 return cdoc; 07295 } 07296 07310 inline prDoc * GetDocumentRect(int page,int light,int type) gxFuncThrowsError { 07311 gxVARIANT doc = 0; 07312 prDoc *cdoc = 0; 07313 GX_GETHANDLE(h); 07314 if(!pr_getdocumentrect(h,page,light,type,&doc)) { 07315 gxthrow; 07316 return cdoc; 07317 } 07318 ifDoc cdoc = new prDoc(doc,h); 07319 if(doc) gx_unrefvariant(doc); 07320 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07321 if(!doc) gxSystem::ClearError(); 07322 return cdoc; 07323 } 07324 07335 inline prDoc * Recognize(int page) gxFuncThrowsError { 07336 gxVARIANT doc = 0; 07337 prDoc *cdoc = 0; 07338 GX_GETHANDLE(h); 07339 if(!pr_recognize(h,page,&doc)) { 07340 gxthrow; 07341 return cdoc; 07342 } 07343 ifDoc cdoc = new prDoc(doc,h); 07344 if(doc) gx_unrefvariant(doc); 07345 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07346 if(!doc) gxSystem::ClearError(); 07347 return cdoc; 07348 } 07349 07350 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 07351 07360 inline prDoc * Analyze(gxVariant *page, int tasklen, int *task) gxFuncThrowsError { 07361 gxVARIANT doc = 0; 07362 prDoc *cdoc = 0; 07363 GX_GETHANDLE(h); 07364 if(!page) { gxSystem::SetError(GX_EINVAL, L"(page)"); gxthrow; return cdoc; } 07365 #ifdef GX_DOTNET 07366 gxVARIANT var = page ? (gxVARIANT)GX_GETPTR(page->_get_variant()) : 0; 07367 #else 07368 gxVARIANT var = page ? page->_variant : 0; 07369 #endif 07370 if(!pr_analyze(h, var, tasklen, task, &doc)) { 07371 gxthrow; 07372 return cdoc; 07373 } 07374 ifDoc cdoc = new prDoc(doc,h); 07375 if(doc) gx_unrefvariant(doc); 07376 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07377 if(!doc) gxSystem::ClearError(); 07378 return cdoc; 07379 } 07380 07391 inline prDoc * Analyze(gxu8 *buffer, int buflen, const wchar_t *comment = 0) gxFuncThrowsError { 07392 gxVARIANT doc = 0; 07393 prDoc *cdoc = 0; 07394 GX_GETHANDLE(h); 07395 if(!pr_analyze(h, buffer, buflen, &doc, comment)) { 07396 gxthrow; 07397 return cdoc; 07398 } 07399 ifDoc cdoc = new prDoc(doc,h); 07400 if(doc) gx_unrefvariant(doc); 07401 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07402 if(!doc) gxSystem::ClearError(); 07403 return cdoc; 07404 } 07405 #endif 07406 07407 #ifndef NO_GX_STL 07408 07416 inline prDoc * Analyze(gxVariant *page, gxInIntArray task) gxFuncThrowsError { 07417 gxVARIANT doc = 0; 07418 prDoc *cdoc = 0; 07419 GX_GETHANDLE(h); 07420 if(!page) { gxSystem::SetError(GX_EINVAL); gxthrow; return cdoc; } 07421 #ifdef GX_DOTNET 07422 gxVARIANT var = page ? (gxVARIANT)GX_GETPTR(page->_get_variant()) : 0; 07423 #else 07424 gxVARIANT var = page ? page->_variant : 0; 07425 #endif 07426 GX_GETININTARRAY(task); 07427 bool st = pr_analyze(h, var, GX_GETININTARRAY_LEN(task), GX_GETININTARRAY_PTR(task), &doc)!=0; 07428 GX_FREEININTARRAY(task); 07429 if(!st) { 07430 gxthrow; 07431 return cdoc; 07432 } 07433 ifDoc cdoc = new prDoc(doc,h); 07434 if(doc) gx_unrefvariant(doc); 07435 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07436 if(!doc) gxSystem::ClearError(); 07437 return cdoc; 07438 } 07439 #endif 07440 07441 #if defined(GX_SWIG) || defined(GX_DOTNET) 07442 07450 inline prDoc * Analyze(gxInData buffer, gxInStr comment) gxFuncThrowsError { 07451 gxVARIANT doc = 0; 07452 prDoc *cdoc = 0; 07453 GX_GETHANDLE(h); 07454 GX_GETDATA(buffer); 07455 GX_GETSTRING(_comment, comment); 07456 bool st = pr_analyze(h, (gxu8*)GX_DATAPTR(buffer), GX_DATALEN(buffer), &doc, _comment)!=0; 07457 GX_FREEDATA(buffer); 07458 if(!st) { 07459 gxthrow; 07460 return cdoc; 07461 } 07462 ifDoc cdoc = new prDoc(doc,h); 07463 if(doc) gx_unrefvariant(doc); 07464 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07465 if(!doc) gxSystem::ClearError(); 07466 return cdoc; 07467 } 07468 #endif 07469 07470 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 07471 07481 inline prDoc * ResolveMrzText(const wchar_t **lines,int nlines) gxFuncThrowsError { 07482 gxVARIANT doc = 0; 07483 prDoc *cdoc = 0; 07484 if(!pr_resolvemrztext(*this,lines,nlines,&doc)) { 07485 gxthrow; 07486 return cdoc; 07487 } 07488 ifDoc cdoc = new prDoc(doc,*this); 07489 if(doc) gx_unrefvariant(doc); 07490 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07491 if(!doc) gxSystem::ClearError(); 07492 return cdoc; 07493 } 07494 07505 inline prDoc * ResolveMrzText(const char **lines,int nlines) gxFuncThrowsError { 07506 gxVARIANT doc = 0; 07507 prDoc *cdoc = 0; 07508 if(!pr_resolvemrztext(*this,lines,nlines,&doc)) { 07509 gxthrow; 07510 return cdoc; 07511 } 07512 ifDoc cdoc = new prDoc(doc,*this); 07513 if(doc) gx_unrefvariant(doc); 07514 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07515 if(!doc) gxSystem::ClearError(); 07516 return cdoc; 07517 } 07518 #endif 07519 07520 #ifdef GX_UNICODE /*(*/ 07521 07530 inline prDoc * ResolveMrzText(gxInStrArray lines) gxFuncThrowsError { 07531 gxVARIANT doc = 0; 07532 prDoc *cdoc = 0; 07533 GX_GETHANDLE(h); 07534 GX_GETINSTRARRAY(lines); 07535 bool st = pr_resolvemrztext(h,(const wchar_t**)GX_GETINSTRARRAY_PTR(lines),GX_GETINSTRARRAY_LEN(lines),&doc)!=0; 07536 GX_FREEINSTRARRAY(lines); 07537 if(!st) { 07538 gxthrow; 07539 return cdoc; 07540 } 07541 ifDoc cdoc = new prDoc(doc,h); 07542 if(doc) gx_unrefvariant(doc); 07543 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07544 if(!doc) gxSystem::ClearError(); 07545 return cdoc; 07546 } 07547 #endif/*)*/ 07548 07549 #ifdef GX_ASCII /*(*/ 07550 07559 inline prDoc * ResolveMrzText(gxInAStrArray lines) gxFuncThrowsError { 07560 gxVARIANT doc = 0; 07561 prDoc *cdoc = 0; 07562 GX_GETHANDLE(h); 07563 GX_GETINASTRARRAY(lines); 07564 bool st = pr_resolvemrztext(h,(const char**)GX_GETINASTRARRAY_PTR(lines),GX_GETINASTRARRAY_LEN(lines),&doc)!=0; 07565 GX_FREEINASTRARRAY(lines); 07566 if(!st) { 07567 gxthrow; 07568 return cdoc; 07569 } 07570 ifDoc cdoc = new prDoc(doc,h); 07571 if(doc) gx_unrefvariant(doc); 07572 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 07573 if(!doc) gxSystem::ClearError(); 07574 return cdoc; 07575 } 07576 #endif/*)*/ 07577 07578 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 07579 07587 inline prDoc * ResolveMagstripe(const wchar_t **tracks, int ntracks) gxFuncThrowsError { 07588 gxVARIANT doc = 0; 07589 prDoc *cdoc = 0; 07590 if(!pr_resolvemagstripe(*this, tracks, ntracks, &doc)) { 07591 gxthrow; 07592 return cdoc; 07593 } 07594 ifDoc cdoc = new prDoc(doc,*this); 07595 if(doc) gx_unrefvariant(doc); 07596 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07597 if(!doc) gxSystem::ClearError(); 07598 return cdoc; 07599 } 07600 07609 inline prDoc * ResolveMagstripe(const char **tracks, int ntracks) gxFuncThrowsError { 07610 gxVARIANT doc = 0; 07611 prDoc *cdoc = 0; 07612 if(!pr_resolvemagstripe(*this, tracks, ntracks, &doc)) { 07613 gxthrow; 07614 return cdoc; 07615 } 07616 ifDoc cdoc = new prDoc(doc, *this); 07617 if(doc) gx_unrefvariant(doc); 07618 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07619 if(!doc) gxSystem::ClearError(); 07620 return cdoc; 07621 } 07622 #endif 07623 07624 #ifdef GX_UNICODE /*(*/ 07625 07632 inline prDoc * ResolveMagstripe(gxInStrArray tracks) gxFuncThrowsError { 07633 gxVARIANT doc = 0; 07634 prDoc *cdoc = 0; 07635 GX_GETHANDLE(h); 07636 GX_GETINSTRARRAY(tracks); 07637 bool st = pr_resolvemagstripe(h, (const wchar_t**)GX_GETINSTRARRAY_PTR(tracks), GX_GETINSTRARRAY_LEN(tracks), &doc)!=0; 07638 GX_FREEINSTRARRAY(tracks); 07639 if(!st) { 07640 gxthrow; 07641 return cdoc; 07642 } 07643 ifDoc cdoc = new prDoc(doc,h); 07644 if(doc) gx_unrefvariant(doc); 07645 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07646 if(!doc) gxSystem::ClearError(); 07647 return cdoc; 07648 } 07649 #endif/*)*/ 07650 07651 #ifdef GX_ASCII /*(*/ 07652 07659 inline prDoc * ResolveMagstripe(gxInAStrArray tracks) gxFuncThrowsError { 07660 gxVARIANT doc = 0; 07661 prDoc *cdoc = 0; 07662 GX_GETHANDLE(h); 07663 GX_GETINASTRARRAY(tracks); 07664 bool st = pr_resolvemagstripe(h, (const char**)GX_GETINASTRARRAY_PTR(tracks), GX_GETINASTRARRAY_LEN(tracks), &doc)!=0; 07665 GX_FREEINASTRARRAY(tracks); 07666 if(!st) { 07667 gxthrow; 07668 return cdoc; 07669 } 07670 ifDoc cdoc = new prDoc(doc,h); 07671 if(doc) gx_unrefvariant(doc); 07672 ifDoc if(!cdoc) { gxSystem::SetError(GX_ENOMEM); gxthrow; } 07673 if(!doc) gxSystem::ClearError(); 07674 return cdoc; 07675 } 07676 #endif/*)*/ 07677 07678 #if !defined(GX_DOTNET) && !defined(GX_SWIG) 07679 07689 inline bool GetRfidCardList(wchar_t ***cards,int *ncards) gxFuncThrowsError { 07690 bool st = pr_getrfidcardlist(*this,cards,ncards)!=0; 07691 gxcondthrow(!st); 07692 return st; 07693 } 07694 07705 inline bool GetRfidCardList(char ***cards,int *ncards) gxFuncThrowsError { 07706 bool st = pr_getrfidcardlist(*this,cards,ncards)!=0; 07707 gxcondthrow(!st); 07708 return st; 07709 } 07710 #endif 07711 07712 #ifdef GX_UNICODE 07713 07717 inline gxOutStrArray GetRfidCardList(void) gxFuncThrowsError { 07718 wchar_t **cards; 07719 int ncards = 0; 07720 GX_GETHANDLE(h); 07721 if(!pr_getrfidcardlist(h,&cards,&ncards)) { 07722 gxthrow; 07723 return GX_PUTGSTRINGARRAY_NONE; 07724 } 07725 return GX_PUTGSTRINGARRAY(cards, ncards, true); 07726 } 07727 #endif 07728 07729 #ifdef GX_ASCII 07730 07734 inline gxOutAStrArray GetRfidCardListA(void) gxFuncThrowsError { 07735 char **cards; 07736 int ncards = 0; 07737 if(!pr_getrfidcardlist(*this,&cards,&ncards)) { 07738 gxthrow; 07739 return GX_PUTGASTRINGARRAY_NONE; 07740 } 07741 return GX_PUTGASTRINGARRAY(cards, ncards, true); 07742 } 07743 #endif 07744 07745 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 07746 07753 inline bool ConnectRfidCard(const wchar_t *card) gxFuncThrowsError { 07754 bool st = pr_connectrfidcard(*this,card)!=0; 07755 gxcondthrow(!st); 07756 return st; 07757 } 07758 07765 inline bool ConnectRfidCard(const char *card) gxFuncThrowsError { 07766 bool st = pr_connectrfidcard(*this,card)!=0; 07767 gxcondthrow(!st); 07768 return st; 07769 } 07770 07777 inline bool DisconnectRfidCard(const wchar_t *card) gxFuncThrowsError { 07778 bool st = pr_disconnectrfidcard(*this,card)!=0; 07779 gxcondthrow(!st); 07780 return st; 07781 } 07782 07789 inline bool DisconnectRfidCard(const char *card) gxFuncThrowsError { 07790 bool st = pr_disconnectrfidcard(*this,card)!=0; 07791 gxcondthrow(!st); 07792 return st; 07793 } 07794 07795 #endif 07796 07797 #ifdef GX_UNICODE 07798 07805 inline bool ConnectRfidCard(gxInStr card) gxFuncThrowsError { 07806 GX_GETHANDLE(h); 07807 GX_GETSTRING(_card, card); 07808 bool st = pr_connectrfidcard(h,_card)!=0; 07809 gxcondthrow(!st); 07810 return st; 07811 } 07812 07819 inline bool DisconnectRfidCard(gxInStr card) gxFuncThrowsError { 07820 GX_GETHANDLE(h); 07821 GX_GETSTRING(_card, card); 07822 bool st = pr_disconnectrfidcard(h,_card)!=0; 07823 gxcondthrow(!st); 07824 return st; 07825 } 07826 07827 #endif 07828 07829 #ifdef GX_ASCII 07830 07837 inline bool ConnectRfidCard(gxInAStr card) gxFuncThrowsError { 07838 GX_GETHANDLE(h); 07839 GX_GETASTRING(_card, card); 07840 bool st = pr_connectrfidcard(h,_card)!=0; 07841 gxcondthrow(!st); 07842 return st; 07843 } 07844 07851 inline bool DisconnectRfidCard(gxInAStr card) gxFuncThrowsError { 07852 GX_GETHANDLE(h); 07853 GX_GETASTRING(_card, card); 07854 bool st = pr_disconnectrfidcard(h,_card)!=0; 07855 gxcondthrow(!st); 07856 return st; 07857 } 07858 07859 #endif/* GX_ASCII */ 07860 07861 #if !defined(GX_DOTNET) && !defined(GX_SWIG) 07862 07875 inline bool GetRfidFile(const wchar_t *card,int fileid,void **data,int *sdata) gxFuncThrowsError { 07876 bool st = pr_getrfidfile(*this,card,fileid,data,sdata)!=0; 07877 gxcondthrow(!st); 07878 return st; 07879 } 07880 07889 inline bool CheckRfidFileHash(const wchar_t *card,int fileid) gxFuncThrowsError { 07890 bool st = pr_checkrfidfilehash(*this,card,fileid)!=0; 07891 gxcondthrow(!st); 07892 return st; 07893 } 07894 07908 inline bool GetRfidFile(const char *card,int fileid,void **data,int *sdata) gxFuncThrowsError { 07909 bool st = pr_getrfidfile(*this,card,fileid,data,sdata)!=0; 07910 gxcondthrow(!st); 07911 return st; 07912 } 07913 07922 inline bool CheckRfidFileHash(const char *card,int fileid) gxFuncThrowsError { 07923 bool st = pr_checkrfidfilehash(*this,card,fileid)!=0; 07924 gxcondthrow(!st); 07925 return st; 07926 } 07927 #endif 07928 07929 #if defined(GX_SWIG) || defined(GX_DOTNET) 07930 07931 #ifdef GX_UNICODE 07932 07939 inline gxOutData GetRfidFile(gxInStr card, int fileid) gxFuncThrowsError { 07940 GX_GETSTRING(_card, card); 07941 GX_GETHANDLE(h); 07942 void *data; 07943 int sdata; 07944 if(!pr_getrfidfile(h,_card,fileid,&data,&sdata)) { 07945 gxthrow; 07946 return GX_PUTDATA_NONE; 07947 } 07948 gxOutData od = GX_PUTDATA(data, sdata); 07949 if(data) gx_globalfree(data); 07950 return od; 07951 } 07952 #endif 07953 07954 #ifdef GX_ASCII 07955 07962 inline gxOutData GetRfidFile(gxInAStr card,int fileid) gxFuncThrowsError { 07963 GX_GETASTRING(_card, card); 07964 GX_GETHANDLE(h); 07965 void *data; 07966 int sdata; 07967 if(!pr_getrfidfile(h, _card,fileid,data,sdata)) { 07968 gxthrow; 07969 return GX_PUTDATA_NONE; 07970 } 07971 gxOutData od = GX_PUTDATA(data, sdata); 07972 if(data) gx_globalfree(data); 07973 return od; 07974 } 07975 #endif 07976 07977 #endif 07978 07979 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 07980 07988 inline int GetRfidFileStart(const wchar_t *card, int fileid) gxFuncThrowsError { 07989 int reqid; 07990 bool st = pr_getrfidfile_start(*this, card, fileid, &reqid)!=0; 07991 gxcondthrow(!st); 07992 return st ? reqid : -1; 07993 } 07994 08002 inline int GetRfidFileStart(const char *card, int fileid) gxFuncThrowsError { 08003 int reqid; 08004 bool st = pr_getrfidfile_start(*this, card, fileid, &reqid)!=0; 08005 gxcondthrow(!st); 08006 return st ? reqid : -1; 08007 } 08008 08009 #endif 08010 08011 #ifdef GX_UNICODE 08012 08019 inline int GetRfidFileStart(gxInStr card, int fileid) gxFuncThrowsError { 08020 GX_GETHANDLE(h); 08021 GX_GETSTRING(_card, card); 08022 int reqid; 08023 bool st = pr_getrfidfile_start(h,_card,fileid,&reqid)!=0; 08024 gxcondthrow(!st); 08025 return st ? reqid : -1; 08026 } 08027 #endif 08028 08029 #ifdef GX_ASCII 08030 08037 inline int GetRfidFileStart(gxInAStr card, int fileid) gxFuncThrowsError { 08038 GX_GETHANDLE(h); 08039 GX_GETASTRING(_card, card); 08040 int reqid; 08041 bool st = pr_getrfidfile_start(h,_card,fileid,&reqid)!=0; 08042 gxcondthrow(!st); 08043 return st ? reqid : -1; 08044 } 08045 #endif 08046 08056 inline int GetRfidFileGetStatus(int reqid) gxFuncThrowsError { 08057 GX_GETHANDLE(h); 08058 int status; 08059 bool st = pr_getrfidfile_getstatus(h,reqid,&status)!=0; 08060 gxcondthrow(!st); 08061 return st? status : -1; 08062 } 08063 08064 #if !defined(GX_DOTNET) && !defined(GX_SWIG) 08065 08074 inline bool GetRfidFileWait(int reqid, void **data, int *sdata) gxFuncThrowsError { 08075 bool st = pr_getrfidfile_wait(*this,reqid,data,sdata)!=0; 08076 gxcondthrow(!st); 08077 return st; 08078 } 08079 #else 08080 08086 inline gxOutData GetRfidFileWait(int reqid) gxFuncThrowsError { 08087 GX_GETHANDLE(h); 08088 void *data; 08089 int sdata; 08090 if(!pr_getrfidfile_wait(h,reqid,&data,&sdata)){ 08091 gxthrow; 08092 return GX_PUTDATA_NONE; 08093 } 08094 gxOutData od = GX_PUTDATA(data, sdata); 08095 if(data) gx_globalfree(data); 08096 return od; 08097 } 08098 #endif 08099 08106 inline bool GetRfidFileStop() gxFuncThrowsError { 08107 GX_GETHANDLE(h); 08108 bool st = pr_getrfidfile_stop(h)!=0; 08109 gxcondthrow(!st); 08110 return st; 08111 } 08112 08113 #ifdef GX_UNICODE 08114 08122 inline bool CheckRfidFileHash(gxInStr card, int fileid) gxFuncThrowsError { 08123 GX_GETHANDLE(h); 08124 GX_GETSTRING(_card, card); 08125 bool st = pr_checkrfidfilehash(h,_card,fileid)!=0; 08126 gxcondthrow(!st); 08127 return st; 08128 } 08129 #endif 08130 08131 #ifdef GX_ASCII 08132 08140 inline bool CheckRfidFileHash(gxInAStr card, int fileid) gxFuncThrowsError { 08141 GX_GETHANDLE(h); 08142 GX_GETASTRING(_card, card); 08143 bool st = pr_checkrfidfilehash(h,_card,fileid)!=0; 08144 gxcondthrow(!st); 08145 return st; 08146 } 08147 #endif 08148 08149 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 08150 08158 inline prDoc * ResolveRfidData(const void *data, int sdata) gxFuncThrowsError { 08159 gxVARIANT doc = 0; 08160 prDoc *cdoc = 0; 08161 if(!pr_resolverfiddata(*this,data,sdata,&doc)) { 08162 gxthrow; 08163 return cdoc; 08164 } 08165 ifDoc cdoc = new prDoc(doc,*this); 08166 if(doc) gx_unrefvariant(doc); 08167 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 08168 if(!doc) gxSystem::ClearError(); 08169 return cdoc; 08170 } 08171 #else 08172 08179 inline prDoc * ResolveRfidData(gxInData data) gxFuncThrowsError { 08180 gxVARIANT doc = 0; 08181 prDoc *cdoc = 0; 08182 GX_GETHANDLE(h); 08183 GX_GETDATA(data); 08184 bool st = pr_resolverfiddata(h,GX_DATAPTR(data),GX_DATALEN(data),&doc)!=0; 08185 GX_FREEDATA(data); 08186 if(!st) { 08187 gxthrow; 08188 return cdoc; 08189 } 08190 ifDoc cdoc = new prDoc(doc,h); 08191 if(doc) gx_unrefvariant(doc); 08192 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 08193 if(!doc) gxSystem::ClearError(); 08194 return cdoc; 08195 } 08196 #endif 08197 08198 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 08199 08208 inline bool GetApplications(const wchar_t *card, int **apps, int *napps) gxFuncThrowsError { 08209 bool st = pr_getapplications(*this, card, apps, napps)!=0; 08210 gxcondthrow(!st); 08211 return st; 08212 } 08213 08222 inline bool GetApplications(const char *card, int **apps, int *napps) gxFuncThrowsError { 08223 bool st = pr_getapplicationsa(*this, card, apps, napps)!=0; 08224 gxcondthrow(!st); 08225 return st; 08226 } 08227 #else 08228 08234 inline gxOutIntArray GetApplications(gxInStr card) gxFuncThrowsError { 08235 GX_GETHANDLE(h); 08236 GX_GETSTRING(_card, card); 08237 int apps_len = 0; 08238 int *apps_ptr = 0; 08239 gxOutIntArray apps = GX_INTARRAY_NONE; 08240 bool st = pr_getapplications(h, _card, &apps_ptr, &apps_len)!=0; 08241 if(apps_ptr && apps_len){ 08242 apps = GX_PUTINTARRAY(apps_ptr, apps_len); 08243 gx_globalfree(apps_ptr); 08244 } 08245 return apps; 08246 } 08247 #endif 08248 08249 08250 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 08251 08259 inline bool SelectApplication(const wchar_t *card, PR_APP_TYPE Application) gxFuncThrowsError { 08260 bool st = pr_selectapplication(*this,card,Application)!=0; 08261 gxcondthrow(!st); 08262 return st; 08263 } 08264 08272 inline bool SelectApplication(const char *card, PR_APP_TYPE Application) gxFuncThrowsError { 08273 bool st = pr_selectapplicationa(*this,card,Application)!=0; 08274 gxcondthrow(!st); 08275 return st; 08276 } 08277 08278 #endif 08279 08280 #ifdef GX_UNICODE 08281 08289 inline bool SelectApplication(gxInStr card, PR_APP_TYPE Application) gxFuncThrowsError { 08290 GX_GETHANDLE(h); 08291 GX_GETSTRING(_card, card); 08292 bool st = pr_selectapplication(h,_card,Application)!=0; 08293 gxcondthrow(!st); 08294 return st; 08295 } 08296 08297 #endif 08298 08299 #ifdef GX_ASCII 08300 08308 inline bool SelectApplication(gxInAStr card, PR_APP_TYPE Application) gxFuncThrowsError { 08309 GX_GETHANDLE(h); 08310 GX_GETASTRING(_card, card); 08311 bool st = pr_selectapplication(h,_card,Application)!=0; 08312 gxcondthrow(!st); 08313 return st; 08314 } 08315 08316 #endif 08317 08318 08319 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 08320 08328 inline bool MakeBAC(const wchar_t *card, const wchar_t **lines, int nlines) gxFuncThrowsError { 08329 bool st = pr_makebac(*this,card,lines,nlines)!=0; 08330 gxcondthrow(!st); 08331 return st; 08332 } 08333 08341 inline bool MakeBAC(const char *card, const char **lines, int nlines) gxFuncThrowsError { 08342 bool st = pr_makebac(*this,card,lines,nlines)!=0; 08343 gxcondthrow(!st); 08344 return st; 08345 } 08346 08347 #endif 08348 08349 #ifdef GX_UNICODE 08350 08357 inline bool MakeBAC(gxInStr card, gxInStrArray lines) gxFuncThrowsError { 08358 GX_GETHANDLE(h); 08359 GX_GETSTRING(_card, card); 08360 GX_GETINSTRARRAY(lines); 08361 bool st = pr_makebac(h,_card,(const wchar_t**)GX_GETINSTRARRAY_PTR(lines),GX_GETINSTRARRAY_LEN(lines))!=0; 08362 GX_FREEINSTRARRAY(lines); 08363 gxcondthrow(!st); 08364 return st; 08365 } 08366 08367 #endif 08368 08369 #ifdef GX_ASCII 08370 08377 inline bool MakeBAC(gxInAStr card, gxInAStrArray lines) gxFuncThrowsError { 08378 GX_GETHANDLE(h); 08379 GX_GETASTRING(_card, card); 08380 GX_GETINASTRARRAY(lines); 08381 bool st = pr_makebac(h,_card,(const char**)GX_GETINASTRARRAY_PTR(lines),GX_GETINASTRARRAY_LEN(lines))!=0; 08382 GX_FREEINASTRARRAY(lines); 08383 gxcondthrow(!st); 08384 return st; 08385 } 08386 08387 #endif 08388 08389 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 08390 08400 inline bool MakePACE(const wchar_t *card, const wchar_t **lines, int nlines, int PasswordType) gxFuncThrowsError { 08401 bool st = pr_makepace(*this,card,lines,nlines,PasswordType)!=0; 08402 gxcondthrow(!st); 08403 return st; 08404 } 08405 08415 inline bool MakePACE(const char *card, const char **lines, int nlines, int PasswordType) gxFuncThrowsError { 08416 bool st = pr_makepace(*this,card,lines,nlines,PasswordType)!=0; 08417 gxcondthrow(!st); 08418 return st; 08419 } 08420 #endif 08421 08422 #ifdef GX_UNICODE 08423 08432 inline bool MakePACE(gxInStr card, gxInStrArray lines, int PasswordType) gxFuncThrowsError { 08433 GX_GETHANDLE(h); 08434 GX_GETSTRING(_card, card); 08435 GX_GETINSTRARRAY(lines); 08436 bool st = pr_makepace(h,_card,(const wchar_t**)GX_GETINSTRARRAY_PTR(lines),GX_GETINSTRARRAY_LEN(lines),PasswordType)!=0; 08437 GX_FREEINSTRARRAY(lines); 08438 gxcondthrow(!st); 08439 return st; 08440 } 08441 #endif 08442 08443 #ifdef GX_ASCII 08444 08453 inline bool MakePACE(gxInAStr card, gxInAStrArray lines, int PasswordType) gxFuncThrowsError { 08454 GX_GETHANDLE(h); 08455 GX_GETASTRING(_card, card); 08456 GX_GETINASTRARRAY(lines); 08457 bool st = pr_makepace(h,_card,(const char**)GX_GETINASTRARRAY_PTR(lines),GX_GETINASTRARRAY_LEN(lines),PasswordType)!=0; 08458 GX_FREEINASTRARRAY(lines); 08459 gxcondthrow(!st); 08460 return st; 08461 } 08462 #endif 08463 08464 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 08465 08474 inline int GetNextAuthentication(const wchar_t *card, int ForceNext = false) gxFuncThrowsError { 08475 int Authentication; 08476 bool st = pr_getnextauthentication(*this,card,&Authentication,ForceNext)!=0; 08477 gxcondthrow(!st); 08478 return st ? Authentication : -1; 08479 } 08480 08489 inline int GetNextAuthentication(const char *card, int ForceNext = false) gxFuncThrowsError { 08490 int Authentication; 08491 bool st = pr_getnextauthentication(*this,card,&Authentication,ForceNext)!=0; 08492 gxcondthrow(!st); 08493 return st ? Authentication : -1; 08494 } 08495 08508 inline int DoAuthentication(const wchar_t *card, int Authentication, const wchar_t **AuthData GX_DEFARG(0), int Lines GX_DEFARG(0), int PasswordType GX_DEFARG(PR_PACE_PW_MRZ)) gxFuncThrowsError { 08509 bool st = pr_doauthentication(*this, card, Authentication, AuthData, Lines, PasswordType)!=0; 08510 gxcondthrow(!st); 08511 return st; 08512 } 08513 08526 inline int DoAuthentication(const char *card, int Authentication, const char **AuthData GX_DEFARG(0), int Lines GX_DEFARG(0), int PasswordType GX_DEFARG(PR_PACE_PW_MRZ)) gxFuncThrowsError { 08527 bool st = pr_doauthenticationa(*this,card, Authentication, AuthData, Lines, PasswordType)!=0; 08528 gxcondthrow(!st); 08529 return st; 08530 } 08531 08538 inline bool MakePassiveAuth(const wchar_t *card) gxFuncThrowsError { 08539 bool st = pr_makepassiveauth(*this,card)!=0; 08540 gxcondthrow(!st); 08541 return st; 08542 } 08543 08550 inline bool MakePassiveAuth(const char *card) gxFuncThrowsError { 08551 bool st = pr_makepassiveauth(*this,card)!=0; 08552 gxcondthrow(!st); 08553 return st; 08554 } 08555 08565 inline bool MakeActiveAuth(const wchar_t *card) gxFuncThrowsError { 08566 bool st = pr_makeactiveauth(*this,card)!=0; 08567 gxcondthrow(!st); 08568 return st; 08569 } 08570 08580 inline bool MakeActiveAuth(const char *card) gxFuncThrowsError { 08581 bool st = pr_makeactiveauth(*this,card)!=0; 08582 gxcondthrow(!st); 08583 return st; 08584 } 08585 08592 inline bool MakeChipAuth(const wchar_t *card) gxFuncThrowsError { 08593 bool st = pr_makechipauth(*this,card)!=0; 08594 gxcondthrow(!st); 08595 return st; 08596 } 08597 08604 inline bool MakeChipAuth(const char *card) gxFuncThrowsError { 08605 bool st = pr_makechipauth(*this,card)!=0; 08606 gxcondthrow(!st); 08607 return st; 08608 } 08609 08616 inline bool MakeTerminalAuth(const wchar_t *card) gxFuncThrowsError { 08617 bool st = pr_maketerminalauth(*this,card)!=0; 08618 gxcondthrow(!st); 08619 return st; 08620 } 08621 08628 inline bool MakeTerminalAuth(const char *card) gxFuncThrowsError { 08629 bool st = pr_maketerminalauth(*this,card)!=0; 08630 gxcondthrow(!st); 08631 return st; 08632 } 08633 08642 inline bool InitTerminalAuth(const wchar_t *card, void **data, int *sdata) gxFuncThrowsError { 08643 bool st = pr_initta(*this, card, data, sdata)!=0; 08644 gxcondthrow(!st); 08645 return st; 08646 } 08647 08656 inline bool InitTerminalAuth(const char *card, void **data, int *sdata) gxFuncThrowsError { 08657 bool st = pr_initta(*this, card, data, sdata)!=0; 08658 gxcondthrow(!st); 08659 return st; 08660 } 08661 08670 inline bool CompleteTerminalAuth(const wchar_t *card, const void *data, int sdata) gxFuncThrowsError { 08671 bool st = pr_completeta(*this, card, data, sdata)!=0; 08672 gxcondthrow(!st); 08673 return st; 08674 } 08675 08684 inline bool CompleteTerminalAuth(const char *card, const void *data, int sdata) gxFuncThrowsError { 08685 bool st = pr_completeta(*this, card, data, sdata)!=0; 08686 gxcondthrow(!st); 08687 return st; 08688 } 08689 08697 inline bool LoadCertFile(const wchar_t *certificate, const wchar_t *privateKey = NULL) gxFuncThrowsError { 08698 bool st = pr_loadcertfile(*this, certificate, privateKey)!=0; 08699 gxcondthrow(!st); 08700 return st; 08701 } 08702 08710 inline bool LoadCertFile(const char *certificate, const char *privateKey = NULL) gxFuncThrowsError { 08711 bool st = pr_loadcertfile(*this, certificate, privateKey)!=0; 08712 gxcondthrow(!st); 08713 return st; 08714 } 08715 08722 inline bool LoadCertFromStore(const wchar_t *storename) gxFuncThrowsError { 08723 bool st = pr_loadcertfromstore(*this, storename)!=0; 08724 gxcondthrow(!st); 08725 return st; 08726 } 08727 08734 inline bool LoadCertFromStore(const char *storename) gxFuncThrowsError { 08735 bool st = pr_loadcertfromstore(*this, storename)!=0; 08736 gxcondthrow(!st); 08737 return st; 08738 } 08739 08749 inline bool LoadCertFileFromMem(void *certificate_data, unsigned int certificate_length, void *privateKey_data = NULL, unsigned int privateKey_length = 0) gxFuncThrowsError { 08750 bool st = pr_loadcertfrommem(*this, certificate_data, certificate_length, privateKey_data, privateKey_length)!=0; 08751 gxcondthrow(!st); 08752 return st; 08753 } 08754 08755 #endif 08756 08757 #if defined(GX_SWIG) || defined(GX_DOTNET) 08758 08765 inline bool LoadCertFileFromMem(gxInData certificate, gxInData privateKey) gxFuncThrowsError { 08766 GX_GETHANDLE(h); 08767 GX_GETDATA(certificate); 08768 bool st; 08769 if(privateKey!=GX_NULLPTR) { 08770 GX_GETDATA(privateKey); 08771 st = pr_loadcertfrommem(h, (void*)GX_DATAPTR(certificate), (unsigned int)GX_DATALEN(certificate), (void*)GX_DATAPTR(privateKey), (unsigned int)GX_DATALEN(privateKey))!=0; 08772 GX_FREEDATA(privateKey); 08773 } 08774 else{ 08775 st = pr_loadcertfrommem(h, (void*)GX_DATAPTR(certificate), (unsigned int)GX_DATALEN(certificate), 0, 0)!=0; 08776 } 08777 08778 GX_FREEDATA(certificate); 08779 gxcondthrow(!st); 08780 return st; 08781 } 08782 #endif 08783 #ifdef GX_UNICODE 08784 08793 inline int GetNextAuthentication(gxInStr card, int ForceNext GX_DEFARG(false)) gxFuncThrowsError { 08794 int Authentication; 08795 GX_GETHANDLE(h); 08796 GX_GETSTRING(_card, card); 08797 bool st = pr_getnextauthentication(h,_card,&Authentication,ForceNext)!=0; 08798 gxcondthrow(!st); 08799 return st ? Authentication : -1; 08800 } 08801 08813 inline int DoAuthentication(gxInStr card, int Authentication, gxInStrArray AuthData, int PasswordType GX_DEFARG(PR_PACE_PW_MRZ)) gxFuncThrowsError { 08814 GX_GETHANDLE(h); 08815 GX_GETSTRING(_card, card); 08816 GX_GETINSTRARRAY(AuthData); 08817 bool st = pr_doauthentication(h, _card, Authentication, (const wchar_t**)GX_GETINSTRARRAY_PTR(AuthData), GX_GETINSTRARRAY_LEN(AuthData), PasswordType)!=0; 08818 GX_FREEINSTRARRAY(AuthData); 08819 gxcondthrow(!st); 08820 return st; 08821 } 08822 08831 inline int DoAuthentication(gxInStr card, int Authentication) gxFuncThrowsError { 08832 GX_GETHANDLE(h); 08833 GX_GETSTRING(_card, card); 08834 bool st = pr_doauthentication(h, _card, Authentication, 0, 0, 0)!=0; 08835 gxcondthrow(!st); 08836 return st; 08837 } 08838 08845 inline bool MakePassiveAuth(gxInStr card) gxFuncThrowsError { 08846 GX_GETHANDLE(h); 08847 GX_GETSTRING(_card, card); 08848 bool st = pr_makepassiveauth(h,_card)!=0; 08849 gxcondthrow(!st); 08850 return st; 08851 } 08852 08862 inline bool MakeActiveAuth(gxInStr card) gxFuncThrowsError { 08863 GX_GETHANDLE(h); 08864 GX_GETSTRING(_card, card); 08865 bool st = pr_makeactiveauth(h,_card)!=0; 08866 gxcondthrow(!st); 08867 return st; 08868 } 08869 08876 inline bool MakeChipAuth(gxInStr card) gxFuncThrowsError { 08877 GX_GETHANDLE(h); 08878 GX_GETSTRING(_card, card); 08879 bool st = pr_makechipauth(h,_card)!=0; 08880 gxcondthrow(!st); 08881 return st; 08882 } 08883 08890 inline bool MakeTerminalAuth(gxInStr card) gxFuncThrowsError { 08891 GX_GETHANDLE(h); 08892 GX_GETSTRING(_card, card); 08893 bool st = pr_maketerminalauth(h,_card)!=0; 08894 gxcondthrow(!st); 08895 return st; 08896 } 08897 08898 #if defined(GX_SWIG) || defined(GX_DOTNET) 08899 08904 inline gxOutData InitTerminalAuth(gxInStr card) gxFuncThrowsError { 08905 GX_GETSTRING(_card, card); 08906 GX_GETHANDLE(h); 08907 void *data; 08908 int sdata; 08909 if(!pr_initta(h, _card, &data, &sdata)) { 08910 gxthrow; 08911 return GX_PUTDATA_NONE; 08912 } 08913 gxOutData od = GX_PUTDATA(data, sdata); 08914 if(data) gx_globalfree(data); 08915 return od; 08916 } 08917 08925 inline bool CompleteTerminalAuth(gxInStr card, gxInData data) gxFuncThrowsError { 08926 GX_GETSTRING(_card, card); 08927 GX_GETHANDLE(h); 08928 GX_GETDATA(data); 08929 bool st = pr_completeta(h, _card, GX_DATAPTR(data), GX_DATALEN(data))!=0; 08930 gxcondthrow(!st); 08931 return st; 08932 } 08933 #endif 08934 08942 inline bool LoadCertFile(gxInStr certificate, gxInStr privateKey /*GX_DEFARG("")*/) gxFuncThrowsError { 08943 GX_GETHANDLE(h); 08944 GX_GETSTRING(_certificate, certificate); 08945 GX_GETSTRING(_privateKey, privateKey); 08946 bool st = pr_loadcertfile(h,_certificate,_privateKey)!=0; 08947 gxcondthrow(!st); 08948 return st; 08949 } 08950 08957 inline bool LoadCertFromStore(gxInStr storename) gxFuncThrowsError { 08958 GX_GETHANDLE(h); 08959 GX_GETSTRING(_storename, storename); 08960 bool st = pr_loadcertfromstore(h,_storename)!=0; 08961 gxcondthrow(!st); 08962 return st; 08963 } 08964 08965 #endif 08966 08967 #ifdef GX_ASCII 08968 08977 inline int GetNextAuthentication(gxInAStr card, int ForceNext GX_DEFARG(false)) gxFuncThrowsError { 08978 int Authentication; 08979 GX_GETHANDLE(h); 08980 GX_GETASTRING(_card, card); 08981 bool st = pr_getnextauthentication(h,_card,&Authentication,ForceNext)!=0; 08982 gxcondthrow(!st); 08983 return st ? Authentication : -1; 08984 } 08985 08997 inline int DoAuthentication(gxInAStr card, int Authentication, gxInAStrArray AuthData, int PasswordType GX_DEFARG(PR_PACE_PW_MRZ)) gxFuncThrowsError { 08998 GX_GETHANDLE(h); 08999 GX_GETASTRING(_card, card); 09000 GX_GETINASTRARRAY(AuthData); 09001 bool st = pr_doauthenticationa(h, _card, Authentication, (const char **)GX_GETINASTRARRAY_PTR(AuthData), GX_GETINASTRARRAY_LEN(AuthData), PasswordType)!=0; 09002 GX_FREEINASTRARRAY(AuthData); 09003 gxcondthrow(!st); 09004 return st; 09005 } 09006 09015 inline int DoAuthentication(gxInAStr card, int Authentication) gxFuncThrowsError { 09016 GX_GETHANDLE(h); 09017 GX_GETASTRING(_card, card); 09018 bool st = pr_doauthenticationa(h, _card, Authentication, 0, 0, 0)!=0; 09019 gxcondthrow(!st); 09020 return st; 09021 } 09022 09029 inline bool MakePassiveAuth(gxInAStr card) gxFuncThrowsError { 09030 GX_GETHANDLE(h); 09031 GX_GETASTRING(_card, card); 09032 bool st = pr_makepassiveauth(h,_card)!=0; 09033 gxcondthrow(!st); 09034 return st; 09035 } 09036 09046 inline bool MakeActiveAuth(gxInAStr card) gxFuncThrowsError { 09047 GX_GETHANDLE(h); 09048 GX_GETASTRING(_card, card); 09049 bool st = pr_makeactiveauth(h,_card)!=0; 09050 gxcondthrow(!st); 09051 return st; 09052 } 09053 09060 inline bool MakeChipAuth(gxInAStr card) gxFuncThrowsError { 09061 GX_GETHANDLE(h); 09062 GX_GETASTRING(_card, card); 09063 bool st = pr_makechipauth(h,_card)!=0; 09064 gxcondthrow(!st); 09065 return st; 09066 } 09067 09074 inline bool MakeTerminalAuth(gxInAStr card) gxFuncThrowsError { 09075 GX_GETHANDLE(h); 09076 GX_GETASTRING(_card, card); 09077 bool st = pr_maketerminalauth(h,_card)!=0; 09078 gxcondthrow(!st); 09079 return st; 09080 } 09081 09082 #if defined(GX_SWIG) || defined(GX_DOTNET) 09083 09088 inline gxOutData InitTerminalAuth(gxInAStr card) gxFuncThrowsError { 09089 GX_GETASTRING(_card, card); 09090 GX_GETHANDLE(h); 09091 void *data; 09092 int sdata; 09093 if(!pr_initta(h, _card, &data, &sdata)) { 09094 gxthrow; 09095 return GX_PUTDATA_NONE; 09096 } 09097 gxOutData od = GX_PUTDATA(data, sdata); 09098 if(data) gx_globalfree(data); 09099 return od; 09100 } 09101 09109 inline bool CompleteTerminalAuth(gxInAStr card, gxInData data) gxFuncThrowsError { 09110 GX_GETASTRING(_card, card); 09111 GX_GETHANDLE(h); 09112 GX_GETDATA(data); 09113 bool st = pr_completeta(h, _card, GX_DATAPTR(data), GX_DATALEN(data))!=0; 09114 gxcondthrow(!st); 09115 return st; 09116 } 09117 #endif 09118 09126 inline bool LoadCertFile(gxInAStr certificate, gxInAStr privateKey /*GX_DEFARG("")*/) gxFuncThrowsError { 09127 GX_GETHANDLE(h); 09128 GX_GETASTRING(_certificate, certificate); 09129 GX_GETASTRING(_privateKey, privateKey); 09130 bool st = pr_loadcertfile(h,_certificate,_privateKey)!=0; 09131 gxcondthrow(!st); 09132 return st; 09133 } 09134 09141 inline bool LoadCertFromStore(gxInAStr storename) gxFuncThrowsError { 09142 GX_GETHANDLE(h); 09143 GX_GETASTRING(_storename, storename); 09144 bool st = pr_loadcertfromstore(h,_storename)!=0; 09145 gxcondthrow(!st); 09146 return st; 09147 } 09148 09149 #endif/* GX_ASCII */ 09150 09157 inline bool ClearCertList(int sel) gxFuncThrowsError { 09158 GX_GETHANDLE(h); 09159 bool st = pr_clearcertlist(h, sel)!=0; 09160 gxcondthrow(!st); 09161 return st; 09162 } 09163 09164 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 09165 09171 inline gxVariant * GetRfidCardInfo(const wchar_t *card) gxFuncThrowsError { 09172 gxVARIANT cardinfo; 09173 bool st = pr_getrfidcardinfo(*this,card,&cardinfo)!=0; 09174 gxcondthrow(!st); 09175 if(st) gxSystem::ClearError(); 09176 if(!cardinfo) return 0; 09177 gxVariant * vr = new gxVariant(cardinfo); 09178 gx_unrefvariant(cardinfo); 09179 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09180 return vr; 09181 } 09182 09188 inline gxVariant * GetRfidCardInfo(const char *card) gxFuncThrowsError { 09189 gxVARIANT cardinfo; 09190 bool st = pr_getrfidcardinfo(*this,card,&cardinfo)!=0; 09191 gxcondthrow(!st); 09192 if(st) gxSystem::ClearError(); 09193 if(!cardinfo) return 0; 09194 gxVariant * vr = new gxVariant(cardinfo); 09195 gx_unrefvariant(cardinfo); 09196 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09197 return vr; 09198 } 09199 09206 inline gxVariant* GetCertificateId(const char *card, int Authentication) gxFuncThrowsError { 09207 gxVARIANT Id; 09208 bool st = pr_getcertificateid(*this,card,Authentication,&Id)!= 0; 09209 gxcondthrow(!st); 09210 if(st) gxSystem::ClearError(); 09211 if(!Id) return 0; 09212 gxVariant *variant = new gxVariant(Id); 09213 gx_unrefvariant(Id); 09214 if(!variant){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09215 return variant; 09216 } 09217 09224 inline gxVariant* GetCertificateId(const wchar_t *card, int Authentication) gxFuncThrowsError { 09225 gxVARIANT Id; 09226 bool st = pr_getcertificateid(*this,card,Authentication,&Id)!= 0; 09227 gxcondthrow(!st); 09228 if(st) gxSystem::ClearError(); 09229 if(!Id) return 0; 09230 gxVariant *variant = new gxVariant(Id); 09231 gx_unrefvariant(Id); 09232 if(!variant){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09233 return variant; 09234 } 09235 09236 #endif 09237 09238 #ifdef GX_UNICODE 09239 09245 inline gxVariant * GetRfidCardInfo(gxInStr card) gxFuncThrowsError { 09246 GX_GETHANDLE(h); 09247 GX_GETSTRING(_card, card); 09248 gxVARIANT cardinfo; 09249 bool st = pr_getrfidcardinfo(h,_card,&cardinfo)!=0; 09250 gxcondthrow(!st); 09251 if(st) gxSystem::ClearError(); 09252 if(!cardinfo) return 0; 09253 #ifndef GX_DOTNET 09254 gxVariant * vr = new gxVariant(cardinfo); 09255 gx_unrefvariant(cardinfo); 09256 #else 09257 gxVariant * vr = new gxVariant(); 09258 vr->_set_variant(cardinfo); 09259 #endif 09260 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09261 return vr; 09262 } 09263 09270 inline gxVariant* GetCertificateId(gxInStr card, int Authentication) gxFuncThrowsError { 09271 GX_GETHANDLE(h); 09272 GX_GETSTRING(_card, card); 09273 gxVARIANT Id; 09274 bool st = pr_getcertificateid(h,_card,Authentication,&Id)!= 0; 09275 gxcondthrow(!st); 09276 if(st) gxSystem::ClearError(); 09277 if(!Id) return 0; 09278 #ifndef GX_DOTNET 09279 gxVariant *variant = new gxVariant(Id); 09280 gx_unrefvariant(Id); 09281 #else 09282 gxVariant *variant = new gxVariant(); 09283 variant->_set_variant(Id); 09284 #endif 09285 if(!variant){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09286 return variant; 09287 } 09288 09289 09290 #endif 09291 09292 #ifdef GX_ASCII 09293 09299 inline gxVariant * GetRfidCardInfo(gxInAStr card) gxFuncThrowsError { 09300 GX_GETHANDLE(h); 09301 GX_GETASTRING(_card, card); 09302 gxVARIANT cardinfo; 09303 bool st = pr_getrfidcardinfo(h,_card,&cardinfo)!=0; 09304 gxcondthrow(!st); 09305 if(st) gxSystem::ClearError(); 09306 if(!cardinfo) return 0; 09307 gxVariant * vr = new gxVariant(cardinfo); 09308 gx_unrefvariant(cardinfo); 09309 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09310 return vr; 09311 } 09312 09319 inline gxVariant* GetCertificateId(gxInAStr card, int Authentication) gxFuncThrowsError { 09320 GX_GETHANDLE(h); 09321 GX_GETASTRING(_card, card); 09322 gxVARIANT Id=0; 09323 bool st = pr_getcertificateid(h,_card,Authentication,&Id)!= 0; 09324 gxcondthrow(!st); 09325 if(st) gxSystem::ClearError(); 09326 if(!Id) return 0; 09327 gxVariant *variant = new gxVariant(Id); 09328 gx_unrefvariant(Id); 09329 if(!variant){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09330 return variant; 09331 } 09332 09333 #endif 09334 09345 inline prDoc * CompareFace(int page, int face_no) gxFuncThrowsError { 09346 gxVARIANT doc = 0; 09347 prDoc *cdoc = 0; 09348 GX_GETHANDLE(h); 09349 if(!pr_compareface(h,page,face_no,&doc)) { 09350 gxthrow; 09351 return cdoc; 09352 } 09353 ifDoc cdoc = new prDoc(doc,h); 09354 if(doc) gx_unrefvariant(doc); 09355 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09356 if(!doc) gxSystem::ClearError(); 09357 return cdoc; 09358 } 09359 09360 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 09361 09371 inline gxVariant * DecodeLatentImage(int page, int light, int type, const wchar_t *decpar) gxFuncThrowsError { 09372 gxVARIANT image; 09373 bool st = pr_decodelatentimage(*this, page, light, type, decpar, &image)!=0; 09374 gxcondthrow(!st); 09375 if(st) gxSystem::ClearError(); 09376 if(!image) return 0; 09377 gxVariant * vr = new gxVariant(image); 09378 gx_unrefvariant(image); 09379 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09380 return vr; 09381 } 09382 #endif 09383 09384 #ifdef GX_UNICODE 09385 09395 inline gxVariant * DecodeLatentImage(int page, int light, int type, gxInStr decpar) gxFuncThrowsError { 09396 GX_GETHANDLE(h); 09397 GX_GETSTRING(_decpar, decpar); 09398 gxVARIANT image; 09399 bool st = pr_decodelatentimage(h, page, light, type, _decpar, &image)!=0; 09400 gxcondthrow(!st); 09401 if(st) gxSystem::ClearError(); 09402 if(!image) return 0; 09403 #ifndef GX_DOTNET 09404 gxVariant * vr = new gxVariant(image); 09405 gx_unrefvariant(image); 09406 #else 09407 gxVariant * vr = new gxVariant(); 09408 vr->_set_variant(image); 09409 #endif 09410 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 09411 return vr; 09412 } 09413 #endif 09414 09415 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 09416 09423 inline prDoc * LoadDocument(const wchar_t *filename) gxFuncThrowsError { 09424 gxVARIANT doc = 0; 09425 prDoc *cdoc = 0; 09426 if(!pr_loaddocument(*this,filename,&doc)) { 09427 gxthrow; 09428 return cdoc; 09429 } 09430 ifDoc cdoc = new prDoc(doc,*this); 09431 if(doc) gx_unrefvariant(doc); 09432 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09433 if(!doc) gxSystem::ClearError(); 09434 return cdoc; 09435 } 09436 09444 inline prDoc * LoadDocument(const char *filename) gxFuncThrowsError { 09445 gxVARIANT doc = 0; 09446 prDoc *cdoc = 0; 09447 if(!pr_loaddocument(*this,filename,&doc)) { 09448 gxthrow; 09449 return cdoc; 09450 } 09451 ifDoc cdoc = new prDoc(doc,*this); 09452 if(doc) gx_unrefvariant(doc); 09453 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09454 if(!doc) gxSystem::ClearError(); 09455 return cdoc; 09456 } 09457 09466 inline prDoc * LoadDocumentFromMem(const gxu8 *buffer, gxi32 buflen) gxFuncThrowsError { 09467 gxVARIANT doc = 0; 09468 prDoc *cdoc = 0; 09469 if(!pr_loaddocumentfrommem(*this, buffer, buflen, &doc)) { 09470 gxthrow; 09471 return cdoc; 09472 } 09473 ifDoc cdoc = new prDoc(doc,*this); 09474 if(doc) gx_unrefvariant(doc); 09475 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09476 if(!doc) gxSystem::ClearError(); 09477 return cdoc; 09478 } 09479 09480 #endif/* GX_SWIG GX_DOTNET */ 09481 09482 #ifdef GX_UNICODE 09483 09490 inline prDoc * LoadDocument(gxInStr filename) gxFuncThrowsError { 09491 gxVARIANT doc = 0; 09492 prDoc *cdoc = 0; 09493 GX_GETHANDLE(h); 09494 GX_GETSTRING(_filename, filename); 09495 if(!pr_loaddocument(h,_filename,&doc)) { 09496 gxthrow; 09497 return cdoc; 09498 } 09499 ifDoc cdoc = new prDoc(doc,h); 09500 if(doc) gx_unrefvariant(doc); 09501 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09502 if(!doc) gxSystem::ClearError(); 09503 return cdoc; 09504 } 09505 #endif/* GX_UNICODE */ 09506 09507 #ifdef GX_ASCII 09508 09515 inline prDoc * LoadDocument(gxInAStr filename) gxFuncThrowsError { 09516 gxVARIANT doc = 0; 09517 prDoc *cdoc = 0; 09518 GX_GETHANDLE(h); 09519 GX_GETASTRING(_filename, filename); 09520 if(!pr_loaddocument(h,_filename,&doc)) { 09521 gxthrow; 09522 return cdoc; 09523 } 09524 ifDoc cdoc = new prDoc(doc,h); 09525 if(doc) gx_unrefvariant(doc); 09526 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09527 if(!doc) gxSystem::ClearError(); 09528 return cdoc; 09529 } 09530 #endif/* GX_ASCII */ 09531 09532 #if defined(GX_SWIG) || defined(GX_DOTNET) 09533 09540 inline prDoc * LoadDocumentFromMem(gxInData buffer) gxFuncThrowsError { 09541 gxVARIANT doc = 0; 09542 prDoc *cdoc = 0; 09543 GX_GETHANDLE(h); 09544 GX_GETDATA(buffer); 09545 bool st = pr_loaddocumentfrommem(h, (const gxu8*)GX_DATAPTR(buffer), GX_DATALEN(buffer), &doc)!=0; 09546 GX_FREEDATA(buffer); 09547 if(!st) { 09548 gxthrow; 09549 return cdoc; 09550 } 09551 ifDoc cdoc = new prDoc(doc, h); 09552 if(doc) gx_unrefvariant(doc); 09553 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09554 if(!doc) gxSystem::ClearError(); 09555 return cdoc; 09556 } 09557 #endif 09558 09564 inline prDoc * GetDocumentRoot() gxFuncThrowsError { 09565 gxVARIANT doc = 0; 09566 prDoc *cdoc = 0; 09567 GX_GETHANDLE(h); 09568 if(!pr_getdocumentroot(h,&doc)) { 09569 gxthrow; 09570 return cdoc; 09571 } 09572 ifDoc cdoc = new prDoc(doc,h); 09573 if(doc) gx_unrefvariant(doc); 09574 ifDoc if(!cdoc){gxSystem::SetError(GX_ENOMEM);gxthrow;} 09575 if(!doc) gxSystem::ClearError(); 09576 return cdoc; 09577 } 09578 }; 09579 09580 #ifndef GX_MANUAL 09581 #undef ifDoc 09582 #endif 09583 09584 /******************************************************************************/ 09585 #endif/* NO_GX_CLASSES )*/ 09586 /******************************************************************************/ 09587 #ifdef GX_NAMESPACES 09588 } 09589 #endif 09590 /******************************************************************************/ 09591 #ifdef __BORLANDC__ 09592 #pragma warn .rch 09593 #endif 09594 #ifdef _MSC_VER 09595 #pragma warning(pop) 09596 #endif 09597 /******************************************************************************/ 09598 #endif/* PRAPI_INCL */