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

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

?? library_22.html

?? linux_c函數,linux下編程必備的
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
Non-option argument -
</PRE>
<P>
<H3><A NAME="SEC390" HREF="library_toc.html#SEC390" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC390">Parsing Long Options</A></H3>
<P>
To accept GNU-style long options as well as single-character options,
use <CODE>getopt_long</CODE> instead of <CODE>getopt</CODE>.  You should make every
program accept long options if it uses any options, for this takes
little extra work and helps beginners remember how to use the program.
<P>
<A NAME="IDX1641"></A>
<U>Data Type:</U> <B>struct option</B><P>
This structure describes a single long option name for the sake of
<CODE>getopt_long</CODE>.  The argument <VAR>longopts</VAR> must be an array of
these structures, one for each long option.  Terminate the array with an
element containing all zeros.
<P>
The <CODE>struct option</CODE> structure has these fields:
<P>
<DL COMPACT>
<DT><CODE>const char *name</CODE>
<DD>This field is the name of the option.  It is a string.
<P>
<DT><CODE>int has_arg</CODE>
<DD>This field says whether the option takes an argument.  It is an integer,
and there are three legitimate values: <CODE>no_argument</CODE>,
<CODE>required_argument</CODE> and <CODE>optional_argument</CODE>.
<P>
<DT><CODE>int *flag</CODE>
<DD><DT><CODE>int val</CODE>
<DD>These fields control how to report or act on the option when it occurs.
<P>
If <CODE>flag</CODE> is a null pointer, then the <CODE>val</CODE> is a value which
identifies this option.  Often these values are chosen to uniquely
identify particular long options.
<P>
If <CODE>flag</CODE> is not a null pointer, it should be the address of an
<CODE>int</CODE> variable which is the flag for this option.  The value in
<CODE>val</CODE> is the value to store in the flag to indicate that the option
was seen.
</DL>
<P>
<A NAME="IDX1642"></A>
<U>Function:</U> int <B>getopt_long</B> <I>(int <VAR>argc</VAR>, char **<VAR>argv</VAR>, const char *<VAR>shortopts</VAR>, struct option *<VAR>longopts</VAR>, int *<VAR>indexptr</VAR>)</I><P>
Decode options from the vector <VAR>argv</VAR> (whose length is <VAR>argc</VAR>).
The argument <VAR>shortopts</VAR> describes the short options to accept, just as
it does in <CODE>getopt</CODE>.  The argument <VAR>longopts</VAR> describes the long
options to accept (see above).
<P>
When <CODE>getopt_long</CODE> encounters a short option, it does the same
thing that <CODE>getopt</CODE> would do: it returns the character code for the
option, and stores the options argument (if it has one) in <CODE>optarg</CODE>.
<P>
When <CODE>getopt_long</CODE> encounters a long option, it takes actions based
on the <CODE>flag</CODE> and <CODE>val</CODE> fields of the definition of that
option.
<P>
If <CODE>flag</CODE> is a null pointer, then <CODE>getopt_long</CODE> returns the
contents of <CODE>val</CODE> to indicate which option it found.  You should
arrange distinct values in the <CODE>val</CODE> field for options with
different meanings, so you can decode these values after
<CODE>getopt_long</CODE> returns.  If the long option is equivalent to a short
option, you can use the short option's character code in <CODE>val</CODE>.
<P>
If <CODE>flag</CODE> is not a null pointer, that means this option should just
set a flag in the program.  The flag is a variable of type <CODE>int</CODE>
that you define.  Put the address of the flag in the <CODE>flag</CODE> field.
Put in the <CODE>val</CODE> field the value you would like this option to
store in the flag.  In this case, <CODE>getopt_long</CODE> returns <CODE>0</CODE>.
<P>
For any long option, <CODE>getopt_long</CODE> tells you the index in the array
<VAR>longopts</VAR> of the options definition, by storing it into
<CODE>*<VAR>indexptr</VAR></CODE>.  You can get the name of the option with
<CODE><VAR>longopts</VAR>[*<VAR>indexptr</VAR>].name</CODE>.  So you can distinguish among
long options either by the values in their <CODE>val</CODE> fields or by their
indices.  You can also distinguish in this way among long options that
set flags.
<P>
When a long option has an argument, <CODE>getopt_long</CODE> puts the argument
value in the variable <CODE>optarg</CODE> before returning.  When the option
has no argument, the value in <CODE>optarg</CODE> is a null pointer.  This is
how you can tell whether an optional argument was supplied.
<P>
When <CODE>getopt_long</CODE> has no more options to handle, it returns
<CODE>-1</CODE>, and leaves in the variable <CODE>optind</CODE> the index in
<VAR>argv</VAR> of the next remaining argument.
<P>
<H3><A NAME="SEC391" HREF="library_toc.html#SEC391" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC391">Example of Parsing Long Options</A></H3>
<P>
<PRE>
#include &#60;stdio.h&#62;

/* Flag set by <SAMP>`--verbose'</SAMP>.   */
static int verbose_flag;

int
main (argc, argv)
     int argc;
     char **argv;
{
  int c;

  while (1)
    {
      static struct option long_options[] =
	{
	  /* These options set a flag.   */
	  {"verbose", 0, &#38;verbose_flag, 1},
	  {"brief", 0, &#38;verbose_flag, 0},
	  /* These options don't set a flag.
	     We distinguish them by their indices.  */
	  {"add", 1, 0, 0},
	  {"append", 0, 0, 0},
	  {"delete", 1, 0, 0},
	  {"create", 0, 0, 0},
	  {"file", 1, 0, 0},
	  {0, 0, 0, 0}
	};
      /* <CODE>getopt_long</CODE> stores the option index here.   */
      int option_index = 0;

      c = getopt_long (argc, argv, "abc:d:",
		       long_options, &#38;option_index);

      /* Detect the end of the options.   */
      if (c == -1)
	break;

      switch (c)
	{
	case 0:
	  /* If this option set a flag, do nothing else now.   */
	  if (long_options[option_index].flag != 0)
	    break;
	  printf ("option %s", long_options[option_index].name);
	  if (optarg)
	    printf (" with arg %s", optarg);
	  printf ("\n");
	  break;

	case 'a':
	  puts ("option -a\n");
	  break;

	case 'b':
	  puts ("option -b\n");
	  break;

	case 'c':
	  printf ("option -c with value `%s'\n", optarg);
	  break;

	case 'd':
	  printf ("option -d with value `%s'\n", optarg);
	  break;

	case '?':
	  /* <CODE>getopt_long</CODE> already printed an error message.   */
	  break;

	default:
	  abort ();
	}
    }

  /* Instead of reporting <SAMP>`--verbose'</SAMP>
     and <SAMP>`--brief'</SAMP> as they are encountered,
     we report the final status resulting from them.  */
  if (verbose_flag)
    puts ("verbose flag is set");

  /* Print any remaining command line arguments (not options).   */
  if (optind &#60; argc)
    {
      printf ("non-option ARGV-elements: ");
      while (optind &#60; argc)
	printf ("%s ", argv[optind++]);
      putchar ('\n');
    }

  exit (0);
}
</PRE>
<P>
<H2><A NAME="SEC392" HREF="library_toc.html#SEC392" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC392">Environment Variables</A></H2>
<A NAME="IDX1643"></A>
<P>
When a program is executed, it receives information about the context in
which it was invoked in two ways.  The first mechanism uses the
<VAR>argv</VAR> and <VAR>argc</VAR> arguments to its <CODE>main</CODE> function, and is
discussed in section <A HREF="library_22.html#SEC386" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_22.html#SEC386">Program Arguments</A>.  The second mechanism uses
<DFN>environment variables</DFN> and is discussed in this section.
<P>
The <VAR>argv</VAR> mechanism is typically used to pass command-line
arguments specific to the particular program being invoked.  The
environment, on the other hand, keeps track of information that is
shared by many programs, changes infrequently, and that is less
frequently accessed.
<P>
The environment variables discussed in this section are the same
environment variables that you set using assignments and the
<CODE>export</CODE> command in the shell.  Programs executed from the shell
inherit all of the environment variables from the shell.
<A NAME="IDX1644"></A>
<P>
Standard environment variables are used for information about the user's
home directory, terminal type, current locale, and so on; you can define
additional variables for other purposes.  The set of all environment
variables that have values is collectively known as the
<DFN>environment</DFN>.
<P>
Names of environment variables are case-sensitive and must not contain
the character <SAMP>`='</SAMP>.  System-defined environment variables are
invariably uppercase.
<P>
The values of environment variables can be anything that can be
represented as a string.  A value must not contain an embedded null
character, since this is assumed to terminate the string.
<P>
<A NAME="IDX1645"></A>
<A NAME="IDX1646"></A>
<H3><A NAME="SEC393" HREF="library_toc.html#SEC393" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC393">Environment Access</A></H3>
<P>
The value of an environment variable can be accessed with the
<CODE>getenv</CODE> function.  This is declared in the header file
<TT>`stdlib.h'</TT>.
<A NAME="IDX1647"></A>
<P>
<A NAME="IDX1648"></A>
<U>Function:</U> char * <B>getenv</B> <I>(const char *<VAR>name</VAR>)</I><P>
This function returns a string that is the value of the environment
variable <VAR>name</VAR>.  You must not modify this string.  In some systems
not using the GNU library, it might be overwritten by subsequent calls
to <CODE>getenv</CODE> (but not by any other library function).
If the environment variable <VAR>name</VAR> is not defined, the value is a
null pointer.
<P>
<A NAME="IDX1649"></A>
<U>Function:</U> int <B>putenv</B> <I>(const char *<VAR>string</VAR>)</I><P>
The <CODE>putenv</CODE> function adds or removes definitions from the environment.
If the <VAR>string</VAR> is of the form <SAMP>`<VAR>name</VAR>=<VAR>value</VAR>'</SAMP>, the
definition is added to the environment.  Otherwise, the <VAR>string</VAR> is
interpreted as the name of an environment variable, and any definition
for this variable in the environment is removed.
<P>
The GNU library provides this function for compatibility with SVID; it
may not be available in other systems.
<P>
You can deal directly with the underlying representation of environment
objects to add more variables to the environment (for example, to
communicate with another program you are about to execute; see
section <A HREF="library_23.html#SEC406" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_23.html#SEC406">Executing a File</A>).  
<P>
<A NAME="IDX1650"></A>
<U>Variable:</U> char ** <B>environ</B><P>
The environment is represented as an array of strings.  Each string is
of the format <SAMP>`<VAR>name</VAR>=<VAR>value</VAR>'</SAMP>.  The order in which
strings appear in the environment is not significant, but the same
<VAR>name</VAR> must not appear more than once.  The last element of the
array is a null pointer.
<P>
This variable is declared in the header file <TT>`unistd.h'</TT>.
<P>
If you just want to get the value of an environment variable, use
<CODE>getenv</CODE>.
<P>
<A NAME="IDX1651"></A>
<H3><A NAME="SEC394" HREF="library_toc.html#SEC394" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC394">Standard Environment Variables</A></H3>
<P>
These environment variables have standard meanings.  This doesn't mean
that they are always present in the environment; but if these variables
<EM>are</EM> present, they have these meanings, and that you shouldn't try
to use these environment variable names for some other purpose.
<P>
<DL COMPACT>
<A NAME="IDX1652"></A>
<A NAME="IDX1653"></A>
<DT><CODE>HOME</CODE>
<DD><P>
This is a string representing the user's <DFN>home directory</DFN>, or
initial default working directory.
<P>
The user can set <CODE>HOME</CODE> to any value.
If you need to make sure to obtain the proper home directory
for a particular user, you should not use <CODE>HOME</CODE>; instead,
look up the user's name in the user database (see section <A HREF="library_25.html#SEC441" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_25.html#SEC441">User Database</A>).
<P>
For most purposes, it is better to use <CODE>HOME</CODE>, precisely because
this lets the user specify the value.
<P>
<A NAME="IDX1654"></A>
<DT><CODE>LOGNAME</CODE>
<DD><P>
This is the name that the user used to log in.  Since the value in the
environment can be tweaked arbitrarily, this is not a reliable way to
identify the user who is running a process; a function like
<CODE>getlogin</CODE> (see section <A HREF="library_25.html#SEC440" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_25.html#SEC440">Identifying Who Logged In</A>) is better for that purpose.
<P>
For most purposes, it is better to use <CODE>LOGNAME</CODE>, precisely because
this lets the user specify the value.
<P>
<A NAME="IDX1655"></A>
<DT><CODE>PATH</CODE>
<DD><P>
A <DFN>path</DFN> is a sequence of directory names which is used for
searching for a file.  The variable <CODE>PATH</CODE> holds a path used
for searching for programs to be run.
<P>
The <CODE>execlp</CODE> and <CODE>execvp</CODE> functions (see section <A HREF="library_23.html#SEC406" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_23.html#SEC406">Executing a File</A>)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产一区二区精华液| 日韩精品色哟哟| 亚洲国产日韩在线一区模特| 免费成人av在线播放| 成人涩涩免费视频| 日韩一区二区精品在线观看| 最新国产成人在线观看| 六月婷婷色综合| 欧美色窝79yyyycom| 日本一区二区动态图| 美洲天堂一区二卡三卡四卡视频| 不卡电影一区二区三区| 精品人伦一区二区色婷婷| 亚洲国产精品久久久男人的天堂| 国产99精品视频| 精品黑人一区二区三区久久| 一区二区三区欧美激情| 国产91露脸合集magnet| 欧美va亚洲va香蕉在线| 午夜电影网亚洲视频| 色成年激情久久综合| 中文字幕亚洲一区二区va在线| 韩国成人精品a∨在线观看| 91精品国产综合久久精品图片| 亚洲色图20p| www.亚洲免费av| 国产欧美日韩一区二区三区在线观看| 久久99国产精品免费| 91精品国产免费久久综合| 亚洲第一在线综合网站| 欧美性生活大片视频| 亚洲综合激情另类小说区| 91成人在线免费观看| 亚洲另类在线视频| 在线观看日韩毛片| 亚洲第一成年网| 欧美在线一区二区| 亚洲成人福利片| 56国语精品自产拍在线观看| 亚洲观看高清完整版在线观看| 在线观看欧美黄色| 亚洲超碰97人人做人人爱| 欧美精品在线视频| 老司机免费视频一区二区三区| 日韩欧美黄色影院| 国产成人在线视频免费播放| 欧美国产精品中文字幕| 成人av网站在线观看免费| 国产精品二区一区二区aⅴ污介绍| 成人黄色小视频在线观看| 国产精品久久久久影视| 91视频你懂的| 污片在线观看一区二区| 精品伦理精品一区| 成人丝袜18视频在线观看| 国产精品久久久久一区| 在线观看视频欧美| 久久av老司机精品网站导航| 久久久久一区二区三区四区| 99久久精品国产导航| 亚洲成人在线免费| 亚洲精品一线二线三线无人区| 丰满白嫩尤物一区二区| 一区二区三区视频在线看| 91麻豆精品91久久久久久清纯| 精品一区二区国语对白| 国产精品国产三级国产| 欧美日韩一区二区三区高清 | 国产精品视频一二三区| 色综合久久精品| 久久99精品久久久| 一区二区三区在线观看视频| 91精品国产91久久久久久最新毛片 | 中文字幕不卡的av| 欧美无人高清视频在线观看| 久草这里只有精品视频| 一区二区三区欧美在线观看| 26uuu精品一区二区在线观看| 91麻豆免费观看| 国产一区日韩二区欧美三区| 亚洲在线免费播放| 国产精品久久毛片av大全日韩| 555夜色666亚洲国产免| 99热国产精品| 开心九九激情九九欧美日韩精美视频电影 | 欧美性xxxxxx少妇| 国产久卡久卡久卡久卡视频精品| 一区av在线播放| 欧美国产一区在线| 精品视频123区在线观看| 性欧美大战久久久久久久久| 久久久精品欧美丰满| 91捆绑美女网站| 精油按摩中文字幕久久| 亚洲欧洲精品天堂一级| 久久免费国产精品| 欧美三级电影网站| 成人91在线观看| 久久草av在线| 亚洲自拍偷拍网站| 精品国产乱码久久久久久久久 | 精品久久久久久久人人人人传媒| 99re这里只有精品6| 国产99久久久精品| 久久疯狂做爰流白浆xx| 一区二区三区免费在线观看| 久久久九九九九| 日韩一区二区三区高清免费看看| 97se亚洲国产综合自在线观| 日本欧美加勒比视频| 日韩黄色免费电影| 亚洲精品视频自拍| 国产欧美日韩综合| 色一情一乱一乱一91av| 欧美日韩一区久久| av毛片久久久久**hd| 亚洲综合色视频| 亚洲国产精品二十页| 日韩精品一区二区三区老鸭窝| 欧美一级在线观看| 一本大道av一区二区在线播放| 国产成人av福利| 高清国产一区二区| 国产成人小视频| av男人天堂一区| 99精品欧美一区二区三区小说| av在线一区二区三区| 成人黄色免费短视频| caoporen国产精品视频| 麻豆精品视频在线观看| 国产在线不卡一区| 一区二区三区视频在线看| 偷拍亚洲欧洲综合| 成人欧美一区二区三区视频网页| 亚洲欧美日韩国产一区二区三区| 久久影院视频免费| 久久久久久久久久久电影| 日本一区二区三区四区在线视频| 国产清纯在线一区二区www| 国产蜜臀97一区二区三区| 中文字幕色av一区二区三区| 国产精品午夜电影| 国产精品久久久久天堂| 亚洲一卡二卡三卡四卡无卡久久| 亚洲一二三四在线观看| 久久激情五月激情| 国产精品一区二区在线观看网站| 不卡的av中国片| 在线观看精品一区| 日韩女优毛片在线| 中文字幕精品一区二区精品绿巨人 | 久久亚洲二区三区| 亚洲男人天堂av网| 午夜电影一区二区| 波多野结衣一区二区三区| 欧洲日韩一区二区三区| 日韩三级免费观看| 久久精品人人爽人人爽| 亚洲情趣在线观看| 免费观看一级特黄欧美大片| 国产激情一区二区三区四区| av在线播放成人| 精品少妇一区二区三区免费观看 | 欧美精品v国产精品v日韩精品| 日韩欧美一区二区视频| 综合电影一区二区三区| 日韩电影免费一区| 欧洲一区在线电影| 国产女同性恋一区二区| 亚洲成人av中文| 色婷婷综合久久| 2023国产一二三区日本精品2022| 亚洲自拍偷拍网站| 激情综合色综合久久综合| 欧美丝袜丝交足nylons图片| 精品国产成人在线影院| 亚洲女人的天堂| 成人国产电影网| 日韩欧美色综合| 日韩精品免费专区| eeuss鲁片一区二区三区在线观看| 欧美一区二区美女| 亚洲欧洲综合另类| 国产一区二区不卡| 91视频.com| 久久久久久9999| 美脚の诱脚舐め脚责91 | 中文字幕在线不卡| 国产一区视频导航| 亚洲精品一区二区三区福利| 亚洲精品中文字幕在线观看| 成人av在线影院| 精品国产区一区| 捆绑调教美女网站视频一区| 色综合亚洲欧洲| 亚洲久草在线视频| 国产sm精品调教视频网站| 国产日产欧美精品一区二区三区| 国产乱码精品一区二区三区忘忧草 | 欧美乱熟臀69xxxxxx|