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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: findtagitem.c,v 1.4 1996/10/24 15:51:35 aros Exp $
  4.     $Log: findtagitem.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/utility.h>
  19. #include <utility/tagitem.h>
  20. #include <aros/libcall.h>
  21.  
  22. /*****************************************************************************
  23.  
  24.     NAME */
  25.     #include <clib/utility_protos.h>
  26.  
  27.     AROS_LH2(struct TagItem *, FindTagItem,
  28.  
  29. /*  SYNOPSIS */
  30.     AROS_LHA(Tag,              tagValue, D0),
  31.     AROS_LHA(struct TagItem *, tagList,  A0),
  32.  
  33. /*  LOCATION */
  34.     struct UtilityBase *, UtilityBase, 5, 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(tagList->ti_Tag)
  62.     {
  63.         /* End of list */
  64.         case TAG_END:
  65.         return NULL;
  66.         /* Ignore this tag */
  67.         case TAG_IGNORE:
  68.         break;
  69.         /* Jump to new tag list */
  70.         case TAG_MORE:
  71.         tagList=(struct TagItem *)tagList->ti_Data;
  72.         continue;
  73.         /* Ignore this and skip the next ti_Data tags */
  74.         case TAG_SKIP:
  75.         tagList+=tagList->ti_Data;
  76.         break;
  77.         /* Normal tag */
  78.         default:
  79.         if(tagList->ti_Tag==tagValue)
  80.             return tagList;
  81.         break;
  82.     }
  83.     /* Got to next tag */
  84.     tagList++;
  85.     }
  86.     AROS_LIBFUNC_EXIT
  87. } /* FindTagItem */
  88.