cpython/Programs/_freeze_module.c

/* This is built as a stand-alone executable by the Makefile, and helps turn
   modules into frozen modules.

   This is used directly by Tools/build/freeze_modules.py, and indirectly by "make regen-frozen".

   See Python/frozen.c for more info.

   Keep this file in sync with Programs/_freeze_module.py.
*/


#include <Python.h>
#include <marshal.h>
#include "pycore_fileutils.h"     // _Py_stat_struct
#include <pycore_import.h>

#include <stdio.h>
#include <stdlib.h>               // malloc()
#include <sys/types.h>
#include <sys/stat.h>
#ifndef MS_WINDOWS
#  include <unistd.h>
#endif

/* To avoid a circular dependency on frozen.o, we create our own structure
   of frozen modules instead, left deliberately blank so as to avoid
   unintentional import of a stale version of _frozen_importlib. */

static const struct _frozen no_modules[] =;
static const struct _module_alias aliases[] =;

const struct _frozen *_PyImport_FrozenBootstrap;
const struct _frozen *_PyImport_FrozenStdlib;
const struct _frozen *_PyImport_FrozenTest;
const struct _frozen *PyImport_FrozenModules;
const struct _module_alias *_PyImport_FrozenAliases;

static const char header[] =;

static void
runtime_init(void)
{}

static const char *
read_text(const char *inpath)
{}

static PyObject *
compile_and_marshal(const char *name, const char *text)
{}

static char *
get_varname(const char *name, const char *prefix)
{}

static void
write_code(FILE *outfile, PyObject *marshalled, const char *varname)
{}

static int
write_frozen(const char *outpath, const char *inpath, const char *name,
             PyObject *marshalled)
{}

int
main(int argc, char *argv[])
{}