]> git.proxmox.com Git - libgit2.git/blame - include/git2/signature.h
Add a few malloc checks
[libgit2.git] / include / git2 / signature.h
CommitLineData
638c2ca4
VM
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 */
38GIT_BEGIN_DECL
39
40/**
41 * Create a new action signature. The signature must be freed
42 * manually or using git_signature_free
43 *
44 * @name name of the person
45 * @email email of the person
46 * @time time when the action happened
47 * @offset timezone offset in minutes for the time
9d80d74d 48 * @return the new sig, NULL on out of memory
638c2ca4 49 */
56d8ca26 50GIT_EXTERN(git_signature *) git_signature_new(const char *name, const char *email, git_time_t time, int offset);
638c2ca4
VM
51
52/**
53 * Create a copy of an existing signature.
54 *
55 * All internal strings are also duplicated.
56 * @sig signature to duplicated
57 * @return a copy of sig, NULL on out of memory
58 */
59GIT_EXTERN(git_signature *) git_signature_dup(const git_signature *sig);
60
61/**
62 * Free an existing signature
63 *
64 * @sig signature to free
65 */
66GIT_EXTERN(void) git_signature_free(git_signature *sig);
67
68/** @} */
69GIT_END_DECL
70#endif