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

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

?? tilde.c

?? 基于的linux的oracle sqlplus替代工具
?? C
字號:
/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). *//* Copyright (C) 1988,1989 Free Software Foundation, Inc.   This file is part of GNU Readline, a library for reading lines   of text with interactive input and history editing.   Readline is free software; you can redistribute it and/or modify it   under the terms of the GNU General Public License as published by the   Free Software Foundation; either version 2, or (at your option) any   later version.   Readline is distributed in the hope that it will be useful, but   WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU   General Public License for more details.   You should have received a copy of the GNU General Public License   along with Readline; see the file COPYING.  If not, write to the Free   Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */#if defined (HAVE_CONFIG_H)#  include <config.h>#endif#if defined (HAVE_UNISTD_H)#  ifdef _MINIX#    include <sys/types.h>#  endif#  include <unistd.h>#endif#if defined (HAVE_STRING_H)#  include <string.h>#else /* !HAVE_STRING_H */#  include <strings.h>#endif /* !HAVE_STRING_H */  #if defined (HAVE_STDLIB_H)#  include <stdlib.h>#else#  include "ansi_stdlib.h"#endif /* HAVE_STDLIB_H */#include <sys/types.h>#include <pwd.h>#include "tilde.h"#if defined (TEST) || defined (STATIC_MALLOC)static void *xmalloc (), *xrealloc ();#else#  include "xmalloc.h"#endif /* TEST || STATIC_MALLOC */#if !defined (HAVE_GETPW_DECLS)extern struct passwd *getpwuid PARAMS((uid_t));extern struct passwd *getpwnam PARAMS((const char *));#endif /* !HAVE_GETPW_DECLS */#if !defined (savestring)#define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x))#endif /* !savestring */#if !defined (NULL)#  if defined (__STDC__)#    define NULL ((void *) 0)#  else#    define NULL 0x0#  endif /* !__STDC__ */#endif /* !NULL *//* If being compiled as part of bash, these will be satisfied from   variables.o.  If being compiled as part of readline, they will   be satisfied from shell.o. */extern char *sh_get_home_dir PARAMS((void));extern char *sh_get_env_value PARAMS((const char *));/* The default value of tilde_additional_prefixes.  This is set to   whitespace preceding a tilde so that simple programs which do not   perform any word separation get desired behaviour. */static const char *default_prefixes[] =  { " ~", "\t~", (const char *)NULL };/* The default value of tilde_additional_suffixes.  This is set to   whitespace or newline so that simple programs which do not   perform any word separation get desired behaviour. */static const char *default_suffixes[] =  { " ", "\n", (const char *)NULL };/* If non-null, this contains the address of a function that the application   wants called before trying the standard tilde expansions.  The function   is called with the text sans tilde, and returns a malloc()'ed string   which is the expansion, or a NULL pointer if the expansion fails. */tilde_hook_func_t *tilde_expansion_preexpansion_hook = (tilde_hook_func_t *)NULL;/* If non-null, this contains the address of a function to call if the   standard meaning for expanding a tilde fails.  The function is called   with the text (sans tilde, as in "foo"), and returns a malloc()'ed string   which is the expansion, or a NULL pointer if there is no expansion. */tilde_hook_func_t *tilde_expansion_failure_hook = (tilde_hook_func_t *)NULL;/* When non-null, this is a NULL terminated array of strings which   are duplicates for a tilde prefix.  Bash uses this to expand   `=~' and `:~'. */char **tilde_additional_prefixes = (char **)default_prefixes;/* When non-null, this is a NULL terminated array of strings which match   the end of a username, instead of just "/".  Bash sets this to   `:' and `=~'. */char **tilde_additional_suffixes = (char **)default_suffixes;static int tilde_find_prefix PARAMS((const char *, int *));static int tilde_find_suffix PARAMS((const char *));static char *isolate_tilde_prefix PARAMS((const char *, int *));static char *glue_prefix_and_suffix PARAMS((char *, const char *, int));/* Find the start of a tilde expansion in STRING, and return the index of   the tilde which starts the expansion.  Place the length of the text   which identified this tilde starter in LEN, excluding the tilde itself. */static inttilde_find_prefix (string, len)     const char *string;     int *len;{  register int i, j, string_len;  register char **prefixes;  prefixes = tilde_additional_prefixes;  string_len = strlen (string);  *len = 0;  if (*string == '\0' || *string == '~')    return (0);  if (prefixes)    {      for (i = 0; i < string_len; i++)	{	  for (j = 0; prefixes[j]; j++)	    {	      if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0)		{		  *len = strlen (prefixes[j]) - 1;		  return (i + *len);		}	    }	}    }  return (string_len);}/* Find the end of a tilde expansion in STRING, and return the index of   the character which ends the tilde definition.  */static inttilde_find_suffix (string)     const char *string;{  register int i, j, string_len;  register char **suffixes;  suffixes = tilde_additional_suffixes;  string_len = strlen (string);  for (i = 0; i < string_len; i++)    {#if defined (__MSDOS__)      if (string[i] == '/' || string[i] == '\\' /* || !string[i] */)#else      if (string[i] == '/' /* || !string[i] */)#endif	break;      for (j = 0; suffixes && suffixes[j]; j++)	{	  if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0)	    return (i);	}    }  return (i);}/* Return a new string which is the result of tilde expanding STRING. */char *tilde_expand (string)     const char *string;{  char *result;  int result_size, result_index;  result_index = result_size = 0;  if (result = strchr (string, '~'))    result = (char *)xmalloc (result_size = (strlen (string) + 16));  else    result = (char *)xmalloc (result_size = (strlen (string) + 1));  /* Scan through STRING expanding tildes as we come to them. */  while (1)    {      register int start, end;      char *tilde_word, *expansion;      int len;      /* Make START point to the tilde which starts the expansion. */      start = tilde_find_prefix (string, &len);      /* Copy the skipped text into the result. */      if ((result_index + start + 1) > result_size)	result = (char *)xrealloc (result, 1 + (result_size += (start + 20)));      strncpy (result + result_index, string, start);      result_index += start;      /* Advance STRING to the starting tilde. */      string += start;      /* Make END be the index of one after the last character of the	 username. */      end = tilde_find_suffix (string);      /* If both START and END are zero, we are all done. */      if (!start && !end)	break;      /* Expand the entire tilde word, and copy it into RESULT. */      tilde_word = (char *)xmalloc (1 + end);      strncpy (tilde_word, string, end);      tilde_word[end] = '\0';      string += end;      expansion = tilde_expand_word (tilde_word);      free (tilde_word);      len = strlen (expansion);#ifdef __CYGWIN__      /* Fix for Cygwin to prevent ~user/xxx from expanding to //xxx when	 $HOME for `user' is /.  On cygwin, // denotes a network drive. */      if (len > 1 || *expansion != '/' || *string != '/')#endif	{	  if ((result_index + len + 1) > result_size)	    result = (char *)xrealloc (result, 1 + (result_size += (len + 20)));	  strcpy (result + result_index, expansion);	  result_index += len;	}      free (expansion);    }  result[result_index] = '\0';  return (result);}/* Take FNAME and return the tilde prefix we want expanded.  If LENP is   non-null, the index of the end of the prefix into FNAME is returned in   the location it points to. */static char *isolate_tilde_prefix (fname, lenp)     const char *fname;     int *lenp;{  char *ret;  int i;  ret = (char *)xmalloc (strlen (fname));#if defined (__MSDOS__)  for (i = 1; fname[i] && fname[i] != '/' && fname[i] != '\\'; i++)#else  for (i = 1; fname[i] && fname[i] != '/'; i++)#endif    ret[i - 1] = fname[i];  ret[i - 1] = '\0';  if (lenp)    *lenp = i;  return ret;}/* Return a string that is PREFIX concatenated with SUFFIX starting at   SUFFIND. */static char *glue_prefix_and_suffix (prefix, suffix, suffind)     char *prefix;     const char *suffix;     int suffind;{  char *ret;  int plen, slen;  plen = (prefix && *prefix) ? strlen (prefix) : 0;  slen = strlen (suffix + suffind);  ret = (char *)xmalloc (plen + slen + 1);  if (plen)    strcpy (ret, prefix);  strcpy (ret + plen, suffix + suffind);  return ret;}/* Do the work of tilde expansion on FILENAME.  FILENAME starts with a   tilde.  If there is no expansion, call tilde_expansion_failure_hook.   This always returns a newly-allocated string, never static storage. */char *tilde_expand_word (filename)     const char *filename;{  char *dirname, *expansion, *username;  int user_len;  struct passwd *user_entry;  if (filename == 0)    return ((char *)NULL);  if (*filename != '~')    return (savestring (filename));  /* A leading `~/' or a bare `~' is *always* translated to the value of     $HOME or the home directory of the current user, regardless of any     preexpansion hook. */  if (filename[1] == '\0' || filename[1] == '/')    {      /* Prefix $HOME to the rest of the string. */      expansion = sh_get_env_value ("HOME");      /* If there is no HOME variable, look up the directory in	 the password database. */      if (expansion == 0)	expansion = sh_get_home_dir ();      return (glue_prefix_and_suffix (expansion, filename, 1));    }  username = isolate_tilde_prefix (filename, &user_len);  if (tilde_expansion_preexpansion_hook)    {      expansion = (*tilde_expansion_preexpansion_hook) (username);      if (expansion)	{	  dirname = glue_prefix_and_suffix (expansion, filename, user_len);	  free (username);	  free (expansion);	  return (dirname);	}    }  /* No preexpansion hook, or the preexpansion hook failed.  Look in the     password database. */  dirname = (char *)NULL;  user_entry = getpwnam (username);  if (user_entry == 0)    {      /* If the calling program has a special syntax for expanding tildes,	 and we couldn't find a standard expansion, then let them try. */      if (tilde_expansion_failure_hook)	{	  expansion = (*tilde_expansion_failure_hook) (username);	  if (expansion)	    {	      dirname = glue_prefix_and_suffix (expansion, filename, user_len);	      free (expansion);	    }	}      free (username);      /* If we don't have a failure hook, or if the failure hook did not	 expand the tilde, return a copy of what we were passed. */      if (dirname == 0)	dirname = savestring (filename);    }  else    {      free (username);      dirname = glue_prefix_and_suffix (user_entry->pw_dir, filename, user_len);    }  endpwent ();  return (dirname);}#if defined (TEST)#undef NULL#include <stdio.h>main (argc, argv)     int argc;     char **argv;{  char *result, line[512];  int done = 0;  while (!done)    {      printf ("~expand: ");      fflush (stdout);      if (!gets (line))	strcpy (line, "done");      if ((strcmp (line, "done") == 0) ||	  (strcmp (line, "quit") == 0) ||	  (strcmp (line, "exit") == 0))	{	  done = 1;	  break;	}      result = tilde_expand (line);      printf ("  --> %s\n", result);      free (result);    }  exit (0);}static void memory_error_and_abort ();static void *xmalloc (bytes)     size_t bytes;{  void *temp = (char *)malloc (bytes);  if (!temp)    memory_error_and_abort ();  return (temp);}static void *xrealloc (pointer, bytes)     void *pointer;     int bytes;{  void *temp;  if (!pointer)    temp = malloc (bytes);  else    temp = realloc (pointer, bytes);  if (!temp)    memory_error_and_abort ();  return (temp);}static voidmemory_error_and_abort (){  fprintf (stderr, "readline: out of virtual memory\n");  abort ();}/* * Local variables: * compile-command: "gcc -g -DTEST -o tilde tilde.c" * end: */#endif /* TEST */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品白丝av| 亚洲最新在线观看| 久久这里都是精品| 中文字幕av一区二区三区高| 日韩精品中午字幕| 中文一区二区在线观看| 国产午夜亚洲精品理论片色戒| 精品成人一区二区三区| 国产精品视频一二三区| 国产精品亲子乱子伦xxxx裸| 亚洲欧美电影一区二区| 毛片av一区二区三区| 成人国产免费视频| 欧美一区二区视频网站| 国产精品人人做人人爽人人添| 午夜精品一区在线观看| 国产经典欧美精品| 日韩欧美区一区二| 亚洲国产精品久久久久秋霞影院 | 日韩精品亚洲一区二区三区免费| 一区二区三区不卡视频| 精品一区二区在线免费观看| 欧美不卡一二三| 久久久久国产一区二区三区四区| 一区二区在线观看av| 精品三级在线观看| av男人天堂一区| 亚洲乱码国产乱码精品精的特点 | 日韩一区中文字幕| 国产精品免费看片| 香蕉影视欧美成人| 国产一区二区三区免费播放| 国产精品自拍网站| 在线亚洲精品福利网址导航| 欧美va亚洲va香蕉在线| 国产精品盗摄一区二区三区| 亚洲素人一区二区| 亚洲大片免费看| 不卡的电视剧免费网站有什么| 欧美军同video69gay| 亚洲老司机在线| 成人性生交大合| 国产欧美久久久精品影院| 日韩制服丝袜先锋影音| 91激情五月电影| 亚洲免费观看高清完整版在线 | 色香色香欲天天天影视综合网| 欧美一级专区免费大片| 亚洲一区二区三区在线| 在线亚洲欧美专区二区| 亚洲美女精品一区| 色综合天天天天做夜夜夜夜做| 国产精品三级电影| 99久久精品国产网站| 欧美成人bangbros| 亚洲激情五月婷婷| aaa亚洲精品| 国产精品久久久久久久久图文区 | 国产在线国偷精品产拍免费yy| 欧美视频一二三区| 国产精品久久毛片| 成人亚洲一区二区一| 国产精品私房写真福利视频| 国内精品久久久久影院色| 欧美大片一区二区| 极品美女销魂一区二区三区| 欧美精品一区二区久久婷婷| 视频一区视频二区中文| 欧美三级电影网| 亚洲国产一区二区a毛片| 色婷婷av一区二区三区大白胸 | 国产精品嫩草影院com| 成人免费黄色大片| 亚洲成人精品影院| 精品国产乱子伦一区| 亚洲欧美日韩综合aⅴ视频| 国产精品1区2区3区在线观看| 欧美一区二区视频免费观看| 久久精品72免费观看| 777精品伊人久久久久大香线蕉| 午夜视频在线观看一区| 3d动漫精品啪啪| 久久99这里只有精品| 日本一区二区三区视频视频| 91福利在线免费观看| 日产国产高清一区二区三区| 国产精品美女久久久久高潮| 91在线云播放| 午夜一区二区三区在线观看| 欧美一二三四在线| 国产精品一区二区无线| 亚洲大片免费看| 亚洲欧洲精品一区二区三区| 欧美大片国产精品| 欧美色图激情小说| 国产麻豆精品一区二区| 日韩在线卡一卡二| 亚洲蜜桃精久久久久久久| 久久久噜噜噜久久中文字幕色伊伊| av在线一区二区| 久久精品99久久久| 六月丁香综合在线视频| 日韩国产一区二| 激情五月婷婷综合网| 国产91在线观看| 91精品欧美福利在线观看| 日韩免费一区二区| 国产精品乱码一区二区三区软件| 亚洲一区二区三区四区的| 久久精品国产亚洲aⅴ| 男男视频亚洲欧美| 国产一区二区0| 久久99久久久欧美国产| 日本欧美加勒比视频| 日本免费新一区视频| 久久爱另类一区二区小说| 久久精品国产秦先生| 成人激情校园春色| 日本精品免费观看高清观看| 日韩精品一区二区三区视频在线观看 | 丝袜亚洲另类丝袜在线| 国产成人精品影院| 欧美裸体一区二区三区| 91在线视频免费91| 亚洲精品在线电影| 日本 国产 欧美色综合| 亚洲午夜激情av| 日韩av电影天堂| 欧美三区在线观看| 中文字幕在线观看不卡| 精品一区二区三区的国产在线播放| 91啦中文在线观看| 中文无字幕一区二区三区| 秋霞电影网一区二区| 91精品国产综合久久精品性色| 亚洲免费在线观看| 色狠狠一区二区三区香蕉| 玉足女爽爽91| 欧美视频自拍偷拍| 欧美成人午夜电影| 亚洲国产精品传媒在线观看| 欧美日韩dvd在线观看| 国产精品一卡二卡| 紧缚奴在线一区二区三区| 三级不卡在线观看| 日本成人在线网站| 日韩中文字幕麻豆| 国产成人在线网站| 色妹子一区二区| 26uuu国产电影一区二区| 97超碰欧美中文字幕| 亚洲精品一区二区在线观看| 国产一区啦啦啦在线观看| eeuss鲁片一区二区三区| 欧美在线999| 久久影院视频免费| 一区二区三区欧美视频| 美女网站一区二区| 91在线云播放| 欧美草草影院在线视频| 18涩涩午夜精品.www| 日韩国产一二三区| 不卡在线观看av| 日韩欧美区一区二| 亚洲精品欧美激情| 国产精品一区一区| 欧美精品第一页| 国产精品久久二区二区| 免费不卡在线视频| 91小视频在线免费看| 26uuu欧美| 日韩制服丝袜av| 色婷婷综合五月| 国产亚洲欧美激情| 视频一区二区欧美| 99国产精品久久久| 久久久国产一区二区三区四区小说 | 欧美日韩激情在线| 亚洲精品高清在线| 国产成人av一区二区三区在线| 欧美放荡的少妇| 一区二区久久久久| 成人午夜视频在线| 久久综合九色综合97婷婷| 日本欧美一区二区在线观看| 日本久久电影网| 亚洲特黄一级片| 99久久婷婷国产| 国产精品网站一区| 亚洲黄色性网站| 色哟哟在线观看一区二区三区| 国产欧美日韩卡一| 91亚洲国产成人精品一区二三| 国产精品情趣视频| 欧美日韩久久久一区| 国内成人免费视频| 日韩伦理av电影| 欧美丰满高潮xxxx喷水动漫| 国产麻豆日韩欧美久久| 日本一区二区三区在线不卡|