API shim
Encyclopedia
In computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...

, a shim (from shim) or shiv is a small library
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....

 which transparently intercepts an API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 and changes the parameters passed, handles the operation itself, or redirects the operation elsewhere. Shims typically come about when the behavior of an API changes, thereby causing compatibility issues for older applications which still rely on the older functionality. In such cases, the older API can still be supported by a thin compatibility layer
Compatibility layer
A compatibility layer is a term that refers to components that allow for non-native support of components.In software engineering, a compatibility layer allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system...

 on top of the newer code. Shims can also be used for running programs on different software platforms than they were developed for.

Examples

One example was the support of AppleTalk
AppleTalk
AppleTalk is a proprietary suite of protocols developed by Apple Inc. for networking computers. It was included in the original Macintosh released in 1984, but is now unsupported as of the release of Mac OS X v10.6 in 2009 in favor of TCP/IP networking...

 on Macintosh computers during the brief period in which Apple Computer
Apple Computer
Apple Inc. is an American multinational corporation that designs and markets consumer electronics, computer software, and personal computers. The company's best-known hardware products include the Macintosh line of computers, the iPod, the iPhone and the iPad...

 supported the Open Transport
Open Transport
Open Transport was the name given by Apple Inc. to their implementation of the Unix-originated System V STREAMS. Based on code licensed from Mentat's Portable Streams product, Open Transport was built to provide the Mac OS with a modern TCP/IP implementation, replacing MacTCP...

 networking system. Thousands of Mac programs were based on the universal AppleTalk protocol; in order to support these programs, AppleTalk was re-implemented as an OpenTransport "stack", and then re-implemented as an API shim on top of this new library.

The Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 Application Compatibility Toolkit (ACT) uses the term to mean backward compatibility
Backward compatibility
In the context of telecommunications and computing, a device or technology is said to be backward or downward compatible if it can work with input generated by an older device...

 libraries. Shims simulate the behavior of older versions of Windows for legacy applications that rely on incorrect or deprecated functionality, or correct the way in which poorly-written applications call unchanged APIs, for example to fix LUA
Principle of least privilege
In information security, computer science, and other fields, the principle of least privilege, also known as the principle of minimal privilege or just least privilege, requires that in a particular abstraction layer of a computing environment, every module must be able to access only the...

 bug
Software bug
A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways. Most bugs arise from mistakes and errors made by people in either a program's...

s.

Wine
Wine (software)
Wine is a free software application that aims to allow computer programs written for Microsoft Windows to run on Unix-like operating systems. Wine also provides a software library, known as Winelib, against which developers can compile Windows applications to help port them to Unix-like...

 is a shim that allows running many Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 applications on Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, BSD, Solaris, and Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 based operating systems.

See also

  • Application virtualization
    Application Virtualization
    Application virtualization is an umbrella term that describes software technologies that improve portability, manageability and compatibility of applications by encapsulating them from the underlying operating system on which they are executed. A fully virtualized application is not installed in...

  • Driver wrapper
    Driver wrapper
    A driver wrapper is software that functions as an adapter between an operating system and a driver, such as a device driver, that was not designed for that operating system. It can enable the use of devices for which no drivers for the particular operating system are available...

  • Glide wrappers
  • Thunk (compatibility mapping)
    Thunk (compatibility mapping)
    Thunk refers to the creation of a 16-bit virtual DOS machine within a 32-bit operating platform so that there is backward compatibility for applications using older code or system calls.-OS/2 & Windows 16-bit address hack:...

  • Windows on Windows
    Windows on Windows
    In computing, Windows on Windows - commonly referred to by its acronym WOW or WoW - is a software component of 32-bit versions of the Microsoft Windows NT family of operating systems that provides limited support for running legacy Win16 applications - applications written for Windows 3.x...

  • Wrapper library
    Wrapper library
    In computer programming, a library is a collection of subroutines or classes used to develop software. Libraries expose interfaces which clients of the library use to execute library routines. Wrapper libraries consist of a thin layer of code which translates a library's existing interface into a...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK