Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Functions | Variables
getgmr.c File Reference
#include "rle_config.h"
#include "stdio.h"
#include "getfb.h"
#include "rle_code.h"
Include dependency graph for getgmr.c:

Go to the source code of this file.

Functions

 main (argc, char **argv)
 

Variables

int x = 0
 
int y = 0
 
int posflag = 0
 
int background = 0
 
int query = 0
 
int debug = 0
 
int cflag = 0
 
int getchan
 
int putchan = -1
 

Function Documentation

main ( argc  ,
char **  argv 
)

Definition at line 21 of file getgmr.c.

23 {
24  char * fname = NULL;
25  short magic;
26 
27  if (scanargs(argc, argv,
28  "% D%- q%- BO%- Pi%-x!dy!d c%-channel!dinto%d file%s ",
29  &debug,
30  &query, &background, &posflag, &x, &y,
31  &cflag, &getchan, &putchan, &fname) == 0)
32  exit(1);
33 
34  fd = rle_open_f("getgmr", fname, "r");
35  if ((!query) && Fbopen() < 0)
36  exit(1);
37 
38  if (fread((char *)&magic, sizeof(short), 1, fd) != 1)
39  {
40  fprintf(stderr, "Can't read magic number\n");
41  exit(1);
42  }
43 
44  switch(magic)
45  {
46  case (RLE_MAGIC):
47  if (query)
48  fprintf(stderr, "Image saved in Run Length Encoded form\n");
49  XtndRunGet(magic);
50  break;
51 
52  default:
53  fprintf(stderr,
54  "File not an RLE file, can't restore (magic=0x%x)\n",
55  magic);
56  exit(1);
57  break;
58  }
59  return 0;
60 }
int scanargs(int argc, char **argv, const char *format,...)
Definition: scanargs.c:94
int query
Definition: getgmr.c:18
#define RLE_MAGIC
Definition: rle_code.h:67
int putchan
Definition: getgmr.c:19
int x
Definition: getgmr.c:18
int debug
Definition: getgmr.c:18
char * fname[3]
Definition: show3.c:31
int y
Definition: getgmr.c:18
XtndRunGet(short magic)
Definition: XtndRunget.c:98
int getchan
Definition: getgmr.c:19
FILE * fd
Definition: getfb.h:18
int background
Definition: getgmr.c:18
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
int cflag
Definition: getgmr.c:19
int posflag
Definition: getgmr.c:18

Variable Documentation

int background = 0

Definition at line 18 of file getgmr.c.

int cflag = 0

Definition at line 19 of file getgmr.c.

int debug = 0

Definition at line 18 of file getgmr.c.

int getchan

Definition at line 19 of file getgmr.c.

int posflag = 0

Definition at line 18 of file getgmr.c.

int putchan = -1

Definition at line 19 of file getgmr.c.

int query = 0

Definition at line 18 of file getgmr.c.

int x = 0

Definition at line 18 of file getgmr.c.

int y = 0

Definition at line 18 of file getgmr.c.