1 /*
2  * Support.h
3  * Copyright (C) 2007 by Bryan Duff <duff0097@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  */
20 #ifndef SUPPORT_H
21 #define SUPPORT_H
22 
23 #include <stdio.h>
24 #include <unistd.h>
25 
26 #include <AL/al.h>
27 #include <AL/alut.h>
28 
29 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
30 
31 #define fsFromStart SEEK_SET
32 
33 typedef unsigned char *Str255;
34 typedef int OSErr;
35 typedef short int SInt16;
36 
37 typedef bool Boolean;
38 #define TRUE true
39 #define FALSE false
40 
41 typedef struct UnsignedWide {
42   unsigned int lo;
43   unsigned int hi;
44 } UnsignedWide;
45 
46 typedef struct Point {
47   int h;
48   int v;
49 } Point;
50 
51 #define SetFPos(fildes, whence, offset) lseek(fildes, offset, whence)
52 #define FSClose(fildes) close(fildes)
53 
54 int Random();
55 void Microseconds(UnsignedWide * microTickCount);
56 void GetMouse(Point * p);
57 void GetMouseRel(Point * p);
58 void GetKeys(unsigned long *keys);
59 //int Button(void);
60 int ButtonClick(int button);
61 #ifdef NOOGG
62 void alutLoadWAVFile_CFH(char *filename, ALenum * format, void **wave,
63                          unsigned int *size, ALsizei * freq);
64 void alutUnloadWAV_CFH(ALenum format, void *wave, unsigned int size,
65                        ALsizei freq);
66 #define alutLoadWAVFile alutLoadWAVFile_CFH
67 #define alutUnloadWAV alutUnloadWAV_CFH
68 #else
69 void LoadOGG_CFH(char *filename, ALenum * format, void **wave,
70                  unsigned int *size, ALsizei * freq);
71 void FreeOGG(ALenum format, void *wave, unsigned int size, ALsizei freq);
72 #endif
73 
74 
75 FILE *cfh_fopen(const char *filename, const char *mode);
76 
77 #endif
78