O2S C Library
1.8.2
Provide high-level data-structures and other fundamental tools for C projects
Loading...
Searching...
No Matches
constructors_destructors.c
1
/* ************************************************************************** */
2
/* ____ _ _____ ____ _ _ _ _____ _ _ ____ ____ */
3
/* / ___| / \ | ___| _ \ / \ | \ | | |_ _| || | | _ \/ ___| */
4
/* \___ \ / _ \ | |_ | |_) | / _ \ | \| | | | | || |_| | | \___ \ */
5
/* ___) / ___ \| _| | _ < / ___ \| |\ | | | |__ _| |_| |___) | */
6
/* |____/_/ \_|_| |_| \_/_/ \_|_| \_| |_| |_| |____/|____/ */
7
/* */
8
/* Copyright 2023, SAFRAN T4DS, ALL RIGHTS RESERVED */
9
/* */
10
/* @file constructors_destructors.c */
11
/* @author Antoine GAGNIERE */
12
/* */
13
/* ************************************************************************** */
14
15
#include "
o2s/string.h
"
16
18
string_t
string_new
(
void
)
19
{
20
return
ArrayNew
(
char
);
21
}
22
24
string_t
string_from(
const
char
* cstring,
size_t
length)
25
{
26
string_t
result =
string_new
();
27
28
string_append_cstring(&result, cstring, length);
29
return
result;
30
}
31
33
void
string_clear(
string_t
* self)
34
{
35
array_clear
(self);
36
}
array_clear
void array_clear(array_t *self)
Clears properly the array.
Definition
constructors_destructors.c:33
ArrayNew
#define ArrayNew(Type)
Convenient constructor wrapper.
Definition
array.h:38
string.h
Dynamic string implementation.
string_new
string_t string_new(void)
Constructs an empty string.
Definition
constructors_destructors.c:18
string_t
array_t string_t
A string is an array of char.
Definition
string.h:30
src
string
constructors_destructors.c
Generated on
for O2S C Library by
1.14.0