start service tasks separately in-case platforms need to perform additional set-up...
[AROS.git] / workbench / libs / iffparse / collectionchunks.c
blob87b647f621a1a556f5b29d473e1c79b9361ef28c
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, CollectionChunks,
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, 24, IFFParse)
25 /* FUNCTION
26 Does multiple CollectionChunk() calls on the supplied list.
27 An easy way to install several collction chunks.
29 INPUTS
30 iff - pointer to an IFFHandle struct.
31 propArray - pointer to an array of longword chunk types and identifiers.
32 numPairs - number of type/id pairs in the propArray.
34 RESULT
35 error - 0 if successfull, IFFERR_#? otherwise.
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
44 CollectionChunk()
46 INTERNALS
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
52 LONG count;
53 LONG err;
55 DEBUG_COLLECTIONCHUNKS(dprintf("CollectionChunks: iff 0x%lx array 0x%lx num %d\n",
56 iff, propArray, numPairs));
58 #if DEBUG
60 LONG * lptr = propArray;
61 bug ("CollectionChunks (iff=%p, [\n", iff);
62 for (count = 0; count < numPairs; count++)
64 bug (" {%c%c%c%c,%c%c%c%c}, ",
65 dmkid(lptr[0]),
66 dmkid(lptr[1])
68 lptr += 2;
70 bug (" ])\n");
72 #endif
74 for (count = 0; count < numPairs; count ++ )
76 if ((err = CollectionChunk(iff, propArray[0], propArray[1])))
77 return (err);
78 propArray += 2;
81 ReturnInt("CollectionChunks",LONG,0L);
82 AROS_LIBFUNC_EXIT
83 } /* CollectionChunks */