Written for and tested on DJGPP under DOS and gcc under Linux. Programs that use this interface behave identically under both platforms. Small enough to bundle with your own source (about 100k source with comments, compiled lib size about 50k).
CTIO provides:
Note: CTIO does not provide an interface to console windows running within X windows (eg. Xterm). It is designed for producing a text editor and widgets suitable for the console, for people with cheap PCs too slow to run X.
The purpose of the library
The purpose of CTIO is to assist in the production of a text editor for the Linux console. There are plenty of easy-to-use editors for DOS, but not Linux. I believe it is because screen output and mouse/keyboard input is so complicated at the Linux console, that no decent console editors exist, with mouse selection, mouseable menus etc.
I wanted to write my own editor, so I tried Slang and ncurses. I found them both difficult to learn and limited in a couple of annoying, little ways. I decided to write my own interface library, to be what I always wished for as a programmer: something smaller and simpler than Slang or ncurses, that required little learning and overcame the limitations suffered under those two libraries.
And I believe I have done that. Unlike Slang and ncurses, CTIO enables shift-PageDown, represents the screen as a flat array and reports shift state and mouse movement. I have covered over the complexity and made access to the mouse, keyboard and screen as simple under Linux as it ever was under DOS. I have spread comments liberally over the source in case you want to hack it, written a full set of instructions and provided three demo programs.
Are you a C/C++ programmer looking for a project? The Linux console really needs a mouse-sensitive editor with normal menus. See my inspiring page on the subject for a stirring pep-talk.
Download the latest version (2.00)
(The same source is provided in different formats for your convenience.)
Versions
The latest version is version 2.00. It is backwardly compatable, so programs written for previous versions will still work.
Version 2.0
Changes in version 2.0: (17th March 2003)
Version 1.01
Changes in version 1.01: (13th March 2003)
Version 1.0
Changes in version 1.0: (5th March 2003)
Note: I apologize to anyone who downloaded version 1 between March 5th and March 8th, 2003. There was a bug in it which prevented the DOS version from compiling. Sorry, but with limited access to a computer, I was rushed.
Read the story of My Struggle to write CTIO: here
Use the guestbook to communicate with other visitors to this page, mention anything you have made with CTIO or report bugs you have found.