116 Commits

Author SHA1 Message Date
Khem Raj
7cbc8b7241 libgphoto2: fix const-correctness for c23 builds
C23 treats the return values of strrchr() and strchr() as const char *
when the input string is const-qualified. Update local variables to use
const char * where appropriate to avoid discarded-qualifier warnings and
build failures with -std=gnu23.

No functional change intended.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-04-04 15:00:19 -07:00
Corentin Noël
7c512cc767 meson: Install the camlibs documentation
Do as in autotools and install the camlib README files.

Also add the install_tag to all installation targets to allow automatic packaging.
2025-11-06 11:53:53 +01:00
Daniel Schulte
a16cb6b552 Add JSON output support to print-camera-list 2025-04-28 13:32:54 +02:00
Corentin Noël
f5bb6c875c Add Meson build system 2025-01-08 10:10:36 +01:00
axxel
1dabc5a523 remove unnecessary if (not-null) check before calling free() (#1001)
Co-authored-by: axxel <awagger@web.de>
2024-09-05 09:25:16 +02:00
Jan Tojnar
44cf70907f print-camera-list: clarify help
Use “version” instead of “mode” to avoid confusion with the “(file) mode” argument.
2021-11-12 01:48:00 +01:00
Hans Ulrich Niedermann
54e0d7fa10 Typo fix: It is _SOURCES, not _SOURCE 2021-10-24 10:41:44 +02:00
Hans Ulrich Niedermann
b01e0ff433 utf-8: change xml/html from iso-8859-1 to utf-8 2021-10-09 10:50:07 +02:00
Hans Ulrich Niedermann
4316f75ed4 Remove obsolete gp2ddb (gphoto2 device database) idea
The gphoto2 device database (gp2ddb) was originally intended to
replace the device lists in the camlib code by a device list
maintained in a text file outside of the camlib C code.

This device list file could then be changed without
recompiling camlibs, at the cost of adding a simple gp2ddb
to internal binary representation compiler to libgphoto2.

This would have allowed a user to very easily add a new camera
model to the list of camera models supported by a specific
camlib, as long as that new camera model uses the same
protocol as already supported camera models do.

As the gp2ddb idea has never been developed any further in the
15 yearns since my initial commit from 2006, this idea appears
to be obsolete and can thus be removed from the codebase.
2021-04-01 20:07:08 +02:00
Siim Meerits
456a1d598b Remove trailing whitespace from all *.h and *.c files. 2020-07-27 17:37:00 +03:00
Bastien Nocera
24d7645039 print-camera-list: Fix udev rules for linux-4.14+
Since commit 1455cf8dbfd0 ("driver core: emit uevents when
device is bound to a driver") the kernel started emitting
"bind" and "unbind" uevents which confuse the libgphoto2
udev rules.

This caused ID_GPHOTO2 and GPHOTO2_DRIVER udev properties not being set
on devices, causing them not to be visible to user-space that uses those
properties (such as gvfs' gphoto2 backend).

See https://github.com/systemd/systemd/issues/8221
2018-12-11 12:03:44 +01:00
Marcus Meissner
a3ea52b60d fedora patch: avoid matching usb mass storage devices 2018-04-15 14:05:41 +02:00
Ismo Puustinen
39b4395532 scripts: remove bashisms.
Convert bash scripts to more generic shell scripts. This removes the
strict bash dependency and the scripts should now run with any posix
shell. Also fix the issues reported by shellcheck while at it.
2017-01-24 22:35:26 +02:00
Igor Gnatenko
d6c6699cb5 print-camera-list: fix gip_enum_to_string() usage
print-camera-list.c: In function 'ddb_delayed_head':
print-camera-list.c:887:2: error: too many arguments to function 'gpi_enum_to_string'
  gpi_enum_to_string(a->device_type,
  ^~~~~~~~~~~~~~~~~~
In file included from ../../libgphoto2_port/gphoto2/gphoto2-port-info-list.h:63:0,
                 from ../../gphoto2/gphoto2-abilities-list.h:30,
                 from ../../gphoto2/gphoto2-camera.h:50,
                 from print-camera-list.c:53:
../../libgphoto2_port/gphoto2/gphoto2-port-log.h:185:3: note: declared here
   gpi_enum_to_string(const unsigned int _enum,
   ^~~~~~~~~~~~~~~~~~
print-camera-list.c:897:2: error: too many arguments to function 'gpi_enum_to_string'
  gpi_enum_to_string(a->status,
  ^~~~~~~~~~~~~~~~~~
In file included from ../../libgphoto2_port/gphoto2/gphoto2-port-info-list.h:63:0,
                 from ../../gphoto2/gphoto2-abilities-list.h:30,
                 from ../../gphoto2/gphoto2-camera.h:50,
                 from print-camera-list.c:53:
../../libgphoto2_port/gphoto2/gphoto2-port-log.h:185:3: note: declared here
   gpi_enum_to_string(const unsigned int _enum,
   ^~~~~~~~~~~~~~~~~~

Fixes: 43d9449161 ("New syntax for print-camera-list's udev output")
References: https://github.com/gphoto/libgphoto2/issues/109
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-11-21 14:49:37 +01:00
Marcus Meissner
232e18b1aa print trigger capture flag 2016-11-20 22:40:03 +01:00
Marcus Meissner
1cc0e4bcf0 also mode/group handling to generic ptp matcher in v201 2015-08-24 08:10:47 +02:00
Marcus Meissner
2456c1249d added license header
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15369 67ed7778-7388-44ab-90cf-0a291f65f57c
2015-02-22 10:09:27 +00:00
Marcus Meissner
7c00ed1a5e added udev versions to help
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15051 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-07-02 06:28:13 +00:00
Marcus Meissner
830ff5b038 umlaut removal
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15029 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-06-27 05:43:10 +00:00
Marcus Meissner
55a06ea820 remove a superflous comma
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15013 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-06-26 08:54:20 +00:00
Marcus Meissner
98f34a73fd added generic ptp line
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15004 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-06-11 06:00:06 +00:00
Marcus Meissner
f836c72bae add more initializers to end array
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14922 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-28 12:23:39 +00:00
Marcus Meissner
874ba7038b added note output for hwdb and udev-rules 201 generation
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14920 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-27 18:30:14 +00:00
Marcus Meissner
db31676562 generate udev rules for systemd 201 and later, with hwdb support
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14919 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-27 18:25:56 +00:00
Marcus Meissner
c1ddde0315 From: "Daniel P. Berrange" <berrange@redhat.com>
A great many functions have variables which are set to some
value, but never read thereafter. All these variables can be
removed with no functional impact.



git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14896 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-11 20:10:32 +00:00
Marcus Meissner
237f12e073 From: "Daniel P. Berrange" <dan@berrange.com>
The 's' variable is assigned to from a 'const char *' so
it should be 'const char *' too, to avoid discarding
const-ness.




git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14893 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-04-11 19:57:17 +00:00
Marcus Meissner
39b79a84a1 fixed the PTP generic matcher... again. :(
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14697 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-01-11 08:33:39 +00:00
Marcus Meissner
3b2e8b92b4 Only emit the interface matcher for ptp in hwdb
Emit hwdb list only once.
set the type to PTP if the driver is ptp2.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14682 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-01-08 20:24:36 +00:00
Marcus Meissner
9d286eca2a emit an interface matcher for PTP, not just a dervice class matcher
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14681 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-01-08 10:40:33 +00:00
Marcus Meissner
bd5c51e1b5 updated fsf adress
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14609 67ed7778-7388-44ab-90cf-0a291f65f57c
2014-01-01 20:32:40 +00:00
Marcus Meissner
1a003f310b coverity found some stuff
patch from:  Jaromír Končický


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14560 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-10-07 21:21:41 +00:00
Marcus Meissner
283721bcbd added hwdb output mode for newer udev
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14490 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-07-17 20:35:25 +00:00
Marcus Meissner
f9caff7c2a updated to write differently and also read comments
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14421 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-05-18 14:49:19 +00:00
Marcus Meissner
d4c89d8688 html: render tables for inclusion in support.php
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14419 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-05-18 10:00:37 +00:00
Marcus Meissner
60038db2e4 cleaned up AM_CPPFLAGS and CPPFLAGS usage patterns.
AM_CPPFLAGS and CPPFLAGS are used both during build, so
no need to use merge them together in configure.
also move the -I$(xx) stuff into Makefile* to avoid
shell expansion issues.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14269 67ed7778-7388-44ab-90cf-0a291f65f57c
2013-03-10 14:59:08 +00:00
Marcus Meissner
e3a82c018b merged from 2.4 branch with the ubuntu udev 179 fixes
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13887 67ed7778-7388-44ab-90cf-0a291f65f57c
2012-02-26 19:00:38 +00:00
Marcus Meissner
e30af81f54 add a format specifier to printf
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13880 67ed7778-7388-44ab-90cf-0a291f65f57c
2012-02-23 11:05:38 +00:00
Dan Fandrich
1df292a5e4 Fixed some compiler warnings and portability issues
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@13148 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-07-14 20:50:22 +00:00
Hans de Goede
004777f287 Add ax203 camlib for ax203 based picture frames
This makes it possible to download pictures from / upload pictures to
ax203 based picture frames

It consists of 2 parts:
1) an ax203 camlib, ax203 access, image table parsing, and decompress /
   compress code.
 
2) usbscsi port driver, this is a *Linux only* (for now) port driver
   for accessing devices which require sending custom scsi commands to
   an usb mass storage device (using the /dev/sg# device under Linux).


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12854 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-29 09:25:54 +00:00
Marcus Meissner
a68039990f killed 1 warning
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12809 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-20 22:23:17 +00:00
Hans de Goede
3675016aef print-camera-list: print udevrules for usbdiskdirect port devices
Add support for printing udev rules for usbdiskdirect port cameras
(such as the st2205). Note that the udev rule applies to the /dev/sdx
node instead of to the /dev/usb/.... one, as that is the one which needs
to get its acl's set properly to allow users access.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12777 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-16 08:21:41 +00:00
Marcus Meissner
8b79d08479 revert usb_disk_direct again, not useful here
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12775 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-15 21:30:34 +00:00
Marcus Meissner
599629e8bd handle usb disk direct
convert varargs logging


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12762 67ed7778-7388-44ab-90cf-0a291f65f57c
2010-03-14 20:38:02 +00:00
Marcus Meissner
c4a9bc1c4f fixed media player udev rules in new style mode
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12493 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-10-12 14:42:37 +00:00
Marcus Meissner
f20f69384d fixed version checker code.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12375 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-08-11 15:11:16 +00:00
Dan Fandrich
f6c4c628f3 Fixed a bunch of C89 and SUS portability issues.
Fixed a buffer overflow in the AOX driver.


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12305 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-07-30 18:15:21 +00:00
Marcus Meissner
5e9a103e3d set iface protocol class/subclass to 6/1/1
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12153 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-06-15 07:07:47 +00:00
Marcus Meissner
ffe0a3e862 replace vendor/class hack by direct Apple Vendor ID check
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12147 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-06-12 21:07:38 +00:00
Marcus Meissner
b25a6268b3 output protocol matcher even in devices, if requested
use addset instead of append


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12142 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-06-11 16:15:22 +00:00
Marcus Meissner
58d6d58695 updated version from Martin
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12134 67ed7778-7388-44ab-90cf-0a291f65f57c
2009-06-04 19:16:58 +00:00