OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [insight/] [tk/] [win/] [tkWin32Dll.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * tkWin32Dll.c --
3
 *
4
 *      This file contains a stub dll entry point.
5
 *
6
 * Copyright (c) 1995 Sun Microsystems, Inc.
7
 *
8
 * See the file "license.terms" for information on usage and redistribution
9
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10
 *
11
 * RCS: @(#) $Id: tkWin32Dll.c,v 1.1.1.1 2002-01-16 10:26:02 markom Exp $
12
 */
13
 
14
#include "tkPort.h"
15
#include "tkWinInt.h"
16
 
17
/*
18
 * The following declaration is for the VC++ DLL entry point.
19
 */
20
 
21
BOOL APIENTRY           DllMain _ANSI_ARGS_((HINSTANCE hInst,
22
                            DWORD reason, LPVOID reserved));
23
/* CYGNUS LOCAL */
24
#ifdef __CYGWIN32__
25
/* cygwin32 requires an impure pointer variable, which must be
26
   explicitly initialized when the DLL starts up.  */
27
struct _reent *_impure_ptr;
28
extern struct _reent *_imp__reent_data;
29
#endif
30
/* END CYGNUS LOCAL */
31
 
32
/*
33
 *----------------------------------------------------------------------
34
 *
35
 * DllEntryPoint --
36
 *
37
 *      This wrapper function is used by Borland to invoke the
38
 *      initialization code for Tk.  It simply calls the DllMain
39
 *      routine.
40
 *
41
 * Results:
42
 *      See DllMain.
43
 *
44
 * Side effects:
45
 *      See DllMain.
46
 *
47
 *----------------------------------------------------------------------
48
 */
49
 
50
BOOL APIENTRY
51
DllEntryPoint(hInst, reason, reserved)
52
    HINSTANCE hInst;            /* Library instance handle. */
53
    DWORD reason;               /* Reason this function is being called. */
54
    LPVOID reserved;            /* Not used. */
55
{
56
    return DllMain(hInst, reason, reserved);
57
}
58
 
59
/*
60
 *----------------------------------------------------------------------
61
 *
62
 * DllMain --
63
 *
64
 *      DLL entry point.
65
 *
66
 * Results:
67
 *      TRUE on sucess, FALSE on failure.
68
 *
69
 * Side effects:
70
 *      None.
71
 *
72
 *----------------------------------------------------------------------
73
 */
74
 
75
BOOL APIENTRY
76
DllMain(hInstance, reason, reserved)
77
    HINSTANCE hInstance;
78
    DWORD reason;
79
    LPVOID reserved;
80
{
81
    /* CYGNUS LOCAL */
82
#ifdef __CYGWIN32__
83
    /* cygwin32 requires the impure data pointer to be initialized
84
       when the DLL starts up.  */
85
    _impure_ptr = _imp__reent_data;
86
#endif
87
    /* END CYGNUS LOCAL */
88
 
89
    /*
90
     * If we are attaching to the DLL from a new process, tell Tk about
91
     * the hInstance to use. If we are detaching then clean up any
92
     * data structures related to this DLL.
93
     */
94
 
95
    if (reason == DLL_PROCESS_ATTACH) {
96
        TkWinXInit(hInstance);
97
    } else if (reason == DLL_PROCESS_DETACH) {
98
        TkWinXCleanup(hInstance);
99
    }
100
    return(TRUE);
101
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.