From: <mar...@us...> - 2009-08-19 14:18:22
|
Revision: 12412 http://gphoto.svn.sourceforge.net/gphoto/?rev=12412&view=rev Author: marcusmeissner Date: 2009-08-19 14:18:14 +0000 (Wed, 19 Aug 2009) Log Message: ----------- renamed private to priv Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h trunk/libgphoto2/camlibs/ptp2/ptpip.c trunk/libgphoto2/camlibs/ptp2/usb.c Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2009-08-17 12:13:26 UTC (rev 12411) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2009-08-19 14:18:14 UTC (rev 12412) @@ -3779,7 +3779,7 @@ ptp_init_camerafile_handler (PTPDataHandler *handler, CameraFile *file) { PTPCFHandlerPrivate* private = malloc (sizeof(PTPCFHandlerPrivate)); if (!private) return PTP_RC_GeneralError; - handler->private = private; + handler->priv = private; handler->getfunc = gpfile_getfunc; handler->putfunc = gpfile_putfunc; private->file = file; @@ -3788,7 +3788,7 @@ static uint16_t ptp_exit_camerafile_handler (PTPDataHandler *handler) { - free (handler->private); + free (handler->priv); return PTP_RC_OK; } Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2009-08-17 12:13:26 UTC (rev 12411) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2009-08-19 14:18:14 UTC (rev 12412) @@ -246,7 +246,7 @@ ptp_init_recv_memory_handler(PTPDataHandler *handler) { PTPMemHandlerPrivate* priv; priv = malloc (sizeof(PTPMemHandlerPrivate)); - handler->private = priv; + handler->priv = priv; handler->getfunc = memory_getfunc; handler->putfunc = memory_putfunc; priv->data = NULL; @@ -266,7 +266,7 @@ priv = malloc (sizeof(PTPMemHandlerPrivate)); if (!priv) return PTP_RC_GeneralError; - handler->private = priv; + handler->priv = priv; handler->getfunc = memory_getfunc; handler->putfunc = memory_putfunc; priv->data = data; @@ -278,7 +278,7 @@ /* free private struct + data */ static uint16_t ptp_exit_send_memory_handler (PTPDataHandler *handler) { - PTPMemHandlerPrivate* priv = (PTPMemHandlerPrivate*)handler->private; + PTPMemHandlerPrivate* priv = (PTPMemHandlerPrivate*)handler->priv; /* data is owned by caller */ free (priv); return PTP_RC_OK; @@ -289,7 +289,7 @@ ptp_exit_recv_memory_handler (PTPDataHandler *handler, unsigned char **data, unsigned long *size ) { - PTPMemHandlerPrivate* priv = (PTPMemHandlerPrivate*)handler->private; + PTPMemHandlerPrivate* priv = (PTPMemHandlerPrivate*)handler->priv; *data = priv->data; *size = priv->size; free (priv); @@ -337,7 +337,7 @@ ptp_init_fd_handler(PTPDataHandler *handler, int fd) { PTPFDHandlerPrivate* priv; priv = malloc (sizeof(PTPFDHandlerPrivate)); - handler->private = priv; + handler->priv = priv; handler->getfunc = fd_getfunc; handler->putfunc = fd_putfunc; priv->fd = fd; @@ -346,7 +346,7 @@ static uint16_t ptp_exit_fd_handler (PTPDataHandler *handler) { - PTPFDHandlerPrivate* priv = (PTPFDHandlerPrivate*)handler->private; + PTPFDHandlerPrivate* priv = (PTPFDHandlerPrivate*)handler->priv; free (priv); return PTP_RC_OK; } Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2009-08-17 12:13:26 UTC (rev 12411) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2009-08-19 14:18:14 UTC (rev 12412) @@ -40,6 +40,11 @@ #define PTP_DL_BE 0xF0 #define PTP_DL_LE 0x0F +/* USB interface class */ +#ifndef USB_CLASS_PTP +#define USB_CLASS_PTP 6 +#endif + /* PTP request/response/event general PTP container (transport independent) */ struct _PTPContainer { @@ -1839,17 +1844,17 @@ typedef struct _PTPParams PTPParams; -typedef uint16_t (* PTPDataGetFunc) (PTPParams* params, void* private, +typedef uint16_t (* PTPDataGetFunc) (PTPParams* params, void*priv, unsigned long wantlen, unsigned char *data, unsigned long *gotlen); -typedef uint16_t (* PTPDataPutFunc) (PTPParams* params, void* private, +typedef uint16_t (* PTPDataPutFunc) (PTPParams* params, void*priv, unsigned long sendlen, unsigned char *data, unsigned long *putlen); typedef struct _PTPDataHandler { PTPDataGetFunc getfunc; PTPDataPutFunc putfunc; - void *private; + void *priv; } PTPDataHandler; /* Modified: trunk/libgphoto2/camlibs/ptp2/ptpip.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptpip.c 2009-08-17 12:13:26 UTC (rev 12411) +++ trunk/libgphoto2/camlibs/ptp2/ptpip.c 2009-08-19 14:18:14 UTC (rev 12412) @@ -249,7 +249,7 @@ } else { type = PTPIP_END_DATA_PACKET; } - ret = handler->getfunc (params, handler->private, towrite, &xdata[ptpip_data_payload+8], &xtowrite); + ret = handler->getfunc (params, handler->priv, towrite, &xdata[ptpip_data_payload+8], &xtowrite); if (ret == -1) { perror ("getfunc in senddata failed"); free (xdata); @@ -313,7 +313,7 @@ ); break; } - xret = handler->putfunc (params, handler->private, + xret = handler->putfunc (params, handler->priv, datalen, xdata+ptpip_data_payload, &written ); if (xret == -1) { @@ -335,7 +335,7 @@ ); break; } - xret = handler->putfunc (params, handler->private, + xret = handler->putfunc (params, handler->priv, datalen, xdata+ptpip_data_payload, &written ); if (xret == -1) { Modified: trunk/libgphoto2/camlibs/ptp2/usb.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/usb.c 2009-08-17 12:13:26 UTC (rev 12411) +++ trunk/libgphoto2/camlibs/ptp2/usb.c 2009-08-19 14:18:14 UTC (rev 12412) @@ -128,7 +128,7 @@ /* For all camera devices. */ datawlen = (size<PTP_USB_BULK_PAYLOAD_LEN_WRITE)?size:PTP_USB_BULK_PAYLOAD_LEN_WRITE; wlen = PTP_USB_BULK_HDR_LEN + datawlen; - ret = handler->getfunc(params, handler->private, datawlen, usbdata.payload.data, &gotlen); + ret = handler->getfunc(params, handler->priv, datawlen, usbdata.payload.data, &gotlen); if (ret != PTP_RC_OK) return ret; if (gotlen != datawlen) @@ -161,7 +161,7 @@ toread = 4096; if (toread > bytes_left_to_transfer) toread = bytes_left_to_transfer; - ret = handler->getfunc (params, handler->private, toread, bytes, &readlen); + ret = handler->getfunc (params, handler->priv, toread, bytes, &readlen); if (ret != PTP_RC_OK) break; res = gp_port_write (camera->port, (char*)bytes, readlen); @@ -292,7 +292,7 @@ if (!data) return PTP_RC_GeneralError; /* Copy first part of data to 'data' */ handler->putfunc( - params, handler->private, rlen - PTP_USB_BULK_HDR_LEN, usbdata.payload.data, + params, handler->priv, rlen - PTP_USB_BULK_HDR_LEN, usbdata.payload.data, &written ); /* stuff data directly to passed data handler */ @@ -303,7 +303,7 @@ free (data); return PTP_ERROR_IO; } - handler->putfunc (params, handler->private, result, data, &written); + handler->putfunc (params, handler->priv, result, data, &written); if (result < PTP_USB_BULK_HS_MAX_PACKET_LEN_READ) break; } @@ -351,7 +351,7 @@ /* Copy first part of data to 'data' */ handler->putfunc( - params, handler->private, rlen - PTP_USB_BULK_HDR_LEN, usbdata.payload.data, + params, handler->priv, rlen - PTP_USB_BULK_HDR_LEN, usbdata.payload.data, &written ); /* Is that all of data? */ @@ -385,7 +385,7 @@ ret = PTP_ERROR_IO; break; } - ret = handler->putfunc (params, handler->private, + ret = handler->putfunc (params, handler->priv, res, data, &written ); if (ret != PTP_RC_OK) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |