source: nanovis/branches/1.1/CmdProc.h @ 4804

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

Add basic VTK structured points reader to nanovis, update copyright dates.

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