source: trunk/packages/vizservers/geovis/CmdProc.h @ 3998

Last change on this file since 3998 was 3998, checked in by ldelgass, 10 years ago

Add prelimilary skeleton for geovis map rendering server. Not functional, not
integrated into configure, etc.

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