rename error_t to err_t to avoid conflict with standard C's error type