view utils.h @ 47:3f4982759e55

Converting JS exceptions into Python exceptions is now doable, albeit not yet implemented, thanks to the discovery of JSOPTION_DONT_REPORT_UNCAUGHT. Also, JS warnings are now converted into Python warnings.
author Atul Varma <varmaa@toolness.com>
date Mon, 06 Jul 2009 08:13:45 -0700
parents a0f677cfc679
children bc4263c6ae82
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(PYM_JSContextObject *context,
                    PyObject *object,
                    jsval *rval);

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

extern void
PYM_pythonExceptionToJs(PYM_JSContextObject *context);

void
PYM_jsExceptionToPython(PYM_JSContextObject *context);

#endif