From: <ki...@us...> - 2003-04-25 17:04:46
|
Update of /cvsroot/gphoto/libgphoto2/camlibs/ptp2 In directory sc8-pr-cvs1:/tmp/cvs-serv9738 Modified Files: ChangeLog library.c ptp.c Log Message: * library.c: added perror on gp_port_read() and write error; it won't hurt * ptp.c: NULL does not have to be 0 bug fixed; cosmetics error output tuning; unpack structures only if transaction succeeded * ChangeLog: reformated this file ;) Index: ChangeLog =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/ptp2/ChangeLog,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ChangeLog 12 Apr 2003 18:16:19 -0000 1.14 +++ ChangeLog 25 Apr 2003 17:04:37 -0000 1.15 @@ -1,3 +1,11 @@ +2003-04-25 Mariusz Woloszyn + * library.c: added perror on gp_port_read() and write error; it + won't hurt + * ptp.c: NULL does not have to be 0 bug fixed; + cosmetics error output tuning; + unpack structures only if transaction succeeded + * ChangeLog: reformated this file ;) + 2003-04-12 Marcus Meissner <ma...@je...> * ptp.c, library.c: Check return codes for property get during @@ -26,20 +34,25 @@ * ptp.c: added ptp_getdevicepropdesc() * ptp.h: introduced some device property describing structures and constants + 2003-03-29 Mariusz Woloszyn * library.c: enabled downloading of nonimage files * ptp.c: fixed a bug in capture code + 2003-03-29 Mariusz Woloszyn * library.c: enabled back capture image support + 2003-03-29 Mariusz Woloszyn * ptp.h: added Nparam field to PTPContainer * ptp.c: using Nparam field we send requests with only used params to the camera (although specs says it's legal, some cameras do not like it) + 2003-03-29 Mariusz Woloszyn * ptp.c: fixed a memcopy size bug 2003-03-27 Mariusz Woloszyn * library.c: added HP PhotoSmart 320 + 2003-01-08 Mariusz Woloszyn * ptp.c: cosmetic * ptp-pack.c: fixed a bug in ptp_unpack_DI(), totallen could be Index: library.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/ptp2/library.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- library.c 16 Apr 2003 09:50:43 -0000 1.16 +++ library.c 25 Apr 2003 17:04:38 -0000 1.17 @@ -376,7 +376,10 @@ if (result >= 0) return (PTP_RC_OK); else + { + perror("gp_port_read"); return (translate_gp_result (result)); + } } static short @@ -393,7 +396,10 @@ if (result >= 0) return (PTP_RC_OK); else + { + perror("gp_port_write"); return (translate_gp_result (result)); + } } static short Index: ptp.c =================================================================== RCS file: /cvsroot/gphoto/libgphoto2/camlibs/ptp2/ptp.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ptp.c 12 Apr 2003 18:14:54 -0000 1.12 +++ ptp.c 25 Apr 2003 17:04:38 -0000 1.13 @@ -55,10 +55,13 @@ va_list args; va_start (args, format); - if (params->debug_func) + if (params->debug_func!=NULL) params->debug_func (params->data, format, args); else + { vfprintf (stderr, format, args); + fprintf (stderr,"\n"); + } va_end (args); } @@ -68,10 +71,13 @@ va_list args; va_start (args, format); - if (params->error_func) + if (params->error_func!=NULL) params->error_func (params->data, format, args); else + { vfprintf (stderr, format, args); + fprintf (stderr,"\n"); + } va_end (args); } @@ -397,7 +403,7 @@ ptp.Code=PTP_OC_GetDeviceInfo; ptp.Nparam=0; ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &di); - ptp_unpack_DI(params, di, deviceinfo); + if (ret == PTP_RC_OK) ptp_unpack_DI(params, di, deviceinfo); free(di); return ret; } @@ -476,7 +482,7 @@ ptp.Code=PTP_OC_GetStorageIDs; ptp.Nparam=0; ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &sids); - ptp_unpack_SIDs(params, sids, storageids); + if (ret == PTP_RC_OK) ptp_unpack_SIDs(params, sids, storageids); free(sids); return ret; } @@ -504,7 +510,7 @@ ptp.Param1=storageid; ptp.Nparam=1; ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &si); - ptp_unpack_SI(params, si, storageinfo); + if (ret == PTP_RC_OK) ptp_unpack_SI(params, si, storageinfo); free(si); return ret; } @@ -539,7 +545,7 @@ ptp.Param3=associationOH; ptp.Nparam=3; ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &oh); - ptp_unpack_OH(params, oh, objecthandles); + if (ret == PTP_RC_OK) ptp_unpack_OH(params, oh, objecthandles); free(oh); return ret; } @@ -557,7 +563,7 @@ ptp.Param1=handle; ptp.Nparam=1; ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &oi); - ptp_unpack_OI(params, oi, objectinfo); + if (ret == PTP_RC_OK) ptp_unpack_OI(params, oi, objectinfo); free(oi); return ret; } @@ -720,10 +726,8 @@ ptp.Param1=propcode; ptp.Nparam=1; ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &dpd); - if (ret == PTP_RC_OK) { - ptp_unpack_DPD(params, dpd, devicepropertydesc); - free(dpd); - } + if (ret == PTP_RC_OK) ptp_unpack_DPD(params, dpd, devicepropertydesc); + free(dpd); return ret; } |