File: tixError.c

package info (click to toggle)
tix 8.4.3-10
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 9,080 kB
  • ctags: 7,129
  • sloc: ansic: 28,082; tcl: 22,774; python: 7,577; makefile: 331; cs: 253; sh: 210; perl: 128
file content (80 lines) | stat: -rw-r--r-- 1,933 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

/*	$Id: tixError.c,v 1.2 2004/03/28 02:44:56 hobbs Exp $	*/

/*
 * tixError.c --
 *
 *	Implements error handlers for Tix.
 *
 * Copyright (c) 1996, Expert Interface Technologies
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 */

#include <tixPort.h>
#include <tixInt.h>

int Tix_ArgcError(interp, argc, argv, prefixCount, message)
    Tcl_Interp	      * interp;
    int			argc;
    CONST84 char     ** argv;
    int			prefixCount;
    CONST84 char      * message;
{
    int i;

    Tcl_AppendResult(interp, "wrong # of arguments, should be \"",(char*)NULL);

    for (i=0; i<prefixCount && i<argc; i++) {
	Tcl_AppendResult(interp, argv[i], " ", (char*)NULL);
    }

    Tcl_AppendResult(interp, message, "\".", (char*)NULL);

    return TCL_ERROR;
}

int Tix_ValueMissingError(interp, spec)
    Tcl_Interp	      * interp;
    CONST84 char      * spec;
{
    Tcl_AppendResult(interp, "value for \"", spec,
	"\" missing", (char*)NULL);
    return TCL_ERROR;
}


/*----------------------------------------------------------------------
 * Tix_UnknownPublicMethodError --
 *
 *
 * ToDo: sort the list of commands.
 *----------------------------------------------------------------------
 */
int Tix_UnknownPublicMethodError(interp, cPtr, widRec, method)
    Tcl_Interp	      * interp;
    TixClassRecord    * cPtr;
    CONST84 char      * widRec;
    CONST84 char      * method;
{
    int	    i;
    CONST84 char  * lead = "";

    Tcl_AppendResult(interp, "unknown option \"", method, 
	"\": must be ",
	(char*)NULL);

    for (i=0; i<cPtr->nMethods-1; i++) {
	Tcl_AppendResult(interp, lead, cPtr->methods[i], (char*)NULL);
	lead = ", ";
    }
    if (cPtr->nMethods>1) {
	Tcl_AppendResult(interp, " or ", (char*)NULL);
    }
    if (cPtr->nMethods>0) {
	Tcl_AppendResult(interp, cPtr->methods[i], (char*)NULL);
    }
    return TCL_ERROR;
}