---
name: "Gpointer"
section: "3o"
platform: "linux"
package: "liblablgtk2-ocaml-doc"
version: "2.4.0v0.2tv-8"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/Gpointer"
---

# Gpointer(3o)

Gpointer: various kinds of pointers to C data

## NAME

Gpointer - Gpointer: various kinds of pointers to C data

## Module

Module   Gpointer

## Documentation

Module **Gpointer**\
  :  **sig end**

**Gpointer** : various kinds of pointers to C data

*type* **'a** *optaddr*

Marked pointers

*val optaddr* :  **'a option -\> 'a optaddr**

*type optstring*

Naked pointers

*val raw\_null* :  **optstring**

*val optstring* :  **string option -\> optstring**

*type boxed*

Boxed pointers

*val boxed\_null* :  **boxed**

*val peek\_string* :  **?pos:int -\> ?len:int -\> boxed -\> string**

*val peek\_int* :  **boxed -\> int**

*val poke\_int* :  **boxed -\> int -\> unit**

*val peek\_nativeint* :  **boxed -\> nativeint**

*val poke\_nativeint* :  **boxed -\> nativeint -\> unit**

*type* **'a** *optboxed*

*val optboxed* :  **'a option -\> 'a optboxed**

*val may\_box* :  **f:('a -\> 'b) -\> 'a option -\> 'b optboxed**

*type* **\[\> \]** *variant\_table*

Variant tables

*val decode\_variant* :  **(\[\> \] as 'a) variant\_table -\> int -\> 'a**

*val encode\_variant* :  **(\[\> \] as 'a) variant\_table -\> 'a -\> int**

*val decode\_flags* :  **(\[\> \] as 'a) variant\_table -\> int -\> 'a list**

*val encode\_flags* :  **(\[\> \] as 'a) variant\_table -\> 'a list -\> int**

*exception Null*

Null pointer exception

*type* **'a** *stable*

Ensure a value is copied in the old generation

*val stable\_copy* :  **'a -\> 'a stable**

**=== Region handling ===**

*type region*

The abstract type of heap regions

*val length* :  **region -\> int**

the length of the region

*val get\_addr* :  **region -\> nativeint**

the start address of the region

*val sub* :  **?pos:int -\> ?len:int -\> region -\> region**

subregion of length  **len** starting at offset  **pos**

*val get\_byte* :  **region -\> pos:int -\> int**

*val set\_byte* :  **region -\> pos:int -\> int -\> unit**

*val blit* :  **src:region -\> dst:region -\> unit**

*val region\_of\_string* :  **string -\> region**

create a region sharing a string

*val string\_of\_region* :  **region -\> string**

copy the contents of the region to a string

*type* **'a** *bigarray* =  **(int, Bigarray.int8\_unsigned\_elt, 'a) Bigarray.Array1.t**

*val region\_of\_bigarray* :  **'a bigarray -\> region**

create a region sharing a bigarray

**=== Unsafe access ===**

*val unsafe\_create\_region* :  **path:int array -\> get\_length:('a -\> int) -\> 'a -\> region**

**unsafe\_create\_region ~path ~get\_length** returns a function to build regions from a specific kind of data abstraction

*val unsafe\_get\_byte* :  **region -\> pos:int -\> int**

*val unsafe\_set\_byte* :  **region -\> pos:int -\> int -\> unit**
