Source code for Xiaolin Wu's line algorithm in C?
Wikipedia has pseudo code.
Google has many examples like this one or this one. And your question reminded me this nice article on antialiasing.
EDIT: It's time to discover Hugo Helias's website if you don't know it already.