亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hush.c

?? 嵌入式試驗箱S3C2410的bootloader源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* vi: set sw=4 ts=4: *//* * sh.c -- a prototype Bourne shell grammar parser *      Intended to follow the original Thompson and Ritchie *      "small and simple is beautiful" philosophy, which *      incidentally is a good match to today's BusyBox. * * Copyright (C) 2000,2001  Larry Doolittle  <larry@doolittle.boa.org> * * Credits: *      The parser routines proper are all original material, first *      written Dec 2000 and Jan 2001 by Larry Doolittle. *      The execution engine, the builtins, and much of the underlying *      support has been adapted from busybox-0.49pre's lash, *      which is Copyright (C) 2000 by Lineo, Inc., and *      written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>. *      That, in turn, is based in part on ladsh.c, by Michael K. Johnson and *      Erik W. Troan, which they placed in the public domain.  I don't know *      how much of the Johnson/Troan code has survived the repeated rewrites. * Other credits: *      simple_itoa() was lifted from boa-0.93.15 *      b_addchr() derived from similar w_addchar function in glibc-2.2 *      setup_redirect(), redirect_opt_num(), and big chunks of main() *        and many builtins derived from contributions by Erik Andersen *      miscellaneous bugfixes from Matt Kraai * * There are two big (and related) architecture differences between * this parser and the lash parser.  One is that this version is * actually designed from the ground up to understand nearly all * of the Bourne grammar.  The second, consequential change is that * the parser and input reader have been turned inside out.  Now, * the parser is in control, and asks for input as needed.  The old * way had the input reader in control, and it asked for parsing to * take place as needed.  The new way makes it much easier to properly * handle the recursion implicit in the various substitutions, especially * across continuation lines. * * Bash grammar not implemented: (how many of these were in original sh?) *      $@ (those sure look like weird quoting rules) *      $_ *      ! negation operator for pipes *      &> and >& redirection of stdout+stderr *      Brace Expansion *      Tilde Expansion *      fancy forms of Parameter Expansion *      aliases *      Arithmetic Expansion *      <(list) and >(list) Process Substitution *      reserved words: case, esac, select, function *      Here Documents ( << word ) *      Functions * Major bugs: *      job handling woefully incomplete and buggy *      reserved word execution woefully incomplete and buggy * to-do: *      port selected bugfixes from post-0.49 busybox lash - done? *      finish implementing reserved words: for, while, until, do, done *      change { and } from special chars to reserved words *      builtins: break, continue, eval, return, set, trap, ulimit *      test magic exec *      handle children going into background *      clean up recognition of null pipes *      check setting of global_argc and global_argv *      control-C handling, probably with longjmp *      follow IFS rules more precisely, including update semantics *      figure out what to do with backslash-newline *      explain why we use signal instead of sigaction *      propagate syntax errors, die on resource errors? *      continuation lines, both explicit and implicit - done? *      memory leak finding and plugging - done? *      more testing, especially quoting rules and redirection *      document how quoting rules not precisely followed for variable assignments *      maybe change map[] to use 2-bit entries *      (eventually) remove all the printf's * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#define __U_BOOT__#ifdef __U_BOOT__#include <malloc.h>         /* malloc, free, realloc*/#include <linux/ctype.h>    /* isalpha, isdigit */#include <common.h>        /* readline */#include <hush.h>#include <command.h>        /* find_cmd *//*cmd_boot.c*/extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);      /* do_bootd */#endif#ifdef CFG_HUSH_PARSER#ifndef __U_BOOT__#include <ctype.h>     /* isalpha, isdigit */#include <unistd.h>    /* getpid */#include <stdlib.h>    /* getenv, atoi */#include <string.h>    /* strchr */#include <stdio.h>     /* popen etc. */#include <glob.h>      /* glob, of course */#include <stdarg.h>    /* va_list */#include <errno.h>#include <fcntl.h>#include <getopt.h>    /* should be pretty obvious */#include <sys/stat.h>  /* ulimit */#include <sys/types.h>#include <sys/wait.h>#include <signal.h>/* #include <dmalloc.h> *//* #define DEBUG_SHELL */#if 1#include "busybox.h"#include "cmdedit.h"#else#define applet_name "hush"#include "standalone.h"#define hush_main main#undef CONFIG_FEATURE_SH_FANCY_PROMPT#define BB_BANNER#endif#endif#define SPECIAL_VAR_SYMBOL 03#ifndef __U_BOOT__#define FLAG_EXIT_FROM_LOOP 1#define FLAG_PARSE_SEMICOLON (1 << 1)		/* symbol ';' is special for parser */#define FLAG_REPARSING       (1 << 2)		/* >= 2nd pass */#endif#ifdef __U_BOOT__DECLARE_GLOBAL_DATA_PTR;#define EXIT_SUCCESS 0#define EOF -1#define syntax() syntax_err()#define xstrdup strdup#define error_msg printf#elsetypedef enum {	REDIRECT_INPUT     = 1,	REDIRECT_OVERWRITE = 2,	REDIRECT_APPEND    = 3,	REDIRECT_HEREIS    = 4,	REDIRECT_IO        = 5} redir_type;/* The descrip member of this structure is only used to make debugging * output pretty */struct {int mode; int default_fd; char *descrip;} redir_table[] = {	{ 0,                         0, "()" },	{ O_RDONLY,                  0, "<"  },	{ O_CREAT|O_TRUNC|O_WRONLY,  1, ">"  },	{ O_CREAT|O_APPEND|O_WRONLY, 1, ">>" },	{ O_RDONLY,                 -1, "<<" },	{ O_RDWR,                    1, "<>" }};#endiftypedef enum {	PIPE_SEQ = 1,	PIPE_AND = 2,	PIPE_OR  = 3,	PIPE_BG  = 4,} pipe_style;/* might eventually control execution */typedef enum {	RES_NONE  = 0,	RES_IF    = 1,	RES_THEN  = 2,	RES_ELIF  = 3,	RES_ELSE  = 4,	RES_FI    = 5,	RES_FOR   = 6,	RES_WHILE = 7,	RES_UNTIL = 8,	RES_DO    = 9,	RES_DONE  = 10,	RES_XXXX  = 11,	RES_IN    = 12,	RES_SNTX  = 13} reserved_style;#define FLAG_END   (1<<RES_NONE)#define FLAG_IF    (1<<RES_IF)#define FLAG_THEN  (1<<RES_THEN)#define FLAG_ELIF  (1<<RES_ELIF)#define FLAG_ELSE  (1<<RES_ELSE)#define FLAG_FI    (1<<RES_FI)#define FLAG_FOR   (1<<RES_FOR)#define FLAG_WHILE (1<<RES_WHILE)#define FLAG_UNTIL (1<<RES_UNTIL)#define FLAG_DO    (1<<RES_DO)#define FLAG_DONE  (1<<RES_DONE)#define FLAG_IN    (1<<RES_IN)#define FLAG_START (1<<RES_XXXX)/* This holds pointers to the various results of parsing */struct p_context {	struct child_prog *child;	struct pipe *list_head;	struct pipe *pipe;#ifndef __U_BOOT__	struct redir_struct *pending_redirect;#endif	reserved_style w;	int old_flag;				/* for figuring out valid reserved words */	struct p_context *stack;	int type;			/* define type of parser : ";$" common or special symbol */	/* How about quoting status? */};#ifndef __U_BOOT__struct redir_struct {	redir_type type;			/* type of redirection */	int fd;						/* file descriptor being redirected */	int dup;					/* -1, or file descriptor being duplicated */	struct redir_struct *next;	/* pointer to the next redirect in the list */	glob_t word;				/* *word.gl_pathv is the filename */};#endifstruct child_prog {#ifndef __U_BOOT__	pid_t pid;					/* 0 if exited */#endif	char **argv;				/* program name and arguments */#ifdef __U_BOOT__	int    argc;                            /* number of program arguments */#endif	struct pipe *group;			/* if non-NULL, first in group or subshell */#ifndef __U_BOOT__	int subshell;				/* flag, non-zero if group must be forked */	struct redir_struct *redirects;	/* I/O redirections */	glob_t glob_result;			/* result of parameter globbing */	int is_stopped;				/* is the program currently running? */	struct pipe *family;		/* pointer back to the child's parent pipe */#endif	int sp;				/* number of SPECIAL_VAR_SYMBOL */	int type;};struct pipe {#ifndef __U_BOOT__	int jobid;					/* job number */#endif	int num_progs;				/* total number of programs in job */#ifndef __U_BOOT__	int running_progs;			/* number of programs running */	char *text;					/* name of job */	char *cmdbuf;				/* buffer various argv's point into */	pid_t pgrp;					/* process group ID for the job */#endif	struct child_prog *progs;	/* array of commands in pipe */	struct pipe *next;			/* to track background commands */#ifndef __U_BOOT__	int stopped_progs;			/* number of programs alive, but stopped */	int job_context;			/* bitmask defining current context */#endif	pipe_style followup;		/* PIPE_BG, PIPE_SEQ, PIPE_OR, PIPE_AND */	reserved_style r_mode;		/* supports if, for, while, until */};#ifndef __U_BOOT__struct close_me {	int fd;	struct close_me *next;};#endifstruct variables {	char *name;	char *value;	int flg_export;	int flg_read_only;	struct variables *next;};/* globals, connect us to the outside world * the first three support $?, $#, and $1 */#ifndef __U_BOOT__char **global_argv;unsigned int global_argc;#endifunsigned int last_return_code;int nesting_level;#ifndef __U_BOOT__extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */#endif/* "globals" within this file */static uchar *ifs;static char map[256];#ifndef __U_BOOT__static int fake_mode;static int interactive;static struct close_me *close_me_head;static const char *cwd;static struct pipe *job_list;static unsigned int last_bg_pid;static unsigned int last_jobid;static unsigned int shell_terminal;static char *PS1;static char *PS2;struct variables shell_ver = { "HUSH_VERSION", "0.01", 1, 1, 0 };struct variables *top_vars = &shell_ver;#elsestatic int flag_repeat = 0;static int do_repeat = 0;static struct variables *top_vars = NULL ;#endif /*__U_BOOT__ */#define B_CHUNK (100)#define B_NOSPAC 1typedef struct {	char *data;	int length;	int maxlen;	int quote;	int nonnull;} o_string;#define NULL_O_STRING {NULL,0,0,0,0}/* used for initialization:	o_string foo = NULL_O_STRING; *//* I can almost use ordinary FILE *.  Is open_memstream() universally * available?  Where is it documented? */struct in_str {	const char *p;#ifndef __U_BOOT__	char peek_buf[2];#endif	int __promptme;	int promptmode;#ifndef __U_BOOT__	FILE *file;#endif	int (*get) (struct in_str *);	int (*peek) (struct in_str *);};#define b_getch(input) ((input)->get(input))#define b_peek(input) ((input)->peek(input))#ifndef __U_BOOT__#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"struct built_in_command {	char *cmd;					/* name */	char *descr;				/* description */	int (*function) (struct child_prog *);	/* function ptr */};#endif/* This should be in utility.c */#ifdef DEBUG_SHELL#ifndef __U_BOOT__static void debug_printf(const char *format, ...){	va_list args;	va_start(args, format);	vfprintf(stderr, format, args);	va_end(args);}#else#define debug_printf printf             /* U-Boot debug flag */#endif#elsestatic inline void debug_printf(const char *format, ...) { }#endif#define final_printf debug_printf#ifdef __U_BOOT__static void syntax_err(void) {	 printf("syntax error\n");}#elsestatic void __syntax(char *file, int line) {	error_msg("syntax error %s:%d", file, line);}#define syntax() __syntax(__FILE__, __LINE__)#endif#ifdef __U_BOOT__static void *xmalloc(size_t size);static void *xrealloc(void *ptr, size_t size);#else/* Index of subroutines: *//*   function prototypes for builtins */static int builtin_cd(struct child_prog *child);static int builtin_env(struct child_prog *child);static int builtin_eval(struct child_prog *child);static int builtin_exec(struct child_prog *child);static int builtin_exit(struct child_prog *child);static int builtin_export(struct child_prog *child);static int builtin_fg_bg(struct child_prog *child);static int builtin_help(struct child_prog *child);static int builtin_jobs(struct child_prog *child);static int builtin_pwd(struct child_prog *child);static int builtin_read(struct child_prog *child);static int builtin_set(struct child_prog *child);static int builtin_shift(struct child_prog *child);static int builtin_source(struct child_prog *child);static int builtin_umask(struct child_prog *child);static int builtin_unset(struct child_prog *child);static int builtin_not_written(struct child_prog *child);#endif/*   o_string manipulation: */static int b_check_space(o_string *o, int len);static int b_addchr(o_string *o, int ch);static void b_reset(o_string *o);static int b_addqchr(o_string *o, int ch, int quote);#ifndef __U_BOOT__static int b_adduint(o_string *o, unsigned int i);#endif/*  in_str manipulations: */static int static_get(struct in_str *i);static int static_peek(struct in_str *i);static int file_get(struct in_str *i);static int file_peek(struct in_str *i);#ifndef __U_BOOT__static void setup_file_in_str(struct in_str *i, FILE *f);#elsestatic void setup_file_in_str(struct in_str *i);#endifstatic void setup_string_in_str(struct in_str *i, const char *s);#ifndef __U_BOOT__/*  close_me manipulations: */static void mark_open(int fd);static void mark_closed(int fd);static void close_all(void);#endif/*  "run" the final data structures: */static char *indenter(int i);static int free_pipe_list(struct pipe *head, int indent);static int free_pipe(struct pipe *pi, int indent);/*  really run the final data structures: */#ifndef __U_BOOT__static int setup_redirects(struct child_prog *prog, int squirrel[]);#endifstatic int run_list_real(struct pipe *pi);#ifndef __U_BOOT__static void pseudo_exec(struct child_prog *child) __attribute__ ((noreturn));#endifstatic int run_pipe_real(struct pipe *pi);/*   extended glob support: */#ifndef __U_BOOT__static int globhack(const char *src, int flags, glob_t *pglob);static int glob_needed(const char *s);static int xglob(o_string *dest, int flags, glob_t *pglob);#endif/*   variable assignment: */static int is_assignment(const char *s);/*   data structure manipulation: */#ifndef __U_BOOT__static int setup_redirect(struct p_context *ctx, int fd, redir_type style, struct in_str *input);#endifstatic void initialize_context(struct p_context *ctx);static int done_word(o_string *dest, struct p_context *ctx);static int done_command(struct p_context *ctx);static int done_pipe(struct p_context *ctx, pipe_style type);/*   primary string parsing: */#ifndef __U_BOOT__static int redirect_dup_num(struct in_str *input);static int redirect_opt_num(o_string *o);static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int subst_end);static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch);#endifstatic char *lookup_param(char *src);static char *make_string(char **inp);static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input);#ifndef __U_BOOT__static int parse_string(o_string *dest, struct p_context *ctx, const char *src);#endifstatic int parse_stream(o_string *dest, struct p_context *ctx, struct in_str *input0, int end_trigger);/*   setup: */static int parse_stream_outer(struct in_str *inp, int flag);#ifndef __U_BOOT__static int parse_string_outer(const char *s, int flag);static int parse_file_outer(FILE *f);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久99久久| 午夜电影网一区| 婷婷综合另类小说色区| 97se亚洲国产综合在线| 久久久www免费人成精品| 亚洲天堂免费看| 国产精品香蕉一区二区三区| 色噜噜狠狠成人中文综合| 一区二区欧美精品| 欧美乱熟臀69xxxxxx| 久久aⅴ国产欧美74aaa| 久久久精品tv| 日本韩国欧美国产| 免费观看在线综合| 国产亲近乱来精品视频| 91麻豆国产在线观看| 天天爽夜夜爽夜夜爽精品视频| 日韩欧美国产一二三区| 成人精品一区二区三区四区 | 三级在线观看一区二区| 精品精品欲导航| 色综合久久久久久久久久久| 欧美aaa在线| 伊人性伊人情综合网| 精品国产乱码久久久久久久| 一本色道a无线码一区v| 精品亚洲成a人| 亚洲成人精品影院| 亚洲国产精品精华液ab| 欧美一区二区国产| 91亚洲精品久久久蜜桃| 美女视频网站久久| 偷拍日韩校园综合在线| 专区另类欧美日韩| 精品国偷自产国产一区| 欧美一区三区二区| 91搞黄在线观看| 91网站最新网址| 懂色av一区二区三区免费观看 | 亚洲综合免费观看高清完整版 | 久久综合九色综合97婷婷| 欧美日韩高清一区二区| 色国产精品一区在线观看| www.在线成人| 99国产精品久久| 972aa.com艺术欧美| 成人动漫视频在线| 大陆成人av片| 成人激情图片网| 在线亚洲一区观看| 欧美视频一区在线| 欧美日韩不卡在线| 日韩三级免费观看| 欧美精品一区二区在线播放| 国产一区在线视频| 欧美最猛性xxxxx直播| 国内久久婷婷综合| 奇米一区二区三区av| 亚洲777理论| 日韩精品视频网| 国产精一品亚洲二区在线视频| 美女视频网站黄色亚洲| 蜜臀av一区二区三区| 九色porny丨国产精品| 国产在线一区观看| 99久久久久免费精品国产| 国产91在线|亚洲| 91视频一区二区三区| 欧美日本国产一区| 久久综合狠狠综合久久激情| 亚洲国产成人在线| 日韩成人一区二区三区在线观看| 韩国av一区二区三区四区| 波多野结衣在线aⅴ中文字幕不卡| 99国内精品久久| 欧美精选一区二区| 亚洲国产成人私人影院tom| 亚洲一区中文日韩| 蜜臀精品久久久久久蜜臀| 成人a级免费电影| 在线成人午夜影院| 亚洲精品成人a在线观看| 久久成人av少妇免费| 欧美三级中文字幕| 国产精品乱码人人做人人爱| 午夜av一区二区三区| av成人动漫在线观看| 日韩一卡二卡三卡| 亚洲精品国产无天堂网2021| 国产美女精品人人做人人爽| 91麻豆精品国产91久久久| 亚洲激情男女视频| 国产高清一区日本| 久久一夜天堂av一区二区三区| 亚洲国产成人91porn| 欧美色图片你懂的| 一区二区三区中文字幕电影| 色综合天天性综合| 国产精品免费av| 国产91对白在线观看九色| 国产日韩亚洲欧美综合| 国产麻豆视频精品| 久久久久久久久99精品| 国产精品一卡二卡在线观看| 久久美女高清视频| 成人免费高清在线| 国产日韩综合av| 91免费国产在线观看| 亚洲精品视频观看| 欧美乱熟臀69xxxxxx| 裸体在线国模精品偷拍| 亚洲精品在线三区| 波多野结衣亚洲一区| 婷婷国产在线综合| 欧美一区二区三区视频免费| 久久精品国产亚洲aⅴ| 久久日韩精品一区二区五区| 91小视频免费观看| 亚洲国产色一区| 日韩欧美的一区二区| 99视频一区二区| 日本成人在线一区| 国产视频视频一区| 欧美美女激情18p| 成人妖精视频yjsp地址| 五月激情综合色| 国产精品无人区| 欧美精品久久天天躁| av在线不卡网| 国产一区二区三区香蕉| 亚洲高清免费观看| 中文字幕精品一区二区三区精品| 欧美日韩国产经典色站一区二区三区 | 蜜臀av一区二区| 午夜精品免费在线观看| 亚洲欧洲日韩av| 国产欧美一区二区三区网站| 91精品国产色综合久久不卡电影| 国产不卡高清在线观看视频| 久久精品999| 午夜在线成人av| 亚洲综合在线免费观看| 国产精品无遮挡| 久久先锋资源网| 久久久国际精品| 久久久久久久久久久久久夜| 欧美大片拔萝卜| 精品日韩一区二区三区免费视频| 欧美一区二区精品久久911| 欧美另类z0zxhd电影| 日韩午夜激情电影| 在线观看不卡一区| 欧美精选在线播放| 精品人在线二区三区| 久久综合色婷婷| 久久只精品国产| 亚洲视频在线一区| 日本少妇一区二区| 国内精品嫩模私拍在线| 国产成a人亚洲精| 色噜噜狠狠色综合欧洲selulu| 制服丝袜成人动漫| 2024国产精品| 国产精品丝袜久久久久久app| 一区在线中文字幕| 免费成人美女在线观看.| 成人性生交大片| 欧美色视频在线观看| 日韩视频一区二区| 亚洲欧美一区二区在线观看| 蜜桃av噜噜一区二区三区小说| 日本欧美一区二区在线观看| 国产精品伊人色| 日韩精品一区二区三区三区免费| 国产精品亲子伦对白| 午夜久久久久久久久| 99久久精品免费精品国产| 日韩网站在线看片你懂的| 伊人一区二区三区| 国产成人av电影在线播放| 欧美变态口味重另类| 五月婷婷激情综合| 色综合网色综合| 国产精品私房写真福利视频| 国产原创一区二区三区| 日韩一级黄色大片| 五月婷婷激情综合网| www.亚洲精品| 欧美激情在线看| 懂色av噜噜一区二区三区av| 久久夜色精品一区| 精一区二区三区| 久久久亚洲高清| 成人性生交大片免费看视频在线 | 亚洲图片欧美综合| 成人动漫一区二区| 亚洲在线视频一区| 欧美三级电影网站| 精品伊人久久久久7777人| 欧美成人精品高清在线播放 |