[Arsperl-devel] ARSperl ARS.pm, 1.75, 1.76 ARS.xs, 1.121, 1.122 StructDef.pl, 1.4, 1.5 changes.dat,
Brought to you by:
jeffmurphy
From: Thilo S. <ts...@us...> - 2009-03-31 17:41:30
|
Update of /cvsroot/arsperl/ARSperl In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19729 Modified Files: ARS.pm ARS.xs StructDef.pl changes.dat support-h.template support.c supportrev.c supportrev.h supportrev_generated.c supportrev_generated.h Log Message: arsystem 7.5 port, AR*Image functions Index: changes.dat =================================================================== RCS file: /cvsroot/arsperl/ARSperl/changes.dat,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** changes.dat 6 Jan 2009 19:21:46 -0000 1.62 --- changes.dat 31 Mar 2009 17:41:17 -0000 1.63 *************** *** 1,3 **** --- 1,7 ---- released=xx/xx/xxx version=1.92 + TS additional ars_Login parameters by Conny Martin + TS implemented ars_GetList/Get/Create/Set/DeleteImage + TS fixed incorrect AR_ARITH_OP_NEGATE handling in rev_ARArithOpStruct + TS fixed wrong operand evaluation for AR_ARITH_OP_NEGATE in perl_ARArithOpStruct TS fixed ars_SetServerInfo() memory violation in case of more than key/value pair TS ars_GetFieldTable performance improvement by using ARGetMultipleFields Index: ARS.xs =================================================================== RCS file: /cvsroot/arsperl/ARSperl/ARS.xs,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** ARS.xs 6 Jan 2009 19:21:46 -0000 1.121 --- ARS.xs 31 Mar 2009 17:41:17 -0000 1.122 *************** *** 240,244 **** ARControlStruct * ! ars_Login(server, username, password, lang=NULL, authString=NULL, tcpport=0, rpcnumber=0) char * server char * username --- 240,244 ---- ARControlStruct * ! ars_Login(server, username, password, lang=NULL, authString=NULL, tcpport=0, rpcnumber=0, ...) char * server [...1236 lines suppressed...] *** 7332,7335 **** --- 7863,7880 ---- } + + char * + field_cache_key(ctrl) + ARControlStruct * ctrl + CODE: + { + char server_tag[100]; + sprintf( server_tag, "%s:%p", ctrl->server, ctrl ); + RETVAL = server_tag; + } + OUTPUT: + RETVAL + + MODULE = ARS PACKAGE = ARQualifierStructPtr Index: ARS.pm =================================================================== RCS file: /cvsroot/arsperl/ARSperl/ARS.pm,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ARS.pm 3 Nov 2008 17:08:18 -0000 1.75 --- ARS.pm 31 Mar 2009 17:41:16 -0000 1.76 *************** *** 112,115 **** --- 112,117 ---- ars_GetAlertCount ars_RegisterForAlerts ars_DeregisterForAlerts ars_GetListAlertUser ars_DecodeAlertMessage ars_CreateAlertEvent ars_VerifyUser + ars_GetListImage ars_GetImage ars_CreateImage ars_SetImage ars_DeleteImage + ars_GetListEntryWithMultiSchemaFields ); Index: support.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/support.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** support.c 6 Jan 2009 19:21:46 -0000 1.68 --- support.c 31 Mar 2009 17:41:17 -0000 1.69 *************** *** 2514,2518 **** --- 2514,2520 ---- } + /* printf("numItems = %d\n", in->numItems); */ for (i = 0; i < in->numItems; i++) { + /* printf("[%d] %i\n", i, (int) in->permissionList[i].groupId); */ sprintf(groupid, "%i", (int) in->permissionList[i].groupId); for (j = 0; tmap[j].number != TYPEMAP_LAST; j++) { *************** *** 2931,2934 **** --- 2933,2951 ---- #endif + #if AR_CURRENT_API_VERSION >= 14 + SV * + perl_ARImageDataStruct(ARControlStruct * ctrl, ARImageDataStruct * in) + { + SV *byte_list; + + if( in->numItems == 0 ){ + return newSVsv(&PL_sv_undef); + } + + byte_list = newSVpv((char *) in->bytes, in->numItems); + return byte_list; + } + #endif + SV * perl_ARByteList(ARControlStruct * ctrl, ARByteList * in) *************** *** 3212,3217 **** hv_store(hash, "oper", strlen("oper") , newSVpv(oper, 0), 0); if (in->operation == AR_ARITH_OP_NEGATE) { ! hv_store(hash, "left", strlen("left") , ! perl_ARFieldValueOrArithStruct(ctrl, &in->operandLeft), 0); } else { hv_store(hash, "right", strlen("right") , --- 3229,3236 ---- hv_store(hash, "oper", strlen("oper") , newSVpv(oper, 0), 0); if (in->operation == AR_ARITH_OP_NEGATE) { ! /* hv_store(hash, "left", strlen("left") , ! perl_ARFieldValueOrArithStruct(ctrl, &in->operandLeft), 0); */ ! hv_store(hash, "right", strlen("right") , ! perl_ARFieldValueOrArithStruct(ctrl, &in->operandRight), 0); } else { hv_store(hash, "right", strlen("right") , Index: StructDef.pl =================================================================== RCS file: /cvsroot/arsperl/ARSperl/StructDef.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StructDef.pl 15 May 2008 18:30:01 -0000 1.4 --- StructDef.pl 31 Mar 2009 17:41:17 -0000 1.5 *************** *** 626,651 **** }, }, ! ARArithOpStruct => { ! oper => { ! _type => 'unsigned int', ! _data => 'p->operation', ! _map => { ! AR_ARITH_OP_ADD => '+', ! AR_ARITH_OP_SUBTRACT => '-', ! AR_ARITH_OP_MULTIPLY => '*', ! AR_ARITH_OP_DIVIDE => '/', ! AR_ARITH_OP_MODULO => '%', ! AR_ARITH_OP_NEGATE => '-', ! }, ! }, ! left => { ! _type => 'ARFieldValueOrArithStruct', ! _data => 'p->operandLeft', ! }, ! right => { ! _type => 'ARFieldValueOrArithStruct', ! _data => 'p->operandRight', ! }, ! }, ARStatHistoryValue => { _header_only => 1, --- 626,651 ---- }, }, ! #ARArithOpStruct => { ! # oper => { ! # _type => 'unsigned int', ! # _data => 'p->operation', ! # _map => { ! # AR_ARITH_OP_ADD => '+', ! # AR_ARITH_OP_SUBTRACT => '-', ! # AR_ARITH_OP_MULTIPLY => '*', ! # AR_ARITH_OP_DIVIDE => '/', ! # AR_ARITH_OP_MODULO => '%', ! # AR_ARITH_OP_NEGATE => '-', ! # }, ! # }, ! # left => { ! # _type => 'ARFieldValueOrArithStruct', ! # _data => 'p->operandLeft', ! # }, ! # right => { ! # _type => 'ARFieldValueOrArithStruct', ! # _data => 'p->operandRight', ! # }, ! #}, ARStatHistoryValue => { _header_only => 1, Index: supportrev_generated.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** supportrev_generated.c 15 May 2008 18:30:07 -0000 1.5 --- supportrev_generated.c 31 Mar 2009 17:41:18 -0000 1.6 *************** *** 178,307 **** int - rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ){ - SV **val; - int i = 0; - - if( !p ){ - ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: AR Object param is NULL" ); - return -1; - } - - if( SvTYPE((SV*) h) == SVt_PVHV ){ - - // printf( "ARArithOpStruct: k = <%s>\n", k ); - if( hv_exists(h,k,strlen(k)) ){ - val = hv_fetch( h, k, strlen(k), 0 ); - if( val && *val ){ - { - - - if( SvTYPE(SvRV(*val)) == SVt_PVHV ){ - int i = 0, num = 0; - HV *h = (HV* ) SvRV((SV*) *val); - char k[256]; - k[255] = '\0'; - - - { - SV **val; - strncpy( k, "left", 255 ); - val = hv_fetch( h, "left", 4, 0 ); - if( val && *val ){ - { - rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandLeft) ); - } - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"left\"" ); - return -1; - } - } - - - { - SV **val; - strncpy( k, "right", 255 ); - val = hv_fetch( h, "right", 5, 0 ); - if( val && *val ){ - { - rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandRight) ); - } - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"right\"" ); - return -1; - } - } - - - { - SV **val; - strncpy( k, "oper", 255 ); - val = hv_fetch( h, "oper", 4, 0 ); - if( val && *val ){ - { - int flag = 0; - if( !strcmp(SvPV_nolen(*val),"/") ){ - p->operation = AR_ARITH_OP_DIVIDE; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"%") ){ - p->operation = AR_ARITH_OP_MODULO; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"+") ){ - p->operation = AR_ARITH_OP_ADD; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"-") ){ - p->operation = AR_ARITH_OP_NEGATE; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"*") ){ - p->operation = AR_ARITH_OP_MULTIPLY; - flag = 1; - } - if( !strcmp(SvPV_nolen(*val),"-") ){ - p->operation = AR_ARITH_OP_SUBTRACT; - flag = 1; - } - if( flag == 0 ){ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: invalid key value" ); - ARError_add( AR_RETURN_ERROR, AP_ERR_CONTINUE, SvPV_nolen(*val) ); - } - } - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"oper\"" ); - return -1; - } - } - - - }else{ - ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: hash value is not a hash reference" ); - return -1; - } - - - } - }else{ - ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: hv_fetch returned null"); - return -2; - } - }else{ - ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: key doesn't exist"); - ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k ); - return -2; - } - }else{ - ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: first argument is not a hash"); - return -1; - } - - return 0; - } - - - - - int rev_ARAttachLimitsStruct( ARControlStruct *ctrl, HV *h, char *k, ARAttachLimitsStruct *p ){ SV **val; --- 178,181 ---- Index: supportrev.h =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** supportrev.h 15 May 2008 18:30:03 -0000 1.17 --- supportrev.h 31 Mar 2009 17:41:18 -0000 1.18 *************** *** 89,92 **** --- 89,97 ---- HV *h, char *k, ARMacroParmList *m); + #if AR_CURRENT_API_VERSION >= 14 + EXTERN int rev_ARImageDataStruct(ARControlStruct * ctrl, + HV * h, char *k, ARImageDataStruct * b); + #endif + #if AR_EXPORT_VERSION >= 3 EXTERN int rev_ARByteList(ARControlStruct *ctrl, *************** *** 135,138 **** --- 140,145 ---- #endif + EXTERN int + rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ); #endif /* __supportrev_h_ */ Index: support-h.template =================================================================== RCS file: /cvsroot/arsperl/ARSperl/support-h.template,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** support-h.template 6 Jan 2009 19:21:46 -0000 1.35 --- support-h.template 31 Mar 2009 17:41:17 -0000 1.36 *************** *** 498,501 **** --- 498,504 ---- EXTERN SV *perl_ARCompoundSchema(ARControlStruct *ctrl, ARCompoundSchema *); EXTERN SV *perl_ARSortList(ARControlStruct *ctrl, ARSortList *); + #if AR_CURRENT_API_VERSION >= 14 + EXTERN SV *perl_ARImageDataStruct(ARControlStruct * ctrl, ARImageDataStruct * in); + #endif EXTERN SV *perl_ARByteList(ARControlStruct *ctrl, ARByteList *); EXTERN SV *perl_ARCoordStruct(ARControlStruct *ctrl, ARCoordStruct *); Index: supportrev_generated.h =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev_generated.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** supportrev_generated.h 15 May 2008 18:30:07 -0000 1.4 --- supportrev_generated.h 31 Mar 2009 17:41:18 -0000 1.5 *************** *** 26,32 **** #endif - EXTERN int rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ); - - EXTERN int rev_ARAttachLimitsStruct( ARControlStruct *ctrl, HV *h, char *k, ARAttachLimitsStruct *p ); --- 26,29 ---- Index: supportrev.c =================================================================== RCS file: /cvsroot/arsperl/ARSperl/supportrev.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** supportrev.c 24 Sep 2008 13:03:12 -0000 1.32 --- supportrev.c 31 Mar 2009 17:41:18 -0000 1.33 *************** *** 1462,1465 **** --- 1462,1503 ---- } + #if AR_CURRENT_API_VERSION >= 14 + int + rev_ARImageDataStruct(ARControlStruct * ctrl, HV * h, char *k, ARImageDataStruct * b) + { + if (!h || !k || !b) { + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, + "rev_ARImageDataStruct: invalid (NULL) parameter"); + return -1; + } + if (hv_exists(h, k, strlen(k) )) { + SV **vv = hv_fetch(h, k, strlen(k) , 0); + + if (vv && *vv && SvPOK(*vv)) { + char *byteString = SvPV(*vv, PL_na); + int byteLen = SvCUR(*vv); + + b->numItems = byteLen; + b->bytes = MALLOCNN(byteLen + 1); /* don't want FreeAR.. to whack us */ + + copymem(b->bytes, byteString, byteLen); + return 0; + } else { + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, + "rev_ARImageDataStruct: hash value is not a defined scalar for key:"); + ARError_add(AR_RETURN_ERROR, AP_ERR_CONTINUE, + k ? k : "[key null]"); + } + } else { + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, + "rev_ARImageDataStruct: hash key doesn't exist:"); + ARError_add(AR_RETURN_WARNING, AP_ERR_CONTINUE, + k ? k : "[key null]"); + return -2; + } + return -1; + } + #endif + #if AR_EXPORT_VERSION >= 3 int *************** *** 3487,3488 **** --- 3525,3662 ---- #endif + + + + int + rev_ARArithOpStruct( ARControlStruct *ctrl, HV *h, char *k, ARArithOpStruct *p ){ + SV **val; + int i = 0; + + if( !p ){ + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: AR Object param is NULL" ); + return -1; + } + + if( SvTYPE((SV*) h) == SVt_PVHV ){ + + // printf( "ARArithOpStruct: k = <%s>\n", k ); + if( hv_exists(h,k,strlen(k)) ){ + val = hv_fetch( h, k, strlen(k), 0 ); + if( val && *val ){ + { + + + if( SvTYPE(SvRV(*val)) == SVt_PVHV ){ + int i = 0, num = 0; + HV *h = (HV* ) SvRV((SV*) *val); + char k[256]; + k[255] = '\0'; + + + { + SV **val; + strncpy( k, "oper", 255 ); + val = hv_fetch( h, "oper", 4, 0 ); + if( val && *val ){ + { + int flag = 0; + if( !strcmp(SvPV_nolen(*val),"/") ){ + p->operation = AR_ARITH_OP_DIVIDE; + flag = 1; + } + if( !strcmp(SvPV_nolen(*val),"%") ){ + p->operation = AR_ARITH_OP_MODULO; + flag = 1; + } + if( !strcmp(SvPV_nolen(*val),"+") ){ + p->operation = AR_ARITH_OP_ADD; + flag = 1; + } + /* + if( !strcmp(SvPV_nolen(*val),"-") ){ + p->operation = AR_ARITH_OP_NEGATE; + flag = 1; + } + */ + if( !strcmp(SvPV_nolen(*val),"*") ){ + p->operation = AR_ARITH_OP_MULTIPLY; + flag = 1; + } + if( !strcmp(SvPV_nolen(*val),"-") ){ + p->operation = AR_ARITH_OP_SUBTRACT; + flag = 1; + } + if( flag == 0 ){ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: invalid key value" ); + ARError_add( AR_RETURN_ERROR, AP_ERR_CONTINUE, SvPV_nolen(*val) ); + } + } + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"oper\"" ); + return -1; + } + } + + + { + SV **val; + strncpy( k, "left", 255 ); + val = hv_fetch( h, "left", 4, 0 ); + if( val && *val ){ + { + rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandLeft) ); + } + }else{ + if( p->operation == AR_ARITH_OP_SUBTRACT ){ + p->operation = AR_ARITH_OP_NEGATE; + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"left\"" ); + return -1; + } + } + } + + + { + SV **val; + strncpy( k, "right", 255 ); + val = hv_fetch( h, "right", 5, 0 ); + if( val && *val ){ + { + rev_ARFieldValueOrArithStruct( ctrl, h, k, &(p->operandRight) ); + } + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "hv_fetch error: key \"right\"" ); + return -1; + } + } + + + + + }else{ + ARError_add( AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: hash value is not a hash reference" ); + return -1; + } + + + } + }else{ + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: hv_fetch returned null"); + return -2; + } + }else{ + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, "rev_ARArithOpStruct: key doesn't exist"); + ARError_add(AR_RETURN_WARNING, AP_ERR_GENERAL, k ); + return -2; + } + }else{ + ARError_add(AR_RETURN_ERROR, AP_ERR_GENERAL, "rev_ARArithOpStruct: first argument is not a hash"); + return -1; + } + + return 0; + } + + + |