--- ./gphoto2-config.in Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./gphoto2-config.in Wed Feb 19 14:46:05 2003 @@ -59,7 +59,7 @@ ;; --libs) - echo "-L@libdir@" -lgphoto2 -lm + echo "-L@libdir@" -lgphoto2 -lgphoto2_port -lm ;; *) --- ./camlibs/canon/library.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/canon/library.c Wed Feb 19 14:46:05 2003 @@ -64,8 +64,10 @@ #include "usb.h" #ifndef HAVE_SNPRINTF +/* #warning You do not seem to have a snprintf() function. Using sprintf instead. #warning Note that this leads to SECURITY RISKS! +*/ #define snprintf(buf,size,format,arg) sprintf(buf,format,arg) #endif --- ./camlibs/canon/canon.h Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/canon/canon.h Wed Feb 19 14:46:05 2003 @@ -9,11 +9,11 @@ #define _CANON_H #ifdef CANON_EXPERIMENTAL_CAPTURE -#warning COMPILING WITH EXPERIMENTAL CAPTURE FEATURE +/* #warning COMPILING WITH EXPERIMENTAL CAPTURE FEATURE */ #endif #ifdef CANON_EXPERIMENTAL_UPLOAD -#warning COMPILING WITH EXPERIMENTAL UPLOAD FEATURE +/* #warning COMPILING WITH EXPERIMENTAL UPLOAD FEATURE */ #endif /* Defines for error handling */ --- ./camlibs/canon/canon.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/canon/canon.c Wed Feb 19 14:46:05 2003 @@ -927,7 +927,7 @@ GP_DEBUG ("canon_int_get_disk_name: disk '%s'", msg); - return msg; + return (char *) msg; } /** --- ./camlibs/stv0680/demosaic_sharpen.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/stv0680/demosaic_sharpen.c Wed Feb 19 14:46:05 2003 @@ -67,6 +67,7 @@ * */ +#include "config.h" #include #include "demosaic_sharpen.h" --- ./camlibs/sierra/sierra-desc.h Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/sierra/sierra-desc.h Wed Feb 19 14:46:05 2003 @@ -102,6 +102,10 @@ ValueNameType *regs_value_names; /* list of reg value/names */ } RegisterDescriptorType; +#if defined(__sgi) +#define u_int64_t uint64_t +#endif + /* * XXX check usage of reg_value, maybe change it to char x[8], and * normally type cast its usage. @@ -135,5 +139,10 @@ extern const CameraDescType cp880_cam_desc; extern const CameraDescType cp995_cam_desc; extern const CameraDescType ep3000z_cam_desc; + +/* hack: declare a function to properly initialize union structures in C89 */ +extern void cp880_desc_init(void); +extern void ep3000z_desc_init(void); +extern void oly3040_desc_init(void); #endif /* __SIERRA_DESC_H__ */ --- ./camlibs/sierra/sierra.h Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/sierra/sierra.h Wed Feb 19 14:46:05 2003 @@ -11,8 +11,8 @@ int folders; int speed; int first_packet; - int usb_wrap:1; /* 0: packets sent "raw", 1: see sierra-usbwrap.h */ - int use_extended_protocol:1; + unsigned int usb_wrap:1; /* 0: packets sent "raw", 1: see sierra-usbwrap.h */ + unsigned int use_extended_protocol:1; struct CameraDesc const *cam_desc; char folder[128]; }; --- ./camlibs/sierra/sierra.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/sierra/sierra.c Wed Feb 19 14:46:05 2003 @@ -1969,6 +1969,18 @@ vendor = sierra_cameras[x].usb_product; usb_wrap = sierra_cameras[x].usb_wrap; cam_desc = sierra_cameras[x].cam_desc; + + /* hack: initialize union structures in C89 */ + if (cam_desc == &cp880_cam_desc) { + cp880_desc_init(); + } + else if (cam_desc == &ep3000z_cam_desc) { + ep3000z_desc_init(); + } + else if (cam_desc == &oly3040_cam_desc || + cam_desc == &sierra_default_cam_desc) { + oly3040_desc_init(); + } } } --- ./camlibs/sierra/olympus-desc.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/sierra/olympus-desc.c Wed Feb 19 14:46:05 2003 @@ -308,8 +308,8 @@ /* * Register 35: lcd brightness. */ -static const ValueNameType oly3040_reg_35_val_names[] = { - { { range: { 0, 7 } }, NULL }, +static ValueNameType oly3040_reg_35_val_names[] = { + { { 0x00 }, NULL }, }; static const RegisterDescriptorType oly3040_reg_35[] = { { @@ -322,8 +322,8 @@ /* * Register 24: camera power save (idle time before entering power save mode) */ -static const ValueNameType oly3040_reg_24_val_names[] = { - { { range: { 30, 600, 30 } }, NULL }, +static ValueNameType oly3040_reg_24_val_names[] = { + { { 0x00 }, NULL } }; static const RegisterDescriptorType oly3040_reg_24[] = { { @@ -337,8 +337,8 @@ * Register 23: camera power save when connected to PC * (idle time before entering power save mode) */ -static const ValueNameType oly3040_reg_23_val_names[] = { - { { range: { 30, 600, 30 } }, NULL }, +static ValueNameType oly3040_reg_23_val_names[] = { + { { 0x00 }, NULL } }; static const RegisterDescriptorType oly3040_reg_23[] = { { @@ -350,8 +350,8 @@ /* * Register 38: lcd auto shut off time */ -static const ValueNameType oly3040_reg_38_val_names[] = { - { { range: { 30, 600, 30 } }, NULL }, +static ValueNameType oly3040_reg_38_val_names[] = { + { { 0x00 }, NULL } }; static const RegisterDescriptorType oly3040_reg_38[] = { { @@ -423,9 +423,9 @@ /* * Register 71: optical zoom value. */ -static const ValueNameType oly3040_reg_71_val_names[] = { +static ValueNameType oly3040_reg_71_val_names[] = { { - { range: { 7.3, 21.0, .1 } }, NULL + { 0x00 }, NULL } }; static const RegisterDescriptorType oly3040_reg_71[] = { @@ -475,8 +475,8 @@ * 1 to 120: macro positions * 121 to 240: normal positions */ -static const ValueNameType oly3040_reg_103_val_names[] = { - { { range: { 1, 240, 1 } }, NULL }, +static ValueNameType oly3040_reg_103_val_names[] = { + { { 0x00 }, NULL } }; static const RegisterDescriptorType oly3040_reg_103[] = { { @@ -551,42 +551,71 @@ }, }; -static const char oly3040_manual[] = -N_( -"Some notes about Olympus cameras:\n" -"(1) Camera Configuration:\n" -" A value of 0 will take the default one (auto).\n" -"(2) Olympus C-3040Z (and possibly also the C-2040Z\n" -" and others) have a USB PC Control mode. In order\n" -" to use this mode, the camera must be switched\n" -" into 'USB PC control mode'. To get to the menu\n" -" for switching modes, turn on the camera, open\n" -" the memory card access door and then press and\n" -" hold both of the menu and LCD buttons until the\n" -" camera control menu appears. Set it to ON.\n" -"(3) If you switch the 'LCD mode' to 'Monitor' or\n" -" 'Normal', don't forget to switch it back to 'Off'\n" -" before disconnectig. Otherwise you cannot use\n" -" the camera's buttons. If you end up with this\n" -" state, you should reconnect the camera to the\n" -" PC and switch LCD to 'Off'." -); - -static const char default_manual[] = -N_( -"Default sierra driver:\n\n" -" This is the default sierra driver, it\n" -" should be capable of supporting the download\n" -" and browsing of pictures on your camera.\n\n" -" Camera configuration (or preferences)\n" -" settings are based on the Olympus 3040,\n" -" and are likely incomplete. If you verify\n" -" that the configuration settings are\n" -" complete for your camera, or can contribute\n" -" code to support complete configuration,\n" -" please contact gphoto-devel@gphoto.net\n" -); - -const CameraDescType oly3040_cam_desc = { oly3040_desc, oly3040_manual, TRUE, }; -const CameraDescType sierra_default_cam_desc = { oly3040_desc, default_manual, - FALSE, }; +const CameraDescType oly3040_cam_desc = { + oly3040_desc, + N_( + "Some notes about Olympus cameras:\n" + "(1) Camera Configuration:\n" + " A value of 0 will take the default one (auto).\n" + "(2) Olympus C-3040Z (and possibly also the C-2040Z\n" + " and others) have a USB PC Control mode. In order\n" + " to use this mode, the camera must be switched\n" + " into 'USB PC control mode'. To get to the menu\n" + " for switching modes, turn on the camera, open\n" + " the memory card access door and then press and\n" + " hold both of the menu and LCD buttons until the\n" + " camera control menu appears. Set it to ON.\n" + "(3) If you switch the 'LCD mode' to 'Monitor' or\n" + " 'Normal', don't forget to switch it back to 'Off'\n" + " before disconnectig. Otherwise you cannot use\n" + " the camera's buttons. If you end up with this\n" + " state, you should reconnect the camera to the\n" + " PC and switch LCD to 'Off'." + ), + TRUE +}; + +const CameraDescType sierra_default_cam_desc = { + oly3040_desc, + N_( + "Default sierra driver:\n\n" + " This is the default sierra driver, it\n" + " should be capable of supporting the download\n" + " and browsing of pictures on your camera.\n\n" + " Camera configuration (or preferences)\n" + " settings are based on the Olympus 3040,\n" + " and are likely incomplete. If you verify\n" + " that the configuration settings are\n" + " complete for your camera, or can contribute\n" + " code to support complete configuration,\n" + " please contact gphoto-devel@gphoto.net\n" + ), + FALSE +}; + +/* hack: function to properly initialize union structures in C89 */ +void oly3040_desc_init() { + + oly3040_reg_23_val_names[0].u.range[0] = 30; + oly3040_reg_23_val_names[0].u.range[1] = 600; + oly3040_reg_23_val_names[0].u.range[2] = 30; + + oly3040_reg_24_val_names[0].u.range[0] = 30; + oly3040_reg_24_val_names[0].u.range[1] = 600; + oly3040_reg_24_val_names[0].u.range[2] = 30; + + oly3040_reg_35_val_names[0].u.range[0] = 0; + oly3040_reg_35_val_names[0].u.range[1] = 7; + + oly3040_reg_38_val_names[0].u.range[0] = 30; + oly3040_reg_38_val_names[0].u.range[1] = 600; + oly3040_reg_38_val_names[0].u.range[2] = 30; + + oly3040_reg_71_val_names[0].u.range[0] = 7.3; + oly3040_reg_71_val_names[0].u.range[1] = 21.0; + oly3040_reg_71_val_names[0].u.range[2] = .1; + + oly3040_reg_103_val_names[0].u.range[0] = 1; + oly3040_reg_103_val_names[0].u.range[1] = 240; + oly3040_reg_103_val_names[0].u.range[2] = 1; +} --- ./camlibs/sierra/epson-desc.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/sierra/epson-desc.c Wed Feb 19 14:46:05 2003 @@ -236,8 +236,8 @@ * TOCHECK: what is the exact valid range? * I have previously set 0,255,1 is old camera_get_config_epson() */ -static const ValueNameType ep3000z_reg_23_val_names[] = { - { { range: { 30, 600, 30 } }, NULL }, +static ValueNameType ep3000z_reg_23_val_names[] = { + { { 0x00 }, NULL }, }; static const RegisterDescriptorType ep3000z_reg_23[] = { { @@ -252,8 +252,8 @@ * TOCHECK: what is the exact valid range? * I have previously set 0,255,1 is old camera_get_config_epson() */ -static const ValueNameType ep3000z_reg_24_val_names[] = { - { { range: { 30, 600, 30 } }, NULL }, +static ValueNameType ep3000z_reg_24_val_names[] = { + { { 0x00 }, NULL }, }; static const RegisterDescriptorType ep3000z_reg_24[] = { { @@ -544,16 +544,29 @@ }, }; -static const char ep3000z_manual[] = -N_( -"Some notes about Epson cameras:\n" -"- Some parameters are not controllable remotely:\n" -" * zoom\n" -" * focus\n" -" * custom white balance setup\n" -"- Configuration has been reverse-engineered with\n" -" a PhotoPC 3000z, if your camera acts differently\n" -" please send a mail to (in English)\n" -); - -const CameraDescType ep3000z_cam_desc = { ep3000z_desc, ep3000z_manual, TRUE, }; +const CameraDescType ep3000z_cam_desc = { + ep3000z_desc, + N_( + "Some notes about Epson cameras:\n" + "- Some parameters are not controllable remotely:\n" + " * zoom\n" + " * focus\n" + " * custom white balance setup\n" + "- Configuration has been reverse-engineered with\n" + " a PhotoPC 3000z, if your camera acts differently\n" + " please send a mail to (in English)\n" + ), + TRUE +}; + +/* hack: function to properly initialize union structures in C89 */ +void ep3000z_desc_init() { + + ep3000z_reg_23_val_names[0].u.range[0] = 30; + ep3000z_reg_23_val_names[0].u.range[1] = 600; + ep3000z_reg_23_val_names[0].u.range[2] = 30; + + ep3000z_reg_24_val_names[0].u.range[0] = 30; + ep3000z_reg_24_val_names[0].u.range[1] = 600; + ep3000z_reg_24_val_names[0].u.range[2] = 30; +} --- ./camlibs/sierra/nikon-desc.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/sierra/nikon-desc.c Wed Feb 19 14:46:05 2003 @@ -116,9 +116,9 @@ * work. */ #ifdef RANGE_FOR_SHUTTER -static const ValueNameType cp880_reg_03_val_names[] = { +static ValueNameType cp880_reg_03_val_names[] = { { - { range: { 0, 8000000 } }, NULL + { 0x00 }, NULL } }; static const RegisterDescriptorType cp880_reg_03[] = { @@ -347,8 +347,8 @@ /* * Register 35: lcd brightness. */ -static const ValueNameType cp880_reg_35_val_names[] = { - { { range: { 0, 7 } }, NULL }, +static ValueNameType cp880_reg_35_val_names[] = { + { { 0x00 }, NULL } }; static const RegisterDescriptorType cp880_reg_35[] = { { @@ -362,8 +362,8 @@ * Register 38: lcd auto shut off time, not verified for cp880, unknown * what the maximum range should be. */ -static const ValueNameType cp880_reg_38_val_names[] = { - { { range: { 0, 255 /* XXX? */ } }, NULL }, +static ValueNameType cp880_reg_38_val_names[] = { + { { 0x00 }, NULL } }; static const RegisterDescriptorType cp880_reg_38[] = { { @@ -412,9 +412,9 @@ * use a pull down menu rather than the more obvious range (slider). */ #ifdef RANGE_FOR_EXPOSURE -static const ValueNameType cp880_reg_69_val_names[] = { +static ValueNameType cp880_reg_69_val_names[] = { { - { range: { -2.0, 2.0, .1 } }, NULL, + { 0x00 }, NULL } }; static const RegisterDescriptorType cp880_reg_69[] = { @@ -470,9 +470,9 @@ * * It appears this needs the sierra extended protocol to be complete. */ -static const ValueNameType cp880_reg_71_val_names[] = { +static ValueNameType cp880_reg_71_val_names[] = { { - { range: { 8.0, 20.0, .1 } }, NULL + { 0x00 }, NULL } }; static const RegisterDescriptorType cp880_reg_71[] = { @@ -595,19 +595,22 @@ }, }; -static const char cp880_manual[] = -N_( -"Nikon Coolpix 880:\n" -" Camera configuration (or preferences):\n\n" -" The optical zoom does not properly\n" -" function.\n\n" -" Not all configuration settings\n" -" can be properly read or written, for\n" -" example, the fine tuned setting of\n" -" white balance, and the language settings.\n\n" -" Put the camera in 'M' mode in order to\n" -" to set the shutter speed.\n" -); +const CameraDescType cp880_cam_desc = { + cp880_desc, + N_( + "Nikon Coolpix 880:\n" + " Camera configuration (or preferences):\n\n" + " The optical zoom does not properly\n" + " function.\n\n" + " Not all configuration settings\n" + " can be properly read or written, for\n" + " example, the fine tuned setting of\n" + " white balance, and the language settings.\n\n" + " Put the camera in 'M' mode in order to\n" + " to set the shutter speed.\n" + ), + TRUE +}; /* * Note: use of the 995 has not been tested, it might not even be @@ -614,16 +617,41 @@ * possible to control the camera via the USB port since it reportedly * appears as a USB mass storage device. */ -static const char cp995_manual[] = -N_( -"Nikon Coolpix 995:\n" -" Camera configuration (preferences) for this\n" -" camera are incomplete, contact the gphoto\n" -" developers at gphoto-devel@gphoto.net\n" -" if you would like to contribute to this\n" -" driver.\n\n" -" The download should function correctly.\n" -); +const CameraDescType cp995_cam_desc = { + cp880_desc, + N_( + "Nikon Coolpix 995:\n" + " Camera configuration (preferences) for this\n" + " camera are incomplete, contact the gphoto\n" + " developers at gphoto-devel@gphoto.net\n" + " if you would like to contribute to this\n" + " driver.\n\n" + " The download should function correctly.\n" + ), + TRUE +}; + +/* hack: function to properly initialize union structures in C89 */ +void cp880_desc_init() { + +#ifdef RANGE_FOR_SHUTTER + cp880_reg_03_val_names[0].u.range[0] = 0; + cp880_reg_03_val_names[0].u.range[1] = 8000000; +#endif + + cp880_reg_35_val_names[0].u.range[0] = 0; + cp880_reg_35_val_names[0].u.range[1] = 7; + + cp880_reg_38_val_names[0].u.range[0] = 0; + cp880_reg_38_val_names[0].u.range[1] = 255; /* XXX? */ + +#ifdef RANGE_FOR_EXPOSURE + cp880_reg_69_val_names[0].u.range[0] = -2.0; + cp880_reg_69_val_names[0].u.range[1] = 2.0; + cp880_reg_69_val_names[0].u.range[2] = .1; +#endif -const CameraDescType cp880_cam_desc = { cp880_desc, cp880_manual, TRUE, }; -const CameraDescType cp995_cam_desc = { cp880_desc, cp995_manual, TRUE, }; + cp880_reg_71_val_names[0].u.range[0] = 8.0; + cp880_reg_71_val_names[0].u.range[1] = 20.0; + cp880_reg_71_val_names[0].u.range[2] = .1; +} --- ./camlibs/sierra/sierra-usbwrap.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/sierra/sierra-usbwrap.c Wed Feb 19 14:46:05 2003 @@ -61,6 +61,19 @@ { unsigned char c1, c2, c3, c4; } uw4c_t; /* A type for 4-byte things */ typedef struct { unsigned char c1, c2; } uw2c_t; /* A type for 2-byte things? */ + +static uw4c_t _uw_magic_out = { 'U', 'S', 'B', 'C' }; +static uw4c_t _uw_magic_in = { 'U', 'S', 'B', 'S' }; +static uw4c_t _uw_packet_rdy = { 0x01, 0x00, 0xff, 0x9f }; +static uw4c_t _uw_packet_data = { 0x02, 0x00, 0xff, 0x9f }; +static uw4c_t _uw_packet_stat = { 0x03, 0x00, 0xff, 0x9f }; +static uw4c_t _uw_request_rdy = { 0x00, 0x00, 0x0c, 0xc0 }; +static uw4c_t _uw_request_cmnd = { 0x00, 0x00, 0x0c, 0xc1 }; +static uw4c_t _uw_request_data = { 0x80, 0x00, 0x0c, 0xc2 }; +static uw4c_t _uw_request_stat = { 0x80, 0x00, 0x0c, 0xc3 }; +static uw4c_t _uw_request_size = { 0x80, 0x00, 0x0c, 0xc4 }; +static uw4c_t _uw_request_id = { 0x80, 0x00, 0x06, 0x12 }; + static uw32_t uw_value(int value) /* Convert from host-integer to uw32_t */ { uw32_t ret; @@ -79,11 +92,9 @@ * USB wrapper packets start with ASCII bytes "USBC". * The responses back from the camera start with "USBS". */ -#define UW_MAGIC_OUT ((uw4c_t){ 'U','S','B','C' }) -#define UW_MAGIC_IN ((uw4c_t){ 'U','S','B','S' }) +#define UW_MAGIC_OUT _uw_magic_out +#define UW_MAGIC_IN _uw_magic_in -#define UW_REQUEST_OUT(a,b) ((uw4c_t){0x00,0x00,(a),(b)}) /* write to camera */ -#define UW_REQUEST_IN(a,b) ((uw4c_t){0x80,0x00,(a),(b)}) /* read from camera */ /* Move REQUEST_STAT calls to write_packet %%% */ /* @@ -95,16 +106,16 @@ * usb_wrap_write_packet: RDY(OK), CMND(OK), STAT(OK) * usb_wrap_read_packet: RDY(OK), GETSIZE(OK), DATA(OK), STAT(OK) */ -#define UW_REQUEST_RDY UW_REQUEST_OUT(0x0c,0xc0) /* Test if camera ready */ -#define UW_REQUEST_CMND UW_REQUEST_OUT(0x0c,0xc1) /* Send command to camera */ -#define UW_REQUEST_DATA UW_REQUEST_IN(0x0c,0xc2) /* Read data from camera */ -#define UW_REQUEST_STAT UW_REQUEST_IN(0x0c,0xc3) /* Get last CMND/DATA rslt */ -#define UW_REQUEST_SIZE UW_REQUEST_IN(0x0c,0xc4) /* Get size of next DATA */ -#define UW_REQUEST_ID UW_REQUEST_IN(0x06,0x12) /* Get camera information */ - -#define UW_PACKET_RDY ((uw4c_t){ 0x01, 0x00, 0xff, 0x9f }) -#define UW_PACKET_DATA ((uw4c_t){ 0x02, 0x00, 0xff, 0x9f }) -#define UW_PACKET_STAT ((uw4c_t){ 0x03, 0x00, 0xff, 0x9f }) +#define UW_REQUEST_RDY _uw_request_rdy /* Test if camera ready */ +#define UW_REQUEST_CMND _uw_request_cmnd /* Send command to camera */ +#define UW_REQUEST_DATA _uw_request_data /* Read data from camera */ +#define UW_REQUEST_STAT _uw_request_stat /* Get last CMND/DATA rslt */ +#define UW_REQUEST_SIZE _uw_request_size /* Get size of next DATA */ +#define UW_REQUEST_ID _uw_request_id /* Get camera information */ + +#define UW_PACKET_RDY _uw_packet_rdy +#define UW_PACKET_DATA _uw_packet_data +#define UW_PACKET_STAT _uw_packet_stat /* * The rest of the USB wrapper packet looks like this: --- ./camlibs/digita/digita.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/digita/digita.c Wed Feb 19 14:46:05 2003 @@ -273,7 +273,7 @@ *size = buflen; - return data; + return (char *) data; } /* Colorspace conversion is voodoo-magic to me --jerdfelt */ --- ./camlibs/kodak/dc3200/library.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./camlibs/kodak/dc3200/library.c Wed Feb 19 14:46:05 2003 @@ -133,12 +133,15 @@ * */ - u_char cmd1[5] = {0x01, dc3200_calc_seqnum(camera), 0x01, 0x00, 0x0F}; - u_char cmd2[8] = {0x01, dc3200_calc_seqnum(camera), 0x80, 0x00, 0x01, 0x81, 0x00, 0x03}; + u_char cmd1[5] = {0x01, 0x00, 0x01, 0x00, 0x0F}; + u_char cmd2[8] = {0x01, 0x00, 0x80, 0x00, 0x01, 0x81, 0x00, 0x03}; u_char ack[ACK_PACKET_LEN], resp[DEF_PACKET_LEN]; int ack_len = ACK_PACKET_LEN, resp_len = DEF_PACKET_LEN; + cmd1[1] = dc3200_calc_seqnum(camera); + cmd2[1] = dc3200_calc_seqnum(camera); + if(dc3200_send_command(camera, cmd1, sizeof(cmd1), ack, &ack_len) == GP_ERROR) return GP_ERROR; if(dc3200_check_ack(camera, ack, ack_len) == GP_ERROR) @@ -467,13 +470,16 @@ */ int dc3200_cancel_get_data(Camera *camera) { - u_char pkt[20] = {0x01, dc3200_calc_seqnum(camera), 0x80, 0x00, 0x20, 0x03, 0x0d, 0xc1, 0x50, 0xc0, - 0x00, 0x00, 0x00, 0x06, 0x04, 0x01, 0x00, 0x01, (camera->pl->cmd_seqnum >> 8) & 0xff, camera->pl->cmd_seqnum & 0xff}; + u_char pkt[20] = {0x01, 0x00, 0x80, 0x00, 0x20, 0x03, 0x0d, 0xc1, 0x50, 0xc0, + 0x00, 0x00, 0x00, 0x06, 0x04, 0x01, 0x00, 0x01, 0x00, 0x00}; u_char ack[ACK_PACKET_LEN], resp[DEF_PACKET_LEN]; int ack_len = ACK_PACKET_LEN, resp_len = DEF_PACKET_LEN; struct timeval timeout; timeout.tv_sec = 0; timeout.tv_usec = 1000; + pkt[1] = dc3200_calc_seqnum(camera); + pkt[18] = (camera->pl->cmd_seqnum >> 8) & 0xff; + pkt[19] = camera->pl->cmd_seqnum & 0xff; /* wait a bit ... */ select(0, 0, 0, 0, &timeout); --- ./libgphoto2_port/serial/unix.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./libgphoto2_port/serial/unix.c Wed Feb 19 14:46:05 2003 @@ -230,11 +230,13 @@ return (GP_ERROR_IO_LOCK); } #else +/* #warning No locking library found. #warning You will run into problems if you use #warning gphoto2 with a serial (RS232) camera in #warning combination with Konqueror (KDE) or Nautilus (GNOME). #warning This will *not* concern USB cameras. +*/ #endif return (GP_OK); @@ -541,7 +543,7 @@ now = read (dev->pl->fd, bytes, 1); if (now < 0) return GP_ERROR_IO_READ; - if (bytes[0] == -1) { + if (bytes[0] == (char) -1) { now = read (dev->pl->fd, bytes, 1); if (now < 0) return GP_ERROR_IO_READ; @@ -560,7 +562,7 @@ gp_port_set_error (dev, _("Parity error.")); return GP_ERROR_IO_READ; } - if (bytes[0] != -1) { + if (bytes[0] != (char) -1) { gp_port_set_error (dev, _("Unexpected parity response sequence 0xff 0x%02x."), bytes[0]); return GP_ERROR_IO_READ; } @@ -632,7 +634,7 @@ } *level = j & bit; #else -#warning ACCESSING PINS IS NOT IMPLEMENTED FOR NON-TERMIOS SYSTEMS! +/* #warning ACCESSING PINS IS NOT IMPLEMENTED FOR NON-TERMIOS SYSTEMS! */ #endif return (GP_OK); @@ -664,7 +666,7 @@ return GP_ERROR_IO; } #else -#warning ACCESSING PINS IS NOT IMPLEMENTED FOR NON-TERMIOS SYSTEMS! +/* #warning ACCESSING PINS IS NOT IMPLEMENTED FOR NON-TERMIOS SYSTEMS! */ #endif return GP_OK; @@ -687,7 +689,7 @@ return (GP_ERROR_IO); } #else -#warning SERIAL FLUSH NOT IMPLEMENTED FOR NON TERMIOS SYSTEMS! +/* #warning SERIAL FLUSH NOT IMPLEMENTED FOR NON TERMIOS SYSTEMS! */ #endif return (GP_OK); @@ -899,7 +901,7 @@ tcsendbreak (dev->pl->fd, duration / 310); tcdrain (dev->pl->fd); #else -#warning SEND BREAK NOT IMPLEMENTED FOR NON TERMIOS SYSTEMS! +/* #warning SEND BREAK NOT IMPLEMENTED FOR NON TERMIOS SYSTEMS! */ #endif return GP_OK; --- ./libgphoto2_port/libgphoto2_port/gphoto2-port-log.h Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./libgphoto2_port/libgphoto2_port/gphoto2-port-log.h Wed Feb 19 14:46:05 2003 @@ -76,7 +76,7 @@ gp_log(level, GP_MODULE "/" __FILE__, __VA_ARGS__) #else -#warning Disabling GP_LOG because variadic macros are not allowed +/* #warning Disabling GP_LOG because variadic macros are not allowed */ #define GP_LOG (void) #endif @@ -100,7 +100,7 @@ gp_log(GP_LOG_DEBUG, GP_MODULE "/" __FILE__, __VA_ARGS__) #else -#warning Disabling GP_DEBUG because variadic macros are not allowed +/* #warning Disabling GP_DEBUG because variadic macros are not allowed */ #define GP_DEBUG (void) #endif --- ./libgphoto2_port/configure Sun Dec 1 16:46:01 2002 +++ ../libgphoto2-2.1.1/./libgphoto2_port/configure Wed Feb 19 15:11:11 2003 @@ -12722,7 +12722,7 @@ #define HAVE_SERIAL 1 _ACEOF - * ;; + ;; esac --- ./libgphoto2/gphoto2-file.c Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./libgphoto2/gphoto2-file.c Wed Feb 19 14:46:05 2003 @@ -452,7 +452,7 @@ if (!strcmp (file->mime_type, table[x])) { /* Search the current suffix and erase it */ -#ifdef HAVE_STRCHR +#if defined(HAVE_STRCHR) || defined(__sgi) suffix = strrchr (file->name, '.'); #else suffix = rindex (file->name, '.'); --- ./libgphoto2/libgphoto2.pc.in Sun Dec 1 16:45:44 2002 +++ ../libgphoto2-2.1.1/./libgphoto2/libgphoto2.pc.in Wed Feb 19 14:46:05 2003 @@ -9,5 +9,5 @@ Description: Library for easy access to digital cameras Requires: Version: @VERSION@ -Libs: -L${libdir} -lgphoto2 -lm +Libs: -L${libdir} -lgphoto2 -lgphoto2_port -lm Cflags: -I${includedir}/gphoto2 -I${includedir} --- ./ltmain.sh Thu Nov 21 16:11:31 2002 +++ ../libgphoto2-2.1.1/./ltmain.sh Wed Feb 19 14:46:44 2003 @@ -61,7 +61,7 @@ default_mode= help="Try \`$progname --help' for more information." magic="%%%MAGIC variable%%%" -mkdir="mkdir" +mkdir="mkdir -p" mv="mv -f" rm="rm -f"