mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Initial revision
This commit is contained in:
parent
37ba0bc50b
commit
667d704997
8 changed files with 1013 additions and 0 deletions
21
Python/frozen.c
Normal file
21
Python/frozen.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
/* In order to test the support for frozen modules, by default we
|
||||
define a single frozen module, __hello__. Loading it will print
|
||||
some famous words... */
|
||||
|
||||
static unsigned char M___hello__[] = {
|
||||
99,0,0,0,0,0,0,115,15,0,0,0,127,0,0,127,
|
||||
1,0,100,0,0,71,72,100,1,0,83,40,2,0,0,0,
|
||||
115,14,0,0,0,72,101,108,108,111,32,119,111,114,108,100,
|
||||
46,46,46,78,40,0,0,0,0,40,0,0,0,0,115,8,
|
||||
0,0,0,104,101,108,108,111,46,112,121,115,1,0,0,0,
|
||||
63,
|
||||
};
|
||||
|
||||
struct frozen {
|
||||
char *name;
|
||||
unsigned char *code;
|
||||
int size;
|
||||
} frozen_modules[] = {
|
||||
{"__hello__", M___hello__, 81},
|
||||
{0, 0, 0} /* sentinel */
|
||||
};
|
17
Python/getcompiler.c
Normal file
17
Python/getcompiler.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
#ifdef __GNUC__
|
||||
#define COMPILER " [GCC " __VERSION__ "]"
|
||||
#endif
|
||||
|
||||
#ifndef COMPILER
|
||||
#ifdef __cplusplus
|
||||
#define COMPILER "[C++]"
|
||||
#else
|
||||
#define COMPILER "[C]"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
char *
|
||||
getcompiler()
|
||||
{
|
||||
return COMPILER;
|
||||
}
|
7
Python/getcopyright.c
Normal file
7
Python/getcopyright.c
Normal file
|
@ -0,0 +1,7 @@
|
|||
/* Return the copyright string. This is updated manually. */
|
||||
|
||||
const char *
|
||||
getcopyright()
|
||||
{
|
||||
return "Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam";
|
||||
}
|
9
Python/getplatform.c
Normal file
9
Python/getplatform.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef PLATFORM
|
||||
#define PLATFORM "unknown"
|
||||
#endif
|
||||
|
||||
char *
|
||||
getplatform()
|
||||
{
|
||||
return PLATFORM;
|
||||
}
|
21
Python/getversion.c
Normal file
21
Python/getversion.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
/* Return the full version string. */
|
||||
|
||||
#include "patchlevel.h"
|
||||
|
||||
#define VERSION "%s (%s) %s"
|
||||
|
||||
#ifdef __DATE__
|
||||
#define DATE __DATE__
|
||||
#else
|
||||
#define DATE "August 1 1995"
|
||||
#endif
|
||||
|
||||
extern const char *getcompiler();
|
||||
|
||||
const char *
|
||||
getversion()
|
||||
{
|
||||
static char version[80];
|
||||
sprintf(version, VERSION, PATCHLEVEL, DATE, getcompiler());
|
||||
return version;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue