
Заготовки по С / Динамические структуры / GDSL / Исходники / doc / latex / refman
.pdf
|
4.4 Low-level doubly-linked node manipulation module |
|
57 |
|||||||||
|
Parameters: |
|
|
|
|
|
|
|
|
|
||
|
NODE The low-level node to |
|
ite. |
|
|
|
|
|||||
|
OUTPUT |
FILE The le where to write NODE. |
|
|
|
|||||||
|
WRITE |
F The write fun tion. |
|
F. |
|
|
||||||
|
USER |
|
DATA User's datas passed to WRITE |
|
|
|||||||
See also: |
|
|
|
write |
xml()(p. 57) |
|
|
|
|
|||
|
gdsl_node_dump()(p. 57) |
|
|
|
gdsl_node_t |
|
||||||
4.4.2.12 |
void |
gdsl node write xml ( onst |
|
F, |
||||||||
|
|
NODE, onst |
gdsl |
node write fun t |
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
passedl nguageto. |
|
|
|
|
|
|
|
|
|
|
|
ouldWRITEwriteXMLAb) NODE |
||
|
|
|
|
|
|
|
|
|
|
t |
|
|
|
riteComplexity:athelowF.lowFILE-FILElevel-!=level.O(nodeNULL,AdditionnalOUTPUT1node)to athenNODEle intoUSERusesFILEtoXMLWRITEOU,DAvoid. PUTAFargumenUSERfFILE,ntioninDA |
|
|
|||||||||
Note:OUTPUTWRITEIf |
|
|
|
|
|
|
|
|
|
|
|
|
|
re ondition: |
|
|
|
|
|
|
|
|
|||
|
|
|
!= NULL & OUTPUT_FILE != NULL |
|
|
|
|
|||||
|
NODE The low-level node to |
|
ite. |
|
|
|
|
|||||
Parameters: |
|
FILE The le where to write NODE. |
|
|
|
|||||||
|
OUTPUT |
|
|
|
||||||||
|
WRITE |
F The write fun tion. |
|
F. |
|
|
||||||
|
USER |
|
DATA User's datas passed to WRITE |
|
|
|||||||
See also: |
|
|
|
write()(p. 56) |
|
|
|
|
|
|
||
|
gdsl_node_dump()(p. 57) |
|
|
|
|
|
|
|||||
4.4.2.13 |
v id _ _ |
_dump ( onst _gdsl_node_t NODE, |
||||||||||
|
|
|
onst |
gdslFILEnode,voidwrite_fun to WRITE_F, FILE |
|
|||||||
|
|
OUTPUT |
|
|
|
|
|
|
GeneratedDumpOUTPUTWRITEtheFoninternal.FILEstru!=ThuNULL,.tureJunAstrudditionnal22of11:15:30turethenoflowusesaUSER2006lo-levelWRITE-forlevelUSERDATAgdslnodenodebyFNODEDoxygenargumenfunDAa tionletoA.) OUTPUTtouldwritebe NODpassedFILE. toIf

58 |
|
|
|
|
gdsl Module Do umentation |
|
|
Note: |
|
|
|
|
|
|
|
Complexity: O( 1 ) |
|
|||
|
re ondition: |
|
|
|||
|
|
|
!= NULL & OUTPUT_FILE != NULL |
|||
|
|
NODE The low-level node to dump. |
||||
Parameters: |
|
F The write fun tion. |
||||
|
|
WRITE |
|
|||
|
|
OUTPUT FILE The le where to write NODE. |
||||
|
|
USER |
|
DATA User's datas passed to WRITE F. |
||
See also: |
|
|
|
()(p. |
||
|
|
gdsl_node_write |
||||
|
|
xml(56)(p. 57) |
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

4.5 Main module
.5 Main module |
59 |
F
4..un55.ˆ.11.1tionsonstGetFunonstharGDSLtionhargdslversionDogetnumbumentationversionas a string(void).
Note:PGetre GDSLComplexity:nothingondition:version.O(umber1)gdslas_agets ringversion. (void)
osttheondition:returned string MUST NOT be deallo ated. Returns:GDSL version number as a string.
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

60 gdsl Module Do umentation
4.6 2D-Arrays manipulation module
T
Funypedefsˆˆ ttionsGDSL2darragdsl2D-array2darray t typgdsle. gdsl2darray2darrayallot ( onst har
ulonggdslvoidonstCrGetDgdslstroyatefreeharR, nameonst2darranew2Dfun-2Dulong-y2darraty.FREEayfC,ee. (onstgdslF) gdsl2darrayallo( onstfunA) _t ALLOCNAME,F, onst
ˆ 2darrayulongA)ulongGetGet thethethegdslgdsltnumbernumbergdslA)2darray2darraofofof 2Dowsolumns-ygetofyaygetaof.get2Drowsa-2Darrayolumnsname-array.umber. number( gdslonst_gdsl2darray( onst2darraygdsltA)__t- |
||||
ˆ |
|
|
|
|
|
|
gdsl |
y get_size ( onst gdsl_2darray A) |
|
|
|
size2darraof 2D-array. |
( onst gdsl_- |
|
ˆ ulongelemen |
gdsl 2darray_get_ ontent |
|||
|
Get an element |
from a 2Day. |
|
|
ˆ gdsl |
2darray onstgdsl_2darray_set_name (gdsl_2darray_t A, |
|||
2 |
array A, |
ulong R, onst ulong C) |
|
ˆgdslonstonstSetulongelementheharnameNEWR,t ofotagdslNAME)st2Dulong-array2darra.C, voidy set_ ontent (gdsl_2darray_t A,
ˆvoidwriteModifygdslfunan2darrayelemet WRITEn inwritea 2DF,- (FILEonstay. gdslVALUE)2darray_t A, onst gdsl
DATA) |
Generated on Thu Jun OUTPUT22 11:15:30_2006FILE,for gdslvoidby USERDoxygen- |
|
|

4.6 2D-Arrays |
module |
61 |
Write the ontent of |
2D-array to a le. |
|
ˆ void gdsl_2darray_write xml ( onst gdsl_2darray_t A, |
onst |
|
gdsl_writemanipulationfun WRITE_F, FILE OUTPUT_FILE, |
void |
ˆ voidwriteUSERWritegdslfunDATA)the2darrayontentWRITEof dump2DF,array(FILEonstto agdslle into2darraXML.y_t A, onst gdsl
4..66..11.DATA)1 DumpTtypedefthe internalstruDot struumentationgdslture2darrayof a 2D arrayOUTPUTto le.FILE, void USER_-
GDSLThisDebut4.6.nitionby2ype2DtheFun-isatarrafunvoluntarylinetionstion53 of.Doopaquethislegdslumentationmodule.Variables2darray. .hof. thisgdslkind2darrayould'nt tbe dire tly used,
poinisAlloCreate.6uldset.2 |
defaultoulALLOCgdslonstopyw2Dbeto2D2darray-ofulongar-serNAMEsperaFtoyy., tivRNULLdataonst,ely,.Theonststrugdslallogdsltofusetureulongn2darrayandtionsfreethewithfreeCdefaultpointers,Rfunelementsrowsonstalloones:tandALLOCgdslFREE( onstin theolumnsalloharF2DF)and-arrayandfunNAMEFREEits.Thestname,F |
|
tersabe.1oaanewaus |
|
|
ˆ the |
ALLOC |
F simply returns its argument |
FREE |
F does nothing |
|
Note: |
|
|
Complexity: O( 1 ) |
|
Pre nothingondition:
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxyg n
arameters:NAME The name of the new 2D-array to reate

62 |
R |
|
|
|
|
|
|
|
|
|
gdsl Module Do umentation |
|
|
|
|
|
|
|
|
|
ws of the new 2D-array to reate |
|
|||
|
|
The number of rolumns of the |
|
2D-array to reate |
- |
|||||||
|
ALLOC |
|
|
F Fun tion to allo |
ment when inserting it in a |
|||||||
|
FREE F Fun tion to free elemenewt when removing it from a |
2D-array |
||||||||||
Returns: |
|
|
|
llo ated 2D-array in ase of su ess. |
|
|||||||
|
the newly |
|
|
|
||||||||
|
NULL in |
ase of insu ient memory. |
|
|
||||||||
See also: |
2darray_free )(p. 62) |
|
|
|
||||||||
|
|
|
allo |
|
fun |
t p. |
|
|
|
|||
|
gdsl_free |
|
|
t(p. 191) |
|
|
|
|||||
4.6.2.2 void gdsl_2darray_free (gdsl_2darray_t A) |
|
|||||||||||
Destroy a 2D-a ray. |
|
|
|
|
||||||||
Flush |
nd |
|
|
r |
|
y the 2D-array A. The FREE F fun tion passed to gdsl - |
||||||
2darray al o ()(p. 61) is us d to free elements from A, but no |
k is |
|||||||||||
to see if andestement was set (ie. != NULL) or not.It's up to you tohehe k ifdoneth |
||||||||||||
|
Complexitoun |
|
|
|
|
|
|
|
|
|||
Note: |
to free is NULL or not into the FREE F fun tion. |
|
||||||||||
elem n |
|
|||||||||||
|
|
|
|
y: O( R x C ), where R is A's rows ount, and C is A's olumns |
||||||||
re ondition: |
|
|
|
|
|
|
|
|||||
|
|
ust be a valid gdsl_2darray_t |
|
|
||||||||
Parameters: |
|
|
|
|
|
|
|
|
|
|||
|
A |
The 2D-array to destroy |
|
|
|
|||||||
See also: |
|
|
|
|
|
|
|
|
|
|
||
|
gdsl_2darray_allo ()(p. 61) |
|
|
|
||||||||
|
|
|
|
|
|
|
2darravalidO(h2D1-array)gdslygdslt. 2darrayA2darray)t _get_name ( onst |
|
||||
PreNote:Get4.6.2AComplexittheondition:.3nameustgdslonstbeofy:a |
|
|
|
|
|
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen

4.6 2D-Arrays manipulation module |
63 |
||||
ost ondi io : |
|
|
|
||
Parameters: |
|
|
|
||
The re urned string MUST NOT be freed. |
|
||||
A The 2D-array from whi h getting the name |
|
||||
Returns: |
|
|
|
|
|
the name of the 2D-array A. |
|
||||
See also: |
|
|
|
|
|
gdsl_2darray_set_name()(p. 65) |
|
||||
4.6.2.4 |
|
ulong gdsl |
|
y_get_rows_number ( onst |
|
Get the number of rows |
2darraof 2D-array. |
|
|||
Note: |
|
gdsl 2darray |
t A) |
|
|
Complexitust be a valid gdsl_2darray |
|
||||
re ondition:y: O( 1 ) |
|
|
|
||
A |
The 2D-array from whi h getting the rows ount |
|
|||
Parameters: |
|
|
|
||
Returns:the umber of rows of the 2D-array A. |
|
||||
See also: |
|
|
olumns number()(p. 63) |
|
|
gdsl_2darray_get_size()(p. 64) |
|
||||
4.6.2.5 |
|
ulong gdsl |
2darray_get_ olumns_number ( onst |
|
|
|
|
gdsl 2darray |
t A) |
|
|
Get the number of olumns of a 2D-array. |
|
||||
Note: |
|
|
|
|
|
Complexitust be a valid gdsl_2darray |
|
||||
re ondition:y: O( 1 ) |
|
|
|
||
A |
The 2D-array from whi h getting the olumns ount |
|
|||
Parameters: |
|
|
|
||
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen |
|

64 |
|
|
|
|
|
|
|
|
gdsl Module Do umentation |
||
Returns:the umber of olumns of the 2D-array A. |
|
|
|||||||||
See also: |
|
|
|
rows_number()(p. 63) |
|||||||
|
gdsl_2darray_get_size()(p. 64) |
|
|
|
|
||||||
4.6.2.6 |
|
ulong gdsl |
|
2darray_get_size ( onst gdsl_2darray_t A) |
|||||||
Get the size of a 2D-array. |
|
|
|
|
|
|
|||||
|
Complexitust be a valid gdsl_2darray_t |
|
|
|
|
||||||
Note: |
|
|
|
|
|
|
|
|
|
|
|
re ondition:y: O( 1 ) |
|
|
|
|
|
|
|
||||
Parameters: |
|
|
|
|
|
|
|
|
|||
|
A |
The 2D-array to use. |
|
|
|
|
|
||||
|
|
|
|
|
|
|
lumnsA, (notedonstum2darraynumber()ber()ulongA .(pRget. 63),(ponst. 63) tentulong( onstC) |
||||
|
|
|
|
|
|
t Agdslwsf |
|
|
|
|
|
|
|
|
|
|
|
ro |
|
|
|
|
|
|
|
|
|
gety |
|
|
|
|
|
||
|
|
|
2darray2darraelementof elements |
|
|
|
|
|
|||
|
|
|
gdsl |
|
|
|
|
|
|
|
|
|
gdslthealso:.7_umber |
|
|
|
|
| | |
|
|
|
||
SeeReturns:4.6.2 |
|
|
|
|
|
|
|
|
|||
Get an element from |
2D-array. |
|
|
|
|
||||||
Note: |
plexity: O( 1 ) |
|
|
|
|
|
|
|
|||
|
Co |
|
|
|
|
|
|
|
|||
arameters:Aondition:u beust(beA )a&validC gdsl_2darray_t & R |
|
= gd l_2darray_get_rows_- |
|||||||||
Pre |
|
|
|
|
|
|
|
|
< |
|
|
|
Theelementro2Dwlumn-arrayindixoftheindixfromof2D=theof-arraygdslwhitheleelemenh2darrayAgettingontotainedgettothegetgetelementinolumnrowRsandnumber(olumnAC). |
||||||||||
Returns:theCA |
|
< |
|
|
|
|
|
|
|||
See also: |
|
|
|
|
|
|
|
|
|
||
|
gdsl_2darray_set_ ontent()(p. 65) |
|
|
|
|||||||
|
|
|
|
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen |
|

|
D-Arrays |
module |
65 |
|||
|
4.6.2.8 |
|
gdsl_ manipulationy gdsl_2darray_set_name (gdsl_2darray_t |
|
||
PNote:ChangeSetretheComplexitondition:nametheA,previousofy:onst2darraO(2D1name-harra) y.ofNEWthe 2D-NAMEarray A)to a opy of NEW_NAME. |
||||||
|
|
ust be a valid gdsl_2darray_t |
|
|
||
|
arameters: |
|
|
|
||
|
A |
The 2D-array to hange the name |
|
|
||
|
NEW NAME The new name of A |
|
|
|||
Returns: |
|
|
|
|
||
|
the modi ed 2D-array in ase of su ess. |
|
|
|||
|
NULL in ase of failure. |
|
|
|
||
See also: |
|
|
|
|
||
|
gdsl_2darray_get_name()(p. 62) |
tent |
||||
4.6.2.9 |
|
_element_t gdsl_2darray_set_ |
ModifyCTgdslrownehangeessaryRnew2darrayandanthe.elem(gdslVALUEinlementoolumnreate()2darra)ininsertCrowapplied2Disy is-NOTarrayRtallandAo,deallo.VALUEonstolumnusingatedulongC.The.tofIt'stheRALLOCprevious,up2Donstto-arrayyouelemenFulongfunA,to doandtionCiton,returnsvoidpbefore,ainssed ittoinif. Note:Co plexity: O( 1 )
Prearameters:Aondition:u ber(ustbeA )a&validC gdsl_2darray_t & R <= gd l_2darray_get_rows_-
GeneratedARC Theonro2DThwlumn-arrayJunumbernumber22to<11:15:30=modiofgdsltheofythel2006on2darrayeelemenfort togdsltgetmodifytofrombymodifyDoxygenolumns_number( A )

66 |
|
|
|
|
|
gdsl Module Do umentation |
|
|
VALUE The user value to use for allo ating the new element |
|
|||||
Returns: |
|
|
llo ated elem |
in ase of su ess. |
|||
|
the newly |
|
|||||
|
NULL in |
|
ase of insu ien |
memory. |
|
|
|
|
gdsl_2darray_get_ ontent()(p. 64) |
|
|
||||
See also: |
|
|
gdsl_2darray_write ( onst gdsl_2darray_t A, onst |
||||
4.6.2.10 |
|
|
|||||
|
voidgdsl_write_fun _toWRITE_F, FILE OUTPUT_FILE, |
||||||
WritetionComplexitounthe. Aelementsontendditionnaly:O(ofUSERofRaUSER2DthexC-array2D),DATA-whereDATAarraya)RAargumentleisto.A'sOUTPUTrowsouldount,beFILE,passedandusingCtoisA'sWRITEolumnsFF. |
|||||||
Note:fun |
|
|
|
|
|
|
|
re ondition: |
|
|
|
|
|||
|
WRITE |
|
F != NULL & OUTPUT_FILE != NULL |
||||
Parameters: |
|
|
|
|
|
|
|
|
A The 2D-array to write |
|
|
|
|||
|
WRITE |
|
|
F The write fun tion |
|
|
|
|
OUTPUT FILE The le where to write A's elements |
||||||
|
USER |
DATA User's datas passed to WRITE F |
|||||
See also: |
|
|
|
|
|
|
gdsl_2darray_writedump()xml()(p. 67)(p. 66)
4.6.2.11 void gdsl_2darray_write_xml ( onst gdsl_2darray_t AOUTPUT, onst gdslFILEwrite,voidfun _to WRITE_F, FILE
Note:FAdditionnalWrite!=ComplexitounNULL,theallA'sonUSERthtenely:menO(ofusestsDARa2DtoxWRITEACOUTPUTarrayargumen),wheretoF atoRFILE,lewriteouldisUSERinA'sbeintoA'srowsXMLpassedelementsXMLDA.ount,toAlanguage)WRITEandtoOUTPUTC.isIfA'sFWRITE.olumnsFILE-.
Generated on Thu Jun 22 11:15:30 2006 for gdsl by Doxygen