1 /*
2  Copyright (C) 2006-2007 M.A.L. Marques
3  Copyright (C) 2016 M. Oliveira
4 
5  This Source Code Form is subject to the terms of the Mozilla Public
6  License, v. 2.0. If a copy of the MPL was not distributed with this
7  file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9 
10 #include "util.h"
11 
xc_func_info_get_number(const xc_func_info_type * info)12 int xc_func_info_get_number(const xc_func_info_type *info)
13 {
14   return info->number;
15 }
16 
xc_func_info_get_kind(const xc_func_info_type * info)17 int xc_func_info_get_kind(const xc_func_info_type *info)
18 {
19   return info->kind;
20 }
21 
xc_func_info_get_name(const xc_func_info_type * info)22 char const *xc_func_info_get_name(const xc_func_info_type *info)
23 {
24   return info->name;
25 }
26 
xc_func_info_get_family(const xc_func_info_type * info)27 int xc_func_info_get_family(const xc_func_info_type *info)
28 {
29   return info->family;
30 }
31 
xc_func_info_get_flags(const xc_func_info_type * info)32 int xc_func_info_get_flags(const xc_func_info_type *info)
33 {
34   return info->flags;
35 }
36 
xc_func_info_get_references(const xc_func_info_type * info,int number)37 const func_reference_type *xc_func_info_get_references(const xc_func_info_type *info, int number)
38 {
39   assert(number >=0 && number < XC_MAX_REFERENCES);
40 
41   if (info->refs[number] == NULL) {
42     return NULL;
43   } else {
44     return info->refs[number];
45   }
46 }
47 
xc_func_info_get_n_ext_params(const xc_func_info_type * info)48 int xc_func_info_get_n_ext_params(const xc_func_info_type *info)
49 {
50   assert(info!=NULL);
51 
52   return info->ext_params.n;
53 }
54 
xc_func_info_get_ext_params_name(const xc_func_info_type * info,int number)55 char const *xc_func_info_get_ext_params_name(const xc_func_info_type *info, int number)
56 {
57   assert(number >=0 && number < info->ext_params.n);
58 
59   return info->ext_params.names[number];
60 }
61 
xc_func_info_get_ext_params_description(const xc_func_info_type * info,int number)62 char const *xc_func_info_get_ext_params_description(const xc_func_info_type *info, int number)
63 {
64   assert(number >=0 && number < info->ext_params.n);
65 
66   return info->ext_params.descriptions[number];
67 }
68 
xc_func_info_get_ext_params_default_value(const xc_func_info_type * info,int number)69 double xc_func_info_get_ext_params_default_value(const xc_func_info_type *info, int number)
70 {
71   assert(number >=0 && number < info->ext_params.n);
72 
73   return info->ext_params.values[number];
74 }
75