success = PutIconTagList(name,icon,tags);
D0 A0 A1 A2
BOOL PutIconTagList(STRPTR name,
struct DiskObject *icon,
success = PutIconTags(name,icon,tag1,...);
BOOL PutIconTags(STRPTR name,
struct DiskObject *icon,
This function is used to store an icon; the icon can belong to a file/drawer/volume or it can be a default icon.
/* Store an icon as the default "picture" icon. */
struct DiskObject *icon;
LONG errorCode;
BOOL success;
success = PutIconTags(NULL,icon,
ICONPUTA_PutDefaultName,"picture",
ICONA_ErrorCode,&errorCode,
TAG_DONE);
if(success == FALSE)
{
Printf("could not store default picture icon;\n");
PrintFault(errorCode,NULL);
}
This function is a superset of
PutDefDiskObject() and
PutDiskObject().
If the name of the icon file to be stored would be too long to fit (as set with IconControl(..., ICONCTRLA_SetGlobalMaxNameLength, ...)) then PutIconTagList() will silently pretend that the icon file has been written to disk. However, it will not store the icon file on the disk since there would a risk of accidentally overwriting the file the icon belongs to. If you want to know whether the icon you wrote was in fact written to disk, provide an error code pointer with the ICONA_ErrorCode tag. If the name of the file was too long, PutIconTagList() will still pretend that the icon file was written successfully, but the error code ERROR_TOO_MANY_LEVELS will be stored in the variable you passed in with the ICONA_ErrorCode tag.