Learn C Programming

Lesson 3 of 8 · Undefined Behaviour, Debugging and Reading Real C

Module 16 · Undefined Behaviour, Debugging and Reading Real C

Reading Real C: a Walk Through Code From SQLite

ProReading

Amara wants to know how a real database compares names. In SQL, SELECT and select are the same word. So she downloads SQLite, the database inside your phone and your browser (Module 0 lesson 5). Its src folder holds 125 .c files, about 209,000 lines.

Checking what this lesson needs for you…

What is inside Reading Real C: a Walk Through Code From SQLite

  1. Four steps, always in this order
  2. Fetching the code, and pinning the version
  3. Step 1: the header comment is the contract
  4. Step 2: the types say what goes in and out
  5. Step 3: one function and its callers
  6. Step 4: the body, read last
  7. The second walk: strncasecmp in the Linux kernel
  8. Finding your way in a big tree
  9. Licences: whose code you are reading