1 # Copyright (C) 2007-2009, Parrot Foundation.
4 =head1 External C Function Call
6 There is a vast wealth of libraries written for a variety of tasks, and
7 Parrot can tap into most of them using an interface called NCI. NCI
8 allows Parrot to make calls to low-level compiled functions from
9 pre-compiled libraries.
11 The C<loadlib> opcode loads in a compiled library as a Library PMC. The
12 C<dlfunc> opcode takes a reference to that library PMC and the name of
13 a function and returns an NCI subroutine PMC that can be invoked
14 like a normal Parrot subroutine.
20 library = loadlib "libnci_test"
21 unless library goto NOT_LOADED
23 # calling a function in the library
25 dlfunc function, library, "nci_c", "c"
40 # vim: expandtab shiftwidth=4 ft=pir: