1 // Copyright 2013 Intel Corporation
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // - Redistributions of source code must retain the above copyright notice, this
9 //   list of conditions and the following disclaimer.
10 //
11 // - Redistributions in binary form must reproduce the above copyright notice,
12 //   this list of conditions and the following disclaimer in the documentation
13 //   and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #include "api_priv.h"
27 
28 #include "wcore_attrib_list.h"
29 #include "wcore_error.h"
30 
31 WAFFLE_API int32_t
waffle_attrib_list_length(const int32_t attrib_list[])32 waffle_attrib_list_length(const int32_t attrib_list[])
33 {
34 
35     wcore_error_reset();
36     return wcore_attrib_list32_length(attrib_list);
37 }
38 
39 WAFFLE_API bool
waffle_attrib_list_get(const int32_t * attrib_list,int32_t key,int32_t * value)40 waffle_attrib_list_get(
41         const int32_t *attrib_list,
42         int32_t key,
43         int32_t *value)
44 {
45     wcore_error_reset();
46     return wcore_attrib_list32_get(attrib_list, key, value);
47 }
48 
49 WAFFLE_API bool
waffle_attrib_list_get_with_default(const int32_t attrib_list[],int32_t key,int32_t * value,int32_t default_value)50 waffle_attrib_list_get_with_default(
51         const int32_t attrib_list[],
52         int32_t key,
53         int32_t *value,
54         int32_t default_value)
55 {
56     wcore_error_reset();
57     return wcore_attrib_list32_get_with_default(attrib_list, key, value,
58                                                default_value);
59 }
60 
61 WAFFLE_API bool
waffle_attrib_list_update(int32_t * attrib_list,int32_t key,int32_t value)62 waffle_attrib_list_update(
63         int32_t *attrib_list,
64         int32_t key,
65         int32_t value)
66 {
67     wcore_error_reset();
68     return wcore_attrib_list32_update(attrib_list, key, value);
69 }
70