Debian Codegraph @

src/ffutil.h

raw
1 /*
2 * Ffindex
3 * written by Andreas Hauser <[email protected]>.
4 * Please add your name here if you distribute modified versions.
5 *
6 * Ffindex is provided under the Create Commons license "Attribution-ShareAlike
7 * 4.0", which basically captures the spirit of the Gnu Public License (GPL).
8 *
9 * See:
10 * http://creativecommons.org/licenses/by-sa/4.0/
11 *
12 * Ffindex is a very simple database for small files. The files are stored
13 * concatenated in one big data file, seperated by '\0'. A second file
14 * contains a plain text index, giving name, offset and length of of the small
15 * files.
16 */
17
18 /* In addition ffutil.h and ffutil.c is licensed under MIT
19 *
20 * Permission is hereby granted, free of charge, to any person obtaining
21 * a copy of this software and associated documentation files (the
22 * "Software"), to deal in the Software without restriction, including
23 * without limitation the rights to use, copy, modify, merge, publish,
24 * distribute, sublicense, and/or sell copies of the Software, and to
25 * permit persons to whom the Software is furnished to do so, subject to
26 * the following conditions:
27 *
28 * The above copyright notice and this permission notice shall be
29 * included in all copies or substantial portions of the Software.
30 *
31 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 */
39
40 #include <err.h>
41 #include <errno.h>
42 #include <string.h>
43
44
45 int fferror_print(char *sourcecode_filename, int line, const char *function_name, const char *message);
46
47 char* ffnchomp(char *s, size_t len);
48
49 int ffstrncmp(const char* s1, const char* s2, size_t len);
50
51 unsigned long ffparse_ulong(const char *s, const char** end);
52
53 size_t fffprint_ulong(FILE* file, unsigned long l);
54
55 size_t ffcount_lines(const char *filename);
56
57 /* vim: ts=2 sw=2 et
58 */