C version of SEG-D to Database conversion