@@ -356,15 +356,15 @@ find_env_config_value(FILE * env_file, const wchar_t * key, wchar_t * value)
356356 bytes long.
357357*/
358358static int
359- search_for_prefix (const _PyMainInterpreterConfig * main_config ,
359+ search_for_prefix (const _PyCoreConfig * core_config ,
360360 PyCalculatePath * calculate , wchar_t * prefix )
361361{
362362 size_t n ;
363363 wchar_t * vpath ;
364364
365365 /* If PYTHONHOME is set, we believe it unconditionally */
366- if (main_config -> home ) {
367- wcsncpy (prefix , main_config -> home , MAXPATHLEN );
366+ if (core_config -> home ) {
367+ wcsncpy (prefix , core_config -> home , MAXPATHLEN );
368368 prefix [MAXPATHLEN ] = L'\0' ;
369369 wchar_t * delim = wcschr (prefix , DELIM );
370370 if (delim ) {
@@ -423,10 +423,10 @@ search_for_prefix(const _PyMainInterpreterConfig *main_config,
423423
424424
425425static void
426- calculate_prefix (const _PyMainInterpreterConfig * main_config ,
426+ calculate_prefix (const _PyCoreConfig * core_config ,
427427 PyCalculatePath * calculate , wchar_t * prefix )
428428{
429- calculate -> prefix_found = search_for_prefix (main_config , calculate , prefix );
429+ calculate -> prefix_found = search_for_prefix (core_config , calculate , prefix );
430430 if (!calculate -> prefix_found ) {
431431 if (!Py_FrozenFlag ) {
432432 fprintf (stderr ,
@@ -468,19 +468,19 @@ calculate_reduce_prefix(PyCalculatePath *calculate, wchar_t *prefix)
468468 MAXPATHLEN bytes long.
469469*/
470470static int
471- search_for_exec_prefix (const _PyMainInterpreterConfig * main_config ,
471+ search_for_exec_prefix (const _PyCoreConfig * core_config ,
472472 PyCalculatePath * calculate , wchar_t * exec_prefix )
473473{
474474 size_t n ;
475475
476476 /* If PYTHONHOME is set, we believe it unconditionally */
477- if (main_config -> home ) {
478- wchar_t * delim = wcschr (main_config -> home , DELIM );
477+ if (core_config -> home ) {
478+ wchar_t * delim = wcschr (core_config -> home , DELIM );
479479 if (delim ) {
480480 wcsncpy (exec_prefix , delim + 1 , MAXPATHLEN );
481481 }
482482 else {
483- wcsncpy (exec_prefix , main_config -> home , MAXPATHLEN );
483+ wcsncpy (exec_prefix , core_config -> home , MAXPATHLEN );
484484 }
485485 exec_prefix [MAXPATHLEN ] = L'\0' ;
486486 joinpath (exec_prefix , calculate -> lib_python );
@@ -551,10 +551,10 @@ search_for_exec_prefix(const _PyMainInterpreterConfig *main_config,
551551
552552
553553static void
554- calculate_exec_prefix (const _PyMainInterpreterConfig * main_config ,
554+ calculate_exec_prefix (const _PyCoreConfig * core_config ,
555555 PyCalculatePath * calculate , wchar_t * exec_prefix )
556556{
557- calculate -> exec_prefix_found = search_for_exec_prefix (main_config ,
557+ calculate -> exec_prefix_found = search_for_exec_prefix (core_config ,
558558 calculate ,
559559 exec_prefix );
560560 if (!calculate -> exec_prefix_found ) {
@@ -587,7 +587,7 @@ calculate_reduce_exec_prefix(PyCalculatePath *calculate, wchar_t *exec_prefix)
587587
588588
589589static _PyInitError
590- calculate_program_full_path (const _PyMainInterpreterConfig * main_config ,
590+ calculate_program_full_path (const _PyCoreConfig * core_config ,
591591 PyCalculatePath * calculate , _PyPathConfig * config )
592592{
593593 wchar_t program_full_path [MAXPATHLEN + 1 ];
@@ -607,8 +607,8 @@ calculate_program_full_path(const _PyMainInterpreterConfig *main_config,
607607 * other way to find a directory to start the search from. If
608608 * $PATH isn't exported, you lose.
609609 */
610- if (wcschr (main_config -> program_name , SEP )) {
611- wcsncpy (program_full_path , main_config -> program_name , MAXPATHLEN );
610+ if (wcschr (core_config -> program_name , SEP )) {
611+ wcsncpy (program_full_path , core_config -> program_name , MAXPATHLEN );
612612 }
613613#ifdef __APPLE__
614614 /* On Mac OS X, if a script uses an interpreter of the form
@@ -650,7 +650,7 @@ calculate_program_full_path(const _PyMainInterpreterConfig *main_config,
650650 wcsncpy (program_full_path , path , MAXPATHLEN );
651651 }
652652
653- joinpath (program_full_path , main_config -> program_name );
653+ joinpath (program_full_path , core_config -> program_name );
654654 if (isxfile (program_full_path )) {
655655 break ;
656656 }
@@ -815,15 +815,15 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix)
815815
816816
817817static _PyInitError
818- calculate_module_search_path (const _PyMainInterpreterConfig * main_config ,
818+ calculate_module_search_path (const _PyCoreConfig * core_config ,
819819 PyCalculatePath * calculate ,
820820 const wchar_t * prefix , const wchar_t * exec_prefix ,
821821 _PyPathConfig * config )
822822{
823823 /* Calculate size of return buffer */
824824 size_t bufsz = 0 ;
825- if (main_config -> module_search_path_env != NULL ) {
826- bufsz += wcslen (main_config -> module_search_path_env ) + 1 ;
825+ if (core_config -> module_search_path_env != NULL ) {
826+ bufsz += wcslen (core_config -> module_search_path_env ) + 1 ;
827827 }
828828
829829 wchar_t * defpath = calculate -> pythonpath ;
@@ -857,8 +857,8 @@ calculate_module_search_path(const _PyMainInterpreterConfig *main_config,
857857 buf [0 ] = '\0' ;
858858
859859 /* Run-time value of $PYTHONPATH goes first */
860- if (main_config -> module_search_path_env ) {
861- wcscpy (buf , main_config -> module_search_path_env );
860+ if (core_config -> module_search_path_env ) {
861+ wcscpy (buf , core_config -> module_search_path_env );
862862 wcscat (buf , delimiter );
863863 }
864864
@@ -907,7 +907,7 @@ calculate_module_search_path(const _PyMainInterpreterConfig *main_config,
907907
908908static _PyInitError
909909calculate_init (PyCalculatePath * calculate ,
910- const _PyMainInterpreterConfig * main_config )
910+ const _PyCoreConfig * core_config )
911911{
912912 size_t len ;
913913 const char * path = getenv ("PATH" );
@@ -950,12 +950,12 @@ calculate_free(PyCalculatePath *calculate)
950950
951951
952952static _PyInitError
953- calculate_path_impl (const _PyMainInterpreterConfig * main_config ,
953+ calculate_path_impl (const _PyCoreConfig * core_config ,
954954 PyCalculatePath * calculate , _PyPathConfig * config )
955955{
956956 _PyInitError err ;
957957
958- err = calculate_program_full_path (main_config , calculate , config );
958+ err = calculate_program_full_path (core_config , calculate , config );
959959 if (_Py_INIT_FAILED (err )) {
960960 return err ;
961961 }
@@ -969,13 +969,13 @@ calculate_path_impl(const _PyMainInterpreterConfig *main_config,
969969
970970 wchar_t prefix [MAXPATHLEN + 1 ];
971971 memset (prefix , 0 , sizeof (prefix ));
972- calculate_prefix (main_config , calculate , prefix );
972+ calculate_prefix (core_config , calculate , prefix );
973973
974974 calculate_zip_path (calculate , prefix );
975975
976976 wchar_t exec_prefix [MAXPATHLEN + 1 ];
977977 memset (exec_prefix , 0 , sizeof (exec_prefix ));
978- calculate_exec_prefix (main_config , calculate , exec_prefix );
978+ calculate_exec_prefix (core_config , calculate , exec_prefix );
979979
980980 if ((!calculate -> prefix_found || !calculate -> exec_prefix_found ) &&
981981 !Py_FrozenFlag )
@@ -984,7 +984,7 @@ calculate_path_impl(const _PyMainInterpreterConfig *main_config,
984984 "Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]\n" );
985985 }
986986
987- err = calculate_module_search_path (main_config , calculate ,
987+ err = calculate_module_search_path (core_config , calculate ,
988988 prefix , exec_prefix , config );
989989 if (_Py_INIT_FAILED (err )) {
990990 return err ;
@@ -1009,18 +1009,17 @@ calculate_path_impl(const _PyMainInterpreterConfig *main_config,
10091009
10101010
10111011_PyInitError
1012- _PyPathConfig_Calculate (_PyPathConfig * config ,
1013- const _PyMainInterpreterConfig * main_config )
1012+ _PyPathConfig_Calculate (_PyPathConfig * config , const _PyCoreConfig * core_config )
10141013{
10151014 PyCalculatePath calculate ;
10161015 memset (& calculate , 0 , sizeof (calculate ));
10171016
1018- _PyInitError err = calculate_init (& calculate , main_config );
1017+ _PyInitError err = calculate_init (& calculate , core_config );
10191018 if (_Py_INIT_FAILED (err )) {
10201019 goto done ;
10211020 }
10221021
1023- err = calculate_path_impl (main_config , & calculate , config );
1022+ err = calculate_path_impl (core_config , & calculate , config );
10241023 if (_Py_INIT_FAILED (err )) {
10251024 goto done ;
10261025 }
0 commit comments