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

Function gmtlib_create_ps

src/gmt_plot.c:10626–10638  ·  view source on GitHub ↗

! . */

Source from the content-addressed store, hash-verified

10624
10625/*! . */
10626struct GMT_POSTSCRIPT * gmtlib_create_ps (struct GMT_CTRL *GMT, uint64_t length) {
10627 /* Makes an empty GMT_POSTSCRIPT struct - If length > 0 then we also allocate the string */
10628 struct GMT_POSTSCRIPT *P = gmt_get_postscript (GMT);
10629 struct GMT_POSTSCRIPT_HIDDEN *PH = gmt_get_P_hidden (P);
10630 PH->id = GMT->parent->unique_var_ID++; /* Give unique identifier */
10631 if (length) { /* Allocate a blank string */
10632 P->data = gmt_M_memory (GMT, NULL, length, char);
10633 PH->n_alloc = length; /* But P->n_bytes = 0 since nothing was placed there */
10634 PH->alloc_mode = GMT_ALLOC_INTERNALLY; /* Memory can be freed by GMT. */
10635 PH->alloc_level = GMT->hidden.func_level; /* Must be freed at this level. */
10636 }
10637 return (P);
10638}
10639
10640/*! . */
10641void gmtlib_free_ps_ptr (struct GMT_CTRL *GMT, struct GMT_POSTSCRIPT *P) {

Callers 2

gmtlib_duplicate_psFunction · 0.85
GMT_Create_DataFunction · 0.85

Calls 2

gmt_get_postscriptFunction · 0.85
gmt_get_P_hiddenFunction · 0.85

Tested by

no test coverage detected