You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

31 years ago
31 years ago
31 years ago
31 years ago
  1. /* Dummy frozen modules initializer */
  2. #include "Python.h"
  3. /* In order to test the support for frozen modules, by default we
  4. define a single frozen module, __hello__. Loading it will print
  5. some famous words... */
  6. /* To regenerate this data after the bytecode or marshal format has changed,
  7. go to ../Tools/freeze/ and freeze the hello.py file; then copy and paste
  8. the appropriate bytes from M___main__.c. */
  9. static unsigned char M___hello__[] = {
  10. 99,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
  11. 0,115,9,0,0,0,100,0,0,71,72,100,1,0,83,40,
  12. 2,0,0,0,115,14,0,0,0,72,101,108,108,111,32,119,
  13. 111,114,108,100,46,46,46,78,40,0,0,0,0,40,0,0,
  14. 0,0,40,0,0,0,0,40,0,0,0,0,115,8,0,0,
  15. 0,104,101,108,108,111,46,112,121,115,1,0,0,0,63,1,
  16. 0,0,0,115,0,0,0,0,
  17. };
  18. #define SIZE (int)sizeof(M___hello__)
  19. static struct _frozen _PyImport_FrozenModules[] = {
  20. /* Test module */
  21. {"__hello__", M___hello__, SIZE},
  22. /* Test package (negative size indicates package-ness) */
  23. {"__phello__", M___hello__, -SIZE},
  24. {"__phello__.spam", M___hello__, SIZE},
  25. {0, 0, 0} /* sentinel */
  26. };
  27. /* Embedding apps may change this pointer to point to their favorite
  28. collection of frozen modules: */
  29. struct _frozen *PyImport_FrozenModules = _PyImport_FrozenModules;