Skip to content

Instantly share code, notes, and snippets.

@lf94
Created November 8, 2016 00:07
Show Gist options
  • Select an option

  • Save lf94/4c167771aacd971d51323e882e62a80e to your computer and use it in GitHub Desktop.

Select an option

Save lf94/4c167771aacd971d51323e882e62a80e to your computer and use it in GitHub Desktop.
The main character insert routine comments from Opus\wordtech\insert.c
The programmer bryanl left some real nice comments in the source code. I bet he never expected it to be looked at years later. I've added some commentary myself too.
Line 412:
When a character is typed, it is inserted at rgchInsert[ichInsert++].
When rgchInsert is full, it is written to the scratch file, and Replace'd
with a new insertion block.
Line 222:
fc = FcAppendRgchToFn(fnScratch, rgchInsert, ichInsert);
rgchInsert - rg(?) Character Insert. This is a char[].
ichInsert - Index Character Insert. This is an int.
fnScratch - File Number Scratch (The "scratch" file, a.k.a. a buffer)
FcAppendRgchToFn appends rgchInsert text at the ichInsert position, in the fnScratch buffer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment