Also include a few missing prototypes, which could possibly fix bugs.
This contains partial code for displaying the cursor locally.