Modified the Lua API timeout argument specification to be an extension of the v3.9 specification

Fix the v3.9-incompatible changes in 8e02cde ("Lua API Timeout
Specification Changes to Enable Non-Blocking Reads", November 15, 2025)
to make them compatible.

The timeout arguments for tio.expect/s(), tio.read(), and tio.readline()
have been changed as follows:
- The timeout is in milliseconds, and the default is 0, which means to
wait forever (as in v3.9).
- A negative value means to nowait.

A constant table (tio.C) has also been added,
defining tio.C.FOREVER to 0 and tio.C.NOWAIT to -1.
This commit is contained in:
yabu76 2026-02-01 11:56:29 +09:00
parent 0da8731c0b
commit c009ed755c
3 changed files with 33 additions and 11 deletions

View file

@ -24,7 +24,8 @@
#include <stdbool.h>
#include <stdio.h>
#define WRITE_POLL_FOREVER (-1)
#define POLL_NOWAIT (0)
#define POLL_FOREVER (-1)
#define UNUSED(expr) do { (void)(expr); } while (0)
void delay(long ms);