nfs-ganesha 1.4
Defines | Functions

nodelist_range.c File Reference

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include "nodelist.h"

Go to the source code of this file.

Defines

#define DEFAULT_RANGELIST_SIZE   16
#define DEFAULT_RANGELIST_INC_SIZE   8

Functions

int nodelist_range_set (nodelist_range_t *r1, long int v1, long int v2)
 set bridge range values
int nodelist_range_check (nodelist_range_t *r1)
 Indicate if the range is a valid one. That is to say if from value is lower that to value.
int _nodelist_range_compare (const void *a1, const void *a2)
int nodelist_range_compare (nodelist_range_t *r1, nodelist_range_t *r2)
 Indicate if the first range equals, is placed before or is placed after the second one.
int nodelist_range_intersects (nodelist_range_t *r1, nodelist_range_t *r2)
 Indicate if it exists an non empty intersection between the two input ranges.
int nodelist_range_intersection (nodelist_range_t *r1, nodelist_range_t *r2, nodelist_range_t *rout)
 Gives the range that is common to the two input ranges.
int nodelist_range_contiguous (nodelist_range_t *r1, nodelist_range_t *r2)
 Indicate if the two input ranges are contiguous.
int nodelist_range_includes (nodelist_range_t *r1, nodelist_range_t *r2)
 Indicate if one of the two input range is included in the other one.
int nodelist_range_union (nodelist_range_t *r1, nodelist_range_t *r2, nodelist_range_t *rout)
 Gives a nodelist_range that represent the union of the two nodelist_ranges given in input. The two ranges must intersect or be continuous otherwise operation will failed.
int nodelist_rangelist_init (nodelist_rangelist_t *array)
 Initialize a bridge ranges array structure.
int nodelist_rangelist_init_by_copy (nodelist_rangelist_t *array, nodelist_rangelist_t *a2c)
 Initialize a bridge ranges array structure by duplicating an other one.
int nodelist_rangelist_free_contents (nodelist_rangelist_t *array)
 Free a bridge ranges array structure contents.
int nodelist_rangelist_incremente_size (nodelist_rangelist_t *array)
 Increment a bridge ranges array storage zone.
int nodelist_rangelist_add_range (nodelist_rangelist_t *array, nodelist_range_t *rin)
 Add a range to a bridge ranges array The range will be merge with already existing ranges if required and resulting ranges will be sorted.
int nodelist_rangelist_add_rangelist (nodelist_rangelist_t *array, nodelist_rangelist_t *rlin)
int nodelist_rangelist_remove_range (nodelist_rangelist_t *array, nodelist_range_t *rin)
int nodelist_rangelist_remove_rangelist (nodelist_rangelist_t *array, nodelist_rangelist_t *rlin)
int nodelist_rangelist_add_list (nodelist_rangelist_t *array, char *list)
 Add a list of values to a bridge ranges array The range will be merge with already existing ranges if required and resulting ranges will be sorted.
int nodelist_rangelist_sort (nodelist_rangelist_t *array)
 Sort a bridge ranges array.
int nodelist_rangelist_intersects (nodelist_rangelist_t *a1, nodelist_rangelist_t *a2)
int nodelist_rangelist_includes (nodelist_rangelist_t *a1, nodelist_rangelist_t *a2)
int nodelist_rangelist_show (nodelist_rangelist_t *array)

Define Documentation

#define DEFAULT_RANGELIST_INC_SIZE   8

Definition at line 17 of file nodelist_range.c.

#define DEFAULT_RANGELIST_SIZE   16

Definition at line 16 of file nodelist_range.c.


Function Documentation

int _nodelist_range_compare ( const void *  a1,
const void *  a2 
)

Definition at line 43 of file nodelist_range.c.

int nodelist_rangelist_add_rangelist ( nodelist_rangelist_t array,
nodelist_rangelist_t rlin 
)

Definition at line 287 of file nodelist_range.c.

int nodelist_rangelist_includes ( nodelist_rangelist_t a1,
nodelist_rangelist_t a2 
)

Definition at line 544 of file nodelist_range.c.

int nodelist_rangelist_intersects ( nodelist_rangelist_t a1,
nodelist_rangelist_t a2 
)

Definition at line 526 of file nodelist_range.c.

int nodelist_rangelist_remove_range ( nodelist_rangelist_t array,
nodelist_range_t rin 
)

Definition at line 302 of file nodelist_range.c.

int nodelist_rangelist_remove_rangelist ( nodelist_rangelist_t array,
nodelist_rangelist_t rlin 
)

Definition at line 382 of file nodelist_range.c.

int nodelist_rangelist_show ( nodelist_rangelist_t array)

Definition at line 565 of file nodelist_range.c.