summaryrefslogtreecommitdiff
path: root/util.h
blob: e3e2e86a37936d837c6ba6127a3780d4ca7065f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef UTIL_H_
#define UTIL_H_

#include <stdio.h>

//Utility functions

//Allocates a new string containing the concatenation of first and second
char * alloc_concat(char * first, char * second);
//Allocates a new string containing the concatenation of the strings pointed to by parts
char * alloc_concat_m(int num_parts, char ** parts);
//Returns the size of a file using fseek and ftell
long file_size(FILE * f);
//Strips whitespace and non-printable characters from the beginning and end of a string
char * strip_ws(char * text);
char * split_keyval(char * text);

#endif //UTIL_H_