-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringVector.h
More file actions
26 lines (20 loc) · 867 Bytes
/
StringVector.h
File metadata and controls
26 lines (20 loc) · 867 Bytes
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
#ifndef STRINGVECTOR_H
#define STRINGVECTOR_H
#include <stdio.h>
struct StringVector {
size_t capacity;
size_t size;
char **strings; // dynamic array of pointers
};
void string_vector_init( struct StringVector *this, size_t capacity );
void string_vector_free( struct StringVector *this );
void string_vector_add( struct StringVector *this, const char *start, const char *end );
size_t string_vector_size( const struct StringVector *this );
char * string_vector_get( const struct StringVector *this, size_t index );
struct StringVector split_line( char *line );
char * strjoinarray( char *dest,
const struct StringVector *this,
size_t fist,
size_t last,
char * glue );
#endif /* STRINGVECTOR_H */