This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathregions.h
97 lines (89 loc) · 2.35 KB
/
regions.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* Copyright (c) 2015 Smithsonian Astrophysical Observatory
*/
/*
*
* regions.h - include file for "compile on the fly" region filtering
*
*/
#ifndef __regions_h
#define __regions_h
/* the following record structure(s) must match those in imregions.h */
/* output mask struct */
typedef struct regmasks {
int region;
int y;
int xstart, xstop;
} *RegionsMask, RegionsMaskRec;
/* end of common record structures */
typedef struct regrec {
/* general information */
char *mode;
int method;
int paint;
int debug;
/* the input regions string */
char *regstr;
int size;
/* fits info */
void *fhd;
char *cards;
/* compiled program info */
char *code;
char *prog;
FILE *fp;
/* method info */
char *cc;
char *cflags;
char *objs;
char *extra;
char *shflags;
/* process info */
char *pname;
int ptype;
/* which type of pipe? */
int pipeos;
/* used by unix pipe */
int pid;
int ichan;
int ochan;
/* used by Windows pipe */
void *process;
void *ihandle;
void *ohandle;
/* used for dynamic linking */
void *dl;
/* prefix for each region (e.g. "Module." for emscripten) */
char *reg_prefix;
/* loadable drivers for each technique */
/* NB: can't use typdef because we refer to this struct */
int (*reg_start)(struct regrec *reg);
int (*reg_open)(struct regrec *reg);
int (*reg_prepend)(struct regrec *reg);
int (*reg_write)(struct regrec *reg);
int (*reg_append)(struct regrec *reg);
int (*reg_close)(struct regrec *reg);
int (*reg_compile)(struct regrec *reg);
int (*reg_end)(struct regrec *reg);
char *(*reg_name)(struct regrec *reg, char *name);
char *(*reg_routine1)(struct regrec *reg, char *name);
char *(*reg_routine2)(struct regrec *reg, char *name);
char *(*reg_region1)(struct regrec *reg, char *name);
char *(*reg_region2)(struct regrec *reg, char *name);
/* returned from lexer */
char *filter;
int nroutine;
int nreg;
int nshape;
char *radang;
} *Regions, RegionsRec;
extern Regions _null_region;
#define NOREGIONS _null_region
/* regions.c */
Regions OpenRegions(char *cards, char *regions, char *mode);
int FilterRegions(Regions reg, int x0, int x1, int y0, int y1, int block,
RegionsMask *mask, int *nreg);
int CloseRegions(Regions reg);
/* semi-public (shared by specific compiler implementations) */
char *_RegionsInitString(Regions reg);
#endif /* __regions.h */