Standardní knihovna jazyka C: Porovnání verzí
Smazaný obsah Přidaný obsah
pokračování překladu,typo |
překlad - tabulka a == Standardní knihovna jazyka C v jiných jazycích == |
||
Řádek 46:
Hlavičkové soubory '''<iso646.h>''', '''<wchar.h>''' a '''<wctype.h>''' byly přidány s prvním rozšířením normy (označováným NA1)v roce 1995.
Následující aktualizace byla provedena v roce 1999 v souvislosti s vydáním standardu [[C99]] a přibyly hlavičkové soubory s názvy: '''<complex.h>''', '''<fenv.h>''', '''<inttypes.h>''', '''<stdbool.h>''', '''<stdint.h>''' a '''<tgmath.h>'''.
== Standard ISO ==
Řádek 69:
|''' [[fenv.h|<fenv.h>]]''' || Práce v prostředí s [[Plovoucí desetinná čárka|plovoucí desetinnou čárkou]]. (Nově s '''C99''')
|-
|''' [[float.h|<float.h>]]''' ||
|-
|''' [[inttypes.h|<inttypes.h>]]''' ||
|-
|''' [[iso646.h|<iso646.h>]]''' ||
|-
|''' [[limits.h|<limits.h>]]''' ||
|-
|''' [[locale.h|<locale.h>]]''' ||
|-
|''' [[math.h|<math.h>]]''' ||
|-
|''' [[setjmp.h|<setjmp.h>]]''' ||
|-
|''' [[signal.h|<signal.h>]]''' ||
|-
|''' [[stdarg.h|<stdarg.h>]]''' ||
|-
|''' [[stdbool.h|<stdbool.h>]]''' ||
|-
|''' [[stdint.h|<stdint.h>]] ''' ||
|-
|''' [[stddef.h|<stddef.h>]]''' ||
|-
|''' [[stdio.h|<stdio.h>]]''' ||
|-
|''' [[stdlib.h|<stdlib.h>]]''' ||
|-
|''' [[string.h|<string.h>]]''' ||
|-
|''' [[tgmath.h|<tgmath.h>]]''' ||
|-
|''' [[time.h|<time.h>]]''' ||
|-
|''' [[wchar.h|<wchar.h>]]''' ||
|-
|''' [[wctype.h|<wctype.h>]]''' ||
|}
== Standardní knihovna jazyka C v jiných jazycích ==
Některé programovací jazyky zahrnují funkce standardní knihovny jazyka C ve svých vlastních knihovnách. Knihovny v jiných programovacích jazycích jsou většinou přizpůsobené, aby více vyhovovaly struktuře daného programovacího jazyka, ale funkce a smentika je zachována. Programovací jazyk [[C++]] například zahrnuje funkce standardu knihovny ANSI C, co se týče jména funkcí '''std''' (jako <code>std::printf</code>, <code>std::atoi</code>, <code>std::feof</code>, etc.) a podobná jména hlavičkových souborů ("<code>cstdio</code>", "<code>cmath</code>", "<code>cstdlib</code>", atd.). Dalšími jazyky s podobným přístupem k programování, jako má jazyk C jsou: [[D (programovací jazyk)|programovací jazyk D]] a převládající implementace jazyka [[Python (programovací jazyk)|Python]] známá jako [[CPython]].
== Funkce compileru ==
Some compilers (for example, [[GNU Compiler Collection|GCC]]<ref>[http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Other-Builtins.html#Other-Builtins Other built-in functions provided by GCC], GCC Manual</ref>) provide built-in versions of many of the functions in the C standard library; that is, the implementations of the functions are written into the compiled [[object file]], and the program calls the built-in versions instead of the functions in the C library [[shared object]] file. This reduces function call overhead, especially if function calls are replaced with [[inline function|inline]] variants, and allows other forms of [[Compiler optimization|optimisation]] (as the compiler knows the [[Control flow|control-flow]] characteristics of the built-in variants), but may cause confusion when debugging (for example, the built-in versions cannot be replaced with [[Instrumentation (computer programming)|instrumented]] variants).
However, the built-in functions must behave like ordinary functions in accordance with ISO C. The main implication is that the program must be able to create a pointer to these functions by taking their address, and invoke the function by means of that pointer. If two pointers to the same function are derived in two different translation unit in the program, these two pointers must compare equal; that is, the address comes by resolving the name of the function, which has external (program-wide) linkage.
== Standardní knihovna POSIX ==
[[POSIX]] (and [[Single Unix Specification|SUS]]) specifies a number of routines that should be available over and above those in the C standard library proper; these are often implemented alongside the C standard library functionality, with varying degrees of closeness. For example, [[glibc]] implements functions such as [[Fork (operating system)|fork]] within libc.so, but before [[NPTL]] was merged into glibc it constituted a separate library with its own linker flag. Often, this POSIX-specified functionality will be regarded as part of the library; the C library proper may be identified as the ANSI or [[International Organization for Standardization| ISO]] C library.
== Implementace ==
Unix-like systems typically have a C library in [[shared library]] form, but the header files (and compiler toolchain) may be absent from an installation so C development may not be possible. The C library is considered part of the operating system on Unix-like systems. The C functions, including the ISO C standard ones, are widely used by programs, and are regarded as if they were not only an implementation of something in the C language, but also de facto part of the operating system interface. Unix-like operating systems generally cannot function if the C library is erased.
By contrast, on Microsoft Windows, the core system dynamic libraries ([[DLL]]s) do not provide an implementation of the C standard library; this is provided by each compiler individually. Compiled applications written in C are either statically linked with a C library, or linked to a dynamic version of the library that is shipped with these applications, rather than relied upon to be present on the targeted systems. Functions in a compiler's C library are not regarded as interfaces to Microsoft Windows.
Many other implementations exist, provided with both various operating systems and C compilers.
Seznam nejznámějších implementací:
|