|
1733 | 1733 | \pdfbookmark[1]{standard header files}{stdhdrs} |
1734 | 1734 |
|
1735 | 1735 | \begin{slide} |
1736 | | -\sltitle{Standardní hlavièkové soubory (ANSI~C)} |
| 1736 | +\sltitle{Standard header files (ANSI~C)} |
1737 | 1737 | \renewcommand{\arraystretch}{1} |
1738 | 1738 | \begin{tabular}{l@{\hspace{3ex}\dots\hspace{3ex}}l} |
1739 | | -\texttt{stdlib.h} & základní makra a funkce \\ |
1740 | | -\texttt{errno.h} & o¹etøení chyb \\ |
1741 | | -\texttt{stdio.h} & vstup a výstup \\ |
1742 | | -\texttt{ctype.h} & práce se znaky \\ |
1743 | | -\texttt{string.h} & práce s øetìzci \\ |
1744 | | -\texttt{time.h} & práce s datem a èasem \\ |
1745 | | -\texttt{math.h} & matematické funkce \\ |
1746 | | -\texttt{setjmp.h} & dlouhé skoky \\ |
1747 | | -\texttt{assert.h} & ladicí funkce \\ |
1748 | | -\texttt{stdarg.h} & práce s promìnným poètem parametrù \\ |
1749 | | -\texttt{limits.h} & implementaènì závislé konstanty \\ |
1750 | | -\texttt{signal.h} & o¹etøení signálù |
| 1739 | +\texttt{stdlib.h} & basic macros and functions\\ |
| 1740 | +\texttt{errno.h} & error handling\\ |
| 1741 | +\texttt{stdio.h} & input and output\\ |
| 1742 | +\texttt{ctype.h} & character handling\\ |
| 1743 | +\texttt{string.h} & string handling\\ |
| 1744 | +\texttt{time.h} & time and date handling\\ |
| 1745 | +\texttt{math.h} & math functions\\ |
| 1746 | +\texttt{setjmp.h} & far jumps\\ |
| 1747 | +\texttt{assert.h} & debugging macros/functions\\ |
| 1748 | +\texttt{stdarg.h} & variable arguments processing\\ |
| 1749 | +\texttt{limits.h} & implementation dependent constants\\ |
| 1750 | +\texttt{signal.h} & signal handling |
1751 | 1751 | \end{tabular} |
1752 | 1752 | \end{slide} |
1753 | 1753 |
|
1754 | 1754 | \begin{itemize} |
1755 | | -\item hlavièkový soubor (\emph{header file}) je soubor s deklaracemi funkcí |
1756 | | -(\emph{forward declaration}), pro\-mìn\-ných a maker. Z pohledu preprocesoru |
1757 | | -je to obyèejný soubor napsaný v jazyce C. |
1758 | | -\item \emsl{tyto hlavièkové soubory nejsou specifické pro UNIX. Jsou souèástí |
1759 | | -standardu ANSI~C, který jak ji¾ víme (strana \pageref{C_LANGUAGE}), je zahrnut v |
1760 | | -POSIX.1. Je ale dùle¾ité si uvìdomit, ¾e tyto hlavièkové soubory musí podporovat |
1761 | | -ka¾dý systém, který podporuje ANSI~C, a» ji¾ podporuje POSIX.1 nebo ne.} |
1762 | | -\item pøíslu¹ný hlavièkový soubor pro konkrétní funkci najdete v manuálové |
1763 | | -stránce dané funkce, toto je zaèátek manuálové stránky na Solarisu pro |
1764 | | -\texttt{memcpy}: |
| 1755 | +\item The \emph{header file} is a file that contains declarations |
| 1756 | +(\emph{forward declaration}) of functions, variables and macro definitions. |
| 1757 | +From preprocessor's point of view this is simple file in C language. |
| 1758 | +\item \emsl{These header files are not specific to UNIX. They are part of |
| 1759 | +the ANSI~C standard, that is included in POSIX.1 (page \pageref{C_LANGUAGE}) |
| 1760 | +It is important to realize that every system that supports |
| 1761 | +ANSI~C has to have these files, notwithstanding whether it supports POSIX.1.} |
| 1762 | +\item Appropriate header file for given function can be looked up using the |
| 1763 | +function's man page, e.g. this is the beginning of \texttt{memcpy} man page |
| 1764 | +on Solaris: |
1765 | 1765 | \begin{verbatim} |
1766 | 1766 | Standard C Library Functions memory(3C) |
1767 | 1767 |
|
|
1774 | 1774 | ... |
1775 | 1775 | ... |
1776 | 1776 | \end{verbatim} |
1777 | | -\item jednotlivá makra obsa¾ená v tìchto souborech vìt¹inou nejsou |
1778 | | -vysvìt\-le\-na, význam jednotlivých maker je ale mo¾né si vyhledat v |
1779 | | -pøíslu¹ných specifikacích, které jsou on-line. Na nìkterých systémech |
1780 | | -(Solaris) mají jednotlivé hlavièkové soubory svoji vlastní manuálovou stránku |
1781 | | -(\texttt{man stdlib.h}). |
1782 | | -\item makro \texttt{assert} je mo¾né z bìhem kompilace odstranit pomocí makra |
1783 | | -\texttt{NDEBUG}. Pøíklad: \example{assert/assert.c}. |
| 1777 | +\item Individual macros contained in these files are usually not explained, |
| 1778 | +their meaning can be looked up in relevant specifications which are on-line. |
| 1779 | +On some systems (Solaris) individual header files have their own manual page |
| 1780 | +(e.g. \texttt{man stdlib.h}). |
| 1781 | +\item The \texttt{assert} macro is possible to remove during the compilation |
| 1782 | +using the \texttt{NDEBUG} define. Example: \example{assert/assert.c}. |
1784 | 1783 |
|
1785 | 1784 | \begin{verbatim} |
1786 | 1785 | cat assert.c |
|
0 commit comments