Skip to content
apidoc-c and apidoc-cpp samples

geo/vec #

Vectors, in C, for the documentation site and apidoc-clang's tests.

macro VEC_MAX #

#define VEC_MAX 1024

The largest length.

struct vec_t #

typedef struct { ... } vec_t

A vector of numbers.

field data #

double *data

The numbers.

field len #

size_t len

How many.

type alias vec_pool #

typedef struct vec_pool vec_pool

An opaque handle to a vector pool.

enum vec_order #

enum vec_order

How a vector is ordered.

variant VEC_ASC #

VEC_ASC

Smallest first.

variant VEC_DESC #

VEC_DESC

Largest first.

constant VEC_SORTED #

VEC_SORTED = 1

constant VEC_UNIQUE #

VEC_UNIQUE = 2

function vec_new #

vec_t *vec_new(size_t len)

Makes a vector.

Parameters

len

How many numbers; at most VEC_MAX.

Returns

A vector of len zeros, or NULL when out of memory.

See also

vec_free

function vec_free #

void vec_free(vec_t *v)

Frees a vector made by vec_new().

function vec_sort #

void vec_sort(vec_t *v, enum vec_order order)

Sorts it, see vec_order.

type alias vec_visit #

typedef int (*vec_visit)(double value, void *data)

A callback over numbers.

variable vec_count #

extern size_t vec_count

How many vectors there are.