source: nanovis/branches/1.2/nanovisServer.h @ 5523

Last change on this file since 5523 was 5519, checked in by ldelgass, 9 years ago

bump version

  • Property svn:eol-style set to native
File size: 1.9 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#ifndef NANOVIS_SERVER_H
7#define NANOVIS_SERVER_H
8
9#include <sys/types.h> // For pid_t
10#include <sys/time.h>  // For struct timeval
11#include <cstddef>     // For size_t
12#include <cstdio>      // For FILE *
13
14#include <tcl.h>
15
16#include "config.h"
17
18#define NANOVIS_VERSION_STRING "1.2.3"
19
20#define MSECS_ELAPSED(t1, t2) \
21    ((t1).tv_sec == (t2).tv_sec ? (((t2).tv_usec - (t1).tv_usec)/1.0e+3) : \
22     (((t2).tv_sec - (t1).tv_sec))*1.0e+3 + (double)((t2).tv_usec - (t1).tv_usec)/1.0e+3)
23
24#define CVT2SECS(x)  ((double)(x).tv_sec) + ((double)(x).tv_usec * 1.0e-6)
25
26namespace nv {
27    class ReadBuffer;
28    class ResponseQueue;
29
30    typedef struct {
31        pid_t pid;
32        size_t nFrames;            /**< # of frames sent to client. */
33        size_t nFrameBytes;        /**< # of bytes for all frames. */
34        size_t nCommands;          /**< # of commands executed */
35        double cmdTime;            /**< Elasped time spend executing
36                                    * commands. */
37        struct timeval start;      /**< Start of elapsed time. */
38    } Stats;
39
40    extern Stats g_stats;
41
42    extern int g_statsFile;        ///< Stats file descriptor
43    extern int g_fdIn;             ///< Input file descriptor
44    extern int g_fdOut;            ///< Output file descriptor
45    extern FILE *g_fIn;            ///< Input file handle
46    extern FILE *g_fOut;           ///< Output file handle
47    extern FILE *g_fLog;           ///< Trace logging file handle
48    extern ReadBuffer *g_inBufPtr; ///< Socket read buffer
49#ifdef USE_THREADS
50    extern ResponseQueue *g_queue;
51#endif
52
53#ifdef KEEPSTATS
54    extern int getStatsFile(Tcl_Obj *objPtr);
55    extern int writeToStatsFile(int f, const char *s, size_t length);
56#endif
57    extern void sendDataToClient(const char *command, char *data,
58                                 size_t dlen);
59}
60
61#endif
Note: See TracBrowser for help on using the repository browser.