14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
-
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
|
* The "native" build platform requires GNU Make 3.81 or higher and the conventional set of Unix-side build tools. Contributions of control files (or READMEs) for other build platforms are of course welcomed.
* The overall style is a direct artifact (as it were) of fossil(1), and we ask that all contributors maintain the _general overall_ style. We are _not_ picky about placement of spaces around parenthesis and whatnot, mainly just the overall 2-space indentation and `{` bracing `}` styles, as well as the naming style for public symbols (e.g. a prefix of `fsl_` on most symbols). The one notable exception is how APIs are documented: libfossil uses Doxygen style and Doxygen cannot swallow fossil's native comment style.
## Getting it Running Locally (on Unix-like systems)
Because of where the libs live vs where the binaries live, the easiest ways to get the source tree running its test apps are...
The following text assumes the `{CHECKOUT}` is the top-most directory of this source tree's checkout and that the tree has been built already, using:
The following text assumes the `{CHECKOUT}` is the top-most directory of this source tree's checkout and that the tree has been built already using:
```
$ ./configure
$ make
```
(FWIW, i use `./configure CC="ccache cc"; make -j4`, noting that "make" *must* be GNU Make, which is called `gmake` on some platforms.)
Now, to get the binaries working...
First, and simplest, is to add `{CHECKOUT}/src` to one's `$LD_LIBRARY_PATH` and `{CHECKOUT}/f-apps` to the `$PATH`. `libfossil.*` lives, as of this writing, in the `src` dir, but building from the top-most directory will also symlink those there. The build tree is not set up to do out-of-tree builds (and won't be unless someone who cares about that patches it to do so).
Slightly more elaborate is to...
Slightly more elaborate is...
1) From a directory in the `$LD_LIBRARY PATH`, type: `ln -s {CHECKOUT}/src/libfossil.* .`
1) From a directory in the `$LD_LIBRARY PATH`, type: \
`ln -s {CHECKOUT}/src/libfossil.* .` \
For my systems, that's `~/lib`.
2) Symlink all of the [f-apps](/dir/f-apps/) to a directory in the `$PATH`. For example:
```
$ cd ~/bin
$ for i in {CHECKOUT}/f-apps/f-*; do
test -x "$i" && ln -s "$i" . # filter out .o/.c files
done
```
Or:
```
$ cd ~/bin
$ ln -s {CHECKOUT}/f-apps/f-* .
$ rm f-*.o f-*.c
```
As new f-apps are added, add a symlink to the appropriate directory.
## An Introduction to structs...
All (or almost all) structs in the library are accompanied by other constructs which help ensure consistency regarding how library-level structs are to be initialized. The general pattern looks like this:
|