def MakeSingleLineProtos(lines):
  """move function prototypes into single lines for easier post processing
  """
  result = []
  # we use the presence of the newline in  result[-1] as an indicator
  # whether we should append to that line or start a new one
  for line in lines:
    if line.endswith(",\n") or line.endswith("(\n"):
      line = line.rstrip()
    if not result or result[-1].endswith("\n"):
      result.append(line)
    else:
      result[-1] = result[-1] + line.lstrip()
  return result