File: ungz.c

package info (click to toggle)
raster3d 3.0-7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 5,180 kB
  • sloc: fortran: 9,536; ansic: 1,064; makefile: 311; sh: 272; csh: 1
file content (30 lines) | stat: -rw-r--r-- 543 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Uncompress a raster3d input file into a temporary file
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef __hpux
#define ungz_  ungz
#endif

int ungz_( origname,  tempname )
char  *origname, *tempname;
{
char   command[128];
char  *t;
int   ierr;

#ifdef GUNZIP
    t = tempnam( NULL, "R3D%%" );
    sprintf( command, "gunzip -c %s > %s", origname, t );
    ierr = system( command );
    strcpy( tempname, t );
#else
    fprintf(stderr," >> sorry, no decompression support\n");
    ierr = -1;
#endif

return(ierr);
}