diff function.h @ 37:d4efcbb06964

Added a new PYM_JSFunction type, PYM_JSContext.define_property(), and PYM_JSContext.new_function(). Also fixed a memory leak.
author Atul Varma <varmaa@toolness.com>
date Thu, 02 Jul 2009 22:42:31 -0700
parents
children 8a7abd0bb48d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/function.h	Thu Jul 02 22:42:31 2009 -0700
@@ -0,0 +1,22 @@
+#ifndef PYM_FUNCTION_H
+#define PYM_FUNCTION_H
+
+#include "object.h"
+#include "context.h"
+
+#include <jsapi.h>
+#include <Python/Python.h>
+
+typedef struct {
+  PYM_JSObject base;
+  PyObject *callable;
+} PYM_JSFunction;
+
+extern PyTypeObject PYM_JSFunctionType;
+
+extern PYM_JSFunction *
+PYM_newJSFunction(PYM_JSContextObject *context,
+                  PyObject *callable,
+                  const char *name);
+
+#endif