TPCCLIB
|
Expansion of positive integers specified in a string. More...
#include "libtpcmisc.h"
Go to the source code of this file.
Functions | |
void | intInit (INT_list *l) |
void | intEmpty (INT_list *l) |
int | intExpand (char *text, INT_list *list) |
int | _intexadd (INT_list *list, int a) |
INT_list | intMerge (INT_list *list1, INT_list *list2) |
int | integerListInit (INTEGER_LIST *l) |
int | integerListEmpty (INTEGER_LIST *l) |
int | integerListAdd (INTEGER_LIST *l, int v, int ifnew) |
int | integerListSort (INTEGER_LIST *l) |
int | integerListAddFromString (const char *s1, const char *s2, INTEGER_LIST *l, const int ifnew) |
int | integerListExpandFromString (const char *s1, const char *s2, INTEGER_LIST *l, const int ifnew) |
Expansion of positive integers specified in a string.
Definition in file intex.c.
int _intexadd | ( | INT_list * | list, |
int | a ) |
int _intexadd(int *list, int a) ; local function. Deprecated.
list | |
a |
Definition at line 92 of file intex.c.
Referenced by intExpand().
int integerListAdd | ( | INTEGER_LIST * | l, |
int | v, | ||
int | ifnew ) |
Add one integer to INTEGER_LIST.
l | Pointer to initiated list |
v | Integer value to add |
ifnew | Add integer to the list only if it is new (0=no, 1=yes) |
Definition at line 190 of file intex.c.
Referenced by imgMaskRoiNr(), integerListAddFromString(), and integerListExpandFromString().
int integerListAddFromString | ( | const char * | s1, |
const char * | s2, | ||
INTEGER_LIST * | l, | ||
const int | ifnew ) |
Read a list of integer values from given string with given delimiters.
s1 | Pointer to string from which the integers are read, for example "2,3,6,8". |
s2 | String containing character delimiters, for example ", ". |
l | Pointer to INTEGER_LIST struct; previous contents are preserved. |
ifnew | Add integer to the list only if it is new (0=no, 1=yes) |
Definition at line 242 of file intex.c.
int integerListEmpty | ( | INTEGER_LIST * | l | ) |
Free the memory allocated in the INTEGER_LIST struct.
l | Pointer to INTEGER_LIST struct |
Definition at line 175 of file intex.c.
Referenced by imgMaskRoiNr().
int integerListExpandFromString | ( | const char * | s1, |
const char * | s2, | ||
INTEGER_LIST * | l, | ||
const int | ifnew ) |
Read ranges and individual integer values from given string with given delimiters.
s1 | Pointer to string from which the integers are read, for example "0-8,12,32-28" or "0..8, 12, 28..34". |
s2 | String containing character delimiters, for example ", ". |
l | Pointer to INTEGER_LIST struct; previous contents are preserved. |
ifnew | Add integer to the list only if it is new (0=no, 1=yes) |
Definition at line 278 of file intex.c.
int integerListInit | ( | INTEGER_LIST * | l | ) |
Call this (once) before using INTEGER_LIST struct for the first time.
l | Pointer to INTEGER_LIST struct |
int integerListSort | ( | INTEGER_LIST * | l | ) |
Sort INTEGER_LIST
l | Pointer to INTEGER_LIST struct |
Definition at line 219 of file intex.c.
Referenced by imgMaskRoiNr().
void intEmpty | ( | INT_list * | l | ) |
int intExpand | ( | char * | text, |
INT_list * | list ) |
Existing list is freed and all data is cleared. Deprecated. Expanded integers are listed in list.i[] in increasing order.
text | Integer expressions to be expanded, e.g. 0-8,12,34-28 |
list | Pointer for int list data |
Definition at line 43 of file intex.c.
void intInit | ( | INT_list * | l | ) |
Merges two lists and returns the result. (the originals are not touched) Duplicate entries are removed. Deprecated.
list1 | The first list |
list2 | The second list |
Definition at line 124 of file intex.c.