* @brief Get the plot's output dimensions, in pixels. * * The read-side counterpart of `plot_set_size`. * * @param plot The plot. NULL is a no-op. * @param width If non-NULL, receives the width. * @param height If non-NULL, receives the height. */
| 2024 | in front, so the text continues an unquoted cell. */ |
| 2025 | static bool plot_csv_write_text(FILE* f, const char* text, bool prefix_done) { |
| 2026 | bool quote = strpbrk(text, ",\"\r\n") != NULL; |
| 2027 | if (!quote) { |
| 2028 | return fputs(text, f) >= 0; |
| 2029 | } |
| 2030 | if (prefix_done) { |
| 2031 | /* "x_" + a label that needs quoting: drop the characters that would |
| 2032 | need it rather than emit a half-quoted cell */ |
| 2033 | for (const char* p = text; *p; ++p) { |
| 2034 | if (!strchr(",\"\r\n", *p) && fputc(*p, f) == EOF) { |
| 2035 | return false; |
| 2036 | } |
| 2037 | } |
| 2038 | return true; |
| 2039 | } |
nothing calls this directly
no outgoing calls
no test coverage detected