Add command execution runtime (lcmd.c, lcmd.h)

Implements luaB_command: fork/execvp with pipe-captured stdout/stderr,
argv parsing with quoting/escaping, and non-blocking pipe reading via
select(). Backs the __command() calls emitted by the backtick parser.

Resolves #03 and #04.
This commit is contained in:
Cormac Shannon
2026-02-28 18:27:42 +00:00
parent 882a90be48
commit 39d6cc95cb
2 changed files with 354 additions and 0 deletions

14
lcmd.h Normal file
View File

@@ -0,0 +1,14 @@
/*
** $Id: lcmd.h $
** Command execution for backtick syntax
** See Copyright Notice in lua.h
*/
#ifndef lcmd_h
#define lcmd_h
#include "lua.h"
int luaB_command (lua_State *L);
#endif