How might you implement that in C?