From 4af53c1fa20cea7e324cedf54f68543cd1db515f Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Fri, 12 Oct 2001 19:30:02 +0000 Subject: [PATCH] 2001-10-12 Hans Ulrich Niedermann * HACKING: reformatted, added not for emacs users * README: added hint to gphoto2-cli.txt * AUTHORS: fixed typo git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2504 67ed7778-7388-44ab-90cf-0a291f65f57c --- AUTHORS | 2 +- ChangeLog | 6 ++++++ HACKING | 52 +++++++++++++++++++++++++++++++++++++++++++++------- README | 11 +++++------ 4 files changed, 57 insertions(+), 14 deletions(-) diff --git a/AUTHORS b/AUTHORS index 56c2206a8..2a9b4c4b1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,7 +4,7 @@ Directory Browse library, Mattel library, command-line interface, gpio design Mariusz Zynel -Panasonic DC1000/DC1580 library, comnmand-line interface, +Panasonic DC1000/DC1580 library, command-line interface, Solaris patches, bug fixing Johannes Erdfelt diff --git a/ChangeLog b/ChangeLog index bbb77507d..ff5a1e726 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-10-12 Hans Ulrich Niedermann + + * HACKING: reformatted, added not for emacs users + * README: added hint to gphoto2-cli.txt + * AUTHORS: fixed typo + 2001-10-12 Hans Ulrich Niedermann * camlibs/canon/canon.c: added is_crw() function diff --git a/HACKING b/HACKING index 392c5726f..1a7ca882f 100644 --- a/HACKING +++ b/HACKING @@ -1,19 +1,31 @@ -If you want to hack on gphoto2 (or a camera driver for gphoto2), please follow some rules to make our work easier: +If you want to hack on gphoto2 (or a camera driver for gphoto2), +please follow some rules to make our work easier: camlib ------ -Camera libraries are often very sensitive to changes. Therefore, before you commit any changes, double check with the author that your changes won't break the driver. +Camera libraries are often very sensitive to changes. Therefore, +before you commit any changes, double check with the author that your +changes won't break the driver. -If you want to write a driver for gphoto2, the easiest way to do so would be to copy over the contents of camlibs/template and fill in your code. +If you want to write a driver for gphoto2, the easiest way to do so +would be to copy over the contents of camlibs/template and fill in +your code. -Use something like CHECK_RESULT (see for example libgphoto2/filesys.c). +Use something like CHECK_RESULT (see for example +libgphoto2/filesys.c). -Let's say you write a driver called sillycam. Please set up a file called sillycam.c containing all gphoto2-specific code (like camera_init) and another two files called library.c and library.h containing the "magic", that is all gp_port_[read,write] functions and the basic logic of the communication. This makes it easier for us to adapt your code if anything should change in the gphoto2-API. +Let's say you write a driver called sillycam. Please set up a file +called sillycam.c containing all gphoto2-specific code (like +camera_init) and another two files called library.c and library.h +containing the "magic", that is all gp_port_[read,write] functions and +the basic logic of the communication. This makes it easier for us to +adapt your code if anything should change in the gphoto2-API. Use the port provided by camera->port. -Use the filesystem provided by camera->fs and set up the callbacks so that libgphoto2 can cache listings and file-information. +Use the filesystem provided by camera->fs and set up the callbacks so +that libgphoto2 can cache listings and file-information. libgphoto2 @@ -42,5 +54,31 @@ my_func (int arg) return (GP_OK); } -Please always check the return value of gp_-functions! We defined some handy macros all over the place (like CHECK_RESULT) - by using those, you'll avoid lots of if {} else {}. +Please always check the return value of gp_-functions! We defined some +handy macros all over the place (like CHECK_RESULT) - by using those, +you'll avoid lots of if {} else {}. +Emacs users may define and use a gphoto-c-mode by putting the +following stuff into their .emacs file: + +-----8<------------------------------------------------ + +;;* gphoto-c-mode +;;*===================================================================== +(defun gphoto-c-mode () + "C mode with adjusted defaults for gphoto hacking" + (interactive) + (c-mode) + (c-set-style "linux") + (setq indent-tabs-mode t) + (font-lock-mode)) + +;; +(setq auto-mode-alist (cons '("/home/user/src/gphoto.*\\.[ch]$" . gphoto-c-mode) + auto-mode-alist)) + +-----8<------------------------------------------------ + +Local Variables: +mode:text +End: diff --git a/README b/README index 76522c4b6..d6d8eff7c 100644 --- a/README +++ b/README @@ -73,10 +73,9 @@ Frontends --------- gphoto2 ships with a command line frontend which is quite powerful, -especially in combination with scripts. For the GUI lovers, there are for -example gtkam (GTK based), and GnoCam (GNOME). Additionally, there -are plugins for other programs available like kio_gphoto (KDE - Konqueror). - - - +especially in combination with scripts. See gphoto2-cli.txt for a +short description. +For the GUI lovers, there are for example gtkam (GTK based), and +GnoCam (GNOME). Additionally, there are plugins for other programs +available like kio_gphoto (KDE - Konqueror).