add prototype declaration
add default value about PLUGIN_XXX
remove duplicated packing