]> icculus.org git repositories - taylor/freespace2.git/blob - src/platform/unix.cpp
Initial revision
[taylor/freespace2.git] / src / platform / unix.cpp
1 #include <ctype.h>
2 #include "unix.h"
3
4 void strlwr (char * str)
5 {
6         while (*str) {*str = tolower (*str); str++; }
7 }
8
9 int filelength (int fd)
10 {
11         FILE *f = fdopen (dup(fd), "r");
12         fseek (f, 0, SEEK_END);
13         int len = ftell (f);
14         fclose (f);
15         return len;
16 }