Numworks Epsilon  1.4.1
Graphing Calculator Operating System
builtinimport.c File Reference
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "py/compile.h"
#include "py/objmodule.h"
#include "py/persistentcode.h"
#include "py/runtime.h"
#include "py/builtin.h"
#include "py/frozenmod.h"

Go to the source code of this file.

Macros

#define DEBUG_PRINT   (0)
 
#define DEBUG_printf(...)   (void)0
 
#define PATH_SEP_CHAR   '/'
 

Functions

bool mp_obj_is_package (mp_obj_t module)
 
STATIC mp_import_stat_t mp_import_stat_any (const char *path)
 
STATIC mp_import_stat_t stat_file_py_or_mpy (vstr_t *path)
 
STATIC mp_import_stat_t stat_dir_or_file (vstr_t *path)
 
STATIC mp_import_stat_t find_file (const char *file_str, uint file_len, vstr_t *dest)
 
STATIC void do_load (mp_obj_t module_obj, vstr_t *file)
 
STATIC void chop_component (const char *start, const char **end)
 
mp_obj_t mp_builtin___import__ (size_t n_args, const mp_obj_t *args)
 
 MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (mp_builtin___import___obj, 1, 5, mp_builtin___import__)
 

Macro Definition Documentation

◆ DEBUG_PRINT

#define DEBUG_PRINT   (0)

Definition at line 43 of file builtinimport.c.

◆ DEBUG_printf

#define DEBUG_printf (   ...)    (void)0

Definition at line 44 of file builtinimport.c.

◆ PATH_SEP_CHAR

#define PATH_SEP_CHAR   '/'

Definition at line 47 of file builtinimport.c.

Function Documentation

◆ chop_component()

STATIC void chop_component ( const char *  start,
const char **  end 
)

Definition at line 236 of file builtinimport.c.

◆ do_load()

STATIC void do_load ( mp_obj_t  module_obj,
vstr_t file 
)

Definition at line 182 of file builtinimport.c.

◆ find_file()

STATIC mp_import_stat_t find_file ( const char *  file_str,
uint  file_len,
vstr_t dest 
)

Definition at line 96 of file builtinimport.c.

◆ mp_builtin___import__()

mp_obj_t mp_builtin___import__ ( size_t  n_args,
const mp_obj_t args 
)

Definition at line 247 of file builtinimport.c.

◆ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN()

MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN ( mp_builtin___import___obj  ,
,
,
mp_builtin___import__   
)

◆ mp_import_stat_any()

STATIC mp_import_stat_t mp_import_stat_any ( const char *  path)

Definition at line 57 of file builtinimport.c.

◆ mp_obj_is_package()

bool mp_obj_is_package ( mp_obj_t  module)

Definition at line 49 of file builtinimport.c.

◆ stat_dir_or_file()

STATIC mp_import_stat_t stat_dir_or_file ( vstr_t path)

Definition at line 84 of file builtinimport.c.

◆ stat_file_py_or_mpy()

STATIC mp_import_stat_t stat_file_py_or_mpy ( vstr_t path)

Definition at line 67 of file builtinimport.c.