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

Function gmtapi_begin_io

src/gmt_api.c:1883–1907  ·  view source on GitHub ↗

! . */

Source from the content-addressed store, hash-verified

1881
1882/*! . */
1883GMT_LOCAL int gmtapi_begin_io (struct GMTAPI_CTRL *API, unsigned int direction) {
1884 /* Initializes the i/o mechanism for either input or output (depends on direction).
1885 * gmtapi_begin_io must be called before any bulk data i/o is allowed.
1886 * direction: Either GMT_IN or GMT_OUT.
1887 * Returns: false if successful, true if error.
1888 */
1889
1890 struct GMT_CTRL *GMT = NULL;
1891 if (API == NULL) return_error (API, GMT_NOT_A_SESSION);
1892 if (!(direction == GMT_IN || direction == GMT_OUT)) return_error (API, GMT_NOT_A_VALID_DIRECTION);
1893 API->error = GMT_NOERROR;
1894 if (!API->registered[direction])
1895 GMT_Report (API, GMT_MSG_DEBUG, "gmtapi_begin_io: No %s resources registered\n", GMT_direction[direction]);
1896 /* Passed basic sanity checks */
1897 GMT = API->GMT;
1898 API->io_mode[direction] = GMTAPI_BY_SET;
1899 API->io_enabled[direction] = true; /* OK to access resources */
1900 GMT->current.io.ogr = GMT_OGR_UNKNOWN;
1901 GMT->current.io.variable_in_columns = false;
1902 GMT->current.io.need_previous = (GMT->common.g.active || GMT->current.io.skip_duplicates);
1903 GMT->current.io.segment_header[0] = GMT->current.io.curr_text[0] = 0;
1904 GMT_Report (API, GMT_MSG_DEBUG, "gmtapi_begin_io: %s resource access is now enabled [container]\n", GMT_direction[direction]);
1905
1906 return (GMT_NOERROR); /* No error encountered */
1907}
1908
1909/* Mapping of internal [row][col] indices to a single 1-D index.
1910 * Internally, row and col both starts at 0. These will be accessed

Callers 2

gmtapi_get_dataFunction · 0.85
gmtapi_put_dataFunction · 0.85

Calls 1

GMT_ReportFunction · 0.85

Tested by

no test coverage detected