| 4 | #include "gmt.h" |
| 5 | |
| 6 | int 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 | }; |
nothing calls this directly
no test coverage detected