summaryrefslogtreecommitdiff
path: root/libgphoto2_port/libusb1
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* use darwin_c_source ... isoc99 source does not seem to cut it for macos. ↵Marcus Meissner2021-03-101-1/+1
| | | | https://github.com/gphoto/libgphoto2/issues/633
* use isoc99 source https://github.com/gphoto/libgphoto2/issues/633Marcus Meissner2021-03-091-1/+1
|
* added #define _DARWIN_C_SOURCE as in other files to avoid implicitMarcus Meissner2021-03-091-0/+1
| | | | https://github.com/gphoto/libgphoto2/issues/633
* Fix libusb1 iolib compilation warnings.Siim Meerits2020-08-031-2/+2
| | | | Resolves signed-unsigned comparison issues.
* Remove trailing whitespace from all *.h and *.c files.Siim Meerits2020-07-271-24/+24
|
* allow switching usb interface and configMarcus Meissner2020-05-101-2/+2
| | | | fixes https://github.com/gphoto/libgphoto2/issues/502
* handle not devices a bit betterMarcus Meissner2019-04-281-0/+6
|
* if we have no interrupt endpoint, do no try to queue interrupt URBs.Marcus Meissner2018-02-251-0/+5
| | | | fixes https://github.com/gphoto/libgphoto2/issues/234
* Rework of the ptp event irq manager to raise errors and rearm when neededFlorent Viard2017-07-251-40/+143
| | | | | | | | | | | | | | | | | | This commit rework the ptp2 event (irq) manager for multiple purposes: - If the callback of an event is called because the async event encountered an error, report this error upstream. This allows a call to check_event to detect that a device was removed. Without it, a call to check event will silentely hide that the check_event call failed because a device being removed or dead (by returning a TIMEOUT error) as if everything was ok but there was no event. - Re-arm async event requests if less are running than the expected number of active interrupts transfers - Use a linked list for the queue of events instead of a memory array and steal buffers to avoid useless memory copies. So the code should be faster and more memory efficient.
* if there is no timeout, just check if anything is in the interrupt queueMarcus Meissner2017-03-051-0/+3
|
* allow logging the read bulk data in fuzzer modeMarcus Meissner2016-10-291-0/+15
|
* do not check the return of the gp_port_info_list_append in genericMarcus Meissner2016-02-071-1/+1
| | | | case, as it might be -1
* removed some leaks on error exits (Coverity)Marcus Meissner2016-02-061-3/+5
| | | | CID 1033377 Resource leak
* remove a libusb_free_transfer, as it causes double freesMarcus Meissner2016-01-111-1/+1
|
* timeout polling for the pending async cancel events,Marcus Meissner2016-01-041-0/+3
| | | | to clear them off the queue
* use calloc(n,s) instead of malloc(n*s)Marcus Meissner2016-01-041-2/+2
|
* remove unused sys/time.h defineMarcus Meissner2016-01-041-1/+0
|
* remove sys/param.h and dirent.h use, not neededMarcus Meissner2016-01-031-3/+0
|
* correctly clear out the freed pointers for irqs, irqlens andMarcus Meissner2015-12-211-0/+3
| | | | and the irqcount on _close (we might just reopen the same port later).
* do not try to use libusb libusb_strerror, its presence seems to fluctuateMarcus Meissner2015-12-211-5/+2
|
* removed unused variablesMarcus Meissner2015-11-151-3/+0
|
* free the async interrupts before resetting device, so they do notMarcus Meissner2015-11-151-1/+18
| | | | trigger
* commentsMarcus Meissner2015-06-161-2/+4
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15463 67ed7778-7388-44ab-90cf-0a291f65f57c
* async irqs still not working fully, improved a bit moreMarcus Meissner2015-06-151-8/+14
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15462 67ed7778-7388-44ab-90cf-0a291f65f57c
* changed the cancellation of the async usb transfers so that it does notMarcus Meissner2015-06-141-24/+36
| | | | | | | hang git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15459 67ed7778-7388-44ab-90cf-0a291f65f57c
* intterupt timeout is okMarcus Meissner2015-05-171-2/+3
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15441 67ed7778-7388-44ab-90cf-0a291f65f57c
* cleanup the async interrupt transfersMarcus Meissner2015-03-291-8/+20
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15412 67ed7778-7388-44ab-90cf-0a291f65f57c
* fixed the sizeof, allocate 10 transfers and not just 1Marcus Meissner2015-03-291-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15411 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de>Marcus Meissner2015-03-271-1/+4
| | | | | | | | | | | 1) I always got an "invalid parameter" error message on gp_camera_exit, because gp_port_close gets called twice. Since the result gets ignored anyway the attached patch makes libusb1.c accept a second call by simply returning. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15403 67ed7778-7388-44ab-90cf-0a291f65f57c
* improve cleanup routines for async interrupt handlingMarcus Meissner2015-03-221-36/+16
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15393 67ed7778-7388-44ab-90cf-0a291f65f57c
* moved cancel transfer from _exit to _closeMarcus Meissner2015-03-151-45/+31
| | | | | | | interrupt transfer can be done in sync fashion, it will call into git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15389 67ed7778-7388-44ab-90cf-0a291f65f57c
* commit temporary work on queued interrupt handlingMarcus Meissner2015-03-111-44/+119
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15385 67ed7778-7388-44ab-90cf-0a291f65f57c
* return the read bytes from a control transfer, we need itMarcus Meissner2015-03-101-2/+3
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15384 67ed7778-7388-44ab-90cf-0a291f65f57c
* disable not yet working async handlingMarcus Meissner2015-03-081-2/+5
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15382 67ed7778-7388-44ab-90cf-0a291f65f57c
* function prefixes changed to be more clear that this is libusb1Marcus Meissner2015-03-081-70/+126
| | | | | | | started adding async transfers for e.g. interrupts git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15381 67ed7778-7388-44ab-90cf-0a291f65f57c
* free the devicelist, as freeing the context does notMarcus Meissner2014-12-061-0/+3
| | | | | | | seem to do it. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15258 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-09-091-3/+3
| | | | | | | | | | | | condense gp_log_data debug output. - changed gp_log_data to take a printf style debug string -> new major version of libgphoto2_port - adjusted all callers git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15175 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-221-32/+14
| | | | | | | | | | | | I had something 'prepared' for this situation, here you go.. ;) The patch does not, however, actually remove the GP_LOG_VERBOSE enum, since that would change the interface for all clients, which might not be worth it. If you don't think that is a problem, please remove it... git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15107 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-221-35/+23
| | | | | | | | | | | | | here are the logging cleanup patches for the remaining libgphoto_port backend libs, that I announced earlier. 14 and 15 are equivalent to 3,4,5 as before. 16 removes 4 left instances of _(...) macro usage in log messages. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15106 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-221-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+1
| | | | | | | | | | | 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-211-3/+4
| | | | | | | | adjust log_on_libusb_error_helper macro call to log the location better git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15095 67ed7778-7388-44ab-90cf-0a291f65f57c
* sync error codes with upstream libusbMarcus Meissner2014-07-211-14/+15
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15094 67ed7778-7388-44ab-90cf-0a291f65f57c
* if we do not have libusb_strerror, implement it ourselvesMarcus Meissner2014-07-201-4/+23
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15092 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de> ↵Marcus Meissner2014-07-201-7/+13
| | | | | | | CHECK -> C_GP, added some more checks git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15091 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de>Marcus Meissner2014-07-201-151/+134
| | | | | | | | replace libusb1 error handling with macro code, handle more errors in generic wrapper git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15090 67ed7778-7388-44ab-90cf-0a291f65f57c
* From: Axel Waggershauser <awagger@web.de>Marcus Meissner2014-07-201-45/+33
| | | | | | | use macros in argument and post-alloc checking. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15088 67ed7778-7388-44ab-90cf-0a291f65f57c
* removed umlautsMarcus Meissner2014-06-271-3/+3
| | | | git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15023 67ed7778-7388-44ab-90cf-0a291f65f57c
* do not add the regex matcher for ^usb: if there is no USB support inMarcus Meissner2014-05-261-5/+7
| | | | | | | system. handle missing usb support in gp_port_usb_update git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14957 67ed7778-7388-44ab-90cf-0a291f65f57c