Do not install wrong cache routine if called before SysBase is complete.
[AROS.git] / workbench / libs / iffparse / propchunks.c
blob7c10b355e1119c85184909220f1a3bf51699c7e0
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
8 #include "iffparse_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/iffparse.h>
15 AROS_LH3(LONG, PropChunks,
17 /* SYNOPSIS */
18 AROS_LHA(struct IFFHandle *, iff, A0),
19 AROS_LHA(const LONG *, propArray, A1),
20 AROS_LHA(LONG , numPairs, D0),
22 /* LOCATION */
23 struct Library *, IFFParseBase, 20, IFFParse)
25 /* FUNCTION
26 Does multiple PropChunk() calls on the supplied list.
27 An easy way to install several prop chunk handlers
30 INPUTS
31 iff - pointer to an IFFHandle struct.
32 propArray - pointer to an array of longword chunk types and identifiers.
33 numPairs - number of type/id pairs in the propArray.
36 RESULT
37 error - 0 if successfull, IFFERR_#? otherwise.
40 NOTES
42 EXAMPLE
44 BUGS
46 SEE ALSO
48 INTERNALS
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
53 LONG count;
54 LONG err;
56 DEBUG_PROPCHUNKS(dprintf("PropChunks: iff 0x%lx array 0x%lx num %d\n",
57 iff, propArray, numPairs));
59 #if DEBUG
61 LONG * lptr = propArray;
62 bug ("PropChunks (iff=%p, [\n", iff);
63 for (count = 0; count < numPairs; count++)
65 bug (" {%c%c%c%c,%c%c%c%c}, ",
66 dmkid(lptr[0]),
67 dmkid(lptr[1])
69 lptr += 2;
71 bug (" ])\n");
73 #endif
75 for (count = 0; count < numPairs; count ++ )
77 if ((err = PropChunk(iff, propArray[0], propArray[1])))
78 ReturnInt("PropChunks",LONG,err);
80 propArray += 2;
83 ReturnInt("PropChunks",LONG,0L);
84 AROS_LIBFUNC_EXIT
85 } /* PropChunks */