summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/macro.h
diff options
context:
space:
mode:
authornlanza <nlanza@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-13 02:19:00 +0000
committernlanza <nlanza@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-13 02:19:00 +0000
commitaa88fdd8c6ad2da5eb5bd933e2d53d56cd8c176f (patch)
treed0551b96eaebb5b55694579fb8dae4abc7a38407 /crawl-ref/source/macro.h
parent2b32f164e6ca1c4b3d587789f6cf46f46fe02fe8 (diff)
downloadcrawl-ref-aa88fdd8c6ad2da5eb5bd933e2d53d56cd8c176f.tar.gz
crawl-ref-aa88fdd8c6ad2da5eb5bd933e2d53d56cd8c176f.zip
Clean up a mistake in the SVN import.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/macro.h')
-rw-r--r--crawl-ref/source/macro.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/crawl-ref/source/macro.h b/crawl-ref/source/macro.h
new file mode 100644
index 0000000000..dba3bafafe
--- /dev/null
+++ b/crawl-ref/source/macro.h
@@ -0,0 +1,63 @@
+/*
+ * File: macro.cc
+ * Summary: Crude macro-capability
+ * Written by: Juho Snellman <jsnell@lyseo.edu.ouka.fi>
+ *
+ * Change History (most recent first):
+ *
+ * <2> 6/25/02 JS Removed old cruft
+ * <1> -/--/-- JS Created
+ */
+
+#ifdef USE_MACROS
+
+#ifndef MACRO_H
+#define MACRO_H
+
+#ifndef MACRO_CC
+
+#undef getch
+#define getch() getchm()
+
+#endif
+
+enum KeymapContext {
+ KC_DEFAULT, // For no-arg getchm().
+ KC_LEVELMAP, // When in the 'X' level map
+ KC_TARGETING, // Only during 'x' and other targeting modes
+
+ KC_CONTEXT_COUNT // Must always be the last
+};
+
+int getchm(int (*rgetch)() = NULL); // keymaps applied (ie for prompts)
+int getchm(KeymapContext context, int (*rgetch)() = NULL);
+
+int getch_with_command_macros(void); // keymaps and macros (ie for commands)
+
+void flush_input_buffer( int reason );
+
+void macro_add_query(void);
+int macro_init(void);
+void macro_save(void);
+
+void macro_userfn(const char *keys, const char *registryname);
+
+void macro_buf_add(int key);
+
+bool is_userfunction(int key);
+
+const char *get_userfunction(int key);
+
+#endif
+
+#else
+
+#define getch_with_command_macros() getch()
+#define getchm(x) getch()
+#define flush_input_buffer(XXX) ;
+#define macro_buf_add(x)
+#define is_userfunction(x) false
+#define get_userfunction(x) NULL
+#define call_userfunction(x)
+
+#endif