MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / main

Function main

src/testapi_matrix_plot.c:6–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "gmt.h"
5
6int main () {
7 void *API = NULL; /* The API control structure */
8 struct GMT_MATRIX *M = NULL; /* Structure to hold input matrix */
9 char input[GMT_VF_LEN] = {""}; /* String to hold virtual input filename */
10 char args[128] = {""}; /* String to hold module command arguments */
11 /* Initialize the GMT session */
12 API = GMT_Create_Session ("test", 0U, GMT_SESSION_EXTERNAL, NULL);
13 M = GMT_Read_Data (API, GMT_IS_MATRIX, GMT_IS_FILE, GMT_IS_POINT, GMT_READ_NORMAL, NULL, "@matrix_grid.txt", NULL);
14 /* Associate our matrix with a virtual file */
15 GMT_Open_VirtualFile (API, GMT_IS_GRID|GMT_VIA_MATRIX, GMT_IS_SURFACE, GMT_IN|GMT_IS_REFERENCE, M, input);
16 /* Prepare the module arguments */
17 sprintf (args, "%s -JM6i -P -Baf -Ei -I+d", input);
18 /* Call the grdimage module */
19 GMT_Call_Module (API, "grdimage", GMT_MODULE_CMD, args);
20 /* Close the virtual file */
21 GMT_Close_VirtualFile (API, input);
22 /* Destroy session */
23 if (GMT_Destroy_Session (API)) return EXIT_FAILURE;
24};

Callers

nothing calls this directly

Calls 6

GMT_Create_SessionFunction · 0.85
GMT_Read_DataFunction · 0.85
GMT_Open_VirtualFileFunction · 0.85
GMT_Call_ModuleFunction · 0.85
GMT_Close_VirtualFileFunction · 0.85
GMT_Destroy_SessionFunction · 0.85

Tested by

no test coverage detected