예제 #1
0
파일: job.c 프로젝트: Saneyan/neovim
bool job_write(int id, char *data, uint32_t len)
{
  Job *job = find_job(id);

  if (job == NULL || job->stopped) {
    free(data);
    return false;
  }

  if (!wstream_write(job->in, data, len, true)) {
    job_stop(job->id);
    return false;
  }

  return true;
}
예제 #2
0
파일: job.c 프로젝트: HalcyonChimera/neovim
/// Writes data to the job's stdin. This is a non-blocking operation, it
/// returns when the write request was sent.
///
/// @param job The Job instance
/// @param buffer The buffer which contains the data to be written
/// @return true if the write request was successfully sent, false if writing
///         to the job stream failed (possibly because the OS buffer is full)
bool job_write(Job *job, WBuffer *buffer)
{
  return wstream_write(job->in, buffer);
}