[3597] | 1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
| 2 | /* |
---|
| 3 | * Copyright (c) 2004-2013 HUBzero Foundation, LLC |
---|
| 4 | * |
---|
| 5 | * Authors: |
---|
| 6 | * Wei Qiao <qiaow@purdue.edu> |
---|
| 7 | * Insoo Woo <iwoo@purdue.edu> |
---|
| 8 | * George A. Howlett <gah@purdue.edu> |
---|
| 9 | * Leif Delgass <ldelgass@purdue.edu> |
---|
| 10 | */ |
---|
[3613] | 11 | #ifndef NV_COMMAND_H |
---|
| 12 | #define NV_COMMAND_H |
---|
[3597] | 13 | |
---|
| 14 | #include <tcl.h> |
---|
| 15 | |
---|
[3605] | 16 | #include <RpBuffer.h> |
---|
| 17 | |
---|
| 18 | #include "ResponseQueue.h" |
---|
| 19 | |
---|
[3597] | 20 | namespace Rappture { |
---|
| 21 | class Buffer; |
---|
| 22 | } |
---|
| 23 | |
---|
[3605] | 24 | namespace nv { |
---|
[3611] | 25 | |
---|
[3605] | 26 | class ReadBuffer; |
---|
[3611] | 27 | class Volume; |
---|
[3605] | 28 | |
---|
| 29 | #ifdef USE_THREADS |
---|
| 30 | extern void queueResponse(const void *bytes, size_t len, |
---|
| 31 | Response::AllocationType allocType, |
---|
| 32 | Response::ResponseType type = Response::DATA); |
---|
| 33 | #else |
---|
| 34 | extern ssize_t SocketWrite(const void *bytes, size_t len); |
---|
| 35 | #endif |
---|
| 36 | |
---|
| 37 | extern bool SocketRead(char *bytes, size_t len); |
---|
| 38 | |
---|
| 39 | extern int processCommands(Tcl_Interp *interp, |
---|
| 40 | ReadBuffer *inBufPtr, |
---|
| 41 | int fdOut); |
---|
| 42 | |
---|
| 43 | extern int handleError(Tcl_Interp *interp, |
---|
| 44 | int status, |
---|
| 45 | int fdOut); |
---|
| 46 | |
---|
| 47 | extern void initTcl(Tcl_Interp *interp, ClientData clientData); |
---|
| 48 | |
---|
[3597] | 49 | extern int GetAxisFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, |
---|
| 50 | int *axisVal); |
---|
| 51 | |
---|
[3607] | 52 | extern int GetBooleanFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, |
---|
[3597] | 53 | bool *boolVal); |
---|
| 54 | |
---|
| 55 | extern int GetDataStream(Tcl_Interp *interp, Rappture::Buffer &buf, int nBytes); |
---|
| 56 | |
---|
| 57 | extern int GetFloatFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, |
---|
| 58 | float *floatVal); |
---|
| 59 | |
---|
| 60 | extern int GetVolumeFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, |
---|
| 61 | Volume **volume); |
---|
| 62 | |
---|
[3611] | 63 | } |
---|
| 64 | |
---|
[3597] | 65 | #endif |
---|