diff options
author | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:25 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:25 +0100 |
commit | 0ccfeea985d21a6fa84ede7aaa461b9075ca0aa6 (patch) | |
tree | 066c6402715dc5b12a8e4f0f8757060493440289 | |
parent | 8e4e1e5784fc476f25e2fa418773926d4df7a46a (diff) |
Move Term_queue_space() to z-term.c
This means we can avoid accessing "private" members of Term.
-rw-r--r-- | src/main-x11.c | 17 | ||||
-rw-r--r-- | src/z-term.c | 16 | ||||
-rw-r--r-- | src/z-term.h | 1 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/main-x11.c b/src/main-x11.c index 6117c840..effb67dc 100644 --- a/src/main-x11.c +++ b/src/main-x11.c @@ -529,23 +529,6 @@ int x_io_error_handler(Display *d) } /* - * Calculate how much space there is in the key queue for the current term. - */ -int Term_queue_space(void) -{ - /* Find the gap if the tail is before the head. */ - int space = Term->key_tail - Term->key_head; - - /* Otherwise, add in the extra for looping. */ - if (space <= 0) space = Term->key_size - space; - - /* The last space is never used as that would be interpreted as leaving - * no pending keypresses. */ - return space -1; -} - - -/* * Add a series of keypresses to the "queue". * * Return any errors generated by Term_keypress() in doing so, or SUCCESS diff --git a/src/z-term.c b/src/z-term.c index 3d5a4977..a936cae8 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -1508,6 +1508,22 @@ errr Term_inkey(char *ch, bool_ wait, bool_ take) } +/* + * Calculate how much space there is in the key queue for the current term. + */ +int Term_queue_space() +{ + /* Find the gap if the tail is before the head. */ + int space = Term->key_tail - Term->key_head; + + /* Otherwise, add in the extra for looping. */ + if (space <= 0) space = Term->key_size - space; + + /* The last space is never used as that would be interpreted as leaving + * no pending keypresses. */ + return space -1; +} + /*** Extra routines ***/ diff --git a/src/z-term.h b/src/z-term.h index 7690493c..69d31eee 100644 --- a/src/z-term.h +++ b/src/z-term.h @@ -223,6 +223,7 @@ errr Term_flush(); errr Term_keypress(int k); errr Term_key_push(int k); errr Term_inkey(char *ch, bool_ wait, bool_ take); +int Term_queue_space(); errr Term_save(void); term_win* Term_save_to(void); |