OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tcl8.6.12 / generic / tclLoadNone.c
1 /*
2  * tclLoadNone.c --
3  *
4  *      This procedure provides a version of the TclpDlopen for use in
5  *      systems that don't support dynamic loading; it just returns an error.
6  *
7  * Copyright (c) 1995-1997 Sun Microsystems, Inc.
8  *
9  * See the file "license.terms" for information on usage and redistribution of
10  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
11  */
12
13 #include "tclInt.h"
14 \f
15 /*
16  *----------------------------------------------------------------------
17  *
18  * TclpDlopen --
19  *
20  *      This procedure is called to carry out dynamic loading of binary code;
21  *      it is intended for use only on systems that don't support dynamic
22  *      loading (it returns an error).
23  *
24  * Results:
25  *      The result is TCL_ERROR, and an error message is left in the interp's
26  *      result.
27  *
28  * Side effects:
29  *      None.
30  *
31  *----------------------------------------------------------------------
32  */
33
34 int
35 TclpDlopen(
36     Tcl_Interp *interp,         /* Used for error reporting. */
37     Tcl_Obj *pathPtr,           /* Name of the file containing the desired
38                                  * code (UTF-8). */
39     Tcl_LoadHandle *loadHandle, /* Filled with token for dynamically loaded
40                                  * file which will be passed back to
41                                  * (*unloadProcPtr)() to unload the file. */
42     Tcl_FSUnloadFileProc **unloadProcPtr,
43                                 /* Filled with address of Tcl_FSUnloadFileProc
44                                  * function which should be used for this
45                                  * file. */
46     int flags)
47 {
48     if (interp) {
49         Tcl_SetObjResult(interp, Tcl_NewStringObj(
50                 "dynamic loading is not currently available on this system",
51                 -1));
52     }
53     return TCL_ERROR;
54 }
55 \f
56 /*
57  *----------------------------------------------------------------------
58  *
59  * TclGuessPackageName --
60  *
61  *      If the "load" command is invoked without providing a package name,
62  *      this procedure is invoked to try to figure it out.
63  *
64  * Results:
65  *      Always returns 0 to indicate that we couldn't figure out a package
66  *      name; generic code will then try to guess the package from the file
67  *      name. A return value of 1 would have meant that we figured out the
68  *      package name and put it in bufPtr.
69  *
70  * Side effects:
71  *      None.
72  *
73  *----------------------------------------------------------------------
74  */
75
76 int
77 TclGuessPackageName(
78     const char *fileName,       /* Name of file containing package (already
79                                  * translated to local form if needed). */
80     Tcl_DString *bufPtr)        /* Initialized empty dstring. Append package
81                                  * name to this if possible. */
82 {
83     return 0;
84 }
85 \f
86 /*
87  * These functions are fallbacks if we somehow determine that the platform can
88  * do loading from memory but the user wishes to disable it. They just report
89  * (gracefully) that they fail.
90  */
91
92 #ifdef TCL_LOAD_FROM_MEMORY
93
94 MODULE_SCOPE void *
95 TclpLoadMemoryGetBuffer(
96     Tcl_Interp *interp,         /* Dummy: unused by this implementation */
97     int size)                   /* Dummy: unused by this implementation */
98 {
99     return NULL;
100 }
101
102 MODULE_SCOPE int
103 TclpLoadMemory(
104     Tcl_Interp *interp,         /* Used for error reporting. */
105     void *buffer,               /* Dummy: unused by this implementation */
106     int size,                   /* Dummy: unused by this implementation */
107     int codeSize,               /* Dummy: unused by this implementation */
108     Tcl_LoadHandle *loadHandle, /* Dummy: unused by this implementation */
109     Tcl_FSUnloadFileProc **unloadProcPtr,
110                                 /* Dummy: unused by this implementation */
111     int flags)
112                                 /* Dummy: unused by this implementation */
113 {
114     if (interp) {
115         Tcl_SetObjResult(interp, Tcl_NewStringObj("dynamic loading from memory "
116                 "is not available on this system", -1));
117     }
118     return TCL_ERROR;
119 }
120
121 #endif /* TCL_LOAD_FROM_MEMORY */
122 \f
123 /*
124  * Local Variables:
125  * mode: c
126  * c-basic-offset: 4
127  * fill-column: 78
128  * End:
129  */