msh.c
来自「为samsung2410 ARM移植的busybox工具包」· C语言 代码 · 共 2,740 行 · 第 1/5 页
C
2,740 行
/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */#define TPIPE 3 /* a | b */#define TLIST 4 /* a [&;] b */#define TOR 5 /* || */#define TAND 6 /* && */#define TFOR 7#define TDO 8#define TCASE lues returned by wait */#define WAITSIG(s) ((s)&0177)#define WAITVAL(s) (((s)>>8)&0377)#define WAITCORE(s) (((s)&0200)!=0)/* * library and system defintions */typedef void xint; /* base type of jmp_buf, for not broken compilers *//* * shell components */#define QUOTE 0200#define NOBLOCK ((struct op *)NULL)#define NOWORD ((char *)NULL)#define NOWORDS ((char **)NULL)#define NOPIPE ((int *)NULL)/* * Description of a command or an operation on commands. * Might eventually use a union. */struct op { int type; /* operation type, see below */ char **words; /* arguments to a command */ struct ioword **ioact; /* IO actions (eg, < > >>) */ struct op *left; struct op *right; char *str; /* identifier for case and for */};#define TCOM 1 /* command */#define TPAREN 2 /* (c-list) */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?