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

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

?? shell.c

?? nedit 是一款linux下的開發源碼的功能強大的編輯器
?? C
?? 第 1 頁 / 共 3 頁
字號:
cmdDone:    XtFree((char *)cmdData);    window->shellCmdData = NULL;    if (fromMacro)    	ResumeMacroExecution(window);}/*** Fork a subprocess to execute a command, return file descriptors for pipes** connected to the subprocess' stdin, stdout, and stderr streams.  cmdDir** sets the default directory for the subprocess.  If stderrFD is passed as** NULL, the pipe represented by stdoutFD is connected to both stdin and** stderr.  The function value returns the pid of the new subprocess, or -1** if an error occured.*/static pid_t forkCommand(Widget parent, const char *command, const char *cmdDir,	int *stdinFD, int *stdoutFD, int *stderrFD){    int childStdoutFD, childStdinFD, childStderrFD, pipeFDs[2];    int dupFD;    pid_t childPid;        /* Ignore SIGPIPE signals generated when user attempts to provide       input for commands which don't take input */    signal(SIGPIPE, SIG_IGN);        /* Create pipes to communicate with the sub process.  One end of each is       returned to the caller, the other half is spliced to stdin, stdout       and stderr in the child process */    if (pipe(pipeFDs) != 0) {    	perror("NEdit: Internal error (opening stdout pipe)");        return -1;    }    *stdoutFD = pipeFDs[0];    childStdoutFD = pipeFDs[1];    if (pipe(pipeFDs) != 0) {    	perror("NEdit: Internal error (opening stdin pipe)");        return -1;    }    *stdinFD = pipeFDs[1];    childStdinFD = pipeFDs[0];    if (stderrFD == NULL)    	childStderrFD = childStdoutFD;    else {	if (pipe(pipeFDs) != 0) {    	    perror("NEdit: Internal error (opening stdin pipe)");            return -1;        }	*stderrFD = pipeFDs[0];	childStderrFD = pipeFDs[1];    }        /* Fork the process */    childPid = fork();        /*    ** Child process context (fork returned 0), clean up the    ** child ends of the pipes and execute the command    */    if (0 == childPid) {	/* close the parent end of the pipes in the child process   */	close(*stdinFD);	close(*stdoutFD);	if (stderrFD != NULL)	    close(*stderrFD);	/* close current stdin, stdout, and stderr file descriptors before	   substituting pipes */	close(fileno(stdin));	close(fileno(stdout));	close(fileno(stderr));	/* duplicate the child ends of the pipes to have the same numbers	   as stdout & stderr, so it can substitute for stdout & stderr */ 	dupFD = dup2(childStdinFD, fileno(stdin));	if (dupFD == -1)	    perror("dup of stdin failed"); 	dupFD = dup2(childStdoutFD, fileno(stdout));	if (dupFD == -1)	    perror("dup of stdout failed"); 	dupFD = dup2(childStderrFD, fileno(stderr));	if (dupFD == -1)	    perror("dup of stderr failed");		/* make this process the leader of a new process group, so the sub	   processes can be killed, if necessary, with a killpg call */#ifndef __EMX__  /* OS/2 doesn't have this */	setsid();#endif             /* change the current working directory to the directory of the current	  file. */        if(cmdDir[0] != 0)	   if(chdir(cmdDir) == -1)	       perror("chdir to directory of current file failed");     	/* execute the command using the shell specified by preferences */	execl(GetPrefShell(), GetPrefShell(), "-c", command, (char *)0);	/* if we reach here, execl failed */	fprintf(stderr, "Error starting shell: %s\n", GetPrefShell());	exit(EXIT_FAILURE);    }        /* Parent process context, check if fork succeeded */    if (childPid == -1)    {        DialogF(DF_ERR, parent, 1, "Shell Command",                "Error starting shell command process\n(fork failed)",                "Dismiss");    }    /* close the child ends of the pipes */    close(childStdinFD);    close(childStdoutFD);    if (stderrFD != NULL)    	close(childStderrFD);    return childPid;}    /*** Add a buffer full of output to a buffer list*/static void addOutput(buffer **bufList, buffer *buf){    buf->next = *bufList;    *bufList = buf;}/*** coalesce the contents of a list of buffers into a contiguous memory block,** freeing the memory occupied by the buffer list.  Returns the memory block** as the function result, and its length as parameter "length".*/static char *coalesceOutput(buffer **bufList, int *outLength){    buffer *buf, *rBufList = NULL;    char *outBuf, *outPtr, *p;    int i, length = 0;        /* find the total length of data read */    for (buf=*bufList; buf!=NULL; buf=buf->next)    	length += buf->length;        /* allocate contiguous memory for returning data */    outBuf = XtMalloc(length+1);        /* reverse the buffer list */    while (*bufList != NULL) {    	buf = *bufList;    	*bufList = buf->next;    	buf->next = rBufList;    	rBufList = buf;    }        /* copy the buffers into the output buffer */    outPtr = outBuf;    for (buf=rBufList; buf!=NULL; buf=buf->next) {    	p = buf->contents;    	for (i=0; i<buf->length; i++)    	    *outPtr++ = *p++;    }        /* terminate with a null */    *outPtr = '\0';    /* free the buffer list */    freeBufList(&rBufList);        *outLength = outPtr - outBuf;    return outBuf;}static void freeBufList(buffer **bufList){    buffer *buf;        while (*bufList != NULL) {    	buf = *bufList;    	*bufList = buf->next;    	XtFree((char *)buf);    }}/*** Remove trailing newlines from a string by substituting nulls*/static void removeTrailingNewlines(char *string){    char *endPtr = &string[strlen(string)-1];        while (endPtr >= string && *endPtr == '\n')    	*endPtr-- = '\0';}/*** Create a dialog for the output of a shell command.  The dialog lives until** the user presses the Dismiss button, and is then destroyed*/static void createOutputDialog(Widget parent, char *text){    Arg al[50];    int ac, rows, cols, hasScrollBar, wrapped;    Widget form, textW, button;    XmString st1;    /* measure the width and height of the text to determine size for dialog */    measureText(text, MAX_OUT_DIALOG_COLS, &rows, &cols, &wrapped);    if (rows > MAX_OUT_DIALOG_ROWS) {    	rows = MAX_OUT_DIALOG_ROWS;    	hasScrollBar = True;    } else    	hasScrollBar = False;    if (cols > MAX_OUT_DIALOG_COLS)    	cols = MAX_OUT_DIALOG_COLS;    if (cols == 0)    	cols = 1;    /* Without completely emulating Motif's wrapping algorithm, we can't       be sure that we haven't underestimated the number of lines in case       a line has wrapped, so let's assume that some lines could be obscured       */    if (wrapped)	hasScrollBar = True;    ac = 0;    form = CreateFormDialog(parent, "shellOutForm", al, ac);    ac = 0;    XtSetArg(al[ac], XmNlabelString, st1=MKSTRING("Dismiss")); ac++;    XtSetArg(al[ac], XmNhighlightThickness, 0);  ac++;    XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM);  ac++;    XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE);  ac++;    button = XmCreatePushButtonGadget(form, "dismiss", al, ac);    XtManageChild(button);    XtVaSetValues(form, XmNdefaultButton, button, NULL);    XmStringFree(st1);    XtAddCallback(button, XmNactivateCallback, destroyOutDialogCB,    	    XtParent(form));        ac = 0;    XtSetArg(al[ac], XmNrows, rows);  ac++;    XtSetArg(al[ac], XmNcolumns, cols);  ac++;    XtSetArg(al[ac], XmNresizeHeight, False);  ac++;    XtSetArg(al[ac], XmNtraversalOn, False); ac++;    XtSetArg(al[ac], XmNwordWrap, True);  ac++;    XtSetArg(al[ac], XmNscrollHorizontal, False);  ac++;    XtSetArg(al[ac], XmNscrollVertical, hasScrollBar);  ac++;    XtSetArg(al[ac], XmNhighlightThickness, 0);  ac++;    XtSetArg(al[ac], XmNspacing, 0);  ac++;    XtSetArg(al[ac], XmNeditMode, XmMULTI_LINE_EDIT);  ac++;    XtSetArg(al[ac], XmNeditable, False);  ac++;    XtSetArg(al[ac], XmNvalue, text);  ac++;    XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM);  ac++;    XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM);  ac++;    XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET);  ac++;    XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM);  ac++;    XtSetArg(al[ac], XmNbottomWidget, button);  ac++;    textW = XmCreateScrolledText(form, "outText", al, ac);    AddMouseWheelSupport(textW);    XtManageChild(textW);        XtVaSetValues(XtParent(form), XmNtitle, "Output from Command", NULL);    ManageDialogCenteredOnPointer(form);}/*** Dispose of the command output dialog when user presses Dismiss button*/static void destroyOutDialogCB(Widget w, XtPointer callback, XtPointer closure){    XtDestroyWidget((Widget)callback);}/*** Measure the width and height of a string of text.  Assumes 8 character** tabs.  wrapWidth specifies a number of columns at which text wraps.*/static void measureText(char *text, int wrapWidth, int *rows, int *cols,	int *wrapped){    int maxCols = 0, line = 1, col = 0, wrapCol;    char *c;        *wrapped = 0;    for (c=text; *c!='\0'; c++) {    	if (*c=='\n') {	    line++;	    col = 0;	    continue;	} 	if (*c == '\t') {	    col += 8 - (col % 8);	    wrapCol = 0; /* Tabs at end of line are not drawn when wrapped */	} else if (*c == ' ') {	    col++;	    wrapCol = 0; /* Spaces at end of line are not drawn when wrapped */	} else {	    col++;	    wrapCol = 1;	}	/* Note: there is a small chance that the number of lines is	   over-estimated when a line ends with a space or a tab (ie, followed           by a newline) and that whitespace crosses the boundary, because           whitespace at the end of a line does not cause wrapping. Taking           this into account is very hard, but an over-estimation is harmless.           The worst that can happen is that some extra blank lines are shown           at the end of the dialog (in contrast to an under-estimation, which           could make the last lines invisible).           On the other hand, without emulating Motif's wrapping algorithm           completely, we can't be sure that we don't underestimate the number           of lines (Motif uses word wrap, and this counting algorithm uses           character wrap). Therefore, we remember whether there is a line           that has wrapped. In that case we allways install a scroll bar.	   */	if (col > wrapWidth) {	    line++;	    *wrapped = 1;	    col = wrapCol;	} else if (col > maxCols) {	    maxCols = col;	}    }    *rows = line;    *cols = maxCols;}/*** Truncate a string to a maximum of length characters.  If it shortens the** string, it appends "..." to show that it has been shortened. It assumes** that the string that it is passed is writeable.*/static void truncateString(char *string, int length){    if ((int)strlen(string) > length)	memcpy(&string[length-3], "...", 4);}/*** Substitute the string fileStr in inStr wherever % appears and** lineStr in inStr wherever # appears, storing the** result in outStr. If predictOnly is non-zero, the result string length** is predicted without creating the string. Returns the length of the result** string or -1 in case of an error.***/static int shellSubstituter(char *outStr, const char *inStr, const char *fileStr,        const char *lineStr, int outLen, int predictOnly){    const char *inChar;    char *outChar = NULL;    int outWritten = 0;    int fileLen, lineLen;    inChar = inStr;    if (!predictOnly) {        outChar = outStr;    }    fileLen = strlen(fileStr);    lineLen = strlen(lineStr);    while (*inChar != '\0') {        if (!predictOnly && outWritten >= outLen) {            return(-1);        }        if (*inChar == '%') {            if (*(inChar + 1) == '%') {                inChar += 2;                if (!predictOnly) {                    *outChar++ = '%';                }                outWritten++;            } else  {                if (!predictOnly) {                    if (outWritten + fileLen >= outLen) {                        return(-1);                    }                    strncpy(outChar, fileStr, fileLen);                    outChar += fileLen;                }                outWritten += fileLen;                inChar++;            }        } else if (*inChar == '#') {            if (*(inChar + 1) == '#') {                inChar += 2;                if (!predictOnly) {                    *outChar++ = '#';                }                outWritten++;            } else  {                if (!predictOnly) {                    if (outWritten + lineLen >= outLen) {                        return(-1);                    }                    strncpy(outChar, lineStr, lineLen);                    outChar += lineLen;                }                outWritten += lineLen;                inChar++;            }        } else {            if (!predictOnly) {                *outChar++ = *inChar;            }            inChar++;            outWritten++;        }    }    if (!predictOnly) {        if (outWritten >= outLen) {            return(-1);        }        *outChar = '\0';    }    ++outWritten;    return(outWritten);}static char *shellCommandSubstitutes(const char *inStr, const char *fileStr,        const char *lineStr){    int cmdLen;    char *subsCmdStr = NULL;    cmdLen = shellSubstituter(NULL, inStr, fileStr, lineStr, 0, 1);    if (cmdLen >= 0) {        subsCmdStr = malloc(cmdLen);        if (subsCmdStr) {            cmdLen = shellSubstituter(subsCmdStr, inStr, fileStr, lineStr, cmdLen, 0);            if (cmdLen < 0) {                free(subsCmdStr);                subsCmdStr = NULL;            }        }    }    return(subsCmdStr);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美国十次了思思久久精品导航| 在线免费视频一区二区| 337p亚洲精品色噜噜| 丝袜亚洲另类欧美| 精品久久久久久综合日本欧美 | 色婷婷狠狠综合| 一区二区三区高清不卡| 3d成人动漫网站| 国产精品亚洲一区二区三区妖精| 日本一区二区三区四区| 91黄色免费看| 韩国av一区二区三区在线观看| 中文字幕精品一区二区精品绿巨人| 色综合久久久网| 奇米影视一区二区三区| 日本一区二区三区四区在线视频| 99久久精品久久久久久清纯| 一区二区三区四区激情| 26uuu精品一区二区三区四区在线| 成人在线视频一区| 午夜精品成人在线| 中文字幕电影一区| 欧美一二三区精品| 91麻豆免费看片| 韩国精品久久久| 亚洲成年人网站在线观看| 国产夜色精品一区二区av| 在线视频你懂得一区| 国产在线一区观看| 亚洲成av人片在线| 国产精品久久久久久久久免费樱桃| 欧美日韩视频在线观看一区二区三区| 精品一区二区三区久久久| 亚洲男人天堂av| 国产人成一区二区三区影院| 欧美日韩不卡在线| 色婷婷综合在线| 国产sm精品调教视频网站| 男女视频一区二区| 亚洲福利视频一区二区| 国产精品久久久久久久浪潮网站| 欧美sm美女调教| 9191国产精品| 欧美日高清视频| 一本色道久久综合狠狠躁的推荐| 国内精品国产成人国产三级粉色| 污片在线观看一区二区| 亚洲美女视频在线| 中文字幕在线不卡| 国产精品欧美久久久久一区二区| 精品福利在线导航| 日韩三级精品电影久久久| 欧美久久久久中文字幕| 欧美三片在线视频观看| 91麻豆蜜桃一区二区三区| jlzzjlzz亚洲日本少妇| 成人av综合一区| 岛国精品一区二区| 99久久精品国产一区| www.欧美日韩国产在线| www.66久久| 91麻豆产精品久久久久久| 99re8在线精品视频免费播放| av午夜一区麻豆| 一本大道久久精品懂色aⅴ| 91一区二区三区在线播放| 99免费精品视频| 日本乱码高清不卡字幕| 欧美日韩综合色| 欧美一区二区视频在线观看2020| 欧美一区二区日韩| 精品区一区二区| 久久久99精品免费观看| 国产精品免费免费| 亚洲激情男女视频| 午夜久久电影网| 日韩成人午夜精品| 国内一区二区视频| 99久久99久久免费精品蜜臀| 在线观看视频欧美| 欧美一区二区三区在线电影| 日韩欧美美女一区二区三区| 欧美经典三级视频一区二区三区| 亚洲免费电影在线| 久久er精品视频| 99国产精品久久久久| 欧美日韩中文字幕一区二区| 日韩女优制服丝袜电影| 中文字幕第一区| 丝袜国产日韩另类美女| 国产乱妇无码大片在线观看| 色婷婷久久综合| 亚洲精品在线免费观看视频| 中文字幕五月欧美| 日本aⅴ亚洲精品中文乱码| 国产a级毛片一区| 欧美日韩成人一区| 国产精品久久久久aaaa樱花| 日本色综合中文字幕| 成人av电影免费观看| 日韩视频一区二区| 亚洲欧美区自拍先锋| 狠狠色狠狠色综合| 欧美亚洲动漫制服丝袜| 国产三级欧美三级日产三级99| 一区2区3区在线看| 盗摄精品av一区二区三区| 制服.丝袜.亚洲.另类.中文| 国产精品国产三级国产a| 麻豆91精品视频| 欧美亚洲国产一区在线观看网站 | 26uuu精品一区二区| 亚洲乱码国产乱码精品精小说 | 国内成人自拍视频| 欧美日韩国产中文| 亚洲欧美日韩国产成人精品影院| 国产一区二区三区美女| 91麻豆精品国产91久久久| 亚洲欧洲无码一区二区三区| 国产一区在线观看麻豆| 日韩三级视频在线观看| 午夜在线电影亚洲一区| 色综合久久综合网| 成人欧美一区二区三区在线播放| 国产高清精品久久久久| 精品日韩欧美在线| 美美哒免费高清在线观看视频一区二区| 欧美亚洲一区二区三区四区| 亚洲啪啪综合av一区二区三区| 成人福利在线看| 国产精品嫩草影院av蜜臀| 国产精品一区二区三区乱码| 精品蜜桃在线看| 玖玖九九国产精品| 欧美tickle裸体挠脚心vk| 久久99精品国产91久久来源| 精品日韩在线一区| 国产精品一二三四五| 国产欧美一区二区三区在线看蜜臀| 国产在线视频一区二区三区| www欧美成人18+| 国产精品一区三区| 国产日韩欧美精品综合| 成人中文字幕电影| 亚洲色图视频网| 色欧美乱欧美15图片| 亚洲午夜一区二区三区| 欧美酷刑日本凌虐凌虐| 日韩成人一区二区| 久久先锋资源网| 本田岬高潮一区二区三区| 专区另类欧美日韩| 欧美乱妇15p| 美女免费视频一区二区| 久久久久久影视| 成人免费毛片高清视频| 亚洲精品免费看| 欧美三级日韩三级国产三级| 免费高清视频精品| 欧美国产精品劲爆| 在线观看欧美黄色| 久久99蜜桃精品| 国产精品对白交换视频| 欧美探花视频资源| 精品一区二区三区蜜桃| 中文字幕字幕中文在线中不卡视频| 欧美性高清videossexo| 日本成人在线一区| 136国产福利精品导航| 欧美精品色综合| 国产剧情一区二区| 亚洲黄网站在线观看| 26uuu国产电影一区二区| 色综合天天天天做夜夜夜夜做| 免费看欧美女人艹b| 亚洲视频网在线直播| 91精品国产综合久久精品app| 国产98色在线|日韩| 午夜成人免费电影| 国产精品免费av| 日韩欧美在线一区二区三区| 成人网页在线观看| 蜜桃av一区二区三区电影| 亚洲狠狠丁香婷婷综合久久久| 久久影院视频免费| 制服丝袜日韩国产| 欧美性videosxxxxx| 成人高清视频在线观看| 久久精品国产澳门| 亚洲第一电影网| 亚洲日本va午夜在线影院| 精品久久久久久久久久久久久久久久久 | 国产精品盗摄一区二区三区| 日韩一区二区在线看片| 欧美日精品一区视频| 91美女蜜桃在线| av在线一区二区三区| 国产毛片精品一区| 久久99久久精品欧美| 午夜精品一区二区三区免费视频|