1 /* Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
20 struct chunk_header_position
{
21 unsigned long position
;
26 struct chunk_header_position old
;
27 struct chunk_header_position
new;
30 bool parse_chunk_header(struct chunk_header
*header
, const char *line
);
31 bool parse_chunk_lineno(unsigned long *lineno
, const char *chunk
, int marker
);
34 char id
[SIZEOF_REV
]; /* SHA1 ID. */
35 char title
[128]; /* First line of the commit message. */
36 const struct ident
*author
; /* Author of the commit. */
37 struct time time
; /* Date from the author ident. */
38 const char *filename
; /* Name of file. */
39 char parent_id
[SIZEOF_REV
]; /* Parent/previous SHA1 ID. */
40 const char *parent_filename
; /* Parent/previous name of file. */
44 char id
[SIZEOF_REV
]; /* SHA1 ID. */
50 bool parse_blame_header(struct blame_header
*header
, const char *text
, size_t max_lineno
);
51 bool parse_blame_info(struct blame_commit
*commit
, char author
[SIZEOF_STR
], char *line
);
53 /* Parse author lines where the name may be empty:
54 * author <email@address.tld> 1138474660 +0100
56 void parse_author_line(char *ident
, const struct ident
**author
, struct time
*time
);
58 size_t parse_size(const char *text
);
63 const char *get_path(const char *path
);
64 struct ident
*get_author(const char *name
, const char *email
);
67 /* vim: set ts=8 sw=8 noexpandtab: */