source: trunk/packages/vizservers/nanovis/CmdProc.h @ 2831

Last change on this file since 2831 was 2831, checked in by ldelgass, 7 years ago

Refactor texture classes, misc. cleanups, cut down on header pollution -- still
need to fix header deps in Makefile.in

  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 *-------------------------------------------------------------------------------
4 *
5 * CmdSpec.h --
6 *
7 *      Generic function prototype of CmdOptions.
8 *
9 *-------------------------------------------------------------------------------
10 */
11
12#ifndef CMDSPEC_H
13#define CMDSPEC_H
14
15namespace Rappture {
16
17/*
18 *-------------------------------------------------------------------------------
19 *
20 * CmdSpec --
21 *
22 *      Structure to specify a set of operations for a Tcl command.
23 *      This is passed to the Blt_GetOp procedure to look
24 *      for a function pointer associated with the operation name.
25 *
26 *-------------------------------------------------------------------------------
27 */
28typedef struct {
29    const char *name;           /* Name of operation */
30    int minChars;               /* Minimum # characters to disambiguate */
31    Tcl_ObjCmdProc *proc;
32    int minArgs;                /* Minimum # args required */
33    int maxArgs;                /* Maximum # args required */
34    const char *usage;          /* Usage message */
35} CmdSpec;
36
37typedef enum {
38    CMDSPEC_ARG0,               /* Op is the first argument. */
39    CMDSPEC_ARG1,               /* Op is the second argument. */
40    CMDSPEC_ARG2,               /* Op is the third argument. */
41    CMDSPEC_ARG3,               /* Op is the fourth argument. */
42    CMDSPEC_ARG4                /* Op is the fifth argument. */
43} CmdSpecIndex;
44
45#define CMDSPEC_LINEAR_SEARCH   1
46#define CMDSPEC_BINARY_SEARCH   0
47
48extern Tcl_ObjCmdProc *
49GetOpFromObj(Tcl_Interp *interp, int nSpecs, 
50             CmdSpec *specs, int operPos, int objc, Tcl_Obj *const *objv, int flags);
51
52#define NumCmdSpecs(s) (sizeof(s) / sizeof(Rappture::CmdSpec))
53
54}
55
56#endif /* CMDSPEC_H */
Note: See TracBrowser for help on using the repository browser.