| 1 | – | /* Copyright (c) 1998 Silicon Graphics, Inc. */ | 
| 2 | – |  | 
| 1 |  | #ifndef lint | 
| 2 | < | static char SCCSid[] = "$SunId$ SGI"; | 
| 2 | > | static const char       RCSid[] = "$Id$"; | 
| 3 |  | #endif | 
| 6 | – |  | 
| 4 |  | /* | 
| 5 |  | * Holodeck display process. | 
| 6 |  | */ | 
| 19 |  | #define FSIZDEF         0.125   /* default focus frame size */ | 
| 20 |  | #endif | 
| 21 |  |  | 
| 22 | + | #if defined(freebsd) | 
| 23 | + | #define fbufcnt(f)      ((f)->_r) | 
| 24 | + | #elif defined(__GNUC__) | 
| 25 | + | #define fbufcnt(f)      ((f)->_IO_read_end - (f)->_IO_read_ptr) | 
| 26 | + | #else | 
| 27 | + | #define fbufcnt(f)      ((f)->_cnt) | 
| 28 | + | #endif | 
| 29 | + |  | 
| 30 |  | HOLO    *hdlist[HDMAX+1];       /* global holodeck list */ | 
| 31 |  |  | 
| 32 |  | char    *hdgfn[HDMAX];          /* holodeck section geometry list */ | 
| 45 |  | FILE    *sstdin, *sstdout;      /* server's standard input and output */ | 
| 46 |  |  | 
| 47 |  | #ifdef DEBUG | 
| 43 | – | #include <sys/types.h> | 
| 48 |  | extern time_t   time(); | 
| 49 |  | static time_t   tmodesw; | 
| 50 |  | static time_t   timm, tadd; | 
| 60 |  | int     argc; | 
| 61 |  | char    *argv[]; | 
| 62 |  | { | 
| 59 | – | extern int      eputs(); | 
| 63 |  | int     rdy, inp, res = 0, pause = 0; | 
| 64 |  |  | 
| 65 |  | progname = argv[0]; | 
| 161 |  | if (hdlist[0] == NULL) | 
| 162 |  | return(RDY_SRV);        /* initialize first */ | 
| 163 |  | flgs = 0;               /* flag what's ready already */ | 
| 164 | < | if (imm_mode || stdin->_cnt > 0) | 
| 164 | > | if (imm_mode || fbufcnt(stdin) > 0) | 
| 165 |  | flgs |= RDY_SRV; | 
| 166 | < | if (sstdin != NULL && sstdin->_cnt > 0) | 
| 166 | > | if (sstdin != NULL && fbufcnt(sstdin) > 0) | 
| 167 |  | flgs |= RDY_SIN; | 
| 168 |  | if (odev.inpready) | 
| 169 |  | flgs |= RDY_DEV; | 
| 566 |  | } | 
| 567 |  |  | 
| 568 |  |  | 
| 569 | + | void | 
| 570 |  | eputs(s)                        /* put error message to stderr */ | 
| 571 |  | register char  *s; | 
| 572 |  | { | 
| 586 |  | } | 
| 587 |  |  | 
| 588 |  |  | 
| 589 | + | void | 
| 590 |  | quit(code)                      /* clean up and exit */ | 
| 591 |  | int     code; | 
| 592 |  | { |