-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdynamic_string.h
47 lines (38 loc) · 1.74 KB
/
dynamic_string.h
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
47
/**
* @file dynamic_string.h
* @author André Dietrich
* @date 14 December 2016
*
* @copyright Copyright 2016 André Dietrich. All rights reserved.
*
* @license This project is released under the MIT-License.
*
* @brief Definition of C string manipulation functions.
*
*
*/
#ifndef STRING_C_H
#define STRING_C_H
#include "dynamic_types.h"
#include <stdlib.h>
/** @brief Returns the length of an string. */
dyn_ushort dyn_strlen (dyn_const_str str);
/** @brief Concatenate strings */
void dyn_strcat (dyn_str destination, dyn_const_str source);
/** @brief Concatenate strings, required memory is automatically allocated. */
void dyn_strcat2 (dyn_str destination, dyn_const_str source);
/** @brief Copy string. */
void dyn_strcpy (dyn_str destination, dyn_const_str source);
/** @brief Integer to ASCII-string conversion. */
void dyn_itoa (dyn_str str, dyn_int i);
/** @brief Calculates the number of required characters for integer to string
* (decimal) conversion, minus increases the value by one. */
dyn_ushort dyn_itoa_len (dyn_int i);
/** @brief Float to ASCII-string conversion (decimal). */
void dyn_ftoa (dyn_str str, const dyn_float f);
/** @brief Calculates the number of required characters for float to string
* (decimal) conversion, minus increases the value by one. */
dyn_ushort dyn_ftoa_len (const dyn_float f);
/** @brief Compares the string a to the string b. */
dyn_char dyn_strcmp (dyn_const_str a, dyn_const_str b);
#endif