|
1245 | 1245 | at system make files of any Unix-like system. A typical feature of such build |
1246 | 1246 | systems is that there is no documentation on how it works internally so you have |
1247 | 1247 | to dig in deep if you need to understand or modify it -- and that usually is not |
1248 | | -for the faint-hearted. |
| 1248 | +for the fainthearted. |
1249 | 1249 | \end{itemize} |
1250 | 1250 |
|
1251 | 1251 | %%%%% |
|
1882 | 1882 | \item Passing the environment in the third parameter of type |
1883 | 1883 | \texttt{char**} is not part of the normative part of the C standard, only the |
1884 | 1884 | informative one. C compilers typically support that though. |
1885 | | -The \texttt{main} variant with the \nth{3} parameter looks like this:\\ \texttt{int |
1886 | | -\funnm{main}(int \emph{argc}, char *\emph{argv}[], char *\emph{envp}[]);} |
| 1885 | +The \texttt{main} variant with the \nth{3} parameter looks like this:\\ |
| 1886 | +ifdef([[[NOSPELLCHECK]]], [[[ |
| 1887 | +\texttt{int \funnm{main}(int \emph{argc}, char *\emph{argv}[], |
| 1888 | +char *\emph{envp}[]);} |
| 1889 | +]]]) |
1887 | 1890 | \item The return value type of \texttt{main} should be always \texttt{int}. |
1888 | 1891 | \emsl{Only lower 8 bits from that integer are only used though.} It is always a |
1889 | 1892 | non-negative number. Note that in contrast to the C convention, the \texttt{0} |
|
1971 | 1974 | convention. \texttt{wget} does not follow convention and uses |
1972 | 1975 | \texttt{http\_proxy} and \texttt{https\_proxy} as environment variables to set |
1973 | 1976 | the proxy to be used, and other lower case variables as well. |
1974 | | -\item If \emph{envp} is the \nth{3} argument of \texttt{main}, it is the same pointer |
1975 | | -as is in the standard global variable \texttt{environ}. |
| 1977 | +\item If \texttt{envp} is the \nth{3} argument of \texttt{main}, it is the same |
| 1978 | +pointer as is in the standard global variable \texttt{environ}. |
1976 | 1979 | \item Example: \example{main/print-env.c} (see below how to clear out inherited |
1977 | 1980 | environment from the shell using the \texttt{env} command): |
1978 | 1981 |
|
|
2071 | 2074 | application to specify the ordering. |
2072 | 2075 | \item The UNIX standard defines 13 rules that very precisely define the naming |
2073 | 2076 | of commands and the format of options. For example the name of the command |
2074 | | -should be lower case, 2--9 characters long and using only chracters from |
| 2077 | +should be lower case, 2--9 characters long and using only characters from |
2075 | 2078 | the portable character set. Arguments without options should be possible to group |
2076 | 2079 | after '--', etc. |
2077 | 2080 | \item Using numbers of options is old fashioned; reportedly SUSv3 mentions that. |
|
2117 | 2120 | \item Usually the \texttt{getopt} function is used first to process options |
2118 | 2121 | and then the rest is processed using custom functions; the remaining arguments |
2119 | 2122 | are often file names and such. |
2120 | | -\item By convention the optinons in the \texttt{optstring} variable are sorted. |
| 2123 | +\item By convention the options in the \texttt{optstring} variable are sorted. |
2121 | 2124 | \end{itemize} |
2122 | 2125 |
|
2123 | 2126 | %%%%% |
|
0 commit comments