]> Pileus Git - ~andy/rsl/commitdiff
Change RSL variables from static to extern
authorAndy Spencer <andy753421@gmail.com>
Sun, 28 Aug 2011 22:16:31 +0000 (22:16 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 28 Aug 2011 22:16:31 +0000 (22:16 +0000)
examples/any_to_gif.c
examples/any_to_ppm.c
examples/qlook.c
src/dorade_to_radar.c
src/lassen_to_radar.c
src/radar_to_uf.c
src/rsl.h
src/uf_to_radar.c
src/volume.c

index 7493029364379efe1f7181ab490bb2f79b3ffe60..dcb971e08c7f636f75b35c7dd9d56b522f54c1e3 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#define USE_RSL_VARS
 #include "rsl.h"
 
 /* Example use for getopt; argument processing */
index 42a41b44d5a5c3c44984892528bec906933bfa00..9f70201060e07b86e695c5a0606c4cb3ba998002 100644 (file)
@@ -11,7 +11,6 @@
  */
 #include <stdlib.h>
 
-#define USE_RSL_VARS
 #include "rsl.h"
 
 int main(int argc, char **argv)
index ec533738cf2aa8f0ec817d2900fa5ea1e961b226..eb90b00975232c4bcd245f5d0de26eeb4c8afc99 100644 (file)
@@ -6,7 +6,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <libgen.h>
-#define USE_RSL_VARS
 #include "rsl.h"
 
 #define ZDR_WIDTH 10
index 4af897a856bd08185c46b9a6c50bf4ace9ff2199..b3c8c6631fbca7853c8f503bbedb13b839b4c3f6 100644 (file)
@@ -25,7 +25,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#define USE_RSL_VARS
 #include "rsl.h"
 #include "dorade.h"
 
index a7ae48dfbe81dce08a842f5727fb9551c688bf64..7925c50c6fd415c1d801a80fb8e3708c19c2adcd 100644 (file)
@@ -36,7 +36,6 @@
 #include <string.h>
 #include <math.h>
 
-#define USE_RSL_VARS
 #include "rsl.h"
 
 #ifdef HAVE_LASSEN
index f5a18abf3821d494808486cfbf8c3ce89cca5021..fae49a2a0445dbe8fc8e0f083d83927a3fdb85ee 100644 (file)
@@ -25,7 +25,6 @@
 #include <time.h>
 #include <stdlib.h>
 
-#define USE_RSL_VARS
 #include "rsl.h"
 extern int radar_verbose_flag;
 /* Missing data flag : -32768 when a signed short. */
@@ -186,7 +185,7 @@ void RSL_radar_to_uf_fp(Radar *r, FILE *fp)
     fprintf(stderr,"Maximum #   of volumes for UF is %d\n", nvolumes);
   }
 
-  max_field_names = sizeof(RSL_ftype) / 4;
+  max_field_names = MAX_RADAR_VOLUMES;
 
 /*--------
  *   LOOP for all sweeps (typically 11 or 16 for wsr88d data.
index b3ea1f490220a28fa7df62b0c1bc145737a9c98f..de6de71aae1e964d819dc0d18575701d06372a2a 100644 (file)
--- a/src/rsl.h
+++ b/src/rsl.h
@@ -843,36 +843,11 @@ Range HC_INVF(float x);
 Range VC_INVF(float x);
 Range SD_INVF(float x);
 
+/* Type identifiers and function tables */
+extern char *RSL_ftype[];
+extern float (*RSL_f_list[])(Range x);
+extern Range (*RSL_invf_list[])(float x);
 
-/* If you like these variables, you can use them in your application
- * by defining USE_RSL_VARS before #include "rsl.h"
- */
-#ifdef USE_RSL_VARS
-static char *RSL_ftype[] = {"DZ", "VR", "SW", "CZ", "ZT", "DR", 
-                            "LR", "ZD", "DM", "RH", "PH", "XZ", 
-                            "CD", "MZ", "MD", "ZE", "VE", "KD", 
-                            "TI", "DX", "CH", "AH", "CV", "AV",
-                            "SQ", "VS", "VL", "VG", "VT", "NP",
-                            "HC", "VC", "V2", "S2", "V3", "S3",
-                            "CR", "CC", "PR", "SD", "ZZ", "RD"};
-
-static  float (*RSL_f_list[])(Range x) = {DZ_F, VR_F, SW_F, CZ_F, ZT_F, DR_F,
-                                          LR_F, ZD_F, DM_F, RH_F, PH_F, XZ_F,
-                                          CD_F, MZ_F, MD_F, ZE_F, VE_F, KD_F,
-                                          TI_F, DX_F, CH_F, AH_F, CV_F, AV_F,
-                                          SQ_F, VS_F, VL_F, VG_F, VT_F, NP_F,
-                                          HC_F, VC_F, VR_F, SW_F, VR_F, SW_F,
-                                          DZ_F, CZ_F, PH_F, SD_F, DZ_F, DZ_F};
-
-static  Range (*RSL_invf_list[])(float x)
-         = {DZ_INVF, VR_INVF, SW_INVF, CZ_INVF, ZT_INVF, DR_INVF, 
-            LR_INVF, ZD_INVF, DM_INVF, RH_INVF, PH_INVF, XZ_INVF, 
-            CD_INVF, MZ_INVF, MD_INVF, ZE_INVF, VE_INVF, KD_INVF,
-            TI_INVF, DX_INVF, CH_INVF, AH_INVF, CV_INVF, AV_INVF,
-            SQ_INVF, VS_INVF, VL_INVF, VG_INVF, VT_INVF, NP_INVF,
-            HC_INVF, VC_INVF, VR_INVF, SW_INVF, VR_INVF, SW_INVF,
-            DZ_INVF, CZ_INVF, PH_INVF, SD_INVF, DZ_INVF, DZ_INVF};
-#endif
 /* Secret routines that are quite useful and useful to developers. */
 void radar_load_date_time(Radar *radar);
 int big_endian(void);
index 870f5ed2ad0b8ccb13880750508317032ee97d31..d9d0673b842061b69ebd50b9380f2b2f4c363aa1 100644 (file)
@@ -24,9 +24,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
-
-/* This allows us to use RSL_ftype, RSL_f_list, RSL_invf_list from rsl.h. */
-#define USE_RSL_VARS
 #include "rsl.h"
 
 extern int radar_verbose_flag;
index a30368b4796258f72416061a22602b32a54f791d..eddcc1d352b7ea339b093724d63a9c3c4eab9143 100644 (file)
@@ -67,7 +67,6 @@
 #include <stdarg.h>
 int strcasecmp(const char *s1, const char *s2);
 
-#define USE_RSL_VARS
 #include "rsl.h"
 
 #define bin_azimuth(x, dx) (float)((float)x/dx)
@@ -111,6 +110,30 @@ extern int radar_verbose_flag;
  */
 #define F_OFFSET 4
 
+char *RSL_ftype[] = {"DZ", "VR", "SW", "CZ", "ZT", "DR",
+                     "LR", "ZD", "DM", "RH", "PH", "XZ",
+                     "CD", "MZ", "MD", "ZE", "VE", "KD",
+                     "TI", "DX", "CH", "AH", "CV", "AV",
+                     "SQ", "VS", "VL", "VG", "VT", "NP",
+                     "HC", "VC", "V2", "S2", "V3", "S3",
+                     "CR", "CC", "PR", "SD", "ZZ", "RD"};
+
+float (*RSL_f_list[])(Range x) = {DZ_F, VR_F, SW_F, CZ_F, ZT_F, DR_F,
+                                  LR_F, ZD_F, DM_F, RH_F, PH_F, XZ_F,
+                                  CD_F, MZ_F, MD_F, ZE_F, VE_F, KD_F,
+                                  TI_F, DX_F, CH_F, AH_F, CV_F, AV_F,
+                                  SQ_F, VS_F, VL_F, VG_F, VT_F, NP_F,
+                                  HC_F, VC_F, VR_F, SW_F, VR_F, SW_F,
+                                  DZ_F, CZ_F, PH_F, SD_F, DZ_F, DZ_F};
+
+Range (*RSL_invf_list[])(float x)
+    = {DZ_INVF, VR_INVF, SW_INVF, CZ_INVF, ZT_INVF, DR_INVF,
+       LR_INVF, ZD_INVF, DM_INVF, RH_INVF, PH_INVF, XZ_INVF,
+       CD_INVF, MZ_INVF, MD_INVF, ZE_INVF, VE_INVF, KD_INVF,
+       TI_INVF, DX_INVF, CH_INVF, AH_INVF, CV_INVF, AV_INVF,
+       SQ_INVF, VS_INVF, VL_INVF, VG_INVF, VT_INVF, NP_INVF,
+       HC_INVF, VC_INVF, VR_INVF, SW_INVF, VR_INVF, SW_INVF,
+       DZ_INVF, CZ_INVF, PH_INVF, SD_INVF, DZ_INVF, DZ_INVF};
 
 float DZ_F(Range x) {
   if (x >= F_OFFSET) /* This test works when Range is unsigned. */