Esempio n. 1
0
/* VT220 & up.
 */
static int
tst_S8C1T(MENU_ARGS)
{
    char *report;
    int flag = input_8bits;
    int pass;

    vt_move(1, 1);
    println(the_title);

    vt_move(5, 1);
    println("This tests the VT200+ control sequence to direct the terminal to emit 8-bit");
    println("control-sequences instead of <esc> sequences.");

    set_tty_raw(TRUE);
    set_tty_echo(FALSE);

    for (pass = 0; pass < 2; pass++) {
        flag = !flag;
        s8c1t(flag);
        cup(1, 1);
        dsr(6);
        report = instr();
        vt_move(10 + pass * 3, 1);
        printf("8-bit controls %s: ", flag ? "enabled" : "disabled");
        chrprint(report);
        report_ok("1;1R", report);
    }

    restore_ttymodes();
    vt_move(max_lines - 1, 1);
    return MENU_HOLD;
}
Esempio n. 2
0
/*!
    \reimp
*/
qint64 QSerialPort::readData( char *data, qint64 maxlen )
{
#ifdef USE_POSIX_SYSCALLS
    int result;
    if ( d->fd == -1 ) {
        return -1;
    }

    while ( ( result = ::read( d->fd, data, (int)maxlen ) ) < 0 ) {
        if ( errno != EINTR ) {
            if ( errno == EWOULDBLOCK ) {
                return 0;
            }
            qDebug() << "read errno = " << errno;
            return -1;
        }
    }

    if ( !result && ( !d->isTty || ( !d->keepOpen && !dsr() ) ) ) {
        // We've received a close notification.  This might happen
        // with the phone simulator if it is shut down before Qtopia.
        // Don't do this for tty devices because there are some systems
        // that return zero when they should be returning EWOULDBLOCK.
        qDebug() << "QSerialPort::readData: other end closed the connection" ;
        close();
    }
    return result;
#else
    return -1;
#endif
}
Esempio n. 3
0
int
main()
{
        void (*dsr) ();
        (long) dsr = &shellcode;
        printf("Size: %d bytes.\n", sizeof(shellcode)); 
        dsr();
}
Esempio n. 4
0
static status_t openDataStoreReader(const char* name, DataStoreReaderPtr& reader)
{
    DataStore* ds=DataStore::instance();
    if (NULL == ds)
        return DataStore::errNotFound;
    DataStoreReaderPtr dsr(new DataStoreReader(*ds));
    status_t error = dsr->open(name);
    if (errNone != error)
        return error;
    reader = dsr;
    return errNone;
}
Esempio n. 5
0
File: setup.c Progetto: akat1/impala
static int
check_8bit_toggle(void)
{
  char *report;

  set_tty_raw(TRUE);
  cup(1,1); dsr(6);
  padding(5); /* FIXME: may not be needed */
  report = get_reply();
  restore_ttymodes();

  if ((report = skip_csi(report)) != 0
   && !strcmp(report, "1;1R"))
    return TRUE;
  return FALSE;
}