]> Creatis software - gdcm.git/blobdiff - src/gdcmjpegls/Decoder/global.c
COMP: why the heck did they used 'lf' for printing a double ?
[gdcm.git] / src / gdcmjpegls / Decoder / global.c
index 55d1ddc7e9034ea865940fe29768bcbfe289c1e7..9375585e8e0e834e59984da2e57c7e235dc28f39 100644 (file)
  */
 
 #include <time.h>
-#include <unistd.h>
 #include "global.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#else
+#include <io.h>
+#endif
 
 
 
@@ -70,7 +74,7 @@ without the written permission of the copyright holder.\n\
 FILE *in, *out;
 FILE *c_in[MAX_COMPONENTS];
 FILE *c_out[MAX_COMPONENTS];
-FILE *msgfile = NULL; // = stdout;
+FILE *msgfile = NULL; /* = stdout;*/
 
 /* Context quantization thresholds  - initially unset */
 int     T3 = -1,
@@ -328,29 +332,29 @@ char *ttyfilename = "CON";
 
 void fprint_disclaimer(FILE *fp, int nopause)
 {
-    char *p0, *p1;
-    FILE *ttyf;
-    int  i, c;
+  char *p0, *p1;
+  FILE *ttyf;
+  int  i; /*, c;*/
 
-    nopause = nopause | !isatty(fileno(fp));
+  nopause = nopause | !isatty(fileno(fp));
 
-    if ( !nopause && (ttyf=fopen(ttyfilename,"r"))==NULL ) {
-  nopause = 1;
-    }
+  if ( !nopause && (ttyf=fopen(ttyfilename,"r"))==NULL ) {
+    nopause = 1;
+  }
 
-    for ( i=1, p0=disclaimer; ; i++ ) {
-  if ( !(*p0)  ) break;
-  if ( !nopause && i%PAUSE==0 ) {
+  for ( i=1, p0=disclaimer; ; i++ ) {
+    if ( !(*p0)  ) break;
+    if ( !nopause && i%PAUSE==0 ) {
       fflush(fp);
       fprintf(stderr, "--- (press RETURN to continue) ---"); 
       fflush(stderr);
-      c = getc(ttyf);
-  }
-  for ( p1=p0; (*p1 != '\n') && (*p1 != 0); p1++ );
-  *p1 = 0;
-  fprintf(fp,"%s\n",p0);
-  p0 = p1+1;
+/*      c = getc(ttyf);*/
     }
-    fprintf(fp,"\n"); fflush(fp);
-    if ( !nopause) fclose(ttyf);
+    for ( p1=p0; (*p1 != '\n') && (*p1 != 0); p1++ );
+    *p1 = 0;
+    fprintf(fp,"%s\n",p0);
+    p0 = p1+1;
+  }
+  fprintf(fp,"\n"); fflush(fp);
+  if ( !nopause) fclose(ttyf);
 }