Redis provides extensive C APIs for users to write a module. While Redis modules can be written in any language that has C binding functionalities, writing a Redis module in C language is the easiest and most straightforward method.
In this recipe, we are going to implement a Redis module, MYMODULE, in C language with a new command ZIP, which can be called as follows:
MYMODULE.ZIP destination_hash field_list value_list
The command takes two Redis lists and tries to create a Redis hash, whose fields are elements in field_list and corresponding values are elements of the same index in value_list.
For example, if field_list is ["john", "alex", "tom"] and value_list is ["20", "30", "40"], destination_hash will be {"john": "20", "alex": "30", "tom"...