Making C library for write-rule --protocol struct