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

  1. /*
  2.     $Id: taginarray.c,v 1.2 1996/10/24 15:51:38 aros Exp $
  3.     $Log: taginarray.c,v $
  4.     Revision 1.2  1996/10/24 15:51:38  aros
  5.     Use the official AROS macros over the __AROS versions.
  6.  
  7.     Revision 1.1  1996/10/22 04:46:01  aros
  8.     Some more utility.library functions.
  9.  
  10.     Desc:
  11.     Lang: english
  12. */
  13. #include "utility_intern.h"
  14. #include <utility/tagitem.h>
  15.  
  16. /*****************************************************************************
  17.  
  18.     NAME */
  19.         #include <clib/utility_protos.h>
  20.  
  21.         AROS_LH2(BOOL, TagInArray,
  22.  
  23. /*  SYNOPSIS */
  24.         AROS_LHA(Tag  , tagValue, D0),
  25.         AROS_LHA(Tag *, tagArray, A0),
  26.  
  27. /*  LOCATION */
  28.         struct UtilityBase *, UtilityBase, 15, Utility)
  29.  
  30. /*  FUNCTION
  31.         Determines whether the value tagValue exists in an array of Tags
  32.         pointed to by tagArray. This array must be contiguous, and must be
  33.         terminated by TAG_DONE.
  34.  
  35.         This is an array of Tags (ie: Tag tagArray[]), not an array of
  36.         TagItems (ie: struct TagItem tagArray[]).
  37.  
  38.     INPUTS
  39.         tagValue    -   The value of the Tag to search for.
  40.         tagArray    -   The ARRAY of Tag's to scan through.
  41.  
  42.     RESULT
  43.         TRUE    if tagValue exists in tagArray
  44.         FALSE   otherwise
  45.  
  46.     NOTES
  47.  
  48.     EXAMPLE
  49.  
  50.     BUGS
  51.  
  52.     SEE ALSO
  53.         <utility/tagitem.h>, FilterTagItems()
  54.  
  55.     INTERNALS
  56.  
  57.     HISTORY
  58.         29-10-95    digulla automatically created from
  59.                             utility_lib.fd and clib/utility_protos.h
  60.         01-09-96    iaint   Implemented from autodoc.
  61.  
  62. *****************************************************************************/
  63. {
  64.     AROS_LIBFUNC_INIT
  65.  
  66.     while(*tagArray != TAG_DONE)
  67.     {
  68.         if(*tagArray == tagValue)
  69.             return TRUE;
  70.         tagArray++;
  71.     }
  72.     return FALSE;
  73.  
  74.     AROS_LIBFUNC_EXIT
  75. } /* TagInArray */
  76.