Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
0b877e6a
Commit
0b877e6a
authored
Oct 19, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce a bunch of canonical typedefs to map VCL types to C
types. Have the python code learn the mapping from them.
parent
32d5bc32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
12 deletions
+36
-12
vrt.h
include/vrt.h
+20
-0
generate.py
lib/libvcl/generate.py
+16
-12
No files found.
include/vrt.h
View file @
0b877e6a
...
...
@@ -38,6 +38,26 @@ struct director;
struct
VCL_conf
;
struct
sockaddr_storage
;
/***********************************************************************
* This is the central definition of the mapping from VCL types to
* C-types. The python scripts read these from here.
*/
typedef
struct
director
*
VCL_BACKEND
;
typedef
unsigned
VCL_BOOL
;
typedef
double
VCL_BYTES
;
typedef
double
VCL_DURATION
;
typedef
const
char
*
VCL_ENUM
;
typedef
const
char
*
VCL_HEADER
;
typedef
long
VCL_INT
;
typedef
struct
sockaddr_storage
*
VCL_IP
;
typedef
double
VCL_REAL
;
typedef
const
char
*
VCL_STRING
;
typedef
double
VCL_TIME
;
typedef
void
VCL_VOID
;
/***********************************************************************/
enum
gethdr_e
{
HDR_REQ
,
HDR_RESP
,
HDR_OBJ
,
HDR_BEREQ
,
HDR_BERESP
};
struct
gethdr_s
{
...
...
lib/libvcl/generate.py
View file @
0b877e6a
...
...
@@ -475,21 +475,25 @@ stv_variables = (
# VCL to C type conversion
vcltypes
=
{
'IP'
:
"struct sockaddr_storage *"
,
'STRING'
:
"const char *"
,
'BOOL'
:
"unsigned"
,
'BACKEND'
:
"struct director *"
,
'TIME'
:
"double"
,
'DURATION'
:
"double"
,
'BYTES'
:
"double"
,
'INT'
:
"long"
,
'HEADER'
:
"const char *"
,
'VOID'
:
"void"
,
'REAL'
:
"double"
,
'STRING_LIST'
:
"void*"
,
'ENUM'
:
"const char *"
,
}
fi
=
open
(
buildroot
+
"/include/vrt.h"
)
for
i
in
fi
:
j
=
i
.
split
();
if
len
(
j
)
<
3
:
continue
if
j
[
0
]
!=
"typedef"
:
continue
if
j
[
-
1
][
-
1
]
!=
";"
:
continue
if
j
[
-
1
][:
4
]
!=
"VCL_"
:
continue
d
=
" "
.
join
(
j
[
1
:
-
1
])
vcltypes
[
j
[
-
1
][
4
:
-
1
]]
=
d
fi
.
close
()
#######################################################################
# Nothing is easily configurable below this line.
#######################################################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment