mirror of
https://github.com/python/cpython.git
synced 2025-11-08 17:41:42 +00:00
ANSI-fied sources, converted to four-space indentation.
This commit is contained in:
parent
da940d8f8d
commit
edabdc1e9e
1 changed files with 329 additions and 338 deletions
|
|
@ -139,8 +139,7 @@ static char *module_search_path = NULL;
|
||||||
static char lib_python[20]; /* Dynamically set to "lib/python" VERSION */
|
static char lib_python[20]; /* Dynamically set to "lib/python" VERSION */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reduce(dir)
|
reduce(char *dir)
|
||||||
char *dir;
|
|
||||||
{
|
{
|
||||||
size_t i = strlen(dir);
|
size_t i = strlen(dir);
|
||||||
while (i > 0 && dir[i] != SEP)
|
while (i > 0 && dir[i] != SEP)
|
||||||
|
|
@ -158,8 +157,7 @@ reduce(dir)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
isfile(filename) /* Is file, not directory */
|
isfile(char *filename) /* Is file, not directory */
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if (stat(filename, &buf) != 0)
|
if (stat(filename, &buf) != 0)
|
||||||
|
|
@ -171,8 +169,7 @@ isfile(filename) /* Is file, not directory */
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ismodule(filename) /* Is module -- check for .pyc/.pyo too */
|
ismodule(char *filename) /* Is module -- check for .pyc/.pyo too */
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
if (isfile(filename))
|
if (isfile(filename))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -188,8 +185,7 @@ ismodule(filename) /* Is module -- check for .pyc/.pyo too */
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
isxfile(filename) /* Is executable file */
|
isxfile(char *filename) /* Is executable file */
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if (stat(filename, &buf) != 0)
|
if (stat(filename, &buf) != 0)
|
||||||
|
|
@ -203,8 +199,7 @@ isxfile(filename) /* Is executable file */
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
isdir(filename) /* Is directory */
|
isdir(char *filename) /* Is directory */
|
||||||
char *filename;
|
|
||||||
{
|
{
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
if (stat(filename, &buf) != 0)
|
if (stat(filename, &buf) != 0)
|
||||||
|
|
@ -216,9 +211,7 @@ isdir(filename) /* Is directory */
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
joinpath(buffer, stuff)
|
joinpath(char *buffer, char *stuff)
|
||||||
char *buffer;
|
|
||||||
char *stuff;
|
|
||||||
{
|
{
|
||||||
size_t n, k;
|
size_t n, k;
|
||||||
if (stuff[0] == SEP)
|
if (stuff[0] == SEP)
|
||||||
|
|
@ -237,9 +230,7 @@ joinpath(buffer, stuff)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
search_for_prefix(argv0_path, home)
|
search_for_prefix(char *argv0_path, char *home)
|
||||||
char *argv0_path;
|
|
||||||
char *home;
|
|
||||||
{
|
{
|
||||||
size_t n;
|
size_t n;
|
||||||
char *vpath;
|
char *vpath;
|
||||||
|
|
@ -306,9 +297,7 @@ search_for_prefix(argv0_path, home)
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
search_for_exec_prefix(argv0_path, home)
|
search_for_exec_prefix(char *argv0_path, char *home)
|
||||||
char *argv0_path;
|
|
||||||
char *home;
|
|
||||||
{
|
{
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
|
|
@ -389,8 +378,10 @@ calculate_path()
|
||||||
|
|
||||||
/* Frameworks have support for versioning */
|
/* Frameworks have support for versioning */
|
||||||
strcpy(lib_python, "lib");
|
strcpy(lib_python, "lib");
|
||||||
} else {
|
}
|
||||||
/* If we're not in a framework, fall back to the old way (even though NSNameOfModule() probably does the same thing.) */
|
else {
|
||||||
|
/* If we're not in a framework, fall back to the old way
|
||||||
|
(even though NSNameOfModule() probably does the same thing.) */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize this dynamically for K&R C */
|
/* Initialize this dynamically for K&R C */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue