]> git.cworth.org Git - apitrace/commitdiff
get_function_by_name shortcut
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 20 Feb 2011 09:01:25 +0000 (09:01 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Tue, 22 Feb 2011 07:15:58 +0000 (07:15 +0000)
stdapi.py

index 79df2c3c837aa1944074b248375bcab265ec571f..7d0c98258b46f7f8f5eb9de1ae8024ab74c5756f 100644 (file)
--- a/stdapi.py
+++ b/stdapi.py
@@ -543,6 +543,12 @@ class API:
     def add_interfaces(self, interfaces):
         self.interfaces.extend(interfaces)
 
+    def get_function_by_name(self, name):
+        for function in self.functions:
+            if function.name == name:
+                return function
+        return None
+
 
 Bool = Literal("bool", "Bool")
 SChar = Literal("signed char", "SInt")