C/Invoke

C/Invoke is a library for connecting to C libraries at runtime.
Download

C/Invoke Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Will Weisser
  • Publisher web site:
  • http://www.nongnu.org/cinvoke/

C/Invoke Tags


C/Invoke Description

C/Invoke is a library for connecting to C libraries at runtime. C/Invoke is a library for connecting to C libraries at runtime. This differs from the typical method of interfacing with C, which involves writing static definitions which are then compiled to a machine-dependant format. C/Invoke provides a runtime facility to build descriptions of C functions and to call them, passing them appropriate data and retrieving results.C/Invoke provides a central repository of code to handle the platform-dependant details of marshaling C parameters and return values. Currently C/Invoke has been ported to GCC (GNU/Linux, *BSD) on the x86 and amd64 architectures, Microsoft Windows on x86, and Mac OS X on PowerPC. The development team is interested in adding more ports as they gain access to more diverse hardware.AudienceThe main audience of C/Invoke are users of high-level programming languages who wish to interface with C. At the moment, most languages can be extended with C libraries only by authoring modules in C using language-specific APIs. There are many problems with this approach; writing extension modules requires knowledge of the C language instead of the language the application is being written in, the APIs needed to implement the modules are often involved and complex, and the resulting libraries must be built and maintained on many different platforms.However, once C/Invoke is integrated into a language, the situation changes dramatically; users of Lua (for example) can interface to C by writing Lua code alone. This means that the advantages of Lua (or other high-level languages) such as portability and ease of use can be combined with the low-level power of C. To call a C function, one merely declares a C prototype in the high-level code, similar to the P/Invoke functionality of Microsoft's .NET Framework. A subroutine is then created in the high-level environment which hooks into a proxy generated to correctly call the given C function.There are two ways to integrate C/Invoke into a language. One is to use the existing extension module interface of the language in the normal manner. This is the preferred method to integrate with a language which is already established and which would be hard to modify, such as Perl, Python, Ruby, Tcl, etc. The other way would be to link C/Invoke directly into the language runtime and make the declarative C services part of the syntax of the language.The C/Invoke developers are always looking for volunteers to integrate with an existing language, or programming language authors who are interested in using C/Invoke directly.What's New in This Release:· Support for the SPARC architecure was added, and many bugs were fixed in the Lua language binding.


C/Invoke Related Software