restructure read_char quit handling
authorBT Templeton <bt@hcoop.net>
Fri, 5 Jul 2013 02:12:09 +0000 (22:12 -0400)
committerRobin Templeton <robin@terpri.org>
Sat, 18 Apr 2015 22:49:10 +0000 (18:49 -0400)
commit1aff0bcac42916c7f86227e1a863a55042df195e
tree6e64a6c209af83e1e33f3fb3ea7654904e320ed7
parent1ce6f8a934489dab4e1d1aa880f2219409ab0fd4
restructure read_char quit handling

Move initialization and quit handling to a separate function to simplify
the conversion to Guile control flow facilities.

* src/keyboard.c (struct read_char_state): New data type.

  (read_char): Move most of this function to `read_char_1'. Initialize a
  state structure and a `longjmp' point for quits, then call
  `read_char_1'.

  (read_char_1): New function.

  (save_getcjmp, restore_getcjmp): Take a pointer to a `jmp_buf' as an
  argument. All callers changed.
src/keyboard.c