/*
--- DO NOT EDIT THIS FILE !!! ---

This file has been generated automatically with 'jsapigen'.

jsapigen is a glue-code generator for SpiderMonkey. It is distributed
under the conditions of version 3 of the GNU General Public License.
Please have a look at http://jsapigen.sourceforge.net.

This file is NOT part of jsapigen and is NOT necessarily covered by
jsapigen's license. For licensing information regarding this file,
please refer to the software package which it is part of.

*/

#include <stdio.h>

void jsEditor(void)
{
        printf("Constructor invoked\n");
}

#ifdef HAVE_ALLOCA_H
#include <alloca.h>
static size_t jj_alloca_limit = 0;
#endif
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#ifdef HAVE_ALLOCA_H
#endif
#include <jsapi.h>
#ifndef JS_THREADSAFE
#if JS_VERSION <= 170
#define jsrefcount int
#define JS_BeginRequest(cx)
#define JS_EndRequest(cx)
#define JS_SuspendRequest(cx)
#define JS_ResumeRequest(cx, saveDepth)
#endif
#endif
#ifndef JS_FS
#define JS_FS(name, call, nargs, flags, extra) {name, call, nargs, flags, extra}
#endif
#ifndef JS_FS_END
#define JS_FS_END {NULL, NULL, 0, 0, 0}
#endif

static JSBool
jjeditorprintTiming(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
    JSObject * var2;
    int var3;
    int var6;
    int var7;
    int var8;
    jsval var9;
    int32 var10;
    jsval var11;
    JSBool var1;
    var2 = NULL;
    var3 = 0;
    var6 = 0;
    var7 = 0;
    var8 = 0;
    var9 = JSVAL_NULL;
    var10 = 0;
    var11 = JSVAL_NULL;
    var1 = JS_FALSE;
    var2 = obj;
    var6 = argc;
    var8 = 0;
    var8 = var8 < var6;
    if (var8) {
    var9 = argv[0];
    if (JS_ValueToInt32(cx, var9, &var10) != JS_TRUE) {
        goto do_return;
    }
    var7 = (int)var10;
    }
    var3 = jsPrintTiming(cx, var7);
    if (JS_NewNumberValue(cx, var3, &var11) != JS_TRUE) {
        goto do_return;
    }
    argv[argc+0] = var11;
    if (rval) {
        *rval = var11;
    }
    var1 = JS_TRUE;
    do_return:
    return var1;
}
static JSBool
jjeditordumpSegment(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
    JSObject * var13;
    int var14;
    int var17;
    jsval var18;
    JSBool var12;
    var13 = NULL;
    var14 = 0;
    var17 = 0;
    var18 = JSVAL_NULL;
    var12 = JS_FALSE;
    var13 = obj;
    var17 = argc;
    var14 = jsDumpSegments(cx);
    if (JS_NewNumberValue(cx, var14, &var18) != JS_TRUE) {
        goto do_return;
    }
    argv[argc+0] = var18;
    if (rval) {
        *rval = var18;
    }
    var12 = JS_TRUE;
    do_return:
    return var12;
}
static JSBool
jjeditordumpRefVideo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
    JSObject * var20;
    int var21;
    int var24;
    jsval var25;
    JSBool var19;
    var20 = NULL;
    var21 = 0;
    var24 = 0;
    var25 = JSVAL_NULL;
    var19 = JS_FALSE;
    var20 = obj;
    var24 = argc;
    var21 = jsDumpRefVideos(cx);
    if (JS_NewNumberValue(cx, var21, &var25) != JS_TRUE) {
        goto do_return;
    }
    argv[argc+0] = var25;
    if (rval) {
        *rval = var25;
    }
    var19 = JS_TRUE;
    do_return:
    return var19;
}
static JSBool
jjeditor__construct__(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
    JSObject * var27;
    int var31;
    JSBool var26;
    var27 = NULL;
    var31 = 0;
    var26 = JS_FALSE;
    var27 = obj;
    var31 = argc;
    jsEditor();
    var26 = JS_TRUE;
    return var26;
}
static JSPropertySpec jj_static_ps[] = {
    {NULL, 0, 0, NULL, NULL}
};
static JSPropertySpec jj_ps[] = {
    {NULL, 0, 0, NULL, NULL}
};
static JSFunctionSpec jj_static_fs[] = {
    JS_FS_END
};
static JSFunctionSpec jj_fs[] = {
    JS_FS_END
};
static JSPropertySpec jjeditor_static_ps[] = {
    {NULL, 0, 0, NULL, NULL}
};
static JSPropertySpec jjeditor_ps[] = {
    {NULL, 0, 0, NULL, NULL}
};
static JSFunctionSpec jjeditor_static_fs[] = {
    JS_FS("printTiming", jjeditorprintTiming, 1, 0, 1),
    JS_FS("dumpSegment", jjeditordumpSegment, 0, 0, 1),
    JS_FS("dumpRefVideo", jjeditordumpRefVideo, 0, 0, 1),
    JS_FS_END
};
static JSFunctionSpec jjeditor_fs[] = {
    JS_FS_END
};
static JSClass jjeditor_class = {
    "editor",
    0,
    JS_PropertyStub,
    JS_PropertyStub,
    JS_PropertyStub,
    JS_PropertyStub,
    JS_EnumerateStub,
    JS_ResolveStub,
    JS_ConvertStub,
    JS_FinalizeStub,
    NULL,
    NULL,
    NULL,
    jjeditor__construct__,
    NULL,
    NULL,
    NULL,
    NULL
};
static JSObject *
jjeditor_init(JSContext *cx, JSObject *obj)
{
    JSObject *parent_proto, *proto;
    JSClass *class;
    if (!cx || !obj) {
        JS_ReportError(cx, "invalid parameter");
        return NULL;
    }
    if (!JS_EnterLocalRootScope(cx)) {
        JS_ReportError(cx, "JS_EnterLocalRootScope failed");
        return NULL;
    }
    parent_proto = NULL;
    proto = NULL;
    parent_proto = JS_NewObject(cx, NULL, NULL, NULL);
    if (!parent_proto) {
        JS_LeaveLocalRootScope(cx);
        JS_ReportError(cx, "failed to create prototype");
        return NULL;
    }
    class = &jjeditor_class;
    proto = JS_InitClass(cx, obj, parent_proto, class, jjeditor__construct__, 0, jjeditor_ps, jjeditor_fs, jjeditor_static_ps, jjeditor_static_fs);
    if (!proto) {
        JS_LeaveLocalRootScope(cx);
        JS_ReportError(cx, "failed to init class");
        return NULL;
    }
    JS_LeaveLocalRootScope(cx);
    return proto;
}


JSObject *jsEditorInit(JSContext *cx,JSObject *obj)
{
          if (JS_DefineFunctions(cx, obj, jj_static_fs) != JS_TRUE) 
          {
                return NULL;
          }
          return jjeditor_init(cx,obj);
}

JSFunctionSpec  *jsGetEditFunctions(void)
{
        return jjeditor_static_fs;
}


