2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: AllocateTagItems()
8 #include <proto/exec.h>
11 /*****************************************************************************
14 #include <utility/tagitem.h>
15 #include <proto/utility.h>
17 AROS_LH1(struct TagItem
*, AllocateTagItems
,
20 AROS_LHA(ULONG
, numTags
, D0
),
23 struct UtilityBase
*, UtilityBase
, 11, Utility
)
26 Allocate a number of TagItems in an array for whatever you like.
27 The memory allocated will be cleared.
30 numTags - The number of TagItems to allocate.
33 A pointer to an array of struct TagItem containing numTags tags.
36 The number you supply must include the terminating tag (ie TAG_DONE)
37 There is no provision for extra TagItems at the end of the list.
39 If the number of tags to allocate is zero, then none will be.
42 struct TagItem *tagList;
44 tagList = AllocateTagItems( 4 );
46 tagList[0].ti_Tag = NA_Name;
47 tagList[0].ti_Data = (IPTR)"A list of tags";
48 tagList[3].ti_Tag = TAG_DONE;
50 \* Do what you want with your TagList here ... *\
52 FreeTagItems( tagList );
62 29-10-95 digulla automatically created from
63 utility_lib.fd and clib/utility_protos.h
64 11-08-96 iaint Moved code into the AROS source.
66 *****************************************************************************/
69 struct TagItem
*tags
= NULL
;
72 tags
= AllocVec( numTags
* sizeof(struct TagItem
) ,
73 MEMF_CLEAR
| MEMF_PUBLIC
);
79 } /* AllocateTagItems */