| 7471 | |
| 7472 | /*! . */ |
| 7473 | GMT_LOCAL struct GMT_CTRL *gmtinit_new_GMT_ctrl (struct GMTAPI_CTRL *API, const char *session, unsigned int pad) { /* Allocate and initialize a new common control structure */ |
| 7474 | int i; |
| 7475 | char path[PATH_MAX+1]; |
| 7476 | char *unit_name[4] = {"cm", "inch", "m", "point"}; |
| 7477 | double u2u[4][4] = { /* Local initialization of unit conversion factors */ |
| 7478 | { 1.00, 1.0/2.54, 0.01, 72.0/2.54 }, |
| 7479 | { 2.54, 1.0, 0.0254, 72.0 }, |
| 7480 | { 100.00, 100.0/2.54, 1.0, 72.0/0.0254 }, |
| 7481 | { 2.54/72.0, 1.0/72.0, 0.0254/72.0, 1.0 } |
| 7482 | }; |
| 7483 | struct GMT_PROJ4 GMT_proj4[GMT_N_PROJ4] = { |
| 7484 | { "aea" , GMT_ALBERS }, |
| 7485 | { "aeqd" , GMT_AZ_EQDIST }, |
| 7486 | { "cyl_stere", GMT_CYL_STEREO }, |
| 7487 | { "cass" , GMT_CASSINI }, |
| 7488 | { "cea" , GMT_CYL_EQ }, |
| 7489 | { "eck4" , GMT_ECKERT4 }, |
| 7490 | { "eck6" , GMT_ECKERT6 }, |
| 7491 | { "eqc" , GMT_CYL_EQDIST }, |
| 7492 | { "eqdc" , GMT_ECONIC }, |
| 7493 | { "gnom" , GMT_GNOMONIC }, |
| 7494 | { "hammer" , GMT_HAMMER }, |
| 7495 | { "laea" , GMT_LAMB_AZ_EQ }, |
| 7496 | { "lcc" , GMT_LAMBERT }, |
| 7497 | { "merc" , GMT_MERCATOR }, |
| 7498 | { "mill" , GMT_MILLER }, |
| 7499 | { "moll" , GMT_MOLLWEIDE }, |
| 7500 | { "nsper" , GMT_GENPER }, |
| 7501 | { "omerc" , GMT_OBLIQUE_MERC }, |
| 7502 | { "omercp" , GMT_OBLIQUE_MERC_POLE }, |
| 7503 | { "ortho" , GMT_ORTHO }, |
| 7504 | { "polar" , GMT_POLAR }, |
| 7505 | { "poly" , GMT_POLYCONIC }, |
| 7506 | { "robin" , GMT_ROBINSON }, |
| 7507 | { "sinu" , GMT_SINUSOIDAL }, |
| 7508 | { "stere" , GMT_STEREO }, |
| 7509 | { "tmerc" , GMT_TM }, |
| 7510 | { "utm" , GMT_UTM }, |
| 7511 | { "vandg" , GMT_VANGRINTEN }, |
| 7512 | { "wintri" , GMT_WINKEL }, |
| 7513 | { "xy" , GMT_LINEAR }, |
| 7514 | { "z" , GMT_ZAXIS } |
| 7515 | }; |
| 7516 | struct GMT_CTRL *GMT = NULL; |
| 7517 | struct ELLIPSOID ref_ellipsoid[GMT_N_ELLIPSOIDS] = { /* This constant is created by CMake - do not edit */ |
| 7518 | #include "gmt_ellipsoids.h" /* This include file is created by CMake - do not edit */ |
| 7519 | }; |
| 7520 | struct DATUM datum[GMT_N_DATUMS] = { /* This constant is created by CMake - do not edit */ |
| 7521 | #include "gmt_datums.h" /* This include file is created by CMake - do not edit */ |
| 7522 | }; |
| 7523 | gmt_M_unused(session); |
| 7524 | |
| 7525 | GMT_Report (API, GMT_MSG_DEBUG, "Enter: gmtinit_new_GMT_ctrl\n"); |
| 7526 | /* Alloc using calloc since gmt_M_memory may use resources not yet initialized */ |
| 7527 | if ((GMT = calloc (1U, sizeof (struct GMT_CTRL))) == NULL) return NULL; |
| 7528 | gmt_M_memcpy (GMT->current.setting.ref_ellipsoid, ref_ellipsoid, 1, ref_ellipsoid); |
| 7529 | gmt_M_memcpy (GMT->current.setting.proj_datum, datum, 1, datum); |
| 7530 |
no test coverage detected