1
//------------------------------------------------------------------------
2
// SYSTEM : System specific code
3
//------------------------------------------------------------------------
5
// GL-Node Viewer (C) 2004-2007 Andrew Apted
7
// This program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public License
9
// as published by the Free Software Foundation; either version 2
10
// of the License, or (at your option) any later version.
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
//------------------------------------------------------------------------
19
#ifndef __NODEVIEW_SYSTEM_H__
20
#define __NODEVIEW_SYSTEM_H__
23
/* ----- basic types and macros ---------------------------- */
26
typedef short sint16_g;
29
typedef unsigned char uint8_g;
30
typedef unsigned short uint16_g;
31
typedef unsigned int uint32_g;
33
typedef double angle_g; // degrees, 0 is E, 90 is N
36
/* ----- function prototypes ---------------------------- */
38
// fatal error messages (these don't return)
39
void FatalError(const char *str, ...);
40
void InternalError(const char *str, ...);
42
// display normal messages & warnings to the screen
43
void PrintMsg(const char *str, ...);
44
void PrintWarn(const char *str, ...);
47
extern const char **arg_list;
50
void ArgvInit(int argc, const char **argv);
52
int ArgvFind(char short_name, const char *long_name, int *num_params = NULL);
53
bool ArgvIsOption(int index);
56
void InitEndian(void);
57
uint16_g Endian_U16(uint16_g);
58
uint32_g Endian_U32(uint32_g);
60
// these are only used for debugging
61
void InitDebug(bool enable);
63
void PrintDebug(const char *str, ...);
66
/* ----- conversion macros ----------------------- */
68
#define UINT8(x) ((uint8_g) (x))
69
#define SINT8(x) ((sint8_g) (x))
71
#define UINT16(x) Endian_U16(x)
72
#define UINT32(x) Endian_U32(x)
74
#define SINT16(x) ((sint16_g) Endian_U16((uint16_g) (x)))
75
#define SINT32(x) ((sint32_g) Endian_U32((uint32_g) (x)))
78
#endif /* __NODEVIEW_SYSTEM_H__ */