mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-09-01 13:43:40 +02:00
Removed files which sould not be in git repo
This commit is contained in:
parent
23c0ccdd67
commit
c1a5029de7
579
external/Python/docopt.py
vendored
579
external/Python/docopt.py
vendored
@ -1,579 +0,0 @@
|
|||||||
"""Pythonic command-line interface parser that will make you smile.
|
|
||||||
|
|
||||||
* http://docopt.org
|
|
||||||
* Repository and issue-tracker: https://github.com/docopt/docopt
|
|
||||||
* Licensed under terms of MIT license (see LICENSE-MIT)
|
|
||||||
* Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com
|
|
||||||
|
|
||||||
"""
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['docopt']
|
|
||||||
__version__ = '0.6.2'
|
|
||||||
|
|
||||||
|
|
||||||
class DocoptLanguageError(Exception):
|
|
||||||
|
|
||||||
"""Error in construction of usage-message by developer."""
|
|
||||||
|
|
||||||
|
|
||||||
class DocoptExit(SystemExit):
|
|
||||||
|
|
||||||
"""Exit in case user invoked program with incorrect arguments."""
|
|
||||||
|
|
||||||
usage = ''
|
|
||||||
|
|
||||||
def __init__(self, message=''):
|
|
||||||
SystemExit.__init__(self, (message + '\n' + self.usage).strip())
|
|
||||||
|
|
||||||
|
|
||||||
class Pattern(object):
|
|
||||||
|
|
||||||
def __eq__(self, other):
|
|
||||||
return repr(self) == repr(other)
|
|
||||||
|
|
||||||
def __hash__(self):
|
|
||||||
return hash(repr(self))
|
|
||||||
|
|
||||||
def fix(self):
|
|
||||||
self.fix_identities()
|
|
||||||
self.fix_repeating_arguments()
|
|
||||||
return self
|
|
||||||
|
|
||||||
def fix_identities(self, uniq=None):
|
|
||||||
"""Make pattern-tree tips point to same object if they are equal."""
|
|
||||||
if not hasattr(self, 'children'):
|
|
||||||
return self
|
|
||||||
uniq = list(set(self.flat())) if uniq is None else uniq
|
|
||||||
for i, c in enumerate(self.children):
|
|
||||||
if not hasattr(c, 'children'):
|
|
||||||
assert c in uniq
|
|
||||||
self.children[i] = uniq[uniq.index(c)]
|
|
||||||
else:
|
|
||||||
c.fix_identities(uniq)
|
|
||||||
|
|
||||||
def fix_repeating_arguments(self):
|
|
||||||
"""Fix elements that should accumulate/increment values."""
|
|
||||||
either = [list(c.children) for c in self.either.children]
|
|
||||||
for case in either:
|
|
||||||
for e in [c for c in case if case.count(c) > 1]:
|
|
||||||
if type(e) is Argument or type(e) is Option and e.argcount:
|
|
||||||
if e.value is None:
|
|
||||||
e.value = []
|
|
||||||
elif type(e.value) is not list:
|
|
||||||
e.value = e.value.split()
|
|
||||||
if type(e) is Command or type(e) is Option and e.argcount == 0:
|
|
||||||
e.value = 0
|
|
||||||
return self
|
|
||||||
|
|
||||||
@property
|
|
||||||
def either(self):
|
|
||||||
"""Transform pattern into an equivalent, with only top-level Either."""
|
|
||||||
# Currently the pattern will not be equivalent, but more "narrow",
|
|
||||||
# although good enough to reason about list arguments.
|
|
||||||
ret = []
|
|
||||||
groups = [[self]]
|
|
||||||
while groups:
|
|
||||||
children = groups.pop(0)
|
|
||||||
types = [type(c) for c in children]
|
|
||||||
if Either in types:
|
|
||||||
either = [c for c in children if type(c) is Either][0]
|
|
||||||
children.pop(children.index(either))
|
|
||||||
for c in either.children:
|
|
||||||
groups.append([c] + children)
|
|
||||||
elif Required in types:
|
|
||||||
required = [c for c in children if type(c) is Required][0]
|
|
||||||
children.pop(children.index(required))
|
|
||||||
groups.append(list(required.children) + children)
|
|
||||||
elif Optional in types:
|
|
||||||
optional = [c for c in children if type(c) is Optional][0]
|
|
||||||
children.pop(children.index(optional))
|
|
||||||
groups.append(list(optional.children) + children)
|
|
||||||
elif AnyOptions in types:
|
|
||||||
optional = [c for c in children if type(c) is AnyOptions][0]
|
|
||||||
children.pop(children.index(optional))
|
|
||||||
groups.append(list(optional.children) + children)
|
|
||||||
elif OneOrMore in types:
|
|
||||||
oneormore = [c for c in children if type(c) is OneOrMore][0]
|
|
||||||
children.pop(children.index(oneormore))
|
|
||||||
groups.append(list(oneormore.children) * 2 + children)
|
|
||||||
else:
|
|
||||||
ret.append(children)
|
|
||||||
return Either(*[Required(*e) for e in ret])
|
|
||||||
|
|
||||||
|
|
||||||
class ChildPattern(Pattern):
|
|
||||||
|
|
||||||
def __init__(self, name, value=None):
|
|
||||||
self.name = name
|
|
||||||
self.value = value
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return '%s(%r, %r)' % (self.__class__.__name__, self.name, self.value)
|
|
||||||
|
|
||||||
def flat(self, *types):
|
|
||||||
return [self] if not types or type(self) in types else []
|
|
||||||
|
|
||||||
def match(self, left, collected=None):
|
|
||||||
collected = [] if collected is None else collected
|
|
||||||
pos, match = self.single_match(left)
|
|
||||||
if match is None:
|
|
||||||
return False, left, collected
|
|
||||||
left_ = left[:pos] + left[pos + 1:]
|
|
||||||
same_name = [a for a in collected if a.name == self.name]
|
|
||||||
if type(self.value) in (int, list):
|
|
||||||
if type(self.value) is int:
|
|
||||||
increment = 1
|
|
||||||
else:
|
|
||||||
increment = ([match.value] if type(match.value) is str
|
|
||||||
else match.value)
|
|
||||||
if not same_name:
|
|
||||||
match.value = increment
|
|
||||||
return True, left_, collected + [match]
|
|
||||||
same_name[0].value += increment
|
|
||||||
return True, left_, collected
|
|
||||||
return True, left_, collected + [match]
|
|
||||||
|
|
||||||
|
|
||||||
class ParentPattern(Pattern):
|
|
||||||
|
|
||||||
def __init__(self, *children):
|
|
||||||
self.children = list(children)
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return '%s(%s)' % (self.__class__.__name__,
|
|
||||||
', '.join(repr(a) for a in self.children))
|
|
||||||
|
|
||||||
def flat(self, *types):
|
|
||||||
if type(self) in types:
|
|
||||||
return [self]
|
|
||||||
return sum([c.flat(*types) for c in self.children], [])
|
|
||||||
|
|
||||||
|
|
||||||
class Argument(ChildPattern):
|
|
||||||
|
|
||||||
def single_match(self, left):
|
|
||||||
for n, p in enumerate(left):
|
|
||||||
if type(p) is Argument:
|
|
||||||
return n, Argument(self.name, p.value)
|
|
||||||
return None, None
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def parse(class_, source):
|
|
||||||
name = re.findall('(<\S*?>)', source)[0]
|
|
||||||
value = re.findall('\[default: (.*)\]', source, flags=re.I)
|
|
||||||
return class_(name, value[0] if value else None)
|
|
||||||
|
|
||||||
|
|
||||||
class Command(Argument):
|
|
||||||
|
|
||||||
def __init__(self, name, value=False):
|
|
||||||
self.name = name
|
|
||||||
self.value = value
|
|
||||||
|
|
||||||
def single_match(self, left):
|
|
||||||
for n, p in enumerate(left):
|
|
||||||
if type(p) is Argument:
|
|
||||||
if p.value == self.name:
|
|
||||||
return n, Command(self.name, True)
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
return None, None
|
|
||||||
|
|
||||||
|
|
||||||
class Option(ChildPattern):
|
|
||||||
|
|
||||||
def __init__(self, short=None, long=None, argcount=0, value=False):
|
|
||||||
assert argcount in (0, 1)
|
|
||||||
self.short, self.long = short, long
|
|
||||||
self.argcount, self.value = argcount, value
|
|
||||||
self.value = None if value is False and argcount else value
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def parse(class_, option_description):
|
|
||||||
short, long, argcount, value = None, None, 0, False
|
|
||||||
options, _, description = option_description.strip().partition(' ')
|
|
||||||
options = options.replace(',', ' ').replace('=', ' ')
|
|
||||||
for s in options.split():
|
|
||||||
if s.startswith('--'):
|
|
||||||
long = s
|
|
||||||
elif s.startswith('-'):
|
|
||||||
short = s
|
|
||||||
else:
|
|
||||||
argcount = 1
|
|
||||||
if argcount:
|
|
||||||
matched = re.findall('\[default: (.*)\]', description, flags=re.I)
|
|
||||||
value = matched[0] if matched else None
|
|
||||||
return class_(short, long, argcount, value)
|
|
||||||
|
|
||||||
def single_match(self, left):
|
|
||||||
for n, p in enumerate(left):
|
|
||||||
if self.name == p.name:
|
|
||||||
return n, p
|
|
||||||
return None, None
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
return self.long or self.short
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return 'Option(%r, %r, %r, %r)' % (self.short, self.long,
|
|
||||||
self.argcount, self.value)
|
|
||||||
|
|
||||||
|
|
||||||
class Required(ParentPattern):
|
|
||||||
|
|
||||||
def match(self, left, collected=None):
|
|
||||||
collected = [] if collected is None else collected
|
|
||||||
l = left
|
|
||||||
c = collected
|
|
||||||
for p in self.children:
|
|
||||||
matched, l, c = p.match(l, c)
|
|
||||||
if not matched:
|
|
||||||
return False, left, collected
|
|
||||||
return True, l, c
|
|
||||||
|
|
||||||
|
|
||||||
class Optional(ParentPattern):
|
|
||||||
|
|
||||||
def match(self, left, collected=None):
|
|
||||||
collected = [] if collected is None else collected
|
|
||||||
for p in self.children:
|
|
||||||
m, left, collected = p.match(left, collected)
|
|
||||||
return True, left, collected
|
|
||||||
|
|
||||||
|
|
||||||
class AnyOptions(Optional):
|
|
||||||
|
|
||||||
"""Marker/placeholder for [options] shortcut."""
|
|
||||||
|
|
||||||
|
|
||||||
class OneOrMore(ParentPattern):
|
|
||||||
|
|
||||||
def match(self, left, collected=None):
|
|
||||||
assert len(self.children) == 1
|
|
||||||
collected = [] if collected is None else collected
|
|
||||||
l = left
|
|
||||||
c = collected
|
|
||||||
l_ = None
|
|
||||||
matched = True
|
|
||||||
times = 0
|
|
||||||
while matched:
|
|
||||||
# could it be that something didn't match but changed l or c?
|
|
||||||
matched, l, c = self.children[0].match(l, c)
|
|
||||||
times += 1 if matched else 0
|
|
||||||
if l_ == l:
|
|
||||||
break
|
|
||||||
l_ = l
|
|
||||||
if times >= 1:
|
|
||||||
return True, l, c
|
|
||||||
return False, left, collected
|
|
||||||
|
|
||||||
|
|
||||||
class Either(ParentPattern):
|
|
||||||
|
|
||||||
def match(self, left, collected=None):
|
|
||||||
collected = [] if collected is None else collected
|
|
||||||
outcomes = []
|
|
||||||
for p in self.children:
|
|
||||||
matched, _, _ = outcome = p.match(left, collected)
|
|
||||||
if matched:
|
|
||||||
outcomes.append(outcome)
|
|
||||||
if outcomes:
|
|
||||||
return min(outcomes, key=lambda outcome: len(outcome[1]))
|
|
||||||
return False, left, collected
|
|
||||||
|
|
||||||
|
|
||||||
class TokenStream(list):
|
|
||||||
|
|
||||||
def __init__(self, source, error):
|
|
||||||
self += source.split() if hasattr(source, 'split') else source
|
|
||||||
self.error = error
|
|
||||||
|
|
||||||
def move(self):
|
|
||||||
return self.pop(0) if len(self) else None
|
|
||||||
|
|
||||||
def current(self):
|
|
||||||
return self[0] if len(self) else None
|
|
||||||
|
|
||||||
|
|
||||||
def parse_long(tokens, options):
|
|
||||||
"""long ::= '--' chars [ ( ' ' | '=' ) chars ] ;"""
|
|
||||||
long, eq, value = tokens.move().partition('=')
|
|
||||||
assert long.startswith('--')
|
|
||||||
value = None if eq == value == '' else value
|
|
||||||
similar = [o for o in options if o.long == long]
|
|
||||||
if tokens.error is DocoptExit and similar == []: # if no exact match
|
|
||||||
similar = [o for o in options if o.long and o.long.startswith(long)]
|
|
||||||
if len(similar) > 1: # might be simply specified ambiguously 2+ times?
|
|
||||||
raise tokens.error('%s is not a unique prefix: %s?' %
|
|
||||||
(long, ', '.join(o.long for o in similar)))
|
|
||||||
elif len(similar) < 1:
|
|
||||||
argcount = 1 if eq == '=' else 0
|
|
||||||
o = Option(None, long, argcount)
|
|
||||||
options.append(o)
|
|
||||||
if tokens.error is DocoptExit:
|
|
||||||
o = Option(None, long, argcount, value if argcount else True)
|
|
||||||
else:
|
|
||||||
o = Option(similar[0].short, similar[0].long,
|
|
||||||
similar[0].argcount, similar[0].value)
|
|
||||||
if o.argcount == 0:
|
|
||||||
if value is not None:
|
|
||||||
raise tokens.error('%s must not have an argument' % o.long)
|
|
||||||
else:
|
|
||||||
if value is None:
|
|
||||||
if tokens.current() is None:
|
|
||||||
raise tokens.error('%s requires argument' % o.long)
|
|
||||||
value = tokens.move()
|
|
||||||
if tokens.error is DocoptExit:
|
|
||||||
o.value = value if value is not None else True
|
|
||||||
return [o]
|
|
||||||
|
|
||||||
|
|
||||||
def parse_shorts(tokens, options):
|
|
||||||
"""shorts ::= '-' ( chars )* [ [ ' ' ] chars ] ;"""
|
|
||||||
token = tokens.move()
|
|
||||||
assert token.startswith('-') and not token.startswith('--')
|
|
||||||
left = token.lstrip('-')
|
|
||||||
parsed = []
|
|
||||||
while left != '':
|
|
||||||
short, left = '-' + left[0], left[1:]
|
|
||||||
similar = [o for o in options if o.short == short]
|
|
||||||
if len(similar) > 1:
|
|
||||||
raise tokens.error('%s is specified ambiguously %d times' %
|
|
||||||
(short, len(similar)))
|
|
||||||
elif len(similar) < 1:
|
|
||||||
o = Option(short, None, 0)
|
|
||||||
options.append(o)
|
|
||||||
if tokens.error is DocoptExit:
|
|
||||||
o = Option(short, None, 0, True)
|
|
||||||
else: # why copying is necessary here?
|
|
||||||
o = Option(short, similar[0].long,
|
|
||||||
similar[0].argcount, similar[0].value)
|
|
||||||
value = None
|
|
||||||
if o.argcount != 0:
|
|
||||||
if left == '':
|
|
||||||
if tokens.current() is None:
|
|
||||||
raise tokens.error('%s requires argument' % short)
|
|
||||||
value = tokens.move()
|
|
||||||
else:
|
|
||||||
value = left
|
|
||||||
left = ''
|
|
||||||
if tokens.error is DocoptExit:
|
|
||||||
o.value = value if value is not None else True
|
|
||||||
parsed.append(o)
|
|
||||||
return parsed
|
|
||||||
|
|
||||||
|
|
||||||
def parse_pattern(source, options):
|
|
||||||
tokens = TokenStream(re.sub(r'([\[\]\(\)\|]|\.\.\.)', r' \1 ', source),
|
|
||||||
DocoptLanguageError)
|
|
||||||
result = parse_expr(tokens, options)
|
|
||||||
if tokens.current() is not None:
|
|
||||||
raise tokens.error('unexpected ending: %r' % ' '.join(tokens))
|
|
||||||
return Required(*result)
|
|
||||||
|
|
||||||
|
|
||||||
def parse_expr(tokens, options):
|
|
||||||
"""expr ::= seq ( '|' seq )* ;"""
|
|
||||||
seq = parse_seq(tokens, options)
|
|
||||||
if tokens.current() != '|':
|
|
||||||
return seq
|
|
||||||
result = [Required(*seq)] if len(seq) > 1 else seq
|
|
||||||
while tokens.current() == '|':
|
|
||||||
tokens.move()
|
|
||||||
seq = parse_seq(tokens, options)
|
|
||||||
result += [Required(*seq)] if len(seq) > 1 else seq
|
|
||||||
return [Either(*result)] if len(result) > 1 else result
|
|
||||||
|
|
||||||
|
|
||||||
def parse_seq(tokens, options):
|
|
||||||
"""seq ::= ( atom [ '...' ] )* ;"""
|
|
||||||
result = []
|
|
||||||
while tokens.current() not in [None, ']', ')', '|']:
|
|
||||||
atom = parse_atom(tokens, options)
|
|
||||||
if tokens.current() == '...':
|
|
||||||
atom = [OneOrMore(*atom)]
|
|
||||||
tokens.move()
|
|
||||||
result += atom
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
def parse_atom(tokens, options):
|
|
||||||
"""atom ::= '(' expr ')' | '[' expr ']' | 'options'
|
|
||||||
| long | shorts | argument | command ;
|
|
||||||
"""
|
|
||||||
token = tokens.current()
|
|
||||||
result = []
|
|
||||||
if token in '([':
|
|
||||||
tokens.move()
|
|
||||||
matching, pattern = {'(': [')', Required], '[': [']', Optional]}[token]
|
|
||||||
result = pattern(*parse_expr(tokens, options))
|
|
||||||
if tokens.move() != matching:
|
|
||||||
raise tokens.error("unmatched '%s'" % token)
|
|
||||||
return [result]
|
|
||||||
elif token == 'options':
|
|
||||||
tokens.move()
|
|
||||||
return [AnyOptions()]
|
|
||||||
elif token.startswith('--') and token != '--':
|
|
||||||
return parse_long(tokens, options)
|
|
||||||
elif token.startswith('-') and token not in ('-', '--'):
|
|
||||||
return parse_shorts(tokens, options)
|
|
||||||
elif token.startswith('<') and token.endswith('>') or token.isupper():
|
|
||||||
return [Argument(tokens.move())]
|
|
||||||
else:
|
|
||||||
return [Command(tokens.move())]
|
|
||||||
|
|
||||||
|
|
||||||
def parse_argv(tokens, options, options_first=False):
|
|
||||||
"""Parse command-line argument vector.
|
|
||||||
|
|
||||||
If options_first:
|
|
||||||
argv ::= [ long | shorts ]* [ argument ]* [ '--' [ argument ]* ] ;
|
|
||||||
else:
|
|
||||||
argv ::= [ long | shorts | argument ]* [ '--' [ argument ]* ] ;
|
|
||||||
|
|
||||||
"""
|
|
||||||
parsed = []
|
|
||||||
while tokens.current() is not None:
|
|
||||||
if tokens.current() == '--':
|
|
||||||
return parsed + [Argument(None, v) for v in tokens]
|
|
||||||
elif tokens.current().startswith('--'):
|
|
||||||
parsed += parse_long(tokens, options)
|
|
||||||
elif tokens.current().startswith('-') and tokens.current() != '-':
|
|
||||||
parsed += parse_shorts(tokens, options)
|
|
||||||
elif options_first:
|
|
||||||
return parsed + [Argument(None, v) for v in tokens]
|
|
||||||
else:
|
|
||||||
parsed.append(Argument(None, tokens.move()))
|
|
||||||
return parsed
|
|
||||||
|
|
||||||
|
|
||||||
def parse_defaults(doc):
|
|
||||||
# in python < 2.7 you can't pass flags=re.MULTILINE
|
|
||||||
split = re.split('\n *(<\S+?>|-\S+?)', doc)[1:]
|
|
||||||
split = [s1 + s2 for s1, s2 in zip(split[::2], split[1::2])]
|
|
||||||
options = [Option.parse(s) for s in split if s.startswith('-')]
|
|
||||||
#arguments = [Argument.parse(s) for s in split if s.startswith('<')]
|
|
||||||
#return options, arguments
|
|
||||||
return options
|
|
||||||
|
|
||||||
|
|
||||||
def printable_usage(doc):
|
|
||||||
# in python < 2.7 you can't pass flags=re.IGNORECASE
|
|
||||||
usage_split = re.split(r'([Uu][Ss][Aa][Gg][Ee]:)', doc)
|
|
||||||
if len(usage_split) < 3:
|
|
||||||
raise DocoptLanguageError('"usage:" (case-insensitive) not found.')
|
|
||||||
if len(usage_split) > 3:
|
|
||||||
raise DocoptLanguageError('More than one "usage:" (case-insensitive).')
|
|
||||||
return re.split(r'\n\s*\n', ''.join(usage_split[1:]))[0].strip()
|
|
||||||
|
|
||||||
|
|
||||||
def formal_usage(printable_usage):
|
|
||||||
pu = printable_usage.split()[1:] # split and drop "usage:"
|
|
||||||
return '( ' + ' '.join(') | (' if s == pu[0] else s for s in pu[1:]) + ' )'
|
|
||||||
|
|
||||||
|
|
||||||
def extras(help, version, options, doc):
|
|
||||||
if help and any((o.name in ('-h', '--help')) and o.value for o in options):
|
|
||||||
print(doc.strip("\n"))
|
|
||||||
sys.exit()
|
|
||||||
if version and any(o.name == '--version' and o.value for o in options):
|
|
||||||
print(version)
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
|
|
||||||
class Dict(dict):
|
|
||||||
def __repr__(self):
|
|
||||||
return '{%s}' % ',\n '.join('%r: %r' % i for i in sorted(self.items()))
|
|
||||||
|
|
||||||
|
|
||||||
def docopt(doc, argv=None, help=True, version=None, options_first=False):
|
|
||||||
"""Parse `argv` based on command-line interface described in `doc`.
|
|
||||||
|
|
||||||
`docopt` creates your command-line interface based on its
|
|
||||||
description that you pass as `doc`. Such description can contain
|
|
||||||
--options, <positional-argument>, commands, which could be
|
|
||||||
[optional], (required), (mutually | exclusive) or repeated...
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
doc : str
|
|
||||||
Description of your command-line interface.
|
|
||||||
argv : list of str, optional
|
|
||||||
Argument vector to be parsed. sys.argv[1:] is used if not
|
|
||||||
provided.
|
|
||||||
help : bool (default: True)
|
|
||||||
Set to False to disable automatic help on -h or --help
|
|
||||||
options.
|
|
||||||
version : any object
|
|
||||||
If passed, the object will be printed if --version is in
|
|
||||||
`argv`.
|
|
||||||
options_first : bool (default: False)
|
|
||||||
Set to True to require options preceed positional arguments,
|
|
||||||
i.e. to forbid options and positional arguments intermix.
|
|
||||||
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
args : dict
|
|
||||||
A dictionary, where keys are names of command-line elements
|
|
||||||
such as e.g. "--verbose" and "<path>", and values are the
|
|
||||||
parsed values of those elements.
|
|
||||||
|
|
||||||
Example
|
|
||||||
-------
|
|
||||||
>>> from docopt import docopt
|
|
||||||
>>> doc = '''
|
|
||||||
Usage:
|
|
||||||
my_program tcp <host> <port> [--timeout=<seconds>]
|
|
||||||
my_program serial <port> [--baud=<n>] [--timeout=<seconds>]
|
|
||||||
my_program (-h | --help | --version)
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-h, --help Show this screen and exit.
|
|
||||||
--baud=<n> Baudrate [default: 9600]
|
|
||||||
'''
|
|
||||||
>>> argv = ['tcp', '127.0.0.1', '80', '--timeout', '30']
|
|
||||||
>>> docopt(doc, argv)
|
|
||||||
{'--baud': '9600',
|
|
||||||
'--help': False,
|
|
||||||
'--timeout': '30',
|
|
||||||
'--version': False,
|
|
||||||
'<host>': '127.0.0.1',
|
|
||||||
'<port>': '80',
|
|
||||||
'serial': False,
|
|
||||||
'tcp': True}
|
|
||||||
|
|
||||||
See also
|
|
||||||
--------
|
|
||||||
* For video introduction see http://docopt.org
|
|
||||||
* Full documentation is available in README.rst as well as online
|
|
||||||
at https://github.com/docopt/docopt#readme
|
|
||||||
|
|
||||||
"""
|
|
||||||
if argv is None:
|
|
||||||
argv = sys.argv[1:]
|
|
||||||
DocoptExit.usage = printable_usage(doc)
|
|
||||||
options = parse_defaults(doc)
|
|
||||||
pattern = parse_pattern(formal_usage(DocoptExit.usage), options)
|
|
||||||
# [default] syntax for argument is disabled
|
|
||||||
#for a in pattern.flat(Argument):
|
|
||||||
# same_name = [d for d in arguments if d.name == a.name]
|
|
||||||
# if same_name:
|
|
||||||
# a.value = same_name[0].value
|
|
||||||
argv = parse_argv(TokenStream(argv, DocoptExit), list(options),
|
|
||||||
options_first)
|
|
||||||
pattern_options = set(pattern.flat(Option))
|
|
||||||
for ao in pattern.flat(AnyOptions):
|
|
||||||
doc_options = parse_defaults(doc)
|
|
||||||
ao.children = list(set(doc_options) - pattern_options)
|
|
||||||
#if any_options:
|
|
||||||
# ao.children += [Option(o.short, o.long, o.argcount)
|
|
||||||
# for o in argv if type(o) is Option]
|
|
||||||
extras(help, version, argv, doc)
|
|
||||||
matched, left, collected = pattern.fix().match(argv)
|
|
||||||
if matched and left == []: # better error message if left?
|
|
||||||
return Dict((a.name, a.value) for a in (pattern.flat() + collected))
|
|
||||||
raise DocoptExit()
|
|
@ -1,617 +0,0 @@
|
|||||||
integer EADDRINUSE
|
|
||||||
integer EADDRNOTAVAIL
|
|
||||||
integer EAFNOSUPPORT
|
|
||||||
integer ECONNABORTED
|
|
||||||
integer ECONNREFUSED
|
|
||||||
integer ECONNRESET
|
|
||||||
integer EFSM
|
|
||||||
integer EHOSTUNREACH
|
|
||||||
integer EINPROGRESS
|
|
||||||
integer EMSGSIZE
|
|
||||||
integer EMTHREAD
|
|
||||||
integer ENETDOWN
|
|
||||||
integer ENETRESET
|
|
||||||
integer ENETUNREACH
|
|
||||||
integer ENOBUFS
|
|
||||||
integer ENOCOMPATPROTO
|
|
||||||
integer ENOTCONN
|
|
||||||
integer ENOTSOCK
|
|
||||||
integer ENOTSUP
|
|
||||||
integer EPROTONOSUPPORT
|
|
||||||
integer ETERM
|
|
||||||
integer ETIMEDOUT
|
|
||||||
integer ZMQ_AFFINITY
|
|
||||||
integer ZMQ_BACKLOG
|
|
||||||
integer ZMQ_BINDTODEVICE
|
|
||||||
integer ZMQ_BLOCKY
|
|
||||||
integer ZMQ_CHANNEL
|
|
||||||
integer ZMQ_CLIENT
|
|
||||||
integer ZMQ_CONFLATE
|
|
||||||
integer ZMQ_CONNECT_RID
|
|
||||||
integer ZMQ_CONNECT_ROUTING_ID
|
|
||||||
integer ZMQ_CONNECT_TIMEOUT
|
|
||||||
integer ZMQ_CURRENT_EVENT_VERSION
|
|
||||||
integer ZMQ_CURRENT_EVENT_VERSION_DRAFT
|
|
||||||
integer ZMQ_CURVE
|
|
||||||
integer ZMQ_CURVE_PUBLICKEY
|
|
||||||
integer ZMQ_CURVE_SECRETKEY
|
|
||||||
integer ZMQ_CURVE_SERVER
|
|
||||||
integer ZMQ_CURVE_SERVERKEY
|
|
||||||
integer ZMQ_DEALER
|
|
||||||
integer ZMQ_DEFINED_STDINT
|
|
||||||
integer ZMQ_DELAY_ATTACH_ON_CONNECT
|
|
||||||
integer ZMQ_DGRAM
|
|
||||||
integer ZMQ_DISCONNECT_MSG
|
|
||||||
integer ZMQ_DISH
|
|
||||||
integer ZMQ_DONTWAIT
|
|
||||||
integer ZMQ_EVENTS
|
|
||||||
integer ZMQ_EVENT_ACCEPTED
|
|
||||||
integer ZMQ_EVENT_ACCEPT_FAILED
|
|
||||||
integer ZMQ_EVENT_ALL
|
|
||||||
integer ZMQ_EVENT_ALL_V1
|
|
||||||
integer ZMQ_EVENT_ALL_V2
|
|
||||||
integer ZMQ_EVENT_BIND_FAILED
|
|
||||||
integer ZMQ_EVENT_CLOSED
|
|
||||||
integer ZMQ_EVENT_CLOSE_FAILED
|
|
||||||
integer ZMQ_EVENT_CONNECTED
|
|
||||||
integer ZMQ_EVENT_CONNECT_DELAYED
|
|
||||||
integer ZMQ_EVENT_CONNECT_RETRIED
|
|
||||||
integer ZMQ_EVENT_DISCONNECTED
|
|
||||||
integer ZMQ_EVENT_HANDSHAKE_FAILED_AUTH
|
|
||||||
integer ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL
|
|
||||||
integer ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL
|
|
||||||
integer ZMQ_EVENT_HANDSHAKE_SUCCEEDED
|
|
||||||
integer ZMQ_EVENT_LISTENING
|
|
||||||
integer ZMQ_EVENT_MONITOR_STOPPED
|
|
||||||
integer ZMQ_EVENT_PIPES_STATS
|
|
||||||
integer ZMQ_FAIL_UNROUTABLE
|
|
||||||
integer ZMQ_FD
|
|
||||||
integer ZMQ_FORWARDER
|
|
||||||
integer ZMQ_GATHER
|
|
||||||
integer ZMQ_GROUP_MAX_LENGTH
|
|
||||||
integer ZMQ_GSSAPI
|
|
||||||
integer ZMQ_GSSAPI_NT_HOSTBASED
|
|
||||||
integer ZMQ_GSSAPI_NT_KRB5_PRINCIPAL
|
|
||||||
integer ZMQ_GSSAPI_NT_USER_NAME
|
|
||||||
integer ZMQ_GSSAPI_PLAINTEXT
|
|
||||||
integer ZMQ_GSSAPI_PRINCIPAL
|
|
||||||
integer ZMQ_GSSAPI_PRINCIPAL_NAMETYPE
|
|
||||||
integer ZMQ_GSSAPI_SERVER
|
|
||||||
integer ZMQ_GSSAPI_SERVICE_PRINCIPAL
|
|
||||||
integer ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE
|
|
||||||
integer ZMQ_HANDSHAKE_IVL
|
|
||||||
integer ZMQ_HAS_CAPABILITIES
|
|
||||||
integer ZMQ_HAUSNUMERO
|
|
||||||
integer ZMQ_HEARTBEAT_IVL
|
|
||||||
integer ZMQ_HEARTBEAT_TIMEOUT
|
|
||||||
integer ZMQ_HEARTBEAT_TTL
|
|
||||||
integer ZMQ_HELLO_MSG
|
|
||||||
integer ZMQ_IDENTITY
|
|
||||||
integer ZMQ_IMMEDIATE
|
|
||||||
integer ZMQ_INVERT_MATCHING
|
|
||||||
integer ZMQ_IN_BATCH_SIZE
|
|
||||||
integer ZMQ_IO_THREADS
|
|
||||||
integer ZMQ_IO_THREADS_DFLT
|
|
||||||
integer ZMQ_IPC_FILTER_GID
|
|
||||||
integer ZMQ_IPC_FILTER_PID
|
|
||||||
integer ZMQ_IPC_FILTER_UID
|
|
||||||
integer ZMQ_IPV4ONLY
|
|
||||||
integer ZMQ_IPV6
|
|
||||||
integer ZMQ_LAST_ENDPOINT
|
|
||||||
integer ZMQ_LINGER
|
|
||||||
integer ZMQ_LOOPBACK_FASTPATH
|
|
||||||
integer ZMQ_MAXMSGSIZE
|
|
||||||
integer ZMQ_MAX_MSGSZ
|
|
||||||
integer ZMQ_MAX_SOCKETS
|
|
||||||
integer ZMQ_MAX_SOCKETS_DFLT
|
|
||||||
integer ZMQ_MECHANISM
|
|
||||||
integer ZMQ_METADATA
|
|
||||||
integer ZMQ_MORE
|
|
||||||
integer ZMQ_MSG_T_SIZE
|
|
||||||
integer ZMQ_MULTICAST_HOPS
|
|
||||||
integer ZMQ_MULTICAST_LOOP
|
|
||||||
integer ZMQ_MULTICAST_MAXTPDU
|
|
||||||
integer ZMQ_NOBLOCK
|
|
||||||
integer ZMQ_NOTIFY_CONNECT
|
|
||||||
integer ZMQ_NOTIFY_DISCONNECT
|
|
||||||
integer ZMQ_NULL
|
|
||||||
integer ZMQ_ONLY_FIRST_SUBSCRIBE
|
|
||||||
integer ZMQ_OUT_BATCH_SIZE
|
|
||||||
integer ZMQ_PAIR
|
|
||||||
integer ZMQ_PEER
|
|
||||||
integer ZMQ_PLAIN
|
|
||||||
integer ZMQ_PLAIN_PASSWORD
|
|
||||||
integer ZMQ_PLAIN_SERVER
|
|
||||||
integer ZMQ_PLAIN_USERNAME
|
|
||||||
integer ZMQ_POLLERR
|
|
||||||
integer ZMQ_POLLIN
|
|
||||||
integer ZMQ_POLLITEMS_DFLT
|
|
||||||
integer ZMQ_POLLOUT
|
|
||||||
integer ZMQ_POLLPRI
|
|
||||||
integer ZMQ_PRIORITY
|
|
||||||
integer ZMQ_PROBE_ROUTER
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_WS_UNSPECIFIED
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND
|
|
||||||
integer ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED
|
|
||||||
integer ZMQ_PTR
|
|
||||||
integer ZMQ_PUB
|
|
||||||
integer ZMQ_PULL
|
|
||||||
integer ZMQ_PUSH
|
|
||||||
integer ZMQ_QUEUE
|
|
||||||
integer ZMQ_RADIO
|
|
||||||
integer ZMQ_RATE
|
|
||||||
integer ZMQ_RCVBUF
|
|
||||||
integer ZMQ_RCVHWM
|
|
||||||
integer ZMQ_RCVMORE
|
|
||||||
integer ZMQ_RCVTIMEO
|
|
||||||
integer ZMQ_RECONNECT_IVL
|
|
||||||
integer ZMQ_RECONNECT_IVL_MAX
|
|
||||||
integer ZMQ_RECONNECT_STOP
|
|
||||||
integer ZMQ_RECONNECT_STOP_AFTER_DISCONNECT
|
|
||||||
integer ZMQ_RECONNECT_STOP_CONN_REFUSED
|
|
||||||
integer ZMQ_RECONNECT_STOP_HANDSHAKE_FAILED
|
|
||||||
integer ZMQ_RECOVERY_IVL
|
|
||||||
integer ZMQ_REP
|
|
||||||
integer ZMQ_REQ
|
|
||||||
integer ZMQ_REQ_CORRELATE
|
|
||||||
integer ZMQ_REQ_RELAXED
|
|
||||||
integer ZMQ_ROUTER
|
|
||||||
integer ZMQ_ROUTER_BEHAVIOR
|
|
||||||
integer ZMQ_ROUTER_HANDOVER
|
|
||||||
integer ZMQ_ROUTER_MANDATORY
|
|
||||||
integer ZMQ_ROUTER_NOTIFY
|
|
||||||
integer ZMQ_ROUTER_RAW
|
|
||||||
integer ZMQ_ROUTING_ID
|
|
||||||
integer ZMQ_SCATTER
|
|
||||||
integer ZMQ_SERVER
|
|
||||||
integer ZMQ_SHARED
|
|
||||||
integer ZMQ_SNDBUF
|
|
||||||
integer ZMQ_SNDHWM
|
|
||||||
integer ZMQ_SNDMORE
|
|
||||||
integer ZMQ_SNDTIMEO
|
|
||||||
integer ZMQ_SOCKET_LIMIT
|
|
||||||
integer ZMQ_SOCKS_PASSWORD
|
|
||||||
integer ZMQ_SOCKS_PROXY
|
|
||||||
integer ZMQ_SOCKS_USERNAME
|
|
||||||
integer ZMQ_SRCFD
|
|
||||||
integer ZMQ_STREAM
|
|
||||||
integer ZMQ_STREAMER
|
|
||||||
integer ZMQ_STREAM_NOTIFY
|
|
||||||
integer ZMQ_SUB
|
|
||||||
integer ZMQ_SUBSCRIBE
|
|
||||||
integer ZMQ_TCP_ACCEPT_FILTER
|
|
||||||
integer ZMQ_TCP_KEEPALIVE
|
|
||||||
integer ZMQ_TCP_KEEPALIVE_CNT
|
|
||||||
integer ZMQ_TCP_KEEPALIVE_IDLE
|
|
||||||
integer ZMQ_TCP_KEEPALIVE_INTVL
|
|
||||||
integer ZMQ_TCP_MAXRT
|
|
||||||
integer ZMQ_THREAD_AFFINITY_CPU_ADD
|
|
||||||
integer ZMQ_THREAD_AFFINITY_CPU_REMOVE
|
|
||||||
integer ZMQ_THREAD_NAME_PREFIX
|
|
||||||
integer ZMQ_THREAD_PRIORITY
|
|
||||||
integer ZMQ_THREAD_PRIORITY_DFLT
|
|
||||||
integer ZMQ_THREAD_SAFE
|
|
||||||
integer ZMQ_THREAD_SCHED_POLICY
|
|
||||||
integer ZMQ_THREAD_SCHED_POLICY_DFLT
|
|
||||||
integer ZMQ_TOS
|
|
||||||
integer ZMQ_TYPE
|
|
||||||
integer ZMQ_UNSUBSCRIBE
|
|
||||||
integer ZMQ_USE_FD
|
|
||||||
integer ZMQ_VERSION
|
|
||||||
integer ZMQ_VERSION_MAJOR
|
|
||||||
integer ZMQ_VERSION_MINOR
|
|
||||||
integer ZMQ_VERSION_PATCH
|
|
||||||
integer ZMQ_VMCI_BUFFER_MAX_SIZE
|
|
||||||
integer ZMQ_VMCI_BUFFER_MIN_SIZE
|
|
||||||
integer ZMQ_VMCI_BUFFER_SIZE
|
|
||||||
integer ZMQ_VMCI_CONNECT_TIMEOUT
|
|
||||||
integer ZMQ_WSS_CERT_PEM
|
|
||||||
integer ZMQ_WSS_HOSTNAME
|
|
||||||
integer ZMQ_WSS_KEY_PEM
|
|
||||||
integer ZMQ_WSS_TRUST_PEM
|
|
||||||
integer ZMQ_WSS_TRUST_SYSTEM
|
|
||||||
integer ZMQ_XPUB
|
|
||||||
integer ZMQ_XPUB_MANUAL
|
|
||||||
integer ZMQ_XPUB_MANUAL_LAST_VALUE
|
|
||||||
integer ZMQ_XPUB_NODROP
|
|
||||||
integer ZMQ_XPUB_VERBOSE
|
|
||||||
integer ZMQ_XPUB_VERBOSER
|
|
||||||
integer ZMQ_XPUB_WELCOME_MSG
|
|
||||||
integer ZMQ_XREP
|
|
||||||
integer ZMQ_XREQ
|
|
||||||
integer ZMQ_XSUB
|
|
||||||
integer ZMQ_ZAP_DOMAIN
|
|
||||||
integer ZMQ_ZAP_ENFORCE_DOMAIN
|
|
||||||
integer ZMQ_ZERO_COPY_RECV
|
|
||||||
parameter(EADDRINUSE=156384717)
|
|
||||||
parameter(EADDRNOTAVAIL=156384718)
|
|
||||||
parameter(EAFNOSUPPORT=156384723)
|
|
||||||
parameter(ECONNABORTED=156384725)
|
|
||||||
parameter(ECONNREFUSED=156384719)
|
|
||||||
parameter(ECONNRESET=156384726)
|
|
||||||
parameter(EFSM=156384763)
|
|
||||||
parameter(EHOSTUNREACH=156384729)
|
|
||||||
parameter(EINPROGRESS=156384720)
|
|
||||||
parameter(EMSGSIZE=156384722)
|
|
||||||
parameter(EMTHREAD=156384766)
|
|
||||||
parameter(ENETDOWN=156384716)
|
|
||||||
parameter(ENETRESET=156384730)
|
|
||||||
parameter(ENETUNREACH=156384724)
|
|
||||||
parameter(ENOBUFS=156384715)
|
|
||||||
parameter(ENOCOMPATPROTO=156384764)
|
|
||||||
parameter(ENOTCONN=156384727)
|
|
||||||
parameter(ENOTSOCK=156384721)
|
|
||||||
parameter(ENOTSUP=156384713)
|
|
||||||
parameter(EPROTONOSUPPORT=156384714)
|
|
||||||
parameter(ETERM=156384765)
|
|
||||||
parameter(ETIMEDOUT=156384728)
|
|
||||||
parameter(ZMQ_AFFINITY=4)
|
|
||||||
parameter(ZMQ_BACKLOG=19)
|
|
||||||
parameter(ZMQ_BINDTODEVICE=92)
|
|
||||||
parameter(ZMQ_BLOCKY=70)
|
|
||||||
parameter(ZMQ_CHANNEL=20)
|
|
||||||
parameter(ZMQ_CLIENT=13)
|
|
||||||
parameter(ZMQ_CONFLATE=54)
|
|
||||||
parameter(ZMQ_CONNECT_RID=61)
|
|
||||||
parameter(ZMQ_CONNECT_ROUTING_ID=61)
|
|
||||||
parameter(ZMQ_CONNECT_TIMEOUT=79)
|
|
||||||
parameter(ZMQ_CURRENT_EVENT_VERSION=1)
|
|
||||||
parameter(ZMQ_CURRENT_EVENT_VERSION_DRAFT=2)
|
|
||||||
parameter(ZMQ_CURVE=2)
|
|
||||||
parameter(ZMQ_CURVE_PUBLICKEY=48)
|
|
||||||
parameter(ZMQ_CURVE_SECRETKEY=49)
|
|
||||||
parameter(ZMQ_CURVE_SERVER=47)
|
|
||||||
parameter(ZMQ_CURVE_SERVERKEY=50)
|
|
||||||
parameter(ZMQ_DEALER=5)
|
|
||||||
parameter(ZMQ_DEFINED_STDINT=1)
|
|
||||||
parameter(ZMQ_DELAY_ATTACH_ON_CONNECT=39)
|
|
||||||
parameter(ZMQ_DGRAM=18)
|
|
||||||
parameter(ZMQ_DISCONNECT_MSG=111)
|
|
||||||
parameter(ZMQ_DISH=15)
|
|
||||||
parameter(ZMQ_DONTWAIT=1)
|
|
||||||
parameter(ZMQ_EVENTS=15)
|
|
||||||
parameter(ZMQ_EVENT_ACCEPTED=32)
|
|
||||||
parameter(ZMQ_EVENT_ACCEPT_FAILED=64)
|
|
||||||
parameter(ZMQ_EVENT_ALL=65535)
|
|
||||||
parameter(ZMQ_EVENT_ALL_V1=65535)
|
|
||||||
parameter(ZMQ_EVENT_ALL_V2=131071)
|
|
||||||
parameter(ZMQ_EVENT_BIND_FAILED=16)
|
|
||||||
parameter(ZMQ_EVENT_CLOSED=128)
|
|
||||||
parameter(ZMQ_EVENT_CLOSE_FAILED=256)
|
|
||||||
parameter(ZMQ_EVENT_CONNECTED=1)
|
|
||||||
parameter(ZMQ_EVENT_CONNECT_DELAYED=2)
|
|
||||||
parameter(ZMQ_EVENT_CONNECT_RETRIED=4)
|
|
||||||
parameter(ZMQ_EVENT_DISCONNECTED=512)
|
|
||||||
parameter(ZMQ_EVENT_HANDSHAKE_FAILED_AUTH=16384)
|
|
||||||
parameter(ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL=2048)
|
|
||||||
parameter(ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL=8192)
|
|
||||||
parameter(ZMQ_EVENT_HANDSHAKE_SUCCEEDED=4096)
|
|
||||||
parameter(ZMQ_EVENT_LISTENING=8)
|
|
||||||
parameter(ZMQ_EVENT_MONITOR_STOPPED=1024)
|
|
||||||
parameter(ZMQ_EVENT_PIPES_STATS=65536)
|
|
||||||
parameter(ZMQ_FAIL_UNROUTABLE=33)
|
|
||||||
parameter(ZMQ_FD=14)
|
|
||||||
parameter(ZMQ_FORWARDER=2)
|
|
||||||
parameter(ZMQ_GATHER=16)
|
|
||||||
parameter(ZMQ_GROUP_MAX_LENGTH=255)
|
|
||||||
parameter(ZMQ_GSSAPI=3)
|
|
||||||
parameter(ZMQ_GSSAPI_NT_HOSTBASED=0)
|
|
||||||
parameter(ZMQ_GSSAPI_NT_KRB5_PRINCIPAL=2)
|
|
||||||
parameter(ZMQ_GSSAPI_NT_USER_NAME=1)
|
|
||||||
parameter(ZMQ_GSSAPI_PLAINTEXT=65)
|
|
||||||
parameter(ZMQ_GSSAPI_PRINCIPAL=63)
|
|
||||||
parameter(ZMQ_GSSAPI_PRINCIPAL_NAMETYPE=90)
|
|
||||||
parameter(ZMQ_GSSAPI_SERVER=62)
|
|
||||||
parameter(ZMQ_GSSAPI_SERVICE_PRINCIPAL=64)
|
|
||||||
parameter(ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE=91)
|
|
||||||
parameter(ZMQ_HANDSHAKE_IVL=66)
|
|
||||||
parameter(ZMQ_HAS_CAPABILITIES=1)
|
|
||||||
parameter(ZMQ_HAUSNUMERO=156384712)
|
|
||||||
parameter(ZMQ_HEARTBEAT_IVL=75)
|
|
||||||
parameter(ZMQ_HEARTBEAT_TIMEOUT=77)
|
|
||||||
parameter(ZMQ_HEARTBEAT_TTL=76)
|
|
||||||
parameter(ZMQ_HELLO_MSG=110)
|
|
||||||
parameter(ZMQ_IDENTITY=5)
|
|
||||||
parameter(ZMQ_IMMEDIATE=39)
|
|
||||||
parameter(ZMQ_INVERT_MATCHING=74)
|
|
||||||
parameter(ZMQ_IN_BATCH_SIZE=101)
|
|
||||||
parameter(ZMQ_IO_THREADS=1)
|
|
||||||
parameter(ZMQ_IO_THREADS_DFLT=1)
|
|
||||||
parameter(ZMQ_IPC_FILTER_GID=60)
|
|
||||||
parameter(ZMQ_IPC_FILTER_PID=58)
|
|
||||||
parameter(ZMQ_IPC_FILTER_UID=59)
|
|
||||||
parameter(ZMQ_IPV4ONLY=31)
|
|
||||||
parameter(ZMQ_IPV6=42)
|
|
||||||
parameter(ZMQ_LAST_ENDPOINT=32)
|
|
||||||
parameter(ZMQ_LINGER=17)
|
|
||||||
parameter(ZMQ_LOOPBACK_FASTPATH=94)
|
|
||||||
parameter(ZMQ_MAXMSGSIZE=22)
|
|
||||||
parameter(ZMQ_MAX_MSGSZ=5)
|
|
||||||
parameter(ZMQ_MAX_SOCKETS=2)
|
|
||||||
parameter(ZMQ_MAX_SOCKETS_DFLT=1023)
|
|
||||||
parameter(ZMQ_MECHANISM=43)
|
|
||||||
parameter(ZMQ_METADATA=95)
|
|
||||||
parameter(ZMQ_MORE=1)
|
|
||||||
parameter(ZMQ_MSG_T_SIZE=6)
|
|
||||||
parameter(ZMQ_MULTICAST_HOPS=25)
|
|
||||||
parameter(ZMQ_MULTICAST_LOOP=96)
|
|
||||||
parameter(ZMQ_MULTICAST_MAXTPDU=84)
|
|
||||||
parameter(ZMQ_NOBLOCK=1)
|
|
||||||
parameter(ZMQ_NOTIFY_CONNECT=1)
|
|
||||||
parameter(ZMQ_NOTIFY_DISCONNECT=2)
|
|
||||||
parameter(ZMQ_NULL=0)
|
|
||||||
parameter(ZMQ_ONLY_FIRST_SUBSCRIBE=108)
|
|
||||||
parameter(ZMQ_OUT_BATCH_SIZE=102)
|
|
||||||
parameter(ZMQ_PAIR=0)
|
|
||||||
parameter(ZMQ_PEER=19)
|
|
||||||
parameter(ZMQ_PLAIN=1)
|
|
||||||
parameter(ZMQ_PLAIN_PASSWORD=46)
|
|
||||||
parameter(ZMQ_PLAIN_SERVER=44)
|
|
||||||
parameter(ZMQ_PLAIN_USERNAME=45)
|
|
||||||
parameter(ZMQ_POLLERR=4)
|
|
||||||
parameter(ZMQ_POLLIN=1)
|
|
||||||
parameter(ZMQ_POLLITEMS_DFLT=16)
|
|
||||||
parameter(ZMQ_POLLOUT=2)
|
|
||||||
parameter(ZMQ_POLLPRI=8)
|
|
||||||
parameter(ZMQ_PRIORITY=112)
|
|
||||||
parameter(ZMQ_PROBE_ROUTER=51)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_WS_UNSPECIFIED=805306368)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID=536870914)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION=536870915)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA=536870917)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE=536870916)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY=536870913)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED=536870912)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC=285212673)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA=268435480)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE=268435458)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE=268435459)
|
|
||||||
parameter(
|
|
||||||
& ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR=268435477)
|
|
||||||
parameter(
|
|
||||||
& ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO=268435475)
|
|
||||||
parameter(
|
|
||||||
& ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE=268435476)
|
|
||||||
parameter(
|
|
||||||
& ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE=268435474)
|
|
||||||
parameter(
|
|
||||||
& ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY=268435478)
|
|
||||||
parameter(
|
|
||||||
& ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED=268435473)
|
|
||||||
parameter(
|
|
||||||
& ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME=268435479)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH=285212674)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND=268435457)
|
|
||||||
parameter(ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED=268435456)
|
|
||||||
parameter(ZMQ_PTR=8)
|
|
||||||
parameter(ZMQ_PUB=1)
|
|
||||||
parameter(ZMQ_PULL=7)
|
|
||||||
parameter(ZMQ_PUSH=8)
|
|
||||||
parameter(ZMQ_QUEUE=3)
|
|
||||||
parameter(ZMQ_RADIO=14)
|
|
||||||
parameter(ZMQ_RATE=8)
|
|
||||||
parameter(ZMQ_RCVBUF=12)
|
|
||||||
parameter(ZMQ_RCVHWM=24)
|
|
||||||
parameter(ZMQ_RCVMORE=13)
|
|
||||||
parameter(ZMQ_RCVTIMEO=27)
|
|
||||||
parameter(ZMQ_RECONNECT_IVL=18)
|
|
||||||
parameter(ZMQ_RECONNECT_IVL_MAX=21)
|
|
||||||
parameter(ZMQ_RECONNECT_STOP=109)
|
|
||||||
parameter(ZMQ_RECONNECT_STOP_AFTER_DISCONNECT=3)
|
|
||||||
parameter(ZMQ_RECONNECT_STOP_CONN_REFUSED=1)
|
|
||||||
parameter(ZMQ_RECONNECT_STOP_HANDSHAKE_FAILED=2)
|
|
||||||
parameter(ZMQ_RECOVERY_IVL=9)
|
|
||||||
parameter(ZMQ_REP=4)
|
|
||||||
parameter(ZMQ_REQ=3)
|
|
||||||
parameter(ZMQ_REQ_CORRELATE=52)
|
|
||||||
parameter(ZMQ_REQ_RELAXED=53)
|
|
||||||
parameter(ZMQ_ROUTER=6)
|
|
||||||
parameter(ZMQ_ROUTER_BEHAVIOR=33)
|
|
||||||
parameter(ZMQ_ROUTER_HANDOVER=56)
|
|
||||||
parameter(ZMQ_ROUTER_MANDATORY=33)
|
|
||||||
parameter(ZMQ_ROUTER_NOTIFY=97)
|
|
||||||
parameter(ZMQ_ROUTER_RAW=41)
|
|
||||||
parameter(ZMQ_ROUTING_ID=5)
|
|
||||||
parameter(ZMQ_SCATTER=17)
|
|
||||||
parameter(ZMQ_SERVER=12)
|
|
||||||
parameter(ZMQ_SHARED=3)
|
|
||||||
parameter(ZMQ_SNDBUF=11)
|
|
||||||
parameter(ZMQ_SNDHWM=23)
|
|
||||||
parameter(ZMQ_SNDMORE=2)
|
|
||||||
parameter(ZMQ_SNDTIMEO=28)
|
|
||||||
parameter(ZMQ_SOCKET_LIMIT=3)
|
|
||||||
parameter(ZMQ_SOCKS_PASSWORD=100)
|
|
||||||
parameter(ZMQ_SOCKS_PROXY=68)
|
|
||||||
parameter(ZMQ_SOCKS_USERNAME=99)
|
|
||||||
parameter(ZMQ_SRCFD=2)
|
|
||||||
parameter(ZMQ_STREAM=11)
|
|
||||||
parameter(ZMQ_STREAMER=1)
|
|
||||||
parameter(ZMQ_STREAM_NOTIFY=73)
|
|
||||||
parameter(ZMQ_SUB=2)
|
|
||||||
parameter(ZMQ_SUBSCRIBE=6)
|
|
||||||
parameter(ZMQ_TCP_ACCEPT_FILTER=38)
|
|
||||||
parameter(ZMQ_TCP_KEEPALIVE=34)
|
|
||||||
parameter(ZMQ_TCP_KEEPALIVE_CNT=35)
|
|
||||||
parameter(ZMQ_TCP_KEEPALIVE_IDLE=36)
|
|
||||||
parameter(ZMQ_TCP_KEEPALIVE_INTVL=37)
|
|
||||||
parameter(ZMQ_TCP_MAXRT=80)
|
|
||||||
parameter(ZMQ_THREAD_AFFINITY_CPU_ADD=7)
|
|
||||||
parameter(ZMQ_THREAD_AFFINITY_CPU_REMOVE=8)
|
|
||||||
parameter(ZMQ_THREAD_NAME_PREFIX=9)
|
|
||||||
parameter(ZMQ_THREAD_PRIORITY=3)
|
|
||||||
parameter(ZMQ_THREAD_PRIORITY_DFLT=-1)
|
|
||||||
parameter(ZMQ_THREAD_SAFE=81)
|
|
||||||
parameter(ZMQ_THREAD_SCHED_POLICY=4)
|
|
||||||
parameter(ZMQ_THREAD_SCHED_POLICY_DFLT=-1)
|
|
||||||
parameter(ZMQ_TOS=57)
|
|
||||||
parameter(ZMQ_TYPE=16)
|
|
||||||
parameter(ZMQ_UNSUBSCRIBE=7)
|
|
||||||
parameter(ZMQ_USE_FD=89)
|
|
||||||
parameter(ZMQ_VERSION=40304)
|
|
||||||
parameter(ZMQ_VERSION_MAJOR=4)
|
|
||||||
parameter(ZMQ_VERSION_MINOR=3)
|
|
||||||
parameter(ZMQ_VERSION_PATCH=4)
|
|
||||||
parameter(ZMQ_VMCI_BUFFER_MAX_SIZE=87)
|
|
||||||
parameter(ZMQ_VMCI_BUFFER_MIN_SIZE=86)
|
|
||||||
parameter(ZMQ_VMCI_BUFFER_SIZE=85)
|
|
||||||
parameter(ZMQ_VMCI_CONNECT_TIMEOUT=88)
|
|
||||||
parameter(ZMQ_WSS_CERT_PEM=104)
|
|
||||||
parameter(ZMQ_WSS_HOSTNAME=106)
|
|
||||||
parameter(ZMQ_WSS_KEY_PEM=103)
|
|
||||||
parameter(ZMQ_WSS_TRUST_PEM=105)
|
|
||||||
parameter(ZMQ_WSS_TRUST_SYSTEM=107)
|
|
||||||
parameter(ZMQ_XPUB=9)
|
|
||||||
parameter(ZMQ_XPUB_MANUAL=71)
|
|
||||||
parameter(ZMQ_XPUB_MANUAL_LAST_VALUE=98)
|
|
||||||
parameter(ZMQ_XPUB_NODROP=69)
|
|
||||||
parameter(ZMQ_XPUB_VERBOSE=40)
|
|
||||||
parameter(ZMQ_XPUB_VERBOSER=78)
|
|
||||||
parameter(ZMQ_XPUB_WELCOME_MSG=72)
|
|
||||||
parameter(ZMQ_XREP=6)
|
|
||||||
parameter(ZMQ_XREQ=5)
|
|
||||||
parameter(ZMQ_XSUB=10)
|
|
||||||
parameter(ZMQ_ZAP_DOMAIN=55)
|
|
||||||
parameter(ZMQ_ZAP_ENFORCE_DOMAIN=93)
|
|
||||||
parameter(ZMQ_ZERO_COPY_RECV=10)
|
|
||||||
integer f77_zmq_bind
|
|
||||||
external f77_zmq_bind
|
|
||||||
integer f77_zmq_close
|
|
||||||
external f77_zmq_close
|
|
||||||
integer f77_zmq_connect
|
|
||||||
external f77_zmq_connect
|
|
||||||
integer f77_zmq_ctx_destroy
|
|
||||||
external f77_zmq_ctx_destroy
|
|
||||||
integer f77_zmq_ctx_get
|
|
||||||
external f77_zmq_ctx_get
|
|
||||||
integer*8 f77_zmq_ctx_new
|
|
||||||
external f77_zmq_ctx_new
|
|
||||||
integer f77_zmq_ctx_set
|
|
||||||
external f77_zmq_ctx_set
|
|
||||||
integer f77_zmq_ctx_shutdown
|
|
||||||
external f77_zmq_ctx_shutdown
|
|
||||||
integer f77_zmq_ctx_term
|
|
||||||
external f77_zmq_ctx_term
|
|
||||||
integer f77_zmq_disconnect
|
|
||||||
external f77_zmq_disconnect
|
|
||||||
integer f77_zmq_errno
|
|
||||||
external f77_zmq_errno
|
|
||||||
integer f77_zmq_getsockopt
|
|
||||||
external f77_zmq_getsockopt
|
|
||||||
integer f77_zmq_microsleep
|
|
||||||
external f77_zmq_microsleep
|
|
||||||
integer f77_zmq_msg_close
|
|
||||||
external f77_zmq_msg_close
|
|
||||||
integer f77_zmq_msg_copy
|
|
||||||
external f77_zmq_msg_copy
|
|
||||||
integer f77_zmq_msg_copy_from_data
|
|
||||||
external f77_zmq_msg_copy_from_data
|
|
||||||
integer f77_zmq_msg_copy_to_data
|
|
||||||
external f77_zmq_msg_copy_to_data
|
|
||||||
integer f77_zmq_msg_copy_to_data8
|
|
||||||
external f77_zmq_msg_copy_to_data8
|
|
||||||
integer*8 f77_zmq_msg_data
|
|
||||||
external f77_zmq_msg_data
|
|
||||||
integer*8 f77_zmq_msg_data_new
|
|
||||||
external f77_zmq_msg_data_new
|
|
||||||
integer f77_zmq_msg_destroy
|
|
||||||
external f77_zmq_msg_destroy
|
|
||||||
integer f77_zmq_msg_destroy_data
|
|
||||||
external f77_zmq_msg_destroy_data
|
|
||||||
integer f77_zmq_msg_get
|
|
||||||
external f77_zmq_msg_get
|
|
||||||
character*(64) f77_zmq_msg_gets
|
|
||||||
external f77_zmq_msg_gets
|
|
||||||
integer f77_zmq_msg_init
|
|
||||||
external f77_zmq_msg_init
|
|
||||||
integer f77_zmq_msg_init_data
|
|
||||||
external f77_zmq_msg_init_data
|
|
||||||
integer f77_zmq_msg_init_size
|
|
||||||
external f77_zmq_msg_init_size
|
|
||||||
integer f77_zmq_msg_more
|
|
||||||
external f77_zmq_msg_more
|
|
||||||
integer f77_zmq_msg_move
|
|
||||||
external f77_zmq_msg_move
|
|
||||||
integer*8 f77_zmq_msg_new
|
|
||||||
external f77_zmq_msg_new
|
|
||||||
integer f77_zmq_msg_recv
|
|
||||||
external f77_zmq_msg_recv
|
|
||||||
integer*8 f77_zmq_msg_recv8
|
|
||||||
external f77_zmq_msg_recv8
|
|
||||||
integer f77_zmq_msg_send
|
|
||||||
external f77_zmq_msg_send
|
|
||||||
integer*8 f77_zmq_msg_send8
|
|
||||||
external f77_zmq_msg_send8
|
|
||||||
integer f77_zmq_msg_set
|
|
||||||
external f77_zmq_msg_set
|
|
||||||
integer f77_zmq_msg_size
|
|
||||||
external f77_zmq_msg_size
|
|
||||||
integer*8 f77_zmq_msg_size8
|
|
||||||
external f77_zmq_msg_size8
|
|
||||||
integer f77_zmq_poll
|
|
||||||
external f77_zmq_poll
|
|
||||||
integer f77_zmq_pollitem_destroy
|
|
||||||
external f77_zmq_pollitem_destroy
|
|
||||||
integer*8 f77_zmq_pollitem_new
|
|
||||||
external f77_zmq_pollitem_new
|
|
||||||
integer f77_zmq_pollitem_revents
|
|
||||||
external f77_zmq_pollitem_revents
|
|
||||||
integer f77_zmq_pollitem_set_events
|
|
||||||
external f77_zmq_pollitem_set_events
|
|
||||||
integer f77_zmq_pollitem_set_socket
|
|
||||||
external f77_zmq_pollitem_set_socket
|
|
||||||
integer f77_zmq_proxy
|
|
||||||
external f77_zmq_proxy
|
|
||||||
integer f77_zmq_proxy_steerable
|
|
||||||
external f77_zmq_proxy_steerable
|
|
||||||
integer f77_zmq_recv
|
|
||||||
external f77_zmq_recv
|
|
||||||
integer*8 f77_zmq_recv8
|
|
||||||
external f77_zmq_recv8
|
|
||||||
integer f77_zmq_send
|
|
||||||
external f77_zmq_send
|
|
||||||
integer*8 f77_zmq_send8
|
|
||||||
external f77_zmq_send8
|
|
||||||
integer f77_zmq_send_const
|
|
||||||
external f77_zmq_send_const
|
|
||||||
integer*8 f77_zmq_send_const8
|
|
||||||
external f77_zmq_send_const8
|
|
||||||
integer f77_zmq_setsockopt
|
|
||||||
external f77_zmq_setsockopt
|
|
||||||
integer*8 f77_zmq_socket
|
|
||||||
external f77_zmq_socket
|
|
||||||
integer f77_zmq_socket_monitor
|
|
||||||
external f77_zmq_socket_monitor
|
|
||||||
character*(64) f77_zmq_strerror
|
|
||||||
external f77_zmq_strerror
|
|
||||||
integer f77_zmq_term
|
|
||||||
external f77_zmq_term
|
|
||||||
integer f77_zmq_unbind
|
|
||||||
external f77_zmq_unbind
|
|
||||||
integer f77_zmq_version
|
|
||||||
external f77_zmq_version
|
|
||||||
integer pthread_create
|
|
||||||
external pthread_create
|
|
||||||
integer pthread_create_arg
|
|
||||||
external pthread_create_arg
|
|
||||||
integer pthread_detach
|
|
||||||
external pthread_detach
|
|
||||||
integer pthread_join
|
|
||||||
external pthread_join
|
|
Loading…
Reference in New Issue
Block a user