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