view utils.h @ 33:3f8a2db496f5

Changed PYM_pyObjectToJsval() to simply return an int status/error code; this way callers don't have to worry about decreasing the reference count of a Py_NONE.
author Atul Varma <varmaa@toolness.com>
date Tue, 30 Jun 2009 22:42:48 -0700
parents 3b2bdf2823bb
children 0b9a316ce4ef
line wrap: on
line source

#ifndef PYM_UTILS_H
#define PYM_UTILS_H

#include "context.h"

#include <jsapi.h>
#include <jsdhash.h>
#include <Python/Python.h>

typedef struct {
  JSDHashEntryStub base;
  void *value;
} PYM_HashEntry;

extern PyObject *PYM_error;

extern int
PYM_pyObjectToJsval(JSContext *cx,
                    PyObject *object,
                    jsval *rval);

extern PyObject *
PYM_jsvalToPyObject(PYM_JSContextObject *context, jsval value);

#endif