Generic Circular Buffer In C