[Context] I'm developing a little app, as a hobby to learn ncurses, that catalogs and lists and searches within a set of documents (for now, they are the HOWTOs from TLDP).
The most tricky part of the app is, I believe, the file reader (show the contents of a file nicely). To really be able to provide a good enough user experience, given that the HOWTOs are somewhat long, it would be a valuable feature if I can "save" the line where the user stopped reading, and start on that same line the next time the user opens up that same HOWTO [/context]
So to the real question: is there a command-line reader that can not only get a line X as a parameter and position the cursor at that line, but also tell me the line that was last shown? I understand that an app can't "return" that value, given that returns are either 0 or an ERROR#, so maybe some kind of system variable or shared memory or... ?
Given that I'll be doing the call from a C app, maybe a different solution that's not an external app will also serve me just right, I'm open to suggestions.