Sfoglia il codice sorgente

neercs: add some helper function for future keyboard input.

master
Sam Hocevar 12 anni fa
parent
commit
8d9153bc1d
2 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. +10
    -0
      neercs/term/pty.cpp
  2. +3
    -0
      neercs/term/pty.h

+ 10
- 0
neercs/term/pty.cpp Vedi File

@@ -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 Vedi File

@@ -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:


Caricamento…
Annulla
Salva