nvidia-container-toolkit/internal/nvsandboxutils/gen/nvsandboxutils/nvsandboxutils.yml
Sananya Majumder aa946f3f59 nvsandboxutils: Add script to generate bindings
This change adds a script and related files to generate the internal
bindings for Sandboxutils library with the help of c-for-go.
This can be used to update the bindings when the header file is modified
with reference to how they are generated with the Makefile in go-nvml.

Run: ./update-bindings.sh

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Signed-off-by: Huy Nguyen <huyn@nvidia.com>
Signed-off-by: Sananya Majumder <sananyam@nvidia.com>
2024-09-24 10:04:48 -07:00

67 lines
2.4 KiB
YAML

# Copyright (c) 2024, NVIDIA CORPORATION
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
GENERATOR:
PackageName: nvsandboxutils
PackageDescription: "Package NVSANDBOXUTILS bindings"
PackageLicense: |-
Copyright (c) 2024, NVIDIA CORPORATION
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Includes: ["nvsandboxutils.h"]
FlagGroups:
- {name: "LDFLAGS", traits: ["linux"], flags: ["-Wl,--export-dynamic","-Wl,--unresolved-symbols=ignore-in-object-files"]}
- {name: "LDFLAGS", traits: ["darwin"], flags: ["-Wl,-undefined,dynamic_lookup"]}
PARSER:
SourcesPaths: ["nvsandboxutils.h"]
TRANSLATOR:
ConstRules:
defines: eval
enum: eval
PtrTips:
function:
- {target: "^nvSandboxUtils", default: "sref"}
MemTips:
- {target: "^nvSandboxUtils", default: "raw"}
Rules:
const:
- {action: accept, from: "^NVSANDBOXUTILS_"}
- {action: accept, from: "^nvSandboxUtils"}
- {action: replace, from: "^NVSANDBOXUTILS_"}
- {action: replace, from: "^nvSandboxUtils"}
- {action: accept, from: "^NV"}
- {action: accept, from: "^MAX"}
- {action: accept, from: "^INPUT"}
- {action: replace, from: "_t$"}
- {transform: export}
type:
- {action: accept, from: "^nvSandboxUtils"}
- {action: replace, from: "^nvSandboxUtils"}
- {action: replace, from: "_t$"}
- {transform: export}
function:
- {action: accept, from: "^nvSandboxUtils"}
- {transform: unexport}