Merge pull request #37 from mway/feature/annotation

Merged @mway++ 's feature/annotation branch.
simplify the statement: use Z_STRVAL_PP directly
remove unused variables
extract variable declaration to parent scope
Fix miss use
strncpy() -> estrndup()