let output_string output = 
  match output with
    | Channel cout -> Pervasives.output_string cout
    | Buffer b -> Buffer.add_string b