blob: d2a7353c1c1770cf80845361deb10766e6dde698 [file] [log] [blame]
Guido van Rossum582646a1996-05-28 22:30:17 +00001/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00002Copyright (c) 2000, BeOpen.com.
3Copyright (c) 1995-2000, Corporation for National Research Initiatives.
4Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
5All rights reserved.
Guido van Rossum582646a1996-05-28 22:30:17 +00006
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00007See the file "Misc/COPYRIGHT" for information on usage and
8redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossum582646a1996-05-28 22:30:17 +00009******************************************************************/
10
11/* Dummy frozen modules initializer */
12
13#include "Python.h"
14
Guido van Rossum667d7041995-08-04 04:20:48 +000015/* In order to test the support for frozen modules, by default we
16 define a single frozen module, __hello__. Loading it will print
17 some famous words... */
18
19static unsigned char M___hello__[] = {
Guido van Rossum019db5d1997-07-19 21:54:24 +000020 99,0,0,0,0,1,0,0,0,115,15,0,0,0,127,0,
21 0,127,1,0,100,0,0,71,72,100,1,0,83,40,2,0,
22 0,0,115,14,0,0,0,72,101,108,108,111,32,119,111,114,
23 108,100,46,46,46,78,40,0,0,0,0,40,0,0,0,0,
24 115,8,0,0,0,104,101,108,108,111,46,112,121,115,1,0,
25 0,0,63,1,0,115,0,0,0,0,
Guido van Rossum667d7041995-08-04 04:20:48 +000026};
27
Guido van Rossum7c46a921996-06-17 17:07:23 +000028static struct _frozen _PyImport_FrozenModules[] = {
Guido van Rossumf015e181998-04-03 21:10:36 +000029 /* Test module */
Guido van Rossum019db5d1997-07-19 21:54:24 +000030 {"__hello__", M___hello__, 90},
Guido van Rossumf015e181998-04-03 21:10:36 +000031 /* Test package (negative size indicates package-ness) */
32 {"__phello__", M___hello__, -90},
33 {"__phello__.spam", M___hello__, 90},
Guido van Rossum667d7041995-08-04 04:20:48 +000034 {0, 0, 0} /* sentinel */
35};
Guido van Rossum7c46a921996-06-17 17:07:23 +000036
37/* Embedding apps may change this pointer to point to their favorite
38 collection of frozen modules: */
39
40struct _frozen *PyImport_FrozenModules = _PyImport_FrozenModules;