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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gnuserv.c

?? Emacs的一個(gè)插件源碼
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/* -*-C-*- Server code for handling requests from clients and forwarding them on to the GNU Emacs process. This file is part of GNU Emacs. Copying is permitted under those conditions described by the GNU General Public License. Copyright (C) 1989 Free Software Foundation, Inc. Author: Andy Norman (ange@hplb.hpl.hp.com), based on 'etc/server.c'         from the 18.52 GNU Emacs distribution. Please mail bugs and suggestions to the author at the above address.*//* HISTORY  * 11-Nov-1990		bristor@simba	 *    Added EOT stuff. *//* * This file incorporates new features added by Bob Weiner <weiner@mot.com>, * Darrell Kindred <dkindred@cmu.edu> and Arup Mukherjee <arup@cmu.edu>. * Please see the note at the end of the README file for details. * * (If gnuserv came bundled with your emacs, the README file is probably * ../etc/gnuserv.README relative to the directory containing this file) */static char rcsid [] = "$Header: gnuserv.c,v 2.0 94/08/14 12:33:29 arup Exp $";#include "gnuserv.h"#ifdef USE_LITOUT#ifdef linux#include <bsd/sgtty.h>#else#include <sgtty.h>#endif#endif#ifdef AIX#include <sys/select.h>#endif#if !defined(SYSV_IPC) && !defined(UNIX_DOMAIN_SOCKETS) && \    !defined(INTERNET_DOMAIN_SOCKETS)main (){  fprintf (stderr,"Sorry, the Emacs server is only supported on systems that have\n");  fprintf (stderr,"Unix Domain sockets, Internet Domain sockets or System V IPC\n");  exit (1);} /* main */#else /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */#ifdef SYSV_IPCint ipc_qid = 0;		/* ipc message queue id */int ipc_wpid = 0;		/* watchdog task pid *//*  ipc_exit -- clean up the queue id and queue, then kill the watchdog task              if it exists. exit with the given status.*/void ipc_exit(stat)     int stat;{  msgctl(ipc_qid,IPC_RMID,0);    if (ipc_wpid != 0)    kill(ipc_wpid,SIGKILL);  exit(stat);} /* ipc_exit *//*  ipc_handle_signal -- catch the signal given and clean up.*/void ipc_handle_signal(sig)     int sig;{  ipc_exit(0);} /* ipc_handle_signal *//*   ipc_spawn_watchdog -- spawn a watchdog task to clean up the message queue should the			server process die.*/int ipc_spawn_watchdog(){  if ((ipc_wpid = fork()) == 0) { /* child process */    int ppid = getppid();	/* parent's process id */    setpgrp();			/* gnu kills process group on exit */        while (1) {      if (kill(ppid,0) < 0) {	/* ppid is no longer valid, parent may have died */	ipc_exit(0);      }; /* if */      sleep(10);		/* have another go later */    }; /* while */  }; /* if */} /* ipc_spawn_watchdog *//*  ipc_init -- initialize server, setting the global msqid that can be listened on.*/void ipc_init(msgpp)     struct msgbuf **msgpp;{  key_t key;			/* messge key */  char buf[GSERV_BUFSZ];	/* pathname for key */  int p;			/* child process id */  sprintf(buf,"/tmp/gsrv%d",geteuid());  creat(buf,0600);  key = ftok(buf,1);  if ((ipc_qid = msgget(key,0600|IPC_CREAT)) == -1) {    perror(progname);    fprintf(stderr,"%s: unable to create msg queue\n",progname);    ipc_exit(1);  }; /* if */  ipc_spawn_watchdog();  signal(SIGTERM,ipc_handle_signal);  signal(SIGINT,ipc_handle_signal);  if ((*msgpp = (struct msgbuf *)                 malloc(sizeof **msgpp + GSERV_BUFSZ)) == NULL) {    fprintf(stderr,	    "%s: unable to allocate space for message buffer\n",progname);    ipc_exit(1);  }; /* if */} /* ipc_init *//*  handle_ipc_request -- accept a request from a client, pass the request on  			to the GNU Emacs process, then wait for its reply and			pass that on to the client.*/void handle_ipc_request(msgp)     struct msgbuf *msgp;	/* message buffer */{  struct msqid_ds msg_st;	/* message status */  char buf[GSERV_BUFSZ];  int len;			/* length of message / read */  int s, result_len;            /* tag fields on the response from emacs */  int junk;			/* junk value */  int offset = 0;  int total = 1;                /* # bytes that will actually be sent off */  if ((len = msgrcv(ipc_qid,msgp,GSERV_BUFSZ-1,1,0)) < 0) {    perror(progname);    fprintf(stderr,"%s: unable to receive\n",progname);    ipc_exit(1);  }; /* if */  msgctl(ipc_qid,IPC_STAT,&msg_st);  strncpy(buf,msgp->mtext,len);  buf[len] = '\0';		/* terminate */    printf("%d %s",ipc_qid,buf);  fflush(stdout);  /* now for the response from gnu */  msgp->mtext[0] = '\0';#if 0  if ((len = read(0,buf,GSERV_BUFSZ)) < 0) {    perror(progname);    fprintf(stderr,"%s: unable to read\n",progname);    ipc_exit(1);  }; /* if */        sscanf(buf,"%d:%[^\n]\n",&junk,msgp->mtext);#else   /* read in "n/m:" (n=client fd, m=message length) */  while (offset < GSERV_BUFSZ && 	 ((len = read(0,buf+offset,1)) > 0) &&	 buf[offset] != ':') {    offset += len;  }  if (len < 0) {    perror(progname);    fprintf(stderr,"%s: unable to read\n",progname);    exit(1);  }        /* parse the response from emacs, getting client fd & result length */  buf[offset] = '\0';  sscanf(buf,"%d/%d", &s, &result_len);  while (result_len > 0) {    if ((len = read(0,buf,min2(result_len, GSERV_BUFSZ - 1))) < 0) {      perror(progname);      fprintf(stderr,"%s: unable to read\n",progname);      exit(1);    }    /* Send this string off, but only if we have enough space */     if (GSERV_BUFSZ > total) {      if (total + len <= GSERV_BUFSZ)	buf[len] = 0;      else 	buf[GSERV_BUFSZ - total] = 0;      send_string(s,buf);      total += strlen(buf);    };    result_len -= len;  }  /* eat the newline */  while ((len = read(0,buf,1)) == 0)    ;  if (len < 0) {    perror(progname);    fprintf(stderr,"%s: unable to read\n",progname);    exit(1);  }  if (buf[0] != '\n') {    fprintf(stderr,"%s: garbage after result [%c]\n",progname, buf[0]);    exit(1);  }#endif  /* Send a response back to the client. */  msgp->mtype = msg_st.msg_lspid;  if (msgsnd(ipc_qid,msgp,strlen(msgp->mtext)+1,0) < 0)    perror("msgsend(gnuserv)");} /* handle_ipc_request */#endif /* SYSV_IPC */#if defined(INTERNET_DOMAIN_SOCKETS) || defined(UNIX_DOMAIN_SOCKETS)/*  echo_request -- read request from a given socket descriptor, and send the information                  to stdout (the gnu process).*/void echo_request(s)int s;				/* socket */{  char buf[GSERV_BUFSZ];  int len;  printf("%d ",s);    /* read until we get a newline or no characters */  while ((len = recv(s,buf,GSERV_BUFSZ,0)) > 0) {    buf[len] = '\0';    printf("%s",buf);    if (buf[len-1] == EOT_CHR) {      fflush(stdout);      break;			/* end of message */    }  }; /* while */  if (len < 0) {    perror(progname);    fprintf(stderr,"%s: unable to recv\n",progname);    exit(1);  }; /* if */  } /* echo_request *//*  handle_response -- accept a response from stdin (the gnu process) and pass the                     information on to the relevant client.*/void handle_response(){  char buf[GSERV_BUFSZ+1];  char response[GSERV_BUFSZ+1];  int offset=0;  int s;  int len;  int result_len;  /* read in "n/m:" (n=client fd, m=message length) */  while (offset < GSERV_BUFSZ && 	 ((len = read(0,buf+offset,1)) > 0) &&	 buf[offset] != ':') {    offset += len;  }  if (len < 0) {    perror(progname);    fprintf(stderr,"%s: unable to read\n",progname);    exit(1);  }        /* parse the response from emacs, getting client fd & result length */  buf[offset] = '\0';  sscanf(buf,"%d/%d", &s, &result_len);  while (result_len > 0) {    if ((len = read(0,buf,min2(result_len,GSERV_BUFSZ))) < 0) {      perror(progname);      fprintf(stderr,"%s: unable to read\n",progname);      exit(1);    }    buf[len] = '\0';    send_string(s,buf);    result_len -= len;  }  /* eat the newline */  while ((len = read(0,buf,1)) == 0)    ;  if (len < 0) {    perror(progname);    fprintf(stderr,"%s: unable to read\n",progname);    exit(1);  }  if (buf[0] != '\n') {    fprintf(stderr,"%s: garbage after result\n",progname);    exit(1);  }  close(s);} /* handle_response */#endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */#ifdef INTERNET_DOMAIN_SOCKETSstruct entry {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
男女男精品网站| 国产乱子伦视频一区二区三区 | 国产一区二区三区高清播放| 国产精品久久三| 精品国产人成亚洲区| 欧美在线观看视频一区二区| 高清不卡一二三区| 视频一区二区中文字幕| 中文字幕人成不卡一区| 26uuu亚洲婷婷狠狠天堂| 欧美在线色视频| av成人免费在线| 国产一本一道久久香蕉| 日本特黄久久久高潮| 亚洲精品乱码久久久久久 | 亚洲国产日韩a在线播放| 久久久久久亚洲综合| 欧美一级在线观看| 欧美狂野另类xxxxoooo| 在线这里只有精品| av资源网一区| 成人动漫在线一区| 国产黄色精品网站| 国产麻豆精品一区二区| 精品一区二区av| 欧美aaaaaa午夜精品| 亚洲成人三级小说| 亚洲成a人v欧美综合天堂| 一区二区三区四区在线播放 | 欧美久久久一区| 日本久久一区二区三区| 91年精品国产| 91网上在线视频| 91香蕉视频mp4| 在线看一区二区| 色国产综合视频| 在线观看一区二区视频| 欧美优质美女网站| 欧美日韩电影在线播放| 91成人在线免费观看| 欧美在线999| 欧美日韩1234| 欧美一区二区三区色| 在线综合视频播放| 欧美电视剧在线观看完整版| 欧美成人一区二区三区片免费 | 91免费版pro下载短视频| 99久久精品免费看| 色综合久久久久网| 欧美日韩午夜精品| 日韩丝袜情趣美女图片| 精品久久久久久久久久久院品网 | 久久久久综合网| 国产亚洲欧美一级| 国产精品二三区| 亚洲男人的天堂在线观看| 亚洲精品免费播放| 日韩电影免费在线观看网站| 美女视频第一区二区三区免费观看网站| 麻豆精品一区二区| 成人理论电影网| 欧美调教femdomvk| 欧美成人video| 国产精品成人一区二区三区夜夜夜| 亚洲日本成人在线观看| 亚洲va国产天堂va久久en| 久久er99热精品一区二区| 成人性视频网站| 欧美日韩一区在线观看| 日韩精品自拍偷拍| 国产精品污污网站在线观看 | 日韩电影在线看| 国产精品综合二区| 欧美亚洲丝袜传媒另类| 欧美一级生活片| 国产精品国产自产拍高清av王其 | 中文字幕一区二区三区色视频| 亚洲一区视频在线| 精品一区二区三区的国产在线播放| 国产传媒欧美日韩成人| 欧美性受xxxx| 国产亚洲欧美色| 同产精品九九九| 成人激情校园春色| 日韩欧美一区二区三区在线| 国产精品超碰97尤物18| 男人操女人的视频在线观看欧美| 成人午夜电影久久影院| 欧美妇女性影城| 亚洲特级片在线| 激情文学综合插| 欧美日韩一级大片网址| 欧美国产综合一区二区| 日韩av网站在线观看| 91天堂素人约啪| 国产性色一区二区| 日本va欧美va瓶| av电影一区二区| 久久婷婷一区二区三区| 亚洲第一福利一区| 91在线精品一区二区三区| 日韩美女视频一区二区在线观看| 亚洲欧美经典视频| 国产成人在线看| 欧美成人精品福利| 日韩成人一级片| 欧美日韩午夜影院| 亚洲综合一二区| 99re66热这里只有精品3直播| 国产精品久久毛片a| 天堂蜜桃一区二区三区| 97se亚洲国产综合自在线不卡| 精品久久久久香蕉网| 免费人成黄页网站在线一区二区| 欧日韩精品视频| 亚洲女女做受ⅹxx高潮| 99视频热这里只有精品免费| 国产视频一区在线播放| 国产精品一二一区| 精品国产三级a在线观看| 六月丁香婷婷久久| 欧美成人激情免费网| 男男成人高潮片免费网站| 4438x亚洲最大成人网| 午夜精品久久一牛影视| 欧美日本国产一区| 亚洲一区二区三区精品在线| 色婷婷久久久亚洲一区二区三区| 国产精品久久久久久久岛一牛影视| 国产91精品久久久久久久网曝门| 久久亚洲一区二区三区四区| 美国精品在线观看| 26uuu另类欧美| 国产成人激情av| 亚洲国产精品精华液2区45| 国产精品一区二区x88av| 久久久久久久电影| 国产白丝精品91爽爽久久| 欧美韩国日本综合| 91丨九色丨蝌蚪富婆spa| 亚洲乱码日产精品bd| 91国产免费观看| 三级在线观看一区二区| 777久久久精品| 久久成人久久爱| 日本一区二区不卡视频| av成人老司机| 亚洲成人www| 91精品国产欧美一区二区18| 久草这里只有精品视频| 久久久综合激的五月天| 成人高清视频在线观看| 亚洲你懂的在线视频| 69堂亚洲精品首页| 激情欧美一区二区三区在线观看| 久久精品一区四区| thepron国产精品| 一区二区三区视频在线看| 911精品产国品一二三产区| 国产中文字幕精品| 亚洲人成7777| 日韩一区二区麻豆国产| 国产白丝网站精品污在线入口| 亚洲特级片在线| 日韩午夜精品电影| av爱爱亚洲一区| 五月天欧美精品| 欧美激情综合在线| 欧美日韩精品三区| 狠狠色丁香九九婷婷综合五月| 中文字幕 久热精品 视频在线| 91久久精品网| 精品一区二区久久久| 亚洲日本va午夜在线电影| 91精品国产综合久久久久久久| 国产成人综合自拍| 亚洲一级在线观看| 国产免费成人在线视频| 欧美美女喷水视频| 成人永久免费视频| 亚洲影院免费观看| 久久精品人人做人人综合| 欧美特级限制片免费在线观看| 国产伦精一区二区三区| 亚洲成av人影院| 国产精品三级av| 91精品国产乱码| 91欧美一区二区| 国产成人三级在线观看| 婷婷综合久久一区二区三区| 国产精品久久久久久久裸模| 91精品国产色综合久久| 一本色道a无线码一区v| 国产乱码精品一区二区三区五月婷| 亚洲青青青在线视频| 日本一区二区免费在线| 日韩一级高清毛片| 欧美天堂亚洲电影院在线播放| 成人免费看黄yyy456| 国内精品久久久久影院色|