Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cbindgen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
cbindgen
Commits
723f95e1
Commit
723f95e1
authored
7 years ago
by
Ryan Hunt
Browse files
Options
Downloads
Patches
Plain Diff
Remove legacy config features
parent
245ee11b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/bindgen/config.rs
+0
-76
0 additions, 76 deletions
src/bindgen/config.rs
src/main.rs
+2
-2
2 additions, 2 deletions
src/main.rs
with
2 additions
and
78 deletions
src/bindgen/config.rs
+
0
−
76
View file @
723f95e1
...
...
@@ -243,62 +243,10 @@ impl Config {
Config
::
default
()
}
}
pub
fn
from_webrender
()
->
Config
{
let
license
=
r###"/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */"###
;
let
autogen
=
r###"/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen.
* To generate this file, clone `https://github.com/rlhunt/cbindgen` or run `cargo install cbindgen`,
* then run `cbindgen -c wr gfx/webrender_bindings/ gfx/webrender_bindings/webrender_ffi_generated.h` */"###
;
Config
{
header
:
Some
(
String
::
from
(
license
)),
trailer
:
None
,
include_guard
:
None
,
autogen_warning
:
Some
(
String
::
from
(
autogen
)),
include_version
:
true
,
braces
:
Braces
::
SameLine
,
line_length
:
100
,
tab_width
:
2
,
language
:
Language
::
Cxx
,
function
:
FunctionConfig
{
prefix
:
Some
(
String
::
from
(
"WR_INLINE"
)),
postfix
:
Some
(
String
::
from
(
"WR_FUNC"
)),
args
:
Layout
::
Vertical
,
rename_args
:
Some
(
RenameRule
::
GeckoCase
),
},
structure
:
StructConfig
{
rename_fields
:
None
,
derive_eq
:
true
,
derive_neq
:
false
,
derive_lt
:
false
,
derive_lte
:
false
,
derive_gt
:
false
,
derive_gte
:
false
,
},
enumeration
:
EnumConfig
{
rename_variants
:
None
,
add_sentinel
:
true
,
},
}
}
pub
fn
load
(
config
:
&
str
)
->
Config
{
match
config
{
"default"
=>
Config
::
default
(),
"wr"
=>
Config
::
from_webrender
(),
file
=>
Config
::
from_file
(
file
)
.unwrap
(),
}
}
}
impl
FunctionConfig
{
pub
fn
prefix
(
&
self
,
directives
:
&
DirectiveSet
)
->
Option
<
String
>
{
if
let
Some
(
x
)
=
directives
.atom
(
"function-prefix"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.atom
(
"prefix"
)
{
return
x
;
}
...
...
@@ -306,9 +254,6 @@ impl FunctionConfig {
}
pub
fn
postfix
(
&
self
,
directives
:
&
DirectiveSet
)
->
Option
<
String
>
{
if
let
Some
(
x
)
=
directives
.atom
(
"function-postfix"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.atom
(
"postfix"
)
{
return
x
;
}
...
...
@@ -318,54 +263,36 @@ impl FunctionConfig {
impl
StructConfig
{
pub
fn
derive_eq
(
&
self
,
directives
:
&
DirectiveSet
)
->
bool
{
if
let
Some
(
x
)
=
directives
.bool
(
"struct-gen-op-eq"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.bool
(
"derive-eq"
)
{
return
x
;
}
self
.derive_eq
}
pub
fn
derive_neq
(
&
self
,
directives
:
&
DirectiveSet
)
->
bool
{
if
let
Some
(
x
)
=
directives
.bool
(
"struct-gen-op-neq"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.bool
(
"derive-neq"
)
{
return
x
;
}
self
.derive_neq
}
pub
fn
derive_lt
(
&
self
,
directives
:
&
DirectiveSet
)
->
bool
{
if
let
Some
(
x
)
=
directives
.bool
(
"struct-gen-op-lt"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.bool
(
"derive-lt"
)
{
return
x
;
}
self
.derive_lt
}
pub
fn
derive_lte
(
&
self
,
directives
:
&
DirectiveSet
)
->
bool
{
if
let
Some
(
x
)
=
directives
.bool
(
"struct-gen-op-lte"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.bool
(
"derive-lte"
)
{
return
x
;
}
self
.derive_lte
}
pub
fn
derive_gt
(
&
self
,
directives
:
&
DirectiveSet
)
->
bool
{
if
let
Some
(
x
)
=
directives
.bool
(
"struct-gen-op-gt"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.bool
(
"derive-gt"
)
{
return
x
;
}
self
.derive_gt
}
pub
fn
derive_gte
(
&
self
,
directives
:
&
DirectiveSet
)
->
bool
{
if
let
Some
(
x
)
=
directives
.bool
(
"struct-gen-op-gte"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.bool
(
"derive-gte"
)
{
return
x
;
}
...
...
@@ -375,9 +302,6 @@ impl StructConfig {
impl
EnumConfig
{
pub
fn
add_sentinel
(
&
self
,
directives
:
&
DirectiveSet
)
->
bool
{
if
let
Some
(
x
)
=
directives
.bool
(
"enum-add-sentinel"
)
{
return
x
;
}
if
let
Some
(
x
)
=
directives
.bool
(
"add-sentinel"
)
{
return
x
;
}
...
...
This diff is collapsed.
Click to expand it.
src/main.rs
+
2
−
2
View file @
723f95e1
...
...
@@ -24,7 +24,7 @@ fn main() {
.short
(
"c"
)
.long
(
"config"
)
.value_name
(
"CONFIG"
)
.help
(
"the
config to use. currently either `wr`, or `default`
"
))
.help
(
"the
path to the cbindgen.toml config to use
"
))
.arg
(
Arg
::
with_name
(
"v"
)
.short
(
"v"
)
.help
(
"whether to print verbose logs"
))
...
...
@@ -49,7 +49,7 @@ fn main() {
let
input
=
matches
.value_of
(
"INPUT"
)
.unwrap
();
let
config
=
match
matches
.value_of
(
"config"
)
{
Some
(
c
)
=>
Config
::
load
(
c
),
Some
(
c
)
=>
Config
::
from_file
(
c
)
.unwrap
(
),
None
=>
Config
::
from_root_or_default
(
&
input
),
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment