added C code using struct for weapon type - just to do something in C.