Short: Support library for TagLists (also <OS2.x) Architecture: m68k-amigaos taglist.library/Introduction taglist.library/TL_GetTagData taglist.library/TL_FindTagData taglist.library/TL_FindTagItem taglist.library/TL_MapTagList taglist.library/Introduction taglist.library Author Sam Hepworth. Copyright (C) 1992 Zeal Computer. Freeware. This code is freely redistributable upon the conditions that this notice remains intact and that modified versions of this file not be distributed in any way. The author makes no warranty of any kind with respect to this product and explicitly disclaims any implied warranties of merchantability or fitness for any particular purpose. KickStart 2.0 use taglists to handle variable numbers of arguments to functions. This method is rather slow but highly flexible since you search out each argument independent of it's location. If you would like to use taglists under KickStart 1.2 you can use the primitive functions in this library. Both KickStart 1.2 and KickStart 2.0 users can benefit form the taglist to structure conversion function. If Commodore modify (improve) their taglist specifications you will not need to rewrite or recompile your programs because updating the binary taglist.library file will do. Please mail me if you think of improvements both to the code and the documentation. Sam Hepworth. Vognporten 14-213 2620 Albertslund Denmark internet e-mail: shepherd@diku.dk taglist.library/TL_GetTagData NAME TL_GetTagData -- get value of tagitem with given id SYNOPSIS data = TL_GatTagData(id, default, taglist) D0 D0 D1 A0 ULONG TL_GetTagData(ULONG, ULONG, struct TagItem *) FUNCTION Find a given tagitem and return the value. If the tagitem could not be found return the default value. taglist.library/TL_FindTagData NAME TL_FindTagData -- get pointer to value of tagitem with given id SYNOPSIS data = TL_FindTagData(id, taglist) D0 D0 A0 ULONG *TL_FindTagData(ULONG, struct TagItem *) FUNCTION Find a given tagitem and return pointer to it's value. If the tagitem could not be found return NULL. taglist.library/TL_FindTagItem NAME TL_FindTagItem -- get pointer to tagitem with given id SYNOPSIS tagitem = TL_FindTagItem(id, taglist) D0 D0 A0 struct TagItem *TL_FindTagItem(ULONG, struct TagItem *) FUNCTION Find a given tagitem and return pointer to it. If the tagitem could not be found return NULL. taglist.library/TL_MapTagList NAME TL_MapTagList -- convert taglist to structure SYNOPSIS missing = TL_MapTagList(tagmap, buffer, taglist) D0 A0 A1 A2 ULONG TL_MagTagList(struct TagMapItem *, APTR, struct TagItem *) FUNCTION Converts a taglist into a structure. INPUT The tagmap convert taglists into complex structures supporting integer and boolean values with a size of byte, word, or longword. Integer values are simply copied into the structure at a given offset using a size of byte, word, or longword. A default value can be used if the tagitem is not found, or a missing flag can be set. Boolean values can set or clear bits in a structure at a given offset using a size of byte, word, or longword. A default value can be define in case no value is found in the taglist. If a boolean value sets bits when the value is TRUE, then it clears bits when the value is FALSE. If default is TRUE then default is to set bits. If default is FALSE then default is to clear bits. If a boolean value clears bits when the value is TRUE it sets bits when the value is FALSE. If default is TRUE then default is to clear bits. If default is FALSE then default is to set bits. The following macro is defined in taglist.h and should be used to create tagmaps. For more details see the include file. TAGMAP(ID,STRUCTURE,MEMBER,MISS,TYPE,DEFAULT,VALUE) where ID The tagid or tagcommand. Only two commands are supported: TAG_END (end of tagmap) and TAG_INIT (do not search any tagid just use default value). STRUCTURE Structure to store value in. MEMBER Structure member to store value in. MISS Bits to set if this value is missing. TYPE Size value to store, this can be BYTE, WORD, or LONG, no overflow check is made. DEFAULT For integers only NODEFAULT and DEFAULT are legal. For boolean NODEFAULT, DEFAULT (default is TRUE), and default (default is FALSE) are accepted. VALUE For integers this is the value to use by default. For boolean this is the bits to affect (not only if default).