Now that we understand the basic functionality of the web counter, it's time to move on to phase 2 of the project.
In this second phase, we're going to add (in order of increasing complexity):
Why these particular features, and not others? They're incremental, and they are more or less independent of each other, which means we can examine them one at a time, and understand what kind of impact they have on the code base. And, most of them are useful. :-)
The biggest modification is the ability to write() to the resource. What I mean by that is that we can set the counter's value by writing a value to it:
# echo 1234 >/dev/webcounter.gif
This will reset the counter value to 1234.
This modification will illustrate some aspects of accumulating data from a client's write() function, and then seeing how this data needs to be processed in order to interact correctly with the resource manager. We'll also look at extending this functionality later.
All of the modifications take place within main.c (with the exception of the font-selection modification, which also adds two new files, 8x8.c and 8x8.h).