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

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

?? cplmatch.c

?? BCAST Implementation for NS2
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * Copyright (c) 2000, 2001 by Martin C. Shepherd. *  * All rights reserved. *  * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, and/or sell copies of the Software, and to permit persons * to whom the Software is furnished to do so, provided that the above * copyright notice(s) and this permission notice appear in all copies of * the Software and that both the above copyright notice(s) and this * permission notice appear in supporting documentation. *  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *  * Except as contained in this notice, the name of a copyright holder * shall not be used in advertising or otherwise to promote the sale, use * or other dealings in this Software without prior written authorization * of the copyright holder. *//* * Standard includes. */#include <stdlib.h>#include <stdio.h>#include <string.h>/* * Local includes. */#include "libtecla.h"#include "stringrp.h"#include "pathutil.h"#include "cplfile.h"/* * Specify the number of strings to allocate when the string free-list * is exhausted. This also sets the number of elements to expand the * matches[] array by whenever it is found to be too small. */#define STR_BLK_FACT 100/* * Set the max length of the error-reporting string. There is no point * in this being longer than the width of a typical terminal window. * In composing error messages, I have assumed that this number is * at least 80, so don't decrease it below 80. */#define ERRLEN 200/* * Completion matches are recorded in containers of the following * type. */struct WordCompletion {  StringGroup *sg;        /* Memory for a group of strings */  int matches_dim;        /* The allocated size of result.matches[] */  char errmsg[ERRLEN+1];  /* The error-reporting buffer */  CplMatches result;      /* Completions to be returned to the caller */  CompleteFile *cf;       /* The resources used for filename completion */};static void cpl_sort_matches(WordCompletion *cpl);static void cpl_zap_duplicates(WordCompletion *cpl);static void cpl_clear_completions(WordCompletion *cpl);static int cpl_cmp_matches(const void *v1, const void *v2);static int cpl_cmp_suffixes(const void *v1, const void *v2);/* * The new_CplFileConf() constructor sets the integer first member of * the returned object to the following magic number. On seeing this, * cpl_file_completions() knows when it is passed a valid CplFileConf * object. */#define CFC_ID_CODE 4568/* * A pointer to a structure of the following type can be passed to * the builtin file-completion callback function to modify its behavior. */struct CplFileConf {  int id;             /* new_CplFileConf() sets this to CFC_ID_CODE */  int escaped;        /* If none-zero, backslashes in the input line are */                      /*  interpreted as escaping special characters and */                      /*  spaces, and any special characters and spaces in */                      /*  the listed completions will also be escaped with */                      /*  added backslashes. This is the default behaviour. */                      /* If zero, backslashes are interpreted as being */                      /*  literal parts of the filename, and none are added */                      /*  to the completion suffixes. */  int file_start;     /* The index in the input line of the first character */                      /*  of the filename. If you specify -1 here, */                      /*  cpl_file_completions() identifies the */                      /*  the start of the filename by looking backwards for */                      /*  an unescaped space, or the beginning of the line. */  CplCheckFn *chk_fn; /* If not zero, this argument specifies a */                      /*  function to call to ask whether a given */                      /*  file should be included in the list */                      /*  of completions. */  void *chk_data;     /* Anonymous data to be passed to check_fn(). */};static void cpl_init_FileConf(CplFileConf *cfc);/*....................................................................... * Create a new string-completion object. * * Output: *  return    WordCompletion *  The new object, or NULL on error. */WordCompletion *new_WordCompletion(void){  WordCompletion *cpl;  /* The object to be returned *//* * Allocate the container. */  cpl = (WordCompletion *) malloc(sizeof(WordCompletion));  if(!cpl) {    fprintf(stderr, "new_WordCompletion: Insufficient memory.\n");    return NULL;  };/* * Before attempting any operation that might fail, initialize the * container at least up to the point at which it can safely be passed * to del_WordCompletion(). */  cpl->sg = NULL;  cpl->matches_dim = 0;  cpl->result.suffix = NULL;  cpl->result.cont_suffix = NULL;  cpl->result.matches = NULL;  cpl->result.nmatch = 0;  cpl->cf = NULL;/* * Allocate an object that allows a group of strings to be allocated * efficiently by placing many of them in contiguous string segments. */  cpl->sg = _new_StringGroup(_pu_pathname_dim());  if(!cpl->sg)    return del_WordCompletion(cpl);/* * Allocate an array for matching completions. This will be extended later * if needed. */  cpl->matches_dim = STR_BLK_FACT;  cpl->result.matches = (CplMatch *) malloc(sizeof(cpl->result.matches[0]) *					    cpl->matches_dim);  if(!cpl->result.matches) {    fprintf(stderr,     "new_WordCompletion: Insufficient memory to allocate array of matches.\n");    return del_WordCompletion(cpl);  };/* * Allocate a filename-completion resource object. */  cpl->cf = _new_CompleteFile();  if(!cpl->cf)    return del_WordCompletion(cpl);  return cpl;}/*....................................................................... * Delete a string-completion object. * * Input: *  cpl    WordCompletion *  The object to be deleted. * Output: *  return WordCompletion *  The deleted object (always NULL). */WordCompletion *del_WordCompletion(WordCompletion *cpl){  if(cpl) {    cpl->sg = _del_StringGroup(cpl->sg);    if(cpl->result.matches) {      free(cpl->result.matches);      cpl->result.matches = NULL;      cpl->cf = _del_CompleteFile(cpl->cf);    };    free(cpl);  };  return NULL;}/*....................................................................... * This function is designed to be called by CplMatchFn callback * functions. It adds one possible completion of the token that is being * completed to an array of completions. If the completion needs any * special quoting to be valid when displayed in the input line, this * quoting must be included in the string. * * Input: *  cpl     WordCompletion *  The argument of the same name that was passed *                            to the calling CplMatchFn callback function. *  line        const char *  The input line, as received by the callback *                            function. *  word_start         int    The index within line[] of the start of the *                            word that is being completed. *  word_end           int    The index within line[] of the character which *                            follows the incomplete word, as received by the *                            calling callback function. *  suffix      const char *  The appropriately quoted string that could *                            be appended to the incomplete token to complete *                            it. A copy of this string will be allocated *                            internally. *  type_suffix const char *  When listing multiple completions, gl_get_line() *                            appends this string to the completion to indicate *                            its type to the user. If not pertinent pass "". *                            Otherwise pass a literal or static string. *  cont_suffix const char *  If this turns out to be the only completion, *                            gl_get_line() will append this string as *                            a continuation. For example, the builtin *                            file-completion callback registers a directory *                            separator here for directory matches, and a *                            space otherwise. If the match were a function *                            name you might want to append an open *                            parenthesis, etc.. If not relevant pass "". *                            Otherwise pass a literal or static string. * Output: *  return             int    0 - OK. *                            1 - Error. */int cpl_add_completion(WordCompletion *cpl, const char *line,		       int word_start, int word_end, const char *suffix,		       const char *type_suffix, const char *cont_suffix){  CplMatch *match; /* The container of the new match */  char *string;    /* A newly allocated copy of the completion string *//* * Check the arguments. */  if(!cpl)    return 1;  if(!suffix)    return 0;  if(!type_suffix)    type_suffix = "";  if(!cont_suffix)    cont_suffix = "";/* * Do we need to extend the array of matches[]? */  if(cpl->result.nmatch+1 > cpl->matches_dim) {    int needed = cpl->matches_dim + STR_BLK_FACT;    CplMatch *matches = (CplMatch *) realloc(cpl->result.matches,			    sizeof(cpl->result.matches[0]) * needed);    if(!matches) {      strcpy(cpl->errmsg, "Insufficient memory to extend array of matches.");      return 1;    };    cpl->result.matches = matches;    cpl->matches_dim = needed;  };/* * Allocate memory to store the combined completion prefix and the * new suffix. */  string = _sg_alloc_string(cpl->sg, word_end-word_start + strlen(suffix));  if(!string) {    strcpy(cpl->errmsg, "Insufficient memory to extend array of matches.");    return 1;  };/* * Compose the string. */  strncpy(string, line + word_start, word_end - word_start);  strcpy(string + word_end - word_start, suffix);/* * Record the new match. */  match = cpl->result.matches + cpl->result.nmatch++;  match->completion = string;  match->suffix = string + word_end - word_start;  match->type_suffix = type_suffix;/* * Record the continuation suffix. */  cpl->result.cont_suffix = cont_suffix;  return 0;}/*....................................................................... * Sort the array of matches. * * Input: *  cpl   WordCompletion *  The completion resource object. */static void cpl_sort_matches(WordCompletion *cpl){  qsort(cpl->result.matches, cpl->result.nmatch,	sizeof(cpl->result.matches[0]), cpl_cmp_matches);}/*....................................................................... * This is a qsort() comparison function used to sort matches. * * Input: *  v1, v2   void *  Pointers to the two matches to be compared. * Output: *  return    int    -1 -> v1 < v2. *                    0 -> v1 == v2 *                    1 -> v1 > v2 */static int cpl_cmp_matches(const void *v1, const void *v2){  const CplMatch *m1 = (const CplMatch *) v1;  const CplMatch *m2 = (const CplMatch *) v2;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区在线观看| 天天综合天天综合色| 一区二区免费视频| 黄页网站大全一区二区| 93久久精品日日躁夜夜躁欧美| 欧美肥胖老妇做爰| 亚洲精品国产一区二区精华液| 久久99久久精品| 色女孩综合影院| 国产精品午夜免费| 国产最新精品精品你懂的| 欧美色图天堂网| 中文字幕亚洲区| 国产精品亚洲人在线观看| 91精品视频网| 亚洲mv大片欧洲mv大片精品| 北条麻妃一区二区三区| 日韩欧美国产精品| 免费在线观看一区| 欧美日韩另类国产亚洲欧美一级| 成人欧美一区二区三区小说 | 欧美电影免费提供在线观看| 亚洲国产裸拍裸体视频在线观看乱了| 成人少妇影院yyyy| 欧美激情在线看| 国产成人午夜视频| 久久精品日韩一区二区三区| 美女视频黄久久| 欧美一级片在线看| 久久国内精品视频| 日韩一级在线观看| 久久国产精品露脸对白| 日韩欧美国产1| 国产一区二区三区四| www国产成人免费观看视频 深夜成人网 | 亚洲自拍偷拍麻豆| 在线观看国产一区二区| 亚洲观看高清完整版在线观看| 91在线观看免费视频| 日韩理论片网站| 色综合欧美在线视频区| 亚洲国产精品精华液网站 | 91蝌蚪porny九色| 亚洲日本va在线观看| 日本福利一区二区| 亚洲福利一区二区| 日韩精品一区二区在线| 国产精品综合在线视频| 中文字幕不卡在线观看| 91在线精品一区二区三区| 一区二区三区精品久久久| 欧美在线观看视频一区二区| 丝袜美腿成人在线| 亚洲精品一区在线观看| 成人精品国产福利| 夜夜嗨av一区二区三区网页| 337p亚洲精品色噜噜噜| 国产一区免费电影| 亚洲人成伊人成综合网小说| 欧美日韩黄视频| 精东粉嫩av免费一区二区三区| 国产精品人成在线观看免费| 欧美私模裸体表演在线观看| 精品一区二区三区在线观看 | 热久久一区二区| 久久精品夜色噜噜亚洲a∨| av中文字幕不卡| 日韩国产精品91| 国产欧美精品一区二区色综合| 91免费版在线| 久久99精品久久久久| 亚洲人成人一区二区在线观看 | 91精品国产综合久久香蕉麻豆| 国内精品伊人久久久久av影院| 日本一区二区视频在线| 欧美日韩一区高清| 国产二区国产一区在线观看| 亚洲高清一区二区三区| 日本一区二区三区四区| 欧美一区二区在线观看| 91美女在线视频| 国产大陆a不卡| 午夜电影久久久| 亚洲欧洲另类国产综合| 欧美sm美女调教| 在线国产亚洲欧美| 99久久综合精品| 国产精品88888| 麻豆精品精品国产自在97香蕉| 亚洲免费av在线| 中文字幕一区在线观看| 久久久久久免费网| 91精品国产色综合久久久蜜香臀| 99国产一区二区三精品乱码| 国产精品一区二区三区乱码| 日本亚洲天堂网| 亚洲国产日韩综合久久精品| 国产精品卡一卡二| 国产欧美一区二区精品忘忧草| 91精品国产综合久久精品| 色一情一乱一乱一91av| 不卡在线视频中文字幕| 国产成人综合在线观看| 久久国产免费看| 免费精品视频在线| 蜜臀91精品一区二区三区| 日本女人一区二区三区| 午夜一区二区三区在线观看| 一区二区欧美国产| 亚洲观看高清完整版在线观看 | 一区二区三区四区蜜桃| 亚洲欧洲99久久| 国产精品传媒入口麻豆| 亚洲欧美综合另类在线卡通| 国产精品沙发午睡系列990531| 国产拍欧美日韩视频二区| 国产日韩精品一区二区浪潮av| 欧美成人bangbros| 久久久久久久久久久久久女国产乱 | 日本亚洲三级在线| 日精品一区二区三区| 全国精品久久少妇| 久久精品国产免费看久久精品| 久久精品国产999大香线蕉| 蜜桃视频在线一区| 国产乱理伦片在线观看夜一区| 国产一区啦啦啦在线观看| 丰满白嫩尤物一区二区| 粉嫩av一区二区三区粉嫩| 成人精品小蝌蚪| 一本一道波多野结衣一区二区| 91福利精品视频| 欧美福利视频一区| 日韩欧美国产成人一区二区| 久久精品一区蜜桃臀影院| 一区在线播放视频| 亚洲自拍偷拍综合| 美日韩一级片在线观看| 国产成人av电影在线播放| 不卡视频一二三| 欧美午夜精品一区二区三区| 日韩一级免费一区| 欧美激情一区二区三区在线| 亚洲欧美色图小说| 日韩中文字幕亚洲一区二区va在线| 久久精品国产一区二区三区免费看| 国产精品一二三区| 欧美三级在线视频| 久久精品人人做人人爽人人| 亚洲免费观看高清完整| 免费一级欧美片在线观看| 国产成人午夜片在线观看高清观看| 色天使久久综合网天天| 精品国产一区二区三区忘忧草 | 久久97超碰国产精品超碰| 成人少妇影院yyyy| 91精品国产一区二区三区香蕉| 国产欧美日韩精品一区| 婷婷综合在线观看| 成人va在线观看| 欧美高清hd18日本| 中文字幕中文字幕中文字幕亚洲无线| 亚洲大型综合色站| 国产91精品久久久久久久网曝门| 欧美性受极品xxxx喷水| 国产欧美视频一区二区| 日本vs亚洲vs韩国一区三区| 99免费精品在线观看| 精品美女被调教视频大全网站| 亚洲精品视频在线观看网站| 久88久久88久久久| 欧美乱熟臀69xxxxxx| 亚洲欧美自拍偷拍色图| 国产精品一区二区三区乱码| 日韩亚洲欧美成人一区| 亚洲成人av电影在线| 色婷婷综合久色| 中文av一区特黄| 麻豆精品在线看| 欧美一区在线视频| 亚洲高清久久久| 日本韩国精品一区二区在线观看| 久久青草欧美一区二区三区| 欧美aa在线视频| 欧美一区二区观看视频| 亚洲午夜精品在线| 91欧美一区二区| 中文字幕日韩精品一区| 成人在线一区二区三区| 2021中文字幕一区亚洲| 日韩av一区二区在线影视| 欧美日韩精品是欧美日韩精品| 亚洲欧美日韩在线不卡| 91偷拍与自偷拍精品| 亚洲欧洲av在线| 91在线观看视频| 亚洲精品中文字幕乱码三区| 95精品视频在线| 亚洲综合自拍偷拍| 欧美在线短视频|