mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
3d2d04b25e
This lets our system() and popen() commands function sort of like BusyBox and ToyBox. By default the Cosmopolitan Shell is lightweight. But if you use STATIC_YOINK then you can pull the individual commands you want into the linkage, and they'll be included in a single binary. For example the demo binary embeds `tr` and `sed` and ends up ~140kb.
24 lines
790 B
C
24 lines
790 B
C
#ifndef COSMOPOLITAN_THIRD_PARTY_TR_EXTERN_H_
|
|
#define COSMOPOLITAN_THIRD_PARTY_TR_EXTERN_H_
|
|
#include "libc/limits.h"
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
COSMOPOLITAN_C_START_
|
|
|
|
typedef struct {
|
|
enum { STRING1, STRING2 } which;
|
|
enum { EOS, INFINITE, NORMAL, RANGE, SEQUENCE, SET } state;
|
|
int cnt; /* character count */
|
|
int lastch; /* last character */
|
|
int equiv[2]; /* equivalence set */
|
|
int *set; /* set of characters */
|
|
unsigned char *str; /* user's string */
|
|
} STR;
|
|
|
|
#define NCHARS (UCHAR_MAX + 1) /* Number of possible characters. */
|
|
#define OOBCH (UCHAR_MAX + 1) /* Out of band character value. */
|
|
|
|
int next(STR *);
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_THIRD_PARTY_TR_EXTERN_H_ */
|