cpython/Python/pathconfig.c

/* Path configuration like module_search_path (sys.path) */

#include "Python.h"
#include "pycore_initconfig.h"    // _PyStatus_OK()
#include "pycore_fileutils.h"     // _Py_wgetcwd()
#include "pycore_pathconfig.h"
#include "pycore_pymem.h"         // _PyMem_SetDefaultAllocator()
#include <wchar.h>

#include "marshal.h"              // PyMarshal_ReadObjectFromString
#include "osdefs.h"               // DELIM

#ifdef MS_WINDOWS
#  include <windows.h>            // GetFullPathNameW(), MAX_PATH
#  include <pathcch.h>
#  include <shlwapi.h>
#endif


/* External interface */

/* Stored values set by C API functions */
_PyPathConfig;

#define _PyPathConfig_INIT


_PyPathConfig _Py_path_config =;


const wchar_t *
_PyPathConfig_GetGlobalModuleSearchPath(void)
{}


void
_PyPathConfig_ClearGlobal(void)
{}

PyStatus
_PyPathConfig_ReadGlobal(PyConfig *config)
{}

PyStatus
_PyPathConfig_UpdateGlobal(const PyConfig *config)
{}


static void _Py_NO_RETURN
path_out_of_memory(const char *func)
{}

// Removed in Python 3.13 API, but kept for the stable ABI
PyAPI_FUNC(void)
Py_SetPath(const wchar_t *path)
{}


void
Py_SetPythonHome(const wchar_t *home)
{}


void
Py_SetProgramName(const wchar_t *program_name)
{}


wchar_t *
Py_GetPath(void)
{}


wchar_t *
_Py_GetStdlibDir(void)
{}


wchar_t *
Py_GetPrefix(void)
{}


wchar_t *
Py_GetExecPrefix(void)
{}


wchar_t *
Py_GetProgramFullPath(void)
{}


wchar_t*
Py_GetPythonHome(void)
{}


wchar_t *
Py_GetProgramName(void)
{}



/* Compute module search path from argv[0] or the current working
   directory ("-m module" case) which will be prepended to sys.argv:
   sys.path[0].

   Return 1 if the path is correctly resolved and written into *path0_p.

   Return 0 if it fails to resolve the full path. For example, return 0 if the
   current working directory has been removed (bpo-36236) or if argv is empty.

   Raise an exception and return -1 on error.
   */
int
_PyPathConfig_ComputeSysPath0(const PyWideStringList *argv, PyObject **path0_p)
{}