Defining the Interval Set
With the majority of the supporting tie-in code written, we can turn our focus on the actual data structure and the functions that respond to the external commands. First, we should add our command functions to the command table at line 115 of src/redis.c.- {"iadd",iaddCommand,-5,"wm",0,NULL,1,1,1,0,0},
- {"irem",iremCommand,-3,"w",0,NULL,1,1,1,0,0},
- {"irembystab",irembystabCommand,3,"w",0,NULL,1,1,1,0,0},
- {"istab",istabCommand,-3,"r",0,NULL,1,1,1,0,0},
复制代码 We’ll define that AVL management functions as well as the four above functions in src/t_iset.c, a new module we create to hold just our custom datatype. |