blob: 5634dc72ba47e5dffd1f4147f56e437cdd4f1533 (
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
|
#ifndef __SAFEC_ARRAY_H
#define __SAFEC_ARRAY_H
#include <stddef.h>
typedef struct {
size_t length;
size_t elemsz;
void* __data;
} array_t;
void* array_at(const array_t* array, size_t idx);
typedef struct {
size_t length;
char* __data;
} str_t;
char* str_at(const str_t* str, size_t idx);
str_t str_slice(const str_t* str, size_t start, size_t length);
void str_c_str(
char* dst,
size_t dst_size,
const str_t* src
);
/* TODO: reimplement string.h functions for this new string construct */
#endif
|