Start of stubs that replicate the original c source