<commit_before>HACKING
=======

If you want to hack on gphoto2 (or a camera driver for gphoto2),
please follow some rules to make our work easier.

[ Note from 2019-10: Some of these rules are from the early 2000s and
  may make less sense now than they did fifteen years plus earlier. ]


Licensing
=========

We urge you to license your contributions under the LGPL so we can
distribute gphoto2 under the LGPL as well.


Patches
=======

... are always welcome.

We prefer patches against the current git master very much over
patches against old released versions, but these are also welcome :-)


Source Files
============

Every source file (`file_name.c`) should have the following layout:

    /* Licence, author, etc. */
    #include "config.h"<commit_msg>HACKING.md: Add basic source code repository structure<commit_after>HACKING
=======

If you want to hack on gphoto2 (or a camera driver for gphoto2),
please follow some rules to make our work easier.

[ Note from 2019-10: Some of these rules are from the early 2000s and
  may make less sense now than they did fifteen years plus earlier. ]


Licensing
=========

We urge you to license your contributions under the LGPL so we can
distribute gphoto2 under the LGPL as well.


Patches
=======

... are always welcome.

We prefer patches against the current git master very much over
patches against old released versions, but these are also welcome :-)


Source Repository Directory Structure
=====================================

The source repository structure as of libgphoto2-2.5.23 (2019-10):

  * [`libgphoto2_port/gphoto2/*.h`](libgphoto2_port/gphoto2/)

    The header files with the interface to `libgphoto2_port`.

  * [`libgphoto2_port/libgphoto2_port/*.[ch]`](libgphoto2_port/libgphoto2_port/)

    Implementation of the `libgphoto2_port` library used internally by
    `libgphoto2`.

  * [`libgphoto2_port/{disk,libusb1,ptpip,serial,usb,usbdiskdirect,usbscsi,vusb}/*.[ch]`](libgphoto2_port/)

    The port driver code for the `iolibs`. Dynamically loaded by `libgphoto2_port`.

  * [`libgphoto2/*.[ch]`](libgphoto2/)

    The source code of the actual `libgphoto2` library.

  * [`gphoto2/*.h`](gphoto2/)

    The header files with the interface to `libgphoto2`.

  * [`camlibs/<CAMLIB>/*.[ch]`](camlibs/)

    The camera drivers (`camlibs`). Dynamically loaded by `libgphoto2`.

The buildsystem is based on automake, i.e. `configure.ac`,
`Makefile.am` and `Makefile-files` have their standard functions.


Source Files
============

Every source file (`file_name.c`) should have the following layout:

    /* Licence, author, etc. */
    #include "config.h"
{'fraction_non_alphanumeric': 0.12333965844402277, 'fraction_numerical': 0.022390891840607212, 'mean_word_length': 4.1686274509803924, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4345003', 'n_tokens_mistral': 844, 'n_tokens_neox': 773, 'n_words': 310}