move some codes to `zutil.c`
add enum type for zopt