aboutsummaryrefslogtreecommitdiffstats
path: root/io.h
blob: ee28320f77b56bb14db4f8b7310196f3a9f6995c (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
28
29
30
31
32
33
34
35
/*
 * io.h
 * decleration of basic io operations
 *
 * Erik Liodden
 */

#ifndef IO_H
#define IO_H

#define BUF_SIZE 1024


/*
 * read_line:
 * read line from stream. I should probably delete this as fgets works just
 * fine.
 */
int read_line(char *buf, FILE *stream);

/*
 * str_count_words:
 * count words in the string `str` and return this number
 */
int str_count_words(char *str);

/*
 * string_to_int_array:
 * convert a string `buf` of ints reperated by spaces into the array `numbers`
 * the function returns a pointer to the array of ints
 */
int *string_to_int_array(char *buf, int *numbers);


#endif  /* IO_H */