Conform to c99 standards.
Typedef status codes, use regular ints where appropriate.