extern C block

Patch as supplied by Brian C. Becker <Brian@BrianCBecker.com> in #47 reconverted into a git commit.