Пример #1
0
void jl_load(const char *fname)
{
    char *fpath = jl_find_file_in_path(fname);
    jl_start_parsing_file(fpath);
    jl_parse_eval_all(fpath);
    if (fpath != fname) free(fpath);
}
Пример #2
0
void jl_load(const char *fname)
{
    char *fpath = (char*)fname;
    struct stat stbuf;
    if (jl_stat(fpath, (char*)&stbuf) != 0) {
        jl_errorf("could not open file %s", fpath);
    }
    jl_start_parsing_file(fpath);
    jl_parse_eval_all(fpath);
    if (fpath != fname) free(fpath);
}
Пример #3
0
jl_value_t *jl_load_file_string(const char *text, char *filename)
{
    value_t t, f;
    t = cvalue_static_cstring(text);
    fl_gc_handle(&t);
    f = cvalue_static_cstring(filename);
    fl_applyn(2, symbol_value(symbol("jl-parse-string-stream")),
              t, f);
    fl_free_gc_handles(1);
    return jl_parse_eval_all(filename);
}
Пример #4
0
void jl_load(const char *fname)
{
    if (jl_current_module == jl_base_module) {
        //This deliberatly uses ios, because stdio initialization has been moved to Julia
        jl_printf(JL_STDOUT, "%s\n", fname);
    }
    char *fpath = (char*)fname;
    uv_statbuf_t stbuf;
    if (jl_stat(fpath, (char*)&stbuf) != 0 || (stbuf.st_mode & S_IFMT) != S_IFREG) {
        jl_errorf("could not open file %s", fpath);
    }
    jl_start_parsing_file(fpath);
    jl_parse_eval_all(fpath);
    if (fpath != fname) free(fpath);
    if (jl_current_module == jl_base_module) {
        jl_printf(JL_STDOUT, "\e[1F\e[2K");
    }
Пример #5
0
jl_value_t *jl_load(const char *fname, size_t len)
{
    if (jl_current_module->istopmod) {
        jl_printf(JL_STDOUT, "%s\r\n", fname);
#ifdef _OS_WINDOWS_
        uv_run(uv_default_loop(), (uv_run_mode)1);
#endif
    }
    char *fpath = (char*)fname;
    uv_stat_t stbuf;
    if (jl_stat(fpath, (char*)&stbuf) != 0 || (stbuf.st_mode & S_IFMT) != S_IFREG) {
        jl_errorf("could not open file %s", fpath);
    }
    if (jl_start_parsing_file(fpath) != 0) {
        jl_errorf("could not open file %s", fpath);
    }
    jl_value_t *result = jl_parse_eval_all(fpath, len);
    if (fpath != fname) free(fpath);
    return result;
}
Пример #6
0
jl_value_t *jl_load(const char *fname)
{
    if (jl_current_module == jl_base_module) {
        //This deliberatly uses ios, because stdio initialization has been moved to Julia
        jl_printf(JL_STDOUT, "%s\r\n", fname);
#ifdef _OS_WINDOWS_
        uv_run(uv_default_loop(), (uv_run_mode)1);
#endif
    }
    char *fpath = (char*)fname;
    uv_stat_t stbuf;
    if (jl_stat(fpath, (char*)&stbuf) != 0 || (stbuf.st_mode & S_IFMT) != S_IFREG) {
        jl_errorf("could not open file %s", fpath);
    }
    if (jl_start_parsing_file(fpath) != 0) {
        jl_errorf("could not open file %s", fpath);
    }
    jl_value_t *result = jl_parse_eval_all(fpath);
    if (fpath != fname) free(fpath);
    return result;
}
Пример #7
0
void jl_load_file_string(const char *text)
{
    fl_applyn(1, symbol_value(symbol("jl-parse-string-stream")),
              cvalue_static_cstring(text));
    jl_parse_eval_all("");
}
Пример #8
0
JL_DLLEXPORT jl_value_t *jl_load_file_string(const char *text, size_t len,
                                             char *filename, jl_module_t *inmodule)
{
    return jl_parse_eval_all(filename, text, len, inmodule);
}