API和ABI之间的差异 [英] Difference between API and ABI

查看:1326
本文介绍了API和ABI之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Linux系统编程和我​​遇到的API和ABI来了,而读
的Linux系统编程

I am new to linux system programming and I came across API and ABI while reading Linux System Programming.

API的定义:

这是API定义通过该接口
  一块软件通信的
  与其他在源代码级别。

An API defines the interfaces by which one piece of software communicates with another at the source level.

ABI的定义:

而一个API定义源
  接口,在ABI定义
  两者之间的低级别的二进制接口
  或在多件的软件
  特殊架构。它定义
  应用程序如何与之交互
  本身,应用程序如何交互
  与内核,以及如何在
  应用与图书馆互动。

Whereas an API defines a source interface, an ABI defines the low-level binary interface between two or more pieces of software on a particular architecture. It defines how an application interacts with itself, how an application interacts with the kernel, and how an application interacts with libraries.

如何能在节目源层面沟通?什么是一个源级别?这是否与源$ C ​​$ C的呢?或图书馆的来源被包含在主程序?

How can a program communicate at a source level ? What is a source level ? Is it related to source code in anyway? Or the source of the library gets included in the main program ?

我所知道的唯一的区别是API主要用于由程序员和ABI主要是由编译器使用。

The only difference I know is API is mostly used by programmers and ABI is mostly used by compiler.

推荐答案

的API是人类。我们编写源$ C ​​$ C。当我们写一个程序,并希望使用我们写code像一些库函数:

The API is what humans use. We write source code. When we write a program and want to use some library function we write code like:

 long howManyDecibels = 123L;
 int ok = livenMyHills( howManyDecibels);

和我们需要知道,有一种方法livenMyHills(),它需要很长整型参数。因此,作为一个编程接口,它在源$ C ​​$ C pssed所有前$ P $。编译器变成符合本语言的这个特定的操作系统上执行的可执行指令这一点。在这种情况下会导致音频单元上某些低级别的操作。因此,特别是比特和字节在一些硬件喷出。因此,在运行时有大量的二进制级别的行动正在进行,我们通常不会看到的。

and we needed to know that there is a method livenMyHills(), which takes a long integer parameter. So as a Programming Interface it's all expressed in source code. The compiler turns this into executable instructions which conform to the implementation of this language on this particular operating system. And in this case result in some low level operations on an Audio unit. So particular bits and bytes are squirted at some hardware. So at runtime there's lots of Binary level action going on which we don't usually see.

这篇关于API和ABI之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆