Explorar el Código

neercs: add some helper function for future keyboard input.

master
Sam Hocevar hace 12 años
padre
commit
8d9153bc1d
Se han modificado 2 ficheros con 13 adiciones y 0 borrados
  1. +10
    -0
      neercs/term/pty.cpp
  2. +3
    -0
      neercs/term/pty.h

+ 10
- 0
neercs/term/pty.cpp Ver fichero

@@ -180,6 +180,16 @@ void Pty::UnreadData(char *data, size_t len)
#endif
}

size_t Pty::WriteData(char const *data, size_t len)
{
#if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H
/* FIXME: can we be more naive than that? */
return write((int)m_fd, data, len);
#endif

return 0;
}

void Pty::SetWindowSize(ivec2 size, int64_t fd /* = -1 */)
{
#if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H


+ 3
- 0
neercs/term/pty.h Ver fichero

@@ -12,8 +12,11 @@ public:
~Pty();

void Run(char const *command, ivec2 size);

size_t ReadData(char *data, size_t maxlen);
void UnreadData(char *data, size_t len);
size_t WriteData(char const *data, size_t len);

void SetWindowSize(ivec2 size, int64_t fd = -1);

private:


Cargando…
Cancelar
Guardar