<s>
Wrapper	B-Library
libraries	I-Library
(	O
or	O
library	B-Library
wrappers	O
)	O
consist	O
of	O
a	O
thin	O
layer	O
of	O
code	O
(	O
a	O
"	O
shim	B-General_Concept
"	O
)	O
which	O
translates	O
a	O
library	B-Library
's	O
existing	O
interface	O
into	O
a	O
compatible	O
interface	O
.	O
</s>
<s>
Wrapper	B-Library
libraries	I-Library
can	O
be	O
implemented	O
using	O
the	O
adapter	O
,	O
façade	O
,	O
and	O
to	O
a	O
lesser	O
extent	O
,	O
proxy	O
design	O
patterns	O
.	O
</s>
<s>
The	O
specific	O
way	O
in	O
which	O
a	O
wrapper	B-Library
library	I-Library
is	O
implemented	O
is	O
highly	O
specific	O
to	O
the	O
environment	O
it	O
is	O
being	O
written	O
in	O
and	O
the	O
scenarios	O
which	O
it	O
intends	O
to	O
address	O
.	O
</s>
<s>
This	O
is	O
especially	O
true	O
in	O
the	O
case	O
when	O
cross	O
language/runtime	O
interoperability	O
is	O
a	O
consideration	O
.	O
</s>
<s>
The	O
following	O
provides	O
a	O
general	O
illustration	O
of	O
a	O
common	O
wrapper	B-Library
library	I-Library
implementation	O
.	O
</s>
<s>
The	O
original	O
C	O
interface	O
can	O
be	O
regarded	O
as	O
error	O
prone	O
,	O
particularly	O
in	O
the	O
case	O
where	O
users	O
of	O
the	O
library	B-Library
forget	O
to	O
unlock	O
an	O
already	O
locked	O
mutex	O
.	O
</s>
<s>
The	O
new	O
interface	O
effectively	O
utilizes	O
RAII	B-Application
(	O
Resource	B-Application
Acquisition	I-Application
is	I-Application
Initialization	I-Application
)	O
in	O
the	O
new	O
and	O
classes	O
to	O
ensure	O
s	O
are	O
eventually	O
unlocked	O
and	O
objects	O
are	O
automatically	O
released	O
.	O
</s>
<s>
The	O
above	O
code	O
closely	O
mimics	O
the	O
implementation	O
of	O
and	O
which	O
are	O
part	O
of	O
the	O
library	B-Library
.	O
</s>
<s>
Some	O
wrapper	B-Library
libraries	I-Library
exist	O
to	O
act	O
as	O
a	O
bridge	O
between	O
a	O
client	O
application	O
and	O
a	O
library	B-Library
written	O
using	O
an	O
incompatible	O
technology	O
.	O
</s>
<s>
For	O
instance	O
,	O
a	O
Java	B-Language
application	O
may	O
need	O
to	O
execute	O
a	O
system	B-Operating_System
call	I-Operating_System
.	O
</s>
<s>
However	O
system	B-Operating_System
calls	I-Operating_System
are	O
typically	O
exposed	O
as	O
C	O
library	B-Library
functions	I-Library
.	O
</s>
<s>
To	O
resolve	O
this	O
issue	O
Java	B-Language
implements	O
wrapper	B-Library
libraries	I-Library
which	O
make	O
these	O
system	B-Operating_System
calls	I-Operating_System
callable	O
from	O
a	O
Java	B-Language
application	O
.	O
</s>
<s>
In	O
order	O
to	O
achieve	O
this	O
,	O
languages	O
like	O
Java	B-Language
provide	O
a	O
mechanism	O
called	O
foreign	B-Application
function	I-Application
interface	I-Application
that	O
makes	O
this	O
possible	O
.	O
</s>
<s>
Some	O
examples	O
of	O
existing	O
wrapper	B-Library
libraries	I-Library
:	O
</s>
