annotate src/util.h @ 296:14d835cf02d9

Handle input files on command line and add some memory management utility functions
author lost
date Sat, 17 Jan 2009 20:54:58 +0000
parents
children 48945dac8178
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
296
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
1 /*
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
2 util.h
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
3 Copyright © 2008 William Astle
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
4
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
5 This file is part of LWLINK.
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
6
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
7 LWLINK is free software: you can redistribute it and/or modify it under the
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
8 terms of the GNU General Public License as published by the Free Software
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
9 Foundation, either version 3 of the License, or (at your option) any later
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
10 version.
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
11
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
12 This program is distributed in the hope that it will be useful, but WITHOUT
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
15 more details.
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
16
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
17 You should have received a copy of the GNU General Public License along with
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
18 this program. If not, see <http://www.gnu.org/licenses/>.
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
19 */
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
20
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
21 /*
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
22 Utility functions
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
23 */
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
24
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
25 #ifndef __util_h_seen__
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
26 #define __util_h_seen__
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
27
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
28 #ifndef __util_c_seen__
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
29 #define __util_E__ extern
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
30 #else
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
31 #define __util_E__
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
32 #endif
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
33
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
34 // allocate memory
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
35 __util_E__ void *lw_malloc(int size);
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
36 __util_E__ void lw_free(void *ptr);
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
37 __util_E__ void *lw_realloc(void *optr, int size);
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
38
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
39 // string stuff
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
40 __util_E__ char *lw_strdup(const char *s);
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
41
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
42 #undef __util_E__
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
43
14d835cf02d9 Handle input files on command line and add some memory management utility functions
lost
parents:
diff changeset
44 #endif // __util_h_seen__