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

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [insight/] [tix/] [generic/] [tixError.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * tixError.c --
3
 *
4
 *      Implements error handlers for Tix.
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 <tixPort.h>
14
#include <tixInt.h>
15
 
16
int Tix_ArgcError(interp, argc, argv, prefixCount, message)
17
    Tcl_Interp        * interp;
18
    int                 argc;
19
    char             ** argv;
20
    int                 prefixCount;
21
    char              * message;
22
{
23
    int i;
24
 
25
    Tcl_AppendResult(interp, "wrong # of arguments, should be \"",(char*)NULL);
26
 
27
    for (i=0; i<prefixCount && i<argc; i++) {
28
        Tcl_AppendResult(interp, argv[i], " ", (char*)NULL);
29
    }
30
 
31
    Tcl_AppendResult(interp, message, "\".", (char*)NULL);
32
 
33
    return TCL_ERROR;
34
}
35
 
36
int Tix_ValueMissingError(interp, spec)
37
    Tcl_Interp        * interp;
38
    char              * spec;
39
{
40
    Tcl_AppendResult(interp, "value for \"", spec,
41
        "\" missing", (char*)NULL);
42
    return TCL_ERROR;
43
}
44
 
45
 
46
/*----------------------------------------------------------------------
47
 * Tix_UnknownPublicMethodError --
48
 *
49
 *
50
 * ToDo: sort the list of commands.
51
 *----------------------------------------------------------------------
52
 */
53
int Tix_UnknownPublicMethodError(interp, cPtr, widRec, method)
54
    Tcl_Interp        * interp;
55
    TixClassRecord    * cPtr;
56
    char              * widRec;
57
    char              * method;
58
{
59
    int     i;
60
    char  * lead = "";
61
 
62
    Tcl_AppendResult(interp, "unknown option \"", method,
63
        "\": must be ",
64
        (char*)NULL);
65
 
66
    for (i=0; i<cPtr->nMethods-1; i++) {
67
        Tcl_AppendResult(interp, lead, cPtr->methods[i], (char*)NULL);
68
        lead = ", ";
69
    }
70
    if (cPtr->nMethods>1) {
71
        Tcl_AppendResult(interp, " or ", (char*)NULL);
72
    }
73
    if (cPtr->nMethods>0) {
74
        Tcl_AppendResult(interp, cPtr->methods[i], (char*)NULL);
75
    }
76
    return TCL_ERROR;
77
}

powered by: WebSVN 2.1.0

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