• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13def collect_implemented_api_map(excluded_funcs)
14    implemented_api_raw = nil
15    Dir.chdir(File.dirname(__FILE__)) do
16        implemented_api_raw = `python abckit_status.py --capi --print-implemented 2>&1`.split(/\n/).sort
17    end
18
19    implemented_api_map = {}
20
21    implemented_api_raw.each do |api_func_raw|
22        domain, api_func = *api_func_raw.split(/::/)
23
24        if excluded_funcs.include?(api_func)
25            next
26        end
27
28        if implemented_api_map[domain].nil?
29            implemented_api_map[domain] = [api_func]
30        else
31            implemented_api_map[domain].append(api_func)
32        end
33    end
34
35    return implemented_api_map
36end
37