revert - libatomic is still needed for target code.
[AROS.git] / rom / oop / obtainattrbasesarray.c
blob75ab45ccf827b1f5f01a9f73bc9a94a15349db3c
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Obtain array of attribute base IDs
6 Lang: english
7 */
9 #include <proto/exec.h>
10 #include <exec/memory.h>
11 #include <aros/debug.h>
13 #include "intern.h"
14 #include "hash.h"
16 /*****************************************************************************
18 NAME */
20 #include <proto/oop.h>
21 #include <oop/oop.h>
23 AROS_LH2(ULONG, OOP_ObtainAttrBasesArray,
25 /* SYNOPSIS */
26 AROS_LHA(OOP_AttrBase *, bases, A0),
27 AROS_LHA(CONST_STRPTR const *, ids, A1),
29 /* LOCATION */
30 struct Library *, OOPBase, 23, OOP)
32 /* FUNCTION
33 Obtain several attribute base IDs, storing them in linear array.
35 INPUTS
36 bases - a pointer to array to fill in
37 ids - a NULL-terminated array of interface IDs
39 RESULT
40 Zero on success or number of failed bases on failure. Failed
41 entries will be set to 0.
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
50 OOP_ReleaseAttrBasesArray()
52 INTERNALS
54 HISTORY
56 ******************************************************************************/
58 AROS_LIBFUNC_INIT
60 ULONG failed = 0;
62 while (*ids)
64 *bases = OOP_ObtainAttrBase(*ids);
66 if (*bases == 0)
67 failed++;
69 bases++;
70 ids++;
73 return failed;
75 AROS_LIBFUNC_EXIT