gCAD3D 2.35
ut_iTab.c File Reference

list of integers More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_iTab.h"

Functions

int I4Tab_init_spc (I4Tab *tab, void *spc, int isize)
 
int I4Tab_free (I4Tab *tab)
 
int I4Tab_add (I4Tab *tab, int iNew)
 
int I4Tab_add_uniq (int *iNr, I4Tab *tab, int iNew)
 
int I4Tab_find (int ii, I4Tab *tab)
 
int I4Tab__ (int ii, I4Tab *tab)
 
int I4Tab_nr (I4Tab *tab)
 
int I4Tab_dump (I4Tab *tab)
 

Detailed Description

list of integers

=====================================================
List_functions_start:
U4Tab_NEW setup of a new IntegerList
I4Tab_init_spc init / clear table; fixed space (void*); no reallocate
// I4Tab_init__ init / clear table; automatic alloc/realloc
// I4Tab_init_Memspc init / clear table; fixed space in Memspc; no reallocate
// I4Tab_init_fu init / clear table; save into temp-file.
I4Tab_free reset, free
I4Tab_add add integer
I4Tab_add_uniq add integer, check if it already exists
I4Tab__ return int from index
I4Tab_find find index of int
I4Tab_nr return nr of ints
List_functions_end:
=====================================================
see also:
UTI

Function Documentation

int I4Tab_init_spc ( I4Tab tab,
void *  spc,
int  isize 
)
init / clear all words; fixed space (void*); no reallocate.
RetCod:
int I4Tab_free ( I4Tab tab)

do not free I4Tab from I4Tab_init_Memspc

int I4Tab_add ( I4Tab tab,
int  iNew 
)
add a new int
RetCode:
-1 EOM - no enough memory error
>=0 index of iNew in tab
int I4Tab_add_uniq ( int *  iNr,
I4Tab tab,
int  iNew 
)
add string, check if it already exists
Output:
iNr index of iNew in tab
RetCode:
-1 EOM - not enough memory error
0 new record added (iNew is uniq)
1 no new record added (iNew is not uniq)
int I4Tab_find ( int  ii,
I4Tab tab 
)

I4Tab_find find int ii - returns nr; -1 = not found

int I4Tab__ ( int  ii,
I4Tab tab 
)

get text of record Nr iNr (returns value)

int I4Tab_nr ( I4Tab tab)

returns nr of strings

int I4Tab_dump ( I4Tab tab)

dump all strings (test)