summaryrefslogtreecommitdiff
path: root/include/git2/buf_text.h
blob: 29bfca80d2acbd5db67ce735be74ee73b26f67ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_git_buf_text_h__
#define INCLUDE_git_buf_text_h__

#include "common.h"
#include "buffer.h"

/**
 * @file git2/buf_text.h
 * @brief Buffer text export structure
 *
 * @ingroup Git
 * @{
 */
GIT_BEGIN_DECL

/**
 * Check quickly if buffer looks like it contains binary data
 *
 * @param buf Buffer to check
 * @return 1 if buffer looks like non-text data
 */
GIT_EXTERN(int) git_buf_text_is_binary(const git_buf *buf);

/**
 * Check quickly if buffer contains a NUL byte
 *
 * @param buf Buffer to check
 * @return 1 if buffer contains a NUL byte
 */
GIT_EXTERN(int) git_buf_text_contains_nul(const git_buf *buf);

GIT_END_DECL

/** @} */

#endif