Example #1
0
    def __str__(self):
        string = ffi.string(lib.EnvGetDefglobalPPForm(self._env, self._glb))

        return string.decode().rstrip('\n')
Example #2
0
    def description(self):
        buf = ffi.new('char[1024]')
        lib.EnvGetDefmethodDescription(self._env, buf, 1024, self._gnc,
                                       self._idx)

        return ffi.string(buf).decode()
Example #3
0
    def __repr__(self):
        string = lib.EnvGetDefrulePPForm(self._env, self._rule)

        return "%s: %s" % (self.__class__.__name__, ffi.string(string).decode())
Example #4
0
 def name(self):
     return ffi.string(lib.EnvGetDefgenericName(self._env,
                                                self._gnc)).decode()
Example #5
0
    def __str__(self):
        string = ffi.string(
            lib.EnvGetDefmethodPPForm(self._env, self._gnc, self._idx))

        return string.decode().rstrip('\n')
Example #6
0
    def __str__(self):
        string = ffi.string(lib.EnvGetDeffunctionPPForm(self._env, self._fnc))

        return string.decode().rstrip('\n')
Example #7
0
 def name(self):
     """Function name."""
     return ffi.string(lib.EnvGetDeffunctionName(self._env,
                                                 self._fnc)).decode()
Example #8
0
def fact_pp_string(env, fact):
    buf = ffi.new('char[1024]')
    lib.EnvGetFactPPForm(env, buf, 1024, fact)

    return ffi.string(buf).decode()
Example #9
0
def query_function(env: ffi.CData, name: ffi.CData, context: ffi.CData):
    router = ffi.from_handle(context)

    return bool(router.query(ffi.string(name).decode()))
Example #10
0
 def name(self):
     """Global name."""
     return ffi.string(lib.EnvGetDefmoduleName(self._env,
                                               self._mdl)).decode()
Example #11
0
 def name(self):
     """Template name."""
     return ffi.string(lib.EnvGetDeftemplateName(self._env,
                                                 self._tpl)).decode()
Example #12
0
    def __repr__(self):
        module = lib.EnvGetDefmodulePPForm(self._env, self._mdl)
        strn = ffi.string(module).decode() if module != ffi.NULL else self.name

        return "%s: %s" % (self.__class__.__name__, strn)
Example #13
0
    def __str__(self):
        module = lib.EnvGetDefmodulePPForm(self._env, self._mdl)

        return ffi.string(module).decode() if module != ffi.NULL else self.name
Example #14
0
 def name(self):
     """Global name."""
     return ffi.string(lib.EnvGetDefglobalName(self._env,
                                               self._glb)).decode()
Example #15
0
def instance_pp_string(env, ist):
    buf = ffi.new('char[1024]')
    lib.EnvGetInstancePPForm(env, buf, 1024, ist)

    return ffi.string(buf).decode()
Example #16
0
    def __str__(self):
        strn = lib.EnvGetDefclassPPForm(self._env, self._cls)
        strn = ffi.string(strn).decode() if strn != ffi.NULL else self.name

        return strn.rstrip('\n')
Example #17
0
def string_to_str(string):
    return ffi.string(lib.to_string(string)).decode()
Example #18
0
    def __repr__(self):
        strn = lib.EnvGetDefclassPPForm(self._env, self._cls)
        strn = ffi.string(strn).decode() if strn != ffi.NULL else self.name

        return "%s: %s" % (self.__class__.__name__, strn.rstrip('\n'))
Example #19
0
    def __repr__(self):
        string = ffi.string(lib.EnvGetDeffunctionPPForm(self._env, self._fnc))

        return "%s: %s" % (self.__class__.__name__,
                           string.decode().rstrip('\n'))
Example #20
0
 def name(self):
     """Class name."""
     return ffi.string(lib.EnvGetDefclassName(self._env, self._cls)).decode()
Example #21
0
    def __str__(self):
        string = ffi.string(lib.EnvGetDefgenericPPForm(self._env, self._gnc))

        return string.decode().rstrip('\n')
Example #22
0
 def name(self):
     """Instance name."""
     return ffi.string(lib.EnvGetInstanceName(self._env, self._ist)).decode()
Example #23
0
    def module(self):
        modname = ffi.string(lib.EnvDefgenericModule(self._env, self._gnc))
        defmodule = lib.EnvFindDefmodule(self._env, modname)

        return Module(self._env, defmodule)
Example #24
0
    def __str__(self):
        string = ffi.string(lib.EnvGetDefmessageHandlerPPForm(
            self._env, self._cls, self._idx))

        return string.decode().rstrip('\n')
Example #25
0
    def __repr__(self):
        string = ffi.string(
            lib.EnvGetDefmethodPPForm(self._env, self._gnc, self._idx))

        return "%s: %s" % (self.__class__.__name__,
                           string.decode().rstrip('\n'))
Example #26
0
 def name(self):
     """MessageHandler name."""
     return ffi.string(lib.EnvGetDefmessageHandlerName(
         self._env, self._cls, self._idx)).decode()
Example #27
0
 def __str__(self):
     return ffi.string(
         lib.EnvGetDefrulePPForm(self._env, self._rule)).decode()
Example #28
0
 def type(self):
     """MessageHandler type."""
     return ffi.string(lib.EnvGetDefmessageHandlerType(
         self._env, self._cls, self._idx)).decode()
Example #29
0
 def name(self):
     """Rule name."""
     return ffi.string(lib.EnvGetDefruleName(self._env, self._rule)).decode()
Example #30
0
    def __repr__(self):
        string = lib.DefrulePPForm(self._ptr())
        string = ffi.string(string).decode() if string != ffi.NULL else ''

        return "%s: %s" % (self.__class__.__name__, ' '.join(string.split()))