/RISCOS/Python/dynload_riscos.c

http://unladen-swallow.googlecode.com/ · C · 63 lines · 23 code · 8 blank · 32 comment · 1 complexity · 7b1f7675b8b6a64c44d39a58247f14f1 MD5 · raw file

  1. /***********************************************************
  2. Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  3. The Netherlands.
  4. All Rights Reserved
  5. Permission to use, copy, modify, and distribute this software and its
  6. documentation for any purpose and without fee is hereby granted,
  7. provided that the above copyright notice appear in all copies and that
  8. both that copyright notice and this permission notice appear in
  9. supporting documentation, and that the names of Stichting Mathematisch
  10. Centrum or CWI or Corporation for National Research Initiatives or
  11. CNRI not be used in advertising or publicity pertaining to
  12. distribution of the software without specific, written prior
  13. permission.
  14. While CWI is the initial source for this software, a modified version
  15. is made available by the Corporation for National Research Initiatives
  16. (CNRI) at the Internet address ftp://ftp.python.org.
  17. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
  18. REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  19. MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
  20. CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  21. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  22. PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  23. TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  24. PERFORMANCE OF THIS SOFTWARE.
  25. ******************************************************************/
  26. /* This module provides the necessary stubs for when dynamic loading is
  27. not present. */
  28. #include "Python.h"
  29. #include "importdl.h"
  30. #include "dlk.h"
  31. const struct filedescr _PyImport_DynLoadFiletab[] = {
  32. {"/pyd", "rb", C_EXTENSION},
  33. {0, 0}
  34. };
  35. void dynload_init_dummy()
  36. {
  37. }
  38. dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
  39. char *pathname, FILE *fp)
  40. {
  41. int err;
  42. char errstr[256];
  43. void (*init_function)(void);
  44. err = dlk_load_no_init(pathname, &init_function);
  45. if (err) {
  46. PyOS_snprintf(errstr, sizeof(errstr), "dlk failure %d", err);
  47. PyErr_SetString(PyExc_ImportError, errstr);
  48. }
  49. return init_function;
  50. }