GOffice Reference Manual: Utils

## Utils Utils |

## Functions

GocIntArray * | goc_int_array_new ()
GocIntArray * | goc_int_array_ref ()
void | goc_int_array_unref ()
GocPoints * | goc_points_new ()
GocPoints * | goc_points_ref ()
void | goc_points_unref ()

## Types and Values

| GocIntArray
| GocPoints

## Object Hierarchy

        GBoxed
        ├── GocIntArray
        ╰── GocPoints

## Description

Only one structure is currently available: GocPoints.

## Functions

### goc_int_array_new ()

    GocIntArray *
    goc_int_array_new (unsigned  n);

Creates a new GocIntArray instances with `n` values initialized to 0. The values can be changed using direct access:

         GocIntArray array = goc_int_array_new (2);
         array->vals[0] = my_first_int;
         array->vals[1] = my_second_int;

#### Parameters

n | the number of integers in the array. |

#### Returns

the newly created GocIntArray with an initial references count of 1.

Since 0.8.2

### goc_int_array_ref ()

    GocIntArray *
    goc_int_array_ref (GocIntArray *array);

Increases the references count of `array` by 1.

#### Parameters

array | GocIntArray |

#### Returns

the referenced GocIntArray.

Since 0.8.2

### goc_int_array_unref ()

    void
    goc_int_array_unref (GocIntArray *array);

Decreases the references count of `array` by 1, and destroys it if the references count becomes 0.

#### Parameters

array | GocIntArray |

Since 0.8.2

### goc_points_new ()

    GocPoints *
    goc_points_new (unsigned  n);

Creates a new GocPoints instances with `n` points with nul initial coordinates. The coordinates can be changed using direct access:

         GocPoints points = goc_points_new (1);
         points->points[0].x = my_x;
         points->points[0].y = my_y;

#### Parameters

n | the number of GocPoint instances. |

#### Returns

the newly created GocPoints with an initial references count of 1.

### goc_points_ref ()

    GocPoints *
    goc_points_ref (GocPoints *points);

Increases the references count of `points` by 1.

#### Parameters

points | GocPoints |

#### Returns

the referenced GocPoints.

### goc_points_unref ()

    void
    goc_points_unref (GocPoints *points);

Decreases the references count of `points` by 1, and destroys it if the references count becomes 0.

#### Parameters

points | GocPoints |

## Types and Values

### GocIntArray

    typedef struct {
    	unsigned n;
    	int *vals;
    } GocIntArray;

FocIntArray::n is the size of the array. A boxed type used to hold an array of integers.

#### Members

int *`vals`; | The embedded values. |

Since 0.8.2

### GocPoints

    typedef struct {
    	GocPoint *points;
    } GocPoints;

A boxed type used to hold a list of GocPoint instances.

#### Members

GocPoint *`points`; | The embedded points. |