os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/generic/tclLoadNone.c
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/* 
sl@0
     2
 * tclLoadNone.c --
sl@0
     3
 *
sl@0
     4
 *	This procedure provides a version of the TclLoadFile for use
sl@0
     5
 *	in systems that don't support dynamic loading; it just returns
sl@0
     6
 *	an error.
sl@0
     7
 *
sl@0
     8
 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
sl@0
     9
 *
sl@0
    10
 * See the file "license.terms" for information on usage and redistribution
sl@0
    11
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
sl@0
    12
 *
sl@0
    13
 * RCS: @(#) $Id: tclLoadNone.c,v 1.11 2002/07/18 16:26:03 vincentdarley Exp $
sl@0
    14
 */
sl@0
    15
sl@0
    16
#include "tclInt.h"
sl@0
    17

sl@0
    18
/*
sl@0
    19
 *----------------------------------------------------------------------
sl@0
    20
 *
sl@0
    21
 * TclpDlopen --
sl@0
    22
 *
sl@0
    23
 *	This procedure is called to carry out dynamic loading of binary
sl@0
    24
 *	code;  it is intended for use only on systems that don't support
sl@0
    25
 *	dynamic loading (it returns an error).
sl@0
    26
 *
sl@0
    27
 * Results:
sl@0
    28
 *	The result is TCL_ERROR, and an error message is left in
sl@0
    29
 *	the interp's result.
sl@0
    30
 *
sl@0
    31
 * Side effects:
sl@0
    32
 *	None.
sl@0
    33
 *
sl@0
    34
 *----------------------------------------------------------------------
sl@0
    35
 */
sl@0
    36
sl@0
    37
int
sl@0
    38
TclpDlopen(interp, pathPtr, loadHandle, unloadProcPtr)
sl@0
    39
    Tcl_Interp *interp;		/* Used for error reporting. */
sl@0
    40
    Tcl_Obj *pathPtr;		/* Name of the file containing the desired
sl@0
    41
				 * code (UTF-8). */
sl@0
    42
    Tcl_LoadHandle *loadHandle;	/* Filled with token for dynamically loaded
sl@0
    43
				 * file which will be passed back to 
sl@0
    44
				 * (*unloadProcPtr)() to unload the file. */
sl@0
    45
    Tcl_FSUnloadFileProc **unloadProcPtr;	
sl@0
    46
				/* Filled with address of Tcl_FSUnloadFileProc
sl@0
    47
				 * function which should be used for
sl@0
    48
				 * this file. */
sl@0
    49
{
sl@0
    50
    Tcl_SetResult(interp,
sl@0
    51
	    "dynamic loading is not currently available on this system",
sl@0
    52
	    TCL_STATIC);
sl@0
    53
    return TCL_ERROR;
sl@0
    54
}
sl@0
    55

sl@0
    56
/*
sl@0
    57
 *----------------------------------------------------------------------
sl@0
    58
 *
sl@0
    59
 * TclpFindSymbol --
sl@0
    60
 *
sl@0
    61
 *	Looks up a symbol, by name, through a handle associated with
sl@0
    62
 *	a previously loaded piece of code (shared library).
sl@0
    63
 *
sl@0
    64
 * Results:
sl@0
    65
 *	Returns a pointer to the function associated with 'symbol' if
sl@0
    66
 *	it is found.  Otherwise returns NULL and may leave an error
sl@0
    67
 *	message in the interp's result.
sl@0
    68
 *
sl@0
    69
 *----------------------------------------------------------------------
sl@0
    70
 */
sl@0
    71
Tcl_PackageInitProc*
sl@0
    72
TclpFindSymbol(interp, loadHandle, symbol) 
sl@0
    73
    Tcl_Interp *interp;
sl@0
    74
    Tcl_LoadHandle loadHandle;
sl@0
    75
    CONST char *symbol;
sl@0
    76
{
sl@0
    77
    return NULL;
sl@0
    78
}
sl@0
    79

sl@0
    80
/*
sl@0
    81
 *----------------------------------------------------------------------
sl@0
    82
 *
sl@0
    83
 * TclGuessPackageName --
sl@0
    84
 *
sl@0
    85
 *	If the "load" command is invoked without providing a package
sl@0
    86
 *	name, this procedure is invoked to try to figure it out.
sl@0
    87
 *
sl@0
    88
 * Results:
sl@0
    89
 *	Always returns 0 to indicate that we couldn't figure out a
sl@0
    90
 *	package name;  generic code will then try to guess the package
sl@0
    91
 *	from the file name.  A return value of 1 would have meant that
sl@0
    92
 *	we figured out the package name and put it in bufPtr.
sl@0
    93
 *
sl@0
    94
 * Side effects:
sl@0
    95
 *	None.
sl@0
    96
 *
sl@0
    97
 *----------------------------------------------------------------------
sl@0
    98
 */
sl@0
    99
sl@0
   100
int
sl@0
   101
TclGuessPackageName(fileName, bufPtr)
sl@0
   102
    CONST char *fileName;	/* Name of file containing package (already
sl@0
   103
				 * translated to local form if needed). */
sl@0
   104
    Tcl_DString *bufPtr;	/* Initialized empty dstring.  Append
sl@0
   105
				 * package name to this if possible. */
sl@0
   106
{
sl@0
   107
    return 0;
sl@0
   108
}
sl@0
   109

sl@0
   110
/*
sl@0
   111
 *----------------------------------------------------------------------
sl@0
   112
 *
sl@0
   113
 * TclpUnloadFile --
sl@0
   114
 *
sl@0
   115
 *    This procedure is called to carry out dynamic unloading of binary
sl@0
   116
 *    code;  it is intended for use only on systems that don't support
sl@0
   117
 *    dynamic loading (it does nothing).
sl@0
   118
 *
sl@0
   119
 * Results:
sl@0
   120
 *    None.
sl@0
   121
 *
sl@0
   122
 * Side effects:
sl@0
   123
 *    None.
sl@0
   124
 *
sl@0
   125
 *----------------------------------------------------------------------
sl@0
   126
 */
sl@0
   127
sl@0
   128
void
sl@0
   129
TclpUnloadFile(loadHandle)
sl@0
   130
    Tcl_LoadHandle loadHandle;	/* loadHandle returned by a previous call
sl@0
   131
				 * to TclpDlopen().  The loadHandle is 
sl@0
   132
				 * a token that represents the loaded 
sl@0
   133
				 * file. */
sl@0
   134
{
sl@0
   135
}