podman
64 строки · 3.0 Кб
1# Configuration file for c-for-go, which go-libvirt uses to translate the const
2# and type definitions from the C-language sources in the libvirt project into
3# Go. This file is used by the c-for-go binary (github.com/xlab/c-for-go), which
4# is called when 'go generate' is run. See libvirt.go for the command line used.
5---
6GENERATOR:
7PackageName: libvirt
8PackageLicense: |
9Copyright 2018 The go-libvirt Authors.
10
11Licensed under the Apache License, Version 2.0 (the "License");
12you may not use this file except in compliance with the License.
13You may obtain a copy of the License at
14
15http://www.apache.org/licenses/LICENSE-2.0
16
17Unless required by applicable law or agreed to in writing, software
18distributed under the License is distributed on an "AS IS" BASIS,
19WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20See the License for the specific language governing permissions and
21limitations under the License.
22Includes: []
23
24PARSER:
25# We can't use environment variables here, but we don't want to process the
26# libvirt version installed in the system folders (if any). Instead we'll
27# rely on our caller to link the libvirt source directory to lv_source/, and
28# run on that code. This isn't ideal, but changes to c-for-go are needed to
29# fix it.
30IncludePaths: [./lv_source/include, ./lv_source/build/include]
31SourcesPaths:
32- libvirt/libvirt.h
33- libvirt/virterror.h
34
35TRANSLATOR:
36ConstRules:
37defines: eval
38Rules:
39global:
40- {action: accept, from: "^vir"}
41post-global:
42- {action: replace, from: "^vir"}
43- {load: snakecase}
44# Follow golint's capitalization conventions.
45- {action: replace, from: "Api([A-Z]|$)", to: "API$1"}
46- {action: replace, from: "Cpu([A-Z]|$)", to: "CPU$1"}
47- {action: replace, from: "Dns([A-Z]|$)", to: "DNS$1"}
48- {action: replace, from: "Eof([A-Z]|$)", to: "EOF$1"}
49- {action: replace, from: "Id([A-Z]|$)", to: "ID$1"}
50- {action: replace, from: "Ip([A-Z]|$)", to: "IP$1"}
51- {action: replace, from: "Tls([A-Z]|$)", to: "TLS$1"}
52- {action: replace, from: "Uuid([A-Z]|$)", to: "UUID$1"}
53- {action: replace, from: "Uri([A-Z]|$)", to: "URI$1"}
54- {action: replace, from: "Vcpu([A-Z]|$)", to: "VCPU$1"}
55- {action: replace, from: "Xml([A-Z]|$)", to: "XML$1"}
56- {action: replace, from: "Rpc([A-Z]|$)", to: "RPC$1"}
57- {action: replace, from: "Ssh([A-Z]|$)", to: "SSH$1"}
58- {action: replace, from: "Http([A-Z]|$)", to: "HTTP$1"}
59- {transform: unexport, from: "^From"}
60const:
61- {action: accept, from: "^VIR_"}
62# Special case to prevent a collision with a type:
63- {action: replace, from: "^VIR_DOMAIN_JOB_OPERATION", to: "VIR_DOMAIN_JOB_OPERATION_STR"}
64- {transform: lower}
65