블로그 이미지
대갈장군

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

Notice

2010. 9. 25. 01:40 프로그래밍/C
우선 역사를 보자. C 언어는 기준이 완성되기 전까지는 Input/Output 기능과 같은 기본 함수를 언어자체적으로 지원하지 않았다. 그것에 불편을 느낀 다수의 사용자들이 모여 지금의 C Standard Library를 작성하게 되었다. 

Unix와 C는 둘 다 AT&T's Bell Laboratories에서 1960년대 그리고 1970년대에 개발되었는데 C 언어가 인기가 높아지고 많은 사람들이 사용하기 시작하면서 호환성 문제가 발생한다. 고로 American National Standards Institute(ANSI)에서 표준을 세우고 규격화하여 내놓은 것이 바로 ANSI C이다. 그리고 이것은 1989년에 완성된어 C89라고 명명되어 졌다. 

그렇다면, C Standard Library는 뭐냐 하면, C Programming 언어에서 사용되는 기본 명령들, 예를 들자면 input/output 및 string 핸들링 함수와 같은 것들을 구현하기 위한 headers와 library routines를 모아놓은 ISO C 기준의 일부분이다. 

즉, 다시 말해서 C Standard Library는 문서에 의해 규정된 '인터페이스 기준'이다. 고로 걍 설명서일 뿐이라는 것. 사실 C Standard Library는 24개의 헤더 파일인데 요 헤더 파일들에는 함수들과 데이터 타입 그리고 매크로등이 들어가 있다. 

이것은 다른 언어 (예를 들자면 자바)에 비교해서 아주 간단한 함수들만 선언된 헤더파일들이다. C Standard Library는 기껏해야 수학 함수, 문자열 함수, 타입 변환 함수 및 파일 입출력, 콘솔 화면 입출력 함수 정도만 명시되어 있다. 고로 C Standard Library는 C++ Standard Template Library와 같은 고급 컨테이너 타입이나 GUI, 네트워킹 툴등의 고급 기능은 전혀 없다.

아래의 목록이 바로 ISO가 명시하는 C Standard Library의 헤더 파일들이다.

ISO C library headers

NameFromDescription
<assert.h> Contains the assert macro, used to assist with detecting logical errors and other types of bug in debugging versions of a program.
<complex.h> C99 A set of functions for manipulating complex numbers.
<ctype.h> Contains functions used to classify characters by their types or to convert between upper and lower case in a way that is independent of the used character set (typically ASCII or one of its extensions, although implementations utilizing EBCDIC are also known).
<errno.h> For testing error codes reported by library functions.
<fenv.h> C99 For controlling floating-point environment.
<float.h> Contains defined constants specifying the implementation-specific properties of the floating-point library, such as the minimum difference between two different floating-point numbers (_EPSILON), the maximum number of digits of accuracy (_DIG) and the range of numbers which can be represented (_MIN_MAX).
<inttypes.h> C99 For precise conversion between integer types.
<iso646.h> NA1 For programming in ISO 646 variant character sets.
<limits.h> Contains defined constants specifying the implementation-specific properties of the integer types, such as the range of numbers which can be represented (_MIN_MAX).
<locale.h> For setlocale and related constants. This is used to choose an appropriate locale.
<math.h> For computing common mathematical functions.
<setjmp.h> Declares the macros setjmp and longjmp, which are used for non-local exits.
<signal.h> For controlling various exceptional conditions.
<stdarg.h> For accessing a varying number of arguments passed to functions.
<stdbool.h> C99 For a boolean data type.
<stdint.h> C99 For defining various integer types.
<stddef.h> For defining several useful types and macros.
<stdio.h> Provides the core input and output capabilities of the C language. This file includes the venerable printffunction.
<stdlib.h> For performing a variety of operations, including conversion, pseudo-random numbers, memory allocation, process control, environment, signalling, searching, and sorting.
<string.h> For manipulating several kinds of strings.
<tgmath.h> C99 For type-generic mathematical functions.
<time.h> For converting between various time and date formats.
<wchar.h> NA1 For manipulating wide streams and several kinds of strings using wide characters - key to supporting a range of languages.
<wctype.h> NA1 For classifying wide characters.



posted by 대갈장군