summaryrefslogtreecommitdiff
path: root/libgphoto2/gphoto2-camera.c
Commit message (Collapse)AuthorAgeFilesLines
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-231-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rewrote the ptp_opensession error retry code changed some more error logging handling detailed: a) yet another logging/cleanup patch improving the code and error log readability in this specific situation: * extend translate_ptp_results to better handle PTP_ERROR_IO * log the failure of ptp_opensession * make the ptp_opensession error handling code clearer * don't report a 'ptp_port' error inside the CHECK_INIT macro when gp_camera_init fails in gphoto-camera.c. There is no port error string mechanism involved and the original error has been reported already from inside camera_init * don't report the source location when logging the error string inside gp_context_error(). interesting would be the original source location but that is not available there. * remove one of two different strings conveying the same information: 'No additional information available.' and 'No error description available' * improve logging in existing CHECK_RESULT_OPEN_CLOSE macro git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15110 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-221-46/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) introduce C_PARAMS and C_PARAMS_MSG along the lines of C_MEM 2) replace CHECK_NULL with C_PARAMS 3) replace the pattern if ( something ) return GP_ERROR_BAD_PARAMETERS; with C_PARAMS ( !something ); I went over the whole patch again to check that each 'something' condition is really inverted, so I dare to suggest you don't have to do that again ;). 4) replaced CHECK_LIST and CHECK_INDEX_RANGE with simple one-line C_PARAMS(...) expressions 5) a couple of hunks look like this - if (!inet_aton (buffer, &inp)) { - fprintf(stderr,"failed to scan for addr in %s\n", buffer); - return GP_ERROR_BAD_PARAMETERS; - } + C_PARAMS_MSG (inet_aton (buffer, &inp), so some 'lost' error messages get now properly piped into the gp_log mechanism. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15103 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-211-3/+2
| | | | | | | | | | 3) use the fact that realloc() is defined to simply malloc if the first param is NULL, no need to manually distinguish between first and later allocations. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15098 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-211-2/+1
| | | | | | | | | 2) don't check the pointer for NULL before calling free(), because free() checks it again. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15097 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-211-28/+16
| | | | | | | | | | | here is a patch for (mostly) consistent usage of a generalized C_MEM macro for checking the return values of memory allocating functions, i.e. malloc, calloc, realloc and strdup. It is the C_MEM from libusb1.c, moved to gphoto2-port-log.h. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15096 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-191-35/+20
| | | | | | | | | | | | | | | | | 7, 8, 9) same 3,4,5 but for libgphoto core 3, 4) strictly replacing gp_log( GP_LOG_DEBUG/ERROR, ... with GP_LOG_D/E in the libgphoto2 code. they are simple regex-replace patches. 5) fix some whitespace issues caused by 3 and 4 and remove any _(...) gettext macro usage for log messages git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15085 67ed7778-7388-44ab-90cf-0a291f65f57c
* international spellingMarcus Meissner2014-06-271-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15016 67ed7778-7388-44ab-90cf-0a291f65f57c
* if VALGRIND is defined, do not unload the librariesMarcus Meissner2014-03-231-0/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14851 67ed7778-7388-44ab-90cf-0a291f65f57c
* more error checkingMarcus Meissner2014-01-051-8/+11
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14631 67ed7778-7388-44ab-90cf-0a291f65f57c
* check some more return values for completeness (Coverity)Marcus Meissner2014-01-051-3/+5
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14630 67ed7778-7388-44ab-90cf-0a291f65f57c
* updated fsf addressMarcus Meissner2014-01-011-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14610 67ed7778-7388-44ab-90cf-0a291f65f57c
* typoMarcus Meissner2013-05-051-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14404 67ed7778-7388-44ab-90cf-0a291f65f57c
* add usb: filter as safetyMarcus Meissner2010-08-141-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13245 67ed7778-7388-44ab-90cf-0a291f65f57c
* use preset port during init to help autodetectMarcus Meissner2010-08-131-6/+26
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13242 67ed7778-7388-44ab-90cf-0a291f65f57c
* removed a error lineMarcus Meissner2010-05-301-2/+0
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13070 67ed7778-7388-44ab-90cf-0a291f65f57c
* Implemented a gp_camera_file_read partial read function.Marcus Meissner2010-03-261-0/+43
| | | | | | | (draft) git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12848 67ed7778-7388-44ab-90cf-0a291f65f57c
* reorder lines to not free the info entry before usageMarcus Meissner2010-03-211-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12828 67ed7778-7388-44ab-90cf-0a291f65f57c
* wrong umlautMarcus Meissner2010-01-191-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12623 67ed7778-7388-44ab-90cf-0a291f65f57c
* init local variablesMarcus Meissner2009-11-281-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12532 67ed7778-7388-44ab-90cf-0a291f65f57c
* More portability fixes.Dan Fandrich2009-08-011-1/+1
| | | | | | | Changed GP_UDEV to only enable UDEV support if libusb is available. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12349 67ed7778-7388-44ab-90cf-0a291f65f57c
* add a new trigger capture function (just triggers capture, no results)Marcus Meissner2009-04-101-0/+28
| | | | | | | | added a new CAPTURE_COMPLETE event for wait_for_event. some deprecated stuff removed. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11958 67ed7778-7388-44ab-90cf-0a291f65f57c
* Batch commit from weekend work:Marcus Meissner2009-02-161-1/+70
| | | | | | | | | | | | | | - removed "type" from CameraFile handling: - all put_file functions and hooks get "type" as argument now - added type to the set_file_info_noop call - started removal of "name" from CameraFile - generate new filename from original filename + camerafile type + mimetype - new gp_camera_autodetect() helper function - adapted all drivers. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11818 67ed7778-7388-44ab-90cf-0a291f65f57c
* * removed CameraFileInfoFile.name, adjusted usersMarcus Meissner2009-01-251-7/+3
| | | | | | | | | | and callers. * added filename argument to put_file_func, set_info_noop and set_file_noop functions. adjusted all camlibs git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11773 67ed7778-7388-44ab-90cf-0a291f65f57c
* GPPortInfo struct abstracted into a private struct.Marcus Meissner2008-03-151-1/+4
| | | | | | | | | | - libgphoto2_port rewritten for new GPPortInfo. - camlibs/directory and camlibs/ptp2 adjusted. - libgphoto2/ adjusted for the changed GPPortInfo list handling. - configure.ac adjusted, NEWS adjusted git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10990 67ed7778-7388-44ab-90cf-0a291f65f57c
* comment tuningHans Ulrich Niedermann2007-09-041-5/+5
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10643 67ed7778-7388-44ab-90cf-0a291f65f57c
* update doc strings for gp_camera_get_storageinfo() and ↵Hans Ulrich Niedermann2007-09-031-7/+18
| | | | | | gp_filesystem_get_storageinfo() git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10633 67ed7778-7388-44ab-90cf-0a291f65f57c
* proofread Marcus Meissner2007-08-111-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10576 67ed7778-7388-44ab-90cf-0a291f65f57c
* more doxygen additions / fixupMarcus Meissner2007-05-311-6/+6
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10342 67ed7778-7388-44ab-90cf-0a291f65f57c
* added a briefMarcus Meissner2007-05-241-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10302 67ed7778-7388-44ab-90cf-0a291f65f57c
* removed/ changed some includes to avoid unnecessary levelsMarcus Meissner2007-05-211-1/+0
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10288 67ed7778-7388-44ab-90cf-0a291f65f57c
* use different "r" in macros to avoid confusing readers and coverity.Marcus Meissner2007-05-091-52/+46
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10144 67ed7778-7388-44ab-90cf-0a291f65f57c
* implemented a programmatic way to get storage information.Marcus Meissner2007-01-021-0/+28
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9830 67ed7778-7388-44ab-90cf-0a291f65f57c
* Consistently use #include <gphoto2/gphoto2-foo.h> everywhere.Hans Ulrich Niedermann2006-09-281-5/+5
| | | | | | | | | | This moves the header files to a new subdirectory gphoto2 in both libgphoto2 and libphoto2_port/libgphoto2. All references are adapted appropriately. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9221 67ed7778-7388-44ab-90cf-0a291f65f57c
* https://launchpad.net/products/libgphoto/+bug/61163Hubert Figuiere2006-09-201-1/+1
| | | | | | | Fix typos. Original patch do not apply cleanly git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9198 67ed7778-7388-44ab-90cf-0a291f65f57c
* trivial integer signedness fixHans Ulrich Niedermann2006-08-181-1/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@9094 67ed7778-7388-44ab-90cf-0a291f65f57c
* another set of doxygen annotation changes from Steve Fox.Marcus Meissner2006-05-251-2/+2
| | | | | | | removed the literal (c) symbol. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8818 67ed7778-7388-44ab-90cf-0a291f65f57c
* doxygenedMarcus Meissner2006-05-231-191/+209
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8813 67ed7778-7388-44ab-90cf-0a291f65f57c
* Added gp_camera_wait_for_event() API, contributed by:Marcus Meissner2006-03-211-0/+38
| | | | | | | Edward Flick <eddy@cdf-imaging.com> git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8647 67ed7778-7388-44ab-90cf-0a291f65f57c
* added/tuned/updated doxygen docsHans Ulrich Niedermann2005-06-151-176/+175
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8099 67ed7778-7388-44ab-90cf-0a291f65f57c
* Fix source files to compile with the shipped convenience libltdl.Hans Ulrich Niedermann2005-04-291-5/+1
| | | | | | | | | HAVE_LTDL is only defined if we are using the system libltdl, so we cannot use it for conditionally either including ltdl.h or printing an error message. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7923 67ed7778-7388-44ab-90cf-0a291f65f57c
* aftermath of build system updateHans Ulrich Niedermann2005-04-151-33/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7850 67ed7778-7388-44ab-90cf-0a291f65f57c
* Return GP_ERROR_CAMERA_BUSY if a command or I/O is in progress.Patrick Mansfield2003-11-171-0/+2
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6924 67ed7778-7388-44ab-90cf-0a291f65f57c
* Update Lutz's emailArnaud Launay2003-07-131-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6576 67ed7778-7388-44ab-90cf-0a291f65f57c
* * libgphoto2/gphoto2-abilities-list.c, libgphoto2/gphoto2-camera.c,Marcus Meissner2003-01-031-8/+24
| | | | | | | | libgphoto2/gphoto2-filesys.c: Replaced stack allocation of CameraList by dynamic allocation, since CameraList is pretty large. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6004 67ed7778-7388-44ab-90cf-0a291f65f57c
* Seems I've been too violent with �Arnaud Launay2002-12-221-24/+24
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5978 67ed7778-7388-44ab-90cf-0a291f65f57c
* replace (c) and (C) by �Arnaud Launay2002-12-151-25/+25
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5969 67ed7778-7388-44ab-90cf-0a291f65f57c
* <config.h> -> "config.h"Arnaud Launay2002-11-291-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5859 67ed7778-7388-44ab-90cf-0a291f65f57c
* gettext stuff for ArnaudHans Ulrich Niedermann2002-11-231-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5776 67ed7778-7388-44ab-90cf-0a291f65f57c
* libgphoto2/gphoto2-camera.c: Allow a NULL for the path to bePatrick Mansfield2002-11-211-1/+1
| | | | | | | passed to the camera capture. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5730 67ed7778-7388-44ab-90cf-0a291f65f57c
* Minor user-visible spelling fix.Dan Fandrich2002-06-141-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4670 67ed7778-7388-44ab-90cf-0a291f65f57c