C Rules Engine Pattern Recognition