diff --git a/ci/config-gmt-unix.sh b/ci/config-gmt-unix.sh index 19747cde865..b9b1b2241a8 100755 --- a/ci/config-gmt-unix.sh +++ b/ci/config-gmt-unix.sh @@ -30,6 +30,11 @@ set (DO_API_TESTS ON) set (N_TEST_JOBS 2) set (SUPPORT_EXEC_IN_BINARY_DIR TRUE) set (CMAKE_C_FLAGS "-coverage -O0 ${CMAKE_C_FLAGS}") + +# Turn on testing of upcoming long-option syntax for common GMT options +add_definitions(-DUSE_COMMON_LONG_OPTIONS) +# Turn on testing of upcoming long-option syntax for module options +add_definitions(-DUSE_MODULE_LONG_OPTIONS) EOF fi diff --git a/ci/config-gmt-windows.sh b/ci/config-gmt-windows.sh index 7df9d47a53a..e9028cd5956 100755 --- a/ci/config-gmt-windows.sh +++ b/ci/config-gmt-windows.sh @@ -24,6 +24,11 @@ set (DO_EXAMPLES TRUE) set (DO_TESTS TRUE) set (DO_API_TESTS ON) set (SUPPORT_EXEC_IN_BINARY_DIR TRUE) + +# Turn on testing of upcoming long-option syntax for common GMT options +add_definitions(-DUSE_COMMON_LONG_OPTIONS) +# Turn on testing of upcoming long-option syntax for module options +add_definitions(-DUSE_MODULE_LONG_OPTIONS) EOF fi diff --git a/cmake/ConfigUserTemplate.cmake b/cmake/ConfigUserTemplate.cmake index c952a15b56a..593ce408ccc 100644 --- a/cmake/ConfigUserTemplate.cmake +++ b/cmake/ConfigUserTemplate.cmake @@ -258,6 +258,8 @@ # Uncomment these two statements if you are a developer debugging GMT: #add_definitions(-DDEBUG) #add_definitions(-DMEMDEBUG) # Turn on memory tracking see gmt_support.c for extra info +#add_definitions(-DUSE_COMMON_LONG_OPTIONS) # Turn on testing of upcoming long-option syntax for common GMT options +#add_definitions(-DUSE_MODULE_LONG_OPTIONS) # Turn on testing of upcoming long-option syntax for module options #set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement") # recommended even for release build #set (CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}") # extra warnings #set (CMAKE_C_FLAGS_DEBUG -ggdb3) # gdb debugging symbols diff --git a/src/begin.c b/src/begin.c index 837e69daea2..cf85b79ff9d 100644 --- a/src/begin.c +++ b/src/begin.c @@ -141,7 +141,7 @@ int GMT_begin (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) return (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) return (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); if ((error = parse (GMT, options)) != 0) Return (error); diff --git a/src/block_subs.h b/src/block_subs.h index 90d9ee7a35d..16c88d7a7b2 100644 --- a/src/block_subs.h +++ b/src/block_subs.h @@ -87,6 +87,33 @@ struct BLOCK_CTRL { } W; }; +GMT_LOCAL struct GMT_KEYWORD_DICTIONARY module_kw[] = { /* Local options for all the block* modules */ + /* separator, short-option, long-option, short-directives, long-directives, short-modifiers, long-modifiers */ + { 0, 'A', "fields", "", "", "", "" }, + { 0, 'C', "center", "", "", "", "" }, +#if defined(BLOCKMODE) /* Only blockmode has a -D option */ + { 0, 'D', "bin-width", "", "", "a,c,h,l", "average,center,high,low" }, +#endif +#if defined(BLOCKMEAN) + { 0, 'E', "extend", "", "", "P,p", "prop-simple,prop-weighted" }, +#elif defined(BLOCKMODE) + { 0, 'E', "extend", "r,s", "record,source", "l,h", "lower,higher" }, +#else + { 0, 'E', "extend", "b,r,s", "box-whisker,record,source", "l,h", "lower,higher" }, +#endif + { 0, 'G', "gridfile", "", "", "", "" }, + { '/', 'I', "increment", "", "", "e,n", "exact,number" }, +#if !defined(BLOCKMEAN) /* Only blockmedian & blockmode have a -Q option */ + { 0, 'Q', "quicker", "", "", "", "" }, +#endif + { 0, 'S', "select", "m,n,s,w", "mean,count,sum,weight", "", "" }, +#if defined(BLOCKMEDIAN) /* Only blockmedian has a -T option */ + { 0, 'T', "quantile", "", "", "", "" }, +#endif + { 0, 'W', "weights", "i,o", "in,out", "s", "sigma" }, + { 0, '\0', "", "", "", "", ""} /* End of list marked with empty option and strings */ +}; + #if 0 enum GMT_grdval_blks { /* mode for selected item for gridding */ BLK_ITEM_MEAN = 0, diff --git a/src/blockmean.c b/src/blockmean.c index 3e3c4984aab..c6682ff2ed1 100644 --- a/src/blockmean.c +++ b/src/blockmean.c @@ -41,8 +41,8 @@ #include "block_subs.h" enum Block_Modes { - BLK_MODE_NOTSET = 0, /* No -E+p|P (or -Ep) set */ - BLK_MODE_OBSOLETE = 1, /* Old -Ep for backwards compatibility; assumes input weights are already set to 1/s^ */ + BLK_MODE_NOTSET = 0, /* No -E+p|P (or -Ep) set */ + BLK_MODE_OBSOLETE = 1, /* Old -Ep for backwards compatibility; assumes input weights are already set to 1/s^2 */ BLK_MODE_WEIGHTED = 2, /* -E+p computes weighted z means and error propagation on weighted z mean, using input s and w = 1/s^2 */ BLK_MODE_SIMPLE = 3 /* -E+P computes simple z means and error propagation on simple z mean, using input s and w = 1/s^2 */ }; @@ -307,7 +307,7 @@ int GMT_blockmean (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, module_kw, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/blockmedian.c b/src/blockmedian.c index 2f212f12406..47a49ad1eff 100644 --- a/src/blockmedian.c +++ b/src/blockmedian.c @@ -395,7 +395,7 @@ int GMT_blockmedian (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, module_kw, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/blockmode.c b/src/blockmode.c index 1e21e4e3215..0227c61436a 100644 --- a/src/blockmode.c +++ b/src/blockmode.c @@ -519,7 +519,7 @@ int GMT_blockmode (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, module_kw, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/clear.c b/src/clear.c index d234fdcf172..93d9bea4e11 100644 --- a/src/clear.c +++ b/src/clear.c @@ -150,7 +150,7 @@ int GMT_clear (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); if ((error = parse (GMT, options)) != 0) Return (error); diff --git a/src/dimfilter.c b/src/dimfilter.c index 0ae82d89fdb..3bd1c3fedb3 100644 --- a/src/dimfilter.c +++ b/src/dimfilter.c @@ -584,7 +584,7 @@ int GMT_dimfilter (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/docs.c b/src/docs.c index b5bbd2e2529..85777f39837 100644 --- a/src/docs.c +++ b/src/docs.c @@ -104,7 +104,7 @@ int GMT_docs (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ /*---------------------------- This is the docs main code ----------------------------*/ diff --git a/src/end.c b/src/end.c index 622ac1adfb4..87b4722b9fa 100644 --- a/src/end.c +++ b/src/end.c @@ -108,7 +108,7 @@ int GMT_end (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); if ((error = parse (GMT, options, &show)) != 0) Return (error); diff --git a/src/figure.c b/src/figure.c index 2d26095047d..c5a432a15f5 100644 --- a/src/figure.c +++ b/src/figure.c @@ -149,7 +149,7 @@ int GMT_figure (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); if ((error = parse (GMT, options)) != 0) Return (error); diff --git a/src/filter1d.c b/src/filter1d.c index afc35698d9f..be712fc202f 100644 --- a/src/filter1d.c +++ b/src/filter1d.c @@ -870,7 +870,7 @@ int GMT_filter1d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error, "Error parsing filter1d options\n"); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error, "Error parsing filter1d options\n"); diff --git a/src/fitcircle.c b/src/fitcircle.c index 0a6d947d4ee..7089f39eb3f 100644 --- a/src/fitcircle.c +++ b/src/fitcircle.c @@ -381,7 +381,7 @@ int GMT_fitcircle (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/geodesy/earthtide.c b/src/geodesy/earthtide.c index 4abbc8b8a3a..9e6c60221e8 100644 --- a/src/geodesy/earthtide.c +++ b/src/geodesy/earthtide.c @@ -1448,7 +1448,7 @@ int GMT_earthtide (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/geodesy/gpsgridder.c b/src/geodesy/gpsgridder.c index 35e97324ae9..6f4a2f2e162 100644 --- a/src/geodesy/gpsgridder.c +++ b/src/geodesy/gpsgridder.c @@ -554,7 +554,7 @@ int GMT_gpsgridder (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/geodesy/psvelo.c b/src/geodesy/psvelo.c index 22f479bac52..e22a9d1a468 100644 --- a/src/geodesy/psvelo.c +++ b/src/geodesy/psvelo.c @@ -353,7 +353,7 @@ int GMT_psvelo (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmt2kml.c b/src/gmt2kml.c index 45bffb7d5c9..428791a7255 100644 --- a/src/gmt2kml.c +++ b/src/gmt2kml.c @@ -859,7 +859,7 @@ int GMT_gmt2kml (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmt_constants.h b/src/gmt_constants.h index 49fdc21afc2..3bdef89960b 100644 --- a/src/gmt_constants.h +++ b/src/gmt_constants.h @@ -75,6 +75,7 @@ #define GMT_CONV6_LIMIT 1.0e-6 /* 1 ppm */ #define GMT_CONV4_LIMIT 1.0e-4 /* Less tight convergence limit or "close to zero" limit */ +#define GMT_ASCII_ES 27 /* ASCII code for escape (used to prevent +? strings in plain text from being seen as modifiers) */ #define GMT_ASCII_GS 29 /* ASCII code for group separator (temporarily replacing tabs) */ #define GMT_ASCII_RS 30 /* ASCII code for record separator (temporarily replacing spaces in filenames) */ #define GMT_ASCII_US 31 /* ASCII code for unit separator (temporarily replacing spaces in quoted text) */ diff --git a/src/gmt_init.c b/src/gmt_init.c index 1ec3084fbb9..2f7e57063f1 100644 --- a/src/gmt_init.c +++ b/src/gmt_init.c @@ -354,33 +354,48 @@ static struct GMT_FONTSPEC GMT_standard_fonts[GMT_N_STANDARD_FONTS] = { #include "standard_adobe_fonts.h" }; -/* List of GMT common keyword/options pairs */ -#ifdef USE_GMT_KWD -struct GMT_KW_DICT gmt_kw_common[] = { - {'R', "region"}, - {'J', "proj"}, - {'U', "timestamp"}, - {'V', "verbose"}, - {'X', "xoff"}, - {'Y', "yoff"}, - {'a', "aspatial"}, - {'b', "binary"}, - {'d', "nodata"}, - {'e', "find"}, - {'f', "coltypes"}, - {'g', "gap"}, - {'h', "header"}, - {'i', "incol"}, - {'o', "outcol"}, - {'n', "interpol"}, - {'p', "perspective"}, - {'r', "registration"}, - {'t', "transparency"}, - {'x', "cores"}, - {':', "order"}, - {'\0', ""} /* End of list marked with empty code and string */ +/* List of GMT common keyword/options pairs. This list is used in gmtinit_kw_replace to convert + * the new long-format GMT options (e.g., --timestamp="My plot"+offset=5c/6c) to regular GMT short format + * options (e.g., -U"My plot"+o5c/6c) that the common and module parsers expect. + * + * For testing this there are two define statements that need to be set in ConfigUser.cmake: + * + * -DUSE_COMMON_LONG_OPTIONS will allow us to test the gmt_common_kw array below. + * -DUSE_MODULE_LONG_OPTIONS will allow us to test any module_kw settings in the modules + * + * Without these we are blind to the keyword arrays. Note that while you can test the + * common options without the module options, you cannot do the reverse. + */ + +GMT_LOCAL struct GMT_KEYWORD_DICTIONARY gmt_common_kw[] = { + /* separator, short-option, long-option, short-directives, long-directives, short-modifiers, long-modifiers */ + { 0, 'B', "frame", "", "", "b,g,n,o,t", "box,fill,noframe,oblique-pole,title" }, + { 0, 'B', "axis", "", "", "a,l,L,p,s,S,u", "angle,label,Label,prefix,second-label,Second-label,unit" }, + { 0, 'J', "projection", "", "", "", ""}, + { 0, 'R', "region", "", "", "r,u", "rectangular,unit"}, + { 0, 'U', "timestamp", "", "", "c,j,o", "command,justify,offset"}, + { 0, 'V', "verbosity", "", "", "", ""}, + { 0, 'X', "xshift", "a,c,f,r", "absolute,center,fixed,relative", "", ""}, + { 0, 'Y', "yshift", "a,c,f,r", "absolute,center,fixed,relative", "", ""}, + { 0, 'a', "aspatial", "", "", "", ""}, + { 0, 'b', "binary", "", "", "b,l", "big-endian,little-endian"}, + { 0, 'd', "nodata", "i,o", "in,out", "", ""}, + { 0, 'e', "find", "", "", "f", "file"}, + { ',', 'f', "coltypes", "i,o", "in,out", "", ""}, + { 0, 'g', "gap", "", "", "n,p", "negative,positive"}, + { 0, 'h', "header", "i,o", "in,out", "c,d,r,t", "columns,delete,remark,title"}, + { ',', 'i', "read-columns", "", "", "l,o,s", "log10,offset,scale"}, + { 0, 'j', "spherical", "e,f,g", "ellipsoidal,flat-earth,great-circle", "", ""}, + { 0, 'l', "legend", "", "", "d,f,g,h,j,l,n,s,v,w,x", "drawline,font,gap,header,justify,linetext,ncols,size,vertline,width,scale"}, + { 0, 'n', "interpolation", "b,c,l,n", "b-spline,bicubic,linear,nearest-neighbor", "a,b,c,t", "antialias,bc,clip,threshold"}, + { ',', 'o', "write-columns", "", "", "", ""}, + { 0, 'p', "perspective", "x,y,z", "x,y,z", "v,w", "view,world"}, + { 0, 'r', "registration", "g,p", "gridline,pixel", "", ""}, + { 0, 's', "skip-record", "", "", "a,r", "any,reverse"}, + { 0, 't', "transparency", "", "", "", ""}, + { 0, 'x', "cores", "", "", "", ""}, + { 0, '\0', "", "", "", "", ""} /* End of list marked with empty code and strings */ }; -#endif /* Local variables to gmt_init.c */ @@ -469,54 +484,216 @@ GMT_LOCAL bool gmtinit_file_unlock (struct GMT_CTRL *GMT, int fd) { } #endif -#ifdef USE_GMT_KWD +void gmtlib_handle_escape_text (char *text, char key, int way) { + /* Deal with text that contains modifiers +? that should be seen as plain text + * because they have a leading escape ("My dumb \+p text"). If way == 1 then + * we replace \+ with two GMT_ASCII_ES (Escape) bytes and if way == -1 then we + * remove the first escape and replace the second with a +. Here, key sets + * what to escape, such as +, but the function is general for any key to escape. + * Since way == +1 replaces 2 chars by 2 other chars and way == -1 replaces two + * chars by one char this function can work on both heap and allocated strings. */ + size_t k, j; + if (way == +1) { /* Replace \ with two escapes */ + for (k = 1; k < strlen (text); k++) + if (text[k] == key && text[k-1] == '\\') + text[k] = text[k-1] = GMT_ASCII_ES; + } + else { /* Replace two escapes with a single symbol */ + char c; + for (k = j = 0; k < strlen (text); k++) { + if (text[k] == GMT_ASCII_ES) { + c = key; /* Write the special char */ + k++; /* Skip the second escape char */ + } + else /* Just copy out what we found */ + c = text[k]; + text[j++] = c; /* Replace char */ + } + text[j] = '\0'; /* Chop off remainder of string since no longer used */ + } +} /*! . */ -GMT_LOCAL int gmtinit_find_kw (struct GMTAPI_CTRL *API, struct GMT_KW_DICT *kw, char *arg) { - /* Determine if this arg is found in the keyword list */ - int k; +GMT_LOCAL struct GMT_KEYWORD_DICTIONARY * gmtinit_find_kw (struct GMTAPI_CTRL *API, struct GMT_KEYWORD_DICTIONARY *kw1, struct GMT_KEYWORD_DICTIONARY *kw2, char *arg, int *k) { + /* Determine if this long-format arg is found in one of the two keyword lists kw1 (common) and kw2 (module). + * If we find a match we return a pointer to the corresponding keyword list and the index *k for the array entry. + * If not found then we return NULL and set index to -1 (GMT_NOTSET) */ + size_t len, len_given_keyword = strlen(arg); /* Get the length of given argument */ + struct GMT_KEYWORD_DICTIONARY *kw[2] = {kw1, kw2}; /* kw1 is the common options and kw2 is any module options available in long-format version */ gmt_M_unused (API); - if (kw == NULL) return -1; /* No list to search in yet */ - for (k = 0; kw[k].name[0]; k++) { - if (!strncmp (arg, kw[k].name, strlen(kw[k].name))) break; /* Match found */ + for (unsigned int set = 0; set < 2; set++) { /* Loop over the two keyword structure arrays */ + if (kw[set] == NULL) continue; /* We were not given this set of keywords */ + /* Search list of long-format keywords for a match with arg */ + for (*k = 0; kw[set][*k].long_option[0]; (*k)++) { + len = MIN (len_given_keyword, strlen (kw[set][*k].long_option)); /* Only compare up to the given # of characters, but less than actual length of long_option */ + if (!strncmp (arg, kw[set][*k].long_option, len)) break; /* Match was found */ + } + if (kw[set][*k].short_option) return kw[set]; /* Return if successful, otherwise short_option of last entry is blank */ } - return (kw[k].code) ? k : -1; /* Either return index to match or -1 if not found */ + *k = GMT_NOTSET; /* Nothing found, return GMT_NOTSET and NULL */ + return NULL; +} + +/*! . */ +GMT_LOCAL char gmtinit_find_argument (struct GMTAPI_CTRL *API, char *longlist, char *shortlist, char *text, char sep, char *argument) { + /* Examine the text argument for directives or args and pass it back out via argument. Here, + * sep is either ':' or '=' depending on the call argument. */ + unsigned int k = 0, pos = 0; + size_t len, lent = strlen(text); + char *c = NULL, m = 0, item[GMT_LEN64] = {""}; + gmt_M_unused (API); + if ((c = strchr (text, sep))) c[0] = '0'; /* Chop off the colon or equal and what follows for now */ + while (m == 0 && (gmt_strtok (longlist, ",", &pos, item))) { /* While there are unprocessed directives to examine */ + len = MIN (lent, strlen(item)); /* Only compare up to the given # of characters, but less than length of item */ + if (!strncmp (item, text, len)) /* Found this directive in the text */ + m = shortlist[k]; /* Assign the corresponding short modifier to m and this stops the while loop */ + k += 2; /* Go to next char in comma-separated list of single characters (2 since we skip the comma) */ + } + if (m && c) /* We found a short-option flag and there is an argument that follows a colon or equal sign */ + strcpy (argument, &c[1]); /* Pass out the directive argument */ + else if (m) /* Found a short-option flag but there is nothing that follows */ + argument[0] = '\0'; /* Nothing */ + else /* Not a directive, m is 0 and c is NULL */ + strcpy (argument, text); /* Not a directive, pass out the argument as is */ + if (c) c[0] = sep; /* Restore colon/equal sign we masked out earlier */ + return m; /* Returns 0 if no modifier was found */ +} + +GMT_LOCAL int gmtinit_get_section (struct GMTAPI_CTRL *API, char *arg, char separator, int k, int *sx) { + /* Find the k'th separator occurrence and chop off the rest, return pointer to start of k'th section */ + int j = 0, kk = -1, s0 = 0, s = 0, last_s = 0; + gmt_M_unused (API); + while (arg[j] && kk < k) { /* We need to skip previous sections */ + if (arg[j] == separator) { /* Start of a new section separated by / or comma, probably */ + kk++; /* kk is now the section number, i.e., this will become 0 the first time we get here */ + s0 = s; /* Keep previous start position */ + s = j+1; /* This is position of first character in this section */ + last_s = j; /* Position of previous separator before this section */ + if (kk < k) j++; /* If not at desired section, increment j */ + } + else /* Not there yet, keep going */ + j++; + } + if (kk == k) { /* Found the separator and is now at k'th section */ + arg[j] = '\0'; /* Hide the rest of the string */ + *sx = j; /* Return position of separator that was removed */ + } + else if (last_s) { /* Must be the last section since it is missing a trailing separator */ + *sx = -1; /* Nothing to chop */ + s0 = last_s + 1; /* Start position of last section */ + } + return s0; /* Return start position in arg of current section (i.e., at arg[s0]) */ } /*! . */ -GMT_LOCAL void gmtinit_kw_replace (struct GMTAPI_CTRL *API, struct GMT_KW_DICT *module_kw, struct GMT_OPTION **options) { - /* Loop over given options and replace any recognized long-form --parameter[=value] - * with the corresponding short option version -[value] */ +GMT_LOCAL void gmtinit_kw_replace (struct GMTAPI_CTRL *API, struct GMT_KEYWORD_DICTIONARY *this_module_kw, struct GMT_OPTION **options) { + /* Loop over given options and replace any recognized long-form --parameter[=value] arguments + * with the corresponding classic short-format version -[value]. Specifically, long-format is defined as + * + * --longoption[=[:]][+[=]][+[=]]... + * + * For options that take more than one section of arguments (e.g., -Idx/dy or -icols1,cols2,...) + * the section + * + * [][+[=]][+[=]] + * + * may appear more than once after a section separator (e.g., '/' or ','). The separator is an entry + * in kw.separator, or it is 0 if the option does not take more than one section. + */ + struct GMT_OPTION *opt = NULL; - struct GMT_KW_DICT *kw = NULL; - char text[GMT_LEN256] = {""}, *e = NULL; - int k; + struct GMT_KEYWORD_DICTIONARY *kw = NULL; + char new_arg[GMT_LEN256] = {""}, add[GMT_LEN64] = {""}, argument[GMT_LEN64] = {""}, orig[GMT_BUFSIZ] = {""}, copy[GMT_BUFSIZ] = {""}; + char *directive = NULL, *modifier = NULL, code = 0, e_code = '=', sep[2] = {'\0', '\0'}; + int k, n_sections, section, sect_start = 0, sect_end = 0; + bool modified = false, got_directive = false, got_modifier = false; + #if !defined(USE_MODULE_LONG_OPTIONS) + this_module_kw = NULL; /* Debugging: Not testing the module long-options */ + #endif + for (opt = *options; opt; opt = opt->next) { if (opt->option != GMT_OPT_PARAMETER) continue; /* Cannot be a --keyword[=value] pair */ - if (isupper (opt->arg[0])) continue; /* Skip the upper-case GMT Default parameter settings */ - e = strchr (opt->arg, '='); /* Get location of equal sign, if present */ - if (e) e[0] = '\0'; /* Cut off =value for now so opt->arg only has the keyword */ - if ((k = gmtinit_find_kw (API, gmt_kw_common, opt->arg)) >= 0) /* Got common kw pair */ - kw = gmt_kw_common; - else if ((k = gmtinit_find_kw (API, module_kw, opt->arg)) >= 0) /* Got module kw pair */ - kw = module_kw; - else - continue; /* Got nothing */ + if (isupper (opt->arg[0])) continue; /* Skip the upper-case GMT Default parameter settings, e.g., --FONT_TITLE=12p */ + strcpy (orig, opt->arg); /* Retain a copy of current option arguments */ + strcpy (copy, opt->arg); /* Retain another copy of current option arguments */ + gmtlib_handle_escape_text (copy, '+', +1); /* Hide any escaped +? sequences */ + directive = strchr (copy, '='); /* Get location of equal sign, if present */ + modifier = strchr (copy, '+'); /* Get location of plus sign, if present */ + got_directive = got_modifier = false; /* Reset these to be false */ + /* Check for case where the = is part of a modifier, hence not a value or directive */ + if (directive && modifier && ((directive - copy) > (modifier - copy))) + directive = NULL; /* The = is part of a modifier and not the directive, so ignore it for now */ + if (directive) directive[0] = '\0', got_directive = true; /* Cut off =value for now so opt->arg only has the keyword, but remember a directive was found */ + if (modifier) modifier[0] = '\0', got_modifier = true; /* Cut off +modifier for now so orig only has the keyword, but remember a modifier was found */ + if ((kw = gmtinit_find_kw (API, gmt_common_kw, this_module_kw, orig, &k)) == NULL) { /* Find matching keyword listing */ + /* Did not find matching long format keyword; undo damage and move to next option */ + if (directive) directive[0] = '='; + if (modifier) modifier[0] = '+'; + continue; + } + + /* Here we found a matching long-format option name, returned as the kw[k] struct element */ /* Do the long to short option substitution */ - opt->option = kw[k].code; /* Update the option character first */ - if (e) { - e[0] = '='; /* Put back the = character */ - snprintf (text, GMT_LEN256, "%s", &e[1]); /* Get string with the argument */ + + e_code = '='; /* When we remove the '=' we will replace it, but in multi-sections the code may change after the first section */ + n_sections = ((kw[k].separator) ? gmtlib_count_char (API->GMT, orig, kw[k].separator) : 0) + 1; + opt->option = kw[k].short_option; /* Update the option character first */ + sep[0] = kw[k].separator; /* Need a string with separator to strcat below */ + new_arg[0] = '\0'; /* Initialize short option arguments */ + modified = true; /* We have at least modified one option */ + + for (section = 0; section < n_sections; section++) { /* Parse the sections separately but strcat together a single short option */ + /* Make sure a few things are correct */ + /* Find separator, set to 0, check if modifier is after, if so set to NULL. */ + if (n_sections > 1) { /* Special case since there is only one leading =; other values are given after separators */ + got_modifier = false; /* Start over for each new section since modifiers are section-limited */ + sect_start = gmtinit_get_section (API, orig, kw[k].separator, section, §_end); /* Get next section start and truncate */ + if (directive) /* Update what directive is pointing to since no leading keyword for later sections */ + directive = (sect_start) ? orig + sect_start - 1 : strchr (orig, '='); /* directive points to = or char before value */ + modifier = strchr (directive, '+'); /* Must also update to see if this section has modifiers... */ + if (modifier) modifier[0] = '\0', got_modifier = true; /* ...and if it does we temporarily chop it off here but remember we found one */ + } + + if (got_directive) { /* Process a [:] or possibly just the */ + if ((code = gmtinit_find_argument (API, kw[k].long_directives, kw[k].short_directives, &directive[1], ':', argument))) /* Get the directive, or return 0 if it is an argument instead */ + sprintf (add, "%c%s", code, argument); /* Prepend the directive code */ + else /* Just got an argument; no directive code */ + sprintf (add, "%s", argument); + strcat (new_arg, add); /* Add string to the short-format option argument */ + directive[0] = e_code; /* Put back the = character (at least the first time; later it is a separator) */ + } + if (got_modifier) { /* We have one of more modifiers to process */ + unsigned int pos = 0; + char item[GMT_LEN64] = {""}; + modifier[0] = '+'; /* Put back the plus sign for the first modifier */ + while ((gmt_strtok (modifier, "+", &pos, item))) { /* While there are unprocessed modifiers */ + if ((code = gmtinit_find_argument (API, kw[k].long_modifiers, kw[k].short_modifiers, item, '=', argument))) /* Get the modifier, or return 0 if unrecognized */ + sprintf (add, "+%c%s", code, argument); /* Append modifier with argument next to it (may be empty) */ + else { + GMT_Report (API, GMT_MSG_NORMAL, "Long-modifier form %s for option -%c not recognized!\n", &directive[1], opt->option); + add[0] = '\0'; + } + strcat (new_arg, add); /* Add to the short-format option argument */ + } + } + if (n_sections > 1) { /* Need to separate results per section with the separator character */ + if (section < (n_sections - 1)) /* Except for last we need to append separator */ + strcat (new_arg, sep); /* Add to the short-format option argument */ + if (sect_end > 0) orig[sect_end] = kw[k].separator; /* Put back separator at end of current section */ + e_code = kw[k].separator; /* Since after first section we no longer have '=' to replace */ + } } - else - text[0] = '\0'; /* No argument to pass on */ gmt_M_str_free (opt->arg); /* Free old par=value string argument */ - GMT_Report (API, GMT_MSG_DEBUG, "Converting long-format --%s to -%c%s\n", opt->arg, opt->option, text); - opt->arg = strdup (text); /* Allocate copy of new argument */ + gmtlib_handle_escape_text (new_arg, '+', -1); /* Restore escaped +? sequences */ + opt->arg = strdup (new_arg); /* Allocate copy of new argument */ + } + if (modified && gmt_M_is_verbose (API->GMT, GMT_MSG_LONG_VERBOSE)) { /* Echo the converted options */ + char *cmd = GMT_Create_Cmd (API, *options); + GMT_Report (API, GMT_MSG_LONG_VERBOSE, "Reformatted options: %s\n", cmd); + GMT_Destroy_Cmd (API, &cmd); /* Free string */ } } -#endif GMT_LOCAL int get_psl_encoding (const char *encoding) { /* Return the specified encoding ID */ @@ -1799,26 +1976,30 @@ GMT_LOCAL int gmtinit_parse_U_option (struct GMT_CTRL *GMT, char *item) { char word[GMT_LEN256] = {""}, *c = NULL; /* Find the first +c|j|o that looks like it may be a modifier and not random text */ while (k < len && !(is_plus(item,k) && (is_label(item,k) || is_just(item,k) || is_off(item,k)))) k++; - c = &item[k-1]; /* Start of the modifier */ - c[0] = '\0'; /* Chop off the + so we can parse the label, if any */ - if (item[0]) strncpy (GMT->current.ps.map_logo_label, item, GMT_LEN256-1); /* Got a label */ - c[0] = '+'; /* Restore modifiers */ - while (gmt_getmodopt (GMT, 'U', c, "cjo", &pos, word, &uerr) && uerr == 0) { - switch (word[0]) { - case 'c': /* Maybe +c but only if at end of followed by another modifier */ - if (word[1] == '+' || word[1] == '\0') /* Use command string */ - GMT->current.ps.logo_cmd = true; - break; - case 'j': /* Maybe +j if the next two letters are from LCRBMT */ - if (strchr ("LCRBMT", word[1]) && strchr ("LCRBMT", word[2])) - just = gmt_just_decode (GMT, &word[1], GMT->current.setting.map_logo_justify); - break; - case 'o': /* Maybe +o if next letter could be part of a number */ - if (strchr ("-+.0123456789", word[1])) { /* Seems to be a number */ - if ((k = gmt_get_pair (GMT, &word[1], GMT_PAIR_DIM_DUP, GMT->current.setting.map_logo_pos)) < 2) error++; - } - break; - default: break; /* These are caught in gmt_getmodopt so break is just for Coverity */ + if (k == len) /* MOdifiers were just random text */ + strncpy (GMT->current.ps.map_logo_label, item, GMT_LEN256-1); /* Got a label */ + else { /* Appears to have gotten a valid modifier or more */ + c = &item[k-1]; /* Start of the modifier */ + c[0] = '\0'; /* Chop off the + so we can parse the label, if any */ + if (item[0]) strncpy (GMT->current.ps.map_logo_label, item, GMT_LEN256-1); /* Got a label */ + c[0] = '+'; /* Restore modifiers */ + while (gmt_getmodopt (GMT, 'U', c, "cjo", &pos, word, &uerr) && uerr == 0) { + switch (word[0]) { + case 'c': /* Maybe +c but only if at end of followed by another modifier */ + if (word[1] == '+' || word[1] == '\0') /* Use command string */ + GMT->current.ps.logo_cmd = true; + break; + case 'j': /* Maybe +j if the next two letters are from LCRBMT */ + if (strchr ("LCRBMT", word[1]) && strchr ("LCRBMT", word[2])) + just = gmt_just_decode (GMT, &word[1], GMT->current.setting.map_logo_justify); + break; + case 'o': /* Maybe +o if next letter could be part of a number */ + if (strchr ("-+.0123456789", word[1])) { /* Seems to be a number */ + if ((k = gmt_get_pair (GMT, &word[1], GMT_PAIR_DIM_DUP, GMT->current.setting.map_logo_pos)) < 2) error++; + } + break; + default: break; /* These are caught in gmt_getmodopt so break is just for Coverity */ + } } } GMT->current.setting.map_logo_justify = just; @@ -12704,7 +12885,7 @@ bool panel_B_get (struct GMTAPI_CTRL *API, int fig, int row, int col) { } /*! Prepare options if missing and initialize module */ -struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, const char *keys, const char *in_required, struct GMT_OPTION **options, struct GMT_CTRL **Ccopy) { +struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, const char *keys, const char *in_required, struct GMT_KEYWORD_DICTIONARY *this_module_kw, struct GMT_OPTION **options, struct GMT_CTRL **Ccopy) { /* For modern runmode only - otherwise we simply call gmt_begin_module_sub. * We must consult the required string. It may contain options that we need to set implicitly. * Possible letters in the required string are: @@ -12735,9 +12916,9 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name, struct GMT_CTRL *GMT = API->GMT; API->error = GMT_NOERROR; -#ifdef USE_GMT_KWD - gmtinit_kw_replace (API, NULL, options); -#endif + #if defined(USE_COMMON_LONG_OPTIONS) + gmtinit_kw_replace (API, this_module_kw, options); /* Replace --long-option syntax with equivalent -onechar options */ + #endif /* Making -R globally available means it must affect history, etc. The simplest fix here is to * make sure pscoast -E, if passing old +r|R area settings via -E, is split into -R before GMT_Parse_Common is called */ @@ -13178,7 +13359,7 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name, /*! Backwards compatible gmt_begin_module function for external modules built with GMT 5.3 or learlier */ struct GMT_CTRL * gmt_begin_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, struct GMT_CTRL **Ccopy) { API->GMT->current.setting.run_mode = GMT_CLASSIC; /* Since gmt_begin_module is 5.3 or earlier */ - return (gmt_init_module (API, lib_name, mod_name, "", "", NULL, Ccopy)); + return (gmt_init_module (API, lib_name, mod_name, "", "", NULL, NULL, Ccopy)); } /*! . */ diff --git a/src/gmt_internals.h b/src/gmt_internals.h index e7468242cd6..d0253f27cfc 100644 --- a/src/gmt_internals.h +++ b/src/gmt_internals.h @@ -50,6 +50,7 @@ struct GMT_XINGS { EXTERN_MSC char *opt (struct GMTAPI_CTRL *API,char code); +EXTERN_MSC void gmtlib_handle_escape_text (char *text, char key, int way); EXTERN_MSC int gmtlib_ascii_output_trailing_text (struct GMT_CTRL *GMT, FILE *fp, uint64_t n, double *ptr, char *txt); EXTERN_MSC void gmtlib_reparse_i_option (struct GMT_CTRL *GMT, uint64_t n_columns); EXTERN_MSC void gmtlib_reparse_o_option (struct GMT_CTRL *GMT, uint64_t n_columns); diff --git a/src/gmt_prototypes.h b/src/gmt_prototypes.h index 2a23f2aa1a3..b97f888a8dd 100644 --- a/src/gmt_prototypes.h +++ b/src/gmt_prototypes.h @@ -75,7 +75,7 @@ EXTERN_MSC bool gmt_check_filearg (struct GMT_CTRL *GMT, char option, char *file EXTERN_MSC int gmt_parse_model (struct GMT_CTRL *GMT, char option, char *in_arg, unsigned int dim, struct GMT_MODEL *M); EXTERN_MSC struct GMT_CTRL *gmt_begin (struct GMTAPI_CTRL *API, const char *session, unsigned int pad); EXTERN_MSC void gmt_end (struct GMT_CTRL *GMT); -EXTERN_MSC struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, const char *keys, const char *required, struct GMT_OPTION **options, struct GMT_CTRL **Ccopy); +EXTERN_MSC struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, const char *keys, const char *required, struct GMT_KEYWORD_DICTIONARY *this_module_kw, struct GMT_OPTION **options, struct GMT_CTRL **Ccopy); EXTERN_MSC struct GMT_CTRL *gmt_begin_module (struct GMTAPI_CTRL *API, const char *lib_name, const char *mod_name, struct GMT_CTRL **Ccopy); EXTERN_MSC void gmt_end_module (struct GMT_CTRL *GMT, struct GMT_CTRL *Ccopy); EXTERN_MSC int gmt_init_time_system_structure (struct GMT_CTRL *GMT, struct GMT_TIME_SYSTEM *time_system); diff --git a/src/gmt_types.h b/src/gmt_types.h index 22377f59d22..d6b18d31364 100644 --- a/src/gmt_types.h +++ b/src/gmt_types.h @@ -43,13 +43,16 @@ struct GMT_MATH_MACRO { char **arg; /* List of those commands */ }; -#ifdef USE_GMT_KWD -/*! Definition of GMT_KW_DICT used to expand keyword-value pairs to GMT options */ -struct GMT_KW_DICT { /* Used for keyword-value lookup */ - char code; /* Single character GMT option code */ - char name[31]; /* Name of corresponding keyword */ +/*! Definition of GMT_KEYWORD_DICTIONARY used to expand keyword-value pairs to GMT options */ +struct GMT_KEYWORD_DICTIONARY { /* Used for keyword-value lookup */ + char separator; /* Single character separating 2 or more identical specifications [0 for no repeat] */ + char short_option; /* Single character GMT option code */ + char long_option[31]; /* Name of corresponding long option */ + char short_directives[32]; /* Single character directives, comma-separated */ + char long_directives[256]; /* Long name directives, comma-separated */ + char short_modifiers[32]; /* Single character modifiers, comma-separated */ + char long_modifiers[256]; /* Long name modifiers, comma-separated */ }; -#endif /*! Definition of structure use for finding optimal n_columns/n_rows for surface */ struct GMT_SURFACE_SUGGESTION { /* Used to find top ten list of faster grid dimensions */ diff --git a/src/gmtconnect.c b/src/gmtconnect.c index 0b8d4604de7..51ba08a322c 100644 --- a/src/gmtconnect.c +++ b/src/gmtconnect.c @@ -307,7 +307,7 @@ int GMT_gmtconnect (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize defaults in a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtconvert.c b/src/gmtconvert.c index 5c3443063b8..9b33fcc6173 100644 --- a/src/gmtconvert.c +++ b/src/gmtconvert.c @@ -459,7 +459,7 @@ int GMT_gmtconvert (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtdefaults.c b/src/gmtdefaults.c index 8bf87738641..532b988ea5e 100644 --- a/src/gmtdefaults.c +++ b/src/gmtdefaults.c @@ -136,7 +136,7 @@ int GMT_gmtdefaults (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtget.c b/src/gmtget.c index bfb846064dd..2a8ea3f0ab1 100644 --- a/src/gmtget.c +++ b/src/gmtget.c @@ -135,7 +135,7 @@ int GMT_gmtget (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtinfo.c b/src/gmtinfo.c index ba708b0d9d7..1c4db9fcc29 100644 --- a/src/gmtinfo.c +++ b/src/gmtinfo.c @@ -400,7 +400,7 @@ int GMT_gmtinfo (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtlogo.c b/src/gmtlogo.c index 1627ccdf4d6..f2586ae8885 100644 --- a/src/gmtlogo.c +++ b/src/gmtlogo.c @@ -334,7 +334,7 @@ int GMT_gmtlogo (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtmath.c b/src/gmtmath.c index c876fc5a050..6be9b5250cf 100644 --- a/src/gmtmath.c +++ b/src/gmtmath.c @@ -6238,7 +6238,7 @@ int GMT_gmtmath (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((list = gmt_substitute_macros (GMT, options, "gmtmath.macros")) == NULL) Return1 (GMT_DATA_READ_ERROR); if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, list)) Return1 (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/gmtread.c b/src/gmtread.c index 34fe51c1c16..69dace2f7b4 100644 --- a/src/gmtread.c +++ b/src/gmtread.c @@ -180,7 +180,7 @@ int GMT_gmtread (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtregress.c b/src/gmtregress.c index 0b7e3d35714..cb2955b50c1 100644 --- a/src/gmtregress.c +++ b/src/gmtregress.c @@ -1091,7 +1091,7 @@ int GMT_gmtregress (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtselect.c b/src/gmtselect.c index 1b1a860467d..5b4b5aa44f9 100644 --- a/src/gmtselect.c +++ b/src/gmtselect.c @@ -570,7 +570,7 @@ int GMT_gmtselect (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtset.c b/src/gmtset.c index db43d1ce23b..b63c6f7a8f4 100644 --- a/src/gmtset.c +++ b/src/gmtset.c @@ -153,7 +153,7 @@ int GMT_gmtset (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtsimplify.c b/src/gmtsimplify.c index a13256a5897..f24fe030607 100644 --- a/src/gmtsimplify.c +++ b/src/gmtsimplify.c @@ -300,7 +300,7 @@ int GMT_gmtsimplify (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtspatial.c b/src/gmtspatial.c index 1e27a7cc72e..7b4577d5437 100644 --- a/src/gmtspatial.c +++ b/src/gmtspatial.c @@ -1098,7 +1098,7 @@ int GMT_gmtspatial (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtvector.c b/src/gmtvector.c index 2e785aaa68a..8f75cc2418f 100644 --- a/src/gmtvector.c +++ b/src/gmtvector.c @@ -457,7 +457,7 @@ int GMT_gmtvector (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtwhich.c b/src/gmtwhich.c index ccdd45e84b7..17cda2627dc 100644 --- a/src/gmtwhich.c +++ b/src/gmtwhich.c @@ -164,7 +164,7 @@ int GMT_gmtwhich (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gmtwrite.c b/src/gmtwrite.c index ad745d21aa7..0ba722ba3a2 100644 --- a/src/gmtwrite.c +++ b/src/gmtwrite.c @@ -175,7 +175,7 @@ int GMT_gmtwrite (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grd2cpt.c b/src/grd2cpt.c index 1bed63cfe2c..d159603fe41 100644 --- a/src/grd2cpt.c +++ b/src/grd2cpt.c @@ -462,7 +462,7 @@ int GMT_grd2cpt (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grd2kml.c b/src/grd2kml.c index 3588836175a..c63c2444ea4 100644 --- a/src/grd2kml.c +++ b/src/grd2kml.c @@ -415,7 +415,7 @@ int GMT_grd2kml (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grd2xyz.c b/src/grd2xyz.c index 3b4354fad42..bb9fb3c229f 100644 --- a/src/grd2xyz.c +++ b/src/grd2xyz.c @@ -246,7 +246,7 @@ int GMT_grd2xyz (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, &io, options)) != 0) Return (error); diff --git a/src/grdblend.c b/src/grdblend.c index f7e0c0d2e8b..6bfd3b27604 100644 --- a/src/grdblend.c +++ b/src/grdblend.c @@ -777,7 +777,7 @@ int GMT_grdblend (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdclip.c b/src/grdclip.c index 0527532c00a..7058c61662e 100644 --- a/src/grdclip.c +++ b/src/grdclip.c @@ -306,7 +306,7 @@ int GMT_grdclip (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdcontour.c b/src/grdcontour.c index a8c9dabed84..83ed6ed9c62 100644 --- a/src/grdcontour.c +++ b/src/grdcontour.c @@ -1152,7 +1152,7 @@ int GMT_grdcontour (void *V_API, int mode, void *args) { /* NOT -N, so parse the command-line arguments as a normal module would */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdconvert.c b/src/grdconvert.c index 7b807f63dba..fef1bc1d239 100644 --- a/src/grdconvert.c +++ b/src/grdconvert.c @@ -192,7 +192,7 @@ int GMT_grdconvert (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdcut.c b/src/grdcut.c index 5bff3ed5696..e4e5a5e4174 100644 --- a/src/grdcut.c +++ b/src/grdcut.c @@ -337,8 +337,7 @@ int GMT_grdcut (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, - &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdedit.c b/src/grdedit.c index bc3ead7e171..63cdd1196d7 100644 --- a/src/grdedit.c +++ b/src/grdedit.c @@ -273,7 +273,7 @@ int GMT_grdedit (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdfft.c b/src/grdfft.c index 50bb65affa8..43f0716dd08 100644 --- a/src/grdfft.c +++ b/src/grdfft.c @@ -838,7 +838,7 @@ int GMT_grdfft (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, &f_info, options)) != 0) Return (error); diff --git a/src/grdfill.c b/src/grdfill.c index 3979a34c095..3eabeefc1f8 100644 --- a/src/grdfill.c +++ b/src/grdfill.c @@ -496,7 +496,7 @@ int GMT_grdfill (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdfilter.c b/src/grdfilter.c index 0dbe6b44d52..e704edc5ee0 100644 --- a/src/grdfilter.c +++ b/src/grdfilter.c @@ -931,7 +931,7 @@ int GMT_grdfilter (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ GMT->common.x.n_threads = 1; /* Default to use only one core (we may change this to max cores) */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/grdfilter_mt.c b/src/grdfilter_mt.c index a8b6237f5a0..c3b78672803 100644 --- a/src/grdfilter_mt.c +++ b/src/grdfilter_mt.c @@ -660,7 +660,7 @@ int GMT_grdfilter_mt (void *V_API, int mode, void *args) /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_grdfilter_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = GMT_grdfilter_parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdgradient.c b/src/grdgradient.c index d558dab7978..969020c5444 100644 --- a/src/grdgradient.c +++ b/src/grdgradient.c @@ -433,7 +433,7 @@ int GMT_grdgradient (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdhisteq.c b/src/grdhisteq.c index 64da35954e6..6bea223a3b6 100644 --- a/src/grdhisteq.c +++ b/src/grdhisteq.c @@ -453,7 +453,7 @@ int GMT_grdhisteq (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdimage.c b/src/grdimage.c index 16472b2b818..d632a74403c 100644 --- a/src/grdimage.c +++ b/src/grdimage.c @@ -632,7 +632,7 @@ int GMT_grdimage (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdinfo.c b/src/grdinfo.c index 4d52b2db441..7f89931ca53 100644 --- a/src/grdinfo.c +++ b/src/grdinfo.c @@ -472,7 +472,7 @@ int GMT_grdinfo (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdinterpolate.c b/src/grdinterpolate.c index 885953aa535..5492e99f03e 100644 --- a/src/grdinterpolate.c +++ b/src/grdinterpolate.c @@ -241,7 +241,7 @@ int GMT_grdinterpolate (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdlandmask.c b/src/grdlandmask.c index 2143ee4b5ed..a0c249fe183 100644 --- a/src/grdlandmask.c +++ b/src/grdlandmask.c @@ -297,7 +297,7 @@ int GMT_grdlandmask (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdmask.c b/src/grdmask.c index 3f7e7202476..053c2d48c8b 100644 --- a/src/grdmask.c +++ b/src/grdmask.c @@ -306,7 +306,7 @@ int GMT_grdmask (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdmath.c b/src/grdmath.c index 56d408ed5d9..56a06b82b2d 100644 --- a/src/grdmath.c +++ b/src/grdmath.c @@ -6196,7 +6196,7 @@ int GMT_grdmath (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((list = gmt_substitute_macros (GMT, options, "grdmath.macros")) == NULL) Return1 (GMT_RUNTIME_ERROR); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return1 (API->error); diff --git a/src/grdpaste.c b/src/grdpaste.c index 8cd2419646c..7bf6d91346e 100644 --- a/src/grdpaste.c +++ b/src/grdpaste.c @@ -166,7 +166,7 @@ int GMT_grdpaste (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdproject.c b/src/grdproject.c index 4ce24bb3ea0..d4cce5e7079 100644 --- a/src/grdproject.c +++ b/src/grdproject.c @@ -249,7 +249,7 @@ int GMT_grdproject (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdsample.c b/src/grdsample.c index cf356e9e381..4b02e160ec0 100644 --- a/src/grdsample.c +++ b/src/grdsample.c @@ -253,7 +253,7 @@ int GMT_grdsample (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdtrack.c b/src/grdtrack.c index 6dc17af70e9..24e9df97339 100644 --- a/src/grdtrack.c +++ b/src/grdtrack.c @@ -771,7 +771,7 @@ int GMT_grdtrack (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdtrend.c b/src/grdtrend.c index 63bfde0dd4f..0958e4a2338 100644 --- a/src/grdtrend.c +++ b/src/grdtrend.c @@ -523,7 +523,7 @@ int GMT_grdtrend (void *V_API, int mode, void *args) { if ((error = gmt_report_usage (API, options, 0, usage)) != GMT_NOERROR) bailout (error); /* Give usage if requested */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdvector.c b/src/grdvector.c index 453d26e1478..ac4588ff4be 100644 --- a/src/grdvector.c +++ b/src/grdvector.c @@ -361,7 +361,7 @@ int GMT_grdvector (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdview.c b/src/grdview.c index a0919a0df1d..fec5f2bf933 100644 --- a/src/grdview.c +++ b/src/grdview.c @@ -811,7 +811,7 @@ int GMT_grdview (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/grdvolume.c b/src/grdvolume.c index 077f541b8ce..9cdedb5f966 100644 --- a/src/grdvolume.c +++ b/src/grdvolume.c @@ -465,7 +465,7 @@ int GMT_grdvolume (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/greenspline.c b/src/greenspline.c index cac2e8e5c03..82dcb3f6ee5 100644 --- a/src/greenspline.c +++ b/src/greenspline.c @@ -1462,7 +1462,7 @@ int GMT_greenspline (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/gshhg/gshhg.c b/src/gshhg/gshhg.c index e5620d81a3e..7b5b492be68 100644 --- a/src/gshhg/gshhg.c +++ b/src/gshhg/gshhg.c @@ -226,7 +226,7 @@ int GMT_gshhg (void *V_API, int mode, void *args) { if ((error = gmt_report_usage (API, options, 0, usage)) != GMT_NOERROR) bailout (error); /* Give usage if requested */ /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/img/img2grd.c b/src/img/img2grd.c index 056b8432dcb..c93e30ff660 100644 --- a/src/img/img2grd.c +++ b/src/img/img2grd.c @@ -431,7 +431,7 @@ int GMT_img2grd (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/inset.c b/src/inset.c index fa2d9bc6c78..3b9c141e841 100644 --- a/src/inset.c +++ b/src/inset.c @@ -236,7 +236,7 @@ int GMT_inset (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/kml2gmt.c b/src/kml2gmt.c index 3914fb70a07..01b12e7ece3 100644 --- a/src/kml2gmt.c +++ b/src/kml2gmt.c @@ -191,7 +191,7 @@ int GMT_kml2gmt (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/makecpt.c b/src/makecpt.c index e9f0f5de4c0..40225b39759 100644 --- a/src/makecpt.c +++ b/src/makecpt.c @@ -396,7 +396,7 @@ int GMT_makecpt (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/mapproject.c b/src/mapproject.c index 8b1a0bd3704..07bb0ed8681 100644 --- a/src/mapproject.c +++ b/src/mapproject.c @@ -778,7 +778,7 @@ int GMT_mapproject (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/mgd77/mgd77convert.c b/src/mgd77/mgd77convert.c index 12a239c0341..46adea7b4bb 100644 --- a/src/mgd77/mgd77convert.c +++ b/src/mgd77/mgd77convert.c @@ -238,7 +238,7 @@ int GMT_mgd77convert (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/mgd77/mgd77header.c b/src/mgd77/mgd77header.c index e8dea836df0..8b5df545490 100644 --- a/src/mgd77/mgd77header.c +++ b/src/mgd77/mgd77header.c @@ -198,7 +198,7 @@ int GMT_mgd77header (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ MGD77_Init (GMT, &M); /* Initialize input MGD77 Machinery */ diff --git a/src/mgd77/mgd77info.c b/src/mgd77/mgd77info.c index 3086942e3e3..a8b7d42e585 100644 --- a/src/mgd77/mgd77info.c +++ b/src/mgd77/mgd77info.c @@ -282,7 +282,7 @@ int GMT_mgd77info (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ MGD77_Init (GMT, &M); /* Initialize MGD77 Machinery */ diff --git a/src/mgd77/mgd77list.c b/src/mgd77/mgd77list.c index 268af0f2cd4..dc4609fa239 100644 --- a/src/mgd77/mgd77list.c +++ b/src/mgd77/mgd77list.c @@ -835,7 +835,7 @@ int GMT_mgd77list (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/mgd77/mgd77magref.c b/src/mgd77/mgd77magref.c index 8abde00098e..dcec91aeadf 100644 --- a/src/mgd77/mgd77magref.c +++ b/src/mgd77/mgd77magref.c @@ -438,7 +438,7 @@ int GMT_mgd77magref (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ MGD77_Init (GMT, &M); /* Initialize MGD77 Machinery */ diff --git a/src/mgd77/mgd77manage.c b/src/mgd77/mgd77manage.c index 8a1419c3dad..1d30987b5b2 100644 --- a/src/mgd77/mgd77manage.c +++ b/src/mgd77/mgd77manage.c @@ -551,7 +551,7 @@ int GMT_mgd77manage (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/mgd77/mgd77path.c b/src/mgd77/mgd77path.c index 8d70390b93a..2532575c84c 100644 --- a/src/mgd77/mgd77path.c +++ b/src/mgd77/mgd77path.c @@ -164,7 +164,7 @@ int GMT_mgd77path (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/mgd77/mgd77sniffer.c b/src/mgd77/mgd77sniffer.c index 51e0df8ca39..544f5489d0d 100644 --- a/src/mgd77/mgd77sniffer.c +++ b/src/mgd77/mgd77sniffer.c @@ -606,7 +606,7 @@ int GMT_mgd77sniffer (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); strncpy (GMT->current.setting.format_clock_out, "hh:mm:ss.xx", GMT_LEN64); diff --git a/src/mgd77/mgd77track.c b/src/mgd77/mgd77track.c index 3baba05c816..1f8e65ae2e1 100644 --- a/src/mgd77/mgd77track.c +++ b/src/mgd77/mgd77track.c @@ -593,7 +593,7 @@ int GMT_mgd77track (void *V_API, int mode, void *args) { if ((error = gmt_report_usage (API, options, 0, usage)) != GMT_NOERROR) bailout (error); /* Give usage if requested */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ /* Parse the command-line arguments */ diff --git a/src/movie.c b/src/movie.c index 2b2de4920d2..509a5bbdfbf 100644 --- a/src/movie.c +++ b/src/movie.c @@ -974,7 +974,7 @@ int GMT_movie (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/nearneighbor.c b/src/nearneighbor.c index 4e75b1168eb..cf71629bda3 100644 --- a/src/nearneighbor.c +++ b/src/nearneighbor.c @@ -1,4 +1,4 @@ - /*-------------------------------------------------------------------- +/*-------------------------------------------------------------------- * * Copyright (c) 1991-2019 by the GMT Team (https://www.generic-mapping-tools.org/team.html) * See LICENSE.TXT file for copying and redistribution conditions. @@ -303,7 +303,7 @@ int GMT_nearneighbor (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/potential/gmtflexure.c b/src/potential/gmtflexure.c index 0ecfaf19992..da73b9a1aec 100644 --- a/src/potential/gmtflexure.c +++ b/src/potential/gmtflexure.c @@ -1250,7 +1250,7 @@ int GMT_gmtflexure (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/potential/gmtgravmag3d.c b/src/potential/gmtgravmag3d.c index 1aa06f9bb4b..52570e7ed3e 100644 --- a/src/potential/gmtgravmag3d.c +++ b/src/potential/gmtgravmag3d.c @@ -421,7 +421,7 @@ int GMT_gmtgravmag3d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/potential/gravfft.c b/src/potential/gravfft.c index 77922184275..9f5b7d24683 100644 --- a/src/potential/gravfft.c +++ b/src/potential/gravfft.c @@ -511,7 +511,7 @@ int GMT_gravfft (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/potential/grdflexure.c b/src/potential/grdflexure.c index 4e7c1f301db..7d4b5935a59 100644 --- a/src/potential/grdflexure.c +++ b/src/potential/grdflexure.c @@ -816,7 +816,7 @@ int GMT_grdflexure (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/potential/grdgravmag3d.c b/src/potential/grdgravmag3d.c index 37e895dc6dc..6d275f659ee 100644 --- a/src/potential/grdgravmag3d.c +++ b/src/potential/grdgravmag3d.c @@ -479,7 +479,7 @@ int GMT_grdgravmag3d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ GMT->common.x.n_threads = 1; /* Default to use only one core (we may change this to max cores) */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/potential/grdredpol.c b/src/potential/grdredpol.c index 934732ff1d9..6f8a8781a77 100644 --- a/src/potential/grdredpol.c +++ b/src/potential/grdredpol.c @@ -1213,7 +1213,7 @@ int GMT_grdredpol (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/potential/grdseamount.c b/src/potential/grdseamount.c index adde77350e0..8b2829b99d4 100644 --- a/src/potential/grdseamount.c +++ b/src/potential/grdseamount.c @@ -500,7 +500,7 @@ int GMT_grdseamount (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != GMT_NOERROR) Return (error); diff --git a/src/potential/talwani2d.c b/src/potential/talwani2d.c index 61a3e2521b4..2d100b925c9 100644 --- a/src/potential/talwani2d.c +++ b/src/potential/talwani2d.c @@ -543,7 +543,7 @@ int GMT_talwani2d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/potential/talwani3d.c b/src/potential/talwani3d.c index 68a25f3adaf..6462ca8b09c 100644 --- a/src/potential/talwani3d.c +++ b/src/potential/talwani3d.c @@ -724,7 +724,7 @@ int GMT_talwani3d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/project.c b/src/project.c index cb8188bf3a6..c8ae806cec0 100644 --- a/src/project.c +++ b/src/project.c @@ -646,7 +646,7 @@ int GMT_project (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psbasemap.c b/src/psbasemap.c index 3152353d15a..5a575c51626 100644 --- a/src/psbasemap.c +++ b/src/psbasemap.c @@ -266,7 +266,7 @@ int GMT_psbasemap (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psclip.c b/src/psclip.c index c76d59ec2de..22f1e78fe1f 100644 --- a/src/psclip.c +++ b/src/psclip.c @@ -239,7 +239,7 @@ int GMT_psclip (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/pscoast.c b/src/pscoast.c index 7a641243fbe..45843ec9f42 100644 --- a/src/pscoast.c +++ b/src/pscoast.c @@ -758,7 +758,7 @@ int GMT_pscoast (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize defaults in a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) { diff --git a/src/pscontour.c b/src/pscontour.c index 3f25e7f9176..1db802d25bb 100644 --- a/src/pscontour.c +++ b/src/pscontour.c @@ -851,7 +851,7 @@ int GMT_pscontour (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ /* Must intercept any old-style -Eaz/el here and change it to -p */ if ((opt = GMT_Find_Option (API, 'E', options)) && gmt_M_compat_check (GMT, 4)) { /* Got -E, check if given a file */ if (gmt_access (GMT, opt->arg, F_OK)) { /* Argument not a file we can open, so under compat mode we assume we got -Eaz/el */ diff --git a/src/psconvert.c b/src/psconvert.c index 28900df90d9..06d26956fdd 100644 --- a/src/psconvert.c +++ b/src/psconvert.c @@ -1531,7 +1531,7 @@ int GMT_psconvert (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psevents.c b/src/psevents.c index 2bfd24926cb..9a277d3769b 100644 --- a/src/psevents.c +++ b/src/psevents.c @@ -432,7 +432,7 @@ int GMT_psevents (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/pshistogram.c b/src/pshistogram.c index 32abd0eafc3..b3b08080d68 100644 --- a/src/pshistogram.c +++ b/src/pshistogram.c @@ -774,7 +774,7 @@ int GMT_pshistogram (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (gmt_M_compat_check (GMT, 4)) { /* Must see if -E was given and temporarily change it */ struct GMT_OPTION *opt = NULL; for (opt = options; opt->next; opt = opt->next) { diff --git a/src/psimage.c b/src/psimage.c index f76b20899d6..3878946249f 100644 --- a/src/psimage.c +++ b/src/psimage.c @@ -435,7 +435,7 @@ int GMT_psimage (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/pslegend.c b/src/pslegend.c index d5201caaf7e..f9aca034d23 100644 --- a/src/pslegend.c +++ b/src/pslegend.c @@ -495,7 +495,7 @@ int GMT_pslegend (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psmask.c b/src/psmask.c index dc2f2003524..bd02f28e0d6 100644 --- a/src/psmask.c +++ b/src/psmask.c @@ -653,7 +653,7 @@ int GMT_psmask (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psrose.c b/src/psrose.c index f96ed8fd584..90c0e10cc9a 100644 --- a/src/psrose.c +++ b/src/psrose.c @@ -482,7 +482,7 @@ int GMT_psrose (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psscale.c b/src/psscale.c index 31ff95db2a2..3e1af2863e7 100644 --- a/src/psscale.c +++ b/src/psscale.c @@ -1535,7 +1535,7 @@ int GMT_psscale (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ /* Overrule GMT settings of MAP_FRAME_AXES. Use WESN */ GMT->current.map.frame.side[S_SIDE] = GMT->current.map.frame.side[E_SIDE] = GMT->current.map.frame.side[N_SIDE] = GMT->current.map.frame.side[W_SIDE] = GMT_AXIS_ALL; GMT->current.map.frame.draw = false; /* No -B parsed explicitly yet */ diff --git a/src/pssolar.c b/src/pssolar.c index 377b586ce4e..42179f0acd5 100644 --- a/src/pssolar.c +++ b/src/pssolar.c @@ -437,7 +437,7 @@ int GMT_pssolar (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psternary.c b/src/psternary.c index 70d4f553c7e..e868bae9974 100644 --- a/src/psternary.c +++ b/src/psternary.c @@ -374,7 +374,7 @@ int GMT_psternary (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/pstext.c b/src/pstext.c index 17bbbfcc910..5e8e65a735b 100644 --- a/src/pstext.c +++ b/src/pstext.c @@ -803,7 +803,7 @@ int GMT_pstext (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/pswiggle.c b/src/pswiggle.c index e2bedd4c244..4d8ec6d74de 100644 --- a/src/pswiggle.c +++ b/src/pswiggle.c @@ -481,7 +481,7 @@ int GMT_pswiggle (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/psxy.c b/src/psxy.c index 992b4819089..017fd9cf228 100644 --- a/src/psxy.c +++ b/src/psxy.c @@ -885,7 +885,7 @@ int GMT_psxy (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); /* Initialize GMT_SYMBOL structure */ diff --git a/src/psxy_new.c b/src/psxy_new.c index 31ef4bbfb74..3cbcaaf136a 100644 --- a/src/psxy_new.c +++ b/src/psxy_new.c @@ -867,7 +867,7 @@ int GMT_psxy (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); /* Initialize GMT_SYMBOL structure */ diff --git a/src/psxyz.c b/src/psxyz.c index 6f6afc3bb63..c9d76ee3d37 100644 --- a/src/psxyz.c +++ b/src/psxyz.c @@ -607,7 +607,7 @@ int GMT_psxyz (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); /* Initialize GMT_SYMBOL structure */ diff --git a/src/sample1d.c b/src/sample1d.c index 50d1fbde123..37fa735ab18 100644 --- a/src/sample1d.c +++ b/src/sample1d.c @@ -324,7 +324,7 @@ int GMT_sample1d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/segy/pssegy.c b/src/segy/pssegy.c index 67bc934d023..1d3161fe5b4 100644 --- a/src/segy/pssegy.c +++ b/src/segy/pssegy.c @@ -493,7 +493,7 @@ int GMT_pssegy (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/segy/pssegyz.c b/src/segy/pssegyz.c index e36c07e715e..3b33caa9508 100644 --- a/src/segy/pssegyz.c +++ b/src/segy/pssegyz.c @@ -615,7 +615,7 @@ int GMT_pssegyz (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/segy/segy2grd.c b/src/segy/segy2grd.c index e9c4010d2b0..3819ac1acc1 100644 --- a/src/segy/segy2grd.c +++ b/src/segy/segy2grd.c @@ -303,7 +303,7 @@ int GMT_segy2grd (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/seis/pscoupe.c b/src/seis/pscoupe.c index 4e65071d815..c7ad1b01e8d 100644 --- a/src/seis/pscoupe.c +++ b/src/seis/pscoupe.c @@ -888,7 +888,7 @@ int GMT_pscoupe (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/seis/psmeca.c b/src/seis/psmeca.c index bbf2669451e..21e8542d384 100644 --- a/src/seis/psmeca.c +++ b/src/seis/psmeca.c @@ -554,7 +554,7 @@ int GMT_psmeca (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/seis/pspolar.c b/src/seis/pspolar.c index c9671a6a5d9..a238ff2a853 100644 --- a/src/seis/pspolar.c +++ b/src/seis/pspolar.c @@ -495,7 +495,7 @@ int GMT_pspolar (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/seis/pssac.c b/src/seis/pssac.c index c54d5b32ad2..11a4280dad7 100644 --- a/src/seis/pssac.c +++ b/src/seis/pssac.c @@ -627,7 +627,7 @@ int GMT_pssac (void *V_API, int mode, void *args) { /* High-level function that /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spectrum1d.c b/src/spectrum1d.c index 57ecaf7f6bf..822fb4013fa 100644 --- a/src/spectrum1d.c +++ b/src/spectrum1d.c @@ -707,7 +707,7 @@ int GMT_spectrum1d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/sph2grd.c b/src/sph2grd.c index 7d02687c801..7724a7c98a5 100644 --- a/src/sph2grd.c +++ b/src/sph2grd.c @@ -238,7 +238,7 @@ int GMT_sph2grd (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/sphdistance.c b/src/sphdistance.c index 55a1f22f096..75444752eeb 100644 --- a/src/sphdistance.c +++ b/src/sphdistance.c @@ -289,7 +289,7 @@ int GMT_sphdistance (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ gmt_parse_common_options (GMT, "f", 'f', "g"); /* Implicitly set -fg since this is spherical triangulation */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/sphinterpolate.c b/src/sphinterpolate.c index da52b678188..18bcb713406 100644 --- a/src/sphinterpolate.c +++ b/src/sphinterpolate.c @@ -235,7 +235,7 @@ int GMT_sphinterpolate (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ gmt_parse_common_options (GMT, "f", 'f', "g"); /* Implicitly set -fg since this is spherical triangulation */ Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); diff --git a/src/sphtriangulate.c b/src/sphtriangulate.c index 0efdf382431..4f8c30ff144 100644 --- a/src/sphtriangulate.c +++ b/src/sphtriangulate.c @@ -559,7 +559,7 @@ int GMT_sphtriangulate (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ gmt_parse_common_options (GMT, "f", 'f', "g"); /* Implicitly set -fg since this is spherical triangulation */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/splitxyz.c b/src/splitxyz.c index 766dda25a31..350fa4f46b5 100644 --- a/src/splitxyz.c +++ b/src/splitxyz.c @@ -338,7 +338,7 @@ int GMT_splitxyz (void *V_API, int mode, void *args) { /* Parse the command-line arguments; return if errors are encountered */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/spotter/backtracker.c b/src/spotter/backtracker.c index db9fb531ac5..24192790663 100644 --- a/src/spotter/backtracker.c +++ b/src/spotter/backtracker.c @@ -435,7 +435,7 @@ int GMT_backtracker (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/gmtpmodeler.c b/src/spotter/gmtpmodeler.c index 6b743f35530..54844d98114 100644 --- a/src/spotter/gmtpmodeler.c +++ b/src/spotter/gmtpmodeler.c @@ -253,7 +253,7 @@ int GMT_gmtpmodeler (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/grdpmodeler.c b/src/spotter/grdpmodeler.c index 2e6e3a89b49..855e23bad8c 100644 --- a/src/spotter/grdpmodeler.c +++ b/src/spotter/grdpmodeler.c @@ -283,7 +283,7 @@ int GMT_grdpmodeler (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/grdrotater.c b/src/spotter/grdrotater.c index df40545d40a..07592d0319c 100644 --- a/src/spotter/grdrotater.c +++ b/src/spotter/grdrotater.c @@ -441,7 +441,7 @@ int GMT_grdrotater (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/grdspotter.c b/src/spotter/grdspotter.c index 9413bd56046..7fd2cde36fe 100644 --- a/src/spotter/grdspotter.c +++ b/src/spotter/grdspotter.c @@ -558,7 +558,7 @@ int GMT_grdspotter (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/hotspotter.c b/src/spotter/hotspotter.c index ff5275cb86e..8344c948758 100644 --- a/src/spotter/hotspotter.c +++ b/src/spotter/hotspotter.c @@ -340,7 +340,7 @@ int GMT_hotspotter (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/originater.c b/src/spotter/originater.c index ea97e654eb2..5dd5e12007e 100644 --- a/src/spotter/originater.c +++ b/src/spotter/originater.c @@ -393,7 +393,7 @@ int GMT_originater (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/polespotter.c b/src/spotter/polespotter.c index e04ac76438a..6b29876c268 100644 --- a/src/spotter/polespotter.c +++ b/src/spotter/polespotter.c @@ -306,7 +306,7 @@ int GMT_polespotter (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/rotconverter.c b/src/spotter/rotconverter.c index 50058cbf7d0..bab06c31f00 100644 --- a/src/spotter/rotconverter.c +++ b/src/spotter/rotconverter.c @@ -334,7 +334,7 @@ int GMT_rotconverter (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); if ((ptr = GMT_Find_Option (API, 'f', options)) == NULL) gmt_parse_common_options (GMT, "f", 'f', "g"); /* Did not set -f, implicitly set -fg */ Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ diff --git a/src/spotter/rotsmoother.c b/src/spotter/rotsmoother.c index 3a9489bdc9d..b1299a3890b 100644 --- a/src/spotter/rotsmoother.c +++ b/src/spotter/rotsmoother.c @@ -279,7 +279,7 @@ int GMT_rotsmoother (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/subplot.c b/src/subplot.c index e71f9d91149..ba8d239c019 100644 --- a/src/subplot.c +++ b/src/subplot.c @@ -698,7 +698,7 @@ int GMT_subplot (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); diff --git a/src/surface.c b/src/surface.c index 0dfa3ad1ab5..e93292a8d60 100644 --- a/src/surface.c +++ b/src/surface.c @@ -1872,7 +1872,7 @@ int GMT_surface (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/surface_experimental.c b/src/surface_experimental.c index 6b381decbf8..08142ff054e 100644 --- a/src/surface_experimental.c +++ b/src/surface_experimental.c @@ -2207,7 +2207,7 @@ int GMT_surface_mt (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/surface_old.c b/src/surface_old.c index 4d0ff54e1a5..0bd2dbaf6ca 100644 --- a/src/surface_old.c +++ b/src/surface_old.c @@ -1756,7 +1756,7 @@ int GMT_surface_old (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/trend1d.c b/src/trend1d.c index baa62866a24..6682a7a2930 100644 --- a/src/trend1d.c +++ b/src/trend1d.c @@ -679,7 +679,7 @@ int GMT_trend1d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/trend2d.c b/src/trend2d.c index 3b60b734035..fbdc688f71d 100644 --- a/src/trend2d.c +++ b/src/trend2d.c @@ -564,7 +564,7 @@ int GMT_trend2d (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/triangulate.c b/src/triangulate.c index 11ab83775f5..21c0c23a4aa 100644 --- a/src/triangulate.c +++ b/src/triangulate.c @@ -356,7 +356,7 @@ int GMT_triangulate (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_binlist.c b/src/x2sys/x2sys_binlist.c index 8a95560e655..e9c963b4f85 100644 --- a/src/x2sys/x2sys_binlist.c +++ b/src/x2sys/x2sys_binlist.c @@ -212,7 +212,7 @@ int GMT_x2sys_binlist (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_cross.c b/src/x2sys/x2sys_cross.c index c87ea51281a..247b215581d 100644 --- a/src/x2sys/x2sys_cross.c +++ b/src/x2sys/x2sys_cross.c @@ -423,7 +423,7 @@ int GMT_x2sys_cross (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_datalist.c b/src/x2sys/x2sys_datalist.c index e00a3a7056f..127681a993a 100644 --- a/src/x2sys/x2sys_datalist.c +++ b/src/x2sys/x2sys_datalist.c @@ -258,7 +258,7 @@ int GMT_x2sys_datalist (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_get.c b/src/x2sys/x2sys_get.c index 83b9620a22a..fd6b6ff1e9b 100644 --- a/src/x2sys/x2sys_get.c +++ b/src/x2sys/x2sys_get.c @@ -234,7 +234,7 @@ int GMT_x2sys_get (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_init.c b/src/x2sys/x2sys_init.c index 29fa142cbff..b03b0af5ef7 100644 --- a/src/x2sys/x2sys_init.c +++ b/src/x2sys/x2sys_init.c @@ -307,7 +307,7 @@ int GMT_x2sys_init (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_list.c b/src/x2sys/x2sys_list.c index 7bb5f53aea8..7ed1935050f 100644 --- a/src/x2sys/x2sys_list.c +++ b/src/x2sys/x2sys_list.c @@ -328,7 +328,7 @@ int GMT_x2sys_list (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_merge.c b/src/x2sys/x2sys_merge.c index 299cfd20d47..4c919e7796d 100644 --- a/src/x2sys/x2sys_merge.c +++ b/src/x2sys/x2sys_merge.c @@ -151,7 +151,7 @@ int GMT_x2sys_merge (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_put.c b/src/x2sys/x2sys_put.c index d1fdb72b8aa..127eb86f6dd 100644 --- a/src/x2sys/x2sys_put.c +++ b/src/x2sys/x2sys_put.c @@ -219,7 +219,7 @@ int GMT_x2sys_put (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_report.c b/src/x2sys/x2sys_report.c index 2e76f6c926c..cb23c91e760 100644 --- a/src/x2sys/x2sys_report.c +++ b/src/x2sys/x2sys_report.c @@ -257,7 +257,7 @@ int GMT_x2sys_report (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/x2sys/x2sys_solve.c b/src/x2sys/x2sys_solve.c index bc6b961d381..3a7ed07ff0c 100644 --- a/src/x2sys/x2sys_solve.c +++ b/src/x2sys/x2sys_solve.c @@ -328,7 +328,7 @@ int GMT_x2sys_solve (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, options)) != 0) Return (error); diff --git a/src/xyz2grd.c b/src/xyz2grd.c index 4428f5e33f8..4875c36fbac 100644 --- a/src/xyz2grd.c +++ b/src/xyz2grd.c @@ -339,7 +339,7 @@ int GMT_xyz2grd (void *V_API, int mode, void *args) { /* Parse the command-line arguments */ protect_J(API, options); /* If -J is used, add a -f0f,1f option to avoid later parsing errors due to -R & -J conflicts */ - if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ + if ((GMT = gmt_init_module (API, THIS_MODULE_LIB, THIS_MODULE_CLASSIC_NAME, THIS_MODULE_KEYS, THIS_MODULE_NEEDS, NULL, &options, &GMT_cpy)) == NULL) bailout (API->error); /* Save current state */ if (GMT_Parse_Common (API, THIS_MODULE_OPTIONS, options)) Return (API->error); Ctrl = New_Ctrl (GMT); /* Allocate and initialize a new control structure */ if ((error = parse (GMT, Ctrl, &io, options)) != 0) Return (error); diff --git a/test/modern/longbasemap.ps b/test/modern/longbasemap.ps new file mode 100644 index 00000000000..d2528eda640 Binary files /dev/null and b/test/modern/longbasemap.ps differ diff --git a/test/modern/longbasemap.sh b/test/modern/longbasemap.sh new file mode 100755 index 00000000000..31caa97e2f6 --- /dev/null +++ b/test/modern/longbasemap.sh @@ -0,0 +1,8 @@ + #!/bin/env bash + # Test the long-format version of -R -J -B and -U + gmt begin longbasemap ps + gmt subplot begin 2x1 -F6i/8.5i -M5p -A1+c+o0.2i + gmt basemap --region=0/40/0/50 --projection=X? --frame=WSne+fill=lightblue --axis=x:af+unit=k+angle=45 --axis=y:afg+prefix="$" --timestamp="Time stamp"+command -c1 + gmt basemap --region=0/70/-20/25 --projection=M? --frame=WSne+fill=lightgreen+oblique-pole=60/20 --axis=x:afg --axis=y:afg -c0 + gmt subplot end + gmt end show