API: 두 판 사이의 차이

내용 삭제됨 내용 추가됨
편집 요약 없음
편집 요약 없음
1번째 줄:
'''API'''({{lang|en|Application Programming Interface}}, 응용 프로그램 프로그래밍 인터페이스)는 [[응용 프로그램]]에서 사용할 수 있도록, [[운영 체제]]나 [[프로그래밍 언어]]가 제공하는 기능을 제어할 수 있게 만든 [[인터페이스 (컴퓨터 과학)|인터페이스]]를 뜻한다. 주로 파일 제어, 창 제어, 화상 처리, 문자 제어 등을 위한 인터페이스를 제공한다.
 
== 이용 ==
API는 [[응용 프로그램 이진 인터페이스]](ABI)와는 구별한다. API는 소스 코드 기반인 반면 ABI는 이진 인터페이스이다. 이를테면 POSIX는 API인 반면, [[리눅스 기본 규격]]은 ABI를 제공한다.<ref>{{웹 인용|
url=http://www.linuxfoundation.org/collaborate/workgroups/lsb/lsb-introduction|
title=LSB Introduction|
publisher=Linux Foundation|date=21 June 2012|
accessdate=2015-03-27}}</ref><ref>{{웹 인용|
first=Nick|
last=Stoughton|
url=https://db.usenix.org/publications/login/2005-04/openpdfs/standards2004.pdf|
title=Update on Standards|
publisher=[[USENIX]]|
format=PDF|date=April 2005|
accessdate=2009-06-04}}</ref>
=== 절차적 언어에서의 API ===
대부분의 절차적 언어에서 API는 특정한 작업을 수행할 [[함수]]들의 집합을 규정하며, 특정 소프트웨어 구성 요소와 상호 작용할 수 있게 한다.
 
유닉스 명령어 <code>man 3 sqrt</code>는 <code>sqrt</sort> 함수의 [[타입 시그너처|시그너처]]를 대표한다:
<source lang="C">
SYNOPSIS
#include <math.h>
double sqrt(double X);
float sqrtf(float X);
DESCRIPTION
sqrt computes the positive square root of the argument. ...
RETURNS
On success, the square root is returned. If X is real and positive...
</source>
 
이와 비슷하게, 다른 언어들은 절차적 라이브러리를 갖고 있다. 이를테면 [[펄]]에는 내부 문서화 기능을 이용할 수 있는 동일한 수식 작업을 위한 전용 API들이 있으며, [[perldoc]] 유틸리티를 이용하여 접근할 수 있다:
<source lang="perl">
$ perldoc -f sqrt
sqrt EXPR
sqrt #Return the square root of EXPR. If EXPR is omitted, returns
#square root of $_. Only works on non-negative operands, unless
#you've loaded the standard Math::Complex module.
</source>
 
== API의 예 ==
줄 24 ⟶ 61:
* [[웹 서비스]]
* [[매시업]]
 
== 각주 ==
{{각주}}
 
{{운영 체제}}