/*-------------------------------------------------------------------- * $Id: gmt_init.c,v 1.6.4.3 2002/02/27 17:41:10 pwessel Exp $ * * Copyright (c) 1991-2002 by P. Wessel and W. H. F. Smith * See COPYING file for copying and redistribution conditions. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Contact info: gmt.soest.hawaii.edu *-------------------------------------------------------------------- * * gmt_init.c contains code which is used by all GMT programs * * Author: Paul Wessel * Date: 15-FEB-2000 * Version: 3.4.1 * * * The PUBLIC functions are: * * GMT_explain_option () : Prints explanations for the common options * GMT_get_common_args () : Interprets -B -H -J -K -O -P -R -U -V -X -Y -: -c * GMT_getdefaults () : Initializes the GMT global parameters * GMT_free_plot_array : Free plot memory * GMT_key_lookup () : Linear Key - id lookup function * GMT_savedefaults () : Writes the GMT global parameters to .gmtdefaults * GMT_hash_init () : Initializes a hash * GMT_hash_lookup () : Key - id lookup using hashing * GMT_hash () : Key - id lookup using hashing * GMT_begin () : Gets history and init parameters * GMT_end () : Cleans up and exits * GMT_get_history () : Read the .gmtcommand file * GMT_putpen : Encode pen argument into textstring * GMT_put_history () : Writes updates to the .gmtcommand file * GMT_map_getproject () : Scans the -Jstring to set projection * * The INTERNAL functions are: * * GMT_loaddefaults () : Reads the GMT global parameters from .gmtdefaults * GMT_map_getframe () : Scans the -Bstring to set tickinfo * GMT_setparameter () : Sets a default value given keyord,value-pair * GMT_setshorthand () : Reads and initializes the suffix shorthands * GMT_get_ellipse() : Returns ellipse id based on name * GMT_prepare_3D () : Initialize 3-D parameters */ #include "gmt.h" #include "gmt_init.h" #define USER_MEDIA_OFFSET 1000 int GMT_setparameter(char *keyword, char *value); int GMT_get_ellipse(char *name); int GMT_load_user_media (void); void GMT_set_home (void); BOOLEAN true_false_or_error (char *value, int *answer); void str_tolower (char *value); void GMT_get_history(int argc, char **argv); void GMT_prepare_3D(void); void GMT_free_plot_array(void); int GMT_map_getframe(char *args); char *GMT_putpen (struct GMT_PEN *pen); int GMT_check_region (double w, double e, double s, double n); char *GMT_getdefpath (int get); /* Local variables to gmt_init.c */ struct GMT_HASH hashnode[HASH_SIZE]; BOOLEAN GMT_x_abs = FALSE, GMT_y_abs = FALSE; BOOLEAN GMT_got_frame_rgb; FILE *GMT_fp_history; /* For .gmtcommands file */ /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void GMT_explain_option (char option) { /* The function print to stderr a short explanation for the option indicated by * the variable