Doxygenate and style dsm.c

One file a day... this'll take a while!