/*
This file was auto-generated by mupdfwrap.py.
*/


#include "mupdf/exceptions.h"
#include "mupdf/functions.h"
#include "mupdf/internal.h"


namespace mupdf
{

/* Wrapper for fz_aa_level(). */
int aa_level()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_aa_level(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_aa_level(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_abs(). */
float abs(float f)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_abs(): (long)f=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)f);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_abs(f);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_absi(). */
int absi(int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_absi(): (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)i);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_absi(i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_add_layout_char(). */
void add_layout_char(fz_layout_block *block, float x, float w, const char *p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_add_layout_char(): auto_ctx=%p block=%p (long)x=%li (long)w=%li p=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, block, (long)x, (long)w, p);
	}
	fz_try(auto_ctx) {
		::fz_add_layout_char(auto_ctx, block, x, w, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_add_layout_line(). */
void add_layout_line(fz_layout_block *block, float x, float y, float h, const char *p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_add_layout_line(): auto_ctx=%p block=%p (long)x=%li (long)y=%li (long)h=%li p=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, block, (long)x, (long)y, (long)h, p);
	}
	fz_try(auto_ctx) {
		::fz_add_layout_line(auto_ctx, block, x, y, h, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_add_separation(). */
void add_separation(fz_separations *sep, const char *name, fz_colorspace *cs, int cs_channel)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_add_separation(): auto_ctx=%p sep=%p name=%s cs=%p (long)cs_channel=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep, name, cs, (long)cs_channel);
	}
	fz_try(auto_ctx) {
		::fz_add_separation(auto_ctx, sep, name, cs, cs_channel);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_add_separation_equivalents(). */
void add_separation_equivalents(fz_separations *sep, uint32_t rgba, uint32_t cmyk, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_add_separation_equivalents(): auto_ctx=%p sep=%p (long)rgba=%li (long)cmyk=%li name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep, (long)rgba, (long)cmyk, name);
	}
	fz_try(auto_ctx) {
		::fz_add_separation_equivalents(auto_ctx, sep, rgba, cmyk, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_adjust_rect_for_stroke(). */
fz_rect adjust_rect_for_stroke(fz_rect rect, const fz_stroke_state *stroke, fz_matrix ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_adjust_rect_for_stroke(): auto_ctx=%p &rect=%p stroke=%p &ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &rect, stroke, &ctm);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_adjust_rect_for_stroke(auto_ctx, rect, stroke, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_advance_glyph(). */
float advance_glyph(fz_font *font, int glyph, int wmode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_advance_glyph(): auto_ctx=%p font=%p (long)glyph=%li (long)wmode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)glyph, (long)wmode);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_advance_glyph(auto_ctx, font, glyph, wmode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_aes_crypt_cbc(). */
void aes_crypt_cbc(fz_aes *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_aes_crypt_cbc(): ctx=%p (long)mode=%li (long)length=%li (long)iv=%li input=%p output=%p\n", __FILE__, __LINE__, __FUNCTION__, ctx, (long)mode, (long)length, (long)iv, input, output);
	}
	fz_try(auto_ctx) {
		::fz_aes_crypt_cbc(ctx, mode, length, iv, input, output);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_aes_setkey_dec(). */
int aes_setkey_dec(fz_aes *ctx, const unsigned char *key, int keysize)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_aes_setkey_dec(): ctx=%p key=%p (long)keysize=%li\n", __FILE__, __LINE__, __FUNCTION__, ctx, key, (long)keysize);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_aes_setkey_dec(ctx, key, keysize);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_aes_setkey_enc(). */
int aes_setkey_enc(fz_aes *ctx, const unsigned char *key, int keysize)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_aes_setkey_enc(): ctx=%p key=%p (long)keysize=%li\n", __FILE__, __LINE__, __FUNCTION__, ctx, key, (long)keysize);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_aes_setkey_enc(ctx, key, keysize);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_alpha_from_gray(). */
fz_pixmap *alpha_from_gray(fz_pixmap *gray)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_alpha_from_gray(): auto_ctx=%p gray=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, gray);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_alpha_from_gray(auto_ctx, gray);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_append_bits(). */
void append_bits(fz_buffer *buf, int value, int count)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_bits(): auto_ctx=%p buf=%p (long)value=%li (long)count=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)value, (long)count);
	}
	fz_try(auto_ctx) {
		::fz_append_bits(auto_ctx, buf, value, count);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_bits_pad(). */
void append_bits_pad(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_bits_pad(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_try(auto_ctx) {
		::fz_append_bits_pad(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_buffer(). */
void append_buffer(fz_buffer *destination, fz_buffer *source)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_buffer(): auto_ctx=%p destination=%p source=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, destination, source);
	}
	fz_try(auto_ctx) {
		::fz_append_buffer(auto_ctx, destination, source);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_byte(). */
void append_byte(fz_buffer *buf, int c)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_byte(): auto_ctx=%p buf=%p (long)c=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)c);
	}
	fz_try(auto_ctx) {
		::fz_append_byte(auto_ctx, buf, c);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_data(). */
void append_data(fz_buffer *buf, const void *data, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_data(): auto_ctx=%p buf=%p data=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, data, (long)len);
	}
	fz_try(auto_ctx) {
		::fz_append_data(auto_ctx, buf, data, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_int16_be(). */
void append_int16_be(fz_buffer *buf, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_int16_be(): auto_ctx=%p buf=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_append_int16_be(auto_ctx, buf, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_int16_le(). */
void append_int16_le(fz_buffer *buf, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_int16_le(): auto_ctx=%p buf=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_append_int16_le(auto_ctx, buf, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_int32_be(). */
void append_int32_be(fz_buffer *buf, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_int32_be(): auto_ctx=%p buf=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_append_int32_be(auto_ctx, buf, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_int32_le(). */
void append_int32_le(fz_buffer *buf, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_int32_le(): auto_ctx=%p buf=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_append_int32_le(auto_ctx, buf, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_pdf_string(). */
void append_pdf_string(fz_buffer *buffer, const char *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_pdf_string(): auto_ctx=%p buffer=%p text=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buffer, text);
	}
	fz_try(auto_ctx) {
		::fz_append_pdf_string(auto_ctx, buffer, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_rune(). */
void append_rune(fz_buffer *buf, int c)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_rune(): auto_ctx=%p buf=%p (long)c=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)c);
	}
	fz_try(auto_ctx) {
		::fz_append_rune(auto_ctx, buf, c);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_string(). */
void append_string(fz_buffer *buf, const char *data)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_string(): auto_ctx=%p buf=%p data=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, data);
	}
	fz_try(auto_ctx) {
		::fz_append_string(auto_ctx, buf, data);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_append_vprintf(). */
void append_vprintf(fz_buffer *buffer, const char *fmt, va_list args)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_append_vprintf(): auto_ctx=%p buffer=%p fmt=%s (long)args=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buffer, fmt, (long)args);
	}
	fz_try(auto_ctx) {
		::fz_append_vprintf(auto_ctx, buffer, fmt, args);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_arc4_encrypt(). */
void arc4_encrypt(fz_arc4 *state, unsigned char *dest, const unsigned char *src, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_arc4_encrypt(): state=%p dest=%p src=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, state, dest, src, (long)len);
	}
	fz_try(auto_ctx) {
		::fz_arc4_encrypt(state, dest, src, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_arc4_init(). */
void arc4_init(fz_arc4 *state, const unsigned char *key, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_arc4_init(): state=%p key=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, state, key, (long)len);
	}
	fz_try(auto_ctx) {
		::fz_arc4_init(state, key, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_archive_format(). */
const char *archive_format(fz_archive *arch)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_archive_format(): auto_ctx=%p arch=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arch);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_archive_format(auto_ctx, arch);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_atof(). */
float atof(const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_atof(): s=%s\n", __FILE__, __LINE__, __FUNCTION__, s);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_atof(s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_atoi(). */
int atoi(const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_atoi(): s=%s\n", __FILE__, __LINE__, __FUNCTION__, s);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_atoi(s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_atoi64(). */
int64_t atoi64(const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_atoi64(): s=%s\n", __FILE__, __LINE__, __FUNCTION__, s);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_atoi64(s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_authenticate_password(). */
int authenticate_password(fz_document *doc, const char *password)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_authenticate_password(): auto_ctx=%p doc=%p password=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, password);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_authenticate_password(auto_ctx, doc, password);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_available(). */
size_t available(fz_stream *stm, size_t max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_available(): auto_ctx=%p stm=%p (long)max=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, (long)max);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_available(auto_ctx, stm, max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_begin_group(). */
void begin_group(fz_device *dev, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_begin_group(): auto_ctx=%p dev=%p &area=%p cs=%p (long)isolated=%li (long)knockout=%li (long)blendmode=%li (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, &area, cs, (long)isolated, (long)knockout, (long)blendmode, (long)alpha);
	}
	fz_try(auto_ctx) {
		::fz_begin_group(auto_ctx, dev, area, cs, isolated, knockout, blendmode, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_begin_layer(). */
void begin_layer(fz_device *dev, const char *layer_name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_begin_layer(): auto_ctx=%p dev=%p layer_name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, layer_name);
	}
	fz_try(auto_ctx) {
		::fz_begin_layer(auto_ctx, dev, layer_name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_begin_mask(). */
void begin_mask(fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, const float *bc, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_begin_mask(): auto_ctx=%p dev=%p &area=%p (long)luminosity=%li colorspace=%p bc=%p &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, &area, (long)luminosity, colorspace, bc, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_begin_mask(auto_ctx, dev, area, luminosity, colorspace, bc, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_begin_page(). */
fz_device *begin_page(fz_document_writer *wri, fz_rect mediabox)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_begin_page(): auto_ctx=%p wri=%p &mediabox=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, wri, &mediabox);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_begin_page(auto_ctx, wri, mediabox);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_begin_tile(). */
void begin_tile(fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_begin_tile(): auto_ctx=%p dev=%p &area=%p &view=%p (long)xstep=%li (long)ystep=%li &ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, &area, &view, (long)xstep, (long)ystep, &ctm);
	}
	fz_try(auto_ctx) {
		::fz_begin_tile(auto_ctx, dev, area, view, xstep, ystep, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_begin_tile_id(). */
int begin_tile_id(fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm, int id)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_begin_tile_id(): auto_ctx=%p dev=%p &area=%p &view=%p (long)xstep=%li (long)ystep=%li &ctm=%p (long)id=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, &area, &view, (long)xstep, (long)ystep, &ctm, (long)id);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_begin_tile_id(auto_ctx, dev, area, view, xstep, ystep, ctm, id);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_bidi_fragment_text(). */
void bidi_fragment_text(const uint32_t *text, size_t textlen, fz_bidi_direction *baseDir, fz_bidi_fragment_fn *callback, void *arg, int flags)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bidi_fragment_text(): auto_ctx=%p text=%p (long)textlen=%li baseDir=%p callback=%p arg=%p (long)flags=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text, (long)textlen, baseDir, callback, arg, (long)flags);
	}
	fz_try(auto_ctx) {
		::fz_bidi_fragment_text(auto_ctx, text, textlen, baseDir, callback, arg, flags);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_bitmap_details(). */
void bitmap_details(fz_bitmap *bitmap, int *w, int *h, int *n, int *stride)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bitmap_details(): bitmap=%p w=%p h=%p n=%p stride=%p\n", __FILE__, __LINE__, __FUNCTION__, bitmap, w, h, n, stride);
	}
	fz_try(auto_ctx) {
		::fz_bitmap_details(bitmap, w, h, n, stride);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_blendmode_name(). */
const char *blendmode_name(int blendmode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_blendmode_name(): (long)blendmode=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)blendmode);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_blendmode_name(blendmode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_bound_display_list(). */
fz_rect bound_display_list(fz_display_list *list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bound_display_list(): auto_ctx=%p list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_bound_display_list(auto_ctx, list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_bound_glyph(). */
fz_rect bound_glyph(fz_font *font, int gid, fz_matrix trm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bound_glyph(): auto_ctx=%p font=%p (long)gid=%li &trm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)gid, &trm);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_bound_glyph(auto_ctx, font, gid, trm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_bound_page(). */
fz_rect bound_page(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bound_page(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_bound_page(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_bound_path(). */
fz_rect bound_path(const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bound_path(): auto_ctx=%p path=%p stroke=%p &ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, stroke, &ctm);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_bound_path(auto_ctx, path, stroke, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_bound_shade(). */
fz_rect bound_shade(fz_shade *shade, fz_matrix ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bound_shade(): auto_ctx=%p shade=%p &ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shade, &ctm);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_bound_shade(auto_ctx, shade, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_bound_text(). */
fz_rect bound_text(const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_bound_text(): auto_ctx=%p text=%p stroke=%p &ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text, stroke, &ctm);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_bound_text(auto_ctx, text, stroke, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_buffer_extract(). */
size_t buffer_extract(fz_buffer *buf, unsigned char **data)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_buffer_extract(): auto_ctx=%p buf=%p data=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, data);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_buffer_extract(auto_ctx, buf, data);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_buffer_storage(). */
size_t buffer_storage(fz_buffer *buf, unsigned char **datap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_buffer_storage(): auto_ctx=%p buf=%p datap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, datap);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_buffer_storage(auto_ctx, buf, datap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_calloc(). */
void *calloc(size_t count, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_calloc(): auto_ctx=%p (long)count=%li (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)count, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_calloc(auto_ctx, count, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_calloc_no_throw(). */
void *calloc_no_throw(size_t count, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_calloc_no_throw(): auto_ctx=%p (long)count=%li (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)count, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_calloc_no_throw(auto_ctx, count, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_caught(). */
int caught()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_caught(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_caught(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_caught_message(). */
const char *caught_message()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_caught_message(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_caught_message(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_chartorune(). */
int chartorune(int *rune, const char *str)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_chartorune(): rune=%p str=%s\n", __FILE__, __LINE__, __FUNCTION__, rune, str);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_chartorune(rune, str);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clamp(). */
float clamp(float f, float min, float max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clamp(): (long)f=%li (long)min=%li (long)max=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)f, (long)min, (long)max);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clamp(f, min, max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clamp_color(). */
void clamp_color(fz_colorspace *cs, const float *in, float *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clamp_color(): auto_ctx=%p cs=%p in=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs, in, out);
	}
	fz_try(auto_ctx) {
		::fz_clamp_color(auto_ctx, cs, in, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clamp_location(). */
fz_location clamp_location(fz_document *doc, fz_location loc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clamp_location(): auto_ctx=%p doc=%p &loc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &loc);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clamp_location(auto_ctx, doc, loc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clampd(). */
double clampd(double d, double min, double max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clampd(): (long)d=%li (long)min=%li (long)max=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)d, (long)min, (long)max);
	}
	double ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clampd(d, min, max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clampi(). */
int clampi(int i, int min, int max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clampi(): (long)i=%li (long)min=%li (long)max=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)i, (long)min, (long)max);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clampi(i, min, max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clampp(). */
void *clampp(void *p, void *min, void *max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clampp(): p=%p min=%p max=%p\n", __FILE__, __LINE__, __FUNCTION__, p, min, max);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clampp(p, min, max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_cleanname(). */
char *cleanname(char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_cleanname(): name=%s\n", __FILE__, __LINE__, __FUNCTION__, name);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_cleanname(name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clear_bitmap(). */
void clear_bitmap(fz_bitmap *bit)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clear_bitmap(): auto_ctx=%p bit=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, bit);
	}
	fz_try(auto_ctx) {
		::fz_clear_bitmap(auto_ctx, bit);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clear_buffer(). */
void clear_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clear_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_try(auto_ctx) {
		::fz_clear_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clear_pixmap(). */
void clear_pixmap(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clear_pixmap(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_try(auto_ctx) {
		::fz_clear_pixmap(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clear_pixmap_rect_with_value(). */
void clear_pixmap_rect_with_value(fz_pixmap *pix, int value, fz_irect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clear_pixmap_rect_with_value(): auto_ctx=%p pix=%p (long)value=%li &r=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, (long)value, &r);
	}
	fz_try(auto_ctx) {
		::fz_clear_pixmap_rect_with_value(auto_ctx, pix, value, r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clear_pixmap_with_value(). */
void clear_pixmap_with_value(fz_pixmap *pix, int value)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clear_pixmap_with_value(): auto_ctx=%p pix=%p (long)value=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, (long)value);
	}
	fz_try(auto_ctx) {
		::fz_clear_pixmap_with_value(auto_ctx, pix, value);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clip_image_mask(). */
void clip_image_mask(fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clip_image_mask(): auto_ctx=%p dev=%p image=%p &ctm=%p &scissor=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, image, &ctm, &scissor);
	}
	fz_try(auto_ctx) {
		::fz_clip_image_mask(auto_ctx, dev, image, ctm, scissor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clip_path(). */
void clip_path(fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_rect scissor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clip_path(): auto_ctx=%p dev=%p path=%p (long)even_odd=%li &ctm=%p &scissor=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, path, (long)even_odd, &ctm, &scissor);
	}
	fz_try(auto_ctx) {
		::fz_clip_path(auto_ctx, dev, path, even_odd, ctm, scissor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clip_stroke_path(). */
void clip_stroke_path(fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clip_stroke_path(): auto_ctx=%p dev=%p path=%p stroke=%p &ctm=%p &scissor=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, path, stroke, &ctm, &scissor);
	}
	fz_try(auto_ctx) {
		::fz_clip_stroke_path(auto_ctx, dev, path, stroke, ctm, scissor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clip_stroke_text(). */
void clip_stroke_text(fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_rect scissor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clip_stroke_text(): auto_ctx=%p dev=%p text=%p stroke=%p &ctm=%p &scissor=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, text, stroke, &ctm, &scissor);
	}
	fz_try(auto_ctx) {
		::fz_clip_stroke_text(auto_ctx, dev, text, stroke, ctm, scissor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clip_text(). */
void clip_text(fz_device *dev, const fz_text *text, fz_matrix ctm, fz_rect scissor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clip_text(): auto_ctx=%p dev=%p text=%p &ctm=%p &scissor=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, text, &ctm, &scissor);
	}
	fz_try(auto_ctx) {
		::fz_clip_text(auto_ctx, dev, text, ctm, scissor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_clone_context(). */
fz_context *clone_context()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clone_context(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_context * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clone_context(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clone_default_colorspaces(). */
fz_default_colorspaces *clone_default_colorspaces(fz_default_colorspaces *base)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clone_default_colorspaces(): auto_ctx=%p base=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, base);
	}
	fz_default_colorspaces * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clone_default_colorspaces(auto_ctx, base);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clone_path(). */
fz_path *clone_path(fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clone_path(): auto_ctx=%p path=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_path * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clone_path(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clone_pixmap(). */
fz_pixmap *clone_pixmap(fz_pixmap *old)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clone_pixmap(): auto_ctx=%p old=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, old);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clone_pixmap(auto_ctx, old);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clone_separations_for_overprint(). */
fz_separations *clone_separations_for_overprint(fz_separations *seps)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clone_separations_for_overprint(): auto_ctx=%p seps=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, seps);
	}
	fz_separations * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clone_separations_for_overprint(auto_ctx, seps);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_clone_stroke_state(). */
fz_stroke_state *clone_stroke_state(fz_stroke_state *stroke)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_clone_stroke_state(): auto_ctx=%p stroke=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stroke);
	}
	fz_stroke_state * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_clone_stroke_state(auto_ctx, stroke);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_close_device(). */
void close_device(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_close_device(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_try(auto_ctx) {
		::fz_close_device(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_close_document_writer(). */
void close_document_writer(fz_document_writer *wri)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_close_document_writer(): auto_ctx=%p wri=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, wri);
	}
	fz_try(auto_ctx) {
		::fz_close_document_writer(auto_ctx, wri);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_close_output(). */
void close_output(fz_output *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_close_output(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_try(auto_ctx) {
		::fz_close_output(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_close_zip_writer(). */
void close_zip_writer(fz_zip_writer *zip)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_close_zip_writer(): auto_ctx=%p zip=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, zip);
	}
	fz_try(auto_ctx) {
		::fz_close_zip_writer(auto_ctx, zip);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_closepath(). */
void closepath(fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_closepath(): auto_ctx=%p path=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_try(auto_ctx) {
		::fz_closepath(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_colorspace_colorant(). */
const char *colorspace_colorant(fz_colorspace *cs, int n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_colorant(): auto_ctx=%p cs=%p (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs, (long)n);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_colorant(auto_ctx, cs, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_device_n_has_cmyk(). */
int colorspace_device_n_has_cmyk(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_device_n_has_cmyk(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_device_n_has_cmyk(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_device_n_has_only_cmyk(). */
int colorspace_device_n_has_only_cmyk(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_device_n_has_only_cmyk(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_device_n_has_only_cmyk(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_cmyk(). */
int colorspace_is_cmyk(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_cmyk(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_cmyk(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_device(). */
int colorspace_is_device(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_device(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_device(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_device_cmyk(). */
int colorspace_is_device_cmyk(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_device_cmyk(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_device_cmyk(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_device_gray(). */
int colorspace_is_device_gray(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_device_gray(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_device_gray(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_device_n(). */
int colorspace_is_device_n(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_device_n(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_device_n(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_gray(). */
int colorspace_is_gray(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_gray(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_gray(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_indexed(). */
int colorspace_is_indexed(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_indexed(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_indexed(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_lab(). */
int colorspace_is_lab(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_lab(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_lab(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_lab_icc(). */
int colorspace_is_lab_icc(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_lab_icc(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_lab_icc(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_rgb(). */
int colorspace_is_rgb(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_rgb(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_rgb(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_is_subtractive(). */
int colorspace_is_subtractive(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_is_subtractive(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_is_subtractive(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_n(). */
int colorspace_n(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_n(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_n(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_name(). */
const char *colorspace_name(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_name(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_name(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_colorspace_name_colorant(). */
void colorspace_name_colorant(fz_colorspace *cs, int n, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_name_colorant(): auto_ctx=%p cs=%p (long)n=%li name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs, (long)n, name);
	}
	fz_try(auto_ctx) {
		::fz_colorspace_name_colorant(auto_ctx, cs, n, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_colorspace_type(). */
enum fz_colorspace_type colorspace_type(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_colorspace_type(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	enum fz_colorspace_type ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_colorspace_type(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_compress_ccitt_fax_g3(). */
fz_buffer *compress_ccitt_fax_g3(const unsigned char *data, int columns, int rows)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_compress_ccitt_fax_g3(): auto_ctx=%p data=%p (long)columns=%li (long)rows=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)columns, (long)rows);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_compress_ccitt_fax_g3(auto_ctx, data, columns, rows);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_compress_ccitt_fax_g4(). */
fz_buffer *compress_ccitt_fax_g4(const unsigned char *data, int columns, int rows)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_compress_ccitt_fax_g4(): auto_ctx=%p data=%p (long)columns=%li (long)rows=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)columns, (long)rows);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_compress_ccitt_fax_g4(auto_ctx, data, columns, rows);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_compressed_buffer_size(). */
size_t compressed_buffer_size(fz_compressed_buffer *buffer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_compressed_buffer_size(): buffer=%p\n", __FILE__, __LINE__, __FUNCTION__, buffer);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_compressed_buffer_size(buffer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_compressed_image_buffer(). */
fz_compressed_buffer *compressed_image_buffer(fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_compressed_image_buffer(): auto_ctx=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image);
	}
	fz_compressed_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_compressed_image_buffer(auto_ctx, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_concat(). */
fz_matrix concat(fz_matrix left, fz_matrix right)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_concat(): &left=%p &right=%p\n", __FILE__, __LINE__, __FUNCTION__, &left, &right);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_concat(left, right);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_concat_push_drop(). */
void concat_push_drop(fz_stream *concat, fz_stream *chain)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_concat_push_drop(): auto_ctx=%p concat=%p chain=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, concat, chain);
	}
	fz_try(auto_ctx) {
		::fz_concat_push_drop(auto_ctx, concat, chain);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_contains_rect(). */
int contains_rect(fz_rect a, fz_rect b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_contains_rect(): &a=%p &b=%p\n", __FILE__, __LINE__, __FUNCTION__, &a, &b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_contains_rect(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_convert_color(). */
void convert_color(fz_colorspace *ss, const float *sv, fz_colorspace *ds, float *dv, fz_colorspace *is, fz_color_params params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_convert_color(): auto_ctx=%p ss=%p sv=%p ds=%p dv=%p is=%p ¶ms=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ss, sv, ds, dv, is, ¶ms);
	}
	fz_try(auto_ctx) {
		::fz_convert_color(auto_ctx, ss, sv, ds, dv, is, params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_convert_indexed_pixmap_to_base(). */
fz_pixmap *convert_indexed_pixmap_to_base(const fz_pixmap *src)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_convert_indexed_pixmap_to_base(): auto_ctx=%p src=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, src);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_convert_indexed_pixmap_to_base(auto_ctx, src);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_convert_pixmap(). */
fz_pixmap *convert_pixmap(fz_pixmap *pix, fz_colorspace *cs_des, fz_colorspace *prf, fz_default_colorspaces *default_cs, fz_color_params color_params, int keep_alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_convert_pixmap(): auto_ctx=%p pix=%p cs_des=%p prf=%p default_cs=%p &color_params=%p (long)keep_alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, cs_des, prf, default_cs, &color_params, (long)keep_alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_convert_pixmap(auto_ctx, pix, cs_des, prf, default_cs, color_params, keep_alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_convert_separation_colors(). */
void convert_separation_colors(fz_colorspace *src_cs, const float *src_color, fz_separations *dst_seps, fz_colorspace *dst_cs, float *dst_color, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_convert_separation_colors(): auto_ctx=%p src_cs=%p src_color=%p dst_seps=%p dst_cs=%p dst_color=%p &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, src_cs, src_color, dst_seps, dst_cs, dst_color, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_convert_separation_colors(auto_ctx, src_cs, src_color, dst_seps, dst_cs, dst_color, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_convert_separation_pixmap_to_base(). */
fz_pixmap *convert_separation_pixmap_to_base(const fz_pixmap *src)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_convert_separation_pixmap_to_base(): auto_ctx=%p src=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, src);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_convert_separation_pixmap_to_base(auto_ctx, src);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_copy_option(). */
size_t copy_option(const char *val, char *dest, size_t maxlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_copy_option(): auto_ctx=%p val=%s dest=%s (long)maxlen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, val, dest, (long)maxlen);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_copy_option(auto_ctx, val, dest, maxlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_copy_rectangle(). */
char *copy_rectangle(fz_stext_page *page, fz_rect area, int crlf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_copy_rectangle(): auto_ctx=%p page=%p &area=%p (long)crlf=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, &area, (long)crlf);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_copy_rectangle(auto_ctx, page, area, crlf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_copy_selection(). */
char *copy_selection(fz_stext_page *page, fz_point a, fz_point b, int crlf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_copy_selection(): auto_ctx=%p page=%p &a=%p &b=%p (long)crlf=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, &a, &b, (long)crlf);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_copy_selection(auto_ctx, page, a, b, crlf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_count_active_separations(). */
int count_active_separations(const fz_separations *seps)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_count_active_separations(): auto_ctx=%p seps=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, seps);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_count_active_separations(auto_ctx, seps);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_count_archive_entries(). */
int count_archive_entries(fz_archive *arch)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_count_archive_entries(): auto_ctx=%p arch=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arch);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_count_archive_entries(auto_ctx, arch);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_count_chapter_pages(). */
int count_chapter_pages(fz_document *doc, int chapter)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_count_chapter_pages(): auto_ctx=%p doc=%p (long)chapter=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)chapter);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_count_chapter_pages(auto_ctx, doc, chapter);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_count_chapters(). */
int count_chapters(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_count_chapters(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_count_chapters(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_count_pages(). */
int count_pages(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_count_pages(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_count_pages(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_count_separations(). */
int count_separations(const fz_separations *sep)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_count_separations(): auto_ctx=%p sep=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_count_separations(auto_ctx, sep);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_currentpoint(). */
fz_point currentpoint(fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_currentpoint(): auto_ctx=%p path=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_currentpoint(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_curveto(). */
void curveto(fz_path *path, float x0, float y0, float x1, float y1, float x2, float y2)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_curveto(): auto_ctx=%p path=%p (long)x0=%li (long)y0=%li (long)x1=%li (long)y1=%li (long)x2=%li (long)y2=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)x0, (long)y0, (long)x1, (long)y1, (long)x2, (long)y2);
	}
	fz_try(auto_ctx) {
		::fz_curveto(auto_ctx, path, x0, y0, x1, y1, x2, y2);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_curvetov(). */
void curvetov(fz_path *path, float x1, float y1, float x2, float y2)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_curvetov(): auto_ctx=%p path=%p (long)x1=%li (long)y1=%li (long)x2=%li (long)y2=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)x1, (long)y1, (long)x2, (long)y2);
	}
	fz_try(auto_ctx) {
		::fz_curvetov(auto_ctx, path, x1, y1, x2, y2);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_curvetoy(). */
void curvetoy(fz_path *path, float x0, float y0, float x2, float y2)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_curvetoy(): auto_ctx=%p path=%p (long)x0=%li (long)y0=%li (long)x2=%li (long)y2=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)x0, (long)y0, (long)x2, (long)y2);
	}
	fz_try(auto_ctx) {
		::fz_curvetoy(auto_ctx, path, x0, y0, x2, y2);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_debug_store(). */
void debug_store(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_debug_store(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_debug_store(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_debug_xml(). */
void debug_xml(fz_xml *item, int level)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_debug_xml(): item=%p (long)level=%li\n", __FILE__, __LINE__, __FUNCTION__, item, (long)level);
	}
	fz_try(auto_ctx) {
		::fz_debug_xml(item, level);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_decode_tile(). */
void decode_tile(fz_pixmap *pix, const float *decode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_decode_tile(): auto_ctx=%p pix=%p decode=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, decode);
	}
	fz_try(auto_ctx) {
		::fz_decode_tile(auto_ctx, pix, decode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_decomp_image_from_stream(). */
fz_pixmap *decomp_image_from_stream(fz_stream *stm, fz_compressed_image *image, fz_irect *subarea, int indexed, int l2factor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_decomp_image_from_stream(): auto_ctx=%p stm=%p image=%p subarea=%p (long)indexed=%li (long)l2factor=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, image, subarea, (long)indexed, (long)l2factor);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_decomp_image_from_stream(auto_ctx, stm, image, subarea, indexed, l2factor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_decouple_type3_font(). */
void decouple_type3_font(fz_font *font, void *t3doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_decouple_type3_font(): auto_ctx=%p font=%p t3doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, t3doc);
	}
	fz_try(auto_ctx) {
		::fz_decouple_type3_font(auto_ctx, font, t3doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_default_cmyk(). */
fz_colorspace *default_cmyk(const fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_default_cmyk(): auto_ctx=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_default_cmyk(auto_ctx, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_default_error_callback(). */
void default_error_callback(void *user, const char *message)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_default_error_callback(): user=%p message=%s\n", __FILE__, __LINE__, __FUNCTION__, user, message);
	}
	fz_try(auto_ctx) {
		::fz_default_error_callback(user, message);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_default_gray(). */
fz_colorspace *default_gray(const fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_default_gray(): auto_ctx=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_default_gray(auto_ctx, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_default_halftone(). */
fz_halftone *default_halftone(int num_comps)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_default_halftone(): auto_ctx=%p (long)num_comps=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)num_comps);
	}
	fz_halftone * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_default_halftone(auto_ctx, num_comps);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_default_output_intent(). */
fz_colorspace *default_output_intent(const fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_default_output_intent(): auto_ctx=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_default_output_intent(auto_ctx, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_default_rgb(). */
fz_colorspace *default_rgb(const fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_default_rgb(): auto_ctx=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_default_rgb(auto_ctx, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_default_warning_callback(). */
void default_warning_callback(void *user, const char *message)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_default_warning_callback(): user=%p message=%s\n", __FILE__, __LINE__, __FUNCTION__, user, message);
	}
	fz_try(auto_ctx) {
		::fz_default_warning_callback(user, message);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_defer_reap_end(). */
void defer_reap_end()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_defer_reap_end(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_defer_reap_end(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_defer_reap_start(). */
void defer_reap_start()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_defer_reap_start(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_defer_reap_start(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_deflate(). */
void deflate(unsigned char *dest, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_deflate_level level)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_deflate(): auto_ctx=%p dest=%p compressed_length=%p source=%p (long)source_length=%li (long)level=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dest, compressed_length, source, (long)source_length, (long)level);
	}
	fz_try(auto_ctx) {
		::fz_deflate(auto_ctx, dest, compressed_length, source, source_length, level);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_deflate_bound(). */
size_t deflate_bound(size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_deflate_bound(): auto_ctx=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_deflate_bound(auto_ctx, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_detach_xml(). */
void detach_xml(fz_xml_doc *xml, fz_xml *node)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_detach_xml(): auto_ctx=%p xml=%p node=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xml, node);
	}
	fz_try(auto_ctx) {
		::fz_detach_xml(auto_ctx, xml, node);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_device_bgr(). */
fz_colorspace *device_bgr()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_device_bgr(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_device_bgr(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_device_cmyk(). */
fz_colorspace *device_cmyk()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_device_cmyk(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_device_cmyk(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_device_current_scissor(). */
fz_rect device_current_scissor(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_device_current_scissor(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_device_current_scissor(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_device_gray(). */
fz_colorspace *device_gray()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_device_gray(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_device_gray(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_device_lab(). */
fz_colorspace *device_lab()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_device_lab(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_device_lab(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_device_rgb(). */
fz_colorspace *device_rgb()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_device_rgb(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_device_rgb(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_dirname(). */
void dirname(char *dir, const char *path, size_t dirsize)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_dirname(): dir=%s path=%s (long)dirsize=%li\n", __FILE__, __LINE__, __FUNCTION__, dir, path, (long)dirsize);
	}
	fz_try(auto_ctx) {
		::fz_dirname(dir, path, dirsize);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_disable_device_hints(). */
void disable_device_hints(fz_device *dev, int hints)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_disable_device_hints(): auto_ctx=%p dev=%p (long)hints=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, (long)hints);
	}
	fz_try(auto_ctx) {
		::fz_disable_device_hints(auto_ctx, dev, hints);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_disable_icc(). */
void disable_icc()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_disable_icc(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_disable_icc(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_display_list_is_empty(). */
int display_list_is_empty(const fz_display_list *list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_display_list_is_empty(): auto_ctx=%p list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_display_list_is_empty(auto_ctx, list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_div255(). */
int div255(int c, int a)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_div255(): (long)c=%li (long)a=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)c, (long)a);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_div255(c, a);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_do_always(). */
int do_always()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_do_always(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_do_always(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_do_catch(). */
int do_catch()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_do_catch(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_do_catch(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_do_try(). */
int do_try()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_do_try(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_do_try(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_document_output_intent(). */
fz_colorspace *document_output_intent(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_document_output_intent(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_document_output_intent(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_document_supports_accelerator(). */
int document_supports_accelerator(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_document_supports_accelerator(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_document_supports_accelerator(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_drop_archive(). */
void drop_archive(fz_archive *arch)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_archive(): auto_ctx=%p arch=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arch);
	}
	fz_try(auto_ctx) {
		::fz_drop_archive(auto_ctx, arch);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_band_writer(). */
void drop_band_writer(fz_band_writer *writer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_band_writer(): auto_ctx=%p writer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, writer);
	}
	fz_try(auto_ctx) {
		::fz_drop_band_writer(auto_ctx, writer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_bitmap(). */
void drop_bitmap(fz_bitmap *bit)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_bitmap(): auto_ctx=%p bit=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, bit);
	}
	fz_try(auto_ctx) {
		::fz_drop_bitmap(auto_ctx, bit);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_buffer(). */
void drop_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_try(auto_ctx) {
		::fz_drop_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_colorspace(). */
void drop_colorspace(fz_colorspace *colorspace)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_colorspace(): auto_ctx=%p colorspace=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, colorspace);
	}
	fz_try(auto_ctx) {
		::fz_drop_colorspace(auto_ctx, colorspace);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_colorspace_imp(). */
void drop_colorspace_imp(fz_storable *cs_)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_colorspace_imp(): auto_ctx=%p cs_=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs_);
	}
	fz_try(auto_ctx) {
		::fz_drop_colorspace_imp(auto_ctx, cs_);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_compressed_buffer(). */
void drop_compressed_buffer(fz_compressed_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_compressed_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_try(auto_ctx) {
		::fz_drop_compressed_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_context(). */
void drop_context()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_context(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_drop_context(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_default_colorspaces(). */
void drop_default_colorspaces(fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_default_colorspaces(): auto_ctx=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs);
	}
	fz_try(auto_ctx) {
		::fz_drop_default_colorspaces(auto_ctx, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_device(). */
void drop_device(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_device(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_try(auto_ctx) {
		::fz_drop_device(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_display_list(). */
void drop_display_list(fz_display_list *list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_display_list(): auto_ctx=%p list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list);
	}
	fz_try(auto_ctx) {
		::fz_drop_display_list(auto_ctx, list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_document(). */
void drop_document(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_document(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::fz_drop_document(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_document_writer(). */
void drop_document_writer(fz_document_writer *wri)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_document_writer(): auto_ctx=%p wri=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, wri);
	}
	fz_try(auto_ctx) {
		::fz_drop_document_writer(auto_ctx, wri);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_font(). */
void drop_font(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_font(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_try(auto_ctx) {
		::fz_drop_font(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_glyph(). */
void drop_glyph(fz_glyph *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_glyph(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_try(auto_ctx) {
		::fz_drop_glyph(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_halftone(). */
void drop_halftone(fz_halftone *ht)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_halftone(): auto_ctx=%p ht=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ht);
	}
	fz_try(auto_ctx) {
		::fz_drop_halftone(auto_ctx, ht);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_hash_table(). */
void drop_hash_table(fz_hash_table *table)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_hash_table(): auto_ctx=%p table=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, table);
	}
	fz_try(auto_ctx) {
		::fz_drop_hash_table(auto_ctx, table);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_image(). */
void drop_image(fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_image(): auto_ctx=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image);
	}
	fz_try(auto_ctx) {
		::fz_drop_image(auto_ctx, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_image_base(). */
void drop_image_base(fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_image_base(): auto_ctx=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image);
	}
	fz_try(auto_ctx) {
		::fz_drop_image_base(auto_ctx, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_image_imp(). */
void drop_image_imp(fz_storable *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_image_imp(): auto_ctx=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image);
	}
	fz_try(auto_ctx) {
		::fz_drop_image_imp(auto_ctx, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_image_store_key(). */
void drop_image_store_key(fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_image_store_key(): auto_ctx=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image);
	}
	fz_try(auto_ctx) {
		::fz_drop_image_store_key(auto_ctx, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_imp(). */
int drop_imp(void *p, int *refs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_imp(): auto_ctx=%p p=%p refs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, refs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_drop_imp(auto_ctx, p, refs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_drop_imp16(). */
int drop_imp16(void *p, int16_t *refs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_imp16(): auto_ctx=%p p=%p refs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, refs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_drop_imp16(auto_ctx, p, refs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_drop_imp8(). */
int drop_imp8(void *p, int8_t *refs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_imp8(): auto_ctx=%p p=%p refs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, refs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_drop_imp8(auto_ctx, p, refs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_drop_jbig2_globals(). */
void drop_jbig2_globals(fz_jbig2_globals *globals)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_jbig2_globals(): auto_ctx=%p globals=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, globals);
	}
	fz_try(auto_ctx) {
		::fz_drop_jbig2_globals(auto_ctx, globals);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_jbig2_globals_imp(). */
void drop_jbig2_globals_imp(fz_storable *globals)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_jbig2_globals_imp(): auto_ctx=%p globals=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, globals);
	}
	fz_try(auto_ctx) {
		::fz_drop_jbig2_globals_imp(auto_ctx, globals);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_key_storable(). */
void drop_key_storable(const fz_key_storable *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_key_storable(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_try(auto_ctx) {
		::fz_drop_key_storable(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_key_storable_key(). */
void drop_key_storable_key(const fz_key_storable *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_key_storable_key(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_try(auto_ctx) {
		::fz_drop_key_storable_key(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_layout(). */
void drop_layout(fz_layout_block *block)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_layout(): auto_ctx=%p block=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, block);
	}
	fz_try(auto_ctx) {
		::fz_drop_layout(auto_ctx, block);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_link(). */
void drop_link(fz_link *link)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_link(): auto_ctx=%p link=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, link);
	}
	fz_try(auto_ctx) {
		::fz_drop_link(auto_ctx, link);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_outline(). */
void drop_outline(fz_outline *outline)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_outline(): auto_ctx=%p outline=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, outline);
	}
	fz_try(auto_ctx) {
		::fz_drop_outline(auto_ctx, outline);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_output(). */
void drop_output(fz_output *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_output(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_try(auto_ctx) {
		::fz_drop_output(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_page(). */
void drop_page(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_page(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_try(auto_ctx) {
		::fz_drop_page(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_path(). */
void drop_path(const fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_path(): auto_ctx=%p path=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_try(auto_ctx) {
		::fz_drop_path(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_pixmap(). */
void drop_pixmap(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_pixmap(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_try(auto_ctx) {
		::fz_drop_pixmap(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_pool(). */
void drop_pool(fz_pool *pool)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_pool(): auto_ctx=%p pool=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pool);
	}
	fz_try(auto_ctx) {
		::fz_drop_pool(auto_ctx, pool);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_separations(). */
void drop_separations(fz_separations *sep)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_separations(): auto_ctx=%p sep=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep);
	}
	fz_try(auto_ctx) {
		::fz_drop_separations(auto_ctx, sep);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_shade(). */
void drop_shade(fz_shade *shade)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_shade(): auto_ctx=%p shade=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shade);
	}
	fz_try(auto_ctx) {
		::fz_drop_shade(auto_ctx, shade);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_shade_imp(). */
void drop_shade_imp(fz_storable *shade)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_shade_imp(): auto_ctx=%p shade=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shade);
	}
	fz_try(auto_ctx) {
		::fz_drop_shade_imp(auto_ctx, shade);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_stext_page(). */
void drop_stext_page(fz_stext_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_stext_page(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_try(auto_ctx) {
		::fz_drop_stext_page(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_storable(). */
void drop_storable(const fz_storable *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_storable(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_try(auto_ctx) {
		::fz_drop_storable(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_store_context(). */
void drop_store_context()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_store_context(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_drop_store_context(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_stream(). */
void drop_stream(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_stream(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	fz_try(auto_ctx) {
		::fz_drop_stream(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_stroke_state(). */
void drop_stroke_state(const fz_stroke_state *stroke)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_stroke_state(): auto_ctx=%p stroke=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stroke);
	}
	fz_try(auto_ctx) {
		::fz_drop_stroke_state(auto_ctx, stroke);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_text(). */
void drop_text(const fz_text *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_text(): auto_ctx=%p text=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text);
	}
	fz_try(auto_ctx) {
		::fz_drop_text(auto_ctx, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_tree(). */
void drop_tree(fz_tree *node, void (*dropfunc)(fz_context *, void *))
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_tree(): auto_ctx=%p node=%p dropfunc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, node, dropfunc);
	}
	fz_try(auto_ctx) {
		::fz_drop_tree(auto_ctx, node, dropfunc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_xml(). */
void drop_xml(fz_xml_doc *xml)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_xml(): auto_ctx=%p xml=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xml);
	}
	fz_try(auto_ctx) {
		::fz_drop_xml(auto_ctx, xml);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_drop_zip_writer(). */
void drop_zip_writer(fz_zip_writer *zip)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_drop_zip_writer(): auto_ctx=%p zip=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, zip);
	}
	fz_try(auto_ctx) {
		::fz_drop_zip_writer(auto_ctx, zip);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_dump_glyph_cache_stats(). */
void dump_glyph_cache_stats(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_dump_glyph_cache_stats(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_dump_glyph_cache_stats(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_duplicate_glyph_names_from_unicode(). */
const char **duplicate_glyph_names_from_unicode(int unicode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_duplicate_glyph_names_from_unicode(): (long)unicode=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)unicode);
	}
	const char ** ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_duplicate_glyph_names_from_unicode(unicode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_empty_store(). */
void empty_store()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_empty_store(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_empty_store(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_enable_device_hints(). */
void enable_device_hints(fz_device *dev, int hints)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_enable_device_hints(): auto_ctx=%p dev=%p (long)hints=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, (long)hints);
	}
	fz_try(auto_ctx) {
		::fz_enable_device_hints(auto_ctx, dev, hints);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_enable_icc(). */
void enable_icc()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_enable_icc(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_enable_icc(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_encode_character(). */
int encode_character(fz_font *font, int unicode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_encode_character(): auto_ctx=%p font=%p (long)unicode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)unicode);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_encode_character(auto_ctx, font, unicode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_encode_character_by_glyph_name(). */
int encode_character_by_glyph_name(fz_font *font, const char *glyphname)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_encode_character_by_glyph_name(): auto_ctx=%p font=%p glyphname=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, glyphname);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_encode_character_by_glyph_name(auto_ctx, font, glyphname);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_encode_character_sc(). */
int encode_character_sc(fz_font *font, int unicode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_encode_character_sc(): auto_ctx=%p font=%p (long)unicode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)unicode);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_encode_character_sc(auto_ctx, font, unicode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_encode_character_with_fallback(). */
int encode_character_with_fallback(fz_font *font, int unicode, int script, int language, fz_font **out_font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_encode_character_with_fallback(): auto_ctx=%p font=%p (long)unicode=%li (long)script=%li (long)language=%li out_font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)unicode, (long)script, (long)language, out_font);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_encode_character_with_fallback(auto_ctx, font, unicode, script, language, out_font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_end_group(). */
void end_group(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_end_group(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_try(auto_ctx) {
		::fz_end_group(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_end_layer(). */
void end_layer(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_end_layer(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_try(auto_ctx) {
		::fz_end_layer(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_end_mask(). */
void end_mask(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_end_mask(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_try(auto_ctx) {
		::fz_end_mask(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_end_page(). */
void end_page(fz_document_writer *wri)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_end_page(): auto_ctx=%p wri=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, wri);
	}
	fz_try(auto_ctx) {
		::fz_end_page(auto_ctx, wri);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_end_tile(). */
void end_tile(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_end_tile(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_try(auto_ctx) {
		::fz_end_tile(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_expand_irect(). */
fz_irect expand_irect(fz_irect a, int expand)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_expand_irect(): &a=%p (long)expand=%li\n", __FILE__, __LINE__, __FUNCTION__, &a, (long)expand);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_expand_irect(a, expand);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_expand_rect(). */
fz_rect expand_rect(fz_rect b, float expand)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_expand_rect(): &b=%p (long)expand=%li\n", __FILE__, __LINE__, __FUNCTION__, &b, (long)expand);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_expand_rect(b, expand);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_file_exists(). */
int file_exists(const char *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_file_exists(): auto_ctx=%p path=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_file_exists(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_fill_image(). */
void fill_image(fz_device *dev, fz_image *image, fz_matrix ctm, float alpha, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_fill_image(): auto_ctx=%p dev=%p image=%p &ctm=%p (long)alpha=%li &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, image, &ctm, (long)alpha, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_fill_image(auto_ctx, dev, image, ctm, alpha, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_fill_image_mask(). */
void fill_image_mask(fz_device *dev, fz_image *image, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_fill_image_mask(): auto_ctx=%p dev=%p image=%p &ctm=%p colorspace=%p color=%p (long)alpha=%li &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, image, &ctm, colorspace, color, (long)alpha, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_fill_image_mask(auto_ctx, dev, image, ctm, colorspace, color, alpha, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_fill_path(). */
void fill_path(fz_device *dev, const fz_path *path, int even_odd, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_fill_path(): auto_ctx=%p dev=%p path=%p (long)even_odd=%li &ctm=%p colorspace=%p color=%p (long)alpha=%li &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, path, (long)even_odd, &ctm, colorspace, color, (long)alpha, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_fill_path(auto_ctx, dev, path, even_odd, ctm, colorspace, color, alpha, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_fill_pixmap_with_color(). */
void fill_pixmap_with_color(fz_pixmap *pix, fz_colorspace *colorspace, float *color, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_fill_pixmap_with_color(): auto_ctx=%p pix=%p colorspace=%p color=%p &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, colorspace, color, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_fill_pixmap_with_color(auto_ctx, pix, colorspace, color, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_fill_shade(). */
void fill_shade(fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_fill_shade(): auto_ctx=%p dev=%p shade=%p &ctm=%p (long)alpha=%li &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, shade, &ctm, (long)alpha, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_fill_shade(auto_ctx, dev, shade, ctm, alpha, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_fill_text(). */
void fill_text(fz_device *dev, const fz_text *text, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_fill_text(): auto_ctx=%p dev=%p text=%p &ctm=%p colorspace=%p color=%p (long)alpha=%li &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, text, &ctm, colorspace, color, (long)alpha, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_fill_text(auto_ctx, dev, text, ctm, colorspace, color, alpha, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_filter_store(). */
void filter_store(fz_store_filter_fn *fn, void *arg, const fz_store_type *type)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_filter_store(): auto_ctx=%p fn=%p arg=%p type=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fn, arg, type);
	}
	fz_try(auto_ctx) {
		::fz_filter_store(auto_ctx, fn, arg, type);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_find_item(). */
void *find_item(fz_store_drop_fn *drop, void *key, const fz_store_type *type)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_find_item(): auto_ctx=%p drop=%p key=%p type=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, drop, key, type);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_find_item(auto_ctx, drop, key, type);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_flush_output(). */
void flush_output(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_flush_output(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_flush_output(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_flush_warnings(). */
void flush_warnings()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_flush_warnings(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_flush_warnings(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_font_ascender(). */
float font_ascender(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_ascender(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_ascender(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_bbox(). */
fz_rect font_bbox(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_bbox(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_bbox(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_descender(). */
float font_descender(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_descender(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_descender(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_digest(). */
void font_digest(fz_font *font, unsigned char digest[16])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_digest(): auto_ctx=%p font=%p (long)digest=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)digest);
	}
	fz_try(auto_ctx) {
		::fz_font_digest(auto_ctx, font, digest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_font_flags(). */
fz_font_flags_t *font_flags(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_flags(): font=%p\n", __FILE__, __LINE__, __FUNCTION__, font);
	}
	fz_font_flags_t * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_flags(font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_ft_face(). */
void *font_ft_face(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_ft_face(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_ft_face(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_is_bold(). */
int font_is_bold(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_is_bold(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_is_bold(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_is_italic(). */
int font_is_italic(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_is_italic(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_is_italic(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_is_monospaced(). */
int font_is_monospaced(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_is_monospaced(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_is_monospaced(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_is_serif(). */
int font_is_serif(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_is_serif(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_is_serif(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_name(). */
const char *font_name(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_name(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_name(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_shaper_data(). */
fz_shaper_data_t *font_shaper_data(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_shaper_data(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_shaper_data_t * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_shaper_data(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_font_t3_procs(). */
fz_buffer **font_t3_procs(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_font_t3_procs(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_buffer ** ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_font_t3_procs(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_format_output_path(). */
void format_output_path(char *path, size_t size, const char *fmt, int page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_format_output_path(): auto_ctx=%p path=%s (long)size=%li fmt=%s (long)page=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)size, fmt, (long)page);
	}
	fz_try(auto_ctx) {
		::fz_format_output_path(auto_ctx, path, size, fmt, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_format_string(). */
void format_string(void *user, void (*emit)(fz_context *, void *, int ), const char *fmt, va_list args)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_format_string(): auto_ctx=%p user=%p emit=%p fmt=%s (long)args=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, user, emit, fmt, (long)args);
	}
	fz_try(auto_ctx) {
		::fz_format_string(auto_ctx, user, emit, fmt, args);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_free(). */
void free(void *p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_free(): auto_ctx=%p p=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p);
	}
	fz_try(auto_ctx) {
		::fz_free(auto_ctx, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_gamma_pixmap(). */
void gamma_pixmap(fz_pixmap *pix, float gamma)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_gamma_pixmap(): auto_ctx=%p pix=%p (long)gamma=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, (long)gamma);
	}
	fz_try(auto_ctx) {
		::fz_gamma_pixmap(auto_ctx, pix, gamma);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_generate_transition(). */
int generate_transition(fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time, fz_transition *trans)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_generate_transition(): auto_ctx=%p tpix=%p opix=%p npix=%p (long)time=%li trans=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tpix, opix, npix, (long)time, trans);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_generate_transition(auto_ctx, tpix, opix, npix, time, trans);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_get_glyph_name(). */
void get_glyph_name(fz_font *font, int glyph, char *buf, int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_get_glyph_name(): auto_ctx=%p font=%p (long)glyph=%li buf=%s (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)glyph, buf, (long)size);
	}
	fz_try(auto_ctx) {
		::fz_get_glyph_name(auto_ctx, font, glyph, buf, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_get_pixmap_from_image(). */
fz_pixmap *get_pixmap_from_image(fz_image *image, const fz_irect *subarea, fz_matrix *ctm, int *w, int *h)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_get_pixmap_from_image(): auto_ctx=%p image=%p subarea=%p ctm=%p w=%p h=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image, subarea, ctm, w, h);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_get_pixmap_from_image(auto_ctx, image, subarea, ctm, w, h);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_getopt(). */
int getopt(int nargc, char **nargv, const char *ostr)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_getopt(): (long)nargc=%li nargv=%p ostr=%s\n", __FILE__, __LINE__, __FUNCTION__, (long)nargc, nargv, ostr);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_getopt(nargc, nargv, ostr);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_glyph_bbox(). */
fz_irect glyph_bbox(fz_glyph *glyph)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_glyph_bbox(): auto_ctx=%p glyph=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, glyph);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_glyph_bbox(auto_ctx, glyph);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_glyph_bbox_no_ctx(). */
fz_irect glyph_bbox_no_ctx(fz_glyph *src)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_glyph_bbox_no_ctx(): src=%p\n", __FILE__, __LINE__, __FUNCTION__, src);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_glyph_bbox_no_ctx(src);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_glyph_cacheable(). */
int glyph_cacheable(fz_font *font, int gid)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_glyph_cacheable(): auto_ctx=%p font=%p (long)gid=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)gid);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_glyph_cacheable(auto_ctx, font, gid);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_glyph_height(). */
int glyph_height(fz_glyph *glyph)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_glyph_height(): auto_ctx=%p glyph=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, glyph);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_glyph_height(auto_ctx, glyph);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_glyph_name_from_unicode_sc(). */
const char *glyph_name_from_unicode_sc(int unicode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_glyph_name_from_unicode_sc(): (long)unicode=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)unicode);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_glyph_name_from_unicode_sc(unicode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_glyph_width(). */
int glyph_width(fz_glyph *glyph)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_glyph_width(): auto_ctx=%p glyph=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, glyph);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_glyph_width(auto_ctx, glyph);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_graphics_aa_level(). */
int graphics_aa_level()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_graphics_aa_level(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_graphics_aa_level(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_graphics_min_line_width(). */
float graphics_min_line_width()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_graphics_min_line_width(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_graphics_min_line_width(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_gridfit_matrix(). */
fz_matrix gridfit_matrix(int as_tiled, fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_gridfit_matrix(): (long)as_tiled=%li &m=%p\n", __FILE__, __LINE__, __FUNCTION__, (long)as_tiled, &m);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_gridfit_matrix(as_tiled, m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_grisu(). */
int grisu(float f, char *s, int *exp)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_grisu(): (long)f=%li s=%s exp=%p\n", __FILE__, __LINE__, __FUNCTION__, (long)f, s, exp);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_grisu(f, s, exp);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_grow_buffer(). */
void grow_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_grow_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_try(auto_ctx) {
		::fz_grow_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_has_archive_entry(). */
int has_archive_entry(fz_archive *arch, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_has_archive_entry(): auto_ctx=%p arch=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arch, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_has_archive_entry(auto_ctx, arch, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_has_option(). */
int has_option(const char *opts, const char *key, const char **val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_has_option(): auto_ctx=%p opts=%s key=%s val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, opts, key, val);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_has_option(auto_ctx, opts, key, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_has_permission(). */
int has_permission(fz_document *doc, fz_permission p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_has_permission(): auto_ctx=%p doc=%p (long)p=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)p);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_has_permission(auto_ctx, doc, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_hash_find(). */
void *hash_find(fz_hash_table *table, const void *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_hash_find(): auto_ctx=%p table=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, table, key);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_hash_find(auto_ctx, table, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_hash_for_each(). */
void hash_for_each(fz_hash_table *table, void *state, fz_hash_table_for_each_fn *callback)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_hash_for_each(): auto_ctx=%p table=%p state=%p callback=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, table, state, callback);
	}
	fz_try(auto_ctx) {
		::fz_hash_for_each(auto_ctx, table, state, callback);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_hash_insert(). */
void *hash_insert(fz_hash_table *table, const void *key, void *val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_hash_insert(): auto_ctx=%p table=%p key=%p val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, table, key, val);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_hash_insert(auto_ctx, table, key, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_hash_remove(). */
void hash_remove(fz_hash_table *table, const void *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_hash_remove(): auto_ctx=%p table=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, table, key);
	}
	fz_try(auto_ctx) {
		::fz_hash_remove(auto_ctx, table, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_hb_lock(). */
void hb_lock()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_hb_lock(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_hb_lock(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_hb_unlock(). */
void hb_unlock()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_hb_unlock(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_hb_unlock(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_highlight_selection(). */
int highlight_selection(fz_stext_page *page, fz_point a, fz_point b, fz_quad *quads, int max_quads)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_highlight_selection(): auto_ctx=%p page=%p &a=%p &b=%p quads=%p (long)max_quads=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, &a, &b, quads, (long)max_quads);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_highlight_selection(auto_ctx, page, a, b, quads, max_quads);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_ignore_text(). */
void ignore_text(fz_device *dev, const fz_text *text, fz_matrix ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_ignore_text(): auto_ctx=%p dev=%p text=%p &ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, text, &ctm);
	}
	fz_try(auto_ctx) {
		::fz_ignore_text(auto_ctx, dev, text, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_image_resolution(). */
void image_resolution(fz_image *image, int *xres, int *yres)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_image_resolution(): image=%p xres=%p yres=%p\n", __FILE__, __LINE__, __FUNCTION__, image, xres, yres);
	}
	fz_try(auto_ctx) {
		::fz_image_resolution(image, xres, yres);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_image_size(). */
size_t image_size(fz_image *im)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_image_size(): auto_ctx=%p im=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, im);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_image_size(auto_ctx, im);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_include_point_in_rect(). */
fz_rect include_point_in_rect(fz_rect r, fz_point p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_include_point_in_rect(): &r=%p &p=%p\n", __FILE__, __LINE__, __FUNCTION__, &r, &p);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_include_point_in_rect(r, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_install_load_system_font_funcs(). */
void install_load_system_font_funcs(fz_load_system_font_fn *f, fz_load_system_cjk_font_fn *f_cjk, fz_load_system_fallback_font_fn *f_fallback)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_install_load_system_font_funcs(): auto_ctx=%p f=%p f_cjk=%p f_fallback=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, f, f_cjk, f_fallback);
	}
	fz_try(auto_ctx) {
		::fz_install_load_system_font_funcs(auto_ctx, f, f_cjk, f_fallback);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_intersect_irect(). */
fz_irect intersect_irect(fz_irect a, fz_irect b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_intersect_irect(): &a=%p &b=%p\n", __FILE__, __LINE__, __FUNCTION__, &a, &b);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_intersect_irect(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_intersect_rect(). */
fz_rect intersect_rect(fz_rect a, fz_rect b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_intersect_rect(): &a=%p &b=%p\n", __FILE__, __LINE__, __FUNCTION__, &a, &b);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_intersect_rect(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_invert_matrix(). */
fz_matrix invert_matrix(fz_matrix matrix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_invert_matrix(): &matrix=%p\n", __FILE__, __LINE__, __FUNCTION__, &matrix);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_invert_matrix(matrix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_invert_pixmap(). */
void invert_pixmap(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_invert_pixmap(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_try(auto_ctx) {
		::fz_invert_pixmap(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_invert_pixmap_luminance(). */
void invert_pixmap_luminance(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_invert_pixmap_luminance(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_try(auto_ctx) {
		::fz_invert_pixmap_luminance(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_invert_pixmap_rect(). */
void invert_pixmap_rect(fz_pixmap *image, fz_irect rect)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_invert_pixmap_rect(): auto_ctx=%p image=%p &rect=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image, &rect);
	}
	fz_try(auto_ctx) {
		::fz_invert_pixmap_rect(auto_ctx, image, rect);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_irect_from_rect(). */
fz_irect irect_from_rect(fz_rect rect)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_irect_from_rect(): &rect=%p\n", __FILE__, __LINE__, __FUNCTION__, &rect);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_irect_from_rect(rect);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_directory(). */
int is_directory(const char *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_directory(): auto_ctx=%p path=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_directory(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_document_reflowable(). */
int is_document_reflowable(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_document_reflowable(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_document_reflowable(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_empty_irect(). */
int is_empty_irect(fz_irect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_empty_irect(): &r=%p\n", __FILE__, __LINE__, __FUNCTION__, &r);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_empty_irect(r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_empty_rect(). */
int is_empty_rect(fz_rect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_empty_rect(): &r=%p\n", __FILE__, __LINE__, __FUNCTION__, &r);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_empty_rect(r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_eof(). */
int is_eof(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_eof(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_eof(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_eof_bits(). */
int is_eof_bits(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_eof_bits(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_eof_bits(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_external_link(). */
int is_external_link(const char *uri)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_external_link(): auto_ctx=%p uri=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, uri);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_external_link(auto_ctx, uri);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_identity(). */
int is_identity(fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_identity(): &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &m);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_identity(m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_infinite_irect(). */
int is_infinite_irect(fz_irect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_infinite_irect(): &r=%p\n", __FILE__, __LINE__, __FUNCTION__, &r);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_infinite_irect(r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_infinite_rect(). */
int is_infinite_rect(fz_rect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_infinite_rect(): &r=%p\n", __FILE__, __LINE__, __FUNCTION__, &r);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_infinite_rect(r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_page_range(). */
int is_page_range(const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_page_range(): auto_ctx=%p s=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, s);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_page_range(auto_ctx, s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_pixmap_monochrome(). */
int is_pixmap_monochrome(fz_pixmap *pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_pixmap_monochrome(): auto_ctx=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_pixmap_monochrome(auto_ctx, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_point_inside_irect(). */
int is_point_inside_irect(int x, int y, fz_irect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_point_inside_irect(): (long)x=%li (long)y=%li &r=%p\n", __FILE__, __LINE__, __FUNCTION__, (long)x, (long)y, &r);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_point_inside_irect(x, y, r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_point_inside_quad(). */
int is_point_inside_quad(fz_point p, fz_quad q)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_point_inside_quad(): &p=%p &q=%p\n", __FILE__, __LINE__, __FUNCTION__, &p, &q);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_point_inside_quad(p, q);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_point_inside_rect(). */
int is_point_inside_rect(fz_point p, fz_rect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_point_inside_rect(): &p=%p &r=%p\n", __FILE__, __LINE__, __FUNCTION__, &p, &r);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_point_inside_rect(p, r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_pow2(). */
int is_pow2(int a)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_pow2(): (long)a=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_pow2(a);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_quad_inside_quad(). */
int is_quad_inside_quad(fz_quad needle, fz_quad haystack)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_quad_inside_quad(): &needle=%p &haystack=%p\n", __FILE__, __LINE__, __FUNCTION__, &needle, &haystack);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_quad_inside_quad(needle, haystack);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_quad_intersecting_quad(). */
int is_quad_intersecting_quad(fz_quad a, fz_quad b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_quad_intersecting_quad(): &a=%p &b=%p\n", __FILE__, __LINE__, __FUNCTION__, &a, &b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_quad_intersecting_quad(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_rectilinear(). */
int is_rectilinear(fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_rectilinear(): &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &m);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_rectilinear(m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_tar_archive(). */
int is_tar_archive(fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_tar_archive(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_tar_archive(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_valid_blend_colorspace(). */
int is_valid_blend_colorspace(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_valid_blend_colorspace(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_valid_blend_colorspace(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_is_zip_archive(). */
int is_zip_archive(fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_is_zip_archive(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_is_zip_archive(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_iso8859_1_from_unicode(). */
int iso8859_1_from_unicode(int u)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_iso8859_1_from_unicode(): (long)u=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)u);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_iso8859_1_from_unicode(u);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_iso8859_7_from_unicode(). */
int iso8859_7_from_unicode(int u)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_iso8859_7_from_unicode(): (long)u=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)u);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_iso8859_7_from_unicode(u);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_bitmap(). */
fz_bitmap *keep_bitmap(fz_bitmap *bit)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_bitmap(): auto_ctx=%p bit=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, bit);
	}
	fz_bitmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_bitmap(auto_ctx, bit);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_buffer(). */
fz_buffer *keep_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_colorspace(). */
fz_colorspace *keep_colorspace(fz_colorspace *colorspace)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_colorspace(): auto_ctx=%p colorspace=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, colorspace);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_colorspace(auto_ctx, colorspace);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_default_colorspaces(). */
fz_default_colorspaces *keep_default_colorspaces(fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_default_colorspaces(): auto_ctx=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs);
	}
	fz_default_colorspaces * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_default_colorspaces(auto_ctx, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_device(). */
fz_device *keep_device(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_device(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_device(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_display_list(). */
fz_display_list *keep_display_list(fz_display_list *list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_display_list(): auto_ctx=%p list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_display_list(auto_ctx, list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_document(). */
fz_document *keep_document(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_document(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_document(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_font(). */
fz_font *keep_font(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_font(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_font(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_glyph(). */
fz_glyph *keep_glyph(fz_glyph *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_glyph(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_glyph * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_glyph(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_halftone(). */
fz_halftone *keep_halftone(fz_halftone *half)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_halftone(): auto_ctx=%p half=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, half);
	}
	fz_halftone * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_halftone(auto_ctx, half);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_image(). */
fz_image *keep_image(fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_image(): auto_ctx=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_image(auto_ctx, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_image_store_key(). */
fz_image *keep_image_store_key(fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_image_store_key(): auto_ctx=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_image_store_key(auto_ctx, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_imp(). */
void *keep_imp(void *p, int *refs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_imp(): auto_ctx=%p p=%p refs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, refs);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_imp(auto_ctx, p, refs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_imp16(). */
void *keep_imp16(void *p, int16_t *refs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_imp16(): auto_ctx=%p p=%p refs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, refs);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_imp16(auto_ctx, p, refs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_imp8(). */
void *keep_imp8(void *p, int8_t *refs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_imp8(): auto_ctx=%p p=%p refs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, refs);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_imp8(auto_ctx, p, refs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_jbig2_globals(). */
fz_jbig2_globals *keep_jbig2_globals(fz_jbig2_globals *globals)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_jbig2_globals(): auto_ctx=%p globals=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, globals);
	}
	fz_jbig2_globals * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_jbig2_globals(auto_ctx, globals);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_key_storable(). */
void *keep_key_storable(const fz_key_storable *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_key_storable(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_key_storable(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_key_storable_key(). */
void *keep_key_storable_key(const fz_key_storable *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_key_storable_key(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_key_storable_key(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_link(). */
fz_link *keep_link(fz_link *link)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_link(): auto_ctx=%p link=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, link);
	}
	fz_link * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_link(auto_ctx, link);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_outline(). */
fz_outline *keep_outline(fz_outline *outline)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_outline(): auto_ctx=%p outline=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, outline);
	}
	fz_outline * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_outline(auto_ctx, outline);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_page(). */
fz_page *keep_page(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_page(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_page(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_path(). */
fz_path *keep_path(const fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_path(): auto_ctx=%p path=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_path * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_path(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_pixmap(). */
fz_pixmap *keep_pixmap(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_pixmap(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_pixmap(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_separations(). */
fz_separations *keep_separations(fz_separations *sep)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_separations(): auto_ctx=%p sep=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep);
	}
	fz_separations * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_separations(auto_ctx, sep);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_shade(). */
fz_shade *keep_shade(fz_shade *shade)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_shade(): auto_ctx=%p shade=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shade);
	}
	fz_shade * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_shade(auto_ctx, shade);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_storable(). */
void *keep_storable(const fz_storable *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_storable(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_storable(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_store_context(). */
fz_store *keep_store_context()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_store_context(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_store * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_store_context(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_stream(). */
fz_stream *keep_stream(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_stream(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_stream(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_stroke_state(). */
fz_stroke_state *keep_stroke_state(const fz_stroke_state *stroke)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_stroke_state(): auto_ctx=%p stroke=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stroke);
	}
	fz_stroke_state * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_stroke_state(auto_ctx, stroke);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_keep_text(). */
fz_text *keep_text(const fz_text *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_keep_text(): auto_ctx=%p text=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text);
	}
	fz_text * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_keep_text(auto_ctx, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_koi8u_from_unicode(). */
int koi8u_from_unicode(int u)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_koi8u_from_unicode(): (long)u=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)u);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_koi8u_from_unicode(u);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_last_page(). */
fz_location last_page(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_last_page(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_last_page(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_layout_document(). */
void layout_document(fz_document *doc, float w, float h, float em)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_layout_document(): auto_ctx=%p doc=%p (long)w=%li (long)h=%li (long)em=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)w, (long)h, (long)em);
	}
	fz_try(auto_ctx) {
		::fz_layout_document(auto_ctx, doc, w, h, em);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_lineto(). */
void lineto(fz_path *path, float x, float y)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lineto(): auto_ctx=%p path=%p (long)x=%li (long)y=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)x, (long)y);
	}
	fz_try(auto_ctx) {
		::fz_lineto(auto_ctx, path, x, y);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_list_archive_entry(). */
const char *list_archive_entry(fz_archive *arch, int idx)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_list_archive_entry(): auto_ctx=%p arch=%p (long)idx=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arch, (long)idx);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_list_archive_entry(auto_ctx, arch, idx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_bmp_subimage(). */
fz_pixmap *load_bmp_subimage(const unsigned char *buf, size_t len, int subimage)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_bmp_subimage(): auto_ctx=%p buf=%p (long)len=%li (long)subimage=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len, (long)subimage);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_bmp_subimage(auto_ctx, buf, len, subimage);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_bmp_subimage_count(). */
int load_bmp_subimage_count(const unsigned char *buf, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_bmp_subimage_count(): auto_ctx=%p buf=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_bmp_subimage_count(auto_ctx, buf, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_chapter_page(). */
fz_page *load_chapter_page(fz_document *doc, int chapter, int page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_chapter_page(): auto_ctx=%p doc=%p (long)chapter=%li (long)page=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)chapter, (long)page);
	}
	fz_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_chapter_page(auto_ctx, doc, chapter, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_fallback_font(). */
fz_font *load_fallback_font(int script, int language, int serif, int bold, int italic)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_fallback_font(): auto_ctx=%p (long)script=%li (long)language=%li (long)serif=%li (long)bold=%li (long)italic=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)script, (long)language, (long)serif, (long)bold, (long)italic);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_fallback_font(auto_ctx, script, language, serif, bold, italic);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_jbig2_globals(). */
fz_jbig2_globals *load_jbig2_globals(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_jbig2_globals(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_jbig2_globals * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_jbig2_globals(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_jbig2_subimage(). */
fz_pixmap *load_jbig2_subimage(const unsigned char *buf, size_t len, int subimage)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_jbig2_subimage(): auto_ctx=%p buf=%p (long)len=%li (long)subimage=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len, (long)subimage);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_jbig2_subimage(auto_ctx, buf, len, subimage);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_jbig2_subimage_count(). */
int load_jbig2_subimage_count(const unsigned char *buf, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_jbig2_subimage_count(): auto_ctx=%p buf=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_jbig2_subimage_count(auto_ctx, buf, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_jpx(). */
fz_pixmap *load_jpx(const unsigned char *data, size_t size, fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_jpx(): auto_ctx=%p data=%p (long)size=%li cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)size, cs);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_jpx(auto_ctx, data, size, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_links(). */
fz_link *load_links(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_links(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_link * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_links(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_outline(). */
fz_outline *load_outline(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_outline(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_outline * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_outline(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_page(). */
fz_page *load_page(fz_document *doc, int number)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_page(): auto_ctx=%p doc=%p (long)number=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number);
	}
	fz_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_page(auto_ctx, doc, number);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_pnm_subimage(). */
fz_pixmap *load_pnm_subimage(const unsigned char *buf, size_t len, int subimage)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_pnm_subimage(): auto_ctx=%p buf=%p (long)len=%li (long)subimage=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len, (long)subimage);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_pnm_subimage(auto_ctx, buf, len, subimage);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_pnm_subimage_count(). */
int load_pnm_subimage_count(const unsigned char *buf, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_pnm_subimage_count(): auto_ctx=%p buf=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_pnm_subimage_count(auto_ctx, buf, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_system_cjk_font(). */
fz_font *load_system_cjk_font(const char *name, int ordering, int serif)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_system_cjk_font(): auto_ctx=%p name=%s (long)ordering=%li (long)serif=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, (long)ordering, (long)serif);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_system_cjk_font(auto_ctx, name, ordering, serif);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_system_font(). */
fz_font *load_system_font(const char *name, int bold, int italic, int needs_exact_metrics)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_system_font(): auto_ctx=%p name=%s (long)bold=%li (long)italic=%li (long)needs_exact_metrics=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, (long)bold, (long)italic, (long)needs_exact_metrics);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_system_font(auto_ctx, name, bold, italic, needs_exact_metrics);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_tiff_subimage(). */
fz_pixmap *load_tiff_subimage(const unsigned char *buf, size_t len, int subimage)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_tiff_subimage(): auto_ctx=%p buf=%p (long)len=%li (long)subimage=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len, (long)subimage);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_tiff_subimage(auto_ctx, buf, len, subimage);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_load_tiff_subimage_count(). */
int load_tiff_subimage_count(const unsigned char *buf, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_load_tiff_subimage_count(): auto_ctx=%p buf=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)len);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_load_tiff_subimage_count(auto_ctx, buf, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_location_from_page_number(). */
fz_location location_from_page_number(fz_document *doc, int number)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_location_from_page_number(): auto_ctx=%p doc=%p (long)number=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_location_from_page_number(auto_ctx, doc, number);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lock(). */
void lock(int lock)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lock(): auto_ctx=%p (long)lock=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)lock);
	}
	fz_try(auto_ctx) {
		::fz_lock(auto_ctx, lock);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_lookup_base14_font(). */
const unsigned char *lookup_base14_font(const char *name, int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_base14_font(): auto_ctx=%p name=%s len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_base14_font(auto_ctx, name, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_blendmode(). */
int lookup_blendmode(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_blendmode(): name=%s\n", __FILE__, __LINE__, __FUNCTION__, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_blendmode(name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_bookmark(). */
fz_location lookup_bookmark(fz_document *doc, fz_bookmark mark)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_bookmark(): auto_ctx=%p doc=%p (long)mark=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)mark);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_bookmark(auto_ctx, doc, mark);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_builtin_font(). */
const unsigned char *lookup_builtin_font(const char *name, int bold, int italic, int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_builtin_font(): auto_ctx=%p name=%s (long)bold=%li (long)italic=%li len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, (long)bold, (long)italic, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_builtin_font(auto_ctx, name, bold, italic, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_cjk_font(). */
const unsigned char *lookup_cjk_font(int ordering, int *len, int *index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_cjk_font(): auto_ctx=%p (long)ordering=%li len=%p index=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)ordering, len, index);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_cjk_font(auto_ctx, ordering, len, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_cjk_font_by_language(). */
const unsigned char *lookup_cjk_font_by_language(const char *lang, int *len, int *subfont)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_cjk_font_by_language(): auto_ctx=%p lang=%s len=%p subfont=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, lang, len, subfont);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_cjk_font_by_language(auto_ctx, lang, len, subfont);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_cjk_ordering_by_language(). */
int lookup_cjk_ordering_by_language(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_cjk_ordering_by_language(): name=%s\n", __FILE__, __LINE__, __FUNCTION__, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_cjk_ordering_by_language(name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_metadata(). */
int lookup_metadata(fz_document *doc, const char *key, char *buf, int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_metadata(): auto_ctx=%p doc=%p key=%s buf=%s (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, key, buf, (long)size);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_metadata(auto_ctx, doc, key, buf, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_noto_emoji_font(). */
const unsigned char *lookup_noto_emoji_font(int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_noto_emoji_font(): auto_ctx=%p len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_noto_emoji_font(auto_ctx, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_noto_font(). */
const unsigned char *lookup_noto_font(int script, int lang, int *len, int *subfont)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_noto_font(): auto_ctx=%p (long)script=%li (long)lang=%li len=%p subfont=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)script, (long)lang, len, subfont);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_noto_font(auto_ctx, script, lang, len, subfont);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_noto_math_font(). */
const unsigned char *lookup_noto_math_font(int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_noto_math_font(): auto_ctx=%p len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_noto_math_font(auto_ctx, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_noto_music_font(). */
const unsigned char *lookup_noto_music_font(int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_noto_music_font(): auto_ctx=%p len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_noto_music_font(auto_ctx, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_noto_symbol1_font(). */
const unsigned char *lookup_noto_symbol1_font(int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_noto_symbol1_font(): auto_ctx=%p len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_noto_symbol1_font(auto_ctx, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_noto_symbol2_font(). */
const unsigned char *lookup_noto_symbol2_font(int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_noto_symbol2_font(): auto_ctx=%p len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_noto_symbol2_font(auto_ctx, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_lookup_rendering_intent(). */
int lookup_rendering_intent(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_lookup_rendering_intent(): name=%s\n", __FILE__, __LINE__, __FUNCTION__, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_lookup_rendering_intent(name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_make_bookmark(). */
fz_bookmark make_bookmark(fz_document *doc, fz_location loc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_make_bookmark(): auto_ctx=%p doc=%p &loc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &loc);
	}
	fz_bookmark ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_make_bookmark(auto_ctx, doc, loc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_make_irect(). */
fz_irect make_irect(int x0, int y0, int x1, int y1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_make_irect(): (long)x0=%li (long)y0=%li (long)x1=%li (long)y1=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)x0, (long)y0, (long)x1, (long)y1);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_make_irect(x0, y0, x1, y1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_make_location(). */
fz_location make_location(int chapter, int page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_make_location(): (long)chapter=%li (long)page=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)chapter, (long)page);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_make_location(chapter, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_make_matrix(). */
fz_matrix make_matrix(float a, float b, float c, float d, float e, float f)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_make_matrix(): (long)a=%li (long)b=%li (long)c=%li (long)d=%li (long)e=%li (long)f=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b, (long)c, (long)d, (long)e, (long)f);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_make_matrix(a, b, c, d, e, f);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_make_point(). */
fz_point make_point(float x, float y)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_make_point(): (long)x=%li (long)y=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)x, (long)y);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_make_point(x, y);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_make_quad(). */
fz_quad make_quad(float ul_x, float ul_y, float ur_x, float ur_y, float ll_x, float ll_y, float lr_x, float lr_y)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_make_quad(): (long)ul_x=%li (long)ul_y=%li (long)ur_x=%li (long)ur_y=%li (long)ll_x=%li (long)ll_y=%li (long)lr_x=%li (long)lr_y=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)ul_x, (long)ul_y, (long)ur_x, (long)ur_y, (long)ll_x, (long)ll_y, (long)lr_x, (long)lr_y);
	}
	fz_quad ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_make_quad(ul_x, ul_y, ur_x, ur_y, ll_x, ll_y, lr_x, lr_y);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_make_rect(). */
fz_rect make_rect(float x0, float y0, float x1, float y1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_make_rect(): (long)x0=%li (long)y0=%li (long)x1=%li (long)y1=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)x0, (long)y0, (long)x1, (long)y1);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_make_rect(x0, y0, x1, y1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_malloc(). */
void *malloc(size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_malloc(): auto_ctx=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_malloc(auto_ctx, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_malloc_no_throw(). */
void *malloc_no_throw(size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_malloc_no_throw(): auto_ctx=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_malloc_no_throw(auto_ctx, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_matrix_expansion(). */
float matrix_expansion(fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_matrix_expansion(): &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &m);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_matrix_expansion(m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_matrix_max_expansion(). */
float matrix_max_expansion(fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_matrix_max_expansion(): &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &m);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_matrix_max_expansion(m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_max(). */
float max(float a, float b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_max(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_max(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_maxi(). */
int maxi(int a, int b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_maxi(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_maxi(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_maxi64(). */
int64_t maxi64(int64_t a, int64_t b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_maxi64(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_maxi64(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_maxz(). */
size_t maxz(size_t a, size_t b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_maxz(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_maxz(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_md5_buffer(). */
void md5_buffer(fz_buffer *buffer, unsigned char digest[16])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_md5_buffer(): auto_ctx=%p buffer=%p (long)digest=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buffer, (long)digest);
	}
	fz_try(auto_ctx) {
		::fz_md5_buffer(auto_ctx, buffer, digest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_md5_final(). */
void md5_final(fz_md5 *state, unsigned char digest[16])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_md5_final(): state=%p (long)digest=%li\n", __FILE__, __LINE__, __FUNCTION__, state, (long)digest);
	}
	fz_try(auto_ctx) {
		::fz_md5_final(state, digest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_md5_init(). */
void md5_init(fz_md5 *state)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_md5_init(): state=%p\n", __FILE__, __LINE__, __FUNCTION__, state);
	}
	fz_try(auto_ctx) {
		::fz_md5_init(state);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_md5_pixmap(). */
void md5_pixmap(fz_pixmap *pixmap, unsigned char digest[16])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_md5_pixmap(): auto_ctx=%p pixmap=%p (long)digest=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, (long)digest);
	}
	fz_try(auto_ctx) {
		::fz_md5_pixmap(auto_ctx, pixmap, digest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_md5_update(). */
void md5_update(fz_md5 *state, const unsigned char *input, size_t inlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_md5_update(): state=%p input=%p (long)inlen=%li\n", __FILE__, __LINE__, __FUNCTION__, state, input, (long)inlen);
	}
	fz_try(auto_ctx) {
		::fz_md5_update(state, input, inlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_memmem(). */
void *memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_memmem(): haystack=%p (long)haystacklen=%li needle=%p (long)needlelen=%li\n", __FILE__, __LINE__, __FUNCTION__, haystack, (long)haystacklen, needle, (long)needlelen);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_memmem(haystack, haystacklen, needle, needlelen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_memrnd(). */
void memrnd(uint8_t *block, int len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_memrnd(): auto_ctx=%p block=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, block, (long)len);
	}
	fz_try(auto_ctx) {
		::fz_memrnd(auto_ctx, block, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_min(). */
float min(float a, float b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_min(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_min(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_mini(). */
int mini(int a, int b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_mini(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_mini(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_minz(). */
size_t minz(size_t a, size_t b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_minz(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_minz(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_moveto(). */
void moveto(fz_path *path, float x, float y)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_moveto(): auto_ctx=%p path=%p (long)x=%li (long)y=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)x, (long)y);
	}
	fz_try(auto_ctx) {
		::fz_moveto(auto_ctx, path, x, y);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_mul255(). */
int mul255(int a, int b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_mul255(): (long)a=%li (long)b=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)a, (long)b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_mul255(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_needs_password(). */
int needs_password(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_needs_password(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_needs_password(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_arc4_output(). */
fz_output *new_arc4_output(fz_output *chain, unsigned char *key, size_t keylen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_arc4_output(): auto_ctx=%p chain=%p key=%p (long)keylen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, key, (long)keylen);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_arc4_output(auto_ctx, chain, key, keylen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_archive_of_size(). */
fz_archive *new_archive_of_size(fz_stream *file, int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_archive_of_size(): auto_ctx=%p file=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file, (long)size);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_archive_of_size(auto_ctx, file, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_ascii85_output(). */
fz_output *new_ascii85_output(fz_output *chain)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_ascii85_output(): auto_ctx=%p chain=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_ascii85_output(auto_ctx, chain);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_asciihex_output(). */
fz_output *new_asciihex_output(fz_output *chain)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_asciihex_output(): auto_ctx=%p chain=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_asciihex_output(auto_ctx, chain);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_band_writer_of_size(). */
fz_band_writer *new_band_writer_of_size(size_t size, fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_band_writer_of_size(): auto_ctx=%p (long)size=%li out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_band_writer_of_size(auto_ctx, size, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_base14_font(). */
fz_font *new_base14_font(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_base14_font(): auto_ctx=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_base14_font(auto_ctx, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_bbox_device(). */
fz_device *new_bbox_device(fz_rect *rectp)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_bbox_device(): auto_ctx=%p rectp=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, rectp);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_bbox_device(auto_ctx, rectp);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_bitmap(). */
fz_bitmap *new_bitmap(int w, int h, int n, int xres, int yres)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_bitmap(): auto_ctx=%p (long)w=%li (long)h=%li (long)n=%li (long)xres=%li (long)yres=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)w, (long)h, (long)n, (long)xres, (long)yres);
	}
	fz_bitmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_bitmap(auto_ctx, w, h, n, xres, yres);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_bitmap_from_pixmap(). */
fz_bitmap *new_bitmap_from_pixmap(fz_pixmap *pix, fz_halftone *ht)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_bitmap_from_pixmap(): auto_ctx=%p pix=%p ht=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, ht);
	}
	fz_bitmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_bitmap_from_pixmap(auto_ctx, pix, ht);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_bitmap_from_pixmap_band(). */
fz_bitmap *new_bitmap_from_pixmap_band(fz_pixmap *pix, fz_halftone *ht, int band_start)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_bitmap_from_pixmap_band(): auto_ctx=%p pix=%p ht=%p (long)band_start=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, ht, (long)band_start);
	}
	fz_bitmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_bitmap_from_pixmap_band(auto_ctx, pix, ht, band_start);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer(). */
fz_buffer *new_buffer(size_t capacity)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer(): auto_ctx=%p (long)capacity=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)capacity);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer(auto_ctx, capacity);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_base64(). */
fz_buffer *new_buffer_from_base64(const char *data, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_base64(): auto_ctx=%p data=%s (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)size);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_base64(auto_ctx, data, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_copied_data(). */
fz_buffer *new_buffer_from_copied_data(const unsigned char *data, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_copied_data(): auto_ctx=%p data=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)size);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_copied_data(auto_ctx, data, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_data(). */
fz_buffer *new_buffer_from_data(unsigned char *data, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_data(): auto_ctx=%p data=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)size);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_data(auto_ctx, data, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_display_list(). */
fz_buffer *new_buffer_from_display_list(fz_display_list *list, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_display_list(): auto_ctx=%p list=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list, options);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_display_list(auto_ctx, list, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_image_as_png(). */
fz_buffer *new_buffer_from_image_as_png(fz_image *image, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_image_as_png(): auto_ctx=%p image=%p &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image, &color_params);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_image_as_png(auto_ctx, image, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_page(). */
fz_buffer *new_buffer_from_page(fz_page *page, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_page(): auto_ctx=%p page=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, options);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_page(auto_ctx, page, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_page_number(). */
fz_buffer *new_buffer_from_page_number(fz_document *doc, int number, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_page_number(): auto_ctx=%p doc=%p (long)number=%li options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number, options);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_page_number(auto_ctx, doc, number, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_pixmap_as_png(). */
fz_buffer *new_buffer_from_pixmap_as_png(fz_pixmap *pixmap, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_pixmap_as_png(): auto_ctx=%p pixmap=%p &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, &color_params);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_pixmap_as_png(auto_ctx, pixmap, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_shared_data(). */
fz_buffer *new_buffer_from_shared_data(const unsigned char *data, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_shared_data(): auto_ctx=%p data=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)size);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_shared_data(auto_ctx, data, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_buffer_from_stext_page(). */
fz_buffer *new_buffer_from_stext_page(fz_stext_page *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_buffer_from_stext_page(): auto_ctx=%p text=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_buffer_from_stext_page(auto_ctx, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_builtin_font(). */
fz_font *new_builtin_font(const char *name, int is_bold, int is_italic)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_builtin_font(): auto_ctx=%p name=%s (long)is_bold=%li (long)is_italic=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, (long)is_bold, (long)is_italic);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_builtin_font(auto_ctx, name, is_bold, is_italic);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_cal_gray_colorspace(). */
fz_colorspace *new_cal_gray_colorspace(float wp[3], float bp[3], float gamma)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_cal_gray_colorspace(): auto_ctx=%p (long)wp=%li (long)bp=%li (long)gamma=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)wp, (long)bp, (long)gamma);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_cal_gray_colorspace(auto_ctx, wp, bp, gamma);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_cal_rgb_colorspace(). */
fz_colorspace *new_cal_rgb_colorspace(float wp[3], float bp[3], float gamma[3], float matrix[9])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_cal_rgb_colorspace(): auto_ctx=%p (long)wp=%li (long)bp=%li (long)gamma=%li (long)matrix=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)wp, (long)bp, (long)gamma, (long)matrix);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_cal_rgb_colorspace(auto_ctx, wp, bp, gamma, matrix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_cbz_writer(). */
fz_document_writer *new_cbz_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_cbz_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_cbz_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_cbz_writer_with_output(). */
fz_document_writer *new_cbz_writer_with_output(fz_output *out, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_cbz_writer_with_output(): auto_ctx=%p out=%p options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_cbz_writer_with_output(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_cjk_font(). */
fz_font *new_cjk_font(int ordering)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_cjk_font(): auto_ctx=%p (long)ordering=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)ordering);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_cjk_font(auto_ctx, ordering);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_color_pcl_band_writer(). */
fz_band_writer *new_color_pcl_band_writer(fz_output *out, const fz_pcl_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_color_pcl_band_writer(): auto_ctx=%p out=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_color_pcl_band_writer(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_colorspace(). */
fz_colorspace *new_colorspace(enum fz_colorspace_type type, int flags, int n, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_colorspace(): auto_ctx=%p (long)type=%li (long)flags=%li (long)n=%li name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)type, (long)flags, (long)n, name);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_colorspace(auto_ctx, type, flags, n, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_context_imp(). */
fz_context *new_context_imp(const fz_alloc_context *alloc, const fz_locks_context *locks, size_t max_store, const char *version)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_context_imp(): alloc=%p locks=%p (long)max_store=%li version=%s\n", __FILE__, __LINE__, __FUNCTION__, alloc, locks, (long)max_store, version);
	}
	fz_context * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_context_imp(alloc, locks, max_store, version);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_default_colorspaces(). */
fz_default_colorspaces *new_default_colorspaces()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_default_colorspaces(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_default_colorspaces * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_default_colorspaces(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_deflate_output(). */
fz_output *new_deflate_output(fz_output *chain, int effort, int raw)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_deflate_output(): auto_ctx=%p chain=%p (long)effort=%li (long)raw=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)effort, (long)raw);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_deflate_output(auto_ctx, chain, effort, raw);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_deflated_data(). */
unsigned char *new_deflated_data(size_t *compressed_length, const unsigned char *source, size_t source_length, fz_deflate_level level)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_deflated_data(): auto_ctx=%p compressed_length=%p source=%p (long)source_length=%li (long)level=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, compressed_length, source, (long)source_length, (long)level);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_deflated_data(auto_ctx, compressed_length, source, source_length, level);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_deflated_data_from_buffer(). */
unsigned char *new_deflated_data_from_buffer(size_t *compressed_length, fz_buffer *buffer, fz_deflate_level level)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_deflated_data_from_buffer(): auto_ctx=%p compressed_length=%p buffer=%p (long)level=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, compressed_length, buffer, (long)level);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_deflated_data_from_buffer(auto_ctx, compressed_length, buffer, level);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_device_of_size(). */
fz_device *new_device_of_size(int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_device_of_size(): auto_ctx=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_device_of_size(auto_ctx, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_display_list(). */
fz_display_list *new_display_list(fz_rect mediabox)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_display_list(): auto_ctx=%p &mediabox=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &mediabox);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_display_list(auto_ctx, mediabox);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_display_list_from_page(). */
fz_display_list *new_display_list_from_page(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_display_list_from_page(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_display_list_from_page(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_display_list_from_page_contents(). */
fz_display_list *new_display_list_from_page_contents(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_display_list_from_page_contents(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_display_list_from_page_contents(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_display_list_from_page_number(). */
fz_display_list *new_display_list_from_page_number(fz_document *doc, int number)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_display_list_from_page_number(): auto_ctx=%p doc=%p (long)number=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_display_list_from_page_number(auto_ctx, doc, number);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_display_list_from_svg(). */
fz_display_list *new_display_list_from_svg(fz_buffer *buf, const char *base_uri, fz_archive *zip, float *w, float *h)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_display_list_from_svg(): auto_ctx=%p buf=%p base_uri=%s zip=%p w=%p h=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, base_uri, zip, w, h);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_display_list_from_svg(auto_ctx, buf, base_uri, zip, w, h);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_display_list_from_svg_xml(). */
fz_display_list *new_display_list_from_svg_xml(fz_xml *xml, const char *base_uri, fz_archive *zip, float *w, float *h)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_display_list_from_svg_xml(): auto_ctx=%p xml=%p base_uri=%s zip=%p w=%p h=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xml, base_uri, zip, w, h);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_display_list_from_svg_xml(auto_ctx, xml, base_uri, zip, w, h);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_document_of_size(). */
void *new_document_of_size(int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_document_of_size(): auto_ctx=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_document_of_size(auto_ctx, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_document_writer(). */
fz_document_writer *new_document_writer(const char *path, const char *format, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_document_writer(): auto_ctx=%p path=%s format=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, format, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_document_writer(auto_ctx, path, format, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_document_writer_of_size(). */
fz_document_writer *new_document_writer_of_size(size_t size, fz_document_writer_begin_page_fn *begin_page, fz_document_writer_end_page_fn *end_page, fz_document_writer_close_writer_fn *close, fz_document_writer_drop_writer_fn *drop)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_document_writer_of_size(): auto_ctx=%p (long)size=%li begin_page=%p end_page=%p close=%p drop=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size, begin_page, end_page, close, drop);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_document_writer_of_size(auto_ctx, size, begin_page, end_page, close, drop);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_document_writer_with_output(). */
fz_document_writer *new_document_writer_with_output(fz_output *out, const char *format, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_document_writer_with_output(): auto_ctx=%p out=%p format=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, format, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_document_writer_with_output(auto_ctx, out, format, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_draw_device(). */
fz_device *new_draw_device(fz_matrix transform, fz_pixmap *dest)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_draw_device(): auto_ctx=%p &transform=%p dest=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &transform, dest);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_draw_device(auto_ctx, transform, dest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_draw_device_type3(). */
fz_device *new_draw_device_type3(fz_matrix transform, fz_pixmap *dest)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_draw_device_type3(): auto_ctx=%p &transform=%p dest=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &transform, dest);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_draw_device_type3(auto_ctx, transform, dest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_draw_device_with_bbox(). */
fz_device *new_draw_device_with_bbox(fz_matrix transform, fz_pixmap *dest, const fz_irect *clip)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_draw_device_with_bbox(): auto_ctx=%p &transform=%p dest=%p clip=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &transform, dest, clip);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_draw_device_with_bbox(auto_ctx, transform, dest, clip);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_draw_device_with_bbox_proof(). */
fz_device *new_draw_device_with_bbox_proof(fz_matrix transform, fz_pixmap *dest, const fz_irect *clip, fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_draw_device_with_bbox_proof(): auto_ctx=%p &transform=%p dest=%p clip=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &transform, dest, clip, cs);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_draw_device_with_bbox_proof(auto_ctx, transform, dest, clip, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_draw_device_with_options(). */
fz_device *new_draw_device_with_options(const fz_draw_options *options, fz_rect mediabox, fz_pixmap **pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_draw_device_with_options(): auto_ctx=%p options=%p &mediabox=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, options, &mediabox, pixmap);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_draw_device_with_options(auto_ctx, options, mediabox, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_draw_device_with_proof(). */
fz_device *new_draw_device_with_proof(fz_matrix transform, fz_pixmap *dest, fz_colorspace *proof_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_draw_device_with_proof(): auto_ctx=%p &transform=%p dest=%p proof_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &transform, dest, proof_cs);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_draw_device_with_proof(auto_ctx, transform, dest, proof_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_font_from_buffer(). */
fz_font *new_font_from_buffer(const char *name, fz_buffer *buffer, int index, int use_glyph_bbox)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_font_from_buffer(): auto_ctx=%p name=%s buffer=%p (long)index=%li (long)use_glyph_bbox=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, buffer, (long)index, (long)use_glyph_bbox);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_font_from_buffer(auto_ctx, name, buffer, index, use_glyph_bbox);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_font_from_file(). */
fz_font *new_font_from_file(const char *name, const char *path, int index, int use_glyph_bbox)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_font_from_file(): auto_ctx=%p name=%s path=%s (long)index=%li (long)use_glyph_bbox=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, path, (long)index, (long)use_glyph_bbox);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_font_from_file(auto_ctx, name, path, index, use_glyph_bbox);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_font_from_memory(). */
fz_font *new_font_from_memory(const char *name, const unsigned char *data, int len, int index, int use_glyph_bbox)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_font_from_memory(): auto_ctx=%p name=%s data=%p (long)len=%li (long)index=%li (long)use_glyph_bbox=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, data, (long)len, (long)index, (long)use_glyph_bbox);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_font_from_memory(auto_ctx, name, data, len, index, use_glyph_bbox);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_hash_table(). */
fz_hash_table *new_hash_table(int initialsize, int keylen, int lock, fz_hash_table_drop_fn *drop_val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_hash_table(): auto_ctx=%p (long)initialsize=%li (long)keylen=%li (long)lock=%li drop_val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)initialsize, (long)keylen, (long)lock, drop_val);
	}
	fz_hash_table * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_hash_table(auto_ctx, initialsize, keylen, lock, drop_val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_icc_colorspace(). */
fz_colorspace *new_icc_colorspace(enum fz_colorspace_type type, int flags, const char *name, fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_icc_colorspace(): auto_ctx=%p (long)type=%li (long)flags=%li name=%s buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)type, (long)flags, name, buf);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_icc_colorspace(auto_ctx, type, flags, name, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_from_buffer(). */
fz_image *new_image_from_buffer(fz_buffer *buffer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_from_buffer(): auto_ctx=%p buffer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buffer);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_from_buffer(auto_ctx, buffer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_from_compressed_buffer(). */
fz_image *new_image_from_compressed_buffer(int w, int h, int bpc, fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, float *decode, int *colorkey, fz_compressed_buffer *buffer, fz_image *mask)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_from_compressed_buffer(): auto_ctx=%p (long)w=%li (long)h=%li (long)bpc=%li colorspace=%p (long)xres=%li (long)yres=%li (long)interpolate=%li (long)imagemask=%li decode=%p colorkey=%p buffer=%p mask=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)w, (long)h, (long)bpc, colorspace, (long)xres, (long)yres, (long)interpolate, (long)imagemask, decode, colorkey, buffer, mask);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_from_compressed_buffer(auto_ctx, w, h, bpc, colorspace, xres, yres, interpolate, imagemask, decode, colorkey, buffer, mask);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_from_display_list(). */
fz_image *new_image_from_display_list(float w, float h, fz_display_list *list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_from_display_list(): auto_ctx=%p (long)w=%li (long)h=%li list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)w, (long)h, list);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_from_display_list(auto_ctx, w, h, list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_from_file(). */
fz_image *new_image_from_file(const char *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_from_file(): auto_ctx=%p path=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_from_file(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_from_pixmap(). */
fz_image *new_image_from_pixmap(fz_pixmap *pixmap, fz_image *mask)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_from_pixmap(): auto_ctx=%p pixmap=%p mask=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, mask);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_from_pixmap(auto_ctx, pixmap, mask);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_from_svg(). */
fz_image *new_image_from_svg(fz_buffer *buf, const char *base_uri, fz_archive *zip)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_from_svg(): auto_ctx=%p buf=%p base_uri=%s zip=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, base_uri, zip);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_from_svg(auto_ctx, buf, base_uri, zip);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_from_svg_xml(). */
fz_image *new_image_from_svg_xml(fz_xml *xml, const char *base_uri, fz_archive *zip)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_from_svg_xml(): auto_ctx=%p xml=%p base_uri=%s zip=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xml, base_uri, zip);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_from_svg_xml(auto_ctx, xml, base_uri, zip);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_image_of_size(). */
fz_image *new_image_of_size(int w, int h, int bpc, fz_colorspace *colorspace, int xres, int yres, int interpolate, int imagemask, float *decode, int *colorkey, fz_image *mask, size_t size, fz_image_get_pixmap_fn *get_pixmap, fz_image_get_size_fn *get_size, fz_drop_image_fn *drop)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_image_of_size(): auto_ctx=%p (long)w=%li (long)h=%li (long)bpc=%li colorspace=%p (long)xres=%li (long)yres=%li (long)interpolate=%li (long)imagemask=%li decode=%p colorkey=%p mask=%p (long)size=%li get_pixmap=%p get_size=%p drop=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)w, (long)h, (long)bpc, colorspace, (long)xres, (long)yres, (long)interpolate, (long)imagemask, decode, colorkey, mask, (long)size, get_pixmap, get_size, drop);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_image_of_size(auto_ctx, w, h, bpc, colorspace, xres, yres, interpolate, imagemask, decode, colorkey, mask, size, get_pixmap, get_size, drop);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_indexed_colorspace(). */
fz_colorspace *new_indexed_colorspace(fz_colorspace *base, int high, unsigned char *lookup)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_indexed_colorspace(): auto_ctx=%p base=%p (long)high=%li lookup=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, base, (long)high, lookup);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_indexed_colorspace(auto_ctx, base, high, lookup);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_layout(). */
fz_layout_block *new_layout()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_layout(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_layout_block * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_layout(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_link(). */
fz_link *new_link(fz_rect bbox, void *doc, const char *uri)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_link(): auto_ctx=%p &bbox=%p doc=%p uri=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &bbox, doc, uri);
	}
	fz_link * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_link(auto_ctx, bbox, doc, uri);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_list_device(). */
fz_device *new_list_device(fz_display_list *list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_list_device(): auto_ctx=%p list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_list_device(auto_ctx, list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_log_for_module(). */
fz_output *new_log_for_module(const char *module)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_log_for_module(): auto_ctx=%p module=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, module);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_log_for_module(auto_ctx, module);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_mono_pcl_band_writer(). */
fz_band_writer *new_mono_pcl_band_writer(fz_output *out, const fz_pcl_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_mono_pcl_band_writer(): auto_ctx=%p out=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_mono_pcl_band_writer(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_mono_pwg_band_writer(). */
fz_band_writer *new_mono_pwg_band_writer(fz_output *out, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_mono_pwg_band_writer(): auto_ctx=%p out=%p pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pwg);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_mono_pwg_band_writer(auto_ctx, out, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_outline(). */
fz_outline *new_outline()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_outline(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_outline * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_outline(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_output(). */
fz_output *new_output(int bufsiz, void *state, fz_output_write_fn *write, fz_output_close_fn *close, fz_output_drop_fn *drop)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_output(): auto_ctx=%p (long)bufsiz=%li state=%p write=%p close=%p drop=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)bufsiz, state, write, close, drop);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_output(auto_ctx, bufsiz, state, write, close, drop);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_output_with_buffer(). */
fz_output *new_output_with_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_output_with_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_output_with_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_output_with_path(). */
fz_output *new_output_with_path(const char *filename, int append)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_output_with_path(): auto_ctx=%p filename=%s (long)append=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename, (long)append);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_output_with_path(auto_ctx, filename, append);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_page_of_size(). */
fz_page *new_page_of_size(int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_page_of_size(): auto_ctx=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size);
	}
	fz_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_page_of_size(auto_ctx, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pam_band_writer(). */
fz_band_writer *new_pam_band_writer(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pam_band_writer(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pam_band_writer(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pam_pixmap_writer(). */
fz_document_writer *new_pam_pixmap_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pam_pixmap_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pam_pixmap_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_path(). */
fz_path *new_path()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_path(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_path * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_path(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pbm_band_writer(). */
fz_band_writer *new_pbm_band_writer(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pbm_band_writer(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pbm_band_writer(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pbm_pixmap_writer(). */
fz_document_writer *new_pbm_pixmap_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pbm_pixmap_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pbm_pixmap_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pcl_writer(). */
fz_document_writer *new_pcl_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pcl_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pcl_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pcl_writer_with_output(). */
fz_document_writer *new_pcl_writer_with_output(fz_output *out, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pcl_writer_with_output(): auto_ctx=%p out=%p options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pcl_writer_with_output(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pclm_band_writer(). */
fz_band_writer *new_pclm_band_writer(fz_output *out, const fz_pclm_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pclm_band_writer(): auto_ctx=%p out=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pclm_band_writer(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pclm_writer(). */
fz_document_writer *new_pclm_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pclm_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pclm_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pclm_writer_with_output(). */
fz_document_writer *new_pclm_writer_with_output(fz_output *out, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pclm_writer_with_output(): auto_ctx=%p out=%p options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pclm_writer_with_output(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pdf_writer(). */
fz_document_writer *new_pdf_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pdf_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pdf_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pdf_writer_with_output(). */
fz_document_writer *new_pdf_writer_with_output(fz_output *out, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pdf_writer_with_output(): auto_ctx=%p out=%p options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pdf_writer_with_output(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pgm_pixmap_writer(). */
fz_document_writer *new_pgm_pixmap_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pgm_pixmap_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pgm_pixmap_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap(). */
fz_pixmap *new_pixmap(fz_colorspace *cs, int w, int h, fz_separations *seps, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap(): auto_ctx=%p cs=%p (long)w=%li (long)h=%li seps=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs, (long)w, (long)h, seps, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap(auto_ctx, cs, w, h, seps, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_display_list(). */
fz_pixmap *new_pixmap_from_display_list(fz_display_list *list, fz_matrix ctm, fz_colorspace *cs, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_display_list(): auto_ctx=%p list=%p &ctm=%p cs=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list, &ctm, cs, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_display_list(auto_ctx, list, ctm, cs, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_display_list_with_separations(). */
fz_pixmap *new_pixmap_from_display_list_with_separations(fz_display_list *list, fz_matrix ctm, fz_colorspace *cs, fz_separations *seps, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_display_list_with_separations(): auto_ctx=%p list=%p &ctm=%p cs=%p seps=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list, &ctm, cs, seps, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_display_list_with_separations(auto_ctx, list, ctm, cs, seps, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_page(). */
fz_pixmap *new_pixmap_from_page(fz_page *page, fz_matrix ctm, fz_colorspace *cs, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_page(): auto_ctx=%p page=%p &ctm=%p cs=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, &ctm, cs, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_page(auto_ctx, page, ctm, cs, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_page_contents(). */
fz_pixmap *new_pixmap_from_page_contents(fz_page *page, fz_matrix ctm, fz_colorspace *cs, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_page_contents(): auto_ctx=%p page=%p &ctm=%p cs=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, &ctm, cs, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_page_contents(auto_ctx, page, ctm, cs, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_page_contents_with_separations(). */
fz_pixmap *new_pixmap_from_page_contents_with_separations(fz_page *page, fz_matrix ctm, fz_colorspace *cs, fz_separations *seps, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_page_contents_with_separations(): auto_ctx=%p page=%p &ctm=%p cs=%p seps=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, &ctm, cs, seps, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_page_contents_with_separations(auto_ctx, page, ctm, cs, seps, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_page_number(). */
fz_pixmap *new_pixmap_from_page_number(fz_document *doc, int number, fz_matrix ctm, fz_colorspace *cs, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_page_number(): auto_ctx=%p doc=%p (long)number=%li &ctm=%p cs=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number, &ctm, cs, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_page_number(auto_ctx, doc, number, ctm, cs, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_page_number_with_separations(). */
fz_pixmap *new_pixmap_from_page_number_with_separations(fz_document *doc, int number, fz_matrix ctm, fz_colorspace *cs, fz_separations *seps, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_page_number_with_separations(): auto_ctx=%p doc=%p (long)number=%li &ctm=%p cs=%p seps=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number, &ctm, cs, seps, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_page_number_with_separations(auto_ctx, doc, number, ctm, cs, seps, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_page_with_separations(). */
fz_pixmap *new_pixmap_from_page_with_separations(fz_page *page, fz_matrix ctm, fz_colorspace *cs, fz_separations *seps, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_page_with_separations(): auto_ctx=%p page=%p &ctm=%p cs=%p seps=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, &ctm, cs, seps, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_page_with_separations(auto_ctx, page, ctm, cs, seps, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_from_pixmap(). */
fz_pixmap *new_pixmap_from_pixmap(fz_pixmap *pixmap, const fz_irect *rect)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_from_pixmap(): auto_ctx=%p pixmap=%p rect=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, rect);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_from_pixmap(auto_ctx, pixmap, rect);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_with_bbox(). */
fz_pixmap *new_pixmap_with_bbox(fz_colorspace *colorspace, fz_irect bbox, fz_separations *seps, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_with_bbox(): auto_ctx=%p colorspace=%p &bbox=%p seps=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, colorspace, &bbox, seps, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_with_bbox(auto_ctx, colorspace, bbox, seps, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_with_bbox_and_data(). */
fz_pixmap *new_pixmap_with_bbox_and_data(fz_colorspace *colorspace, fz_irect rect, fz_separations *seps, int alpha, unsigned char *samples)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_with_bbox_and_data(): auto_ctx=%p colorspace=%p &rect=%p seps=%p (long)alpha=%li samples=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, colorspace, &rect, seps, (long)alpha, samples);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_with_bbox_and_data(auto_ctx, colorspace, rect, seps, alpha, samples);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_with_data(). */
fz_pixmap *new_pixmap_with_data(fz_colorspace *colorspace, int w, int h, fz_separations *seps, int alpha, int stride, unsigned char *samples)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_with_data(): auto_ctx=%p colorspace=%p (long)w=%li (long)h=%li seps=%p (long)alpha=%li (long)stride=%li samples=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, colorspace, (long)w, (long)h, seps, (long)alpha, (long)stride, samples);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_with_data(auto_ctx, colorspace, w, h, seps, alpha, stride, samples);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pixmap_writer(). */
fz_document_writer *new_pixmap_writer(const char *path, const char *options, const char *default_path, int n, void (*save)(fz_context *, fz_pixmap *, const char *))
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pixmap_writer(): auto_ctx=%p path=%s options=%s default_path=%s (long)n=%li save=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options, default_path, (long)n, save);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pixmap_writer(auto_ctx, path, options, default_path, n, save);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pkm_band_writer(). */
fz_band_writer *new_pkm_band_writer(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pkm_band_writer(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pkm_band_writer(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pkm_pixmap_writer(). */
fz_document_writer *new_pkm_pixmap_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pkm_pixmap_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pkm_pixmap_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_png_band_writer(). */
fz_band_writer *new_png_band_writer(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_png_band_writer(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_png_band_writer(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_png_pixmap_writer(). */
fz_document_writer *new_png_pixmap_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_png_pixmap_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_png_pixmap_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pnm_band_writer(). */
fz_band_writer *new_pnm_band_writer(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pnm_band_writer(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pnm_band_writer(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pnm_pixmap_writer(). */
fz_document_writer *new_pnm_pixmap_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pnm_pixmap_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pnm_pixmap_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pool(). */
fz_pool *new_pool()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pool(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_pool * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pool(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_ppm_pixmap_writer(). */
fz_document_writer *new_ppm_pixmap_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_ppm_pixmap_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_ppm_pixmap_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_ps_band_writer(). */
fz_band_writer *new_ps_band_writer(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_ps_band_writer(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_ps_band_writer(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_ps_writer(). */
fz_document_writer *new_ps_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_ps_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_ps_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_ps_writer_with_output(). */
fz_document_writer *new_ps_writer_with_output(fz_output *out, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_ps_writer_with_output(): auto_ctx=%p out=%p options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_ps_writer_with_output(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_psd_band_writer(). */
fz_band_writer *new_psd_band_writer(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_psd_band_writer(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_psd_band_writer(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pwg_band_writer(). */
fz_band_writer *new_pwg_band_writer(fz_output *out, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pwg_band_writer(): auto_ctx=%p out=%p pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pwg);
	}
	fz_band_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pwg_band_writer(auto_ctx, out, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pwg_writer(). */
fz_document_writer *new_pwg_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pwg_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pwg_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_pwg_writer_with_output(). */
fz_document_writer *new_pwg_writer_with_output(fz_output *out, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_pwg_writer_with_output(): auto_ctx=%p out=%p options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_pwg_writer_with_output(auto_ctx, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_rle_output(). */
fz_output *new_rle_output(fz_output *chain)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_rle_output(): auto_ctx=%p chain=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_rle_output(auto_ctx, chain);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_separations(). */
fz_separations *new_separations(int controllable)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_separations(): auto_ctx=%p (long)controllable=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)controllable);
	}
	fz_separations * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_separations(auto_ctx, controllable);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_stext_device(). */
fz_device *new_stext_device(fz_stext_page *page, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stext_device(): auto_ctx=%p page=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, options);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stext_device(auto_ctx, page, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_stext_page(). */
fz_stext_page *new_stext_page(fz_rect mediabox)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stext_page(): auto_ctx=%p &mediabox=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, &mediabox);
	}
	fz_stext_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stext_page(auto_ctx, mediabox);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_stext_page_from_display_list(). */
fz_stext_page *new_stext_page_from_display_list(fz_display_list *list, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stext_page_from_display_list(): auto_ctx=%p list=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list, options);
	}
	fz_stext_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stext_page_from_display_list(auto_ctx, list, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_stext_page_from_page(). */
fz_stext_page *new_stext_page_from_page(fz_page *page, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stext_page_from_page(): auto_ctx=%p page=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, options);
	}
	fz_stext_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stext_page_from_page(auto_ctx, page, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_stext_page_from_page_number(). */
fz_stext_page *new_stext_page_from_page_number(fz_document *doc, int number, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stext_page_from_page_number(): auto_ctx=%p doc=%p (long)number=%li options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number, options);
	}
	fz_stext_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stext_page_from_page_number(auto_ctx, doc, number, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_store_context(). */
void new_store_context(size_t max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_store_context(): auto_ctx=%p (long)max=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)max);
	}
	fz_try(auto_ctx) {
		::fz_new_store_context(auto_ctx, max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_new_stream(). */
fz_stream *new_stream(void *state, fz_stream_next_fn *next, fz_stream_drop_fn *drop)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stream(): auto_ctx=%p state=%p next=%p drop=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, state, next, drop);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stream(auto_ctx, state, next, drop);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_stroke_state(). */
fz_stroke_state *new_stroke_state()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stroke_state(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_stroke_state * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stroke_state(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_stroke_state_with_dash_len(). */
fz_stroke_state *new_stroke_state_with_dash_len(int len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_stroke_state_with_dash_len(): auto_ctx=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)len);
	}
	fz_stroke_state * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_stroke_state_with_dash_len(auto_ctx, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_svg_device(). */
fz_device *new_svg_device(fz_output *out, float page_width, float page_height, int text_format, int reuse_images)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_svg_device(): auto_ctx=%p out=%p (long)page_width=%li (long)page_height=%li (long)text_format=%li (long)reuse_images=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)page_width, (long)page_height, (long)text_format, (long)reuse_images);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_svg_device(auto_ctx, out, page_width, page_height, text_format, reuse_images);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_svg_device_with_id(). */
fz_device *new_svg_device_with_id(fz_output *out, float page_width, float page_height, int text_format, int reuse_images, int *id)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_svg_device_with_id(): auto_ctx=%p out=%p (long)page_width=%li (long)page_height=%li (long)text_format=%li (long)reuse_images=%li id=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)page_width, (long)page_height, (long)text_format, (long)reuse_images, id);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_svg_device_with_id(auto_ctx, out, page_width, page_height, text_format, reuse_images, id);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_svg_writer(). */
fz_document_writer *new_svg_writer(const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_svg_writer(): auto_ctx=%p path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_svg_writer(auto_ctx, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_test_device(). */
fz_device *new_test_device(int *is_color, float threshold, int options, fz_device *passthrough)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_test_device(): auto_ctx=%p is_color=%p (long)threshold=%li (long)options=%li passthrough=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, is_color, (long)threshold, (long)options, passthrough);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_test_device(auto_ctx, is_color, threshold, options, passthrough);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_text(). */
fz_text *new_text()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_text(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_text * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_text(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_text_writer(). */
fz_document_writer *new_text_writer(const char *format, const char *path, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_text_writer(): auto_ctx=%p format=%s path=%s options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, format, path, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_text_writer(auto_ctx, format, path, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_text_writer_with_output(). */
fz_document_writer *new_text_writer_with_output(const char *format, fz_output *out, const char *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_text_writer_with_output(): auto_ctx=%p format=%s out=%p options=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, format, out, options);
	}
	fz_document_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_text_writer_with_output(auto_ctx, format, out, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_trace_device(). */
fz_device *new_trace_device(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_trace_device(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_trace_device(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_type3_font(). */
fz_font *new_type3_font(const char *name, fz_matrix matrix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_type3_font(): auto_ctx=%p name=%s &matrix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name, &matrix);
	}
	fz_font * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_type3_font(auto_ctx, name, matrix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_xhtml_document_from_document(). */
fz_document *new_xhtml_document_from_document(fz_document *old_doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_xhtml_document_from_document(): auto_ctx=%p old_doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, old_doc);
	}
	fz_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_xhtml_document_from_document(auto_ctx, old_doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_zip_writer(). */
fz_zip_writer *new_zip_writer(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_zip_writer(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	fz_zip_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_zip_writer(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_new_zip_writer_with_output(). */
fz_zip_writer *new_zip_writer_with_output(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_new_zip_writer_with_output(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_zip_writer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_new_zip_writer_with_output(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_next_page(). */
fz_location next_page(fz_document *doc, fz_location loc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_next_page(): auto_ctx=%p doc=%p &loc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &loc);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_next_page(auto_ctx, doc, loc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_normalize_vector(). */
fz_point normalize_vector(fz_point p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_normalize_vector(): &p=%p\n", __FILE__, __LINE__, __FUNCTION__, &p);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_normalize_vector(p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_a85d(). */
fz_stream *open_a85d(fz_stream *chain)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_a85d(): auto_ctx=%p chain=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_a85d(auto_ctx, chain);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_accelerated_document(). */
fz_document *open_accelerated_document(const char *filename, const char *accel)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_accelerated_document(): auto_ctx=%p filename=%s accel=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename, accel);
	}
	fz_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_accelerated_document(auto_ctx, filename, accel);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_accelerated_document_with_stream(). */
fz_document *open_accelerated_document_with_stream(const char *magic, fz_stream *stream, fz_stream *accel)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_accelerated_document_with_stream(): auto_ctx=%p magic=%s stream=%p accel=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, magic, stream, accel);
	}
	fz_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_accelerated_document_with_stream(auto_ctx, magic, stream, accel);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_aesd(). */
fz_stream *open_aesd(fz_stream *chain, unsigned char *key, unsigned int keylen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_aesd(): auto_ctx=%p chain=%p key=%p (long)keylen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, key, (long)keylen);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_aesd(auto_ctx, chain, key, keylen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_ahxd(). */
fz_stream *open_ahxd(fz_stream *chain)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_ahxd(): auto_ctx=%p chain=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_ahxd(auto_ctx, chain);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_arc4(). */
fz_stream *open_arc4(fz_stream *chain, unsigned char *key, unsigned int keylen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_arc4(): auto_ctx=%p chain=%p key=%p (long)keylen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, key, (long)keylen);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_arc4(auto_ctx, chain, key, keylen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_archive(). */
fz_archive *open_archive(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_archive(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_archive(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_archive_entry(). */
fz_stream *open_archive_entry(fz_archive *arch, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_archive_entry(): auto_ctx=%p arch=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arch, name);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_archive_entry(auto_ctx, arch, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_archive_with_stream(). */
fz_archive *open_archive_with_stream(fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_archive_with_stream(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_archive_with_stream(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_buffer(). */
fz_stream *open_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_compressed_buffer(). */
fz_stream *open_compressed_buffer(fz_compressed_buffer *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_compressed_buffer(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_compressed_buffer(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_concat(). */
fz_stream *open_concat(int max, int pad)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_concat(): auto_ctx=%p (long)max=%li (long)pad=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)max, (long)pad);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_concat(auto_ctx, max, pad);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_dctd(). */
fz_stream *open_dctd(fz_stream *chain, int color_transform, int l2factor, fz_stream *jpegtables)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_dctd(): auto_ctx=%p chain=%p (long)color_transform=%li (long)l2factor=%li jpegtables=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)color_transform, (long)l2factor, jpegtables);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_dctd(auto_ctx, chain, color_transform, l2factor, jpegtables);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_directory(). */
fz_archive *open_directory(const char *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_directory(): auto_ctx=%p path=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_directory(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_document(). */
fz_document *open_document(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_document(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	fz_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_document(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_document_with_stream(). */
fz_document *open_document_with_stream(const char *magic, fz_stream *stream)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_document_with_stream(): auto_ctx=%p magic=%s stream=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, magic, stream);
	}
	fz_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_document_with_stream(auto_ctx, magic, stream);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_endstream_filter(). */
fz_stream *open_endstream_filter(fz_stream *chain, int len, int64_t offset)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_endstream_filter(): auto_ctx=%p chain=%p (long)len=%li (long)offset=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)len, (long)offset);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_endstream_filter(auto_ctx, chain, len, offset);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_faxd(). */
fz_stream *open_faxd(fz_stream *chain, int k, int end_of_line, int encoded_byte_align, int columns, int rows, int end_of_block, int black_is_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_faxd(): auto_ctx=%p chain=%p (long)k=%li (long)end_of_line=%li (long)encoded_byte_align=%li (long)columns=%li (long)rows=%li (long)end_of_block=%li (long)black_is_1=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)k, (long)end_of_line, (long)encoded_byte_align, (long)columns, (long)rows, (long)end_of_block, (long)black_is_1);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_faxd(auto_ctx, chain, k, end_of_line, encoded_byte_align, columns, rows, end_of_block, black_is_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_file(). */
fz_stream *open_file(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_file(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_file(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_file_ptr_no_close(). */
fz_stream *open_file_ptr_no_close(FILE *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_file_ptr_no_close(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_file_ptr_no_close(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_flated(). */
fz_stream *open_flated(fz_stream *chain, int window_bits)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_flated(): auto_ctx=%p chain=%p (long)window_bits=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)window_bits);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_flated(auto_ctx, chain, window_bits);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_image_decomp_stream(). */
fz_stream *open_image_decomp_stream(fz_stream *arg_1, fz_compression_params *arg_2, int *l2factor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_image_decomp_stream(): auto_ctx=%p arg_1=%p arg_2=%p l2factor=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1, arg_2, l2factor);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_image_decomp_stream(auto_ctx, arg_1, arg_2, l2factor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_image_decomp_stream_from_buffer(). */
fz_stream *open_image_decomp_stream_from_buffer(fz_compressed_buffer *arg_1, int *l2factor)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_image_decomp_stream_from_buffer(): auto_ctx=%p arg_1=%p l2factor=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1, l2factor);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_image_decomp_stream_from_buffer(auto_ctx, arg_1, l2factor);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_jbig2d(). */
fz_stream *open_jbig2d(fz_stream *chain, fz_jbig2_globals *globals)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_jbig2d(): auto_ctx=%p chain=%p globals=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, globals);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_jbig2d(auto_ctx, chain, globals);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_leecher(). */
fz_stream *open_leecher(fz_stream *chain, fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_leecher(): auto_ctx=%p chain=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, buf);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_leecher(auto_ctx, chain, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_lzwd(). */
fz_stream *open_lzwd(fz_stream *chain, int early_change, int min_bits, int reverse_bits, int old_tiff)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_lzwd(): auto_ctx=%p chain=%p (long)early_change=%li (long)min_bits=%li (long)reverse_bits=%li (long)old_tiff=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)early_change, (long)min_bits, (long)reverse_bits, (long)old_tiff);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_lzwd(auto_ctx, chain, early_change, min_bits, reverse_bits, old_tiff);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_memory(). */
fz_stream *open_memory(const unsigned char *data, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_memory(): auto_ctx=%p data=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, data, (long)len);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_memory(auto_ctx, data, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_null_filter(). */
fz_stream *open_null_filter(fz_stream *chain, int len, int64_t offset)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_null_filter(): auto_ctx=%p chain=%p (long)len=%li (long)offset=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)len, (long)offset);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_null_filter(auto_ctx, chain, len, offset);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_predict(). */
fz_stream *open_predict(fz_stream *chain, int predictor, int columns, int colors, int bpc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_predict(): auto_ctx=%p chain=%p (long)predictor=%li (long)columns=%li (long)colors=%li (long)bpc=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)predictor, (long)columns, (long)colors, (long)bpc);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_predict(auto_ctx, chain, predictor, columns, colors, bpc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_range_filter(). */
fz_stream *open_range_filter(fz_stream *chain, fz_range *ranges, int nranges)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_range_filter(): auto_ctx=%p chain=%p ranges=%p (long)nranges=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, ranges, (long)nranges);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_range_filter(auto_ctx, chain, ranges, nranges);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_rld(). */
fz_stream *open_rld(fz_stream *chain)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_rld(): auto_ctx=%p chain=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_rld(auto_ctx, chain);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_sgilog16(). */
fz_stream *open_sgilog16(fz_stream *chain, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_sgilog16(): auto_ctx=%p chain=%p (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)w);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_sgilog16(auto_ctx, chain, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_sgilog24(). */
fz_stream *open_sgilog24(fz_stream *chain, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_sgilog24(): auto_ctx=%p chain=%p (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)w);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_sgilog24(auto_ctx, chain, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_sgilog32(). */
fz_stream *open_sgilog32(fz_stream *chain, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_sgilog32(): auto_ctx=%p chain=%p (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)w);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_sgilog32(auto_ctx, chain, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_tar_archive(). */
fz_archive *open_tar_archive(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_tar_archive(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_tar_archive(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_tar_archive_with_stream(). */
fz_archive *open_tar_archive_with_stream(fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_tar_archive_with_stream(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_tar_archive_with_stream(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_thunder(). */
fz_stream *open_thunder(fz_stream *chain, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_thunder(): auto_ctx=%p chain=%p (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, (long)w);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_thunder(auto_ctx, chain, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_zip_archive(). */
fz_archive *open_zip_archive(const char *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_zip_archive(): auto_ctx=%p path=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_zip_archive(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_open_zip_archive_with_stream(). */
fz_archive *open_zip_archive_with_stream(fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_open_zip_archive_with_stream(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	fz_archive * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_open_zip_archive_with_stream(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_option_eq(). */
int option_eq(const char *a, const char *b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_option_eq(): a=%s b=%s\n", __FILE__, __LINE__, __FUNCTION__, a, b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_option_eq(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_outline_glyph(). */
fz_path *outline_glyph(fz_font *font, int gid, fz_matrix ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_outline_glyph(): auto_ctx=%p font=%p (long)gid=%li &ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)gid, &ctm);
	}
	fz_path * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_outline_glyph(auto_ctx, font, gid, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_output_accelerator(). */
void output_accelerator(fz_document *doc, fz_output *accel)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_output_accelerator(): auto_ctx=%p doc=%p accel=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, accel);
	}
	fz_try(auto_ctx) {
		::fz_output_accelerator(auto_ctx, doc, accel);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_output_supports_stream(). */
int output_supports_stream(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_output_supports_stream(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_output_supports_stream(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pack_path(). */
size_t pack_path(uint8_t *pack, size_t max, const fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pack_path(): auto_ctx=%p pack=%p (long)max=%li path=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pack, (long)max, path);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pack_path(auto_ctx, pack, max, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_packed_path_size(). */
int packed_path_size(const fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_packed_path_size(): path=%p\n", __FILE__, __LINE__, __FUNCTION__, path);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_packed_path_size(path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_page_number_from_location(). */
int page_number_from_location(fz_document *doc, fz_location loc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_page_number_from_location(): auto_ctx=%p doc=%p &loc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &loc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_page_number_from_location(auto_ctx, doc, loc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_page_presentation(). */
fz_transition *page_presentation(fz_page *page, fz_transition *transition, float *duration)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_page_presentation(): auto_ctx=%p page=%p transition=%p duration=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, transition, duration);
	}
	fz_transition * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_page_presentation(auto_ctx, page, transition, duration);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_page_separations(). */
fz_separations *page_separations(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_page_separations(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_separations * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_page_separations(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_page_uses_overprint(). */
int page_uses_overprint(fz_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_page_uses_overprint(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_page_uses_overprint(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_paint_shade(). */
void paint_shade(fz_shade *shade, fz_colorspace *override_cs, fz_matrix ctm, fz_pixmap *dest, fz_color_params color_params, fz_irect bbox, const fz_overprint *eop)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_paint_shade(): auto_ctx=%p shade=%p override_cs=%p &ctm=%p dest=%p &color_params=%p &bbox=%p eop=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shade, override_cs, &ctm, dest, &color_params, &bbox, eop);
	}
	fz_try(auto_ctx) {
		::fz_paint_shade(auto_ctx, shade, override_cs, ctm, dest, color_params, bbox, eop);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_parse_draw_options(). */
fz_draw_options *parse_draw_options(fz_draw_options *options, const char *string)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_parse_draw_options(): auto_ctx=%p options=%p string=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, options, string);
	}
	fz_draw_options * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_parse_draw_options(auto_ctx, options, string);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_parse_page_range(). */
const char *parse_page_range(const char *s, int *a, int *b, int n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_parse_page_range(): auto_ctx=%p s=%s a=%p b=%p (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, s, a, b, (long)n);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_parse_page_range(auto_ctx, s, a, b, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_parse_pcl_options(). */
fz_pcl_options *parse_pcl_options(fz_pcl_options *opts, const char *args)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_parse_pcl_options(): auto_ctx=%p opts=%p args=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, opts, args);
	}
	fz_pcl_options * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_parse_pcl_options(auto_ctx, opts, args);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_parse_pclm_options(). */
fz_pclm_options *parse_pclm_options(fz_pclm_options *opts, const char *args)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_parse_pclm_options(): auto_ctx=%p opts=%p args=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, opts, args);
	}
	fz_pclm_options * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_parse_pclm_options(auto_ctx, opts, args);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_parse_stext_options(). */
fz_stext_options *parse_stext_options(fz_stext_options *opts, const char *string)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_parse_stext_options(): auto_ctx=%p opts=%p string=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, opts, string);
	}
	fz_stext_options * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_parse_stext_options(auto_ctx, opts, string);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_parse_xml(). */
fz_xml_doc *parse_xml(fz_buffer *buf, int preserve_white, int for_html)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_parse_xml(): auto_ctx=%p buf=%p (long)preserve_white=%li (long)for_html=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)preserve_white, (long)for_html);
	}
	fz_xml_doc * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_parse_xml(auto_ctx, buf, preserve_white, for_html);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pcl_preset(). */
void pcl_preset(fz_pcl_options *opts, const char *preset)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pcl_preset(): auto_ctx=%p opts=%p preset=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, opts, preset);
	}
	fz_try(auto_ctx) {
		::fz_pcl_preset(auto_ctx, opts, preset);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_peek_byte(). */
int peek_byte(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_peek_byte(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_peek_byte(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_alpha(). */
int pixmap_alpha(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_alpha(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_alpha(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_bbox(). */
fz_irect pixmap_bbox(const fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_bbox(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_bbox(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_colorants(). */
int pixmap_colorants(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_colorants(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_colorants(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_colorspace(). */
fz_colorspace *pixmap_colorspace(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_colorspace(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_colorspace(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_components(). */
int pixmap_components(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_components(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_components(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_height(). */
int pixmap_height(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_height(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_height(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_image_tile(). */
fz_pixmap *pixmap_image_tile(fz_pixmap_image *cimg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_image_tile(): auto_ctx=%p cimg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cimg);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_image_tile(auto_ctx, cimg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_samples(). */
unsigned char *pixmap_samples(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_samples(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_samples(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_spots(). */
int pixmap_spots(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_spots(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_spots(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_stride(). */
int pixmap_stride(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_stride(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_stride(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_width(). */
int pixmap_width(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_width(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_width(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_x(). */
int pixmap_x(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_x(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_x(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pixmap_y(). */
int pixmap_y(fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pixmap_y(): auto_ctx=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pixmap_y(auto_ctx, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pool_alloc(). */
void *pool_alloc(fz_pool *pool, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pool_alloc(): auto_ctx=%p pool=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pool, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pool_alloc(auto_ctx, pool, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pool_size(). */
size_t pool_size(fz_pool *pool)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pool_size(): auto_ctx=%p pool=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pool);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pool_size(auto_ctx, pool);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pool_strdup(). */
char *pool_strdup(fz_pool *pool, const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pool_strdup(): auto_ctx=%p pool=%p s=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pool, s);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pool_strdup(auto_ctx, pool, s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pop_clip(). */
void pop_clip(fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pop_clip(): auto_ctx=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev);
	}
	fz_try(auto_ctx) {
		::fz_pop_clip(auto_ctx, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_post_scale(). */
fz_matrix post_scale(fz_matrix m, float sx, float sy)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_post_scale(): &m=%p (long)sx=%li (long)sy=%li\n", __FILE__, __LINE__, __FUNCTION__, &m, (long)sx, (long)sy);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_post_scale(m, sx, sy);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pre_rotate(). */
fz_matrix pre_rotate(fz_matrix m, float degrees)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pre_rotate(): &m=%p (long)degrees=%li\n", __FILE__, __LINE__, __FUNCTION__, &m, (long)degrees);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pre_rotate(m, degrees);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pre_scale(). */
fz_matrix pre_scale(fz_matrix m, float sx, float sy)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pre_scale(): &m=%p (long)sx=%li (long)sy=%li\n", __FILE__, __LINE__, __FUNCTION__, &m, (long)sx, (long)sy);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pre_scale(m, sx, sy);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pre_shear(). */
fz_matrix pre_shear(fz_matrix m, float sx, float sy)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pre_shear(): &m=%p (long)sx=%li (long)sy=%li\n", __FILE__, __LINE__, __FUNCTION__, &m, (long)sx, (long)sy);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pre_shear(m, sx, sy);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_pre_translate(). */
fz_matrix pre_translate(fz_matrix m, float tx, float ty)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_pre_translate(): &m=%p (long)tx=%li (long)ty=%li\n", __FILE__, __LINE__, __FUNCTION__, &m, (long)tx, (long)ty);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_pre_translate(m, tx, ty);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_prepare_t3_glyph(). */
void prepare_t3_glyph(fz_font *font, int gid)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_prepare_t3_glyph(): auto_ctx=%p font=%p (long)gid=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)gid);
	}
	fz_try(auto_ctx) {
		::fz_prepare_t3_glyph(auto_ctx, font, gid);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_previous_page(). */
fz_location previous_page(fz_document *doc, fz_location loc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_previous_page(): auto_ctx=%p doc=%p &loc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &loc);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_previous_page(auto_ctx, doc, loc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_print_stext_header_as_html(). */
void print_stext_header_as_html(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_header_as_html(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_header_as_html(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_print_stext_header_as_xhtml(). */
void print_stext_header_as_xhtml(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_header_as_xhtml(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_header_as_xhtml(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_print_stext_page_as_html(). */
void print_stext_page_as_html(fz_output *out, fz_stext_page *page, int id)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_page_as_html(): auto_ctx=%p out=%p page=%p (long)id=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, page, (long)id);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_page_as_html(auto_ctx, out, page, id);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_print_stext_page_as_text(). */
void print_stext_page_as_text(fz_output *out, fz_stext_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_page_as_text(): auto_ctx=%p out=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, page);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_page_as_text(auto_ctx, out, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_print_stext_page_as_xhtml(). */
void print_stext_page_as_xhtml(fz_output *out, fz_stext_page *page, int id)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_page_as_xhtml(): auto_ctx=%p out=%p page=%p (long)id=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, page, (long)id);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_page_as_xhtml(auto_ctx, out, page, id);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_print_stext_page_as_xml(). */
void print_stext_page_as_xml(fz_output *out, fz_stext_page *page, int id)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_page_as_xml(): auto_ctx=%p out=%p page=%p (long)id=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, page, (long)id);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_page_as_xml(auto_ctx, out, page, id);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_print_stext_trailer_as_html(). */
void print_stext_trailer_as_html(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_trailer_as_html(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_trailer_as_html(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_print_stext_trailer_as_xhtml(). */
void print_stext_trailer_as_xhtml(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_print_stext_trailer_as_xhtml(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_print_stext_trailer_as_xhtml(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_process_shade(). */
void process_shade(fz_shade *shade, fz_matrix ctm, fz_rect scissor, fz_shade_prepare_fn *prepare, fz_shade_process_fn *process, void *process_arg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_process_shade(): auto_ctx=%p shade=%p &ctm=%p &scissor=%p prepare=%p process=%p process_arg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shade, &ctm, &scissor, prepare, process, process_arg);
	}
	fz_try(auto_ctx) {
		::fz_process_shade(auto_ctx, shade, ctm, scissor, prepare, process, process_arg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_purge_glyph_cache(). */
void purge_glyph_cache()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_purge_glyph_cache(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_purge_glyph_cache(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_push_try(). */
sigjmp_buf *push_try()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_push_try(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	sigjmp_buf * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_push_try(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_quad_from_rect(). */
fz_quad quad_from_rect(fz_rect r)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_quad_from_rect(): &r=%p\n", __FILE__, __LINE__, __FUNCTION__, &r);
	}
	fz_quad ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_quad_from_rect(r);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_quadto(). */
void quadto(fz_path *path, float x0, float y0, float x1, float y1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_quadto(): auto_ctx=%p path=%p (long)x0=%li (long)y0=%li (long)x1=%li (long)y1=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)x0, (long)y0, (long)x1, (long)y1);
	}
	fz_try(auto_ctx) {
		::fz_quadto(auto_ctx, path, x0, y0, x1, y1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_read(). */
size_t read(fz_stream *stm, unsigned char *data, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read(): auto_ctx=%p stm=%p data=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, data, (long)len);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read(auto_ctx, stm, data, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_all(). */
fz_buffer *read_all(fz_stream *stm, size_t initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_all(): auto_ctx=%p stm=%p (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, (long)initial);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_all(auto_ctx, stm, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_archive_entry(). */
fz_buffer *read_archive_entry(fz_archive *arch, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_archive_entry(): auto_ctx=%p arch=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arch, name);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_archive_entry(auto_ctx, arch, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_best(). */
fz_buffer *read_best(fz_stream *stm, size_t initial, int *truncated)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_best(): auto_ctx=%p stm=%p (long)initial=%li truncated=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, (long)initial, truncated);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_best(auto_ctx, stm, initial, truncated);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_bits(). */
unsigned int read_bits(fz_stream *stm, int n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_bits(): auto_ctx=%p stm=%p (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, (long)n);
	}
	unsigned int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_bits(auto_ctx, stm, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_byte(). */
int read_byte(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_byte(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_byte(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_file(). */
fz_buffer *read_file(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_file(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_file(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_float(). */
float read_float(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_float(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_float(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_float_le(). */
float read_float_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_float_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_float_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_int16(). */
int16_t read_int16(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_int16(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int16_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_int16(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_int16_le(). */
int16_t read_int16_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_int16_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int16_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_int16_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_int32(). */
int32_t read_int32(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_int32(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int32_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_int32(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_int32_le(). */
int32_t read_int32_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_int32_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int32_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_int32_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_int64(). */
int64_t read_int64(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_int64(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_int64(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_int64_le(). */
int64_t read_int64_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_int64_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_int64_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_line(). */
char *read_line(fz_stream *stm, char *buf, size_t max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_line(): auto_ctx=%p stm=%p buf=%s (long)max=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, buf, (long)max);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_line(auto_ctx, stm, buf, max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_rbits(). */
unsigned int read_rbits(fz_stream *stm, int n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_rbits(): auto_ctx=%p stm=%p (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, (long)n);
	}
	unsigned int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_rbits(auto_ctx, stm, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_string(). */
void read_string(fz_stream *stm, char *buffer, int len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_string(): auto_ctx=%p stm=%p buffer=%s (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, buffer, (long)len);
	}
	fz_try(auto_ctx) {
		::fz_read_string(auto_ctx, stm, buffer, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_read_uint16(). */
uint16_t read_uint16(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint16(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint16_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint16(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_uint16_le(). */
uint16_t read_uint16_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint16_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint16_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint16_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_uint24(). */
uint32_t read_uint24(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint24(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint32_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint24(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_uint24_le(). */
uint32_t read_uint24_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint24_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint32_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint24_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_uint32(). */
uint32_t read_uint32(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint32(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint32_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint32(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_uint32_le(). */
uint32_t read_uint32_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint32_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint32_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint32_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_uint64(). */
uint64_t read_uint64(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint64(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint64(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_read_uint64_le(). */
uint64_t read_uint64_le(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_read_uint64_le(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	uint64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_read_uint64_le(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_realloc(). */
void *realloc(void *p, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_realloc(): auto_ctx=%p p=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_realloc(auto_ctx, p, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_realloc_no_throw(). */
void *realloc_no_throw(void *p, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_realloc_no_throw(): auto_ctx=%p p=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, p, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_realloc_no_throw(auto_ctx, p, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_realpath(). */
char *realpath(const char *path, char *resolved_path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_realpath(): path=%s resolved_path=%s\n", __FILE__, __LINE__, __FUNCTION__, path, resolved_path);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_realpath(path, resolved_path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_recognize_document(). */
const fz_document_handler *recognize_document(const char *magic)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_recognize_document(): auto_ctx=%p magic=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, magic);
	}
	const fz_document_handler * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_recognize_document(auto_ctx, magic);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_recognize_image_format(). */
int recognize_image_format(unsigned char p[8])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_recognize_image_format(): auto_ctx=%p (long)p=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)p);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_recognize_image_format(auto_ctx, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_rect_from_irect(). */
fz_rect rect_from_irect(fz_irect bbox)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_rect_from_irect(): &bbox=%p\n", __FILE__, __LINE__, __FUNCTION__, &bbox);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_rect_from_irect(bbox);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_rect_from_quad(). */
fz_rect rect_from_quad(fz_quad q)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_rect_from_quad(): &q=%p\n", __FILE__, __LINE__, __FUNCTION__, &q);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_rect_from_quad(q);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_rectto(). */
void rectto(fz_path *path, float x0, float y0, float x1, float y1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_rectto(): auto_ctx=%p path=%p (long)x0=%li (long)y0=%li (long)x1=%li (long)y1=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, (long)x0, (long)y0, (long)x1, (long)y1);
	}
	fz_try(auto_ctx) {
		::fz_rectto(auto_ctx, path, x0, y0, x1, y1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_register_document_handler(). */
void register_document_handler(const fz_document_handler *handler)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_register_document_handler(): auto_ctx=%p handler=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, handler);
	}
	fz_try(auto_ctx) {
		::fz_register_document_handler(auto_ctx, handler);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_register_document_handlers(). */
void register_document_handlers()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_register_document_handlers(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_register_document_handlers(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_remove_item(). */
void remove_item(fz_store_drop_fn *drop, void *key, const fz_store_type *type)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_remove_item(): auto_ctx=%p drop=%p key=%p type=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, drop, key, type);
	}
	fz_try(auto_ctx) {
		::fz_remove_item(auto_ctx, drop, key, type);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_render_flags(). */
void render_flags(fz_device *dev, int set, int clear)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_render_flags(): auto_ctx=%p dev=%p (long)set=%li (long)clear=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, (long)set, (long)clear);
	}
	fz_try(auto_ctx) {
		::fz_render_flags(auto_ctx, dev, set, clear);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_render_glyph_pixmap(). */
fz_pixmap *render_glyph_pixmap(fz_font *font, int gid, fz_matrix *ctm, const fz_irect *scissor, int aa)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_render_glyph_pixmap(): auto_ctx=%p font=%p (long)gid=%li ctm=%p scissor=%p (long)aa=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)gid, ctm, scissor, (long)aa);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_render_glyph_pixmap(auto_ctx, font, gid, ctm, scissor, aa);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_render_t3_glyph_direct(). */
void render_t3_glyph_direct(fz_device *dev, fz_font *font, int gid, fz_matrix trm, void *gstate, fz_default_colorspaces *def_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_render_t3_glyph_direct(): auto_ctx=%p dev=%p font=%p (long)gid=%li &trm=%p gstate=%p def_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, font, (long)gid, &trm, gstate, def_cs);
	}
	fz_try(auto_ctx) {
		::fz_render_t3_glyph_direct(auto_ctx, dev, font, gid, trm, gstate, def_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_rendering_intent_name(). */
const char *rendering_intent_name(int ri)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_rendering_intent_name(): (long)ri=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)ri);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_rendering_intent_name(ri);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_resize_buffer(). */
void resize_buffer(fz_buffer *buf, size_t capacity)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_resize_buffer(): auto_ctx=%p buf=%p (long)capacity=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)capacity);
	}
	fz_try(auto_ctx) {
		::fz_resize_buffer(auto_ctx, buf, capacity);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_resolve_link(). */
fz_location resolve_link(fz_document *doc, const char *uri, float *xp, float *yp)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_resolve_link(): auto_ctx=%p doc=%p uri=%s xp=%p yp=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, uri, xp, yp);
	}
	fz_location ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_resolve_link(auto_ctx, doc, uri, xp, yp);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_rethrow(). */
void rethrow()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_rethrow(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_try(auto_ctx) {
		::fz_rethrow(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_rethrow_if(). */
void rethrow_if(int errcode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_rethrow_if(): auto_ctx=%p (long)errcode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)errcode);
	}
	fz_try(auto_ctx) {
		::fz_rethrow_if(auto_ctx, errcode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_rotate(). */
fz_matrix rotate(float degrees)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_rotate(): (long)degrees=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)degrees);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_rotate(degrees);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_round_rect(). */
fz_irect round_rect(fz_rect rect)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_round_rect(): &rect=%p\n", __FILE__, __LINE__, __FUNCTION__, &rect);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_round_rect(rect);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_run_display_list(). */
void run_display_list(fz_display_list *list, fz_device *dev, fz_matrix ctm, fz_rect scissor, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_run_display_list(): auto_ctx=%p list=%p dev=%p &ctm=%p &scissor=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list, dev, &ctm, &scissor, cookie);
	}
	fz_try(auto_ctx) {
		::fz_run_display_list(auto_ctx, list, dev, ctm, scissor, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_run_page(). */
void run_page(fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_run_page(): auto_ctx=%p page=%p dev=%p &transform=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &transform, cookie);
	}
	fz_try(auto_ctx) {
		::fz_run_page(auto_ctx, page, dev, transform, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_run_page_annots(). */
void run_page_annots(fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_run_page_annots(): auto_ctx=%p page=%p dev=%p &transform=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &transform, cookie);
	}
	fz_try(auto_ctx) {
		::fz_run_page_annots(auto_ctx, page, dev, transform, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_run_page_contents(). */
void run_page_contents(fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_run_page_contents(): auto_ctx=%p page=%p dev=%p &transform=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &transform, cookie);
	}
	fz_try(auto_ctx) {
		::fz_run_page_contents(auto_ctx, page, dev, transform, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_run_page_widgets(). */
void run_page_widgets(fz_page *page, fz_device *dev, fz_matrix transform, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_run_page_widgets(): auto_ctx=%p page=%p dev=%p &transform=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &transform, cookie);
	}
	fz_try(auto_ctx) {
		::fz_run_page_widgets(auto_ctx, page, dev, transform, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_run_t3_glyph(). */
void run_t3_glyph(fz_font *font, int gid, fz_matrix trm, struct fz_device *dev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_run_t3_glyph(): auto_ctx=%p font=%p (long)gid=%li &trm=%p dev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)gid, &trm, dev);
	}
	fz_try(auto_ctx) {
		::fz_run_t3_glyph(auto_ctx, font, gid, trm, dev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_runelen(). */
int runelen(int rune)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_runelen(): (long)rune=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)rune);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_runelen(rune);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_runetochar(). */
int runetochar(char *str, int rune)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_runetochar(): str=%s (long)rune=%li\n", __FILE__, __LINE__, __FUNCTION__, str, (long)rune);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_runetochar(str, rune);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_save_accelerator(). */
void save_accelerator(fz_document *doc, const char *accel)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_accelerator(): auto_ctx=%p doc=%p accel=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, accel);
	}
	fz_try(auto_ctx) {
		::fz_save_accelerator(auto_ctx, doc, accel);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_bitmap_as_pbm(). */
void save_bitmap_as_pbm(fz_bitmap *bitmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_bitmap_as_pbm(): auto_ctx=%p bitmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, bitmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_bitmap_as_pbm(auto_ctx, bitmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_bitmap_as_pcl(). */
void save_bitmap_as_pcl(fz_bitmap *bitmap, char *filename, int append, const fz_pcl_options *pcl)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_bitmap_as_pcl(): auto_ctx=%p bitmap=%p filename=%s (long)append=%li pcl=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, bitmap, filename, (long)append, pcl);
	}
	fz_try(auto_ctx) {
		::fz_save_bitmap_as_pcl(auto_ctx, bitmap, filename, append, pcl);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_bitmap_as_pkm(). */
void save_bitmap_as_pkm(fz_bitmap *bitmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_bitmap_as_pkm(): auto_ctx=%p bitmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, bitmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_bitmap_as_pkm(auto_ctx, bitmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_bitmap_as_pwg(). */
void save_bitmap_as_pwg(fz_bitmap *bitmap, char *filename, int append, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_bitmap_as_pwg(): auto_ctx=%p bitmap=%p filename=%s (long)append=%li pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, bitmap, filename, (long)append, pwg);
	}
	fz_try(auto_ctx) {
		::fz_save_bitmap_as_pwg(auto_ctx, bitmap, filename, append, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_buffer(). */
void save_buffer(fz_buffer *buf, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_buffer(): auto_ctx=%p buf=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_buffer(auto_ctx, buf, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_pam(). */
void save_pixmap_as_pam(fz_pixmap *pixmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_pam(): auto_ctx=%p pixmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_pam(auto_ctx, pixmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_pbm(). */
void save_pixmap_as_pbm(fz_pixmap *pixmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_pbm(): auto_ctx=%p pixmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_pbm(auto_ctx, pixmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_pcl(). */
void save_pixmap_as_pcl(fz_pixmap *pixmap, char *filename, int append, const fz_pcl_options *pcl)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_pcl(): auto_ctx=%p pixmap=%p filename=%s (long)append=%li pcl=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename, (long)append, pcl);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_pcl(auto_ctx, pixmap, filename, append, pcl);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_pclm(). */
void save_pixmap_as_pclm(fz_pixmap *pixmap, char *filename, int append, const fz_pclm_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_pclm(): auto_ctx=%p pixmap=%p filename=%s (long)append=%li options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename, (long)append, options);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_pclm(auto_ctx, pixmap, filename, append, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_pkm(). */
void save_pixmap_as_pkm(fz_pixmap *pixmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_pkm(): auto_ctx=%p pixmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_pkm(auto_ctx, pixmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_png(). */
void save_pixmap_as_png(fz_pixmap *pixmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_png(): auto_ctx=%p pixmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_png(auto_ctx, pixmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_pnm(). */
void save_pixmap_as_pnm(fz_pixmap *pixmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_pnm(): auto_ctx=%p pixmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_pnm(auto_ctx, pixmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_ps(). */
void save_pixmap_as_ps(fz_pixmap *pixmap, char *filename, int append)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_ps(): auto_ctx=%p pixmap=%p filename=%s (long)append=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename, (long)append);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_ps(auto_ctx, pixmap, filename, append);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_psd(). */
void save_pixmap_as_psd(fz_pixmap *pixmap, const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_psd(): auto_ctx=%p pixmap=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_psd(auto_ctx, pixmap, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_save_pixmap_as_pwg(). */
void save_pixmap_as_pwg(fz_pixmap *pixmap, char *filename, int append, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_save_pixmap_as_pwg(): auto_ctx=%p pixmap=%p filename=%s (long)append=%li pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pixmap, filename, (long)append, pwg);
	}
	fz_try(auto_ctx) {
		::fz_save_pixmap_as_pwg(auto_ctx, pixmap, filename, append, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_scale(). */
fz_matrix scale(float sx, float sy)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_scale(): (long)sx=%li (long)sy=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)sx, (long)sy);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_scale(sx, sy);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_search_chapter_page_number(). */
int search_chapter_page_number(fz_document *doc, int chapter, int page, const char *needle, fz_quad *hit_bbox, int hit_max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_search_chapter_page_number(): auto_ctx=%p doc=%p (long)chapter=%li (long)page=%li needle=%s hit_bbox=%p (long)hit_max=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)chapter, (long)page, needle, hit_bbox, (long)hit_max);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_search_chapter_page_number(auto_ctx, doc, chapter, page, needle, hit_bbox, hit_max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_search_display_list(). */
int search_display_list(fz_display_list *list, const char *needle, fz_quad *hit_bbox, int hit_max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_search_display_list(): auto_ctx=%p list=%p needle=%s hit_bbox=%p (long)hit_max=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, list, needle, hit_bbox, (long)hit_max);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_search_display_list(auto_ctx, list, needle, hit_bbox, hit_max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_search_page(). */
int search_page(fz_page *page, const char *needle, fz_quad *hit_bbox, int hit_max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_search_page(): auto_ctx=%p page=%p needle=%s hit_bbox=%p (long)hit_max=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, needle, hit_bbox, (long)hit_max);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_search_page(auto_ctx, page, needle, hit_bbox, hit_max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_search_page_number(). */
int search_page_number(fz_document *doc, int number, const char *needle, fz_quad *hit_bbox, int hit_max)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_search_page_number(): auto_ctx=%p doc=%p (long)number=%li needle=%s hit_bbox=%p (long)hit_max=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number, needle, hit_bbox, (long)hit_max);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_search_page_number(auto_ctx, doc, number, needle, hit_bbox, hit_max);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_search_stext_page(). */
int search_stext_page(fz_stext_page *text, const char *needle, fz_quad *quads, int max_quads)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_search_stext_page(): auto_ctx=%p text=%p needle=%s quads=%p (long)max_quads=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text, needle, quads, (long)max_quads);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_search_stext_page(auto_ctx, text, needle, quads, max_quads);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_seek(). */
void seek(fz_stream *stm, int64_t offset, int whence)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_seek(): auto_ctx=%p stm=%p (long)offset=%li (long)whence=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, (long)offset, (long)whence);
	}
	fz_try(auto_ctx) {
		::fz_seek(auto_ctx, stm, offset, whence);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_seek_output(). */
void seek_output(fz_output *out, int64_t off, int whence)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_seek_output(): auto_ctx=%p out=%p (long)off=%li (long)whence=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)off, (long)whence);
	}
	fz_try(auto_ctx) {
		::fz_seek_output(auto_ctx, out, off, whence);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_separation_current_behavior(). */
fz_separation_behavior separation_current_behavior(const fz_separations *sep, int separation)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_separation_current_behavior(): auto_ctx=%p sep=%p (long)separation=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep, (long)separation);
	}
	fz_separation_behavior ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_separation_current_behavior(auto_ctx, sep, separation);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_separation_equivalent(). */
void separation_equivalent(const fz_separations *seps, int idx, fz_colorspace *dst_cs, float *dst_color, fz_colorspace *prf, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_separation_equivalent(): auto_ctx=%p seps=%p (long)idx=%li dst_cs=%p dst_color=%p prf=%p &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, seps, (long)idx, dst_cs, dst_color, prf, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_separation_equivalent(auto_ctx, seps, idx, dst_cs, dst_color, prf, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_separation_name(). */
const char *separation_name(const fz_separations *sep, int separation)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_separation_name(): auto_ctx=%p sep=%p (long)separation=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep, (long)separation);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_separation_name(auto_ctx, sep, separation);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_set_aa_level(). */
void set_aa_level(int bits)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_aa_level(): auto_ctx=%p (long)bits=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)bits);
	}
	fz_try(auto_ctx) {
		::fz_set_aa_level(auto_ctx, bits);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_compressed_image_buffer(). */
void set_compressed_image_buffer(fz_compressed_image *cimg, fz_compressed_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_compressed_image_buffer(): auto_ctx=%p cimg=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cimg, buf);
	}
	fz_try(auto_ctx) {
		::fz_set_compressed_image_buffer(auto_ctx, cimg, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_default_cmyk(). */
void set_default_cmyk(fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_default_cmyk(): auto_ctx=%p default_cs=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs, cs);
	}
	fz_try(auto_ctx) {
		::fz_set_default_cmyk(auto_ctx, default_cs, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_default_colorspaces(). */
void set_default_colorspaces(fz_device *dev, fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_default_colorspaces(): auto_ctx=%p dev=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, default_cs);
	}
	fz_try(auto_ctx) {
		::fz_set_default_colorspaces(auto_ctx, dev, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_default_gray(). */
void set_default_gray(fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_default_gray(): auto_ctx=%p default_cs=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs, cs);
	}
	fz_try(auto_ctx) {
		::fz_set_default_gray(auto_ctx, default_cs, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_default_output_intent(). */
void set_default_output_intent(fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_default_output_intent(): auto_ctx=%p default_cs=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs, cs);
	}
	fz_try(auto_ctx) {
		::fz_set_default_output_intent(auto_ctx, default_cs, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_default_rgb(). */
void set_default_rgb(fz_default_colorspaces *default_cs, fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_default_rgb(): auto_ctx=%p default_cs=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, default_cs, cs);
	}
	fz_try(auto_ctx) {
		::fz_set_default_rgb(auto_ctx, default_cs, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_error_callback(). */
void set_error_callback(void (*print)(void *, const char *), void *user)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_error_callback(): auto_ctx=%p print=%p user=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, print, user);
	}
	fz_try(auto_ctx) {
		::fz_set_error_callback(auto_ctx, print, user);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_font_bbox(). */
void set_font_bbox(fz_font *font, float xmin, float ymin, float xmax, float ymax)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_font_bbox(): auto_ctx=%p font=%p (long)xmin=%li (long)ymin=%li (long)xmax=%li (long)ymax=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)xmin, (long)ymin, (long)xmax, (long)ymax);
	}
	fz_try(auto_ctx) {
		::fz_set_font_bbox(auto_ctx, font, xmin, ymin, xmax, ymax);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_graphics_aa_level(). */
void set_graphics_aa_level(int bits)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_graphics_aa_level(): auto_ctx=%p (long)bits=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)bits);
	}
	fz_try(auto_ctx) {
		::fz_set_graphics_aa_level(auto_ctx, bits);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_graphics_min_line_width(). */
void set_graphics_min_line_width(float min_line_width)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_graphics_min_line_width(): auto_ctx=%p (long)min_line_width=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)min_line_width);
	}
	fz_try(auto_ctx) {
		::fz_set_graphics_min_line_width(auto_ctx, min_line_width);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_pixmap_image_tile(). */
void set_pixmap_image_tile(fz_pixmap_image *cimg, fz_pixmap *pix)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_pixmap_image_tile(): auto_ctx=%p cimg=%p pix=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cimg, pix);
	}
	fz_try(auto_ctx) {
		::fz_set_pixmap_image_tile(auto_ctx, cimg, pix);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_pixmap_resolution(). */
void set_pixmap_resolution(fz_pixmap *pix, int xres, int yres)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_pixmap_resolution(): auto_ctx=%p pix=%p (long)xres=%li (long)yres=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, (long)xres, (long)yres);
	}
	fz_try(auto_ctx) {
		::fz_set_pixmap_resolution(auto_ctx, pix, xres, yres);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_separation_behavior(). */
void set_separation_behavior(fz_separations *sep, int separation, fz_separation_behavior behavior)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_separation_behavior(): auto_ctx=%p sep=%p (long)separation=%li (long)behavior=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, sep, (long)separation, (long)behavior);
	}
	fz_try(auto_ctx) {
		::fz_set_separation_behavior(auto_ctx, sep, separation, behavior);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_text_aa_level(). */
void set_text_aa_level(int bits)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_text_aa_level(): auto_ctx=%p (long)bits=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)bits);
	}
	fz_try(auto_ctx) {
		::fz_set_text_aa_level(auto_ctx, bits);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_use_document_css(). */
void set_use_document_css(int use)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_use_document_css(): auto_ctx=%p (long)use=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)use);
	}
	fz_try(auto_ctx) {
		::fz_set_use_document_css(auto_ctx, use);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_user_context(). */
void set_user_context(void *user)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_user_context(): auto_ctx=%p user=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, user);
	}
	fz_try(auto_ctx) {
		::fz_set_user_context(auto_ctx, user);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_user_css(). */
void set_user_css(const char *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_user_css(): auto_ctx=%p text=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text);
	}
	fz_try(auto_ctx) {
		::fz_set_user_css(auto_ctx, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_set_warning_callback(). */
void set_warning_callback(void (*print)(void *, const char *), void *user)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_set_warning_callback(): auto_ctx=%p print=%p user=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, print, user);
	}
	fz_try(auto_ctx) {
		::fz_set_warning_callback(auto_ctx, print, user);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha256_final(). */
void sha256_final(fz_sha256 *state, unsigned char digest[32])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha256_final(): state=%p (long)digest=%li\n", __FILE__, __LINE__, __FUNCTION__, state, (long)digest);
	}
	fz_try(auto_ctx) {
		::fz_sha256_final(state, digest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha256_init(). */
void sha256_init(fz_sha256 *state)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha256_init(): state=%p\n", __FILE__, __LINE__, __FUNCTION__, state);
	}
	fz_try(auto_ctx) {
		::fz_sha256_init(state);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha256_update(). */
void sha256_update(fz_sha256 *state, const unsigned char *input, size_t inlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha256_update(): state=%p input=%p (long)inlen=%li\n", __FILE__, __LINE__, __FUNCTION__, state, input, (long)inlen);
	}
	fz_try(auto_ctx) {
		::fz_sha256_update(state, input, inlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha384_final(). */
void sha384_final(fz_sha384 *state, unsigned char digest[64])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha384_final(): state=%p (long)digest=%li\n", __FILE__, __LINE__, __FUNCTION__, state, (long)digest);
	}
	fz_try(auto_ctx) {
		::fz_sha384_final(state, digest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha384_init(). */
void sha384_init(fz_sha384 *state)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha384_init(): state=%p\n", __FILE__, __LINE__, __FUNCTION__, state);
	}
	fz_try(auto_ctx) {
		::fz_sha384_init(state);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha384_update(). */
void sha384_update(fz_sha384 *state, const unsigned char *input, size_t inlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha384_update(): state=%p input=%p (long)inlen=%li\n", __FILE__, __LINE__, __FUNCTION__, state, input, (long)inlen);
	}
	fz_try(auto_ctx) {
		::fz_sha384_update(state, input, inlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha512_final(). */
void sha512_final(fz_sha512 *state, unsigned char digest[64])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha512_final(): state=%p (long)digest=%li\n", __FILE__, __LINE__, __FUNCTION__, state, (long)digest);
	}
	fz_try(auto_ctx) {
		::fz_sha512_final(state, digest);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha512_init(). */
void sha512_init(fz_sha512 *state)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha512_init(): state=%p\n", __FILE__, __LINE__, __FUNCTION__, state);
	}
	fz_try(auto_ctx) {
		::fz_sha512_init(state);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_sha512_update(). */
void sha512_update(fz_sha512 *state, const unsigned char *input, size_t inlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sha512_update(): state=%p input=%p (long)inlen=%li\n", __FILE__, __LINE__, __FUNCTION__, state, input, (long)inlen);
	}
	fz_try(auto_ctx) {
		::fz_sha512_update(state, input, inlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_shear(). */
fz_matrix shear(float sx, float sy)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_shear(): (long)sx=%li (long)sy=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)sx, (long)sy);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_shear(sx, sy);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_show_glyph(). */
void show_glyph(fz_text *text, fz_font *font, fz_matrix trm, int glyph, int unicode, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_show_glyph(): auto_ctx=%p text=%p font=%p &trm=%p (long)glyph=%li (long)unicode=%li (long)wmode=%li (long)bidi_level=%li (long)markup_dir=%li (long)language=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text, font, &trm, (long)glyph, (long)unicode, (long)wmode, (long)bidi_level, (long)markup_dir, (long)language);
	}
	fz_try(auto_ctx) {
		::fz_show_glyph(auto_ctx, text, font, trm, glyph, unicode, wmode, bidi_level, markup_dir, language);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_show_string(). */
fz_matrix show_string(fz_text *text, fz_font *font, fz_matrix trm, const char *s, int wmode, int bidi_level, fz_bidi_direction markup_dir, fz_text_language language)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_show_string(): auto_ctx=%p text=%p font=%p &trm=%p s=%s (long)wmode=%li (long)bidi_level=%li (long)markup_dir=%li (long)language=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, text, font, &trm, s, (long)wmode, (long)bidi_level, (long)markup_dir, (long)language);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_show_string(auto_ctx, text, font, trm, s, wmode, bidi_level, markup_dir, language);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_shrink_store(). */
int shrink_store(unsigned int percent)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_shrink_store(): auto_ctx=%p (long)percent=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)percent);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_shrink_store(auto_ctx, percent);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_skip(). */
size_t skip(fz_stream *stm, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_skip(): auto_ctx=%p stm=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm, (long)len);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_skip(auto_ctx, stm, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_snap_selection(). */
fz_quad snap_selection(fz_stext_page *page, fz_point *ap, fz_point *bp, int mode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_snap_selection(): auto_ctx=%p page=%p ap=%p bp=%p (long)mode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, ap, bp, (long)mode);
	}
	fz_quad ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_snap_selection(auto_ctx, page, ap, bp, mode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_stderr(). */
fz_output *stderr()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_stderr(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_stderr(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_stdout(). */
fz_output *stdout()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_stdout(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	fz_output * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_stdout(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_store_item(). */
void *store_item(void *key, void *val, size_t itemsize, const fz_store_type *type)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_store_item(): auto_ctx=%p key=%p val=%p (long)itemsize=%li type=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, key, val, (long)itemsize, type);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_store_item(auto_ctx, key, val, itemsize, type);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_store_scavenge(). */
int store_scavenge(size_t size, int *phase)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_store_scavenge(): auto_ctx=%p (long)size=%li phase=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size, phase);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_store_scavenge(auto_ctx, size, phase);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_store_scavenge_external(). */
int store_scavenge_external(size_t size, int *phase)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_store_scavenge_external(): auto_ctx=%p (long)size=%li phase=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size, phase);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_store_scavenge_external(auto_ctx, size, phase);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_strcasecmp(). */
int strcasecmp(const char *a, const char *b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strcasecmp(): a=%s b=%s\n", __FILE__, __LINE__, __FUNCTION__, a, b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strcasecmp(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_strdup(). */
char *strdup(const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strdup(): auto_ctx=%p s=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, s);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strdup(auto_ctx, s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_stream_from_output(). */
fz_stream *stream_from_output(fz_output *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_stream_from_output(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_stream_from_output(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_string_from_buffer(). */
const char *string_from_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_string_from_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_string_from_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_string_from_text_language(). */
char *string_from_text_language(char str[8], fz_text_language lang)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_string_from_text_language(): (long)str=%li (long)lang=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)str, (long)lang);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_string_from_text_language(str, lang);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_strlcat(). */
size_t strlcat(char *dst, const char *src, size_t n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strlcat(): dst=%s src=%s (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, dst, src, (long)n);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strlcat(dst, src, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_strlcpy(). */
size_t strlcpy(char *dst, const char *src, size_t n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strlcpy(): dst=%s src=%s (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, dst, src, (long)n);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strlcpy(dst, src, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_strncasecmp(). */
int strncasecmp(const char *a, const char *b, size_t n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strncasecmp(): a=%s b=%s (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, a, b, (long)n);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strncasecmp(a, b, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_strnlen(). */
size_t strnlen(const char *s, size_t maxlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strnlen(): s=%s (long)maxlen=%li\n", __FILE__, __LINE__, __FUNCTION__, s, (long)maxlen);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strnlen(s, maxlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_stroke_path(). */
void stroke_path(fz_device *dev, const fz_path *path, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_stroke_path(): auto_ctx=%p dev=%p path=%p stroke=%p &ctm=%p colorspace=%p color=%p (long)alpha=%li &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, path, stroke, &ctm, colorspace, color, (long)alpha, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_stroke_path(auto_ctx, dev, path, stroke, ctm, colorspace, color, alpha, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_stroke_text(). */
void stroke_text(fz_device *dev, const fz_text *text, const fz_stroke_state *stroke, fz_matrix ctm, fz_colorspace *colorspace, const float *color, float alpha, fz_color_params color_params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_stroke_text(): auto_ctx=%p dev=%p text=%p stroke=%p &ctm=%p colorspace=%p color=%p (long)alpha=%li &color_params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, text, stroke, &ctm, colorspace, color, (long)alpha, &color_params);
	}
	fz_try(auto_ctx) {
		::fz_stroke_text(auto_ctx, dev, text, stroke, ctm, colorspace, color, alpha, color_params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_strsep(). */
char *strsep(char **stringp, const char *delim)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strsep(): stringp=%p delim=%s\n", __FILE__, __LINE__, __FUNCTION__, stringp, delim);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strsep(stringp, delim);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_strtof(). */
float strtof(const char *s, char **es)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_strtof(): s=%s es=%p\n", __FILE__, __LINE__, __FUNCTION__, s, es);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_strtof(s, es);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_subpixel_adjust(). */
float subpixel_adjust(fz_matrix *ctm, fz_matrix *subpix_ctm, unsigned char *qe, unsigned char *qf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_subpixel_adjust(): auto_ctx=%p ctm=%p subpix_ctm=%p qe=%p qf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ctm, subpix_ctm, qe, qf);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_subpixel_adjust(auto_ctx, ctm, subpix_ctm, qe, qf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_sync_bits(). */
void sync_bits(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_sync_bits(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	fz_try(auto_ctx) {
		::fz_sync_bits(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_tell(). */
int64_t tell(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_tell(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_tell(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_tell_output(). */
int64_t tell_output(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_tell_output(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_tell_output(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_terminate_buffer(). */
void terminate_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_terminate_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_try(auto_ctx) {
		::fz_terminate_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_text_aa_level(). */
int text_aa_level()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_text_aa_level(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_text_aa_level(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_text_language_from_string(). */
fz_text_language text_language_from_string(const char *str)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_text_language_from_string(): str=%s\n", __FILE__, __LINE__, __FUNCTION__, str);
	}
	fz_text_language ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_text_language_from_string(str);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_tint_pixmap(). */
void tint_pixmap(fz_pixmap *pix, int black, int white)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_tint_pixmap(): auto_ctx=%p pix=%p (long)black=%li (long)white=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pix, (long)black, (long)white);
	}
	fz_try(auto_ctx) {
		::fz_tint_pixmap(auto_ctx, pix, black, white);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_transform_page(). */
fz_matrix transform_page(fz_rect mediabox, float resolution, float rotate)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_transform_page(): &mediabox=%p (long)resolution=%li (long)rotate=%li\n", __FILE__, __LINE__, __FUNCTION__, &mediabox, (long)resolution, (long)rotate);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_transform_page(mediabox, resolution, rotate);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_transform_path(). */
void transform_path(fz_path *path, fz_matrix transform)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_transform_path(): auto_ctx=%p path=%p &transform=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, &transform);
	}
	fz_try(auto_ctx) {
		::fz_transform_path(auto_ctx, path, transform);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_transform_point(). */
fz_point transform_point(fz_point point, fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_transform_point(): &point=%p &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &point, &m);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_transform_point(point, m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_transform_point_xy(). */
fz_point transform_point_xy(float x, float y, fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_transform_point_xy(): (long)x=%li (long)y=%li &m=%p\n", __FILE__, __LINE__, __FUNCTION__, (long)x, (long)y, &m);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_transform_point_xy(x, y, m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_transform_quad(). */
fz_quad transform_quad(fz_quad q, fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_transform_quad(): &q=%p &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &q, &m);
	}
	fz_quad ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_transform_quad(q, m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_transform_rect(). */
fz_rect transform_rect(fz_rect rect, fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_transform_rect(): &rect=%p &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &rect, &m);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_transform_rect(rect, m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_transform_vector(). */
fz_point transform_vector(fz_point vector, fz_matrix m)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_transform_vector(): &vector=%p &m=%p\n", __FILE__, __LINE__, __FUNCTION__, &vector, &m);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_transform_vector(vector, m);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_translate(). */
fz_matrix translate(float tx, float ty)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_translate(): (long)tx=%li (long)ty=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)tx, (long)ty);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_translate(tx, ty);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_translate_irect(). */
fz_irect translate_irect(fz_irect a, int xoff, int yoff)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_translate_irect(): &a=%p (long)xoff=%li (long)yoff=%li\n", __FILE__, __LINE__, __FUNCTION__, &a, (long)xoff, (long)yoff);
	}
	fz_irect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_translate_irect(a, xoff, yoff);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_translate_rect(). */
fz_rect translate_rect(fz_rect a, float xoff, float yoff)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_translate_rect(): &a=%p (long)xoff=%li (long)yoff=%li\n", __FILE__, __LINE__, __FUNCTION__, &a, (long)xoff, (long)yoff);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_translate_rect(a, xoff, yoff);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_tree_insert(). */
fz_tree *tree_insert(fz_tree *root, const char *key, void *value)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_tree_insert(): auto_ctx=%p root=%p key=%s value=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, root, key, value);
	}
	fz_tree * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_tree_insert(auto_ctx, root, key, value);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_tree_lookup(). */
void *tree_lookup(fz_tree *node, const char *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_tree_lookup(): auto_ctx=%p node=%p key=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, node, key);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_tree_lookup(auto_ctx, node, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_trim_buffer(). */
void trim_buffer(fz_buffer *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_trim_buffer(): auto_ctx=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf);
	}
	fz_try(auto_ctx) {
		::fz_trim_buffer(auto_ctx, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_trim_path(). */
void trim_path(fz_path *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_trim_path(): auto_ctx=%p path=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path);
	}
	fz_try(auto_ctx) {
		::fz_trim_path(auto_ctx, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_truncate_output(). */
void truncate_output(fz_output *arg_1)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_truncate_output(): auto_ctx=%p arg_1=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1);
	}
	fz_try(auto_ctx) {
		::fz_truncate_output(auto_ctx, arg_1);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_try_invert_matrix(). */
int try_invert_matrix(fz_matrix *inv, fz_matrix src)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_try_invert_matrix(): inv=%p &src=%p\n", __FILE__, __LINE__, __FUNCTION__, inv, &src);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_try_invert_matrix(inv, src);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_tune_image_decode(). */
void tune_image_decode(fz_tune_image_decode_fn *image_decode, void *arg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_tune_image_decode(): auto_ctx=%p image_decode=%p arg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image_decode, arg);
	}
	fz_try(auto_ctx) {
		::fz_tune_image_decode(auto_ctx, image_decode, arg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_tune_image_scale(). */
void tune_image_scale(fz_tune_image_scale_fn *image_scale, void *arg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_tune_image_scale(): auto_ctx=%p image_scale=%p arg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, image_scale, arg);
	}
	fz_try(auto_ctx) {
		::fz_tune_image_scale(auto_ctx, image_scale, arg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_unicode_from_glyph_name(). */
int unicode_from_glyph_name(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_unicode_from_glyph_name(): name=%s\n", __FILE__, __LINE__, __FUNCTION__, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_unicode_from_glyph_name(name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_unicode_from_glyph_name_strict(). */
int unicode_from_glyph_name_strict(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_unicode_from_glyph_name_strict(): name=%s\n", __FILE__, __LINE__, __FUNCTION__, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_unicode_from_glyph_name_strict(name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_union_rect(). */
fz_rect union_rect(fz_rect a, fz_rect b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_union_rect(): &a=%p &b=%p\n", __FILE__, __LINE__, __FUNCTION__, &a, &b);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_union_rect(a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_unlock(). */
void unlock(int lock)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_unlock(): auto_ctx=%p (long)lock=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)lock);
	}
	fz_try(auto_ctx) {
		::fz_unlock(auto_ctx, lock);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_unread_byte(). */
void unread_byte(fz_stream *stm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_unread_byte(): auto_ctx=%p stm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, stm);
	}
	fz_try(auto_ctx) {
		::fz_unread_byte(auto_ctx, stm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_unshare_stroke_state(). */
fz_stroke_state *unshare_stroke_state(fz_stroke_state *shared)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_unshare_stroke_state(): auto_ctx=%p shared=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shared);
	}
	fz_stroke_state * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_unshare_stroke_state(auto_ctx, shared);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_unshare_stroke_state_with_dash_len(). */
fz_stroke_state *unshare_stroke_state_with_dash_len(fz_stroke_state *shared, int len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_unshare_stroke_state_with_dash_len(): auto_ctx=%p shared=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, shared, (long)len);
	}
	fz_stroke_state * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_unshare_stroke_state_with_dash_len(auto_ctx, shared, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_urldecode(). */
char *urldecode(char *url)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_urldecode(): url=%s\n", __FILE__, __LINE__, __FUNCTION__, url);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_urldecode(url);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_use_document_css(). */
int use_document_css()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_use_document_css(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_use_document_css(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_user_context(). */
void *user_context()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_user_context(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_user_context(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_user_css(). */
const char *user_css()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_user_css(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_user_css(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_utflen(). */
int utflen(const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_utflen(): s=%s\n", __FILE__, __LINE__, __FUNCTION__, s);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_utflen(s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_var_imp(). */
void var_imp(void *arg_0)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_var_imp(): arg_0=%p\n", __FILE__, __LINE__, __FUNCTION__, arg_0);
	}
	fz_try(auto_ctx) {
		::fz_var_imp(arg_0);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_vsnprintf(). */
size_t vsnprintf(char *buffer, size_t space, const char *fmt, va_list args)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_vsnprintf(): buffer=%s (long)space=%li fmt=%s (long)args=%li\n", __FILE__, __LINE__, __FUNCTION__, buffer, (long)space, fmt, (long)args);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_vsnprintf(buffer, space, fmt, args);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_vthrow(). */
void vthrow(int errcode, const char *arg_2, va_list ap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_vthrow(): auto_ctx=%p (long)errcode=%li arg_2=%s (long)ap=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)errcode, arg_2, (long)ap);
	}
	fz_try(auto_ctx) {
		::fz_vthrow(auto_ctx, errcode, arg_2, ap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_vwarn(). */
void vwarn(const char *fmt, va_list ap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_vwarn(): auto_ctx=%p fmt=%s (long)ap=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fmt, (long)ap);
	}
	fz_try(auto_ctx) {
		::fz_vwarn(auto_ctx, fmt, ap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_walk_path(). */
void walk_path(const fz_path *path, const fz_path_walker *walker, void *arg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_walk_path(): auto_ctx=%p path=%p walker=%p arg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, path, walker, arg);
	}
	fz_try(auto_ctx) {
		::fz_walk_path(auto_ctx, path, walker, arg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_windows_1250_from_unicode(). */
int windows_1250_from_unicode(int u)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_windows_1250_from_unicode(): (long)u=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)u);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_windows_1250_from_unicode(u);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_windows_1251_from_unicode(). */
int windows_1251_from_unicode(int u)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_windows_1251_from_unicode(): (long)u=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)u);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_windows_1251_from_unicode(u);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_windows_1252_from_unicode(). */
int windows_1252_from_unicode(int u)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_windows_1252_from_unicode(): (long)u=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)u);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_windows_1252_from_unicode(u);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_write_band(). */
void write_band(fz_band_writer *writer, int stride, int band_height, const unsigned char *samples)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_band(): auto_ctx=%p writer=%p (long)stride=%li (long)band_height=%li samples=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, writer, (long)stride, (long)band_height, samples);
	}
	fz_try(auto_ctx) {
		::fz_write_band(auto_ctx, writer, stride, band_height, samples);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_base64(). */
void write_base64(fz_output *out, const unsigned char *data, size_t size, int newline)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_base64(): auto_ctx=%p out=%p data=%p (long)size=%li (long)newline=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, data, (long)size, (long)newline);
	}
	fz_try(auto_ctx) {
		::fz_write_base64(auto_ctx, out, data, size, newline);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_base64_buffer(). */
void write_base64_buffer(fz_output *out, fz_buffer *data, int newline)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_base64_buffer(): auto_ctx=%p out=%p data=%p (long)newline=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, data, (long)newline);
	}
	fz_try(auto_ctx) {
		::fz_write_base64_buffer(auto_ctx, out, data, newline);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_bitmap_as_pbm(). */
void write_bitmap_as_pbm(fz_output *out, fz_bitmap *bitmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_bitmap_as_pbm(): auto_ctx=%p out=%p bitmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, bitmap);
	}
	fz_try(auto_ctx) {
		::fz_write_bitmap_as_pbm(auto_ctx, out, bitmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_bitmap_as_pcl(). */
void write_bitmap_as_pcl(fz_output *out, const fz_bitmap *bitmap, const fz_pcl_options *pcl)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_bitmap_as_pcl(): auto_ctx=%p out=%p bitmap=%p pcl=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, bitmap, pcl);
	}
	fz_try(auto_ctx) {
		::fz_write_bitmap_as_pcl(auto_ctx, out, bitmap, pcl);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_bitmap_as_pkm(). */
void write_bitmap_as_pkm(fz_output *out, fz_bitmap *bitmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_bitmap_as_pkm(): auto_ctx=%p out=%p bitmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, bitmap);
	}
	fz_try(auto_ctx) {
		::fz_write_bitmap_as_pkm(auto_ctx, out, bitmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_bitmap_as_pwg(). */
void write_bitmap_as_pwg(fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_bitmap_as_pwg(): auto_ctx=%p out=%p bitmap=%p pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, bitmap, pwg);
	}
	fz_try(auto_ctx) {
		::fz_write_bitmap_as_pwg(auto_ctx, out, bitmap, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_bitmap_as_pwg_page(). */
void write_bitmap_as_pwg_page(fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_bitmap_as_pwg_page(): auto_ctx=%p out=%p bitmap=%p pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, bitmap, pwg);
	}
	fz_try(auto_ctx) {
		::fz_write_bitmap_as_pwg_page(auto_ctx, out, bitmap, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_byte(). */
void write_byte(fz_output *out, unsigned char x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_byte(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_byte(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_char(). */
void write_char(fz_output *out, char x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_char(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_char(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_data(). */
void write_data(fz_output *out, const void *data, size_t size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_data(): auto_ctx=%p out=%p data=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, data, (long)size);
	}
	fz_try(auto_ctx) {
		::fz_write_data(auto_ctx, out, data, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_float_be(). */
void write_float_be(fz_output *out, float f)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_float_be(): auto_ctx=%p out=%p (long)f=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)f);
	}
	fz_try(auto_ctx) {
		::fz_write_float_be(auto_ctx, out, f);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_float_le(). */
void write_float_le(fz_output *out, float f)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_float_le(): auto_ctx=%p out=%p (long)f=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)f);
	}
	fz_try(auto_ctx) {
		::fz_write_float_le(auto_ctx, out, f);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_header(). */
void write_header(fz_band_writer *writer, int w, int h, int n, int alpha, int xres, int yres, int pagenum, fz_colorspace *cs, fz_separations *seps)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_header(): auto_ctx=%p writer=%p (long)w=%li (long)h=%li (long)n=%li (long)alpha=%li (long)xres=%li (long)yres=%li (long)pagenum=%li cs=%p seps=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, writer, (long)w, (long)h, (long)n, (long)alpha, (long)xres, (long)yres, (long)pagenum, cs, seps);
	}
	fz_try(auto_ctx) {
		::fz_write_header(auto_ctx, writer, w, h, n, alpha, xres, yres, pagenum, cs, seps);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_image_as_data_uri(). */
void write_image_as_data_uri(fz_output *out, fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_image_as_data_uri(): auto_ctx=%p out=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, image);
	}
	fz_try(auto_ctx) {
		::fz_write_image_as_data_uri(auto_ctx, out, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_int16_be(). */
void write_int16_be(fz_output *out, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_int16_be(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_int16_be(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_int16_le(). */
void write_int16_le(fz_output *out, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_int16_le(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_int16_le(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_int32_be(). */
void write_int32_be(fz_output *out, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_int32_be(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_int32_be(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_int32_le(). */
void write_int32_le(fz_output *out, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_int32_le(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_int32_le(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_data_uri(). */
void write_pixmap_as_data_uri(fz_output *out, fz_pixmap *pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_data_uri(): auto_ctx=%p out=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_data_uri(auto_ctx, out, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_pam(). */
void write_pixmap_as_pam(fz_output *out, fz_pixmap *pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_pam(): auto_ctx=%p out=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_pam(auto_ctx, out, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_pcl(). */
void write_pixmap_as_pcl(fz_output *out, const fz_pixmap *pixmap, const fz_pcl_options *pcl)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_pcl(): auto_ctx=%p out=%p pixmap=%p pcl=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap, pcl);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_pcl(auto_ctx, out, pixmap, pcl);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_pclm(). */
void write_pixmap_as_pclm(fz_output *out, const fz_pixmap *pixmap, const fz_pclm_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_pclm(): auto_ctx=%p out=%p pixmap=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap, options);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_pclm(auto_ctx, out, pixmap, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_png(). */
void write_pixmap_as_png(fz_output *out, const fz_pixmap *pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_png(): auto_ctx=%p out=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_png(auto_ctx, out, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_pnm(). */
void write_pixmap_as_pnm(fz_output *out, fz_pixmap *pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_pnm(): auto_ctx=%p out=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_pnm(auto_ctx, out, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_ps(). */
void write_pixmap_as_ps(fz_output *out, const fz_pixmap *pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_ps(): auto_ctx=%p out=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_ps(auto_ctx, out, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_psd(). */
void write_pixmap_as_psd(fz_output *out, const fz_pixmap *pixmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_psd(): auto_ctx=%p out=%p pixmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_psd(auto_ctx, out, pixmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_pwg(). */
void write_pixmap_as_pwg(fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_pwg(): auto_ctx=%p out=%p pixmap=%p pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap, pwg);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_pwg(auto_ctx, out, pixmap, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pixmap_as_pwg_page(). */
void write_pixmap_as_pwg_page(fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pixmap_as_pwg_page(): auto_ctx=%p out=%p pixmap=%p pwg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, pixmap, pwg);
	}
	fz_try(auto_ctx) {
		::fz_write_pixmap_as_pwg_page(auto_ctx, out, pixmap, pwg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_ps_file_header(). */
void write_ps_file_header(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_ps_file_header(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_write_ps_file_header(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_ps_file_trailer(). */
void write_ps_file_trailer(fz_output *out, int pages)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_ps_file_trailer(): auto_ctx=%p out=%p (long)pages=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)pages);
	}
	fz_try(auto_ctx) {
		::fz_write_ps_file_trailer(auto_ctx, out, pages);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_pwg_file_header(). */
void write_pwg_file_header(fz_output *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_pwg_file_header(): auto_ctx=%p out=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out);
	}
	fz_try(auto_ctx) {
		::fz_write_pwg_file_header(auto_ctx, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_rune(). */
void write_rune(fz_output *out, int rune)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_rune(): auto_ctx=%p out=%p (long)rune=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)rune);
	}
	fz_try(auto_ctx) {
		::fz_write_rune(auto_ctx, out, rune);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_string(). */
void write_string(fz_output *out, const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_string(): auto_ctx=%p out=%p s=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, s);
	}
	fz_try(auto_ctx) {
		::fz_write_string(auto_ctx, out, s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_uint16_be(). */
void write_uint16_be(fz_output *out, unsigned int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_uint16_be(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_uint16_be(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_uint16_le(). */
void write_uint16_le(fz_output *out, unsigned int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_uint16_le(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_uint16_le(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_uint32_be(). */
void write_uint32_be(fz_output *out, unsigned int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_uint32_be(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_uint32_be(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_uint32_le(). */
void write_uint32_le(fz_output *out, unsigned int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_uint32_le(): auto_ctx=%p out=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)x);
	}
	fz_try(auto_ctx) {
		::fz_write_uint32_le(auto_ctx, out, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_vprintf(). */
void write_vprintf(fz_output *out, const char *fmt, va_list ap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_vprintf(): auto_ctx=%p out=%p fmt=%s (long)ap=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, fmt, (long)ap);
	}
	fz_try(auto_ctx) {
		::fz_write_vprintf(auto_ctx, out, fmt, ap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_write_zip_entry(). */
void write_zip_entry(fz_zip_writer *zip, const char *name, fz_buffer *buf, int compress)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_write_zip_entry(): auto_ctx=%p zip=%p name=%s buf=%p (long)compress=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, zip, name, buf, (long)compress);
	}
	fz_try(auto_ctx) {
		::fz_write_zip_entry(auto_ctx, zip, name, buf, compress);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for fz_xml_att(). */
char *xml_att(fz_xml *item, const char *att)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_att(): item=%p att=%s\n", __FILE__, __LINE__, __FUNCTION__, item, att);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_att(item, att);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_att_eq(). */
int xml_att_eq(fz_xml *item, const char *name, const char *match)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_att_eq(): item=%p name=%s match=%s\n", __FILE__, __LINE__, __FUNCTION__, item, name, match);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_att_eq(item, name, match);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_down(). */
fz_xml *xml_down(fz_xml *item)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_down(): item=%p\n", __FILE__, __LINE__, __FUNCTION__, item);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_down(item);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_find(). */
fz_xml *xml_find(fz_xml *item, const char *tag)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_find(): item=%p tag=%s\n", __FILE__, __LINE__, __FUNCTION__, item, tag);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_find(item, tag);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_find_down(). */
fz_xml *xml_find_down(fz_xml *item, const char *tag)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_find_down(): item=%p tag=%s\n", __FILE__, __LINE__, __FUNCTION__, item, tag);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_find_down(item, tag);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_find_down_match(). */
fz_xml *xml_find_down_match(fz_xml *item, const char *tag, const char *att, const char *match)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_find_down_match(): item=%p tag=%s att=%s match=%s\n", __FILE__, __LINE__, __FUNCTION__, item, tag, att, match);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_find_down_match(item, tag, att, match);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_find_match(). */
fz_xml *xml_find_match(fz_xml *item, const char *tag, const char *att, const char *match)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_find_match(): item=%p tag=%s att=%s match=%s\n", __FILE__, __LINE__, __FUNCTION__, item, tag, att, match);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_find_match(item, tag, att, match);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_find_next(). */
fz_xml *xml_find_next(fz_xml *item, const char *tag)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_find_next(): item=%p tag=%s\n", __FILE__, __LINE__, __FUNCTION__, item, tag);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_find_next(item, tag);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_find_next_match(). */
fz_xml *xml_find_next_match(fz_xml *item, const char *tag, const char *att, const char *match)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_find_next_match(): item=%p tag=%s att=%s match=%s\n", __FILE__, __LINE__, __FUNCTION__, item, tag, att, match);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_find_next_match(item, tag, att, match);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_is_tag(). */
int xml_is_tag(fz_xml *item, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_is_tag(): item=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, item, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_is_tag(item, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_next(). */
fz_xml *xml_next(fz_xml *item)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_next(): item=%p\n", __FILE__, __LINE__, __FUNCTION__, item);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_next(item);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_prev(). */
fz_xml *xml_prev(fz_xml *item)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_prev(): item=%p\n", __FILE__, __LINE__, __FUNCTION__, item);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_prev(item);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_root(). */
fz_xml *xml_root(fz_xml_doc *xml)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_root(): xml=%p\n", __FILE__, __LINE__, __FUNCTION__, xml);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_root(xml);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_tag(). */
char *xml_tag(fz_xml *item)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_tag(): item=%p\n", __FILE__, __LINE__, __FUNCTION__, item);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_tag(item);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_text(). */
char *xml_text(fz_xml *item)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_text(): item=%p\n", __FILE__, __LINE__, __FUNCTION__, item);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_text(item);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for fz_xml_up(). */
fz_xml *xml_up(fz_xml *item)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling fz_xml_up(): item=%p\n", __FILE__, __LINE__, __FUNCTION__, item);
	}
	fz_xml * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::fz_xml_up(item);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_access_alert_event(). */
pdf_alert_event *ppdf_access_alert_event(pdf_doc_event *event)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_access_alert_event(): auto_ctx=%p event=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, event);
	}
	pdf_alert_event * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_access_alert_event(auto_ctx, event);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_access_exec_menu_item_event(). */
const char *ppdf_access_exec_menu_item_event(pdf_doc_event *event)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_access_exec_menu_item_event(): auto_ctx=%p event=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, event);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_access_exec_menu_item_event(auto_ctx, event);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_access_launch_url_event(). */
pdf_launch_url_event *ppdf_access_launch_url_event(pdf_doc_event *event)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_access_launch_url_event(): auto_ctx=%p event=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, event);
	}
	pdf_launch_url_event * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_access_launch_url_event(auto_ctx, event);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_access_mail_doc_event(). */
pdf_mail_doc_event *ppdf_access_mail_doc_event(pdf_doc_event *event)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_access_mail_doc_event(): auto_ctx=%p event=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, event);
	}
	pdf_mail_doc_event * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_access_mail_doc_event(auto_ctx, event);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_annot_ink_list(). */
void ppdf_add_annot_ink_list(pdf_annot *annot, int n, fz_point stroke[])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_annot_ink_list(): auto_ctx=%p annot=%p (long)n=%li (long)stroke=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)n, (long)stroke);
	}
	fz_try(auto_ctx) {
		::pdf_add_annot_ink_list(auto_ctx, annot, n, stroke);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_add_annot_ink_list_stroke(). */
void ppdf_add_annot_ink_list_stroke(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_annot_ink_list_stroke(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_add_annot_ink_list_stroke(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_add_annot_ink_list_stroke_vertex(). */
void ppdf_add_annot_ink_list_stroke_vertex(pdf_annot *annot, fz_point p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_annot_ink_list_stroke_vertex(): auto_ctx=%p annot=%p &p=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, &p);
	}
	fz_try(auto_ctx) {
		::pdf_add_annot_ink_list_stroke_vertex(auto_ctx, annot, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_add_annot_quad_point(). */
void ppdf_add_annot_quad_point(pdf_annot *annot, fz_quad quad)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_annot_quad_point(): auto_ctx=%p annot=%p &quad=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, &quad);
	}
	fz_try(auto_ctx) {
		::pdf_add_annot_quad_point(auto_ctx, annot, quad);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_add_annot_vertex(). */
void ppdf_add_annot_vertex(pdf_annot *annot, fz_point p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_annot_vertex(): auto_ctx=%p annot=%p &p=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, &p);
	}
	fz_try(auto_ctx) {
		::pdf_add_annot_vertex(auto_ctx, annot, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_add_cid_font(). */
pdf_obj *ppdf_add_cid_font(pdf_document *doc, fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_cid_font(): auto_ctx=%p doc=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, font);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_cid_font(auto_ctx, doc, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_cjk_font(). */
pdf_obj *ppdf_add_cjk_font(pdf_document *doc, fz_font *font, int script, int wmode, int serif)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_cjk_font(): auto_ctx=%p doc=%p font=%p (long)script=%li (long)wmode=%li (long)serif=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, font, (long)script, (long)wmode, (long)serif);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_cjk_font(auto_ctx, doc, font, script, wmode, serif);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_codespace(). */
void ppdf_add_codespace(pdf_cmap *cmap, unsigned int low, unsigned int high, size_t n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_codespace(): auto_ctx=%p cmap=%p (long)low=%li (long)high=%li (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap, (long)low, (long)high, (long)n);
	}
	fz_try(auto_ctx) {
		::pdf_add_codespace(auto_ctx, cmap, low, high, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_add_embedded_file(). */
pdf_obj *ppdf_add_embedded_file(pdf_document *doc, const char *filename, const char *mimetype, fz_buffer *contents)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_embedded_file(): auto_ctx=%p doc=%p filename=%s mimetype=%s contents=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, filename, mimetype, contents);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_embedded_file(auto_ctx, doc, filename, mimetype, contents);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_hmtx(). */
void ppdf_add_hmtx(pdf_font_desc *font, int lo, int hi, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_hmtx(): auto_ctx=%p font=%p (long)lo=%li (long)hi=%li (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)lo, (long)hi, (long)w);
	}
	fz_try(auto_ctx) {
		::pdf_add_hmtx(auto_ctx, font, lo, hi, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_add_image(). */
pdf_obj *ppdf_add_image(pdf_document *doc, fz_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_image(): auto_ctx=%p doc=%p image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, image);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_image(auto_ctx, doc, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_new_array(). */
pdf_obj *ppdf_add_new_array(pdf_document *doc, int initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_new_array(): auto_ctx=%p doc=%p (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)initial);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_new_array(auto_ctx, doc, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_new_dict(). */
pdf_obj *ppdf_add_new_dict(pdf_document *doc, int initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_new_dict(): auto_ctx=%p doc=%p (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)initial);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_new_dict(auto_ctx, doc, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_object(). */
pdf_obj *ppdf_add_object(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_object(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_object(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_object_drop(). */
pdf_obj *ppdf_add_object_drop(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_object_drop(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_object_drop(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_page(). */
pdf_obj *ppdf_add_page(pdf_document *doc, fz_rect mediabox, int rotate, pdf_obj *resources, fz_buffer *contents)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_page(): auto_ctx=%p doc=%p &mediabox=%p (long)rotate=%li resources=%p contents=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &mediabox, (long)rotate, resources, contents);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_page(auto_ctx, doc, mediabox, rotate, resources, contents);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_simple_font(). */
pdf_obj *ppdf_add_simple_font(pdf_document *doc, fz_font *font, int encoding)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_simple_font(): auto_ctx=%p doc=%p font=%p (long)encoding=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, font, (long)encoding);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_simple_font(auto_ctx, doc, font, encoding);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_stream(). */
pdf_obj *ppdf_add_stream(pdf_document *doc, fz_buffer *buf, pdf_obj *obj, int compressed)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_stream(): auto_ctx=%p doc=%p buf=%p obj=%p (long)compressed=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, buf, obj, (long)compressed);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_add_stream(auto_ctx, doc, buf, obj, compressed);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_add_vmtx(). */
void ppdf_add_vmtx(pdf_font_desc *font, int lo, int hi, int x, int y, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_add_vmtx(): auto_ctx=%p font=%p (long)lo=%li (long)hi=%li (long)x=%li (long)y=%li (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)lo, (long)hi, (long)x, (long)y, (long)w);
	}
	fz_try(auto_ctx) {
		::pdf_add_vmtx(auto_ctx, font, lo, hi, x, y, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_MK_BC(). */
void ppdf_annot_MK_BC(pdf_annot *annot, int *n, float color[4])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_MK_BC(): auto_ctx=%p annot=%p n=%p (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, n, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_annot_MK_BC(auto_ctx, annot, n, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_MK_BC_rgb(). */
int ppdf_annot_MK_BC_rgb(pdf_annot *annot, float rgb[3])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_MK_BC_rgb(): auto_ctx=%p annot=%p (long)rgb=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)rgb);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_MK_BC_rgb(auto_ctx, annot, rgb);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_MK_BG(). */
void ppdf_annot_MK_BG(pdf_annot *annot, int *n, float color[4])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_MK_BG(): auto_ctx=%p annot=%p n=%p (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, n, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_annot_MK_BG(auto_ctx, annot, n, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_MK_BG_rgb(). */
int ppdf_annot_MK_BG_rgb(pdf_annot *annot, float rgb[3])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_MK_BG_rgb(): auto_ctx=%p annot=%p (long)rgb=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)rgb);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_MK_BG_rgb(auto_ctx, annot, rgb);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_author(). */
const char *ppdf_annot_author(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_author(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_author(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_border(). */
float ppdf_annot_border(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_border(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_border(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_color(). */
void ppdf_annot_color(pdf_annot *annot, int *n, float color[4])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_color(): auto_ctx=%p annot=%p n=%p (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, n, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_annot_color(auto_ctx, annot, n, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_contents(). */
const char *ppdf_annot_contents(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_contents(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_contents(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_default_appearance(). */
void ppdf_annot_default_appearance(pdf_annot *annot, const char **font, float *size, float color[3])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_default_appearance(): auto_ctx=%p annot=%p font=%p size=%p (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, font, size, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_annot_default_appearance(auto_ctx, annot, font, size, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_blur(). */
void ppdf_annot_event_blur(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_blur(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_blur(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_down(). */
void ppdf_annot_event_down(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_down(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_down(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_enter(). */
void ppdf_annot_event_enter(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_enter(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_enter(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_exit(). */
void ppdf_annot_event_exit(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_exit(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_exit(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_focus(). */
void ppdf_annot_event_focus(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_focus(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_focus(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_page_close(). */
void ppdf_annot_event_page_close(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_page_close(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_page_close(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_page_invisible(). */
void ppdf_annot_event_page_invisible(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_page_invisible(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_page_invisible(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_page_open(). */
void ppdf_annot_event_page_open(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_page_open(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_page_open(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_page_visible(). */
void ppdf_annot_event_page_visible(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_page_visible(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_page_visible(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_event_up(). */
void ppdf_annot_event_up(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_event_up(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_annot_event_up(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_flags(). */
int ppdf_annot_flags(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_flags(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_flags(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_author(). */
int ppdf_annot_has_author(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_author(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_author(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_icon_name(). */
int ppdf_annot_has_icon_name(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_icon_name(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_icon_name(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_ink_list(). */
int ppdf_annot_has_ink_list(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_ink_list(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_ink_list(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_interior_color(). */
int ppdf_annot_has_interior_color(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_interior_color(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_interior_color(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_line(). */
int ppdf_annot_has_line(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_line(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_line(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_line_ending_styles(). */
int ppdf_annot_has_line_ending_styles(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_line_ending_styles(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_line_ending_styles(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_open(). */
int ppdf_annot_has_open(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_open(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_open(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_quad_points(). */
int ppdf_annot_has_quad_points(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_quad_points(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_quad_points(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_has_vertices(). */
int ppdf_annot_has_vertices(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_has_vertices(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_has_vertices(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_icon_name(). */
const char *ppdf_annot_icon_name(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_icon_name(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_icon_name(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_ink_list_count(). */
int ppdf_annot_ink_list_count(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_ink_list_count(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_ink_list_count(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_ink_list_stroke_count(). */
int ppdf_annot_ink_list_stroke_count(pdf_annot *annot, int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_ink_list_stroke_count(): auto_ctx=%p annot=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)i);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_ink_list_stroke_count(auto_ctx, annot, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_ink_list_stroke_vertex(). */
fz_point ppdf_annot_ink_list_stroke_vertex(pdf_annot *annot, int i, int k)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_ink_list_stroke_vertex(): auto_ctx=%p annot=%p (long)i=%li (long)k=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)i, (long)k);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_ink_list_stroke_vertex(auto_ctx, annot, i, k);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_interior_color(). */
void ppdf_annot_interior_color(pdf_annot *annot, int *n, float color[4])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_interior_color(): auto_ctx=%p annot=%p n=%p (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, n, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_annot_interior_color(auto_ctx, annot, n, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_is_open(). */
int ppdf_annot_is_open(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_is_open(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_is_open(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_language(). */
fz_text_language ppdf_annot_language(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_language(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_text_language ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_language(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_line(). */
void ppdf_annot_line(pdf_annot *annot, fz_point *a, fz_point *b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_line(): auto_ctx=%p annot=%p a=%p b=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, a, b);
	}
	fz_try(auto_ctx) {
		::pdf_annot_line(auto_ctx, annot, a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_line_end_style(). */
enum pdf_line_ending ppdf_annot_line_end_style(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_line_end_style(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	enum pdf_line_ending ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_line_end_style(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_line_ending_styles(). */
void ppdf_annot_line_ending_styles(pdf_annot *annot, enum pdf_line_ending *start_style, enum pdf_line_ending *end_style)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_line_ending_styles(): auto_ctx=%p annot=%p start_style=%p end_style=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, start_style, end_style);
	}
	fz_try(auto_ctx) {
		::pdf_annot_line_ending_styles(auto_ctx, annot, start_style, end_style);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_annot_line_start_style(). */
enum pdf_line_ending ppdf_annot_line_start_style(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_line_start_style(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	enum pdf_line_ending ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_line_start_style(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_modification_date(). */
int64_t ppdf_annot_modification_date(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_modification_date(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_modification_date(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_opacity(). */
float ppdf_annot_opacity(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_opacity(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_opacity(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_quad_point(). */
fz_quad ppdf_annot_quad_point(pdf_annot *annot, int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_quad_point(): auto_ctx=%p annot=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)i);
	}
	fz_quad ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_quad_point(auto_ctx, annot, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_quad_point_count(). */
int ppdf_annot_quad_point_count(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_quad_point_count(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_quad_point_count(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_quadding(). */
int ppdf_annot_quadding(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_quadding(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_quadding(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_rect(). */
fz_rect ppdf_annot_rect(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_rect(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_rect(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_transform(). */
fz_matrix ppdf_annot_transform(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_transform(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_transform(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_type(). */
enum pdf_annot_type ppdf_annot_type(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_type(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	enum pdf_annot_type ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_type(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_type_from_string(). */
enum pdf_annot_type ppdf_annot_type_from_string(const char *subtype)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_type_from_string(): auto_ctx=%p subtype=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, subtype);
	}
	enum pdf_annot_type ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_type_from_string(auto_ctx, subtype);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_vertex(). */
fz_point ppdf_annot_vertex(pdf_annot *annot, int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_vertex(): auto_ctx=%p annot=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)i);
	}
	fz_point ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_vertex(auto_ctx, annot, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_annot_vertex_count(). */
int ppdf_annot_vertex_count(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_annot_vertex_count(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_annot_vertex_count(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_append_token(). */
void ppdf_append_token(fz_buffer *buf, int tok, pdf_lexbuf *lex)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_append_token(): auto_ctx=%p buf=%p (long)tok=%li lex=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)tok, lex);
	}
	fz_try(auto_ctx) {
		::pdf_append_token(auto_ctx, buf, tok, lex);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_contains(). */
int ppdf_array_contains(pdf_obj *array, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_contains(): auto_ctx=%p array=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_contains(auto_ctx, array, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_delete(). */
void ppdf_array_delete(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_delete(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	fz_try(auto_ctx) {
		::pdf_array_delete(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_find(). */
int ppdf_array_find(pdf_obj *array, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_find(): auto_ctx=%p array=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_find(auto_ctx, array, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get(). */
pdf_obj *ppdf_array_get(pdf_obj *array, int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get(): auto_ctx=%p array=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)i);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get(auto_ctx, array, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_bool(). */
int ppdf_array_get_bool(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_bool(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_bool(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_int(). */
int ppdf_array_get_int(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_int(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_int(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_matrix(). */
fz_matrix ppdf_array_get_matrix(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_matrix(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_matrix(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_name(). */
const char *ppdf_array_get_name(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_name(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_name(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_real(). */
float ppdf_array_get_real(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_real(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_real(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_rect(). */
fz_rect ppdf_array_get_rect(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_rect(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_rect(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_string(). */
const char *ppdf_array_get_string(pdf_obj *array, int index, size_t *sizep)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_string(): auto_ctx=%p array=%p (long)index=%li sizep=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index, sizep);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_string(auto_ctx, array, index, sizep);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_get_text_string(). */
const char *ppdf_array_get_text_string(pdf_obj *array, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_get_text_string(): auto_ctx=%p array=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)index);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_get_text_string(auto_ctx, array, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_insert(). */
void ppdf_array_insert(pdf_obj *array, pdf_obj *obj, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_insert(): auto_ctx=%p array=%p obj=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, obj, (long)index);
	}
	fz_try(auto_ctx) {
		::pdf_array_insert(auto_ctx, array, obj, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_insert_drop(). */
void ppdf_array_insert_drop(pdf_obj *array, pdf_obj *obj, int index)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_insert_drop(): auto_ctx=%p array=%p obj=%p (long)index=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, obj, (long)index);
	}
	fz_try(auto_ctx) {
		::pdf_array_insert_drop(auto_ctx, array, obj, index);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_len(). */
int ppdf_array_len(pdf_obj *array)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_len(): auto_ctx=%p array=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_len(auto_ctx, array);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_push(). */
void ppdf_array_push(pdf_obj *array, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push(): auto_ctx=%p array=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, obj);
	}
	fz_try(auto_ctx) {
		::pdf_array_push(auto_ctx, array, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_push_array(). */
pdf_obj *ppdf_array_push_array(pdf_obj *array, int initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_array(): auto_ctx=%p array=%p (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)initial);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_push_array(auto_ctx, array, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_push_bool(). */
void ppdf_array_push_bool(pdf_obj *array, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_bool(): auto_ctx=%p array=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)x);
	}
	fz_try(auto_ctx) {
		::pdf_array_push_bool(auto_ctx, array, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_push_dict(). */
pdf_obj *ppdf_array_push_dict(pdf_obj *array, int initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_dict(): auto_ctx=%p array=%p (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)initial);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_array_push_dict(auto_ctx, array, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_array_push_drop(). */
void ppdf_array_push_drop(pdf_obj *array, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_drop(): auto_ctx=%p array=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, obj);
	}
	fz_try(auto_ctx) {
		::pdf_array_push_drop(auto_ctx, array, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_push_int(). */
void ppdf_array_push_int(pdf_obj *array, int64_t x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_int(): auto_ctx=%p array=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)x);
	}
	fz_try(auto_ctx) {
		::pdf_array_push_int(auto_ctx, array, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_push_name(). */
void ppdf_array_push_name(pdf_obj *array, const char *x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_name(): auto_ctx=%p array=%p x=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, x);
	}
	fz_try(auto_ctx) {
		::pdf_array_push_name(auto_ctx, array, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_push_real(). */
void ppdf_array_push_real(pdf_obj *array, double x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_real(): auto_ctx=%p array=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)x);
	}
	fz_try(auto_ctx) {
		::pdf_array_push_real(auto_ctx, array, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_push_string(). */
void ppdf_array_push_string(pdf_obj *array, const char *x, size_t n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_string(): auto_ctx=%p array=%p x=%s (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, x, (long)n);
	}
	fz_try(auto_ctx) {
		::pdf_array_push_string(auto_ctx, array, x, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_push_text_string(). */
void ppdf_array_push_text_string(pdf_obj *array, const char *x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_push_text_string(): auto_ctx=%p array=%p x=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, x);
	}
	fz_try(auto_ctx) {
		::pdf_array_push_text_string(auto_ctx, array, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_put(). */
void ppdf_array_put(pdf_obj *array, int i, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_put(): auto_ctx=%p array=%p (long)i=%li obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)i, obj);
	}
	fz_try(auto_ctx) {
		::pdf_array_put(auto_ctx, array, i, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_array_put_drop(). */
void ppdf_array_put_drop(pdf_obj *array, int i, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_array_put_drop(): auto_ctx=%p array=%p (long)i=%li obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)i, obj);
	}
	fz_try(auto_ctx) {
		::pdf_array_put_drop(auto_ctx, array, i, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_authenticate_password(). */
int ppdf_authenticate_password(pdf_document *doc, const char *pw)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_authenticate_password(): auto_ctx=%p doc=%p pw=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, pw);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_authenticate_password(auto_ctx, doc, pw);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_bound_annot(). */
fz_rect ppdf_bound_annot(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_bound_annot(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_bound_annot(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_bound_page(). */
fz_rect ppdf_bound_page(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_bound_page(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_bound_page(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_bound_widget(). */
fz_rect ppdf_bound_widget(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_bound_widget(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_bound_widget(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_button_field_on_state(). */
pdf_obj *ppdf_button_field_on_state(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_button_field_on_state(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_button_field_on_state(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_cache_object(). */
pdf_xref_entry *ppdf_cache_object(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_cache_object(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	pdf_xref_entry * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_cache_object(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_calculate_form(). */
void ppdf_calculate_form(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_calculate_form(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_calculate_form(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_can_be_saved_incrementally(). */
int ppdf_can_be_saved_incrementally(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_can_be_saved_incrementally(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_can_be_saved_incrementally(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_check_certificate(). */
pdf_signature_error ppdf_check_certificate(pdf_pkcs7_verifier *verifier, pdf_document *doc, pdf_obj *signature)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_check_certificate(): auto_ctx=%p verifier=%p doc=%p signature=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, verifier, doc, signature);
	}
	pdf_signature_error ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_check_certificate(auto_ctx, verifier, doc, signature);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_check_digest(). */
pdf_signature_error ppdf_check_digest(pdf_pkcs7_verifier *verifier, pdf_document *doc, pdf_obj *signature)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_check_digest(): auto_ctx=%p verifier=%p doc=%p signature=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, verifier, doc, signature);
	}
	pdf_signature_error ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_check_digest(auto_ctx, verifier, doc, signature);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_check_signature(). */
int ppdf_check_signature(pdf_pkcs7_verifier *verifier, pdf_document *doc, pdf_obj *signature, char *ebuf, size_t ebufsize)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_check_signature(): auto_ctx=%p verifier=%p doc=%p signature=%p ebuf=%s (long)ebufsize=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, verifier, doc, signature, ebuf, (long)ebufsize);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_check_signature(auto_ctx, verifier, doc, signature, ebuf, ebufsize);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_choice_field_option(). */
const char *ppdf_choice_field_option(pdf_obj *field, int exportval, int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_choice_field_option(): auto_ctx=%p field=%p (long)exportval=%li (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field, (long)exportval, (long)i);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_choice_field_option(auto_ctx, field, exportval, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_choice_field_option_count(). */
int ppdf_choice_field_option_count(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_choice_field_option_count(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_choice_field_option_count(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_choice_widget_is_multiselect(). */
int ppdf_choice_widget_is_multiselect(pdf_widget *tw)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_choice_widget_is_multiselect(): auto_ctx=%p tw=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tw);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_choice_widget_is_multiselect(auto_ctx, tw);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_choice_widget_options(). */
int ppdf_choice_widget_options(pdf_widget *tw, int exportval, const char *opts[])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_choice_widget_options(): auto_ctx=%p tw=%p (long)exportval=%li (long)opts=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tw, (long)exportval, (long)opts);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_choice_widget_options(auto_ctx, tw, exportval, opts);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_choice_widget_set_value(). */
void ppdf_choice_widget_set_value(pdf_widget *tw, int n, const char *opts[])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_choice_widget_set_value(): auto_ctx=%p tw=%p (long)n=%li (long)opts=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tw, (long)n, (long)opts);
	}
	fz_try(auto_ctx) {
		::pdf_choice_widget_set_value(auto_ctx, tw, n, opts);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_choice_widget_value(). */
int ppdf_choice_widget_value(pdf_widget *tw, const char *opts[])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_choice_widget_value(): auto_ctx=%p tw=%p (long)opts=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tw, (long)opts);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_choice_widget_value(auto_ctx, tw, opts);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_clean_file(). */
void ppdf_clean_file(char *infile, char *outfile, char *password, pdf_write_options *opts, int retainlen, char *retainlist[])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clean_file(): auto_ctx=%p infile=%s outfile=%s password=%s opts=%p (long)retainlen=%li (long)retainlist=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, infile, outfile, password, opts, (long)retainlen, (long)retainlist);
	}
	fz_try(auto_ctx) {
		::pdf_clean_file(auto_ctx, infile, outfile, password, opts, retainlen, retainlist);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_clean_font_name(). */
const char *ppdf_clean_font_name(const char *fontname)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clean_font_name(): fontname=%s\n", __FILE__, __LINE__, __FUNCTION__, fontname);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_clean_font_name(fontname);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_clean_obj(). */
void ppdf_clean_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clean_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	fz_try(auto_ctx) {
		::pdf_clean_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_clear_annot_ink_list(). */
void ppdf_clear_annot_ink_list(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clear_annot_ink_list(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_clear_annot_ink_list(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_clear_annot_quad_points(). */
void ppdf_clear_annot_quad_points(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clear_annot_quad_points(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_clear_annot_quad_points(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_clear_annot_vertices(). */
void ppdf_clear_annot_vertices(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clear_annot_vertices(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_clear_annot_vertices(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_clear_signature(). */
void ppdf_clear_signature(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clear_signature(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	fz_try(auto_ctx) {
		::pdf_clear_signature(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_clear_xref(). */
void ppdf_clear_xref(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clear_xref(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_clear_xref(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_clear_xref_to_mark(). */
void ppdf_clear_xref_to_mark(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_clear_xref_to_mark(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_clear_xref_to_mark(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_close_processor(). */
void ppdf_close_processor(pdf_processor *proc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_close_processor(): auto_ctx=%p proc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, proc);
	}
	fz_try(auto_ctx) {
		::pdf_close_processor(auto_ctx, proc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_cmap_size(). */
size_t ppdf_cmap_size(pdf_cmap *cmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_cmap_size(): auto_ctx=%p cmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_cmap_size(auto_ctx, cmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_cmap_wmode(). */
int ppdf_cmap_wmode(pdf_cmap *cmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_cmap_wmode(): auto_ctx=%p cmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_cmap_wmode(auto_ctx, cmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_copy_array(). */
pdf_obj *ppdf_copy_array(pdf_obj *array)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_copy_array(): auto_ctx=%p array=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_copy_array(auto_ctx, array);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_copy_dict(). */
pdf_obj *ppdf_copy_dict(pdf_obj *dict)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_copy_dict(): auto_ctx=%p dict=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_copy_dict(auto_ctx, dict);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_layer_config_ui(). */
int ppdf_count_layer_config_ui(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_layer_config_ui(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_layer_config_ui(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_layer_configs(). */
int ppdf_count_layer_configs(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_layer_configs(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_layer_configs(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_objects(). */
int ppdf_count_objects(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_objects(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_objects(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_pages(). */
int ppdf_count_pages(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_pages(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_pages(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_pages_imp(). */
int ppdf_count_pages_imp(fz_document *doc, int chapter)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_pages_imp(): auto_ctx=%p doc=%p (long)chapter=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)chapter);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_pages_imp(auto_ctx, doc, chapter);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_signatures(). */
int ppdf_count_signatures(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_signatures(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_signatures(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_unsaved_versions(). */
int ppdf_count_unsaved_versions(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_unsaved_versions(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_unsaved_versions(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_count_versions(). */
int ppdf_count_versions(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_count_versions(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_count_versions(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_create_annot(). */
pdf_annot *ppdf_create_annot(pdf_page *page, enum pdf_annot_type type)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_create_annot(): auto_ctx=%p page=%p (long)type=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, (long)type);
	}
	pdf_annot * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_create_annot(auto_ctx, page, type);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_create_annot_raw(). */
pdf_annot *ppdf_create_annot_raw(pdf_page *page, enum pdf_annot_type type)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_create_annot_raw(): auto_ctx=%p page=%p (long)type=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, (long)type);
	}
	pdf_annot * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_create_annot_raw(auto_ctx, page, type);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_create_document(). */
pdf_document *ppdf_create_document()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_create_document(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_create_document(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_create_object(). */
int ppdf_create_object(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_create_object(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_create_object(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_encrypt_metadata(). */
int ppdf_crypt_encrypt_metadata(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_encrypt_metadata(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_encrypt_metadata(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_key(). */
unsigned char *ppdf_crypt_key(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_key(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_key(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_length(). */
int ppdf_crypt_length(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_length(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_length(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_method(). */
char *ppdf_crypt_method(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_method(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_method(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_obj(). */
void ppdf_crypt_obj(pdf_crypt *crypt, pdf_obj *obj, int num, int gen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_obj(): auto_ctx=%p crypt=%p obj=%p (long)num=%li (long)gen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt, obj, (long)num, (long)gen);
	}
	fz_try(auto_ctx) {
		::pdf_crypt_obj(auto_ctx, crypt, obj, num, gen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_crypt_owner_encryption(). */
unsigned char *ppdf_crypt_owner_encryption(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_owner_encryption(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_owner_encryption(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_owner_password(). */
unsigned char *ppdf_crypt_owner_password(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_owner_password(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_owner_password(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_permissions(). */
int ppdf_crypt_permissions(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_permissions(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_permissions(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_permissions_encryption(). */
unsigned char *ppdf_crypt_permissions_encryption(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_permissions_encryption(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_permissions_encryption(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_revision(). */
int ppdf_crypt_revision(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_revision(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_revision(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_user_encryption(). */
unsigned char *ppdf_crypt_user_encryption(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_user_encryption(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_user_encryption(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_user_password(). */
unsigned char *ppdf_crypt_user_password(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_user_password(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_user_password(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_crypt_version(). */
int ppdf_crypt_version(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_crypt_version(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_crypt_version(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_debug_obj(). */
void ppdf_debug_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_debug_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	fz_try(auto_ctx) {
		::pdf_debug_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_debug_ref(). */
void ppdf_debug_ref(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_debug_ref(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	fz_try(auto_ctx) {
		::pdf_debug_ref(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_decode_cmap(). */
int ppdf_decode_cmap(pdf_cmap *cmap, unsigned char *s, unsigned char *e, unsigned int *cpt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_decode_cmap(): cmap=%p s=%p e=%p cpt=%p\n", __FILE__, __LINE__, __FUNCTION__, cmap, s, e, cpt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_decode_cmap(cmap, s, e, cpt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_deep_copy_obj(). */
pdf_obj *ppdf_deep_copy_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_deep_copy_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_deep_copy_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_delete_annot(). */
void ppdf_delete_annot(pdf_page *page, pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_delete_annot(): auto_ctx=%p page=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, annot);
	}
	fz_try(auto_ctx) {
		::pdf_delete_annot(auto_ctx, page, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_delete_object(). */
void ppdf_delete_object(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_delete_object(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_try(auto_ctx) {
		::pdf_delete_object(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_delete_page(). */
void ppdf_delete_page(pdf_document *doc, int number)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_delete_page(): auto_ctx=%p doc=%p (long)number=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number);
	}
	fz_try(auto_ctx) {
		::pdf_delete_page(auto_ctx, doc, number);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_delete_page_range(). */
void ppdf_delete_page_range(pdf_document *doc, int start, int end)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_delete_page_range(): auto_ctx=%p doc=%p (long)start=%li (long)end=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)start, (long)end);
	}
	fz_try(auto_ctx) {
		::pdf_delete_page_range(auto_ctx, doc, start, end);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_deselect_layer_config_ui(). */
void ppdf_deselect_layer_config_ui(pdf_document *doc, int ui)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_deselect_layer_config_ui(): auto_ctx=%p doc=%p (long)ui=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)ui);
	}
	fz_try(auto_ctx) {
		::pdf_deselect_layer_config_ui(auto_ctx, doc, ui);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_del(). */
void ppdf_dict_del(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_del(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	fz_try(auto_ctx) {
		::pdf_dict_del(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_dels(). */
void ppdf_dict_dels(pdf_obj *dict, const char *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_dels(): auto_ctx=%p dict=%p key=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	fz_try(auto_ctx) {
		::pdf_dict_dels(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_get(). */
pdf_obj *ppdf_dict_get(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_bool(). */
int ppdf_dict_get_bool(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_bool(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_bool(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_inheritable(). */
pdf_obj *ppdf_dict_get_inheritable(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_inheritable(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_inheritable(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_int(). */
int ppdf_dict_get_int(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_int(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_int(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_key(). */
pdf_obj *ppdf_dict_get_key(pdf_obj *dict, int idx)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_key(): auto_ctx=%p dict=%p (long)idx=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, (long)idx);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_key(auto_ctx, dict, idx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_matrix(). */
fz_matrix ppdf_dict_get_matrix(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_matrix(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_matrix(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_name(). */
const char *ppdf_dict_get_name(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_name(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_name(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_put_drop(). */
void ppdf_dict_get_put_drop(pdf_obj *dict, pdf_obj *key, pdf_obj *val, pdf_obj **old_val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_put_drop(): auto_ctx=%p dict=%p key=%p val=%p old_val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, val, old_val);
	}
	fz_try(auto_ctx) {
		::pdf_dict_get_put_drop(auto_ctx, dict, key, val, old_val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_get_real(). */
float ppdf_dict_get_real(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_real(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_real(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_rect(). */
fz_rect ppdf_dict_get_rect(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_rect(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_rect(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_string(). */
const char *ppdf_dict_get_string(pdf_obj *dict, pdf_obj *key, size_t *sizep)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_string(): auto_ctx=%p dict=%p key=%p sizep=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, sizep);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_string(auto_ctx, dict, key, sizep);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_text_string(). */
const char *ppdf_dict_get_text_string(pdf_obj *dict, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_text_string(): auto_ctx=%p dict=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_text_string(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_get_val(). */
pdf_obj *ppdf_dict_get_val(pdf_obj *dict, int idx)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_get_val(): auto_ctx=%p dict=%p (long)idx=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, (long)idx);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_get_val(auto_ctx, dict, idx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_geta(). */
pdf_obj *ppdf_dict_geta(pdf_obj *dict, pdf_obj *key, pdf_obj *abbrev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_geta(): auto_ctx=%p dict=%p key=%p abbrev=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, abbrev);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_geta(auto_ctx, dict, key, abbrev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_getp(). */
pdf_obj *ppdf_dict_getp(pdf_obj *dict, const char *path)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_getp(): auto_ctx=%p dict=%p path=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, path);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_getp(auto_ctx, dict, path);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_gets(). */
pdf_obj *ppdf_dict_gets(pdf_obj *dict, const char *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_gets(): auto_ctx=%p dict=%p key=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_gets(auto_ctx, dict, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_getsa(). */
pdf_obj *ppdf_dict_getsa(pdf_obj *dict, const char *key, const char *abbrev)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_getsa(): auto_ctx=%p dict=%p key=%s abbrev=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, abbrev);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_getsa(auto_ctx, dict, key, abbrev);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_len(). */
int ppdf_dict_len(pdf_obj *dict)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_len(): auto_ctx=%p dict=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_len(auto_ctx, dict);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_put(). */
void ppdf_dict_put(pdf_obj *dict, pdf_obj *key, pdf_obj *val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put(): auto_ctx=%p dict=%p key=%p val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, val);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put(auto_ctx, dict, key, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_array(). */
pdf_obj *ppdf_dict_put_array(pdf_obj *dict, pdf_obj *key, int initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_array(): auto_ctx=%p dict=%p key=%p (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, (long)initial);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_put_array(auto_ctx, dict, key, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_put_bool(). */
void ppdf_dict_put_bool(pdf_obj *dict, pdf_obj *key, int x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_bool(): auto_ctx=%p dict=%p key=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, (long)x);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_bool(auto_ctx, dict, key, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_dict(). */
pdf_obj *ppdf_dict_put_dict(pdf_obj *dict, pdf_obj *key, int initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_dict(): auto_ctx=%p dict=%p key=%p (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, (long)initial);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_put_dict(auto_ctx, dict, key, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_put_drop(). */
void ppdf_dict_put_drop(pdf_obj *dict, pdf_obj *key, pdf_obj *val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_drop(): auto_ctx=%p dict=%p key=%p val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, val);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_drop(auto_ctx, dict, key, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_int(). */
void ppdf_dict_put_int(pdf_obj *dict, pdf_obj *key, int64_t x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_int(): auto_ctx=%p dict=%p key=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, (long)x);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_int(auto_ctx, dict, key, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_matrix(). */
void ppdf_dict_put_matrix(pdf_obj *dict, pdf_obj *key, fz_matrix x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_matrix(): auto_ctx=%p dict=%p key=%p &x=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, &x);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_matrix(auto_ctx, dict, key, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_name(). */
void ppdf_dict_put_name(pdf_obj *dict, pdf_obj *key, const char *x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_name(): auto_ctx=%p dict=%p key=%p x=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, x);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_name(auto_ctx, dict, key, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_real(). */
void ppdf_dict_put_real(pdf_obj *dict, pdf_obj *key, double x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_real(): auto_ctx=%p dict=%p key=%p (long)x=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, (long)x);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_real(auto_ctx, dict, key, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_rect(). */
void ppdf_dict_put_rect(pdf_obj *dict, pdf_obj *key, fz_rect x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_rect(): auto_ctx=%p dict=%p key=%p &x=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, &x);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_rect(auto_ctx, dict, key, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_string(). */
void ppdf_dict_put_string(pdf_obj *dict, pdf_obj *key, const char *x, size_t n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_string(): auto_ctx=%p dict=%p key=%p x=%s (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, x, (long)n);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_string(auto_ctx, dict, key, x, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_text_string(). */
void ppdf_dict_put_text_string(pdf_obj *dict, pdf_obj *key, const char *x)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_text_string(): auto_ctx=%p dict=%p key=%p x=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, x);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_text_string(auto_ctx, dict, key, x);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_put_val_null(). */
void ppdf_dict_put_val_null(pdf_obj *obj, int idx)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_put_val_null(): auto_ctx=%p obj=%p (long)idx=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj, (long)idx);
	}
	fz_try(auto_ctx) {
		::pdf_dict_put_val_null(auto_ctx, obj, idx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_putp(). */
void ppdf_dict_putp(pdf_obj *dict, const char *path, pdf_obj *val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_putp(): auto_ctx=%p dict=%p path=%s val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, path, val);
	}
	fz_try(auto_ctx) {
		::pdf_dict_putp(auto_ctx, dict, path, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_putp_drop(). */
void ppdf_dict_putp_drop(pdf_obj *dict, const char *path, pdf_obj *val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_putp_drop(): auto_ctx=%p dict=%p path=%s val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, path, val);
	}
	fz_try(auto_ctx) {
		::pdf_dict_putp_drop(auto_ctx, dict, path, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_puts(). */
void ppdf_dict_puts(pdf_obj *dict, const char *key, pdf_obj *val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_puts(): auto_ctx=%p dict=%p key=%s val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, val);
	}
	fz_try(auto_ctx) {
		::pdf_dict_puts(auto_ctx, dict, key, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dict_puts_dict(). */
pdf_obj *ppdf_dict_puts_dict(pdf_obj *dict, const char *key, int initial)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_puts_dict(): auto_ctx=%p dict=%p key=%s (long)initial=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, (long)initial);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_dict_puts_dict(auto_ctx, dict, key, initial);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_dict_puts_drop(). */
void ppdf_dict_puts_drop(pdf_obj *dict, const char *key, pdf_obj *val)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dict_puts_drop(): auto_ctx=%p dict=%p key=%s val=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict, key, val);
	}
	fz_try(auto_ctx) {
		::pdf_dict_puts_drop(auto_ctx, dict, key, val);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dirty_annot(). */
void ppdf_dirty_annot(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dirty_annot(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_dirty_annot(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_dirty_obj(). */
void ppdf_dirty_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_dirty_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	fz_try(auto_ctx) {
		::pdf_dirty_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_disable_js(). */
void ppdf_disable_js(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_disable_js(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_disable_js(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_doc_was_linearized(). */
int ppdf_doc_was_linearized(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_doc_was_linearized(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_doc_was_linearized(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_document_event_did_print(). */
void ppdf_document_event_did_print(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_event_did_print(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_document_event_did_print(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_document_event_did_save(). */
void ppdf_document_event_did_save(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_event_did_save(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_document_event_did_save(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_document_event_will_close(). */
void ppdf_document_event_will_close(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_event_will_close(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_document_event_will_close(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_document_event_will_print(). */
void ppdf_document_event_will_print(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_event_will_print(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_document_event_will_print(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_document_event_will_save(). */
void ppdf_document_event_will_save(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_event_will_save(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_document_event_will_save(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_document_from_fz_document(). */
pdf_document *ppdf_document_from_fz_document(fz_document *ptr)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_from_fz_document(): auto_ctx=%p ptr=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ptr);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_document_from_fz_document(auto_ctx, ptr);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_document_language(). */
fz_text_language ppdf_document_language(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_language(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_text_language ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_document_language(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_document_output_intent(). */
fz_colorspace *ppdf_document_output_intent(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_output_intent(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_document_output_intent(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_document_permissions(). */
int ppdf_document_permissions(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_document_permissions(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_document_permissions(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_drop_annot(). */
void ppdf_drop_annot(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_annot(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_drop_annot(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_annots(). */
void ppdf_drop_annots(pdf_annot *annot_list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_annots(): auto_ctx=%p annot_list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot_list);
	}
	fz_try(auto_ctx) {
		::pdf_drop_annots(auto_ctx, annot_list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_cmap(). */
void ppdf_drop_cmap(pdf_cmap *cmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_cmap(): auto_ctx=%p cmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap);
	}
	fz_try(auto_ctx) {
		::pdf_drop_cmap(auto_ctx, cmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_cmap_imp(). */
void ppdf_drop_cmap_imp(fz_storable *cmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_cmap_imp(): auto_ctx=%p cmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap);
	}
	fz_try(auto_ctx) {
		::pdf_drop_cmap_imp(auto_ctx, cmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_crypt(). */
void ppdf_drop_crypt(pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_crypt(): auto_ctx=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt);
	}
	fz_try(auto_ctx) {
		::pdf_drop_crypt(auto_ctx, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_document(). */
void ppdf_drop_document(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_document(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_drop_document(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_font(). */
void ppdf_drop_font(pdf_font_desc *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_font(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_try(auto_ctx) {
		::pdf_drop_font(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_function(). */
void ppdf_drop_function(pdf_function *func)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_function(): auto_ctx=%p func=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, func);
	}
	fz_try(auto_ctx) {
		::pdf_drop_function(auto_ctx, func);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_graft_map(). */
void ppdf_drop_graft_map(pdf_graft_map *map)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_graft_map(): auto_ctx=%p map=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, map);
	}
	fz_try(auto_ctx) {
		::pdf_drop_graft_map(auto_ctx, map);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_js(). */
void ppdf_drop_js(pdf_js *js)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_js(): auto_ctx=%p js=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, js);
	}
	fz_try(auto_ctx) {
		::pdf_drop_js(auto_ctx, js);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_locked_fields(). */
void ppdf_drop_locked_fields(pdf_locked_fields *locked)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_locked_fields(): auto_ctx=%p locked=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, locked);
	}
	fz_try(auto_ctx) {
		::pdf_drop_locked_fields(auto_ctx, locked);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_obj(). */
void ppdf_drop_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	fz_try(auto_ctx) {
		::pdf_drop_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_ocg(). */
void ppdf_drop_ocg(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_ocg(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_drop_ocg(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_page_tree(). */
void ppdf_drop_page_tree(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_page_tree(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_drop_page_tree(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_pattern(). */
void ppdf_drop_pattern(pdf_pattern *pat)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_pattern(): auto_ctx=%p pat=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pat);
	}
	fz_try(auto_ctx) {
		::pdf_drop_pattern(auto_ctx, pat);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_processor(). */
void ppdf_drop_processor(pdf_processor *proc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_processor(): auto_ctx=%p proc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, proc);
	}
	fz_try(auto_ctx) {
		::pdf_drop_processor(auto_ctx, proc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_resource_tables(). */
void ppdf_drop_resource_tables(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_resource_tables(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_drop_resource_tables(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_signer(). */
void ppdf_drop_signer(pdf_pkcs7_signer *signer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_signer(): auto_ctx=%p signer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, signer);
	}
	fz_try(auto_ctx) {
		::pdf_drop_signer(auto_ctx, signer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_verifier(). */
void ppdf_drop_verifier(pdf_pkcs7_verifier *verifier)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_verifier(): auto_ctx=%p verifier=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, verifier);
	}
	fz_try(auto_ctx) {
		::pdf_drop_verifier(auto_ctx, verifier);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_widget(). */
void ppdf_drop_widget(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_widget(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	fz_try(auto_ctx) {
		::pdf_drop_widget(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_drop_widgets(). */
void ppdf_drop_widgets(pdf_widget *widget_list)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_drop_widgets(): auto_ctx=%p widget_list=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget_list);
	}
	fz_try(auto_ctx) {
		::pdf_drop_widgets(auto_ctx, widget_list);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_embedded_file_name(). */
const char *ppdf_embedded_file_name(pdf_obj *fs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_embedded_file_name(): auto_ctx=%p fs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fs);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_embedded_file_name(auto_ctx, fs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_embedded_file_stream(). */
pdf_obj *ppdf_embedded_file_stream(pdf_obj *fs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_embedded_file_stream(): auto_ctx=%p fs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fs);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_embedded_file_stream(auto_ctx, fs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_embedded_file_type(). */
const char *ppdf_embedded_file_type(pdf_obj *fs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_embedded_file_type(): auto_ctx=%p fs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fs);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_embedded_file_type(auto_ctx, fs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_empty_store(). */
void ppdf_empty_store(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_empty_store(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_empty_store(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_enable_js(). */
void ppdf_enable_js(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_enable_js(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_enable_js(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_encrypt_data(). */
void ppdf_encrypt_data(pdf_crypt *crypt, int num, int gen, void (*fmt_str_out)(fz_context *, void *, const unsigned char *, size_t ), void *arg, const unsigned char *s, size_t n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_encrypt_data(): auto_ctx=%p crypt=%p (long)num=%li (long)gen=%li fmt_str_out=%p arg=%p s=%p (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt, (long)num, (long)gen, fmt_str_out, arg, s, (long)n);
	}
	fz_try(auto_ctx) {
		::pdf_encrypt_data(auto_ctx, crypt, num, gen, fmt_str_out, arg, s, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_encrypted_len(). */
size_t ppdf_encrypted_len(pdf_crypt *crypt, int num, int gen, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_encrypted_len(): auto_ctx=%p crypt=%p (long)num=%li (long)gen=%li (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, crypt, (long)num, (long)gen, (long)len);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_encrypted_len(auto_ctx, crypt, num, gen, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_end_hmtx(). */
void ppdf_end_hmtx(pdf_font_desc *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_end_hmtx(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_try(auto_ctx) {
		::pdf_end_hmtx(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_end_vmtx(). */
void ppdf_end_vmtx(pdf_font_desc *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_end_vmtx(): auto_ctx=%p font=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font);
	}
	fz_try(auto_ctx) {
		::pdf_end_vmtx(auto_ctx, font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_ensure_solid_xref(). */
void ppdf_ensure_solid_xref(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_ensure_solid_xref(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_try(auto_ctx) {
		::pdf_ensure_solid_xref(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_eval_function(). */
void ppdf_eval_function(pdf_function *func, const float *in, int inlen, float *out, int outlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_eval_function(): auto_ctx=%p func=%p in=%p (long)inlen=%li out=%p (long)outlen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, func, in, (long)inlen, out, (long)outlen);
	}
	fz_try(auto_ctx) {
		::pdf_eval_function(auto_ctx, func, in, inlen, out, outlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_event_issue_alert(). */
void ppdf_event_issue_alert(pdf_document *doc, pdf_alert_event *event)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_event_issue_alert(): auto_ctx=%p doc=%p event=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, event);
	}
	fz_try(auto_ctx) {
		::pdf_event_issue_alert(auto_ctx, doc, event);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_event_issue_exec_menu_item(). */
void ppdf_event_issue_exec_menu_item(pdf_document *doc, const char *item)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_event_issue_exec_menu_item(): auto_ctx=%p doc=%p item=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, item);
	}
	fz_try(auto_ctx) {
		::pdf_event_issue_exec_menu_item(auto_ctx, doc, item);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_event_issue_launch_url(). */
void ppdf_event_issue_launch_url(pdf_document *doc, const char *url, int new_frame)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_event_issue_launch_url(): auto_ctx=%p doc=%p url=%s (long)new_frame=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, url, (long)new_frame);
	}
	fz_try(auto_ctx) {
		::pdf_event_issue_launch_url(auto_ctx, doc, url, new_frame);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_event_issue_mail_doc(). */
void ppdf_event_issue_mail_doc(pdf_document *doc, pdf_mail_doc_event *event)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_event_issue_mail_doc(): auto_ctx=%p doc=%p event=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, event);
	}
	fz_try(auto_ctx) {
		::pdf_event_issue_mail_doc(auto_ctx, doc, event);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_event_issue_print(). */
void ppdf_event_issue_print(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_event_issue_print(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_event_issue_print(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_border_style(). */
char *ppdf_field_border_style(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_border_style(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_border_style(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_display(). */
int ppdf_field_display(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_display(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_display(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_event_calculate(). */
void ppdf_field_event_calculate(pdf_document *doc, pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_event_calculate(): auto_ctx=%p doc=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field);
	}
	fz_try(auto_ctx) {
		::pdf_field_event_calculate(auto_ctx, doc, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_event_format(). */
char *ppdf_field_event_format(pdf_document *doc, pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_event_format(): auto_ctx=%p doc=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_event_format(auto_ctx, doc, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_event_keystroke(). */
int ppdf_field_event_keystroke(pdf_document *doc, pdf_obj *field, pdf_keystroke_event *evt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_event_keystroke(): auto_ctx=%p doc=%p field=%p evt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field, evt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_event_keystroke(auto_ctx, doc, field, evt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_event_validate(). */
int ppdf_field_event_validate(pdf_document *doc, pdf_obj *field, const char *value)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_event_validate(): auto_ctx=%p doc=%p field=%p value=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field, value);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_event_validate(auto_ctx, doc, field, value);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_flags(). */
int ppdf_field_flags(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_flags(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_flags(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_label(). */
const char *ppdf_field_label(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_label(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_label(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_name(). */
char *ppdf_field_name(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_name(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_name(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_reset(). */
void ppdf_field_reset(pdf_document *doc, pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_reset(): auto_ctx=%p doc=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field);
	}
	fz_try(auto_ctx) {
		::pdf_field_reset(auto_ctx, doc, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_set_border_style(). */
void ppdf_field_set_border_style(pdf_obj *field, const char *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_set_border_style(): auto_ctx=%p field=%p text=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field, text);
	}
	fz_try(auto_ctx) {
		::pdf_field_set_border_style(auto_ctx, field, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_set_button_caption(). */
void ppdf_field_set_button_caption(pdf_obj *field, const char *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_set_button_caption(): auto_ctx=%p field=%p text=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field, text);
	}
	fz_try(auto_ctx) {
		::pdf_field_set_button_caption(auto_ctx, field, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_set_display(). */
void ppdf_field_set_display(pdf_obj *field, int d)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_set_display(): auto_ctx=%p field=%p (long)d=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field, (long)d);
	}
	fz_try(auto_ctx) {
		::pdf_field_set_display(auto_ctx, field, d);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_set_fill_color(). */
void ppdf_field_set_fill_color(pdf_obj *field, pdf_obj *col)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_set_fill_color(): auto_ctx=%p field=%p col=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field, col);
	}
	fz_try(auto_ctx) {
		::pdf_field_set_fill_color(auto_ctx, field, col);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_set_text_color(). */
void ppdf_field_set_text_color(pdf_obj *field, pdf_obj *col)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_set_text_color(): auto_ctx=%p field=%p col=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field, col);
	}
	fz_try(auto_ctx) {
		::pdf_field_set_text_color(auto_ctx, field, col);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_field_type(). */
int ppdf_field_type(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_type(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_type(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_field_value(). */
const char *ppdf_field_value(pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_field_value(): auto_ctx=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, field);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_field_value(auto_ctx, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_filter_annot_contents(). */
void ppdf_filter_annot_contents(pdf_document *doc, pdf_annot *annot, pdf_filter_options *filter)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_filter_annot_contents(): auto_ctx=%p doc=%p annot=%p filter=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, annot, filter);
	}
	fz_try(auto_ctx) {
		::pdf_filter_annot_contents(auto_ctx, doc, annot, filter);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_filter_page_contents(). */
void ppdf_filter_page_contents(pdf_document *doc, pdf_page *page, pdf_filter_options *filter)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_filter_page_contents(): auto_ctx=%p doc=%p page=%p filter=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, page, filter);
	}
	fz_try(auto_ctx) {
		::pdf_filter_page_contents(auto_ctx, doc, page, filter);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_filter_xobject_instance(). */
pdf_obj *ppdf_filter_xobject_instance(pdf_obj *old_xobj, pdf_obj *page_res, fz_matrix ctm, pdf_filter_options *filter)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_filter_xobject_instance(): auto_ctx=%p old_xobj=%p page_res=%p &ctm=%p filter=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, old_xobj, page_res, &ctm, filter);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_filter_xobject_instance(auto_ctx, old_xobj, page_res, ctm, filter);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_find_font_resource(). */
pdf_obj *ppdf_find_font_resource(pdf_document *doc, int type, int encoding, fz_font *item, unsigned char md5[16])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_find_font_resource(): auto_ctx=%p doc=%p (long)type=%li (long)encoding=%li item=%p (long)md5=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)type, (long)encoding, item, (long)md5);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_find_font_resource(auto_ctx, doc, type, encoding, item, md5);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_find_image_resource(). */
pdf_obj *ppdf_find_image_resource(pdf_document *doc, fz_image *item, unsigned char md5[16])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_find_image_resource(): auto_ctx=%p doc=%p item=%p (long)md5=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, item, (long)md5);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_find_image_resource(auto_ctx, doc, item, md5);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_find_item(). */
void *ppdf_find_item(fz_store_drop_fn *drop, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_find_item(): auto_ctx=%p drop=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, drop, key);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_find_item(auto_ctx, drop, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_find_locked_fields(). */
pdf_locked_fields *ppdf_find_locked_fields(pdf_document *doc, int version)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_find_locked_fields(): auto_ctx=%p doc=%p (long)version=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)version);
	}
	pdf_locked_fields * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_find_locked_fields(auto_ctx, doc, version);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_find_locked_fields_for_sig(). */
pdf_locked_fields *ppdf_find_locked_fields_for_sig(pdf_document *doc, pdf_obj *sig)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_find_locked_fields_for_sig(): auto_ctx=%p doc=%p sig=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, sig);
	}
	pdf_locked_fields * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_find_locked_fields_for_sig(auto_ctx, doc, sig);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_find_version_for_obj(). */
int ppdf_find_version_for_obj(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_find_version_for_obj(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_find_version_for_obj(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_first_annot(). */
pdf_annot *ppdf_first_annot(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_first_annot(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	pdf_annot * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_first_annot(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_first_widget(). */
pdf_widget *ppdf_first_widget(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_first_widget(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	pdf_widget * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_first_widget(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_flatten_inheritable_page_items(). */
void ppdf_flatten_inheritable_page_items(pdf_obj *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_flatten_inheritable_page_items(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_try(auto_ctx) {
		::pdf_flatten_inheritable_page_items(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_font_cid_to_gid(). */
int ppdf_font_cid_to_gid(pdf_font_desc *fontdesc, int cid)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_font_cid_to_gid(): auto_ctx=%p fontdesc=%p (long)cid=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fontdesc, (long)cid);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_font_cid_to_gid(auto_ctx, fontdesc, cid);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_font_writing_supported(). */
int ppdf_font_writing_supported(fz_font *font)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_font_writing_supported(): font=%p\n", __FILE__, __LINE__, __FUNCTION__, font);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_font_writing_supported(font);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_forget_xref(). */
void ppdf_forget_xref(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_forget_xref(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_forget_xref(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_format_date(). */
void ppdf_format_date(char *s, int n, int64_t secs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_format_date(): auto_ctx=%p s=%s (long)n=%li (long)secs=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, s, (long)n, (long)secs);
	}
	fz_try(auto_ctx) {
		::pdf_format_date(auto_ctx, s, n, secs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_format_write_options(). */
char *ppdf_format_write_options(char *buffer, size_t buffer_len, const pdf_write_options *opts)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_format_write_options(): auto_ctx=%p buffer=%s (long)buffer_len=%li opts=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buffer, (long)buffer_len, opts);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_format_write_options(auto_ctx, buffer, buffer_len, opts);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_function_size(). */
size_t ppdf_function_size(pdf_function *func)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_function_size(): auto_ctx=%p func=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, func);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_function_size(auto_ctx, func);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_get_bound_document(). */
pdf_document *ppdf_get_bound_document(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_get_bound_document(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_get_bound_document(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_get_doc_event_callback_data(). */
void *ppdf_get_doc_event_callback_data(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_get_doc_event_callback_data(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_get_doc_event_callback_data(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_get_indirect_document(). */
pdf_document *ppdf_get_indirect_document(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_get_indirect_document(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_get_indirect_document(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_get_populating_xref_entry(). */
pdf_xref_entry *ppdf_get_populating_xref_entry(pdf_document *doc, int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_get_populating_xref_entry(): auto_ctx=%p doc=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)i);
	}
	pdf_xref_entry * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_get_populating_xref_entry(auto_ctx, doc, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_get_widget_editing_state(). */
int ppdf_get_widget_editing_state(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_get_widget_editing_state(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_get_widget_editing_state(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_get_xref_entry(). */
pdf_xref_entry *ppdf_get_xref_entry(pdf_document *doc, int i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_get_xref_entry(): auto_ctx=%p doc=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)i);
	}
	pdf_xref_entry * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_get_xref_entry(auto_ctx, doc, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_graft_mapped_object(). */
pdf_obj *ppdf_graft_mapped_object(pdf_graft_map *map, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_graft_mapped_object(): auto_ctx=%p map=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, map, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_graft_mapped_object(auto_ctx, map, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_graft_object(). */
pdf_obj *ppdf_graft_object(pdf_document *dst, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_graft_object(): auto_ctx=%p dst=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dst, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_graft_object(auto_ctx, dst, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_guess_mime_type_from_file_name(). */
const char *ppdf_guess_mime_type_from_file_name(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_guess_mime_type_from_file_name(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_guess_mime_type_from_file_name(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_has_permission(). */
int ppdf_has_permission(pdf_document *doc, fz_permission p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_has_permission(): auto_ctx=%p doc=%p (long)p=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)p);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_has_permission(auto_ctx, doc, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_has_unsaved_changes(). */
int ppdf_has_unsaved_changes(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_has_unsaved_changes(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_has_unsaved_changes(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_has_unsaved_sigs(). */
int ppdf_has_unsaved_sigs(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_has_unsaved_sigs(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_has_unsaved_sigs(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_insert_font_resource(). */
pdf_obj *ppdf_insert_font_resource(pdf_document *doc, unsigned char md5[16], pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_insert_font_resource(): auto_ctx=%p doc=%p (long)md5=%li obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)md5, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_insert_font_resource(auto_ctx, doc, md5, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_insert_image_resource(). */
pdf_obj *ppdf_insert_image_resource(pdf_document *doc, unsigned char md5[16], pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_insert_image_resource(): auto_ctx=%p doc=%p (long)md5=%li obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)md5, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_insert_image_resource(auto_ctx, doc, md5, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_insert_page(). */
void ppdf_insert_page(pdf_document *doc, int at, pdf_obj *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_insert_page(): auto_ctx=%p doc=%p (long)at=%li page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)at, page);
	}
	fz_try(auto_ctx) {
		::pdf_insert_page(auto_ctx, doc, at, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_invalidate_xfa(). */
void ppdf_invalidate_xfa(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_invalidate_xfa(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_invalidate_xfa(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_is_array(). */
int ppdf_is_array(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_array(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_array(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_bool(). */
int ppdf_is_bool(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_bool(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_bool(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_dict(). */
int ppdf_is_dict(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_dict(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_dict(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_embedded_file(). */
int ppdf_is_embedded_file(pdf_obj *fs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_embedded_file(): auto_ctx=%p fs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_embedded_file(auto_ctx, fs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_field_locked(). */
int ppdf_is_field_locked(pdf_locked_fields *locked, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_field_locked(): auto_ctx=%p locked=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, locked, name);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_field_locked(auto_ctx, locked, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_hidden_ocg(). */
int ppdf_is_hidden_ocg(pdf_ocg_descriptor *desc, pdf_obj *rdb, const char *usage, pdf_obj *ocg)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_hidden_ocg(): auto_ctx=%p desc=%p rdb=%p usage=%s ocg=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, desc, rdb, usage, ocg);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_hidden_ocg(auto_ctx, desc, rdb, usage, ocg);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_indirect(). */
int ppdf_is_indirect(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_indirect(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_indirect(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_int(). */
int ppdf_is_int(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_int(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_int(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_jpx_image(). */
int ppdf_is_jpx_image(pdf_obj *dict)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_jpx_image(): auto_ctx=%p dict=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_jpx_image(auto_ctx, dict);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_name(). */
int ppdf_is_name(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_name(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_name(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_null(). */
int ppdf_is_null(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_null(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_null(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_number(). */
int ppdf_is_number(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_number(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_number(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_real(). */
int ppdf_is_real(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_real(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_real(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_stream(). */
int ppdf_is_stream(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_stream(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_stream(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_string(). */
int ppdf_is_string(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_string(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_string(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_is_tint_colorspace(). */
int ppdf_is_tint_colorspace(fz_colorspace *cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_is_tint_colorspace(): auto_ctx=%p cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cs);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_is_tint_colorspace(auto_ctx, cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_js_event_init(). */
void ppdf_js_event_init(pdf_js *js, pdf_obj *target, const char *value, int willCommit)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_js_event_init(): js=%p target=%p value=%s (long)willCommit=%li\n", __FILE__, __LINE__, __FUNCTION__, js, target, value, (long)willCommit);
	}
	fz_try(auto_ctx) {
		::pdf_js_event_init(js, target, value, willCommit);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_js_event_init_keystroke(). */
void ppdf_js_event_init_keystroke(pdf_js *js, pdf_obj *target, pdf_keystroke_event *evt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_js_event_init_keystroke(): js=%p target=%p evt=%p\n", __FILE__, __LINE__, __FUNCTION__, js, target, evt);
	}
	fz_try(auto_ctx) {
		::pdf_js_event_init_keystroke(js, target, evt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_js_event_result(). */
int ppdf_js_event_result(pdf_js *js)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_js_event_result(): js=%p\n", __FILE__, __LINE__, __FUNCTION__, js);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_js_event_result(js);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_js_event_result_keystroke(). */
int ppdf_js_event_result_keystroke(pdf_js *js, pdf_keystroke_event *evt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_js_event_result_keystroke(): js=%p evt=%p\n", __FILE__, __LINE__, __FUNCTION__, js, evt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_js_event_result_keystroke(js, evt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_js_event_value(). */
char *ppdf_js_event_value(pdf_js *js)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_js_event_value(): js=%p\n", __FILE__, __LINE__, __FUNCTION__, js);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_js_event_value(js);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_js_execute(). */
void ppdf_js_execute(pdf_js *js, const char *name, const char *code)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_js_execute(): js=%p name=%s code=%s\n", __FILE__, __LINE__, __FUNCTION__, js, name, code);
	}
	fz_try(auto_ctx) {
		::pdf_js_execute(js, name, code);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_js_supported(). */
int ppdf_js_supported(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_js_supported(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_js_supported(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_annot(). */
pdf_annot *ppdf_keep_annot(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_annot(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	pdf_annot * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_annot(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_cmap(). */
pdf_cmap *ppdf_keep_cmap(pdf_cmap *cmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_cmap(): auto_ctx=%p cmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap);
	}
	pdf_cmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_cmap(auto_ctx, cmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_document(). */
pdf_document *ppdf_keep_document(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_document(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_document(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_font(). */
pdf_font_desc *ppdf_keep_font(pdf_font_desc *fontdesc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_font(): auto_ctx=%p fontdesc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fontdesc);
	}
	pdf_font_desc * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_font(auto_ctx, fontdesc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_function(). */
pdf_function *ppdf_keep_function(pdf_function *func)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_function(): auto_ctx=%p func=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, func);
	}
	pdf_function * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_function(auto_ctx, func);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_graft_map(). */
pdf_graft_map *ppdf_keep_graft_map(pdf_graft_map *map)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_graft_map(): auto_ctx=%p map=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, map);
	}
	pdf_graft_map * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_graft_map(auto_ctx, map);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_obj(). */
pdf_obj *ppdf_keep_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_pattern(). */
pdf_pattern *ppdf_keep_pattern(pdf_pattern *pat)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_pattern(): auto_ctx=%p pat=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pat);
	}
	pdf_pattern * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_pattern(auto_ctx, pat);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_keep_widget(). */
pdf_widget *ppdf_keep_widget(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_keep_widget(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	pdf_widget * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_keep_widget(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_layer_config_info(). */
void ppdf_layer_config_info(pdf_document *doc, int config_num, pdf_layer_config *info)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_layer_config_info(): auto_ctx=%p doc=%p (long)config_num=%li info=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)config_num, info);
	}
	fz_try(auto_ctx) {
		::pdf_layer_config_info(auto_ctx, doc, config_num, info);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_layer_config_ui_info(). */
void ppdf_layer_config_ui_info(pdf_document *doc, int ui, pdf_layer_config_ui *info)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_layer_config_ui_info(): auto_ctx=%p doc=%p (long)ui=%li info=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)ui, info);
	}
	fz_try(auto_ctx) {
		::pdf_layer_config_ui_info(auto_ctx, doc, ui, info);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_layout_text_widget(). */
fz_layout_block *ppdf_layout_text_widget(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_layout_text_widget(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_layout_block * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_layout_text_widget(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lex(). */
pdf_token ppdf_lex(fz_stream *f, pdf_lexbuf *lexbuf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lex(): auto_ctx=%p f=%p lexbuf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, f, lexbuf);
	}
	pdf_token ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lex(auto_ctx, f, lexbuf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lex_no_string(). */
pdf_token ppdf_lex_no_string(fz_stream *f, pdf_lexbuf *lexbuf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lex_no_string(): auto_ctx=%p f=%p lexbuf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, f, lexbuf);
	}
	pdf_token ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lex_no_string(auto_ctx, f, lexbuf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lexbuf_fin(). */
void ppdf_lexbuf_fin(pdf_lexbuf *lexbuf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lexbuf_fin(): auto_ctx=%p lexbuf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, lexbuf);
	}
	fz_try(auto_ctx) {
		::pdf_lexbuf_fin(auto_ctx, lexbuf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_lexbuf_grow(). */
ptrdiff_t ppdf_lexbuf_grow(pdf_lexbuf *lexbuf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lexbuf_grow(): auto_ctx=%p lexbuf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, lexbuf);
	}
	ptrdiff_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lexbuf_grow(auto_ctx, lexbuf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lexbuf_init(). */
void ppdf_lexbuf_init(pdf_lexbuf *lexbuf, int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lexbuf_init(): auto_ctx=%p lexbuf=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, lexbuf, (long)size);
	}
	fz_try(auto_ctx) {
		::pdf_lexbuf_init(auto_ctx, lexbuf, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_line_ending_from_name(). */
enum pdf_line_ending ppdf_line_ending_from_name(pdf_obj *end)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_line_ending_from_name(): auto_ctx=%p end=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, end);
	}
	enum pdf_line_ending ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_line_ending_from_name(auto_ctx, end);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_line_ending_from_string(). */
enum pdf_line_ending ppdf_line_ending_from_string(const char *end)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_line_ending_from_string(): auto_ctx=%p end=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, end);
	}
	enum pdf_line_ending ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_line_ending_from_string(auto_ctx, end);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_annots(). */
void ppdf_load_annots(pdf_page *page, pdf_obj *annots)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_annots(): auto_ctx=%p page=%p annots=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, annots);
	}
	fz_try(auto_ctx) {
		::pdf_load_annots(auto_ctx, page, annots);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_load_builtin_cmap(). */
pdf_cmap *ppdf_load_builtin_cmap(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_builtin_cmap(): auto_ctx=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name);
	}
	pdf_cmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_builtin_cmap(auto_ctx, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_cmap(). */
pdf_cmap *ppdf_load_cmap(fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_cmap(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	pdf_cmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_cmap(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_colorspace(). */
fz_colorspace *ppdf_load_colorspace(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_colorspace(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_colorspace(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_compressed_inline_image(). */
void ppdf_load_compressed_inline_image(pdf_document *doc, pdf_obj *dict, int length, fz_stream *cstm, int indexed, fz_compressed_image *image)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_compressed_inline_image(): auto_ctx=%p doc=%p dict=%p (long)length=%li cstm=%p (long)indexed=%li image=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, dict, (long)length, cstm, (long)indexed, image);
	}
	fz_try(auto_ctx) {
		::pdf_load_compressed_inline_image(auto_ctx, doc, dict, length, cstm, indexed, image);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_load_compressed_stream(). */
fz_compressed_buffer *ppdf_load_compressed_stream(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_compressed_stream(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_compressed_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_compressed_stream(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_default_colorspaces(). */
fz_default_colorspaces *ppdf_load_default_colorspaces(pdf_document *doc, pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_default_colorspaces(): auto_ctx=%p doc=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, page);
	}
	fz_default_colorspaces * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_default_colorspaces(auto_ctx, doc, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_embedded_cmap(). */
pdf_cmap *ppdf_load_embedded_cmap(pdf_document *doc, pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_embedded_cmap(): auto_ctx=%p doc=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, ref);
	}
	pdf_cmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_embedded_cmap(auto_ctx, doc, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_embedded_file(). */
fz_buffer *ppdf_load_embedded_file(pdf_obj *fs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_embedded_file(): auto_ctx=%p fs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, fs);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_embedded_file(auto_ctx, fs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_encoding(). */
void ppdf_load_encoding(const char **estrings, const char *encoding)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_encoding(): estrings=%p encoding=%s\n", __FILE__, __LINE__, __FUNCTION__, estrings, encoding);
	}
	fz_try(auto_ctx) {
		::pdf_load_encoding(estrings, encoding);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_load_font(). */
pdf_font_desc *ppdf_load_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_font(): auto_ctx=%p doc=%p rdb=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, rdb, obj);
	}
	pdf_font_desc * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_font(auto_ctx, doc, rdb, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_function(). */
pdf_function *ppdf_load_function(pdf_obj *ref, int in, int out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_function(): auto_ctx=%p ref=%p (long)in=%li (long)out=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref, (long)in, (long)out);
	}
	pdf_function * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_function(auto_ctx, ref, in, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_hail_mary_font(). */
pdf_font_desc *ppdf_load_hail_mary_font(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_hail_mary_font(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	pdf_font_desc * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_hail_mary_font(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_image(). */
fz_image *ppdf_load_image(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_image(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_image(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_inline_image(). */
fz_image *ppdf_load_inline_image(pdf_document *doc, pdf_obj *rdb, pdf_obj *dict, fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_inline_image(): auto_ctx=%p doc=%p rdb=%p dict=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, rdb, dict, file);
	}
	fz_image * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_inline_image(auto_ctx, doc, rdb, dict, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_link_annots(). */
fz_link *ppdf_load_link_annots(pdf_document *arg_1, pdf_obj *annots, int pagenum, fz_matrix page_ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_link_annots(): auto_ctx=%p arg_1=%p annots=%p (long)pagenum=%li &page_ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, arg_1, annots, (long)pagenum, &page_ctm);
	}
	fz_link * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_link_annots(auto_ctx, arg_1, annots, pagenum, page_ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_links(). */
fz_link *ppdf_load_links(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_links(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_link * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_links(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_name_tree(). */
pdf_obj *ppdf_load_name_tree(pdf_document *doc, pdf_obj *which)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_name_tree(): auto_ctx=%p doc=%p which=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, which);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_name_tree(auto_ctx, doc, which);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_object(). */
pdf_obj *ppdf_load_object(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_object(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_object(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_outline(). */
fz_outline *ppdf_load_outline(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_outline(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_outline * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_outline(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_page(). */
pdf_page *ppdf_load_page(pdf_document *doc, int number)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_page(): auto_ctx=%p doc=%p (long)number=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)number);
	}
	pdf_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_page(auto_ctx, doc, number);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_page_imp(). */
fz_page *ppdf_load_page_imp(fz_document *doc, int chapter, int number)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_page_imp(): auto_ctx=%p doc=%p (long)chapter=%li (long)number=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)chapter, (long)number);
	}
	fz_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_page_imp(auto_ctx, doc, chapter, number);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_page_tree(). */
void ppdf_load_page_tree(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_page_tree(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_load_page_tree(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_load_pattern(). */
pdf_pattern *ppdf_load_pattern(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_pattern(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	pdf_pattern * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_pattern(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_raw_stream(). */
fz_buffer *ppdf_load_raw_stream(pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_raw_stream(): auto_ctx=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_raw_stream(auto_ctx, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_raw_stream_number(). */
fz_buffer *ppdf_load_raw_stream_number(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_raw_stream_number(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_raw_stream_number(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_shading(). */
fz_shade *ppdf_load_shading(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_shading(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	fz_shade * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_shading(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_stream(). */
fz_buffer *ppdf_load_stream(pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_stream(): auto_ctx=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_stream(auto_ctx, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_stream_number(). */
fz_buffer *ppdf_load_stream_number(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_stream_number(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_buffer * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_stream_number(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_stream_or_string_as_utf8(). */
char *ppdf_load_stream_or_string_as_utf8(pdf_obj *src)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_stream_or_string_as_utf8(): auto_ctx=%p src=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, src);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_stream_or_string_as_utf8(auto_ctx, src);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_system_cmap(). */
pdf_cmap *ppdf_load_system_cmap(const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_system_cmap(): auto_ctx=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name);
	}
	pdf_cmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_system_cmap(auto_ctx, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_to_unicode(). */
void ppdf_load_to_unicode(pdf_document *doc, pdf_font_desc *font, const char **strings, char *collection, pdf_obj *cmapstm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_to_unicode(): auto_ctx=%p doc=%p font=%p strings=%p collection=%s cmapstm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, font, strings, collection, cmapstm);
	}
	fz_try(auto_ctx) {
		::pdf_load_to_unicode(auto_ctx, doc, font, strings, collection, cmapstm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_load_type3_font(). */
pdf_font_desc *ppdf_load_type3_font(pdf_document *doc, pdf_obj *rdb, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_type3_font(): auto_ctx=%p doc=%p rdb=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, rdb, obj);
	}
	pdf_font_desc * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_type3_font(auto_ctx, doc, rdb, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_load_type3_glyphs(). */
void ppdf_load_type3_glyphs(pdf_document *doc, pdf_font_desc *fontdesc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_type3_glyphs(): auto_ctx=%p doc=%p fontdesc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, fontdesc);
	}
	fz_try(auto_ctx) {
		::pdf_load_type3_glyphs(auto_ctx, doc, fontdesc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_load_unencrypted_object(). */
pdf_obj *ppdf_load_unencrypted_object(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_load_unencrypted_object(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_load_unencrypted_object(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_localise_page_resources(). */
void ppdf_localise_page_resources(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_localise_page_resources(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_localise_page_resources(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_lookup_anchor(). */
int ppdf_lookup_anchor(pdf_document *doc, const char *name, float *xp, float *yp)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_anchor(): auto_ctx=%p doc=%p name=%s xp=%p yp=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, name, xp, yp);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_anchor(auto_ctx, doc, name, xp, yp);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_cmap(). */
int ppdf_lookup_cmap(pdf_cmap *cmap, unsigned int cpt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_cmap(): cmap=%p (long)cpt=%li\n", __FILE__, __LINE__, __FUNCTION__, cmap, (long)cpt);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_cmap(cmap, cpt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_cmap_full(). */
int ppdf_lookup_cmap_full(pdf_cmap *cmap, unsigned int cpt, int *out)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_cmap_full(): cmap=%p (long)cpt=%li out=%p\n", __FILE__, __LINE__, __FUNCTION__, cmap, (long)cpt, out);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_cmap_full(cmap, cpt, out);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_dest(). */
pdf_obj *ppdf_lookup_dest(pdf_document *doc, pdf_obj *needle)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_dest(): auto_ctx=%p doc=%p needle=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, needle);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_dest(auto_ctx, doc, needle);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_field(). */
pdf_obj *ppdf_lookup_field(pdf_obj *form, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_field(): auto_ctx=%p form=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, form, name);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_field(auto_ctx, form, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_hmtx(). */
pdf_hmtx ppdf_lookup_hmtx(pdf_font_desc *font, int cid)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_hmtx(): auto_ctx=%p font=%p (long)cid=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)cid);
	}
	pdf_hmtx ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_hmtx(auto_ctx, font, cid);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_metadata(). */
int ppdf_lookup_metadata(pdf_document *doc, const char *key, char *ptr, int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_metadata(): auto_ctx=%p doc=%p key=%s ptr=%s (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, key, ptr, (long)size);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_metadata(auto_ctx, doc, key, ptr, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_name(). */
pdf_obj *ppdf_lookup_name(pdf_document *doc, pdf_obj *which, pdf_obj *needle)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_name(): auto_ctx=%p doc=%p which=%p needle=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, which, needle);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_name(auto_ctx, doc, which, needle);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_number(). */
pdf_obj *ppdf_lookup_number(pdf_obj *root, int needle)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_number(): auto_ctx=%p root=%p (long)needle=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, root, (long)needle);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_number(auto_ctx, root, needle);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_page_number(). */
int ppdf_lookup_page_number(pdf_document *doc, pdf_obj *pageobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_page_number(): auto_ctx=%p doc=%p pageobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, pageobj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_page_number(auto_ctx, doc, pageobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_page_obj(). */
pdf_obj *ppdf_lookup_page_obj(pdf_document *doc, int needle)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_page_obj(): auto_ctx=%p doc=%p (long)needle=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)needle);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_page_obj(auto_ctx, doc, needle);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_substitute_font(). */
const unsigned char *ppdf_lookup_substitute_font(int mono, int serif, int bold, int italic, int *len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_substitute_font(): auto_ctx=%p (long)mono=%li (long)serif=%li (long)bold=%li (long)italic=%li len=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)mono, (long)serif, (long)bold, (long)italic, len);
	}
	const unsigned char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_substitute_font(auto_ctx, mono, serif, bold, italic, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_lookup_vmtx(). */
pdf_vmtx ppdf_lookup_vmtx(pdf_font_desc *font, int cid)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_lookup_vmtx(): auto_ctx=%p font=%p (long)cid=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)cid);
	}
	pdf_vmtx ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_lookup_vmtx(auto_ctx, font, cid);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_map_one_to_many(). */
void ppdf_map_one_to_many(pdf_cmap *cmap, unsigned int one, int *many, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_map_one_to_many(): auto_ctx=%p cmap=%p (long)one=%li many=%p (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap, (long)one, many, (long)len);
	}
	fz_try(auto_ctx) {
		::pdf_map_one_to_many(auto_ctx, cmap, one, many, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_map_range_to_range(). */
void ppdf_map_range_to_range(pdf_cmap *cmap, unsigned int srclo, unsigned int srchi, int dstlo)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_map_range_to_range(): auto_ctx=%p cmap=%p (long)srclo=%li (long)srchi=%li (long)dstlo=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap, (long)srclo, (long)srchi, (long)dstlo);
	}
	fz_try(auto_ctx) {
		::pdf_map_range_to_range(auto_ctx, cmap, srclo, srchi, dstlo);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_mark_obj(). */
int ppdf_mark_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_mark_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_mark_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_mark_xref(). */
void ppdf_mark_xref(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_mark_xref(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_mark_xref(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_name_eq(). */
int ppdf_name_eq(pdf_obj *a, pdf_obj *b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_name_eq(): auto_ctx=%p a=%p b=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, a, b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_name_eq(auto_ctx, a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_name_from_line_ending(). */
pdf_obj *ppdf_name_from_line_ending(enum pdf_line_ending end)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_name_from_line_ending(): auto_ctx=%p (long)end=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)end);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_name_from_line_ending(auto_ctx, end);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_needs_password(). */
int ppdf_needs_password(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_needs_password(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_needs_password(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_array(). */
pdf_obj *ppdf_new_array(pdf_document *doc, int initialcap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_array(): auto_ctx=%p doc=%p (long)initialcap=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)initialcap);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_array(auto_ctx, doc, initialcap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_buffer_processor(). */
pdf_processor *ppdf_new_buffer_processor(fz_buffer *buffer, int ahxencode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_buffer_processor(): auto_ctx=%p buffer=%p (long)ahxencode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buffer, (long)ahxencode);
	}
	pdf_processor * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_buffer_processor(auto_ctx, buffer, ahxencode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_cmap(). */
pdf_cmap *ppdf_new_cmap()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_cmap(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	pdf_cmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_cmap(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_crypt(). */
pdf_crypt *ppdf_new_crypt(pdf_obj *enc, pdf_obj *id)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_crypt(): auto_ctx=%p enc=%p id=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, enc, id);
	}
	pdf_crypt * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_crypt(auto_ctx, enc, id);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_dict(). */
pdf_obj *ppdf_new_dict(pdf_document *doc, int initialcap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_dict(): auto_ctx=%p doc=%p (long)initialcap=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)initialcap);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_dict(auto_ctx, doc, initialcap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_display_list_from_annot(). */
fz_display_list *ppdf_new_display_list_from_annot(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_display_list_from_annot(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_display_list * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_display_list_from_annot(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_encrypt(). */
pdf_crypt *ppdf_new_encrypt(const char *opwd_utf8, const char *upwd_utf8, pdf_obj *id, int permissions, int algorithm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_encrypt(): auto_ctx=%p opwd_utf8=%s upwd_utf8=%s id=%p (long)permissions=%li (long)algorithm=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, opwd_utf8, upwd_utf8, id, (long)permissions, (long)algorithm);
	}
	pdf_crypt * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_encrypt(auto_ctx, opwd_utf8, upwd_utf8, id, permissions, algorithm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_filter_processor(). */
pdf_processor *ppdf_new_filter_processor(pdf_document *doc, pdf_processor *chain, pdf_obj *old_res, pdf_obj *new_res, int struct_parents, fz_matrix transform, pdf_filter_options *filter)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_filter_processor(): auto_ctx=%p doc=%p chain=%p old_res=%p new_res=%p (long)struct_parents=%li &transform=%p filter=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, chain, old_res, new_res, (long)struct_parents, &transform, filter);
	}
	pdf_processor * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_filter_processor(auto_ctx, doc, chain, old_res, new_res, struct_parents, transform, filter);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_font_desc(). */
pdf_font_desc *ppdf_new_font_desc()
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_font_desc(): auto_ctx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx);
	}
	pdf_font_desc * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_font_desc(auto_ctx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_graft_map(). */
pdf_graft_map *ppdf_new_graft_map(pdf_document *dst)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_graft_map(): auto_ctx=%p dst=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dst);
	}
	pdf_graft_map * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_graft_map(auto_ctx, dst);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_identity_cmap(). */
pdf_cmap *ppdf_new_identity_cmap(int wmode, int bytes)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_identity_cmap(): auto_ctx=%p (long)wmode=%li (long)bytes=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)wmode, (long)bytes);
	}
	pdf_cmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_identity_cmap(auto_ctx, wmode, bytes);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_indirect(). */
pdf_obj *ppdf_new_indirect(pdf_document *doc, int num, int gen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_indirect(): auto_ctx=%p doc=%p (long)num=%li (long)gen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num, (long)gen);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_indirect(auto_ctx, doc, num, gen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_int(). */
pdf_obj *ppdf_new_int(int64_t i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_int(): auto_ctx=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)i);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_int(auto_ctx, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_matrix(). */
pdf_obj *ppdf_new_matrix(pdf_document *doc, fz_matrix mtx)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_matrix(): auto_ctx=%p doc=%p &mtx=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &mtx);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_matrix(auto_ctx, doc, mtx);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_name(). */
pdf_obj *ppdf_new_name(const char *str)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_name(): auto_ctx=%p str=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, str);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_name(auto_ctx, str);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_output_processor(). */
pdf_processor *ppdf_new_output_processor(fz_output *out, int ahxencode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_output_processor(): auto_ctx=%p out=%p (long)ahxencode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, (long)ahxencode);
	}
	pdf_processor * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_output_processor(auto_ctx, out, ahxencode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_pdf_device(). */
fz_device *ppdf_new_pdf_device(pdf_document *doc, fz_matrix topctm, fz_rect mediabox, pdf_obj *resources, fz_buffer *contents)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_pdf_device(): auto_ctx=%p doc=%p &topctm=%p &mediabox=%p resources=%p contents=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &topctm, &mediabox, resources, contents);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_pdf_device(auto_ctx, doc, topctm, mediabox, resources, contents);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_pixmap_from_annot(). */
fz_pixmap *ppdf_new_pixmap_from_annot(pdf_annot *annot, fz_matrix ctm, fz_colorspace *cs, fz_separations *seps, int alpha)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_pixmap_from_annot(): auto_ctx=%p annot=%p &ctm=%p cs=%p seps=%p (long)alpha=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, &ctm, cs, seps, (long)alpha);
	}
	fz_pixmap * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_pixmap_from_annot(auto_ctx, annot, ctm, cs, seps, alpha);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_processor(). */
void *ppdf_new_processor(int size)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_processor(): auto_ctx=%p (long)size=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)size);
	}
	void * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_processor(auto_ctx, size);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_real(). */
pdf_obj *ppdf_new_real(float f)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_real(): auto_ctx=%p (long)f=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)f);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_real(auto_ctx, f);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_rect(). */
pdf_obj *ppdf_new_rect(pdf_document *doc, fz_rect rect)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_rect(): auto_ctx=%p doc=%p &rect=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &rect);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_rect(auto_ctx, doc, rect);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_run_processor(). */
pdf_processor *ppdf_new_run_processor(fz_device *dev, fz_matrix ctm, const char *usage, pdf_gstate *gstate, fz_default_colorspaces *default_cs, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_run_processor(): auto_ctx=%p dev=%p &ctm=%p usage=%s gstate=%p default_cs=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dev, &ctm, usage, gstate, default_cs, cookie);
	}
	pdf_processor * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_run_processor(auto_ctx, dev, ctm, usage, gstate, default_cs, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_stext_page_from_annot(). */
fz_stext_page *ppdf_new_stext_page_from_annot(pdf_annot *annot, const fz_stext_options *options)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_stext_page_from_annot(): auto_ctx=%p annot=%p options=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, options);
	}
	fz_stext_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_stext_page_from_annot(auto_ctx, annot, options);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_string(). */
pdf_obj *ppdf_new_string(const char *str, size_t len)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_string(): auto_ctx=%p str=%s (long)len=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, str, (long)len);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_string(auto_ctx, str, len);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_text_string(). */
pdf_obj *ppdf_new_text_string(const char *s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_text_string(): auto_ctx=%p s=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, s);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_text_string(auto_ctx, s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_utf8_from_pdf_stream_obj(). */
char *ppdf_new_utf8_from_pdf_stream_obj(pdf_obj *src)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_utf8_from_pdf_stream_obj(): auto_ctx=%p src=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, src);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_utf8_from_pdf_stream_obj(auto_ctx, src);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_utf8_from_pdf_string(). */
char *ppdf_new_utf8_from_pdf_string(const char *srcptr, size_t srclen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_utf8_from_pdf_string(): auto_ctx=%p srcptr=%s (long)srclen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, srcptr, (long)srclen);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_utf8_from_pdf_string(auto_ctx, srcptr, srclen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_utf8_from_pdf_string_obj(). */
char *ppdf_new_utf8_from_pdf_string_obj(pdf_obj *src)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_utf8_from_pdf_string_obj(): auto_ctx=%p src=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, src);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_utf8_from_pdf_string_obj(auto_ctx, src);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_new_xobject(). */
pdf_obj *ppdf_new_xobject(pdf_document *doc, fz_rect bbox, fz_matrix matrix, pdf_obj *res, fz_buffer *buffer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_new_xobject(): auto_ctx=%p doc=%p &bbox=%p &matrix=%p res=%p buffer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &bbox, &matrix, res, buffer);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_new_xobject(auto_ctx, doc, bbox, matrix, res, buffer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_next_annot(). */
pdf_annot *ppdf_next_annot(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_next_annot(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	pdf_annot * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_next_annot(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_next_widget(). */
pdf_widget *ppdf_next_widget(pdf_widget *previous)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_next_widget(): auto_ctx=%p previous=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, previous);
	}
	pdf_widget * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_next_widget(auto_ctx, previous);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_obj_is_dirty(). */
int ppdf_obj_is_dirty(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_obj_is_dirty(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_obj_is_dirty(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_obj_marked(). */
int ppdf_obj_marked(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_obj_marked(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_obj_marked(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_obj_memo(). */
int ppdf_obj_memo(pdf_obj *obj, int bit, int *memo)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_obj_memo(): auto_ctx=%p obj=%p (long)bit=%li memo=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj, (long)bit, memo);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_obj_memo(auto_ctx, obj, bit, memo);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_obj_num_is_stream(). */
int ppdf_obj_num_is_stream(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_obj_num_is_stream(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_obj_num_is_stream(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_obj_parent_num(). */
int ppdf_obj_parent_num(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_obj_parent_num(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_obj_parent_num(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_obj_refs(). */
int ppdf_obj_refs(pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_obj_refs(): auto_ctx=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_obj_refs(auto_ctx, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_objcmp(). */
int ppdf_objcmp(pdf_obj *a, pdf_obj *b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_objcmp(): auto_ctx=%p a=%p b=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, a, b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_objcmp(auto_ctx, a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_objcmp_resolve(). */
int ppdf_objcmp_resolve(pdf_obj *a, pdf_obj *b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_objcmp_resolve(): auto_ctx=%p a=%p b=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, a, b);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_objcmp_resolve(auto_ctx, a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_contents_stream(). */
fz_stream *ppdf_open_contents_stream(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_contents_stream(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_contents_stream(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_crypt(). */
fz_stream *ppdf_open_crypt(fz_stream *chain, pdf_crypt *crypt, int num, int gen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_crypt(): auto_ctx=%p chain=%p crypt=%p (long)num=%li (long)gen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, crypt, (long)num, (long)gen);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_crypt(auto_ctx, chain, crypt, num, gen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_crypt_with_filter(). */
fz_stream *ppdf_open_crypt_with_filter(fz_stream *chain, pdf_crypt *crypt, pdf_obj *name, int num, int gen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_crypt_with_filter(): auto_ctx=%p chain=%p crypt=%p name=%p (long)num=%li (long)gen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, chain, crypt, name, (long)num, (long)gen);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_crypt_with_filter(auto_ctx, chain, crypt, name, num, gen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_document(). */
pdf_document *ppdf_open_document(const char *filename)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_document(): auto_ctx=%p filename=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, filename);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_document(auto_ctx, filename);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_document_with_stream(). */
pdf_document *ppdf_open_document_with_stream(fz_stream *file)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_document_with_stream(): auto_ctx=%p file=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, file);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_document_with_stream(auto_ctx, file);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_inline_stream(). */
fz_stream *ppdf_open_inline_stream(pdf_document *doc, pdf_obj *stmobj, int length, fz_stream *chain, fz_compression_params *params)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_inline_stream(): auto_ctx=%p doc=%p stmobj=%p (long)length=%li chain=%p params=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, stmobj, (long)length, chain, params);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_inline_stream(auto_ctx, doc, stmobj, length, chain, params);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_raw_stream(). */
fz_stream *ppdf_open_raw_stream(pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_raw_stream(): auto_ctx=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_raw_stream(auto_ctx, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_raw_stream_number(). */
fz_stream *ppdf_open_raw_stream_number(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_raw_stream_number(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_raw_stream_number(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_stream(). */
fz_stream *ppdf_open_stream(pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_stream(): auto_ctx=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_stream(auto_ctx, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_stream_number(). */
fz_stream *ppdf_open_stream_number(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_stream_number(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_stream_number(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_open_stream_with_offset(). */
fz_stream *ppdf_open_stream_with_offset(pdf_document *doc, int num, pdf_obj *dict, int64_t stm_ofs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_open_stream_with_offset(): auto_ctx=%p doc=%p (long)num=%li dict=%p (long)stm_ofs=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num, dict, (long)stm_ofs);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_open_stream_with_offset(auto_ctx, doc, num, dict, stm_ofs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_page_contents(). */
pdf_obj *ppdf_page_contents(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_contents(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_page_contents(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_page_event_close(). */
void ppdf_page_event_close(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_event_close(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_try(auto_ctx) {
		::pdf_page_event_close(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_page_event_open(). */
void ppdf_page_event_open(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_event_open(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_try(auto_ctx) {
		::pdf_page_event_open(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_page_from_fz_page(). */
pdf_page *ppdf_page_from_fz_page(fz_page *ptr)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_from_fz_page(): auto_ctx=%p ptr=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ptr);
	}
	pdf_page * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_page_from_fz_page(auto_ctx, ptr);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_page_group(). */
pdf_obj *ppdf_page_group(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_group(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_page_group(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_page_obj_transform(). */
void ppdf_page_obj_transform(pdf_obj *pageobj, fz_rect *page_mediabox, fz_matrix *page_ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_obj_transform(): auto_ctx=%p pageobj=%p page_mediabox=%p page_ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, pageobj, page_mediabox, page_ctm);
	}
	fz_try(auto_ctx) {
		::pdf_page_obj_transform(auto_ctx, pageobj, page_mediabox, page_ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_page_presentation(). */
fz_transition *ppdf_page_presentation(pdf_page *page, fz_transition *transition, float *duration)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_presentation(): auto_ctx=%p page=%p transition=%p duration=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, transition, duration);
	}
	fz_transition * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_page_presentation(auto_ctx, page, transition, duration);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_page_resources(). */
pdf_obj *ppdf_page_resources(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_resources(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_page_resources(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_page_separations(). */
fz_separations *ppdf_page_separations(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_separations(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	fz_separations * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_page_separations(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_page_transform(). */
void ppdf_page_transform(pdf_page *page, fz_rect *mediabox, fz_matrix *ctm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_transform(): auto_ctx=%p page=%p mediabox=%p ctm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, mediabox, ctm);
	}
	fz_try(auto_ctx) {
		::pdf_page_transform(auto_ctx, page, mediabox, ctm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_page_write(). */
fz_device *ppdf_page_write(pdf_document *doc, fz_rect mediabox, pdf_obj **presources, fz_buffer **pcontents)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_page_write(): auto_ctx=%p doc=%p &mediabox=%p presources=%p pcontents=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, &mediabox, presources, pcontents);
	}
	fz_device * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_page_write(auto_ctx, doc, mediabox, presources, pcontents);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_parse_array(). */
pdf_obj *ppdf_parse_array(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_array(): auto_ctx=%p doc=%p f=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, f, buf);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_parse_array(auto_ctx, doc, f, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_parse_default_appearance(). */
void ppdf_parse_default_appearance(const char *da, const char **font, float *size, float color[3])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_default_appearance(): auto_ctx=%p da=%s font=%p size=%p (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, da, font, size, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_parse_default_appearance(auto_ctx, da, font, size, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_parse_dict(). */
pdf_obj *ppdf_parse_dict(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_dict(): auto_ctx=%p doc=%p f=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, f, buf);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_parse_dict(auto_ctx, doc, f, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_parse_ind_obj(). */
pdf_obj *ppdf_parse_ind_obj(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf, int *num, int *gen, int64_t *stm_ofs, int *try_repair)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_ind_obj(): auto_ctx=%p doc=%p f=%p buf=%p num=%p gen=%p stm_ofs=%p try_repair=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, f, buf, num, gen, stm_ofs, try_repair);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_parse_ind_obj(auto_ctx, doc, f, buf, num, gen, stm_ofs, try_repair);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_parse_link_action(). */
char *ppdf_parse_link_action(pdf_document *doc, pdf_obj *obj, int pagenum)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_link_action(): auto_ctx=%p doc=%p obj=%p (long)pagenum=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj, (long)pagenum);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_parse_link_action(auto_ctx, doc, obj, pagenum);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_parse_link_dest(). */
char *ppdf_parse_link_dest(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_link_dest(): auto_ctx=%p doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, obj);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_parse_link_dest(auto_ctx, doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_parse_stm_obj(). */
pdf_obj *ppdf_parse_stm_obj(pdf_document *doc, fz_stream *f, pdf_lexbuf *buf)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_stm_obj(): auto_ctx=%p doc=%p f=%p buf=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, f, buf);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_parse_stm_obj(auto_ctx, doc, f, buf);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_parse_write_options(). */
pdf_write_options *ppdf_parse_write_options(pdf_write_options *opts, const char *args)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_parse_write_options(): auto_ctx=%p opts=%p args=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, opts, args);
	}
	pdf_write_options * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_parse_write_options(auto_ctx, opts, args);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_print_crypt(). */
void ppdf_print_crypt(fz_output *out, pdf_crypt *crypt)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_print_crypt(): auto_ctx=%p out=%p crypt=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, crypt);
	}
	fz_try(auto_ctx) {
		::pdf_print_crypt(auto_ctx, out, crypt);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_print_default_appearance(). */
void ppdf_print_default_appearance(char *buf, int nbuf, const char *font, float size, const float color[3])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_print_default_appearance(): auto_ctx=%p buf=%s (long)nbuf=%li font=%s (long)size=%li (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)nbuf, font, (long)size, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_print_default_appearance(auto_ctx, buf, nbuf, font, size, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_print_encrypted_obj(). */
void ppdf_print_encrypted_obj(fz_output *out, pdf_obj *obj, int tight, int ascii, pdf_crypt *crypt, int num, int gen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_print_encrypted_obj(): auto_ctx=%p out=%p obj=%p (long)tight=%li (long)ascii=%li crypt=%p (long)num=%li (long)gen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, obj, (long)tight, (long)ascii, crypt, (long)num, (long)gen);
	}
	fz_try(auto_ctx) {
		::pdf_print_encrypted_obj(auto_ctx, out, obj, tight, ascii, crypt, num, gen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_print_font(). */
void ppdf_print_font(fz_output *out, pdf_font_desc *fontdesc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_print_font(): auto_ctx=%p out=%p fontdesc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, fontdesc);
	}
	fz_try(auto_ctx) {
		::pdf_print_font(auto_ctx, out, fontdesc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_print_obj(). */
void ppdf_print_obj(fz_output *out, pdf_obj *obj, int tight, int ascii)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_print_obj(): auto_ctx=%p out=%p obj=%p (long)tight=%li (long)ascii=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, obj, (long)tight, (long)ascii);
	}
	fz_try(auto_ctx) {
		::pdf_print_obj(auto_ctx, out, obj, tight, ascii);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_process_annot(). */
void ppdf_process_annot(pdf_processor *proc, pdf_document *doc, pdf_page *page, pdf_annot *annot, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_process_annot(): auto_ctx=%p proc=%p doc=%p page=%p annot=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, proc, doc, page, annot, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_process_annot(auto_ctx, proc, doc, page, annot, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_process_contents(). */
void ppdf_process_contents(pdf_processor *proc, pdf_document *doc, pdf_obj *obj, pdf_obj *res, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_process_contents(): auto_ctx=%p proc=%p doc=%p obj=%p res=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, proc, doc, obj, res, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_process_contents(auto_ctx, proc, doc, obj, res, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_process_glyph(). */
void ppdf_process_glyph(pdf_processor *proc, pdf_document *doc, pdf_obj *resources, fz_buffer *contents)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_process_glyph(): auto_ctx=%p proc=%p doc=%p resources=%p contents=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, proc, doc, resources, contents);
	}
	fz_try(auto_ctx) {
		::pdf_process_glyph(auto_ctx, proc, doc, resources, contents);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_progressive_advance(). */
pdf_obj *ppdf_progressive_advance(pdf_document *doc, int pagenum)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_progressive_advance(): auto_ctx=%p doc=%p (long)pagenum=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)pagenum);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_progressive_advance(auto_ctx, doc, pagenum);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_read_ocg(). */
void ppdf_read_ocg(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_read_ocg(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_read_ocg(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_redact_page(). */
int ppdf_redact_page(pdf_document *doc, pdf_page *page, pdf_redact_options *opts)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_redact_page(): auto_ctx=%p doc=%p page=%p opts=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, page, opts);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_redact_page(auto_ctx, doc, page, opts);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_remove_item(). */
void ppdf_remove_item(fz_store_drop_fn *drop, pdf_obj *key)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_remove_item(): auto_ctx=%p drop=%p key=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, drop, key);
	}
	fz_try(auto_ctx) {
		::pdf_remove_item(auto_ctx, drop, key);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_repair_obj(). */
int ppdf_repair_obj(pdf_document *doc, pdf_lexbuf *buf, int64_t *stmofsp, int *stmlenp, pdf_obj **encrypt, pdf_obj **id, pdf_obj **page, int64_t *tmpofs, pdf_obj **root)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_repair_obj(): auto_ctx=%p doc=%p buf=%p stmofsp=%p stmlenp=%p encrypt=%p id=%p page=%p tmpofs=%p root=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, buf, stmofsp, stmlenp, encrypt, id, page, tmpofs, root);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_repair_obj(auto_ctx, doc, buf, stmofsp, stmlenp, encrypt, id, page, tmpofs, root);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_repair_obj_stms(). */
void ppdf_repair_obj_stms(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_repair_obj_stms(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_repair_obj_stms(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_repair_xref(). */
void ppdf_repair_xref(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_repair_xref(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_repair_xref(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_replace_xref(). */
void ppdf_replace_xref(pdf_document *doc, pdf_xref_entry *entries, int n)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_replace_xref(): auto_ctx=%p doc=%p entries=%p (long)n=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, entries, (long)n);
	}
	fz_try(auto_ctx) {
		::pdf_replace_xref(auto_ctx, doc, entries, n);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_reset_form(). */
void ppdf_reset_form(pdf_document *doc, pdf_obj *fields, int exclude)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_reset_form(): auto_ctx=%p doc=%p fields=%p (long)exclude=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, fields, (long)exclude);
	}
	fz_try(auto_ctx) {
		::pdf_reset_form(auto_ctx, doc, fields, exclude);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_resolve_indirect(). */
pdf_obj *ppdf_resolve_indirect(pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_resolve_indirect(): auto_ctx=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_resolve_indirect(auto_ctx, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_resolve_indirect_chain(). */
pdf_obj *ppdf_resolve_indirect_chain(pdf_obj *ref)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_resolve_indirect_chain(): auto_ctx=%p ref=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, ref);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_resolve_indirect_chain(auto_ctx, ref);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_resolve_link(). */
int ppdf_resolve_link(pdf_document *doc, const char *uri, float *xp, float *yp)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_resolve_link(): auto_ctx=%p doc=%p uri=%s xp=%p yp=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, uri, xp, yp);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_resolve_link(auto_ctx, doc, uri, xp, yp);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_run_annot(). */
void ppdf_run_annot(pdf_annot *annot, fz_device *dev, fz_matrix ctm, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_run_annot(): auto_ctx=%p annot=%p dev=%p &ctm=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, dev, &ctm, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_run_annot(auto_ctx, annot, dev, ctm, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_run_glyph(). */
void ppdf_run_glyph(pdf_document *doc, pdf_obj *resources, fz_buffer *contents, fz_device *dev, fz_matrix ctm, void *gstate, fz_default_colorspaces *default_cs)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_run_glyph(): auto_ctx=%p doc=%p resources=%p contents=%p dev=%p &ctm=%p gstate=%p default_cs=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, resources, contents, dev, &ctm, gstate, default_cs);
	}
	fz_try(auto_ctx) {
		::pdf_run_glyph(auto_ctx, doc, resources, contents, dev, ctm, gstate, default_cs);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_run_page(). */
void ppdf_run_page(pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_run_page(): auto_ctx=%p page=%p dev=%p &ctm=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &ctm, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_run_page(auto_ctx, page, dev, ctm, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_run_page_annots(). */
void ppdf_run_page_annots(pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_run_page_annots(): auto_ctx=%p page=%p dev=%p &ctm=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &ctm, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_run_page_annots(auto_ctx, page, dev, ctm, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_run_page_contents(). */
void ppdf_run_page_contents(pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_run_page_contents(): auto_ctx=%p page=%p dev=%p &ctm=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &ctm, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_run_page_contents(auto_ctx, page, dev, ctm, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_run_page_widgets(). */
void ppdf_run_page_widgets(pdf_page *page, fz_device *dev, fz_matrix ctm, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_run_page_widgets(): auto_ctx=%p page=%p dev=%p &ctm=%p cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page, dev, &ctm, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_run_page_widgets(auto_ctx, page, dev, ctm, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_run_page_with_usage(). */
void ppdf_run_page_with_usage(pdf_document *doc, pdf_page *page, fz_device *dev, fz_matrix ctm, const char *usage, fz_cookie *cookie)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_run_page_with_usage(): auto_ctx=%p doc=%p page=%p dev=%p &ctm=%p usage=%s cookie=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, page, dev, &ctm, usage, cookie);
	}
	fz_try(auto_ctx) {
		::pdf_run_page_with_usage(auto_ctx, doc, page, dev, ctm, usage, cookie);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_save_document(). */
void ppdf_save_document(pdf_document *doc, const char *filename, pdf_write_options *opts)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_save_document(): auto_ctx=%p doc=%p filename=%s opts=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, filename, opts);
	}
	fz_try(auto_ctx) {
		::pdf_save_document(auto_ctx, doc, filename, opts);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_select_layer_config(). */
void ppdf_select_layer_config(pdf_document *doc, int config_num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_select_layer_config(): auto_ctx=%p doc=%p (long)config_num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)config_num);
	}
	fz_try(auto_ctx) {
		::pdf_select_layer_config(auto_ctx, doc, config_num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_select_layer_config_ui(). */
void ppdf_select_layer_config_ui(pdf_document *doc, int ui)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_select_layer_config_ui(): auto_ctx=%p doc=%p (long)ui=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)ui);
	}
	fz_try(auto_ctx) {
		::pdf_select_layer_config_ui(auto_ctx, doc, ui);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_author(). */
void ppdf_set_annot_author(pdf_annot *annot, const char *author)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_author(): auto_ctx=%p annot=%p author=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, author);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_author(auto_ctx, annot, author);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_border(). */
void ppdf_set_annot_border(pdf_annot *annot, float width)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_border(): auto_ctx=%p annot=%p (long)width=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)width);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_border(auto_ctx, annot, width);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_color(). */
void ppdf_set_annot_color(pdf_annot *annot, int n, const float *color)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_color(): auto_ctx=%p annot=%p (long)n=%li color=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)n, color);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_color(auto_ctx, annot, n, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_contents(). */
void ppdf_set_annot_contents(pdf_annot *annot, const char *text)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_contents(): auto_ctx=%p annot=%p text=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, text);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_contents(auto_ctx, annot, text);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_default_appearance(). */
void ppdf_set_annot_default_appearance(pdf_annot *annot, const char *font, float size, const float color[3])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_default_appearance(): auto_ctx=%p annot=%p font=%s (long)size=%li (long)color=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, font, (long)size, (long)color);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_default_appearance(auto_ctx, annot, font, size, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_flags(). */
void ppdf_set_annot_flags(pdf_annot *annot, int flags)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_flags(): auto_ctx=%p annot=%p (long)flags=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)flags);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_flags(auto_ctx, annot, flags);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_icon_name(). */
void ppdf_set_annot_icon_name(pdf_annot *annot, const char *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_icon_name(): auto_ctx=%p annot=%p name=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, name);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_icon_name(auto_ctx, annot, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_ink_list(). */
void ppdf_set_annot_ink_list(pdf_annot *annot, int n, const int *count, const fz_point *v)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_ink_list(): auto_ctx=%p annot=%p (long)n=%li count=%p v=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)n, count, v);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_ink_list(auto_ctx, annot, n, count, v);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_interior_color(). */
void ppdf_set_annot_interior_color(pdf_annot *annot, int n, const float *color)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_interior_color(): auto_ctx=%p annot=%p (long)n=%li color=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)n, color);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_interior_color(auto_ctx, annot, n, color);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_is_open(). */
void ppdf_set_annot_is_open(pdf_annot *annot, int is_open)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_is_open(): auto_ctx=%p annot=%p (long)is_open=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)is_open);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_is_open(auto_ctx, annot, is_open);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_language(). */
void ppdf_set_annot_language(pdf_annot *annot, fz_text_language lang)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_language(): auto_ctx=%p annot=%p (long)lang=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)lang);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_language(auto_ctx, annot, lang);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_line(). */
void ppdf_set_annot_line(pdf_annot *annot, fz_point a, fz_point b)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_line(): auto_ctx=%p annot=%p &a=%p &b=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, &a, &b);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_line(auto_ctx, annot, a, b);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_line_end_style(). */
void ppdf_set_annot_line_end_style(pdf_annot *annot, enum pdf_line_ending e)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_line_end_style(): auto_ctx=%p annot=%p (long)e=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)e);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_line_end_style(auto_ctx, annot, e);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_line_ending_styles(). */
void ppdf_set_annot_line_ending_styles(pdf_annot *annot, enum pdf_line_ending start_style, enum pdf_line_ending end_style)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_line_ending_styles(): auto_ctx=%p annot=%p (long)start_style=%li (long)end_style=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)start_style, (long)end_style);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_line_ending_styles(auto_ctx, annot, start_style, end_style);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_line_start_style(). */
void ppdf_set_annot_line_start_style(pdf_annot *annot, enum pdf_line_ending s)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_line_start_style(): auto_ctx=%p annot=%p (long)s=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)s);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_line_start_style(auto_ctx, annot, s);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_modification_date(). */
void ppdf_set_annot_modification_date(pdf_annot *annot, int64_t time)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_modification_date(): auto_ctx=%p annot=%p (long)time=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)time);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_modification_date(auto_ctx, annot, time);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_opacity(). */
void ppdf_set_annot_opacity(pdf_annot *annot, float opacity)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_opacity(): auto_ctx=%p annot=%p (long)opacity=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)opacity);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_opacity(auto_ctx, annot, opacity);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_quad_points(). */
void ppdf_set_annot_quad_points(pdf_annot *annot, int n, const fz_quad *qv)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_quad_points(): auto_ctx=%p annot=%p (long)n=%li qv=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)n, qv);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_quad_points(auto_ctx, annot, n, qv);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_quadding(). */
void ppdf_set_annot_quadding(pdf_annot *annot, int q)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_quadding(): auto_ctx=%p annot=%p (long)q=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)q);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_quadding(auto_ctx, annot, q);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_rect(). */
void ppdf_set_annot_rect(pdf_annot *annot, fz_rect rect)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_rect(): auto_ctx=%p annot=%p &rect=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, &rect);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_rect(auto_ctx, annot, rect);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_vertex(). */
void ppdf_set_annot_vertex(pdf_annot *annot, int i, fz_point p)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_vertex(): auto_ctx=%p annot=%p (long)i=%li &p=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)i, &p);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_vertex(auto_ctx, annot, i, p);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_annot_vertices(). */
void ppdf_set_annot_vertices(pdf_annot *annot, int n, const fz_point *v)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_annot_vertices(): auto_ctx=%p annot=%p (long)n=%li v=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, (long)n, v);
	}
	fz_try(auto_ctx) {
		::pdf_set_annot_vertices(auto_ctx, annot, n, v);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_choice_field_value(). */
int ppdf_set_choice_field_value(pdf_widget *widget, const char *value)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_choice_field_value(): auto_ctx=%p widget=%p value=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget, value);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_set_choice_field_value(auto_ctx, widget, value);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_set_cmap_wmode(). */
void ppdf_set_cmap_wmode(pdf_cmap *cmap, int wmode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_cmap_wmode(): auto_ctx=%p cmap=%p (long)wmode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap, (long)wmode);
	}
	fz_try(auto_ctx) {
		::pdf_set_cmap_wmode(auto_ctx, cmap, wmode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_default_hmtx(). */
void ppdf_set_default_hmtx(pdf_font_desc *font, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_default_hmtx(): auto_ctx=%p font=%p (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)w);
	}
	fz_try(auto_ctx) {
		::pdf_set_default_hmtx(auto_ctx, font, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_default_vmtx(). */
void ppdf_set_default_vmtx(pdf_font_desc *font, int y, int w)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_default_vmtx(): auto_ctx=%p font=%p (long)y=%li (long)w=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)y, (long)w);
	}
	fz_try(auto_ctx) {
		::pdf_set_default_vmtx(auto_ctx, font, y, w);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_doc_event_callback(). */
void ppdf_set_doc_event_callback(pdf_document *doc, pdf_doc_event_cb *event_cb, void *data)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_doc_event_callback(): auto_ctx=%p doc=%p event_cb=%p data=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, event_cb, data);
	}
	fz_try(auto_ctx) {
		::pdf_set_doc_event_callback(auto_ctx, doc, event_cb, data);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_document_language(). */
void ppdf_set_document_language(pdf_document *doc, fz_text_language lang)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_document_language(): auto_ctx=%p doc=%p (long)lang=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)lang);
	}
	fz_try(auto_ctx) {
		::pdf_set_document_language(auto_ctx, doc, lang);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_field_value(). */
int ppdf_set_field_value(pdf_document *doc, pdf_obj *field, const char *text, int ignore_trigger_events)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_field_value(): auto_ctx=%p doc=%p field=%p text=%s (long)ignore_trigger_events=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field, text, (long)ignore_trigger_events);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_set_field_value(auto_ctx, doc, field, text, ignore_trigger_events);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_set_font_wmode(). */
void ppdf_set_font_wmode(pdf_font_desc *font, int wmode)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_font_wmode(): auto_ctx=%p font=%p (long)wmode=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, font, (long)wmode);
	}
	fz_try(auto_ctx) {
		::pdf_set_font_wmode(auto_ctx, font, wmode);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_int(). */
void ppdf_set_int(pdf_obj *obj, int64_t i)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_int(): auto_ctx=%p obj=%p (long)i=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj, (long)i);
	}
	fz_try(auto_ctx) {
		::pdf_set_int(auto_ctx, obj, i);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_layer_config_as_default(). */
void ppdf_set_layer_config_as_default(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_layer_config_as_default(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	fz_try(auto_ctx) {
		::pdf_set_layer_config_as_default(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_obj_memo(). */
void ppdf_set_obj_memo(pdf_obj *obj, int bit, int memo)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_obj_memo(): auto_ctx=%p obj=%p (long)bit=%li (long)memo=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj, (long)bit, (long)memo);
	}
	fz_try(auto_ctx) {
		::pdf_set_obj_memo(auto_ctx, obj, bit, memo);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_obj_parent(). */
void ppdf_set_obj_parent(pdf_obj *obj, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_obj_parent(): auto_ctx=%p obj=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj, (long)num);
	}
	fz_try(auto_ctx) {
		::pdf_set_obj_parent(auto_ctx, obj, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_populating_xref_trailer(). */
void ppdf_set_populating_xref_trailer(pdf_document *doc, pdf_obj *trailer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_populating_xref_trailer(): auto_ctx=%p doc=%p trailer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, trailer);
	}
	fz_try(auto_ctx) {
		::pdf_set_populating_xref_trailer(auto_ctx, doc, trailer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_str_len(). */
void ppdf_set_str_len(pdf_obj *obj, size_t newlen)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_str_len(): auto_ctx=%p obj=%p (long)newlen=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj, (long)newlen);
	}
	fz_try(auto_ctx) {
		::pdf_set_str_len(auto_ctx, obj, newlen);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_text_field_value(). */
int ppdf_set_text_field_value(pdf_widget *widget, const char *value)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_text_field_value(): auto_ctx=%p widget=%p value=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget, value);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_set_text_field_value(auto_ctx, widget, value);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_set_usecmap(). */
void ppdf_set_usecmap(pdf_cmap *cmap, pdf_cmap *usecmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_usecmap(): auto_ctx=%p cmap=%p usecmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap, usecmap);
	}
	fz_try(auto_ctx) {
		::pdf_set_usecmap(auto_ctx, cmap, usecmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_set_widget_editing_state(). */
void ppdf_set_widget_editing_state(pdf_widget *widget, int editing)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_set_widget_editing_state(): auto_ctx=%p widget=%p (long)editing=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget, (long)editing);
	}
	fz_try(auto_ctx) {
		::pdf_set_widget_editing_state(auto_ctx, widget, editing);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_sign_signature(). */
void ppdf_sign_signature(pdf_widget *widget, pdf_pkcs7_signer *signer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_sign_signature(): auto_ctx=%p widget=%p signer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget, signer);
	}
	fz_try(auto_ctx) {
		::pdf_sign_signature(auto_ctx, widget, signer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_signature_byte_range(). */
int ppdf_signature_byte_range(pdf_document *doc, pdf_obj *signature, fz_range *byte_range)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_byte_range(): auto_ctx=%p doc=%p signature=%p byte_range=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, signature, byte_range);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_byte_range(auto_ctx, doc, signature, byte_range);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_contents(). */
size_t ppdf_signature_contents(pdf_document *doc, pdf_obj *signature, char **contents)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_contents(): auto_ctx=%p doc=%p signature=%p contents=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, signature, contents);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_contents(auto_ctx, doc, signature, contents);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_drop_designated_name(). */
void ppdf_signature_drop_designated_name(pdf_pkcs7_designated_name *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_drop_designated_name(): auto_ctx=%p name=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name);
	}
	fz_try(auto_ctx) {
		::pdf_signature_drop_designated_name(auto_ctx, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_signature_error_description(). */
char *ppdf_signature_error_description(pdf_signature_error err)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_error_description(): (long)err=%li\n", __FILE__, __LINE__, __FUNCTION__, (long)err);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_error_description(err);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_format_designated_name(). */
char *ppdf_signature_format_designated_name(pdf_pkcs7_designated_name *name)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_format_designated_name(): auto_ctx=%p name=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, name);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_format_designated_name(auto_ctx, name);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_get_signatory(). */
pdf_pkcs7_designated_name *ppdf_signature_get_signatory(pdf_pkcs7_verifier *verifier, pdf_document *doc, pdf_obj *signature)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_get_signatory(): auto_ctx=%p verifier=%p doc=%p signature=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, verifier, doc, signature);
	}
	pdf_pkcs7_designated_name * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_get_signatory(auto_ctx, verifier, doc, signature);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_hash_bytes(). */
fz_stream *ppdf_signature_hash_bytes(pdf_document *doc, pdf_obj *signature)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_hash_bytes(): auto_ctx=%p doc=%p signature=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, signature);
	}
	fz_stream * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_hash_bytes(auto_ctx, doc, signature);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_incremental_change_since_signing(). */
int ppdf_signature_incremental_change_since_signing(pdf_document *doc, pdf_obj *signature)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_incremental_change_since_signing(): auto_ctx=%p doc=%p signature=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, signature);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_incremental_change_since_signing(auto_ctx, doc, signature);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_is_signed(). */
int ppdf_signature_is_signed(pdf_document *doc, pdf_obj *field)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_is_signed(): auto_ctx=%p doc=%p field=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_signature_is_signed(auto_ctx, doc, field);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_signature_set_value(). */
void ppdf_signature_set_value(pdf_document *doc, pdf_obj *field, pdf_pkcs7_signer *signer, int64_t stime)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_signature_set_value(): auto_ctx=%p doc=%p field=%p signer=%p (long)stime=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field, signer, (long)stime);
	}
	fz_try(auto_ctx) {
		::pdf_signature_set_value(auto_ctx, doc, field, signer, stime);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_sort_cmap(). */
void ppdf_sort_cmap(pdf_cmap *cmap)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_sort_cmap(): auto_ctx=%p cmap=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, cmap);
	}
	fz_try(auto_ctx) {
		::pdf_sort_cmap(auto_ctx, cmap);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_sort_dict(). */
void ppdf_sort_dict(pdf_obj *dict)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_sort_dict(): auto_ctx=%p dict=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, dict);
	}
	fz_try(auto_ctx) {
		::pdf_sort_dict(auto_ctx, dict);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_specifics(). */
pdf_document *ppdf_specifics(fz_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_specifics(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	pdf_document * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_specifics(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_sprint_obj(). */
char *ppdf_sprint_obj(char *buf, size_t cap, size_t *len, pdf_obj *obj, int tight, int ascii)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_sprint_obj(): auto_ctx=%p buf=%s (long)cap=%li len=%p obj=%p (long)tight=%li (long)ascii=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, buf, (long)cap, len, obj, (long)tight, (long)ascii);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_sprint_obj(auto_ctx, buf, cap, len, obj, tight, ascii);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_store_item(). */
void ppdf_store_item(pdf_obj *key, void *val, size_t itemsize)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_store_item(): auto_ctx=%p key=%p val=%p (long)itemsize=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, key, val, (long)itemsize);
	}
	fz_try(auto_ctx) {
		::pdf_store_item(auto_ctx, key, val, itemsize);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_string_from_annot_type(). */
const char *ppdf_string_from_annot_type(enum pdf_annot_type type)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_string_from_annot_type(): auto_ctx=%p (long)type=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)type);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_string_from_annot_type(auto_ctx, type);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_string_from_line_ending(). */
const char *ppdf_string_from_line_ending(enum pdf_line_ending end)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_string_from_line_ending(): auto_ctx=%p (long)end=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, (long)end);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_string_from_line_ending(auto_ctx, end);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_text_widget_format(). */
int ppdf_text_widget_format(pdf_widget *tw)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_text_widget_format(): auto_ctx=%p tw=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tw);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_text_widget_format(auto_ctx, tw);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_text_widget_max_len(). */
int ppdf_text_widget_max_len(pdf_widget *tw)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_text_widget_max_len(): auto_ctx=%p tw=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tw);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_text_widget_max_len(auto_ctx, tw);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_bool(). */
int ppdf_to_bool(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_bool(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_bool(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_gen(). */
int ppdf_to_gen(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_gen(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_gen(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_int(). */
int ppdf_to_int(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_int(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_int(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_int64(). */
int64_t ppdf_to_int64(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_int64(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int64_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_int64(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_matrix(). */
fz_matrix ppdf_to_matrix(pdf_obj *array)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_matrix(): auto_ctx=%p array=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_matrix(auto_ctx, array);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_name(). */
const char *ppdf_to_name(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_name(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_name(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_num(). */
int ppdf_to_num(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_num(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_num(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_quad(). */
fz_quad ppdf_to_quad(pdf_obj *array, int offset)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_quad(): auto_ctx=%p array=%p (long)offset=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array, (long)offset);
	}
	fz_quad ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_quad(auto_ctx, array, offset);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_real(). */
float ppdf_to_real(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_real(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	float ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_real(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_rect(). */
fz_rect ppdf_to_rect(pdf_obj *array)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_rect(): auto_ctx=%p array=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, array);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_rect(auto_ctx, array);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_str_buf(). */
char *ppdf_to_str_buf(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_str_buf(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_str_buf(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_str_len(). */
size_t ppdf_to_str_len(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_str_len(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	size_t ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_str_len(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_string(). */
const char *ppdf_to_string(pdf_obj *obj, size_t *sizep)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_string(): auto_ctx=%p obj=%p sizep=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj, sizep);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_string(auto_ctx, obj, sizep);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_to_text_string(). */
const char *ppdf_to_text_string(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_to_text_string(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	const char * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_to_text_string(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_toggle_layer_config_ui(). */
void ppdf_toggle_layer_config_ui(pdf_document *doc, int ui)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_toggle_layer_config_ui(): auto_ctx=%p doc=%p (long)ui=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)ui);
	}
	fz_try(auto_ctx) {
		::pdf_toggle_layer_config_ui(auto_ctx, doc, ui);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_toggle_widget(). */
int ppdf_toggle_widget(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_toggle_widget(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_toggle_widget(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_tos_get_text(). */
fz_text *ppdf_tos_get_text(pdf_text_object_state *tos)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_get_text(): auto_ctx=%p tos=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tos);
	}
	fz_text * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_tos_get_text(auto_ctx, tos);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_tos_make_trm(). */
int ppdf_tos_make_trm(pdf_text_object_state *tos, pdf_text_state *text, pdf_font_desc *fontdesc, int cid, fz_matrix *trm)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_make_trm(): auto_ctx=%p tos=%p text=%p fontdesc=%p (long)cid=%li trm=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tos, text, fontdesc, (long)cid, trm);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_tos_make_trm(auto_ctx, tos, text, fontdesc, cid, trm);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_tos_move_after_char(). */
void ppdf_tos_move_after_char(pdf_text_object_state *tos)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_move_after_char(): auto_ctx=%p tos=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tos);
	}
	fz_try(auto_ctx) {
		::pdf_tos_move_after_char(auto_ctx, tos);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_tos_newline(). */
void ppdf_tos_newline(pdf_text_object_state *tos, float leading)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_newline(): tos=%p (long)leading=%li\n", __FILE__, __LINE__, __FUNCTION__, tos, (long)leading);
	}
	fz_try(auto_ctx) {
		::pdf_tos_newline(tos, leading);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_tos_reset(). */
void ppdf_tos_reset(pdf_text_object_state *tos, int render)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_reset(): auto_ctx=%p tos=%p (long)render=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tos, (long)render);
	}
	fz_try(auto_ctx) {
		::pdf_tos_reset(auto_ctx, tos, render);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_tos_restore(). */
void ppdf_tos_restore(pdf_text_object_state *tos, fz_matrix save[2])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_restore(): auto_ctx=%p tos=%p (long)save=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tos, (long)save);
	}
	fz_try(auto_ctx) {
		::pdf_tos_restore(auto_ctx, tos, save);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_tos_save(). */
void ppdf_tos_save(pdf_text_object_state *tos, fz_matrix save[2])
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_save(): auto_ctx=%p tos=%p (long)save=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tos, (long)save);
	}
	fz_try(auto_ctx) {
		::pdf_tos_save(auto_ctx, tos, save);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_tos_set_matrix(). */
void ppdf_tos_set_matrix(pdf_text_object_state *tos, float a, float b, float c, float d, float e, float f)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_set_matrix(): tos=%p (long)a=%li (long)b=%li (long)c=%li (long)d=%li (long)e=%li (long)f=%li\n", __FILE__, __LINE__, __FUNCTION__, tos, (long)a, (long)b, (long)c, (long)d, (long)e, (long)f);
	}
	fz_try(auto_ctx) {
		::pdf_tos_set_matrix(tos, a, b, c, d, e, f);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_tos_translate(). */
void ppdf_tos_translate(pdf_text_object_state *tos, float tx, float ty)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_tos_translate(): tos=%p (long)tx=%li (long)ty=%li\n", __FILE__, __LINE__, __FUNCTION__, tos, (long)tx, (long)ty);
	}
	fz_try(auto_ctx) {
		::pdf_tos_translate(tos, tx, ty);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_trailer(). */
pdf_obj *ppdf_trailer(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_trailer(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_trailer(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_unmark_obj(). */
void ppdf_unmark_obj(pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_unmark_obj(): auto_ctx=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, obj);
	}
	fz_try(auto_ctx) {
		::pdf_unmark_obj(auto_ctx, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_update_annot(). */
int ppdf_update_annot(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_annot(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_update_annot(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_update_appearance(). */
void ppdf_update_appearance(pdf_annot *annot)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_appearance(): auto_ctx=%p annot=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot);
	}
	fz_try(auto_ctx) {
		::pdf_update_appearance(auto_ctx, annot);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_update_default_colorspaces(). */
fz_default_colorspaces *ppdf_update_default_colorspaces(fz_default_colorspaces *old_cs, pdf_obj *res)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_default_colorspaces(): auto_ctx=%p old_cs=%p res=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, old_cs, res);
	}
	fz_default_colorspaces * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_update_default_colorspaces(auto_ctx, old_cs, res);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_update_object(). */
void ppdf_update_object(pdf_document *doc, int num, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_object(): auto_ctx=%p doc=%p (long)num=%li obj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num, obj);
	}
	fz_try(auto_ctx) {
		::pdf_update_object(auto_ctx, doc, num, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_update_page(). */
int ppdf_update_page(pdf_page *page)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_page(): auto_ctx=%p page=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, page);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_update_page(auto_ctx, page);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_update_signature_appearance(). */
void ppdf_update_signature_appearance(pdf_annot *annot, const char *name, const char *text, const char *date)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_signature_appearance(): auto_ctx=%p annot=%p name=%s text=%s date=%s\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, annot, name, text, date);
	}
	fz_try(auto_ctx) {
		::pdf_update_signature_appearance(auto_ctx, annot, name, text, date);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_update_stream(). */
void ppdf_update_stream(pdf_document *doc, pdf_obj *ref, fz_buffer *buf, int compressed)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_stream(): auto_ctx=%p doc=%p ref=%p buf=%p (long)compressed=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, ref, buf, (long)compressed);
	}
	fz_try(auto_ctx) {
		::pdf_update_stream(auto_ctx, doc, ref, buf, compressed);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_update_widget(). */
int ppdf_update_widget(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_widget(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_update_widget(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_update_xobject(). */
void ppdf_update_xobject(pdf_document *doc, pdf_obj *xobj, fz_rect bbox, fz_matrix mat, pdf_obj *res, fz_buffer *buffer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_update_xobject(): auto_ctx=%p doc=%p xobj=%p &bbox=%p &mat=%p res=%p buffer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, xobj, &bbox, &mat, res, buffer);
	}
	fz_try(auto_ctx) {
		::pdf_update_xobject(auto_ctx, doc, xobj, bbox, mat, res, buffer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_validate_change_history(). */
int ppdf_validate_change_history(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_validate_change_history(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_validate_change_history(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_validate_changes(). */
int ppdf_validate_changes(pdf_document *doc, int version)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_validate_changes(): auto_ctx=%p doc=%p (long)version=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)version);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_validate_changes(auto_ctx, doc, version);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_validate_signature(). */
int ppdf_validate_signature(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_validate_signature(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_validate_signature(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_version(). */
int ppdf_version(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_version(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_version(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_walk_tree(). */
void ppdf_walk_tree(pdf_obj *tree, pdf_obj *kid_name, void (*arrive)(fz_context *, pdf_obj *, void *, pdf_obj **), void (*leave)(fz_context *, pdf_obj *, void *), void *arg, pdf_obj **names, pdf_obj **values)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_walk_tree(): auto_ctx=%p tree=%p kid_name=%p arrive=%p leave=%p arg=%p names=%p values=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, tree, kid_name, arrive, leave, arg, names, values);
	}
	fz_try(auto_ctx) {
		::pdf_walk_tree(auto_ctx, tree, kid_name, arrive, leave, arg, names, values);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_was_pure_xfa(). */
int ppdf_was_pure_xfa(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_was_pure_xfa(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_was_pure_xfa(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_widget_is_signed(). */
int ppdf_widget_is_signed(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_widget_is_signed(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_widget_is_signed(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_widget_type(). */
enum pdf_widget_type ppdf_widget_type(pdf_widget *widget)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_widget_type(): auto_ctx=%p widget=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, widget);
	}
	enum pdf_widget_type ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_widget_type(auto_ctx, widget);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_write_digest(). */
void ppdf_write_digest(fz_output *out, pdf_obj *byte_range, size_t digest_offset, size_t digest_length, pdf_pkcs7_signer *signer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_write_digest(): auto_ctx=%p out=%p byte_range=%p (long)digest_offset=%li (long)digest_length=%li signer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, out, byte_range, (long)digest_offset, (long)digest_length, signer);
	}
	fz_try(auto_ctx) {
		::pdf_write_digest(auto_ctx, out, byte_range, digest_offset, digest_length, signer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_write_document(). */
void ppdf_write_document(pdf_document *doc, fz_output *out, pdf_write_options *opts)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_write_document(): auto_ctx=%p doc=%p out=%p opts=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, out, opts);
	}
	fz_try(auto_ctx) {
		::pdf_write_document(auto_ctx, doc, out, opts);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_xobject_bbox(). */
fz_rect ppdf_xobject_bbox(pdf_obj *xobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xobject_bbox(): auto_ctx=%p xobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xobj);
	}
	fz_rect ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xobject_bbox(auto_ctx, xobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xobject_colorspace(). */
fz_colorspace *ppdf_xobject_colorspace(pdf_obj *xobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xobject_colorspace(): auto_ctx=%p xobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xobj);
	}
	fz_colorspace * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xobject_colorspace(auto_ctx, xobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xobject_isolated(). */
int ppdf_xobject_isolated(pdf_obj *xobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xobject_isolated(): auto_ctx=%p xobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xobj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xobject_isolated(auto_ctx, xobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xobject_knockout(). */
int ppdf_xobject_knockout(pdf_obj *xobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xobject_knockout(): auto_ctx=%p xobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xobj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xobject_knockout(auto_ctx, xobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xobject_matrix(). */
fz_matrix ppdf_xobject_matrix(pdf_obj *xobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xobject_matrix(): auto_ctx=%p xobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xobj);
	}
	fz_matrix ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xobject_matrix(auto_ctx, xobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xobject_resources(). */
pdf_obj *ppdf_xobject_resources(pdf_obj *xobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xobject_resources(): auto_ctx=%p xobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xobj);
	}
	pdf_obj * ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xobject_resources(auto_ctx, xobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xobject_transparency(). */
int ppdf_xobject_transparency(pdf_obj *xobj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xobject_transparency(): auto_ctx=%p xobj=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, xobj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xobject_transparency(auto_ctx, xobj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xref_ensure_incremental_object(). */
void ppdf_xref_ensure_incremental_object(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xref_ensure_incremental_object(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	fz_try(auto_ctx) {
		::pdf_xref_ensure_incremental_object(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

/* Wrapper for pdf_xref_is_incremental(). */
int ppdf_xref_is_incremental(pdf_document *doc, int num)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xref_is_incremental(): auto_ctx=%p doc=%p (long)num=%li\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, (long)num);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xref_is_incremental(auto_ctx, doc, num);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xref_len(). */
int ppdf_xref_len(pdf_document *doc)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xref_len(): auto_ctx=%p doc=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xref_len(auto_ctx, doc);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xref_obj_is_unsaved_signature(). */
int ppdf_xref_obj_is_unsaved_signature(pdf_document *doc, pdf_obj *obj)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xref_obj_is_unsaved_signature(): doc=%p obj=%p\n", __FILE__, __LINE__, __FUNCTION__, doc, obj);
	}
	int ret;
	fz_var(ret);
	fz_try(auto_ctx) {
		ret = ::pdf_xref_obj_is_unsaved_signature(doc, obj);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
	return ret;
}

/* Wrapper for pdf_xref_store_unsaved_signature(). */
void ppdf_xref_store_unsaved_signature(pdf_document *doc, pdf_obj *field, pdf_pkcs7_signer *signer)
{
	fz_context* auto_ctx = internal_context_get();
	fz_var(auto_ctx);
	const char*    trace = getenv("MUPDF_trace");
	if (trace) {
		fprintf(::stderr, "%s:%i:%s(): calling pdf_xref_store_unsaved_signature(): auto_ctx=%p doc=%p field=%p signer=%p\n", __FILE__, __LINE__, __FUNCTION__, auto_ctx, doc, field, signer);
	}
	fz_try(auto_ctx) {
		::pdf_xref_store_unsaved_signature(auto_ctx, doc, field, signer);
	}
	fz_catch(auto_ctx) {
		internal_throw_exception(auto_ctx);
	}
}

} /* End of namespace mupdf. */