home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / utility / applytagchanges.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.8 KB  |  95 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: applytagchanges.c,v 1.4 1996/10/24 15:51:35 aros Exp $
  4.     $Log: applytagchanges.c,v $
  5.     Revision 1.4  1996/10/24 15:51:35  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.3  1996/08/13 14:10:30  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.  
  11.     Revision 1.2  1996/08/01 17:41:41  digulla
  12.     Added standard header for all files
  13.  
  14.     Desc:
  15.     Lang: english
  16. */
  17. #include <exec/types.h>
  18. #include <utility/tagitem.h>
  19. #include <utility/utility.h>
  20. #include <aros/libcall.h>
  21.  
  22. /*****************************************************************************
  23.  
  24.     NAME */
  25.     #include <clib/utility_protos.h>
  26.  
  27.     AROS_LH2(void, ApplyTagChanges,
  28.  
  29. /*  SYNOPSIS */
  30.     AROS_LHA(struct TagItem *, list,       A0),
  31.     AROS_LHA(struct TagItem *, changelist, A1),
  32.  
  33. /*  LOCATION */
  34.     struct UtilityBase *, UtilityBase, 31, Utility)
  35.  
  36. /*  FUNCTION
  37.  
  38.     INPUTS
  39.  
  40.     RESULT
  41.  
  42.     NOTES
  43.  
  44.     EXAMPLE
  45.  
  46.     BUGS
  47.  
  48.     SEE ALSO
  49.  
  50.     INTERNALS
  51.  
  52.     HISTORY
  53.  
  54. *****************************************************************************/
  55. {
  56.     AROS_LIBFUNC_INIT
  57.  
  58.     /* Loop over the whole list */
  59.     for(;;)
  60.     {
  61.     switch(list->ti_Tag)
  62.     {
  63.         /* End of list */
  64.         case TAG_END:
  65.         return;
  66.         /* Ignore this tag */
  67.         case TAG_IGNORE:
  68.         break;
  69.         /* Jump to new tag list */
  70.         case TAG_MORE:
  71.         list=(struct TagItem *)list->ti_Data;
  72.         continue;
  73.         /* Ignore this and skip the next ti_Data tags */
  74.         case TAG_SKIP:
  75.         list+=list->ti_Data;
  76.         break;
  77.         /* Normal tag */
  78.         default:
  79.         {
  80.         struct TagItem *tagitem;
  81.         /* Try to find it in the changelist */
  82.         tagitem=FindTagItem(list->ti_Tag,changelist);
  83.  
  84.         if(tagitem!=NULL)
  85.             /* Found it. Replace it. */
  86.             list->ti_Data=tagitem->ti_Data;
  87.         break;
  88.         }
  89.     }
  90.     /* Got to next tag */
  91.     list++;
  92.     }
  93.     AROS_LIBFUNC_EXIT
  94. } /* ApplyTagChanges */
  95.