File: string.h

package info (click to toggle)
ofono 2.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,064 kB
  • sloc: ansic: 224,979; sh: 5,012; python: 4,040; makefile: 956
file content (46 lines) | stat: -rw-r--r-- 1,214 bytes parent folder | download | duplicates (8)
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
43
44
45
46
/*
 * Embedded Linux library
 * Copyright (C) 2011-2014  Intel Corporation
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#ifndef __ELL_STRING_H
#define __ELL_STRING_H

#include <stdarg.h>
#include <ell/cleanup.h>

#ifdef __cplusplus
extern "C" {
#endif

struct l_string;

struct l_string *l_string_new(size_t initial_length);
void l_string_free(struct l_string *string);
DEFINE_CLEANUP_FUNC(l_string_free);
char *l_string_unwrap(struct l_string *string);

struct l_string *l_string_append(struct l_string *dest, const char *src);
struct l_string *l_string_append_c(struct l_string *dest, const char c);
struct l_string *l_string_append_fixed(struct l_string *dest, const char *src,
					size_t max);

void l_string_append_vprintf(struct l_string *dest,
					const char *format, va_list args)
					__attribute__((format(printf, 2, 0)));
void l_string_append_printf(struct l_string *dest, const char *format, ...)
					__attribute__((format(printf, 2, 3)));

struct l_string *l_string_truncate(struct l_string *string, size_t new_size);

unsigned int l_string_length(struct l_string *string);

char **l_parse_args(const char *args, int *out_n_args);

#ifdef __cplusplus
}
#endif

#endif /* __ELL_STRING_H */