code: def errdev(op, lenout, device):
      
      lenout = ctypes.c_int(lenout)
      op = stypes.stringToCharP(op)
      device = ctypes.create_string_buffer(str.encode(device), lenout.value)
      deviceptr = ctypes.c_char_p(ctypes.addressof(device))
      libspice.errdev_c(op, lenout, deviceptr)
      return stypes.toPythonString(deviceptr)
docs: Retrieve or set the name of the current output device for error messages.
  
      http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/errdev_c.html
  
      :param op: The operation, "GET" or "SET".
      :type op: str
      :param lenout: Length of device for output.
      :type lenout: int
      :param device: The device name.
      :type device: str
      :return: The device name.
      :rtype: str