x_array_list.h File Reference

Higher level lists of arrays and associated functions. More...

#include <inttypes.h>
#include "array.h"

Go to the source code of this file.

Data Structures

struct  struct_uint32_array_list_t
 Defines a list of uint32_array_t. More...
struct  struct_mpz_array_list_t
 Defines a list of mpz_array_t. More...

Defines

#define _TIFA_X_ARRAY_LIST_H_

Typedefs

typedef struct
struct_uint32_array_list_t 
uint32_array_list_t
 Equivalent to struct struct_uint32_array_list_t.
typedef struct
struct_mpz_array_list_t 
mpz_array_list_t
 Equivalent to struct struct_mpz_array_list_t.

Functions

uint32_array_list_talloc_uint32_array_list (uint32_t alloced)
 Allocates and returns a new uint32_array_list_t.
static void add_entry_in_uint32_array_list (uint32_array_t *const entry, uint32_array_list_t *const list)
 Adds an entry to a uint32_array_list_t.
void free_uint32_array_list (uint32_array_list_t *const list)
 Clears a uint32_array_list_t.
void print_uint32_array_list (const uint32_array_list_t *const list)
 Prints a uint32_array_list_t.
mpz_array_list_talloc_mpz_array_list (uint32_t alloced)
 Allocates and returns a new mpz_array_list_t.
static void add_entry_in_mpz_array_list (mpz_array_t *const entry, mpz_array_list_t *const list)
 Adds an entry to a mpz_array_list_t.
void free_mpz_array_list (mpz_array_list_t *const list)
 Clears a mpz_array_list_t.
void print_mpz_array_list (const mpz_array_list_t *const list)
 Prints a mpz_array_list_t.


Detailed Description

Higher level lists of arrays and associated functions.

Author:
Jerome Milan
Date:
Fri Jun 10 2011
Version:
2011-06-10
Defines higher level lists of arrays and their associated functions. This terminology is actually a bit confusing since they are actually more arrays of arrays rather than lists strictly speaking.

Definition in file x_array_list.h.


Define Documentation

#define _TIFA_X_ARRAY_LIST_H_

Standard include guard.

Definition at line 37 of file x_array_list.h.


Function Documentation

static void add_entry_in_mpz_array_list ( mpz_array_t *const   entry,
mpz_array_list_t *const   list 
) [inline, static]

Adds an entry to a mpz_array_list_t.

Adds the entry pointer to list and increments its length field.

Warning:
This function tranfers the ownership of the mpz_array_t pointed to by entry to list. This means that any client code should not clear any mpz_array_t that has been added to a mpz_array_list_t since this is the exclusive responsability of the mpz_array_list_t.
Parameters:
[in] entry A pointer to the mpz_array_t to add in the list.
[in] list A pointer to the mpz_array_list_t.
Returns:
A pointer to the newly allocated mpz_array_list_t structure.

Definition at line 225 of file x_array_list.h.

References struct_mpz_array_list_t::data, and struct_mpz_array_list_t::length.

static void add_entry_in_uint32_array_list ( uint32_array_t *const   entry,
uint32_array_list_t *const   list 
) [inline, static]

Adds an entry to a uint32_array_list_t.

Adds the entry pointer to list and increments its length field.

Warning:
This function tranfers the ownership of the uint32_array_t pointed to by entry to list. This means that any client code should not clear any uint32_array_t that has been added to a uint32_array_list_t since this is the exclusive responsability of the uint32_array_list_t.
Parameters:
[in] entry A pointer to the array to add.
[in] list A pointer to the uint32_array_list_t.
Returns:
A pointer to the newly allocated uint32_array_list_t structure.

Definition at line 117 of file x_array_list.h.

References struct_uint32_array_list_t::alloced, struct_uint32_array_list_t::data, and struct_uint32_array_list_t::length.

mpz_array_list_t* alloc_mpz_array_list ( uint32_t  alloced  ) 

Allocates and returns a new mpz_array_list_t.

Allocates and returns a new mpz_array_list_t such that:

  • its alloced field is set to the parameter alloced.
  • its length field set to zero.
  • its data array is left uninitialized.
Parameters:
[in] alloced The allocated length of the mpz_array_list_t to allocate.
Returns:
A pointer to the newly allocated mpz_array_list_t structure.

uint32_array_list_t* alloc_uint32_array_list ( uint32_t  alloced  ) 

Allocates and returns a new uint32_array_list_t.

Allocates and returns a new uint32_array_list_t such that:

  • its alloced field is set to the parameter alloced.
  • its length field set to zero.
  • its data array is left uninitialized.
Parameters:
[in] alloced The allocated length of the uint32_array_list_t to allocate.
Returns:
A pointer to the newly allocated uint32_array_list_t structure.

void free_mpz_array_list ( mpz_array_list_t *const   list  ) 

Clears a mpz_array_list_t.

Clears a mpz_array_list_t, or, more precisely, clears the memory space used by the array pointed by the data field of a mpz_array_list_t. Also set its alloced and length fields to zero.

Parameters:
[in] list A pointer to the mpz_array_list_t to clear.

void free_uint32_array_list ( uint32_array_list_t *const   list  ) 

Clears a uint32_array_list_t.

Clears a uint32_array_list_t, or, more precisely, clears the memory space used by the array pointed by the data field of a uint32_array_list_t. Also set its alloced and length fields to zero.

Parameters:
[in] list A pointer to the uint32_array_list_t to clear.

void print_mpz_array_list ( const mpz_array_list_t *const   list  ) 

Prints a mpz_array_list_t.

Prints a mpz_array_list_t on the standard output.

Note:
This function is mostly intended for debugging purposes as the output is not particularly well structured
Parameters:
[in] list A pointer to the mpz_array_list_t to print.

void print_uint32_array_list ( const uint32_array_list_t *const   list  ) 

Prints a uint32_array_list_t.

Prints a uint32_array_list_t on the standard output.

Note:
This function is mostly intended for debugging purposes as the output is not particularly well structured
Parameters:
[in] list A pointer to the uint32_array_list_t to print.


Generated on Fri Jun 17 11:10:12 2011 for TIFA by Doxygen 1.5.5