! . */
| 10624 | |
| 10625 | /*! . */ |
| 10626 | struct 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 | /*! . */ |
| 10641 | void gmtlib_free_ps_ptr (struct GMT_CTRL *GMT, struct GMT_POSTSCRIPT *P) { |
no test coverage detected