annotate RISCOS/Python/dynload_riscos.c @ 49955:878d40468c4e legacy-trunk

Issue #4384: Added logging integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging.
author Vinay Sajip <vinay_sajip@yahoo.co.uk>
date Wed, 03 Dec 2008 23:22:58 +0000
parents 379fc66f4c96
children fd25030223b0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16941
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
1 /***********************************************************
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
3 The Netherlands.
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
4
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 All Rights Reserved
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 Permission to use, copy, modify, and distribute this software and its
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 documentation for any purpose and without fee is hereby granted,
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
9 provided that the above copyright notice appear in all copies and that
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 both that copyright notice and this permission notice appear in
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 supporting documentation, and that the names of Stichting Mathematisch
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 Centrum or CWI or Corporation for National Research Initiatives or
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 CNRI not be used in advertising or publicity pertaining to
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 distribution of the software without specific, written prior
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 permission.
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
16
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 While CWI is the initial source for this software, a modified version
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 is made available by the Corporation for National Research Initiatives
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 (CNRI) at the Internet address ftp://ftp.python.org.
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
20
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 PERFORMANCE OF THIS SOFTWARE.
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
29
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 ******************************************************************/
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
31
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 /* This module provides the necessary stubs for when dynamic loading is
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 not present. */
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
34
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 #include "Python.h"
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 #include "importdl.h"
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
37
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 #include "dlk.h"
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
39
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
40
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
41 const struct filedescr _PyImport_DynLoadFiletab[] = {
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
42 {"/pyd", "rb", C_EXTENSION},
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
43 {0, 0}
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
44 };
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
45
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 void dynload_init_dummy()
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 {
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 }
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
49
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
51 char *pathname, FILE *fp)
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
52 {
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
53 int err;
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
54 char errstr[256];
20652
2d3cee9f1633 SF patch #474590 -- RISC OS support
Guido van Rossum <guido@python.org>
parents: 16941
diff changeset
55 void (*init_function)(void);
16941
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
56
20652
2d3cee9f1633 SF patch #474590 -- RISC OS support
Guido van Rossum <guido@python.org>
parents: 16941
diff changeset
57 err = dlk_load_no_init(pathname, &init_function);
21077
379fc66f4c96 Use PyOS_snprintf instead of sprintf.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 20652
diff changeset
58 if (err) {
379fc66f4c96 Use PyOS_snprintf instead of sprintf.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 20652
diff changeset
59 PyOS_snprintf(errstr, sizeof(errstr), "dlk failure %d", err);
379fc66f4c96 Use PyOS_snprintf instead of sprintf.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 20652
diff changeset
60 PyErr_SetString(PyExc_ImportError, errstr);
16941
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
61 }
20652
2d3cee9f1633 SF patch #474590 -- RISC OS support
Guido van Rossum <guido@python.org>
parents: 16941
diff changeset
62 return init_function;
16941
a015aed3a1ac RISCOS files by dschwertberger
Guido van Rossum <guido@python.org>
parents:
diff changeset
63 }