Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export 4 gmt_conf_* (they were local). #8512

Merged
merged 4 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -6718,7 +6718,7 @@ GMT_LOCAL int gmtinit_get_language (struct GMT_CTRL *GMT) {
}

/*! . */
GMT_LOCAL void gmtinit_conf_classic_US (struct GMT_CTRL *GMT) {
EXTERN_MSC void gmtinit_conf_classic_US (struct GMT_CTRL *GMT) {
int i, case_val;
/* Update the settings to US where they differ from standard SI settings:
* Setting SI US
Expand Down Expand Up @@ -6759,7 +6759,7 @@ GMT_LOCAL void gmtinit_conf_classic_US (struct GMT_CTRL *GMT) {
}

/*! . */
GMT_LOCAL void gmtinit_conf_classic (struct GMT_CTRL *GMT) {
EXTERN_MSC void gmtinit_conf_classic (struct GMT_CTRL *GMT) {
int i, error = 0;
char path[PATH_MAX] = {""};
double const pt = 1.0/72.0; /* points to inch */
Expand Down Expand Up @@ -7274,13 +7274,13 @@ GMT_LOCAL void gmtinit_conf_modern_override (struct GMT_CTRL *GMT) {
GMT_Report (GMT->parent, GMT_MSG_ERROR, "Unrecognized value during gmtdefaults modern initialization.\n");}

/*! . */
GMT_LOCAL void gmtinit_conf_modern_US (struct GMT_CTRL *GMT) {
void gmtinit_conf_modern_US (struct GMT_CTRL *GMT) {
gmtinit_conf_classic_US (GMT); /* Override with US settings */
gmtinit_conf_modern_override (GMT);
}

/*! . */
GMT_LOCAL void gmtinit_conf_modern (struct GMT_CTRL *GMT) {
void gmtinit_conf_modern (struct GMT_CTRL *GMT) {
/* REPLACE WITH gmtinit_conf_modern when ready */
gmtinit_conf_classic (GMT);
gmtinit_conf_modern_override (GMT);
Expand Down Expand Up @@ -10930,6 +10930,14 @@ unsigned int gmtlib_setparameter (struct GMT_CTRL *GMT, const char *keyword, cha
case_val = gmt_hash_lookup (GMT, keyword, keys_hashnode, GMT_N_KEYS, GMT_N_KEYS);

switch (case_val) {
case GMTCASE_GMT_RUN_MODE: /* Allow changing to/from CLASSIC/MODERN mode */
if (strcmp(value, "0") && strcmp(value, "1")) {
error = true;
GMT_Report (GMT->parent, GMT_MSG_ERROR, "Unrecognized value %s for SET_RUN_MODE\n", value);
break;
}
GMT->current.setting.run_mode = atoi(value);
break;
/* FORMAT GROUP */
case GMTCASE_INPUT_CLOCK_FORMAT:
gmt_M_compat_translate ("FORMAT_CLOCK_IN");
Expand Down Expand Up @@ -12641,6 +12649,9 @@ char *gmtlib_getparameter (struct GMT_CTRL *GMT, const char *keyword) {
case_val = gmt_hash_lookup (GMT, keyword, keys_hashnode, GMT_N_KEYS, GMT_N_KEYS);

switch (case_val) {
case GMTCASE_GMT_RUN_MODE: /* Gat the current running mode CLASSIC or MODERN */
sprintf (value, "%d", GMT->current.setting.run_mode);
break;
/* FORMAT GROUP */
case GMTCASE_INPUT_CLOCK_FORMAT:
if (gmt_M_compat_check (GMT, 4)) /* GMT4: */
Expand Down
4 changes: 3 additions & 1 deletion src/gmt_keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ GMT_THEME # Group of GMT defaults to override
GMT_TRIANGULATE # Triangulation algorithm
GMT_VERBOSE # Verbosity level
#-------------------------------------------------------
GMT_RUN_MODE # To change between CLASSIC and MODERN mode. Used only by externals.
#-------------------------------------------------------
# IO Group: I/O settings
#-------------------------------------------------------
IO_COL_SEPARATOR # Column separator for output data records
Expand Down Expand Up @@ -175,4 +177,4 @@ TIME_REPORT # Controls time or elapsed run-time stamp in messages
TIME_UNIT # Unit of time measurement
TIME_SYSTEM # Shortcut to setting TIME_EPOCH/UNIT [does not go in gmt.conf]
TIME_WEEK_START # Day a new week starts on
TIME_Y2K_OFFSET_YEAR # For 2-digit years to separate 1900 and 2000 centuries
TIME_Y2K_OFFSET_YEAR # For 2-digit years to separate 1900 and 2000 centuries
4 changes: 4 additions & 0 deletions src/gmt_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ EXTERN_MSC int gmt_get_V (char arg);
EXTERN_MSC char gmt_set_V (int mode);
EXTERN_MSC void gmt_conf_SI (struct GMT_CTRL *GMT);
EXTERN_MSC void gmt_conf_US (struct GMT_CTRL *GMT);
EXTERN_MSC void gmtinit_conf_modern_US (struct GMT_CTRL *GMT);
EXTERN_MSC void gmtinit_conf_modern (struct GMT_CTRL *GMT);
EXTERN_MSC void gmtinit_conf_classic_US (struct GMT_CTRL *GMT);
EXTERN_MSC void gmtinit_conf_classic (struct GMT_CTRL *GMT);
EXTERN_MSC int gmt_truncate_file (struct GMTAPI_CTRL *API, char *file, size_t size);
EXTERN_MSC int gmt_set_current_panel (struct GMTAPI_CTRL *API, int fig, int row, int col, double gap[], char *label, unsigned int first);
EXTERN_MSC int gmt_get_current_figure (struct GMTAPI_CTRL *API);
Expand Down
Loading