talira

GObject Introspection

Middleware between GObject-based C libraries and language bindings

open sourceLGPL-2.0-or-later AND GPL-2.0-or-later AND MITfree

GObject Introspection (GI) is GNOME's middleware layer between C libraries built on GObject and language bindings. A scanner reads a library's C sources and headers at build time and writes GIR, an XML description of its API; a compiler turns that into a binary typelib, and the libgirepository library reads typelibs so that bindings can call into the C library automatically, with no hand-written glue. It also includes a Python package for creating and parsing GIR, and documents how to write bindable APIs and annotations.

Problems it solves

  • call a GObject-based C library from Python or JavaScript without writing bindings by hand
  • generate language bindings for my GNOME C library
  • make my C library usable from scripting languages through GObject

Features

  • scanner that generates GIR from C sources and headers
  • GIR XML format and binary typelib compiler
  • libgirepository to read typelibs at runtime
  • automatic bindings for GObject libraries in other languages

Alternatives

The same job

These do what GObject Introspection does.

  1. bindgen Generates Rust FFI bindings to C and some C++ libraries from their headers

Compare GObject Introspection with the top 3