update ctype/ctype_digit: use ctype.h, rewrite simpler