
Заготовки по С / Динамические структуры / GDSL / Документация
.pdf
|
4.2 Low-level binary sear h tree manipulation module |
|
37 |
||
|
Returns: |
|
|
|
|
|
the rst node for whi h MAP F returns GDSL_MAP_STOP. |
|
|||
|
NULL when the parsing is done. |
|
|
||
See also: |
|
in x()(p. 37) |
|
|
|
|
gdsl_bstree_map_post x()(p. 37) |
|
|
||
4.2.2.18 |
_gdsl |
gdsl bstree_map in x ( onst |
|
||
|
|
bstree_t T, onst gdsl_bstree_map |
fun _t |
|
|
|
|
|
|
|
- |
|
MAParsemenin x()Complexity:.aallIf(pFlowMAP.nodes37)funMAP-levelsttiFoofpsnbinaryO(returnsFtheisand, voidlowalledreturnssearGDSL-levelhonUSERtreeitsbinaryMAPealasthinDATAexaminanodeSTOP,searxedorderwithh)treden.nodetheTgdslin.USERinbstreexedDATAordermap. rguThe |
||||
Note: |
|
|
|
|
Parameters:reUSERMAPTMAPondition:TheFlowFDA!=The-levelNULLAmap|binaTUser's.| )funyseardatastion.hpassedtreetotomapMAP._F.
Returns:the rst node for whi h MAP F returns GDSL_MAP_STOP. NULL when the parsing is done.
See also:gdsl_bstree_map_preostx()x()(p(p. 36). 37)
4.2.2.19 _gdsl bstree_t T,gdslonstbstreegdsl__mapbstreepostmapx ( funonst_t
GeneratedpostmenTheParse.MAPax()IfallowMAP(ponnodesMAP-.Flevel37)ThufunFstopsJunbinaryofreturnstionFthe,22andvoidis11:15:30earlowGDSLreturnsalled-hUSERveltree2006onMAPitsbinaryeaforlastpostDATAhgdslSTOP,nodeexaminatedsearxedby )Doxygenthenwithorderree.thenodegdslT USERin.bstreepostDATAxedmaporderrgu-.

38 |
|
|
gdsl Module Do umentation |
|
|
Note: |
|
|
|
|
User's. )funyseardatastion.hpassedtreetotomapMAP._F. |
|||
Parameters:reUSERMAPTMAPComplexity:ondition:TheFlowFDA!=-ThelevelNULLO(Amap|binaT| |
|
|
|
|
Returns: |
|
F returns GDSL_MAP_STOP. |
||
|
the rst node for whi h MAP |
|||
|
NULL when the parsing is done. |
|
||
See also: |
pre x()(p. 36) |
|||
|
gdsl_bstree_map_in x()(p. 37) |
|||
|
4.2.2.20 v id _ _ |
_ |
|
( onst _gdsl_bstree_t T, |
onOUTPUTnst gdslFILEbstree,voidewrite_fun _t WRITE_F, FILE Note:FILE,beWritepassedComplexity:theusingtonodesWRtentITEO(ontentsofallFnodes.funofthetionoflowa.loAddition-level-levelUSERbibinarylUSERsearDAsearhADATAtreeh) treeT toargumenOUTPUTle. t ould-
Parameters:reOUTPUTWRITEondition:The lowF-Flevel!=FILETheNULL&|binaryTwrite| )TheOUTPUTsearfunle tionwheretree._toFILEwrite!=.T'sNULLnodes. .
USER_DATA User's datas passed to WRITE_F.
See also:gdsl_bstree_writedump()xml()(p. 39)(p. 39)
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

|
Low- |
el binary sear h tree manipulati |
module |
|
39 |
|||
|
4.2.2.21 |
lev id _gdsl_ |
_ |
_xml |
_gdsl |
bstree_t T, |
|
|
|
|
|
|
( onstWRITE_F, FILE |
|
|||
|
|
onOUTPUTnst gdslFILEbstree,voidewrite_fun |
|
|
||||
|
|
|
|
|
|
|
- |
|
|
argumentionFILE,WriteComplexity:totheinwriteonodesouldXMLT'stentbenodeslaO(onofpassedtentsguagelowontentsof.-tolevelIftheWRITEtobinarylowOUTPUT-levelFsearFUSER. !=binaryhNULL,FILEtreesearDAto.AdditionnalthenaAtree)leuseintoTWRITEtoXMLUSEROUTPUT.FDATAfun |
|||||||
Note: |
|
|
|
|
|
|
|
Parameters:reOUTPUTWRITEOUTPUTondition:The low-FlevelFILEFILEThe|binaryT!=write| )TheNULLsearfunle. tionwheretree. to write.T's nodes.
USER_DATA User's datas passed to WRITE_F.
See also:gdsl_bstree_write()dump()(p(p..38)39)
4.2.2.22 v id _ _ _dump ( o st _gdsl_bstree_t T, OUTPUTonst gdslFILEbstree,voidewrite_fun _t WRITE_F, FILE
Note:WRITEtoDumpOUTPUTComplexity:theFstruinternal.!=FILENULL,tureO(stru.ofAthedditionnalturelowuseof-levelWRITElowUSERbinary-levelUSERFDATAsearbinaryfunhtionDAargumentreeseartoTAhwriteto)treeOUTPUTouldT'stoanodesbele.passedFILEonten.toIf
Parameters:reOUTPUTWRITEondition:The low-FlevelFILEThe|binaryT!=write| )NULLsearfun. tionhtree. to dump.
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

40
See
gdsl Module Do umentation
OUTPUT FILE The le where to write T's nodes. USER DATA User's datas passed to WRITE F. also:gdsl_bstree_write()(pxml(. 38)(p. 39)
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

.3 Low-level doubly-linked list ma |
ipulation module |
41 |
|||||||||||||||
4.3 Low-level |
|
doubly-linked list |
manipulation |
|
|||||||||||||
module |
|
|
|
t |
|
|
_list_t |
|
|
|
|
||||||
Typedefsˆ t |
_gdsl node |
|
|
|
|
|
|
||||||||||
GDSL low-level doubly-linkegdsllist type. |
|
|
|
|
|||||||||||||
Fun tions |
list |
|
|
|
gdsl_ |
|
_allo |
|
|
gdsl_element_t E) |
|||||||
_gdsl |
|
|
|
|
|
|
|
||||||||||
Create a new low-level |
list. |
|
|
|
|
|
gdsl_free_fun _t |
||||||||||
ˆ void |
|
gdsl |
|
list |
|
free ( |
gdsl_list( onstL, onst |
||||||||||
FREE |
|
F) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Destroy a low-level list. |
|
|
|
|
|
|
t |
|
|
||||||||
bool |
|
gdsl_list is empt |
|
|
|
|
|
|
|||||||||
Che k if a low-level list is |
empty. |
|
|
|
|
|
|
||||||||||
ulong |
|
gdsl |
list |
get |
size |
( onst _gdsl_list_t L) |
|
|
|||||||||
Get the size of a |
ow-level list. |
|
|
|
|
|
|
|
|||||||||
ˆ void |
gdsl |
list |
|
link ( |
gdsl_list_t L1, _gdsl_list_t L2) |
||||||||||||
|
list_ nsert |
|
after ( gdsl_list_t L, |
_gdsl_list_t |
|||||||||||||
Link two ow-level lists together. |
|
|
|
|
|
|
|||||||||||
PREV) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Insert a low-level list after another one. |
|
|
_gdsl_list_t |
||||||||||||||
ˆ void |
|
gdsl list_insert_before |
|
( gdsl_list_t L, |
|||||||||||||
SUCC) |
|
|
|
|
|
|
|
e another one. |
|
|
|
|
|||||
Insert a low-level list b |
|
|
|
|
|
||||||||||||
void |
gdsl |
|
|
_removefor ( gdsl_node_t NODE) |
|
|
|||||||||||
ˆ _gdsl |
|
list_list |
|
gdsl |
list |
|
h (_gdsl_list_t L, onst gdsl_- |
||||||||||
Remove a node from a low-level list. |
|
|
|
|
|
||||||||||||
ˆ onstomparegdslSe gdslhlistforfunatnodepartigdslularCOMPmapnodelist_funF,inmapsearvoidlowt-forwardMAPlevelVALUE)listF,. (voidonst _gdsl_list_t L, |
|||||||||||||||||
GeneratedParseon Thua lowJun-level22 11:15:30list in forward2006 forordergdsl.by Doxygen |
USER_DATA) |
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

42 |
ˆ _gdsl_list |
|
|
gdsl Module Do umen |
|
|
||
|
t _gdsl_list_map_ba kward ( onst _gdsl_listationL, |
|
||||||
|
ˆ voidwriteonstParsegdslfungdsla lowlist-nodelistlevelWRITEwritelistmapin (baF,onstkwardfunFILEgdslordert MAP. list__F,t L,voidonstUSERgdslDATA)node |
|
|
|||||
|
|
|
|
|
|
|
- |
|
|
|
dslenodeswriteof writea funlow-levelxmltWRITElist (toonsta OUTPUTleF,. FILEgdsl__FILE,list tvoidL, onstUSER__- |
||||||
|
ˆ DATA)voidgdslWritenogall |
|
|
|
|
|
|
|
|
|
|
|
|
OUTPUT_FILE, void |
|||
|
ˆ novUSERidWritee writegdslDATA)all nodeslistfunof dumpastrulow-turWRITElevel( onstlist_toF,agdslleFILEintolistXMLt. L, |
onst _gdsl_- |
||||||
|
|
|
|
|
|
|
|
|
GDSL |
|
|
|
OUTPUT_FILE, void |
||||
olunDATA)thedoublyinternalDogdsl-linkedumennodelistetationypeof a.gdsllow-levellistlist_tto a le. |
|
|
|
|||||
4..33..11.1USERlowDumpTt-ypedeflev |
|
|
|
|
|
|||
This ype is |
|
tary opaque. Variables of this kind ould'nt be dire tly used, |
||||||
but by the fun tions |
this module. |
|
|
|
||||
De nition at line 54 |
of le |
gdsl list.h. |
|
|
|
|||
.3.2 Fun tion Do umentation |
|
|
|
|||||
4.3.2.1 |
gdsl |
list |
gdsl list allo ( onst gdsl_element_t E) |
|
|
|||
Create a ew low-level list. |
|
|
|
|
||||
Allo ate a new low-level list data stru ture whi h have only one node. The |
||||||||
node's onten is set to E. |
|
|
|
|
||||
Note: |
|
|
|
|
|
|
|
|
|
Complexity: O( 1 ) |
|
|
|
|
Pre nothingondition:.
arameters:E The ontent of the rst node of the new low-level list to reate.
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

|
4.3 Low-level doubly-linked list manipulation module |
43 |
||||||
|
Returns: |
|
|
|
|
|
|
|
|
the newly |
llo ated low-l vel list in ase of su ess. |
|
|||||
|
NULL in ase of insu ient memory. |
|
||||||
See also: |
|
|
|
|
|
|
||
|
|
gdsl_list_free()(p. 43) |
|
|||||
4.3.2.2 |
void _gdsl_list |
free ( gdsl_list_t L, onst |
|
|||||
|
Destroy |
gdsl |
free |
fun _t FREE F) |
|
|||
|
low-level list. |
w-level list L. If FREE F != NULL, then |
e FREE - |
|||||
|
lush and destroy the |
|
||||||
|
F fun tion is used to deallo ated ea h L's element. Otherwise, nothing is done |
|||||||
|
with L's elements. |
|
|
|
|
|||
Note: |
|
|
|
|
|
|
|
|
Parameters:reFREELnothingComplexity:ondition:The low.F-levelTheO( |funlistL| )totiondestroyused.to deallo ated L's nodes ontents. |
||||||||
See also: |
|
|
|
|
|
|
||
|
|
gdsl_list_allo ()(p. 42) |
|
|||||
4.3.2.3 |
bool |
gdsl_list |
is_empty ( onst _gdsl_list_t L) |
|||||
|
Che k if a low-level list is empty. |
|
||||||
Note: |
|
|
|
|
|
|
|
|
|
Complexity: O( 1 ) |
|
|
|
||||
|
re ondition: |
|
|
|
|
|
||
|
nothing. |
|
|
|
|
|
||
Parameters: |
|
|
|
|
|
|||
|
L The low-level list to he k. |
|
||||||
Returns: |
|
low- |
|
el |
L is empty. |
|
||
|
TRUE if |
|
|
|||||
|
FALSE ifthe low-levellist L is not empty. |
|
||||||
|
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen |
|

4 |
gdsl Module Do umentation |
|
4.3.2.4 ulong gdsl |
get_size ( onst _gdsl_list_t L) |
|
Get the size of a low-levellist. |
|
|
Note: |
|
|
Returns:Parameters:retheLnothingComplexity:ondition:Theumberlow.-levelofO(elements|listL| )to useof.L (noted
ink3..2t.wo5he lovoidw--levelgdsllistsL2togelistafterherlinkthe. endgdslofLthe).listlow-tlevelL1,listgdslL1. SolistL1_ist beforeL2) |
||||||
L4.2 |
|
|
|
|
| | |
|
Note: |
|
|
|
|
|
|
LComplexity:ondition:12&TheL2 lowmust-levelO(beL1nonlist)-toemptylink afterbeforegdslL1L2list. . _t. |
|
|||||
Parameters:re |
| |
| |
|
|
|
|
4.3.2.6 v |
_gdsl |
list |
insert_after (_gdsl_list_t L, |
|||
|
oidgsl_list |
PREV) |
one. |
|
||
Insert |
a low-lev |
list after |
|
|
||
the low-level list L afteranother low-level list PREV. |
||||||
Note: |
|
|
|
|
|
2006 for gdsl by Doxygen |
LComplexity:ondition:&ThePREVlow-levelmustO(listLbeGenerated)tononlink-emptyafteron ThuPREVgdslJun .list22 11:15:30t. |
||||||
Parameters:re |
| |
| |
|
|
|
|
|
|
|
|
|
|
|

4.3 Low-level doubly-linked list manipulation module |
45 |
|||||
PREV The low-level list that will be linked before L. |
|
|||||
See also: |
|
insert before()(p. 45) |
|
|||
|
gdsl_list_remove()(p. 45) |
|
|
|||
4.3.2.7 |
v |
_gdsl list |
insert_before (_gdsl_list_t L, |
|
||
|
|
oidgsl_list_t SUCC) |
one. |
|
||
Insert |
a low-lev |
list before |
|
|
||
the low-level list L beforeanother low-level list SUCC. |
|
|||||
Note: |
|
|
|
|
|
|
See LComplexity:also:ondition:&TheSUCClowThe-levelmustlowO(-listLlevelbe)nontolistlink-emptythatbeforewillgdslSUCCbelinkedlist.t.after L. |
|
|||||
Parameters:reSUCC |
| | |
|
|
|
||
|
|
|
insert after()(p. 44) |
|
||
_gdsl_list_remove()(p. 45) |
|
|
||||
4.3.2.8 |
void _gdsl_list |
remove (_gdsl_node_t NODE) |
|
|||
Remove a |
|
from a low-level list. |
|
|
||
Unlink thenode NODE from the low-level list in whi h it is inserted. |
|
Note:Complexity: O( 1 )
Pre NODEondition:ust be a non-empty _gdsl_node_t.
arameters:The low-level node to unlink from the low-level list in whi h it's
See also:linked. gdsl_list_insert_before()after() p(p. 44). 45)
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

6 |
gdsl Module Do umentation |
|
4.3.2.9 _gdsl_list_t gdsl |
_sear h (_gdsl_list_t , onst |
|
theomplexity:forhrstangdslpartie emenO(ompareulare nodeequalinthefunintolowaVALUElow-levellist-COMPlevellist.listL,. byF, usingvoid COMPVALUEF )fun tion to |
||
Note:ResearSearnd |
|
Parameters:reVALUECOMPLCOMPondition:TheVALUElowFFThe-!=levelThetoNULLvalue|listndomp| )tothaeusetrisonelemenustfunbeetionusedtobyuseCOMPtoompareF to L'snd elementstheelemenwithe
Returns:the sub-list starting by e if it's found. NULL if VALUE is not found in L.
4.3.2.10 _gdsl list_t L,gdslonstlistgdslmapnodeforwardmap( onstfun _t Note:ParseisGDSLturnsalledComplexity:itsMAPlowonlastnodesMAP-leveleaexaminatedSTOP,hoflistO(nodetheFin, thenlovoidwithforw-levelodeardthegdsl.USERlistorderUSERLlist.in_DATADATAforwardmap )argumentforwrderard(). The.(pIfMAP.46) stopsFFfunreturnsandtion-
Parameters:reUSERMAPLMAPondition:Th lowFFDA!=-levelTheNULLAmaplist| User's|.to)funmapdatastion. .. |
|
|
Returns: |
|
GDSL_MAP_STOP. |
the rst node for whi h MAP F |
||
|
Generated on ThreturnsJun 22 11:15:30 2006 for gdsl by Doxygen |
|
NULL when the parsing is d ne. |
|