c::slice - Create and manipulate C-level array slices
Welcome to Struct, a set of packages providing various data structures to Tcl, and additional operations for existing Tcl structures.
This package provides a basic C API for the creation and use of continous array slices. It does provide neither Tcl commands nor other items visible at script level.
The package is meant to be used by other C level data structure packages, as a means to provide access to parts of their internal data, assuming that they are (conceptually) an array.
To support this the package provides its C API by means of a stubs table which can be imported.
This function creates and initializes a slice object with the specified slice of an array of cells. The return value of the function is the handle of the new slice object.
This function destroys the specified slice object, releasing all allocated memory.
This function provides access to the slice of cells contained in the specified slice object.
This function creates a new slice which is the reverse of the input. The input slice is destroyed.
This function creates a new slice which is the concatenation of the two inputs. The input slices are destroyed.
This function creates a new slice containing the elements of the Tcl list object l.
If l was not a list object 0 is returned, and an error message left in the interpreter interp. Note that interp can be 0, in that case no error message is left.
This function creates a new Tcl list object containing the elements of the slice. This makes sense if and only if the elements of the slice are of type Tcl_Obj*. Any other type and the resulting Tcl object is broken, causing a crash at some point in the future.
This function returns the size of the slice s.
This function returns the element at index at in slice s.
This package, written by Andreas Kupries, is BSD licensed.
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such at the Struct Tracker. Please also report any ideas for enhancements you may have for either package and/or documentation.