njs_generator_init(njs_generator_t *generator, njs_str_t *file,
    njs_int_t depth, njs_bool_t runtime)
{
    njs_memzero(generator, sizeof(njs_generator_t));

    njs_queue_init(&generator->stack);

    generator->file = *file;
    generator->depth = depth;
    generator->runtime = runtime;

    return NJS_OK;
}
njs_generator_init(njs_generator_t *generator, njs_str_t *file,
    njs_int_t depth, njs_bool_t runtime)
{
    njs_memzero(generator, sizeof(njs_generator_t));

    njs_queue_init(&generator->stack);

    generator->file = *file;
    generator->depth = depth;
    generator->runtime = runtime;

    return NJS_OK;
}