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

Added by Paul over 1 year ago. Updated about 1 year ago.

Status:ClosedStart date:2015-11-05
Priority:NormalDue 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:

  1. Create an empty GMT_IS_PS resource for output
  2. Get its ID and create a special filename @GMTAPI@-######
  3. Use this filename as the destination for where PS is to be written
  4. Deal with the PS→text as you see fit, write it to file with GMT_Write_Data, etc.
  5. Remove with GMT_Destroy_Data (API, GMT_IS_PS, PS), etc.

History

#1 Updated by Paul over 1 year 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.

#2 Updated by Paul about 1 year ago

  • Status changed from Resolved to Closed

Closing this issue.

Also available in: Atom PDF