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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
|
--- a/src/clean.c
+++ b/src/clean.c
@@ -44,6 +44,7 @@
/*------------------------------- variables ---------------------------------*/
+objliststruct *cleanobjlist;
static LONG *cleanvictim;
--- a/src/clean.h
+++ b/src/clean.h
@@ -33,7 +33,7 @@
/*------------------------------- variables ---------------------------------*/
-objliststruct *cleanobjlist; /* laconic, isn't it? */
+extern objliststruct *cleanobjlist; /* laconic, isn't it? */
/*------------------------------- functions ---------------------------------*/
--- a/src/extract.c
+++ b/src/extract.c
@@ -40,6 +40,8 @@
#include "extract.h"
#include "plist.h"
+PIXTYPE *dumscan;
+
/*------------------------- Static buffers for lutz() -----------------------*/
static infostruct *info, *store;
--- a/src/extract.h
+++ b/src/extract.h
@@ -37,7 +37,7 @@
status; /* Extraction status */
/*--------------------------------- variables -------------------------------*/
-PIXTYPE *dumscan;
+extern PIXTYPE *dumscan;
/*------------------------------- structures --------------------------------*/
/* Temporary object parameters during extraction */
--- a/src/filter.c
+++ b/src/filter.c
@@ -44,6 +44,8 @@
#include "filter.h"
#include "image.h"
+filterstruct *thefilter;
+
/******************************** convolve ***********************************/
/*
Convolve a scan line with an array.
--- a/src/filter.h
+++ b/src/filter.h
@@ -43,7 +43,7 @@
struct structbpann *bpann;
} filterstruct;
-filterstruct *thefilter;
+extern filterstruct *thefilter;
/*------------------------------- functions ---------------------------------*/
void convolve(picstruct *, PIXTYPE *, int y),
--- a/src/fits/fitscat.c
+++ b/src/fits/fitscat.c
@@ -42,6 +42,10 @@
#include "fitscat_defs.h"
#include "fitscat.h"
+float ctg[37], stg[37];
+char gstr[MAXCHAR];
+int bswapflag;
+
/****** about_cat **************************************************************
PROTO int about_cat(catstruct *cat, FILE *stream)
PURPOSE Print some info about a catalog.
--- a/src/fits/fitscat_defs.h
+++ b/src/fits/fitscat_defs.h
@@ -86,7 +86,7 @@
typedef int LONG; /* for DEC-Alpha... */
/*----------------------------- Internal constants --------------------------*/
-char gstr[MAXCHAR];
+extern char gstr[MAXCHAR];
/*----------------------------- External constants --------------------------*/
--- a/src/fits/fitscat.h
+++ b/src/fits/fitscat.h
@@ -333,6 +333,6 @@
warning(char *msg1, char *msg2);
-int bswapflag;
+extern int bswapflag;
#endif
--- a/src/globals.h
+++ b/src/globals.h
@@ -30,13 +30,13 @@
/*----------------------- miscellaneous variables ---------------------------*/
-sexcatstruct thecat;
-picstruct thefield1,thefield2, thewfield1,thewfield2;
-objstruct flagobj;
-obj2struct flagobj2;
+extern sexcatstruct thecat;
+extern picstruct thefield1,thefield2, thewfield1,thewfield2;
+extern objstruct flagobj;
+extern obj2struct flagobj2;
extern obj2struct outobj2;
-float ctg[37], stg[37];
-char gstr[MAXCHAR];
+extern float ctg[37], stg[37];
+extern char gstr[MAXCHAR];
/*------------------------------- functions ---------------------------------*/
extern void alloccatparams(void),
--- a/src/plist.c
+++ b/src/plist.c
@@ -38,6 +38,11 @@
#include "prefs.h"
#include "plist.h"
+int plistexist_value, plistexist_dvalue, plistexist_cdvalue,
+ plistexist_flag, plistexist_wflag, plistexist_dthresh, plistexist_var,
+ plistoff_value, plistoff_dvalue, plistoff_cdvalue,
+ plistoff_flag[MAXFLAG], plistoff_wflag, plistoff_dthresh, plistoff_var,
+ plistsize;
/******************************** createblank *******************************
PROTO int createblank(int no, objliststruct *objlist)
--- a/src/plist.h
+++ b/src/plist.h
@@ -47,7 +47,7 @@
/*-------------------------------- globals ----------------------------------*/
-int plistexist_value, plistexist_dvalue, plistexist_cdvalue,
+extern int plistexist_value, plistexist_dvalue, plistexist_cdvalue,
plistexist_flag, plistexist_wflag, plistexist_dthresh, plistexist_var,
plistoff_value, plistoff_dvalue, plistoff_cdvalue,
plistoff_flag[MAXFLAG], plistoff_wflag, plistoff_dthresh, plistoff_var,
--- a/src/preflist.h
+++ b/src/preflist.h
@@ -39,7 +39,7 @@
#endif
/*-------------------------------- initialization ---------------------------*/
- int idummy;
+extern int idummy;
pkeystruct key[] =
{
--- a/src/prefs.c
+++ b/src/prefs.c
@@ -56,6 +56,9 @@
#include "preflist.h"
#include "fits/fitscat.h"
+prefstruct prefs;
+double ddummy;
+int idummy;
/********************************* dumpprefs ********************************/
/*
--- a/src/prefs.h
+++ b/src/prefs.h
@@ -249,7 +249,7 @@
int nthreads; /* Number of active threads */
} prefstruct;
- prefstruct prefs;
+extern prefstruct prefs;
/*-------------------------------- protos -----------------------------------*/
extern int cistrcmp(char *cs, char *ct, int mode);
--- a/src/psf.c
+++ b/src/psf.c
@@ -47,6 +47,9 @@
/*------------------------------- variables ---------------------------------*/
+psfstruct *psf,*thedpsf,*thepsf;
+psfitstruct *thepsfit,*thedpsfit;
+PIXTYPE *checkmask;
extern keystruct objkey[];
extern objstruct outobj;
--- a/src/psf.h
+++ b/src/psf.h
@@ -102,9 +102,9 @@
} psfitstruct;
/*----------------------------- Global variables ----------------------------*/
-psfstruct *psf,*thedpsf,*thepsf;
-psfitstruct *thepsfit,*thedpsfit;
-PIXTYPE *checkmask;
+extern psfstruct *psf,*thedpsf,*thepsf;
+extern psfitstruct *thepsfit,*thedpsfit;
+extern PIXTYPE *checkmask;
/*-------------------------------- functions --------------------------------*/
extern void compute_pos(int *pnpsf,int *pconvflag,int *pnpsfflag,
--- a/src/retina.c
+++ b/src/retina.c
@@ -42,6 +42,7 @@
#include "image.h"
#include "retina.h"
+retistruct *theretina;
/******************************** readretina *********************************/
/*
--- a/src/retina.h
+++ b/src/retina.h
@@ -38,7 +38,7 @@
struct structbpann *bpann; /* The neural network */
} retistruct;
-retistruct *theretina;
+extern retistruct *theretina;
/*------------------------------- functions ---------------------------------*/
--- a/src/sexhead1.h
+++ b/src/sexhead1.h
@@ -26,8 +26,8 @@
*
*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-int idummy;
-double ddummy;
+extern int idummy;
+extern double ddummy;
keystruct headkey1[] = {
{"EPOCH ", "",
--- a/src/som.c
+++ b/src/som.c
@@ -41,6 +41,8 @@
#include "prefs.h"
#include "som.h"
+somstruct *thesom;
+
/********************************* som_phot **********************************/
/*
Perform SOM-fitting on a detected source: returns node number of the
--- a/src/som.h
+++ b/src/som.h
@@ -70,7 +70,7 @@
float stderror; /* Global reduced error */
} somstruct;
-somstruct *thesom;
+extern somstruct *thesom;
/*---------------------------------- protos --------------------------------*/
--- a/src/xml.c
+++ b/src/xml.c
@@ -50,6 +50,11 @@
xmlstruct *xmlstack = NULL;
int nxml=0, nxmlmax=0;
+sexcatstruct thecat;
+picstruct thefield1,thefield2, thewfield1,thewfield2;
+objstruct flagobj;
+obj2struct flagobj2;
+
/****** init_xml ************************************************************
PROTO int init_xml(void)
PURPOSE Initialize a set of meta-data kept in memory before being written to the
|