]> git.proxmox.com Git - libgit2.git/blob - include/git2/signature.h
Merge upstream/development
[libgit2.git] / include / git2 / signature.h
1 /*
2 * This file is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2,
4 * as published by the Free Software Foundation.
5 *
6 * In addition to the permissions in the GNU General Public License,
7 * the authors give you unlimited permission to link the compiled
8 * version of this file into combinations with other programs,
9 * and to distribute those combinations without any restriction
10 * coming from the use of this file. (The General Public License
11 * restrictions do apply in other respects; for example, they cover
12 * modification of the file, and distribution when not linked into
13 * a combined executable.)
14 *
15 * This file is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; see the file COPYING. If not, write to
22 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24 */
25 #ifndef INCLUDE_git_signature_h__
26 #define INCLUDE_git_signature_h__
27
28 #include "common.h"
29 #include "types.h"
30
31 /**
32 * @file git2/signature.h
33 * @brief Git signature creation
34 * @defgroup git_signature Git signature creation
35 * @ingroup Git
36 * @{
37 */
38 GIT_BEGIN_DECL
39
40 /**
41 * Create a new action signature. The signature must be freed
42 * manually or using git_signature_free
43 *
44 * @param name name of the person
45 * @param mail email of the person
46 * @param time time when the action happened
47 * @param offset timezone offset in minutes for the time
48 * @return the new sig, NULL on out of memory
49 */
50 GIT_EXTERN(git_signature *) git_signature_new(const char *name, const char *email, git_time_t time, int offset);
51
52 /**
53 * Create a new action signature with a timestamp of 'now'. The
54 * signature must be freed manually or using git_signature_free
55 *
56 * @param name name of the person
57 * @param email email of the person
58 * @return the new sig, NULL on out of memory
59 */
60 GIT_EXTERN(git_signature *) git_signature_now(const char *name, const char *email);
61
62
63 /**
64 * Create a copy of an existing signature.
65 *
66 * All internal strings are also duplicated.
67 * @param sig signature to duplicated
68 * @return a copy of sig, NULL on out of memory
69 */
70 GIT_EXTERN(git_signature *) git_signature_dup(const git_signature *sig);
71
72 /**
73 * Free an existing signature
74 *
75 * @param sig signature to free
76 */
77 GIT_EXTERN(void) git_signature_free(git_signature *sig);
78
79 /** @} */
80 GIT_END_DECL
81 #endif