Guido van Rossum | 582646a | 1996-05-28 22:30:17 +0000 | [diff] [blame] | 1 | /*********************************************************** |
| 2 | Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 3 | The Netherlands. |
| 4 | |
| 5 | All Rights Reserved |
| 6 | |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame^] | 7 | Copyright (c) 2000, BeOpen.com. |
| 8 | Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
| 9 | Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
| 10 | All rights reserved. |
Guido van Rossum | 582646a | 1996-05-28 22:30:17 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | fd71b9e | 2000-06-30 23:50:40 +0000 | [diff] [blame^] | 12 | See the file "Misc/COPYRIGHT" for information on usage and |
| 13 | redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
Guido van Rossum | 582646a | 1996-05-28 22:30:17 +0000 | [diff] [blame] | 14 | |
| 15 | ******************************************************************/ |
| 16 | |
| 17 | /* Dummy frozen modules initializer */ |
| 18 | |
| 19 | #include "Python.h" |
| 20 | |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 21 | /* In order to test the support for frozen modules, by default we |
| 22 | define a single frozen module, __hello__. Loading it will print |
| 23 | some famous words... */ |
| 24 | |
| 25 | static unsigned char M___hello__[] = { |
Guido van Rossum | 019db5d | 1997-07-19 21:54:24 +0000 | [diff] [blame] | 26 | 99,0,0,0,0,1,0,0,0,115,15,0,0,0,127,0, |
| 27 | 0,127,1,0,100,0,0,71,72,100,1,0,83,40,2,0, |
| 28 | 0,0,115,14,0,0,0,72,101,108,108,111,32,119,111,114, |
| 29 | 108,100,46,46,46,78,40,0,0,0,0,40,0,0,0,0, |
| 30 | 115,8,0,0,0,104,101,108,108,111,46,112,121,115,1,0, |
| 31 | 0,0,63,1,0,115,0,0,0,0, |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 32 | }; |
| 33 | |
Guido van Rossum | 7c46a92 | 1996-06-17 17:07:23 +0000 | [diff] [blame] | 34 | static struct _frozen _PyImport_FrozenModules[] = { |
Guido van Rossum | f015e18 | 1998-04-03 21:10:36 +0000 | [diff] [blame] | 35 | /* Test module */ |
Guido van Rossum | 019db5d | 1997-07-19 21:54:24 +0000 | [diff] [blame] | 36 | {"__hello__", M___hello__, 90}, |
Guido van Rossum | f015e18 | 1998-04-03 21:10:36 +0000 | [diff] [blame] | 37 | /* Test package (negative size indicates package-ness) */ |
| 38 | {"__phello__", M___hello__, -90}, |
| 39 | {"__phello__.spam", M___hello__, 90}, |
Guido van Rossum | 667d704 | 1995-08-04 04:20:48 +0000 | [diff] [blame] | 40 | {0, 0, 0} /* sentinel */ |
| 41 | }; |
Guido van Rossum | 7c46a92 | 1996-06-17 17:07:23 +0000 | [diff] [blame] | 42 | |
| 43 | /* Embedding apps may change this pointer to point to their favorite |
| 44 | collection of frozen modules: */ |
| 45 | |
| 46 | struct _frozen *PyImport_FrozenModules = _PyImport_FrozenModules; |