summaryrefslogtreecommitdiff
path: root/libgphoto2/gphoto2-camera.c
Commit message (Collapse)AuthorAgeFilesLines
* Wrap unsafe libltdl calls with locking (#848)Marcus Meissner2022-11-051-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Wrap unsafe libltdl calls with locking https://github.com/gphoto/libgphoto2/issues/166 * 848: do not install internal header gphoto2-port-mutex.h * 848: wrap symbol declarations in #ifdef _GPHOTO2_INTERNAL_CODE * 848: Use proper include guard macro * 848: Encapsulate the lock/unlock code inside functions This hides the pthread usage as an implementation detail inside the gpi_libltdl_lock() and gpi_libltdl_unlock() functions. * 848: Rename from *-mutex.[ch] to *-locking.[ch] The *-lock.[ch] name is implementation neutral. * 848: update libgphoto2_port version number * 848: internal headers do not require __cplusplus checks * 848: add copyright comment at the beginning of *.[ch] * 848: add an unlocked variant of gp_abilities_list_load_dir to avoid lots of unlock/lock codes * 848: remove unnecessary whitespace addition Co-authored-by: kadler15 <spurfan15@gmail.com> Co-authored-by: Hans Ulrich Niedermann <hun@n-dimensional.de>
* Factor out i18n stuff into separate i18n.h filesHans Ulrich Niedermann2021-10-251-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out the i18n definitions into i18n.h include files: One include file each for libgphoto2 and for libgphoto2_port. This removes the complete #ifdef ENABLE_NLS # include <libintl.h> # undef _ # define _(String) dgettext (GETTEXT_PACKAGE, String) # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif #else # define _(String) (String) # define N_(String) (String) #endif block (which in some occasions defines even more macros) and replaces it with a single line #include "libgphoto2/i18n.h" for camlibs and libgphoto2 itself and with #include "libgphoto2_port/i18n.h" for iolibs and libgphoto2_port itself. This gives us two central locations to change the defintions.
* gp_camera_exit: Return result of camera exit function if possibleDaniel Schulte2021-03-161-2/+3
|
* Remove trailing whitespace from all *.h and *.c files.Siim Meerits2020-07-271-34/+34
|
* fixed autodetect returnMarcus Meissner2018-04-301-1/+1
|
* More fixes for support 64bit getpartialobject for Android in read_file_funcFlorent Viard2017-08-281-1/+1
|
* clarify wait_for_event documentation a bitMarcus Meissner2016-04-251-5/+9
|
* emulate the single setter and list config functions viaMarcus Meissner2016-02-191-21/+231
| | | | the regular get_config and set_config if not present
* add new apisMarcus Meissner2016-02-191-0/+98
| | | | gp_camera_list_config, gp_camera_set_single_config, gp_camera_get_single_config
* 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