view mrjunejune/latex_renderer.h @ 263:ee04e4e69fed

Add functional JRPG frame and tools Add full-screen background_2 apertures, functional frame chrome, card-driven details, dual-window tools, live conversion workflows, and bounded cleanup for generated downloads. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <mrjunejune@users.noreply.github.com>
date Thu, 06 Aug 2026 11:31:30 -0700
parents b8b6e726964a
children
line wrap: on
line source

#ifndef MRJUNEJUNE_LATEX_RENDERER_H
#define MRJUNEJUNE_LATEX_RENDERER_H

#include "dowa/dowa.h"

#define LATEX_SOURCE_MAX_BYTES (64 * 1024)
#define LATEX_PDF_MAX_BYTES (4 * 1024 * 1024)

typedef enum {
  LATEX_RENDER_OK = 0,
  LATEX_RENDER_INVALID_INPUT,
  LATEX_RENDER_COMPILE_ERROR,
  LATEX_RENDER_TIMEOUT,
  LATEX_RENDER_COMPILER_UNAVAILABLE,
  LATEX_RENDER_SANDBOX_ERROR,
  LATEX_RENDER_INTERNAL_ERROR,
} Latex_Render_Status;

typedef struct {
  Latex_Render_Status status;
  uint8 *pdf_data;
  size_t pdf_size;
  char *diagnostics;
} Latex_Render_Result;

Latex_Render_Result Latex_Render(const uint8 *source, size_t source_size);
void Latex_Render_Result_Destroy(Latex_Render_Result *result);

#endif