Commit 8a20a9f0 authored by Lasse Karstensen's avatar Lasse Karstensen

Clean up whitespace and extra characters.

Improve readability by removing superfluous white space and
commas.

No functional changes. Works on Python 2 and Python 3.
parent 1851ae9a
...@@ -160,8 +160,8 @@ returns = ( ...@@ -160,8 +160,8 @@ returns = (
sp_variables = [ sp_variables = [
('remote.ip', ('remote.ip',
'IP', 'IP',
( 'client', 'backend'), ('client', 'backend'),
( ), """ (), """
The IP address of the other end of the TCP connection. The IP address of the other end of the TCP connection.
This can either be the clients IP, or the outgoing IP This can either be the clients IP, or the outgoing IP
of a proxy server. of a proxy server.
...@@ -169,45 +169,45 @@ sp_variables = [ ...@@ -169,45 +169,45 @@ sp_variables = [
), ),
('client.ip', ('client.ip',
'IP', 'IP',
( 'client', 'backend'), ('client', 'backend'),
( ), """ (), """
The client's IP address. The client's IP address.
""" """
), ),
('client.identity', ('client.identity',
'STRING', 'STRING',
( 'client',), ('client',),
( 'client',), """ ('client',), """
Identification of the client, used to load balance Identification of the client, used to load balance
in the client director. in the client director.
""" """
), ),
('local.ip', ('local.ip',
'IP', 'IP',
( 'client', 'backend'), ('client', 'backend'),
( ), """ (), """
The IP address of the local end of the TCP connection. The IP address of the local end of the TCP connection.
""" """
), ),
('server.ip', ('server.ip',
'IP', 'IP',
( 'client', 'backend'), ('client', 'backend'),
( ), """ (), """
The IP address of the socket on which the client The IP address of the socket on which the client
connection was received. connection was received.
""" """
), ),
('server.hostname', ('server.hostname',
'STRING', 'STRING',
( 'all',), ('all',),
( ), """ (), """
The host name of the server. The host name of the server.
""" """
), ),
('server.identity', ('server.identity',
'STRING', 'STRING',
( 'all',), ('all',),
( ), """ (), """
The identity of the server, as set by the -i The identity of the server, as set by the -i
parameter. If the -i parameter is not passed to varnishd, parameter. If the -i parameter is not passed to varnishd,
server.identity will be set to the name of the instance, as server.identity will be set to the name of the instance, as
...@@ -216,70 +216,70 @@ sp_variables = [ ...@@ -216,70 +216,70 @@ sp_variables = [
), ),
('req', ('req',
'HTTP', 'HTTP',
( 'client',), ('client',),
( ), """ (), """
The entire request HTTP data structure The entire request HTTP data structure
""" """
), ),
('req.method', ('req.method',
'STRING', 'STRING',
( 'client',), ('client',),
( 'client',), """ ('client',), """
The request type (e.g. "GET", "HEAD"). The request type (e.g. "GET", "HEAD").
""" """
), ),
('req.url', ('req.url',
'STRING', 'STRING',
( 'client',), ('client',),
( 'client',), """ ('client',), """
The requested URL. The requested URL.
""" """
), ),
('req.proto', ('req.proto',
'STRING', 'STRING',
( 'client',), ('client',),
( 'client',), """ ('client',), """
The HTTP protocol version used by the client. The HTTP protocol version used by the client.
""" """
), ),
('req.http.', ('req.http.',
'HEADER', 'HEADER',
( 'client',), ('client',),
( 'client',), """ ('client',), """
The corresponding HTTP header. The corresponding HTTP header.
""" """
), ),
('req.restarts', ('req.restarts',
'INT', 'INT',
( 'client',), ('client',),
( ), """ (), """
A count of how many times this request has been restarted. A count of how many times this request has been restarted.
""" """
), ),
('req.esi_level', ('req.esi_level',
'INT', 'INT',
( 'client',), ('client',),
( ), """ (), """
A count of how many levels of ESI requests we're currently at. A count of how many levels of ESI requests we're currently at.
""" """
), ),
('req.ttl', ('req.ttl',
'DURATION', 'DURATION',
( 'client',), ('client',),
( 'client',), """ ('client',), """
""" """
), ),
('req.xid', ('req.xid',
'STRING', 'STRING',
( 'client',), ('client',),
( ), """ (), """
Unique ID of this request. Unique ID of this request.
""" """
), ),
('req.esi', ('req.esi',
'BOOL', 'BOOL',
( 'client',), ('client',),
( 'client',), """ ('client',), """
Boolean. Set to false to disable ESI processing Boolean. Set to false to disable ESI processing
regardless of any value in beresp.do_esi. Defaults regardless of any value in beresp.do_esi. Defaults
to true. This variable is subject to change in to true. This variable is subject to change in
...@@ -288,22 +288,22 @@ sp_variables = [ ...@@ -288,22 +288,22 @@ sp_variables = [
), ),
('req.can_gzip', ('req.can_gzip',
'BOOL', 'BOOL',
( 'client',), ('client',),
( ), """ (), """
Does the client accept the gzip transfer encoding. Does the client accept the gzip transfer encoding.
""" """
), ),
('req.backend_hint', ('req.backend_hint',
'BACKEND', 'BACKEND',
( 'client', ), ('client', ),
( 'client',), """ ('client',), """
Set bereq.backend to this if we attempt to fetch. Set bereq.backend to this if we attempt to fetch.
""" """
), ),
('req.hash_ignore_busy', ('req.hash_ignore_busy',
'BOOL', 'BOOL',
( 'recv',), ('recv',),
( 'recv',), """ ('recv',), """
Ignore any busy object during cache lookup. You Ignore any busy object during cache lookup. You
would want to do this if you have two server looking would want to do this if you have two server looking
up content from each other to avoid potential deadlocks. up content from each other to avoid potential deadlocks.
...@@ -311,8 +311,8 @@ sp_variables = [ ...@@ -311,8 +311,8 @@ sp_variables = [
), ),
('req.hash_always_miss', ('req.hash_always_miss',
'BOOL', 'BOOL',
( 'recv',), ('recv',),
( 'recv',), """ ('recv',), """
Force a cache miss for this request. If set to true Force a cache miss for this request. If set to true
Varnish will disregard any existing objects and Varnish will disregard any existing objects and
always (re)fetch from the backend. always (re)fetch from the backend.
...@@ -320,7 +320,7 @@ sp_variables = [ ...@@ -320,7 +320,7 @@ sp_variables = [
), ),
('req_top.method', ('req_top.method',
'STRING', 'STRING',
( 'client',), ('client',),
(), """ (), """
The request method of the top-level request in a tree The request method of the top-level request in a tree
of ESI requests. (e.g. "GET", "HEAD"). of ESI requests. (e.g. "GET", "HEAD").
...@@ -329,7 +329,7 @@ sp_variables = [ ...@@ -329,7 +329,7 @@ sp_variables = [
), ),
('req_top.url', ('req_top.url',
'STRING', 'STRING',
( 'client',), ('client',),
(), """ (), """
The requested URL of the top-level request in a tree The requested URL of the top-level request in a tree
of ESI requests. of ESI requests.
...@@ -338,7 +338,7 @@ sp_variables = [ ...@@ -338,7 +338,7 @@ sp_variables = [
), ),
('req_top.http.', ('req_top.http.',
'HEADER', 'HEADER',
( 'client',), ('client',),
(), """ (), """
HTTP headers of the top-level request in a tree of ESI requests. HTTP headers of the top-level request in a tree of ESI requests.
Identical to req.http. in non-ESI requests. Identical to req.http. in non-ESI requests.
...@@ -346,7 +346,7 @@ sp_variables = [ ...@@ -346,7 +346,7 @@ sp_variables = [
), ),
('req_top.proto', ('req_top.proto',
'STRING', 'STRING',
( 'client',), ('client',),
(), """ (), """
HTTP protocol version of the top-level request in a tree of HTTP protocol version of the top-level request in a tree of
ESI requests. ESI requests.
...@@ -355,64 +355,64 @@ sp_variables = [ ...@@ -355,64 +355,64 @@ sp_variables = [
), ),
('bereq', ('bereq',
'HTTP', 'HTTP',
( 'backend',), ('backend',),
( ), """ (), """
The entire backend request HTTP data structure The entire backend request HTTP data structure
""" """
), ),
('bereq.xid', ('bereq.xid',
'STRING', 'STRING',
( 'backend',), ('backend',),
( ), """ (), """
Unique ID of this request. Unique ID of this request.
""" """
), ),
('bereq.retries', ('bereq.retries',
'INT', 'INT',
( 'backend',), ('backend',),
( ), """ (), """
A count of how many times this request has been retried. A count of how many times this request has been retried.
""" """
), ),
('bereq.backend', ('bereq.backend',
'BACKEND', 'BACKEND',
( 'pipe', 'backend', ), ('pipe', 'backend', ),
( 'pipe', 'backend', ), """ ('pipe', 'backend', ), """
This is the backend or director we attempt to fetch from. This is the backend or director we attempt to fetch from.
""" """
), ),
('bereq.method', ('bereq.method',
'STRING', 'STRING',
( 'pipe', 'backend', ), ('pipe', 'backend', ),
( 'pipe', 'backend', ), """ ('pipe', 'backend', ), """
The request type (e.g. "GET", "HEAD"). The request type (e.g. "GET", "HEAD").
""" """
), ),
('bereq.url', ('bereq.url',
'STRING', 'STRING',
( 'pipe', 'backend', ), ('pipe', 'backend', ),
( 'pipe', 'backend', ), """ ('pipe', 'backend', ), """
The requested URL. The requested URL.
""" """
), ),
('bereq.proto', ('bereq.proto',
'STRING', 'STRING',
( 'pipe', 'backend', ), ('pipe', 'backend', ),
( 'pipe', 'backend', ), """ ('pipe', 'backend', ), """
The HTTP protocol version used to talk to the server. The HTTP protocol version used to talk to the server.
""" """
), ),
('bereq.http.', ('bereq.http.',
'HEADER', 'HEADER',
( 'pipe', 'backend', ), ('pipe', 'backend', ),
( 'pipe', 'backend', ), """ ('pipe', 'backend', ), """
The corresponding HTTP header. The corresponding HTTP header.
""" """
), ),
('bereq.uncacheable', ('bereq.uncacheable',
'BOOL', 'BOOL',
( 'backend', ), ('backend', ),
( ), """ (), """
Indicates whether this request is uncacheable due Indicates whether this request is uncacheable due
to a pass in the client side or a hit on an existing to a pass in the client side or a hit on an existing
uncacheable object (aka hit-for-pass). uncacheable object (aka hit-for-pass).
...@@ -420,66 +420,66 @@ sp_variables = [ ...@@ -420,66 +420,66 @@ sp_variables = [
), ),
('bereq.connect_timeout', ('bereq.connect_timeout',
'DURATION', 'DURATION',
( 'pipe', 'backend', ), ('pipe', 'backend', ),
( 'pipe', 'backend', ), """ ('pipe', 'backend', ), """
The time in seconds to wait for a backend connection. The time in seconds to wait for a backend connection.
""" """
), ),
('bereq.first_byte_timeout', ('bereq.first_byte_timeout',
'DURATION', 'DURATION',
( 'backend', ), ('backend', ),
( 'backend', ), """ ('backend', ), """
The time in seconds to wait for the first byte from The time in seconds to wait for the first byte from
the backend. Not available in pipe mode. the backend. Not available in pipe mode.
""" """
), ),
('bereq.between_bytes_timeout', ('bereq.between_bytes_timeout',
'DURATION', 'DURATION',
( 'backend', ), ('backend', ),
( 'backend', ), """ ('backend', ), """
The time in seconds to wait between each received byte from the The time in seconds to wait between each received byte from the
backend. Not available in pipe mode. backend. Not available in pipe mode.
""" """
), ),
('beresp', ('beresp',
'HTTP', 'HTTP',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( ), """ (), """
The entire backend response HTTP data structure The entire backend response HTTP data structure
""" """
), ),
('beresp.proto', ('beresp.proto',
'STRING', 'STRING',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
The HTTP protocol version used the backend replied with. The HTTP protocol version used the backend replied with.
""" """
), ),
('beresp.status', ('beresp.status',
'INT', 'INT',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
The HTTP status code returned by the server. The HTTP status code returned by the server.
""" """
), ),
('beresp.reason', ('beresp.reason',
'STRING', 'STRING',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
The HTTP status message returned by the server. The HTTP status message returned by the server.
""" """
), ),
('beresp.http.', ('beresp.http.',
'HEADER', 'HEADER',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
The corresponding HTTP header. The corresponding HTTP header.
""" """
), ),
('beresp.do_esi', ('beresp.do_esi',
'BOOL', 'BOOL',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Boolean. ESI-process the object after fetching it. Boolean. ESI-process the object after fetching it.
Defaults to false. Set it to true to parse the Defaults to false. Set it to true to parse the
object for ESI directives. Will only be honored if object for ESI directives. Will only be honored if
...@@ -488,8 +488,8 @@ sp_variables = [ ...@@ -488,8 +488,8 @@ sp_variables = [
), ),
('beresp.do_stream', ('beresp.do_stream',
'BOOL', 'BOOL',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Deliver the object to the client directly without Deliver the object to the client directly without
fetching the whole object into varnish. If this fetching the whole object into varnish. If this
request is pass'ed it will not be stored in memory. request is pass'ed it will not be stored in memory.
...@@ -497,8 +497,8 @@ sp_variables = [ ...@@ -497,8 +497,8 @@ sp_variables = [
), ),
('beresp.do_gzip', ('beresp.do_gzip',
'BOOL', 'BOOL',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Boolean. Gzip the object before storing it. Defaults Boolean. Gzip the object before storing it. Defaults
to false. When http_gzip_support is on Varnish will to false. When http_gzip_support is on Varnish will
request already compressed content from the backend request already compressed content from the backend
...@@ -507,16 +507,16 @@ sp_variables = [ ...@@ -507,16 +507,16 @@ sp_variables = [
), ),
('beresp.do_gunzip', ('beresp.do_gunzip',
'BOOL', 'BOOL',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Boolean. Unzip the object before storing it in the Boolean. Unzip the object before storing it in the
cache. Defaults to false. cache. Defaults to false.
""" """
), ),
('beresp.was_304', ('beresp.was_304',
'BOOL', 'BOOL',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( ), """ (), """
Boolean. If this is a successful 304 response to a Boolean. If this is a successful 304 response to a
backend conditional request refreshing an existing backend conditional request refreshing an existing
cache object. cache object.
...@@ -524,8 +524,8 @@ sp_variables = [ ...@@ -524,8 +524,8 @@ sp_variables = [
), ),
('beresp.uncacheable', ('beresp.uncacheable',
'BOOL', 'BOOL',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Inherited from bereq.uncacheable, see there. Inherited from bereq.uncacheable, see there.
Setting this variable makes the object uncacheable, which may Setting this variable makes the object uncacheable, which may
...@@ -537,29 +537,29 @@ sp_variables = [ ...@@ -537,29 +537,29 @@ sp_variables = [
), ),
('beresp.ttl', ('beresp.ttl',
'DURATION', 'DURATION',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
The object's remaining time to live, in seconds. The object's remaining time to live, in seconds.
""" """
), ),
('beresp.age', ('beresp.age',
'DURATION', 'DURATION',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( ), """ (), """
The age of the object. The age of the object.
""" """
), ),
('beresp.grace', ('beresp.grace',
'DURATION', 'DURATION',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Set to a period to enable grace. Set to a period to enable grace.
""" """
), ),
('beresp.keep', ('beresp.keep',
'DURATION', 'DURATION',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Set to a period to enable conditional backend requests. Set to a period to enable conditional backend requests.
The keep time is cache lifetime in addition to the ttl. The keep time is cache lifetime in addition to the ttl.
...@@ -571,8 +571,8 @@ sp_variables = [ ...@@ -571,8 +571,8 @@ sp_variables = [
), ),
('beresp.backend', ('beresp.backend',
'BACKEND', 'BACKEND',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( ), """ (), """
This is the backend we fetched from. If bereq.backend This is the backend we fetched from. If bereq.backend
was set to a director, this will be the backend selected was set to a director, this will be the backend selected
by the director. by the director.
...@@ -580,115 +580,115 @@ sp_variables = [ ...@@ -580,115 +580,115 @@ sp_variables = [
), ),
('beresp.backend.name', ('beresp.backend.name',
'STRING', 'STRING',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( ), """ (), """
Name of the backend this response was fetched from. Name of the backend this response was fetched from.
""" """
), ),
('beresp.backend.ip', ('beresp.backend.ip',
'IP', 'IP',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( ), """ (), """
IP of the backend this response was fetched from. IP of the backend this response was fetched from.
""" """
), ),
('beresp.storage_hint', ('beresp.storage_hint',
'STRING', 'STRING',
( 'backend_response', 'backend_error'), ('backend_response', 'backend_error'),
( 'backend_response', 'backend_error'), """ ('backend_response', 'backend_error'), """
Hint to Varnish that you want to save this object to a Hint to Varnish that you want to save this object to a
particular storage backend. particular storage backend.
""" """
), ),
('obj.proto', ('obj.proto',
'STRING', 'STRING',
( 'hit', ), ('hit',),
( ), """ (), """
The HTTP protocol version used when the object was retrieved. The HTTP protocol version used when the object was retrieved.
""" """
), ),
('obj.status', ('obj.status',
'INT', 'INT',
( 'hit',), ('hit',),
( ), """ (), """
The HTTP status code returned by the server. The HTTP status code returned by the server.
""" """
), ),
('obj.reason', ('obj.reason',
'STRING', 'STRING',
( 'hit',), ('hit',),
( ), """ (), """
The HTTP status message returned by the server. The HTTP status message returned by the server.
""" """
), ),
('obj.hits', ('obj.hits',
'INT', 'INT',
( 'hit', 'deliver',), ('hit', 'deliver'),
( ), """ (), """
The count of cache-hits on this object. A value of 0 indicates a The count of cache-hits on this object. A value of 0 indicates a
cache miss. cache miss.
""" """
), ),
('obj.http.', ('obj.http.',
'HEADER', 'HEADER',
( 'hit', ), ('hit',),
( ), """ (), """
The corresponding HTTP header. The corresponding HTTP header.
""" """
), ),
('obj.ttl', ('obj.ttl',
'DURATION', 'DURATION',
( 'hit', ), ('hit',),
( ), """ (), """
The object's remaining time to live, in seconds. The object's remaining time to live, in seconds.
""" """
), ),
('obj.age', ('obj.age',
'DURATION', 'DURATION',
( 'hit', ), ('hit',),
( ), """ (), """
The age of the object. The age of the object.
""" """
), ),
('obj.grace', ('obj.grace',
'DURATION', 'DURATION',
( 'hit', ), ('hit',),
( ), """ (), """
The object's remaining grace period in seconds. The object's remaining grace period in seconds.
""" """
), ),
('obj.keep', ('obj.keep',
'DURATION', 'DURATION',
( 'hit', ), ('hit',),
( ), """ (), """
The object's remaining keep period in seconds. The object's remaining keep period in seconds.
""" """
), ),
('obj.uncacheable', ('obj.uncacheable',
'BOOL', 'BOOL',
( 'deliver', ), ('deliver',),
( ), """ (), """
Whether the object is uncacheable (pass or hit-for-pass). Whether the object is uncacheable (pass or hit-for-pass).
""" """
), ),
('resp', ('resp',
'HTTP', 'HTTP',
( 'deliver', 'synth'), ('deliver', 'synth'),
( ), """ (), """
The entire response HTTP data structure. The entire response HTTP data structure.
""" """
), ),
('resp.proto', ('resp.proto',
'STRING', 'STRING',
( 'deliver', 'synth', ), ('deliver', 'synth'),
( 'deliver', 'synth', ), """ ('deliver', 'synth'), """
The HTTP protocol version to use for the response. The HTTP protocol version to use for the response.
""" """
), ),
('resp.status', ('resp.status',
'INT', 'INT',
( 'deliver', 'synth', ), ('deliver', 'synth'),
( 'deliver', 'synth', ), """ ('deliver', 'synth'), """
The HTTP status code that will be returned. The HTTP status code that will be returned.
Assigning a HTTP standardized code to resp.status will also Assigning a HTTP standardized code to resp.status will also
...@@ -697,30 +697,30 @@ sp_variables = [ ...@@ -697,30 +697,30 @@ sp_variables = [
), ),
('resp.reason', ('resp.reason',
'STRING', 'STRING',
( 'deliver', 'synth', ), ('deliver', 'synth'),
( 'deliver', 'synth', ), """ ('deliver', 'synth'), """
The HTTP status message that will be returned. The HTTP status message that will be returned.
""" """
), ),
('resp.http.', ('resp.http.',
'HEADER', 'HEADER',
( 'deliver', 'synth', ), ('deliver', 'synth'),
( 'deliver', 'synth', ), """ ('deliver', 'synth'), """
The corresponding HTTP header. The corresponding HTTP header.
""" """
), ),
('resp.is_streaming', ('resp.is_streaming',
'BOOL', 'BOOL',
( 'deliver', 'synth', ), ('deliver', 'synth'),
( ), """ (), """
Returns true when the response will be streamed Returns true when the response will be streamed
from the backend. from the backend.
""" """
), ),
('now', ('now',
'TIME', 'TIME',
( 'all',), ('all',),
( ), """ (), """
The current time, in seconds since the epoch. When The current time, in seconds since the epoch. When
used in string context it returns a formatted string. used in string context it returns a formatted string.
""" """
...@@ -728,8 +728,7 @@ sp_variables = [ ...@@ -728,8 +728,7 @@ sp_variables = [
] ]
# Backwards compatibility: # Backwards compatibility:
aliases = [ aliases = []
]
stv_variables = ( stv_variables = (
('free_space', 'BYTES', "0.", 'storage.<name>.free_space', """ ('free_space', 'BYTES', "0.", 'storage.<name>.free_space', """
...@@ -756,7 +755,7 @@ vcltypes = { ...@@ -756,7 +755,7 @@ vcltypes = {
fi = open(join(srcroot, "include/vrt.h")) fi = open(join(srcroot, "include/vrt.h"))
for i in fi: for i in fi:
j = i.split(); j = i.split()
if len(j) < 3: if len(j) < 3:
continue continue
if j[0] != "typedef": if j[0] != "typedef":
...@@ -865,7 +864,7 @@ def emit_file(fo, fd, bn): ...@@ -865,7 +864,7 @@ def emit_file(fo, fd, bn):
fi.close() fi.close()
w = 66 # Width of lines, after white space prefix w = 66 # Width of lines, after white space prefix
maxlen = 10240 # Max length of string literal maxlen = 10240 # Max length of string literal
x = 0 x = 0
l = 0 l = 0
...@@ -902,7 +901,7 @@ def emit_file(fo, fd, bn): ...@@ -902,7 +901,7 @@ def emit_file(fo, fd, bn):
l += len(d) l += len(d)
if l > maxlen: if l > maxlen:
fo.write("\");\n") fo.write("\");\n")
l = 0; l = 0
x = 0 x = 0
if x > w - 3: if x > w - 3:
fo.write("\"\n") fo.write("\"\n")
...@@ -915,11 +914,11 @@ def emit_file(fo, fd, bn): ...@@ -915,11 +914,11 @@ def emit_file(fo, fd, bn):
####################################################################### #######################################################################
def polish_tokens(tokens): def polish_tokens(tokens):
# Expand single char tokens # Expand single char tokens
st = tokens[None] st = tokens[None]
del tokens[None] del tokens[None]
for i in st: for i in st:
tokens["'" + i + "'"] = i tokens["'" + i + "'"] = i
####################################################################### #######################################################################
...@@ -978,7 +977,7 @@ fo.write("\n#ifdef VCL_RET_MAC\n") ...@@ -978,7 +977,7 @@ fo.write("\n#ifdef VCL_RET_MAC\n")
ll = sorted(returns) ll = sorted(returns)
for i in sorted(rets.keys()): for i in sorted(rets.keys()):
fo.write("VCL_RET_MAC(%s, %s" % (i.lower(), i.upper())) fo.write("VCL_RET_MAC(%s, %s" % (i.lower(), i.upper()))
s=",\n\t" s = ",\n\t"
for j in ll: for j in ll:
if i in j[2]: if i in j[2]:
fo.write("%sVCL_MET_%s" % (s, j[0].upper())) fo.write("%sVCL_MET_%s" % (s, j[0].upper()))
...@@ -1027,6 +1026,7 @@ typedef void vcl_fini_f(VRT_CTX); ...@@ -1027,6 +1026,7 @@ typedef void vcl_fini_f(VRT_CTX);
typedef int vcl_func_f(VRT_CTX); typedef int vcl_func_f(VRT_CTX);
""") """)
def tbl40(a, b): def tbl40(a, b):
while len(a.expandtabs()) < 40: while len(a.expandtabs()) < 40:
a += "\t" a += "\t"
...@@ -1078,6 +1078,7 @@ fo.close() ...@@ -1078,6 +1078,7 @@ fo.close()
####################################################################### #######################################################################
def restrict(fo, spec): def restrict(fo, spec):
d = dict() d = dict()
for j in spec: for j in spec:
...@@ -1134,6 +1135,7 @@ fo.write(""" ...@@ -1134,6 +1135,7 @@ fo.write("""
const struct var vcc_vars[] = { const struct var vcc_vars[] = {
""") """)
def one_var(nm, spec): def one_var(nm, spec):
fh.write("\n") fh.write("\n")
typ = spec[1] typ = spec[1]
...@@ -1251,7 +1253,7 @@ fo.write(""" ...@@ -1251,7 +1253,7 @@ fo.write("""
#endif #endif
""") """)
x=dict() x = dict()
for i in stv_variables: for i in stv_variables:
ct = vcltypes[i[1]] ct = vcltypes[i[1]]
if not ct in x: if not ct in x:
...@@ -1280,6 +1282,7 @@ fp_vclvar = open(join(buildroot, "doc/sphinx/include/vcl_var.rst"), "w") ...@@ -1280,6 +1282,7 @@ fp_vclvar = open(join(buildroot, "doc/sphinx/include/vcl_var.rst"), "w")
l = sorted(sp_variables) l = sorted(sp_variables)
def rst_where(fo, h, l): def rst_where(fo, h, l):
ll = list() ll = list()
if len(l) == 0: if len(l) == 0:
...@@ -1303,7 +1306,7 @@ def rst_where(fo, h, l): ...@@ -1303,7 +1306,7 @@ def rst_where(fo, h, l):
s = ", " s = ", "
fo.write("\n\n") fo.write("\n\n")
hdr="" hdr = ""
for i in l: for i in l:
j = i[0].split(".") j = i[0].split(".")
if j[0] != hdr: if j[0] != hdr:
...@@ -1327,5 +1330,4 @@ for i in stv_variables: ...@@ -1327,5 +1330,4 @@ for i in stv_variables:
for j in i[4].split("\n"): for j in i[4].split("\n"):
fp_vclvar.write("\t%s\n" % j.strip()) fp_vclvar.write("\t%s\n" % j.strip())
fp_vclvar.close() fp_vclvar.close()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment