summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-03-03 18:21:17 +0000
committerMatthew Sackman <matthew@lshift.net>2010-03-03 18:21:17 +0000
commit2751c480d86226bf997f8eea26ef5ba9bcad0fb6 (patch)
tree635b2f276b52607e3c8b15bc4a56fed535e02a36
parent86321d70677b1e9dec1821f363adf9dcdcb87b4e (diff)
parentac7293c3d70b6962886ebb17e92d238850417f1c (diff)
downloadrabbitmq-server-2751c480d86226bf997f8eea26ef5ba9bcad0fb6.tar.gz
Merging bug 16653 into default (now permits client side channel.flow to be used with shovel)
-rw-r--r--codegen.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/codegen.py b/codegen.py
index 96109610..91c70e81 100644
--- a/codegen.py
+++ b/codegen.py
@@ -126,7 +126,7 @@ def printFileHeader():
%%
%% Contributor(s): ______________________________________.
%%"""
-
+
def genErl(spec):
def erlType(domain):
return erlangTypeMap[spec.resolveDomain(domain)]
@@ -151,7 +151,7 @@ def genErl(spec):
def genMethodHasContent(m):
print "method_has_content(%s) -> %s;" % (m.erlangName(), str(m.hasContent).lower())
-
+
def genMethodIsSynchronous(m):
hasNoWait = "nowait" in fieldNameList(m.arguments)
if m.isSynchronous and hasNoWait:
@@ -219,6 +219,9 @@ def genErl(spec):
else:
pass
+ def genMethodRecord(m):
+ print "method_record(%s) -> #%s{};" % (m.erlangName(), m.erlangName())
+
def genDecodeMethodFields(m):
packedFields = packMethodFields(m.arguments)
binaryPattern = ', '.join([methodFieldFragment(f) for f in packedFields])
@@ -299,6 +302,7 @@ def genErl(spec):
-export([method_id/1]).
-export([method_has_content/1]).
-export([is_method_synchronous/1]).
+-export([method_record/1]).
-export([method_fieldnames/1]).
-export([decode_method_fields/2]).
-export([decode_properties/2]).
@@ -323,6 +327,9 @@ bitvalue(undefined) -> 0.
for m in methods: genMethodIsSynchronous(m)
print "is_method_synchronous(Name) -> exit({unknown_method_name, Name})."
+ for m in methods: genMethodRecord(m)
+ print "method_record(Name) -> exit({unknown_method_name, Name})."
+
for m in methods: genMethodFieldNames(m)
print "method_fieldnames(Name) -> exit({unknown_method_name, Name})."
@@ -362,7 +369,7 @@ def genHrl(spec):
result += ' = ' + conv_fn(field.defaultvalue)
return result
return ', '.join([fillField(f) for f in fields])
-
+
methods = spec.allMethods()
printFileHeader()
@@ -386,7 +393,7 @@ def generateErl(specPath):
def generateHrl(specPath):
genHrl(AmqpSpec(specPath))
-
+
if __name__ == "__main__":
do_main(generateHrl, generateErl)