source: nanovis/branches/1.1/nanovisServer.h

Last change on this file was 4883, checked in by ldelgass, 5 years ago

set eol-style on new files

  • 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.1.4"
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
29    typedef struct {
30        pid_t pid;
31        size_t nFrames;            /**< # of frames sent to client. */
32        size_t nFrameBytes;        /**< # of bytes for all frames. */
33        size_t nCommands;          /**< # of commands executed */
34        double cmdTime;            /**< Elasped time spend executing
35                                    * commands. */
36        struct timeval start;      /**< Start of elapsed time. */
37    } Stats;
38
39    extern Stats g_stats;
40
41    extern int g_statsFile;        ///< Stats file descriptor
42    extern int g_fdIn;             ///< Input file descriptor
43    extern int g_fdOut;            ///< Output file descriptor
44    extern FILE *g_fIn;            ///< Input file handle
45    extern FILE *g_fOut;           ///< Output file handle
46    extern FILE *g_fLog;           ///< Trace logging file handle
47    extern ReadBuffer *g_inBufPtr; ///< Socket read buffer
48
49#ifdef KEEPSTATS
50    extern int getStatsFile(Tcl_Obj *objPtr);
51    extern int writeToStatsFile(int f, const char *s, size_t length);
52#endif
53    extern void sendDataToClient(const char *command, const char *data,
54                                 size_t dlen);
55}
56
57#endif
Note: See TracBrowser for help on using the repository browser.