docgen: add a way to get numerical id of a function
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 22 Feb 2017 17:29:07 +0000 (18:29 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 22 Feb 2017 17:29:18 +0000 (18:29 +0100)
src/scripts/elua/apps/docgen/doctree.lua

index 1a3061b..a3a7573 100644 (file)
@@ -326,6 +326,8 @@ local func_type_str = {
     [eolian.function_type.METHOD] = "method"
 }
 
+local ffi = require("ffi")
+
 M.Function = Node:clone {
     -- function types
     UNRESOLVED = eolian.function_type.UNRESOLVED,
@@ -443,6 +445,10 @@ M.Function = Node:clone {
 
     is_same = function(self, other)
         return self.func == other.func
+    end,
+
+    id_get = function(self)
+        return tonumber(ffi.cast("uintptr_t", self.func))
     end
 }