knfing encode.h

ok deoliveira
knfing encode.c

some other polishing with pointers, removing of an uggly define.

ok deoliveira