-int main(int argc, char** argv) {
- int exit_code = 0;
-
- char* svgpath;
- char* pngpath;
- int pngwidth = 1024, pngheight = 1024;
-
- float scale = 1.0;
- struct svgtiny_diagram *diagram;
- cairo_surface_t *surface;
- cairo_t *cr = 0;
- cairo_status_t cr_status;
-
+/*
+ * @brief Create a cairo context from a libsvgtiny diagram.
+ *
+ * @param diagram
+ * A pointer to a valid libsvgtiny diagram.
+ *
+ * @return If successful, a pointer to a @c cairo_t context structure
+ * is returned; if not, @c NULL is returned. You are expected to @c
+ * cairo_destroy the result if it is valid.
+ */
+cairo_t* cairo_context_from_diagram(diagram_t* diagram) {
+ cairo_t* cr;
+ cairo_surface_t* surface;
+ cairo_status_t crs;