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

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

?? expand.c

?? BCAST Implementation for NS2
?? C
?? 第 1 頁 / 共 3 頁
字號:
        return 0;      };      break;    };/* * After passing the first character, turn off the explicit match * requirement. */    xplicit = 0;  };/* * To get here the pattern must have been exhausted. If the filename * string matched, then the filename string must also have been * exhausted. */  return *fptr == '\0';}/*....................................................................... * Match a character range expression terminated by an unescaped close * square bracket. * * Input: *  c               int     The character to be matched with the range *                          pattern. *  pattern  const char *   The range pattern to be matched (ie. after the *                          initiating '[' character). *  endp     const char **  On output a pointer to the character following the *                          range expression will be assigned to *endp. * Output: *  return          int     0 - Doesn't match. *                          1 - The character matched. */static int ef_matches_range(int c, const char *pattern, const char **endp){  const char *pptr = pattern;  /* The pointer used to scan the pattern */  int invert = 0;              /* True to invert the sense of the match */  int matched = 0;             /* True if the character matched the pattern *//* * If the first character is a caret, the sense of the match is * inverted and only if the character isn't one of those in the * range, do we say that it matches. */  if(*pptr == '^') {    pptr++;    invert = 1;  };/* * The hyphen is only a special character when it follows the first * character of the range (not including the caret). */  if(*pptr == '-') {    pptr++;    if(c == '-') {      *endp = pptr;      matched = 1;    };/* * Skip other leading '-' characters since they make no sense. */    while(*pptr == '-')      pptr++;  };/* * The hyphen is only a special character when it follows the first * character of the range (not including the caret or a hyphen). */  if(*pptr == ']') {    pptr++;    if(c == ']') {      *endp = pptr;      matched = 1;    };  };/* * Having dealt with the characters that have special meanings at * the beginning of a character range expression, see if the * character matches any of the remaining characters of the range, * up until a terminating ']' character is seen. */  while(!matched && *pptr && *pptr != ']') {/* * Is this a range of characters signaled by the two end characters * separated by a hyphen? */    if(*pptr == '-') {      if(pptr[1] != ']') {        if(c >= pptr[-1] && c <= pptr[1])	  matched = 1;	pptr += 2;      };/* * A normal character to be compared directly. */    } else if(*pptr++ == c) {      matched = 1;    };  };/* * Find the terminating ']'. */  while(*pptr && *pptr != ']')    pptr++;/* * Did we find a terminating ']'? */  if(*pptr == ']') {    *endp = pptr + 1;    return matched ? !invert : invert;  };/* * If the pattern didn't end with a ']' then it doesn't match, regardless * of the value of the required sense of the match. */  *endp = pptr;  return 0;}/*....................................................................... * This is a qsort() comparison function used to sort strings. * * Input: *  v1, v2   void *  Pointers to the two strings to be compared. * Output: *  return    int    -1 -> v1 < v2. *                    0 -> v1 == v2 *                    1 -> v1 > v2 */static int ef_cmp_strings(const void *v1, const void *v2){  char * const *s1 = (char * const *) v1;  char * const *s2 = (char * const *) v2;  return strcmp(*s1, *s2);}/*....................................................................... * Preprocess a path, expanding ~/, ~user/ and $envvar references, using * ef->path as a work buffer, then copy the result into a cache entry, * and return a pointer to this copy. * * Input: *  ef    ExpandFile *  The resource object of the file matcher. *  pathlen      int    The length of the prefix of path[] to be expanded. * Output: *  return      char *  A pointer to a copy of the output path in the *                      cache. On error NULL is returned, and a description *                      of the error is left in ef->errmsg[]. */static char *ef_expand_special(ExpandFile *ef, const char *path, int pathlen){  int spos;      /* The index of the start of the path segment that needs */                 /*  to be copied from path[] to the output pathname. */  int ppos;      /* The index of a character in path[] */  char *pptr;    /* A pointer into the output path */  int escaped;   /* True if the previous character was a '\' */  int i;/* * Clear the pathname buffer. */  _pn_clear_path(ef->path);/* * We need to perform two passes, one to expand environment variables * and a second to do tilde expansion. This caters for the case * where an initial dollar expansion yields a tilde expression. */  escaped = 0;  for(spos=ppos=0; ppos < pathlen; ppos++) {    int c = path[ppos];    if(escaped) {      escaped = 0;    } else if(c == '\\') {      escaped = 1;    } else if(c == '$') {      int envlen;   /* The length of the environment variable */      char *value;  /* The value of the environment variable *//* * Record the preceding unrecorded part of the pathname. */      if(spos < ppos && _pn_append_to_path(ef->path, path + spos, ppos-spos, 0)	 == NULL) {	strcpy(ef->errmsg, "Insufficient memory to expand path");	return NULL;      };/* * Skip the dollar. */      ppos++;/* * Copy the environment variable name that follows the dollar into * ef->envnam[], stopping if a directory separator or end of string * is seen. */      for(envlen=0; envlen<ENV_LEN && ppos < pathlen &&	  strncmp(path + ppos, FS_DIR_SEP, FS_DIR_SEP_LEN); envlen++)	ef->envnam[envlen] = path[ppos++];/* * If the username overflowed the buffer, treat it as invalid (note that * on most unix systems only 8 characters are allowed in a username, * whereas our ENV_LEN is much bigger than that. */      if(envlen >= ENV_LEN) {	strcpy(ef->errmsg, "Environment variable name too long");	return NULL;      };/* * Terminate the environment variable name. */      ef->envnam[envlen] = '\0';/* * Lookup the value of the environment variable. */      value = getenv(ef->envnam);      if(!value) {	const char *fmt = "No expansion found for: $%.*s";	sprintf(ef->errmsg, fmt, ERRLEN - strlen(fmt), ef->envnam);	return NULL;      };/* * Copy the value of the environment variable into the output pathname. */      if(_pn_append_to_path(ef->path, value, -1, 0) == NULL) {	strcpy(ef->errmsg, "Insufficient memory to expand path");	return NULL;      };/* * Record the start of the uncopied tail of the input pathname. */      spos = ppos;    };  };/* * Record the uncopied tail of the pathname. */  if(spos < ppos && _pn_append_to_path(ef->path, path + spos, ppos-spos, 0)     == NULL) {    strcpy(ef->errmsg, "Insufficient memory to expand path");    return NULL;  };/* * If the first character of the resulting pathname is a tilde, * then attempt to substitute the home directory of the specified user. */  pptr = ef->path->name;  if(*pptr == '~' && path[0] != '\\') {    int usrlen;           /* The length of the username following the tilde */    const char *homedir;  /* The home directory of the user */    int homelen;          /* The length of the home directory string */    int plen;             /* The current length of the path */    int skip=0;           /* The number of characters to skip after the ~user *//* * Get the current length of the output path. */    plen = strlen(ef->path->name);/* * Skip the tilde. */    pptr++;/* * Copy the optional username that follows the tilde into ef->usrnam[]. */    for(usrlen=0; usrlen<USR_LEN && *pptr &&	strncmp(pptr, FS_DIR_SEP, FS_DIR_SEP_LEN); usrlen++)      ef->usrnam[usrlen] = *pptr++;/* * If the username overflowed the buffer, treat it as invalid (note that * on most unix systems only 8 characters are allowed in a username, * whereas our USR_LEN is much bigger than that. */    if(usrlen >= USR_LEN) {      strcpy(ef->errmsg, "Username too long");      return NULL;    };/* * Terminate the username string. */    ef->usrnam[usrlen] = '\0';/* * Lookup the home directory of the user. */    homedir = _hd_lookup_home_dir(ef->home, ef->usrnam);    if(!homedir) {      strncpy(ef->errmsg, _hd_last_home_dir_error(ef->home), ERRLEN);      ef->errmsg[ERRLEN] = '\0';      return NULL;    };    homelen = strlen(homedir);/* * ~user and ~ are usually followed by a directory separator to * separate them from the file contained in the home directory. * If the home directory is the root directory, then we don't want * to follow the home directory by a directory separator, so we must * erase it. */    if(strcmp(homedir, FS_ROOT_DIR) == 0 &&       strncmp(pptr, FS_DIR_SEP, FS_DIR_SEP_LEN) == 0) {      skip = FS_DIR_SEP_LEN;    };/* * If needed, increase the size of the pathname buffer to allow it * to accomodate the home directory instead of the tilde expression. * Note that pptr may not be valid after this call. */    if(_pn_resize_path(ef->path, plen - usrlen - 1 - skip + homelen)==NULL) {      strcpy(ef->errmsg, "Insufficient memory to expand filename");      return NULL;    };/* * Move the part of the pathname that follows the tilde expression to * the end of where the home directory will need to be inserted. */    memmove(ef->path->name + homelen,	    ef->path->name + 1 + usrlen + skip, plen - usrlen - 1 - skip+1);/* * Write the home directory at the beginning of the string. */    for(i=0; i<homelen; i++)      ef->path->name[i] = homedir[i];  };/* * Copy the result into the cache, and return a pointer to the copy. */  return ef_cache_pathname(ef, ef->path->name, 0);}/*....................................................................... * Return a description of the last path-expansion error that occurred. * * Input: *  ef     ExpandFile *   The path-expansion resource object. * Output: *  return       char *   The description of the last error. */const char *ef_last_error(ExpandFile *ef){  return ef ? ef->errmsg : "NULL ExpandFile argument";}/*....................................................................... * Print out an array of matching files. * * Input: *  result  FileExpansion *   The container of the sorted array of *                            expansions. *  fp               FILE *   The output stream to write to. *  term_width        int     The width of the terminal. * Output: *  return            int     0 - OK. *                            1 - Error. */int ef_list_expansions(FileExpansion *result, FILE *fp, int term_width){  int maxlen;    /* The length of the longest matching string */  int width;     /* The width of a column */  int ncol;      /* The number of columns to list */  int nrow;      /* The number of rows needed to list all of the expansions */  int row,col;   /* The row and column being written to */  int i;/* * Check the arguments. */  if(!result || !fp) {    fprintf(stderr, "ef_list_expansions: NULL argument(s).\n");    return 1;  };/* * Not enough space to list anything? */  if(term_width < 1)    return 0;/* * Work out the maximum length of the matching filenames. */  maxlen = 0;  for(i=0; i<result->nfile; i++) {    int len = strlen(result->files[i]);    if(len > maxlen)      maxlen = len;  };/* * Nothing to list? */  if(maxlen == 0)    return 0;/* * Split the available terminal width into columns of maxlen + 2 characters. */  width = maxlen + 2;  ncol = term_width / width;/* * If the column width is greater than the terminal width, the matches will * just have to overlap onto the next line. */  if(ncol < 1)    ncol = 1;/* * How many rows will be needed? */  nrow = (result->nfile + ncol - 1) / ncol;/* * Print the expansions out in ncol columns, sorted in row order within each * column. */  for(row=0; row < nrow; row++) {    for(col=0; col < ncol; col++) {      int m = col*nrow + row;      if(m < result->nfile) {	const char *filename = result->files[m];	if(fprintf(fp, "%s%-*s%s", filename,		   (int) (ncol > 1 ? maxlen - strlen(filename):0), "",		   col<ncol-1 ? "  " : "\r\n") < 0)	  return 1;      } else {	if(fprintf(fp, "\r\n") < 0)	  return 1;	break;      };    };  };  return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产视频一区二区在线观看| 日韩av电影免费观看高清完整版| 99国产精品久久久久久久久久 | 成人激情av网| 自拍偷拍欧美激情| 欧美伊人久久大香线蕉综合69 | 精品成a人在线观看| 国产乱码精品一区二区三区av| 国产欧美一区二区精品忘忧草| 91性感美女视频| 亚洲一区二区三区中文字幕| 欧美一二三区精品| 国产精品资源在线| 玉米视频成人免费看| 欧美日韩国产高清一区二区三区| 精一区二区三区| 日本一区二区三区四区在线视频| 一本久道久久综合中文字幕| 午夜精品福利在线| 精品国产凹凸成av人导航| 白白色 亚洲乱淫| 日日摸夜夜添夜夜添亚洲女人| 欧美精品一区二区在线观看| 91一区一区三区| 日本在线不卡一区| 国产欧美精品日韩区二区麻豆天美| 91激情五月电影| 看电视剧不卡顿的网站| 国产精品久久久久永久免费观看| 91久久一区二区| 麻豆精品精品国产自在97香蕉| 国产精品乱子久久久久| 欧美电影一区二区| 成人影视亚洲图片在线| 亚洲成年人网站在线观看| 久久午夜色播影院免费高清 | 97久久人人超碰| 日本美女一区二区三区视频| 国产精品系列在线| 91久久精品一区二区三| 精品亚洲aⅴ乱码一区二区三区| 国产精品动漫网站| 日韩精品中午字幕| 91小视频免费看| 精品视频1区2区| 懂色一区二区三区免费观看| 天天综合网天天综合色| 国产精品久久精品日日| 日韩欧美在线综合网| 99国产精品一区| 精品伊人久久久久7777人| 亚洲女人****多毛耸耸8| 久久综合狠狠综合久久激情 | 综合久久一区二区三区| 日韩视频永久免费| 91麻豆国产在线观看| 精东粉嫩av免费一区二区三区| 亚洲乱码国产乱码精品精的特点| 欧美成人一区二区三区| 欧美在线视频不卡| 成人国产精品免费| 国内精品久久久久影院薰衣草| 亚洲综合男人的天堂| 国产精品视频一二三| 精品少妇一区二区三区| 欧美日韩黄色一区二区| 91丨porny丨蝌蚪视频| 国产精品456| 美腿丝袜亚洲三区| 亚洲第一精品在线| 亚洲另类春色校园小说| 日本一区二区电影| 久久日韩精品一区二区五区| 69精品人人人人| 色天使久久综合网天天| 成人免费视频网站在线观看| 国产一区二区免费看| 日本强好片久久久久久aaa| 亚洲精品国产无套在线观| 国产精品婷婷午夜在线观看| 精品播放一区二区| 日韩一级成人av| 69p69国产精品| 欧美日韩亚洲高清一区二区| 色屁屁一区二区| 99这里只有久久精品视频| 国产suv精品一区二区6| 极品美女销魂一区二区三区| 青青草成人在线观看| 午夜av一区二区| 午夜精品久久久久久久99水蜜桃| 一区二区三区中文字幕电影| 亚洲另类在线制服丝袜| 亚洲男帅同性gay1069| 国产精品国产自产拍在线| 欧美国产精品一区二区| 国产情人综合久久777777| 久久综合久久鬼色中文字| 欧美va亚洲va香蕉在线| 欧美成人一区二区三区片免费 | 日韩欧美aaaaaa| 欧美一区二区三区免费在线看 | 欧美色网站导航| 91福利国产精品| 欧美偷拍一区二区| 欧美在线制服丝袜| 色成年激情久久综合| 一本色道久久综合狠狠躁的推荐 | 中文欧美字幕免费| 国产精品三级久久久久三级| 国产精品网站一区| 成人免费黄色大片| 成人在线视频一区二区| 成人av免费网站| 色综合天天在线| 色综合久久久久久久久久久| 色哟哟国产精品免费观看| 欧美亚洲综合另类| 6080亚洲精品一区二区| 欧美一级久久久| 久久伊人蜜桃av一区二区| 欧美激情一区二区三区四区| 中文字幕一区二区在线播放| 亚洲激情自拍偷拍| 亚洲大片精品永久免费| 日韩av不卡一区二区| 激情六月婷婷久久| 成人伦理片在线| 色素色在线综合| 91精品国产综合久久福利软件| 精品999在线播放| 中文字幕久久午夜不卡| 亚洲免费观看高清完整版在线观看| 亚洲一区二区黄色| 日本美女一区二区三区视频| 国产精一区二区三区| 97aⅴ精品视频一二三区| 欧美色视频一区| ww久久中文字幕| 中文字幕一区免费在线观看| 亚洲国产乱码最新视频| 六月丁香婷婷久久| 成人黄色777网| 欧美日韩一区在线| 欧美成人一区二区| 国产精品久久久久久久久果冻传媒 | 成人综合激情网| 日本韩国一区二区| 日韩欧美国产麻豆| 国产精品麻豆视频| 午夜激情综合网| 激情综合一区二区三区| 91小宝寻花一区二区三区| 3atv在线一区二区三区| 欧美韩国日本综合| 亚洲第一狼人社区| 国内久久婷婷综合| 91麻豆高清视频| 日韩精品一区二区三区老鸭窝| 中文字幕中文字幕中文字幕亚洲无线| 亚洲欧美一区二区三区极速播放| 亚洲一区二区三区四区的| 久久国产精品免费| 91麻豆精品秘密| 欧美www视频| 伊人性伊人情综合网| 久久99精品国产麻豆婷婷洗澡| 91美女精品福利| 日韩精品在线一区| 亚洲男人的天堂网| 男人的天堂久久精品| 不卡的av电影| 欧美一级免费大片| 亚洲人精品一区| 捆绑调教一区二区三区| 色婷婷综合久久久久中文一区二区| 日韩女优av电影| 亚洲精品成a人| 国产精品亚洲第一区在线暖暖韩国| 在线观看免费亚洲| 国产日韩欧美电影| 天天操天天综合网| 91欧美一区二区| 久久久久久一二三区| 亚洲高清免费在线| 成人免费毛片高清视频| 日韩欧美一二三区| 亚洲午夜私人影院| 9色porny自拍视频一区二区| 亚洲精品一区二区在线观看| 亚洲成人久久影院| 精品国精品自拍自在线| 亚洲最新在线观看| 粉嫩一区二区三区性色av| 欧美一级爆毛片| 亚洲国产视频a| 97久久超碰国产精品电影| 久久精品亚洲乱码伦伦中文| 青青草视频一区| 欧美日韩一卡二卡三卡 |