blob: 9ef1eb58168e9ec9e2a1c8d92a62202e2cec34d2 (
plain) (
blame)
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
|
#ifndef NVIM_STRINGS_H
#define NVIM_STRINGS_H
#include <stdarg.h>
#include <stdbool.h>
#include <string.h>
#include "nvim/eval/typval.h"
#include "nvim/lib/kvec.h"
#include "nvim/types.h"
/// Append string to string and return pointer to the next byte
///
/// Unlike strcat, this one does *not* add NUL byte and returns pointer to the
/// past of the added string.
///
/// @param[out] dst String to append to.
/// @param[in] src String to append.
///
/// @return pointer to the byte just past the appended byte.
static inline char *strappend(char *const dst, const char *const src)
FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
FUNC_ATTR_NONNULL_RET
{
const size_t src_len = strlen(src);
return (char *)memmove(dst, src, src_len) + src_len;
}
typedef kvec_t(char) StringBuilder;
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "strings.h.generated.h"
#endif
#endif // NVIM_STRINGS_H
|