1# Copyright (C) 2012 Intel Corporation 2# Copyright (C) 2021 Advanced Micro Devices, Inc. 3# 4# Permission is hereby granted, free of charge, to any person obtaining a 5# copy of this software and associated documentation files (the "Software"), 6# to deal in the Software without restriction, including without limitation 7# the rights to use, copy, modify, merge, publish, distribute, sublicense, 8# and/or sell copies of the Software, and to permit persons to whom the 9# Software is furnished to do so, subject to the following conditions: 10# 11# The above copyright notice and this permission notice (including the next 12# paragraph) shall be included in all copies or substantial portions of the 13# Software. 14# 15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21# IN THE SOFTWARE. 22 23# This script generates the file api_save_init.h. 24 25import collections 26import license 27import gl_XML 28import sys 29import apiexec 30 31 32class PrintCode(gl_XML.gl_print_base): 33 def __init__(self): 34 super().__init__() 35 36 self.name = 'api_save_init_h.py' 37 self.license = license.bsd_license_template % ( 38 'Copyright (C) 2012 Intel Corporation\n' 39 'Copyright (C) 2021 Advanced Micro Devices, Inc.', 40 'AUTHORS') 41 42 def printBody(self, api): 43 for f in api.functionIterateAll(): 44 if f.exec_flavor != 'dlist': 45 continue 46 47 print('SET_{0}(table, save_{0});'.format(f.name)) 48 49 50if __name__ == '__main__': 51 apiexec.print_glapi_file(PrintCode()) 52