Back to index

enigmail  1.4.3
Classes | Functions | Variables
xpidl Namespace Reference

Classes

class  BuiltinLocation
class  Builtin
class  Location
class  NameMap
class  IDLError
class  Include
class  IDL
class  CDATA
class  Typedef
class  Forward
class  Native
class  BaseInterface
class  Interface
class  Dictionary
class  InterfaceAttributes
class  ConstMember
class  Attribute
class  Method
class  Param
class  Array
class  IDLParser

Functions

def attlistToIDL
def paramAttlistToIDL
def unaliasType
def getBuiltinOrNativeTypeName

Variables

dictionary _paramsHardcode
list builtinNames
dictionary builtinMap = {}
tuple p = IDLParser()

Function Documentation

def xpidl.attlistToIDL (   attlist)

Definition at line 63 of file xpidl.py.

00063 
00064 def attlistToIDL(attlist):
00065     if len(attlist) == 0:
00066         return ''
00067 
00068     attlist = list(attlist)
00069     attlist.sort(cmp=lambda a,b: cmp(a[0], b[0]))
00070 
00071     return '[%s] ' % ','.join(["%s%s" % (name, value is not None and '(%s)' % value or '')
00072                               for name, value, aloc in attlist])

Here is the caller graph for this function:

Definition at line 108 of file xpidl.py.

00108 
00109 def getBuiltinOrNativeTypeName(t):
00110     t = unaliasType(t)
00111     if t.kind == 'builtin':
00112         return t.name
00113     elif t.kind == 'native':
00114         assert t.specialtype is not None
00115         return '[%s]' % t.specialtype
00116     else:
00117         return None

Here is the call graph for this function:

Here is the caller graph for this function:

def xpidl.paramAttlistToIDL (   attlist)

Definition at line 78 of file xpidl.py.

00078 
00079 def paramAttlistToIDL(attlist):
00080     if len(attlist) == 0:
00081         return ''
00082 
00083     # Hack alert: g_hash_table_foreach is pretty much unimitatable... hardcode
00084     # quirk
00085     attlist = list(attlist)
00086     sorted = []
00087     if len(attlist) in _paramsHardcode:
00088         for p in _paramsHardcode[len(attlist)]:
00089             i = 0
00090             while i < len(attlist):
00091                 if attlist[i][0] == p:
00092                     sorted.append(attlist[i])
00093                     del attlist[i]
00094                     continue
00095 
00096                 i += 1
00097 
00098     sorted.extend(attlist)
00099 
00100     return '[%s] ' % ', '.join(["%s%s" % (name, value is not None and ' (%s)' % value or '')
00101                                 for name, value, aloc in sorted])

Here is the caller graph for this function:

def xpidl.unaliasType (   t)

Definition at line 102 of file xpidl.py.

00102 
00103 def unaliasType(t):
00104     while t.kind == 'typedef':
00105         t = t.realtype
00106     assert t is not None
00107     return t

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 {
00002     2: ('array', 'shared', 'iid_is', 'size_is', 'retval'),
00003     3: ('array', 'size_is', 'const'),
00004 }

Definition at line 73 of file xpidl.py.

dictionary xpidl.builtinMap = {}

Definition at line 171 of file xpidl.py.

Initial value:
00001 [
00002     Builtin('boolean', 'bool'),
00003     Builtin('void', 'void'),
00004     Builtin('octet', 'PRUint8'),
00005     Builtin('short', 'PRInt16', True, True),
00006     Builtin('long', 'PRInt32', True, True),
00007     Builtin('long long', 'PRInt64', True, False),
00008     Builtin('unsigned short', 'PRUint16', False, True),
00009     Builtin('unsigned long', 'PRUint32', False, True),
00010     Builtin('unsigned long long', 'PRUint64', False, False),
00011     Builtin('float', 'float', True, False),
00012     Builtin('double', 'double', True, False),
00013     Builtin('char', 'char', True, False),
00014     Builtin('string', 'char *', False, False),
00015     Builtin('wchar', 'PRUnichar', False, False),
00016     Builtin('wstring', 'PRUnichar *', False, False),
00017 ]

Definition at line 153 of file xpidl.py.

tuple xpidl.p = IDLParser()

Definition at line 1601 of file xpidl.py.