restructured the read-rules.c code

#Modifications:
1. removed useless argument from `print_match()`
2. All structure definitions to the top
3. Changed the code layout, added proper indentation where required.