summaryrefslogtreecommitdiff
path: root/src/h-define.h
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2014-05-14 23:54:09 -0700
committerManoj Srivastava <srivasta@debian.org>2014-05-14 23:54:09 -0700
commit4f8b58cc5366bfc2ea3b56fe6ff0443464d10f0f (patch)
treea0a9cad00e7916b9a97e14831fb362f21871cbef /src/h-define.h
tome (2.3.11-ah-2) unstable; urgency=low
* Modified the install paths to deploy to the FHS compliant /usr/games/tome and /var/games/tome, as we have always done * This is a major change, and includes theming. Some of the options have changed. Because of this, the manual page has been removed; there is a command line help option and in game help until the manual page is rewritten. # imported from the archive
Diffstat (limited to 'src/h-define.h')
-rw-r--r--src/h-define.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/src/h-define.h b/src/h-define.h
new file mode 100644
index 00000000..cb36b189
--- /dev/null
+++ b/src/h-define.h
@@ -0,0 +1,111 @@
+/* File: h-define.h */
+
+#ifndef INCLUDED_H_DEFINE_H
+#define INCLUDED_H_DEFINE_H
+
+/*
+ * Define some simple constants
+ */
+
+
+/*
+ * Hack -- Define NULL
+ */
+#ifndef NULL
+# ifdef __STDC__
+# define NULL ((void*)0)
+# else
+# define NULL ((char*)0)
+# endif /* __STDC__ */
+#endif /* NULL */
+
+
+/*
+ * Hack -- force definitions -- see fd_seek()
+ */
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+#ifndef SEEK_CUR
+# define SEEK_CUR 1
+#endif
+#ifndef SEEK_END
+# define SEEK_END 2
+#endif
+
+/*
+ * Hack -- force definitions -- see fd_lock() XXX XXX XXX
+ */
+#ifndef F_UNLCK
+# define F_UNLCK 0
+#endif
+#ifndef F_RDLCK
+# define F_RDLCK 1
+#endif
+#ifndef F_WRLCK
+# define F_WRLCK 2
+#endif
+
+
+/*
+ * The constants "TRUE" and "FALSE"
+ */
+
+#undef TRUE
+#define TRUE 1
+
+#undef FALSE
+#define FALSE 0
+
+
+
+
+/**** Simple "Macros" ****/
+
+/*
+ * Force a character to lowercase/uppercase
+ */
+#define FORCELOWER(A) ((isupper((A))) ? tolower((A)) : (A))
+#define FORCEUPPER(A) ((islower((A))) ? toupper((A)) : (A))
+
+
+/*
+ * Non-typed minimum value macro
+ */
+#undef MIN
+#define MIN(a,b) (((a) > (b)) ? (b) : (a))
+
+/*
+ * Non-typed maximum value macro
+ */
+#undef MAX
+#define MAX(a,b) (((a) < (b)) ? (b) : (a))
+
+/*
+ * Non-typed absolute value macro
+ */
+#undef ABS
+#define ABS(a) (((a) < 0) ? (-(a)) : (a))
+
+/*
+ * Non-typed sign extractor macro
+ */
+#undef SGN
+#define SGN(a) (((a) < 0) ? (-1) : ((a) != 0))
+
+
+/*
+ * Note that all "index" values must be "lowercase letters", while
+ * all "digits" must be "digits". Control characters can be made
+ * from any legal characters. XXX XXX XXX
+ */
+#define A2I(X) ((X) - 'a')
+#define I2A(X) ((X) + 'a')
+#define D2I(X) ((X) - '0')
+#define I2D(X) ((X) + '0')
+#define KTRL(X) ((X) & 0x1F)
+#define ESCAPE '\033'
+
+
+#endif
+