prototype .c logic loop