Feature #810
Feature #805: Enable memory-output from PSL as alternative to file output
Add GMT_PS as a 6th GMT resource for PostScript output
Status: | Closed | Start date: | 2015-11-05 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | Candidate for next minor release | |||
Platform: |
Description
In orderfor developers to hold onto GMT PostScript output when using the API we must add a new GMT resource. It may be as simple as
struct GMT_PS { char *text; /* Buffer with all PostScript */ size_t n_alloc; /* Memory allocated so far */ size_n n; /* Position of where to write next (i.e., length of PS so far) */ };
Thus, to receive PS back to one's program in memory it follows the same scheme for any other output:
- Create an empty GMT_IS_PS resource for output
- Get its ID and create a special filename
@GMTAPI
@-###### - Use this filename as the destination for where PS is to be written
- Deal with the PS→text as you see fit, write it to file with GMT_Write_Data, etc.
- Remove with GMT_Destroy_Data (API, GMT_IS_PS, PS), etc.
History
#1
Updated by Paul over 5 years ago
- Status changed from New to Resolved
- Target version set to Candidate for next minor release
This has basically been implemented in the 5.3.0 branch. I added a test program testpsl.c to demonstrate how it would work. Documentation updated accordingly. In r15235.