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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [demos/] [c-code/] [myInit.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * myInit.c --
3
 *
4
 *      Initialze the Tix demo application.
5
 *
6
 * Copyright (c) 1996, Expert Interface Technologies
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
 */
12
 
13
#include <tk.h>
14
#include <tix.h>
15
 
16
#ifndef _Windows
17
#  ifndef _export
18
#  define _export
19
#  endif
20
#endif
21
 
22
extern TIX_DECLARE_CMD(My_AddTwoCmd);
23
extern TIX_DECLARE_CMD(My_SubTwoCmd);
24
 
25
#ifndef MY_LIBRARY
26
#define MY_LIBRARY "/usr/local/myapp"
27
#endif
28
 
29
 
30
static Tix_TclCmd commands[] = {
31
    {"myAddTwo",                My_AddTwoCmd},
32
    {"mySubTwo",                My_SubTwoCmd},
33
 
34
    /*
35
     * Make sure this list is terminated by a NULL element
36
     */
37
    {(char *) NULL,             (int (*)()) NULL}
38
};
39
 
40
/* My_Init --
41
 *
42
 *      This is the function to call in your Tcl_AppInit() function. It
43
 *      creates the commands of this application that are defined by
44
 *      C functions.
45
 */
46
int _export
47
My_Init(interp)
48
    Tcl_Interp * interp;
49
{
50
    /* Initialize the Tix commands */
51
    Tix_CreateCommands(interp, commands, (ClientData) NULL,
52
        (void (*)()) NULL);
53
 
54
    if (Tix_LoadTclLibrary(interp, "MY_LIBRARY", "my_library",
55
        "Init.tcl", MY_LIBRARY, "myapp") != TCL_OK) {
56
        return TCL_ERROR;
57
    }
58
 
59
    return TCL_OK;
60
}

powered by: WebSVN 2.1.0

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