Mercurial > repos > blastem
annotate util.h @ 495:39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 28 Oct 2013 19:37:30 -0700 |
parents | |
children | 6fc71114d145 |
rev | line source |
---|---|
495
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef UTIL_H_ |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define UTIL_H_ |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include <stdio.h> |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 //Utility functions |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 //Allocates a new string containing the concatenation of first and second |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 char * alloc_concat(char * first, char * second); |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 //Allocates a new string containing the concatenation of the strings pointed to by parts |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 char * alloc_concat_m(int num_parts, char ** parts); |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 //Returns the size of a file using fseek and ftell |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 long file_size(FILE * f); |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 //Strips whitespace and non-printable characters from the beginning and end of a string |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 char * strip_ws(char * text); |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 char * split_keyval(char * text); |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 |
39cad98d2789
Allow OpenGL support to be disabled at compile time. Move generic utility functions out of config.c
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 #endif //UTIL_H_ |