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

Function PSL_comment

src/postscriptlight.c:6170–6192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6168}
6169
6170int PSL_comment (struct PSL_CTRL *C, const char *format, ...) {
6171 va_list args;
6172 if (!C->internal.comments) return (0);
6173 va_start (args, format);
6174 if (C->internal.memory) { /* Send comments to memory buffer */
6175 char tmp_buffer[PSL_BUFSIZ] = {""};
6176 size_t len = vsnprintf (tmp_buffer, PSL_BUFSIZ, format, args);
6177 psl_prepare_buffer (C, len + 6); /* The string plus the leading 4 and trailing 2 chars */
6178 strncat (&(C->internal.buffer[C->internal.n]), "%\n% ", 4U);
6179 C->internal.n += 4;
6180 strncat (&(C->internal.buffer[C->internal.n]), tmp_buffer, len);
6181 C->internal.n += len;
6182 strncat (&(C->internal.buffer[C->internal.n]), "%\n", 2U);
6183 C->internal.n += 2;
6184 }
6185 else { /* Write comments to stream */
6186 fprintf (C->internal.fp, "%%\n%% ");
6187 vfprintf (C->internal.fp, format, args);
6188 fprintf (C->internal.fp, "%%\n");
6189 }
6190 va_end (args);
6191 return (0);
6192}
6193
6194int PSL_initerr (struct PSL_CTRL *C, const char *format, ...) {
6195 va_list args;

Callers 15

gmtplot_map_latlineFunction · 0.85
gmtplot_map_lonlineFunction · 0.85
gmtplot_z_gridlinesFunction · 0.85
gmtplot_map_gridlinesFunction · 0.85
gmtplot_map_gridcrossFunction · 0.85
gmtplot_map_gridticksFunction · 0.85
gmtplot_map_tickmarksFunction · 0.85
gmtplot_map_annotateFunction · 0.85
gmtplot_map_boundaryFunction · 0.85
gmtplot_draw_mag_roseFunction · 0.85

Calls 1

psl_prepare_bufferFunction · 0.85

Tested by

no test coverage detected