From 0cc450e9d75d16133207718aa15492f0bbea664c Mon Sep 17 00:00:00 2001 From: ennewalker Date: Fri, 26 Sep 2008 23:27:50 +0000 Subject: Promoted get_cancelable_line_autohist to cio.h as I determined how to make it work across files. (Declared it as static, as __FILE__ couldn't be used.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7026 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/cio.h | 12 ++++++++++++ crawl-ref/source/debug.cc | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/cio.h b/crawl-ref/source/cio.h index 27f31570aa..38e8b8a2ba 100644 --- a/crawl-ref/source/cio.h +++ b/crawl-ref/source/cio.h @@ -73,6 +73,18 @@ int cancelable_get_line( char *buf, input_history *mh = NULL, int (*keyproc)(int &c) = NULL ); +// Do not use this templated function directly. Use the macro below instead. +template static int cancelable_get_line_autohist_temp(char *buf, int len) +{ + static input_history hist(10); + return cancelable_get_line(buf, len, get_number_of_cols(), &hist); +} + +// This version of cancelable_get_line will automatically retain its own +// input history, independent of other calls to cancelable_get_line. +#define cancelable_get_line_autohist(buf, len) \ + cancelable_get_line_autohist_temp<__LINE__>(buf, len) + struct c_mouse_event { coord_def pos; diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 566a0ac905..b709be9936 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -96,18 +96,6 @@ // Internal Functions // ======================================================================== -// Do not use this templated function directly. Use the macro below instead. -template int cancelable_get_line_autohist_temp(char *buf, int len) -{ - static input_history hist(10); - return cancelable_get_line(buf, len, get_number_of_cols(), &hist); -} - -// This version of cancelable_get_line will automatically retain its own -// input history, independent of other calls to cancelable_get_line. -#define cancelable_get_line_autohist(buf, len) \ - cancelable_get_line_autohist_temp<__LINE__>(buf, len) - //--------------------------------------------------------------- // BreakStrToDebugger //--------------------------------------------------------------- -- cgit v1.2.3-54-g00ecf