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

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

?? ipc.c

?? 支持數字元件仿真的SPICE插件
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*============================================================================FILE    IPC.cMEMBER OF process XSPICECopyright 1991Georgia Tech Research CorporationAtlanta, Georgia 30332All Rights ReservedPROJECT A-8503AUTHORS    9/12/91  Steve TynorMODIFICATIONS    6/13/92  Bill Kuhn  Added some commentsSUMMARY    Provides compatibility for the new SPICE simulator to both the MSPICE user    interface and BCP (via ATESSE v.1 style AEGIS mailboxes) and the new ATESSE    v.2 Simulator Interface and BCP (via Bsd Sockets).    The Interprocess Communications package provides functions    called to receive XSPICE decks from the ATESSE Simulator Interface    or Batch Control processes, and to return results to those    processes.  Functions callable from the simulator packages include:            ipc_initialize_server        ipc_terminate_server        ipc_get_line        ipc_send_line        ipc_send_data_prefix        ipc_send_data_suffix        ipc_send_dcop_prefix        ipc_send_dcop_suffix        ipc_send_evtdict_prefix        ipc_send_evtdict_suffix        ipc_send_evtdata_prefix        ipc_send_evtdata_suffix        ipc_send_errchk        ipc_send_end        ipc_send_boolean        ipc_send_int        ipc_send_double        ipc_send_complex        ipc_send_event        ipc_flush        These functions communicate with a set of transport-level functions    that implement the interprocess communications under one of    the following protocol types determined by a compile-time option:            BSD UNIX Sockets        HP/Apollo Mailboxes        For each transport protocol, the following functions are written:            ipc_transport_initialize_server        ipc_transport_get_line        ipc_transport_terminate_server        ipc_transport_send_line============================================================================*/#ifndef NDEBUG#include <stdio.h>#endif#include <sys/file.h>   /* Specific to BSD - Use sys/fcntl.h for sys5 */#include <assert.h>#include <ctype.h>#include <string.h>#include <memory.h>     /* NOTE: I think this is a Sys5ism (there is not man                         * page for it under Bsd, but it's in /usr/include                         * and it has a BSD copyright header. Go figure.                         */#include "IPC.h"#include "IPCtiein.h"#include "IPCproto.h"/* * Conditional compilation sanity check: */#if !defined (IPC_AEGIS_MAILBOXES) && !defined (IPC_UNIX_SOCKETS)\   && !defined (IPC_DEBUG_VIA_STDIO)"       compiler error - must specify a transport mechanism";#endif/* * static 'globals' *//*typedef unsigned char Buffer_Char_t;*/typedef char Buffer_Char_t;#define OUT_BUFFER_SIZE 1000#define MAX_NUM_RECORDS 200static int              end_of_record_index [MAX_NUM_RECORDS];static int              num_records;static Buffer_Char_t    out_buffer [OUT_BUFFER_SIZE];static int              fill_count;static Ipc_Mode_t       mode;static Ipc_Protocol_t   protocol;static Ipc_Boolean_t        end_of_deck_seen;static int              batch_fd;#define FMT_BUFFER_SIZE 80static char fmt_buffer [FMT_BUFFER_SIZE];/*---------------------------------------------------------------------------*/static Ipc_Boolean_t kw_match (keyword, str)     char *keyword;     char *str;     /*      * returns IPC_TRUE if the first `strlen(keyword)' characters of `str' match      * the ones in `keyword' - case sensitive      */{   char *k = keyword;   char *s = str;   /*    * quit if we run off the end of either string:    */   while (*s && *k) {      if (*s != *k) {         return IPC_FALSE;      }      s++;      k++;   }   /*    * if we get this far, it sould be because we ran off the end of the     * keyword else we didn't match:    */   return (*k == '\0');}/*---------------------------------------------------------------------------*//*ipc_initialize_serverThis function creates the interprocess communication channelserver mailbox or socket.*/Ipc_Status_t ipc_initialize_server (server_name, m, p)     char               *server_name;  /* Mailbox path or host/portnumber pair */     Ipc_Mode_t         m;             /* Interactive or batch */     Ipc_Protocol_t     p;             /* Type of IPC protocol */     /*      * For mailboxes, `server_name' would be the mailbox pathname; for      * sockets, this needs to be a host/portnumber pair. Maybe this should be      * automatically generated by the routine...      */{   Ipc_Status_t status;   char batch_filename [1025];      mode = m;   protocol = p;   end_of_deck_seen = IPC_FALSE;   num_records = 0;   fill_count = 0;      status = ipc_transport_initialize_server (server_name, m, p,                                             batch_filename);   if (status != IPC_STATUS_OK) {      fprintf (stderr, "ERROR: IPC: error initializing server\n");      return IPC_STATUS_ERROR;   }   if (mode == IPC_MODE_BATCH) {#ifdef IPC_AEGIS_MAILBOXES      strcat (batch_filename, ".log");#endif      batch_fd = open (batch_filename, O_WRONLY | O_CREAT, 0666);      if (batch_fd < 0) {         fprintf (stderr, "ERROR: IPC: Error opening batch output file: %s\n",                  batch_filename);         perror ("IPC");         return IPC_STATUS_ERROR;      }   }   return status;}/*---------------------------------------------------------------------------*//*ipc_terminate_serverThis function deallocates the interprocess communication channelmailbox or socket.*/Ipc_Status_t ipc_terminate_server (){   return ipc_transport_terminate_server ();}/*---------------------------------------------------------------------------*//*ipc_get_lineThis function gets a SPICE deck input line from the interprocesscommunication channel.  Any special control commands in the deckbeginning with a ``>'' or ``#'' character are processed internally bythis function and not returned to SPICE.*/Ipc_Status_t ipc_get_line (str, len, wait)     char               *str;   /* Text retrieved from IPC channel */     int                *len;   /* Length of text string */     Ipc_Wait_t         wait;   /* Select blocking or non-blocking */     /*      * Reads one SPICE line from the connection. Strips any control lines      * which cannot be interpretted by the simulator (e.g. >INQCON) and      * processes them.  If such a line is read, it is processed and the next      * line is read.  `ipc_get_line' does not return until a non-interceptable      * line is read or end of file.      *      * If `wait' is IPC_NO_WAIT and there is no data available on the      * connection, `ipc_get_line' returns IPC_STATUS_NO_DATA. If `wait' is      * IPC_WAIT, `ipc_get_line' will not return until there is data available      * or and end of file condition is reached or an error occurs.      *      * Intercepts and processes the following commands:      *    #RETURNI, #MINTIME, #VTRANS,      *    >PAUSE, >CONT, >STOP, >INQCON, >NETLIST, >ENDNET      * Other > records are silently ignored.      *      * Intercepts old-style .TEMP card generated by MSPICE      *      * Returns:      *    IPC_STATUS_OK                - for successful reads      *    IPC_STATUS_NO_DATA           - when NO_WAIT and no data available      *    IPC_STATUS_END_OF_DECK       - at end of deck (>ENDNET seen)      *    IPC_STATUS_ERROR             - otherwise      */{   Ipc_Status_t status;   Ipc_Boolean_t need_another = IPC_TRUE;      do {      status = ipc_transport_get_line (str, len, wait);            switch (status) {      case IPC_STATUS_NO_DATA:      case IPC_STATUS_ERROR:         need_another = IPC_FALSE;         break;      case IPC_STATUS_END_OF_DECK:         assert (0); /* should never get this from the low-level get-line */         status = IPC_STATUS_ERROR;         need_another = IPC_FALSE;         break;      case IPC_STATUS_OK:         /*          * Got a good line - check to see if it's one of the ones we need to          * intercept          */         if (str[0] == '>') {            if (kw_match (">STOP", str)) {               ipc_handle_stop();            } else if (kw_match (">PAUSE", str)) {               /* assert (need_another); */               /*                * once more around the loop to do a blocking wait for the >CONT                */               need_another = IPC_TRUE;               wait = IPC_WAIT;            } else if (kw_match (">INQCON", str)) {               ipc_send_line (">ABRTABL");               ipc_send_line (">PAUSABL");               ipc_send_line (">KEEPABL");               status = ipc_flush ();               if (IPC_STATUS_OK != status) {                  need_another = IPC_FALSE;               }            } else if (kw_match (">ENDNET", str)) {               end_of_deck_seen = IPC_TRUE;               need_another = IPC_FALSE;               status = IPC_STATUS_END_OF_DECK;            } else {               /* silently ignore */            }         } else if (str[0] == '#') {            if (kw_match ("#RETURNI", str)) {               ipc_handle_returni ();            } else if (kw_match ("#MINTIME", str)) {               double d1, d2;               if (1 != sscanf (&str[8], "%lg", &d1)) {                  status = IPC_STATUS_ERROR;                  need_another = IPC_FALSE;               } else {                  ipc_handle_mintime (d1);               }            } else if (kw_match ("#VTRANS", str)) {               char *tok1;               char *tok2;               char *tok3;                              tok1 = &str[8];               for (tok2 = tok1; *tok2; tok2++) {                  if (isspace(*tok2)) {                     *tok2 = '\0';                     tok2++;                     break;                  }               }               for(tok3 = tok2; *tok3; tok3++) {                   if(isspace(*tok3)) {                       *tok3 = '\0';                       break;                   }               }               ipc_handle_vtrans (tok1, tok2);            } else {               /* silently ignore */            }         } else if (str[0] == '.') {            if (kw_match (".TEMP", str)) {               /* don't pass .TEMP card to caller */               printf("Old-style .TEMP card found - ignored\n");            }            else {               /* pass all other . cards to the caller */               need_another = IPC_FALSE;            }         } else {            /*             * Not a '>' or '#' record - let the caller deal with it             */            need_another = IPC_FALSE;         }         break;      default:         /*          * some unknown status value!          */         assert (0);         status = IPC_STATUS_ERROR;         need_another = IPC_FALSE;         break;      }   } while (need_another);   return status;}/*---------------------------------------------------------------------------*//*ipc_flushThis function flushes the interprocess communication channelbuffer contents.*/Ipc_Status_t ipc_flush ()     /*      * Flush all buffered messages out the connection.      */{   Ipc_Status_t status;   int last = 0;   int bytes;   int i;   /* if batch mode */   if (mode == IPC_MODE_BATCH) {      assert (batch_fd >= 0);      /* for number of records in buffer */      for (i = 0; i < num_records; i++) {         /* write the records to the .log file */         if ((end_of_record_index [i] - last) !=               write (batch_fd, &out_buffer[last], end_of_record_index [i] - last)) {            fprintf (stderr,                     "ERROR: IPC: Error writing to batch output file\n");            perror ("IPC");            return IPC_STATUS_ERROR;         }         /* If the record is one of the batch simulation status messages, */         /* send it over the ipc channel too */         if( kw_match("#ERRCHK",  &out_buffer[last]) ||             kw_match(">ENDANAL", &out_buffer[last]) ||             kw_match(">ABORTED", &out_buffer[last]) ) {            status = ipc_transport_send_line (&out_buffer[last],                                              end_of_record_index [i] - last);            if (IPC_STATUS_OK != status) {               return status;            }         }         last = end_of_record_index [i];      }   /* else, must be interactive mode */   } else {      /* send the full buffer over the ipc channel */      status = ipc_transport_send_line (&out_buffer[0],                   end_of_record_index [num_records - 1]);      if (IPC_STATUS_OK != status) {         return status;      }   }   /* reset counts to zero and return */   num_records = 0;   fill_count = 0;   return IPC_STATUS_OK;}/*---------------------------------------------------------------------------*/static Ipc_Status_t ipc_send_line_binary (str, len)     char *str;     int  len;     /*      * Same as `ipc_send_line' except does not expect the str to be null      * terminated. Sends exactly `len' characters. Use this for binary data      * strings that may have embedded nulls.      *      * Modified by wbk to append newlines for compatibility with      * ATESSE 1.0      *      */{   int length = len + 1;   int diff;   Ipc_Status_t status;   /*    * If we can't add the whole str to the buffer, or if there are no more    * record indices free, flush the buffer:    */   if (((fill_count + length) >= OUT_BUFFER_SIZE) ||       (num_records >= MAX_NUM_RECORDS)) {      status = ipc_flush ();      if (IPC_STATUS_OK != status) {         return status;      }   }      /*    * make sure that the str will fit:    */   if (length + fill_count > OUT_BUFFER_SIZE) {      fprintf (stderr,               "ERROR: IPC: String too long to fit in output buffer (> %d bytes) - truncated\n",               OUT_BUFFER_SIZE);      length = OUT_BUFFER_SIZE - fill_count;   }   /*    * finally, concatenate the str to the end of the buffer and add the newline:    */   memcpy (&out_buffer[fill_count], str, len);   fill_count += len;   out_buffer[fill_count] = '\n';   fill_count++;   end_of_record_index [num_records++] = fill_count;      return IPC_STATUS_OK;}/*---------------------------------------------------------------------------*//*ipc_send_line

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区鲁丝不卡| 99久久99久久免费精品蜜臀| 国产精品1区2区| 色8久久人人97超碰香蕉987| 欧美电影免费观看高清完整版在线观看| 国产精品视频一二三区| 蜜桃视频在线观看一区| 91激情五月电影| 亚洲欧美一区二区在线观看| 国精产品一区一区三区mba视频| 在线观看欧美精品| 中文字幕av一区二区三区免费看| 蜜芽一区二区三区| 欧美日韩一区二区三区在线| 亚洲理论在线观看| 99国产精品久久久| 国产精品网站在线观看| 国产真实乱子伦精品视频| 欧美日韩你懂的| 有码一区二区三区| av中文字幕不卡| 国产精品乱码一区二区三区软件| 国产精品一区二区无线| 日韩精品自拍偷拍| 免费成人你懂的| 精品久久久三级丝袜| 久久99国产精品久久| 日韩欧美一区二区三区在线| 日韩国产欧美三级| 欧美一级日韩免费不卡| 蜜臀久久99精品久久久画质超高清| 欧美吻胸吃奶大尺度电影| 亚洲免费观看高清完整| 色菇凉天天综合网| 亚洲一区二区三区视频在线播放| 欧美影视一区在线| 亚洲电影第三页| 欧美一区二区福利在线| 日本aⅴ精品一区二区三区| 欧美日韩mp4| 麻豆91精品91久久久的内涵| 精品美女一区二区| 国产成人精品www牛牛影视| 欧美国产日韩精品免费观看| 国产丶欧美丶日本不卡视频| 欧美国产日韩a欧美在线观看| 99riav久久精品riav| 亚洲午夜免费福利视频| 日韩视频一区二区三区在线播放 | 欧美日韩中文精品| 图片区日韩欧美亚洲| 日韩午夜在线观看| 丁香六月综合激情| 樱花草国产18久久久久| 欧美男女性生活在线直播观看| 久久国产视频网| 国产精品天干天干在线综合| 色婷婷一区二区三区四区| 亚洲成人久久影院| 精品国产髙清在线看国产毛片| 国产成人精品免费网站| 一区二区免费视频| 久久久国产精品麻豆| 色欧美乱欧美15图片| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产视频一区在线观看 | 国产精品三级av| 精品视频999| 国产乱码精品1区2区3区| 亚洲精品视频在线观看网站| 日韩欧美高清dvd碟片| 一本色道综合亚洲| 精品一区二区综合| 曰韩精品一区二区| 国产喷白浆一区二区三区| 在线观看亚洲成人| 懂色av中文字幕一区二区三区| 亚洲小说欧美激情另类| 久久久蜜臀国产一区二区| 欧美三级蜜桃2在线观看| 国产91精品精华液一区二区三区| 亚洲大片精品永久免费| 中文字幕欧美日韩一区| 日韩欧美一二区| 欧美三级三级三级| 91蝌蚪国产九色| 国产一区二区福利视频| 亚洲18女电影在线观看| 亚洲乱码中文字幕| 国产午夜精品久久久久久久| 8v天堂国产在线一区二区| 色女孩综合影院| 波多野结衣中文一区| 国产精品一卡二卡在线观看| 蜜桃一区二区三区四区| 午夜精品国产更新| 亚洲午夜激情网站| 中文字幕佐山爱一区二区免费| 久久精品视频一区二区| 精品国产乱码久久久久久免费| 欧美精品三级在线观看| 欧美四级电影网| 欧美午夜电影网| 欧美日韩一区视频| 欧美视频一区二| 91精品办公室少妇高潮对白| 不卡在线观看av| 成人久久视频在线观看| 成人性生交大片免费| 高清在线不卡av| 国产 欧美在线| 国产成人aaa| 成人深夜福利app| 成人一区二区三区中文字幕| 国产精品99久久久| 成人福利视频在线看| 成人黄色免费短视频| 成人黄色国产精品网站大全在线免费观看 | 在线精品视频免费观看| 91成人在线免费观看| 在线免费观看日本一区| 欧美最猛黑人xxxxx猛交| 欧美系列在线观看| 91精品国产综合久久久久久漫画| 欧美日韩不卡一区二区| 日韩亚洲欧美成人一区| 久久久久久久久久久久久夜| 国产婷婷色一区二区三区| 国产精品污www在线观看| 一区二区三区不卡视频在线观看| 一区二区三区色| 日日夜夜免费精品视频| 狠狠色狠狠色综合日日91app| 国产精品白丝av| www.av亚洲| 精品视频123区在线观看| 欧美大片拔萝卜| 中国av一区二区三区| 亚洲成人一二三| 国产毛片精品国产一区二区三区| 99久久综合精品| 欧美日韩中文字幕一区二区| 精品久久久久久久久久久久久久久| 国产欧美一区二区三区沐欲| 亚洲精品久久久久久国产精华液| 亚洲成a人v欧美综合天堂下载| 久久草av在线| 色婷婷精品久久二区二区蜜臀av| 欧美一区二区三级| 国产精品毛片久久久久久| 日韩精品电影在线| 粉嫩av一区二区三区| 91精品国产色综合久久不卡电影| 久久久久99精品一区| 亚洲尤物在线视频观看| 狠狠久久亚洲欧美| 欧美婷婷六月丁香综合色| 欧美本精品男人aⅴ天堂| 亚洲伦理在线免费看| 国产一区二区在线影院| 欧美性三三影院| 国产日韩欧美不卡在线| 日韩黄色在线观看| 91丨porny丨蝌蚪视频| 日韩精品一区在线| 亚洲图片自拍偷拍| 成人国产在线观看| 精品国产乱码久久久久久蜜臀 | 色一情一乱一乱一91av| 欧美成人精品1314www| 一区二区三区四区亚洲| 成人午夜电影久久影院| 日韩精品一区二区三区老鸭窝 | 亚洲天堂免费看| 国产乱人伦精品一区二区在线观看| 欧美久久久一区| 亚洲国产视频直播| 91色视频在线| 国产精品免费av| 国内精品久久久久影院薰衣草| 91精品国产一区二区三区| 亚洲曰韩产成在线| 在线观看国产日韩| 亚洲免费资源在线播放| 成人美女视频在线观看| 国产亚洲精品7777| 国模大尺度一区二区三区| 91精品国产综合久久久久久久久久| 一区二区三区四区不卡在线 | 高清shemale亚洲人妖| 欧美大片顶级少妇| 蜜臀久久99精品久久久久宅男 | 日本一区二区三区在线观看| 久久国产欧美日韩精品| 日韩一卡二卡三卡国产欧美| 日韩在线播放一区二区| 在线观看免费一区| 亚洲福利电影网| 欧美美女直播网站| 日韩av中文字幕一区二区三区|