/* automatically generated by rust-bindgen 0.72.1 */

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
    storage: Storage,
}
impl<Storage> __BindgenBitfieldUnit<Storage> {
    #[inline]
    pub const fn new(storage: Storage) -> Self {
        Self { storage }
    }
}
impl<Storage> __BindgenBitfieldUnit<Storage>
where
    Storage: AsRef<[u8]> + AsMut<[u8]>,
{
    #[inline]
    fn extract_bit(byte: u8, index: usize) -> bool {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        byte & mask == mask
    }
    #[inline]
    pub fn get_bit(&self, index: usize) -> bool {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = self.storage.as_ref()[byte_index];
        Self::extract_bit(byte, index)
    }
    #[inline]
    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte = unsafe {
            *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
        };
        Self::extract_bit(byte, index)
    }
    #[inline]
    fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        if val { byte | mask } else { byte & !mask }
    }
    #[inline]
    pub fn set_bit(&mut self, index: usize, val: bool) {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = &mut self.storage.as_mut()[byte_index];
        *byte = Self::change_bit(*byte, index, val);
    }
    #[inline]
    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte = unsafe {
            (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
        };
        unsafe { *byte = Self::change_bit(*byte, index, val) };
    }
    #[inline]
    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if self.get_bit(i + bit_offset) {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            self.set_bit(index + bit_offset, val_bit_is_set);
        }
    }
    #[inline]
    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
        }
    }
}
#[doc = r" If Bindgen could only determine the size and alignment of a"]
#[doc = r" type, it is represented like this."]
#[derive(PartialEq, Copy, Clone, Debug, Hash)]
#[repr(C)]
pub struct __BindgenOpaqueArray<T: Copy, const N: usize>(pub [T; N]);
impl<T: Copy + Default, const N: usize> Default for __BindgenOpaqueArray<T, N> {
    fn default() -> Self {
        Self([<T as Default>::default(); N])
    }
}
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
impl<T> __IncompleteArrayField<T> {
    #[inline]
    pub const fn new() -> Self {
        __IncompleteArrayField(::core::marker::PhantomData, [])
    }
    #[inline]
    pub fn as_ptr(&self) -> *const T {
        self as *const _ as *const T
    }
    #[inline]
    pub fn as_mut_ptr(&mut self) -> *mut T {
        self as *mut _ as *mut T
    }
    #[inline]
    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
        ::core::slice::from_raw_parts(self.as_ptr(), len)
    }
    #[inline]
    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
        ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
    }
}
impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
    fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
        fmt.write_str("__IncompleteArrayField")
    }
}
pub const FZ_PI: f64 = 3.14159265;
pub const FZ_RADIAN: f64 = 57.2957795;
pub const FZ_DEGREE: f64 = 0.017453292;
pub const FZ_SQRT2: f64 = 1.41421356;
pub const FZ_LN2: f64 = 0.69314718;
pub const FZ_POINTER_ALIGN_MOD: u32 = 4;
pub const FZ_VERBOSE_EXCEPTIONS: u32 = 0;
pub const FZ_REPLACEMENT_CHARACTER: u32 = 65533;
pub const FZ_AES_DECRYPT: u32 = 0;
pub const FZ_AES_ENCRYPT: u32 = 1;
pub const FZ_HASH_TABLE_KEY_LENGTH: u32 = 48;
pub const FZ_MAX_TRUSTWORTHY_ASCENT: u32 = 8;
pub const FZ_MAX_TRUSTWORTHY_DESCENT: i32 = -2;
pub const FZ_META_FORMAT: &[u8; 7] = b"format\0";
pub const FZ_META_ENCRYPTION: &[u8; 11] = b"encryption\0";
pub const FZ_META_INFO: &[u8; 6] = b"info:\0";
pub const FZ_META_INFO_TITLE: &[u8; 11] = b"info:Title\0";
pub const FZ_META_INFO_AUTHOR: &[u8; 12] = b"info:Author\0";
pub const FZ_META_INFO_SUBJECT: &[u8; 13] = b"info:Subject\0";
pub const FZ_META_INFO_KEYWORDS: &[u8; 14] = b"info:Keywords\0";
pub const FZ_META_INFO_CREATOR: &[u8; 13] = b"info:Creator\0";
pub const FZ_META_INFO_PRODUCER: &[u8; 14] = b"info:Producer\0";
pub const FZ_META_INFO_CREATIONDATE: &[u8; 18] = b"info:CreationDate\0";
pub const FZ_META_INFO_MODIFICATIONDATE: &[u8; 13] = b"info:ModDate\0";
pub const UCDN_EAST_ASIAN_F: u32 = 0;
pub const UCDN_EAST_ASIAN_H: u32 = 1;
pub const UCDN_EAST_ASIAN_W: u32 = 2;
pub const UCDN_EAST_ASIAN_NA: u32 = 3;
pub const UCDN_EAST_ASIAN_A: u32 = 4;
pub const UCDN_EAST_ASIAN_N: u32 = 5;
pub const UCDN_SCRIPT_COMMON: u32 = 0;
pub const UCDN_SCRIPT_LATIN: u32 = 1;
pub const UCDN_SCRIPT_GREEK: u32 = 2;
pub const UCDN_SCRIPT_CYRILLIC: u32 = 3;
pub const UCDN_SCRIPT_ARMENIAN: u32 = 4;
pub const UCDN_SCRIPT_HEBREW: u32 = 5;
pub const UCDN_SCRIPT_ARABIC: u32 = 6;
pub const UCDN_SCRIPT_SYRIAC: u32 = 7;
pub const UCDN_SCRIPT_THAANA: u32 = 8;
pub const UCDN_SCRIPT_DEVANAGARI: u32 = 9;
pub const UCDN_SCRIPT_BENGALI: u32 = 10;
pub const UCDN_SCRIPT_GURMUKHI: u32 = 11;
pub const UCDN_SCRIPT_GUJARATI: u32 = 12;
pub const UCDN_SCRIPT_ORIYA: u32 = 13;
pub const UCDN_SCRIPT_TAMIL: u32 = 14;
pub const UCDN_SCRIPT_TELUGU: u32 = 15;
pub const UCDN_SCRIPT_KANNADA: u32 = 16;
pub const UCDN_SCRIPT_MALAYALAM: u32 = 17;
pub const UCDN_SCRIPT_SINHALA: u32 = 18;
pub const UCDN_SCRIPT_THAI: u32 = 19;
pub const UCDN_SCRIPT_LAO: u32 = 20;
pub const UCDN_SCRIPT_TIBETAN: u32 = 21;
pub const UCDN_SCRIPT_MYANMAR: u32 = 22;
pub const UCDN_SCRIPT_GEORGIAN: u32 = 23;
pub const UCDN_SCRIPT_HANGUL: u32 = 24;
pub const UCDN_SCRIPT_ETHIOPIC: u32 = 25;
pub const UCDN_SCRIPT_CHEROKEE: u32 = 26;
pub const UCDN_SCRIPT_CANADIAN_ABORIGINAL: u32 = 27;
pub const UCDN_SCRIPT_OGHAM: u32 = 28;
pub const UCDN_SCRIPT_RUNIC: u32 = 29;
pub const UCDN_SCRIPT_KHMER: u32 = 30;
pub const UCDN_SCRIPT_MONGOLIAN: u32 = 31;
pub const UCDN_SCRIPT_HIRAGANA: u32 = 32;
pub const UCDN_SCRIPT_KATAKANA: u32 = 33;
pub const UCDN_SCRIPT_BOPOMOFO: u32 = 34;
pub const UCDN_SCRIPT_HAN: u32 = 35;
pub const UCDN_SCRIPT_YI: u32 = 36;
pub const UCDN_SCRIPT_OLD_ITALIC: u32 = 37;
pub const UCDN_SCRIPT_GOTHIC: u32 = 38;
pub const UCDN_SCRIPT_DESERET: u32 = 39;
pub const UCDN_SCRIPT_INHERITED: u32 = 40;
pub const UCDN_SCRIPT_TAGALOG: u32 = 41;
pub const UCDN_SCRIPT_HANUNOO: u32 = 42;
pub const UCDN_SCRIPT_BUHID: u32 = 43;
pub const UCDN_SCRIPT_TAGBANWA: u32 = 44;
pub const UCDN_SCRIPT_LIMBU: u32 = 45;
pub const UCDN_SCRIPT_TAI_LE: u32 = 46;
pub const UCDN_SCRIPT_LINEAR_B: u32 = 47;
pub const UCDN_SCRIPT_UGARITIC: u32 = 48;
pub const UCDN_SCRIPT_SHAVIAN: u32 = 49;
pub const UCDN_SCRIPT_OSMANYA: u32 = 50;
pub const UCDN_SCRIPT_CYPRIOT: u32 = 51;
pub const UCDN_SCRIPT_BRAILLE: u32 = 52;
pub const UCDN_SCRIPT_BUGINESE: u32 = 53;
pub const UCDN_SCRIPT_COPTIC: u32 = 54;
pub const UCDN_SCRIPT_NEW_TAI_LUE: u32 = 55;
pub const UCDN_SCRIPT_GLAGOLITIC: u32 = 56;
pub const UCDN_SCRIPT_TIFINAGH: u32 = 57;
pub const UCDN_SCRIPT_SYLOTI_NAGRI: u32 = 58;
pub const UCDN_SCRIPT_OLD_PERSIAN: u32 = 59;
pub const UCDN_SCRIPT_KHAROSHTHI: u32 = 60;
pub const UCDN_SCRIPT_BALINESE: u32 = 61;
pub const UCDN_SCRIPT_CUNEIFORM: u32 = 62;
pub const UCDN_SCRIPT_PHOENICIAN: u32 = 63;
pub const UCDN_SCRIPT_PHAGS_PA: u32 = 64;
pub const UCDN_SCRIPT_NKO: u32 = 65;
pub const UCDN_SCRIPT_SUNDANESE: u32 = 66;
pub const UCDN_SCRIPT_LEPCHA: u32 = 67;
pub const UCDN_SCRIPT_OL_CHIKI: u32 = 68;
pub const UCDN_SCRIPT_VAI: u32 = 69;
pub const UCDN_SCRIPT_SAURASHTRA: u32 = 70;
pub const UCDN_SCRIPT_KAYAH_LI: u32 = 71;
pub const UCDN_SCRIPT_REJANG: u32 = 72;
pub const UCDN_SCRIPT_LYCIAN: u32 = 73;
pub const UCDN_SCRIPT_CARIAN: u32 = 74;
pub const UCDN_SCRIPT_LYDIAN: u32 = 75;
pub const UCDN_SCRIPT_CHAM: u32 = 76;
pub const UCDN_SCRIPT_TAI_THAM: u32 = 77;
pub const UCDN_SCRIPT_TAI_VIET: u32 = 78;
pub const UCDN_SCRIPT_AVESTAN: u32 = 79;
pub const UCDN_SCRIPT_EGYPTIAN_HIEROGLYPHS: u32 = 80;
pub const UCDN_SCRIPT_SAMARITAN: u32 = 81;
pub const UCDN_SCRIPT_LISU: u32 = 82;
pub const UCDN_SCRIPT_BAMUM: u32 = 83;
pub const UCDN_SCRIPT_JAVANESE: u32 = 84;
pub const UCDN_SCRIPT_MEETEI_MAYEK: u32 = 85;
pub const UCDN_SCRIPT_IMPERIAL_ARAMAIC: u32 = 86;
pub const UCDN_SCRIPT_OLD_SOUTH_ARABIAN: u32 = 87;
pub const UCDN_SCRIPT_INSCRIPTIONAL_PARTHIAN: u32 = 88;
pub const UCDN_SCRIPT_INSCRIPTIONAL_PAHLAVI: u32 = 89;
pub const UCDN_SCRIPT_OLD_TURKIC: u32 = 90;
pub const UCDN_SCRIPT_KAITHI: u32 = 91;
pub const UCDN_SCRIPT_BATAK: u32 = 92;
pub const UCDN_SCRIPT_BRAHMI: u32 = 93;
pub const UCDN_SCRIPT_MANDAIC: u32 = 94;
pub const UCDN_SCRIPT_CHAKMA: u32 = 95;
pub const UCDN_SCRIPT_MEROITIC_CURSIVE: u32 = 96;
pub const UCDN_SCRIPT_MEROITIC_HIEROGLYPHS: u32 = 97;
pub const UCDN_SCRIPT_MIAO: u32 = 98;
pub const UCDN_SCRIPT_SHARADA: u32 = 99;
pub const UCDN_SCRIPT_SORA_SOMPENG: u32 = 100;
pub const UCDN_SCRIPT_TAKRI: u32 = 101;
pub const UCDN_SCRIPT_UNKNOWN: u32 = 102;
pub const UCDN_SCRIPT_BASSA_VAH: u32 = 103;
pub const UCDN_SCRIPT_CAUCASIAN_ALBANIAN: u32 = 104;
pub const UCDN_SCRIPT_DUPLOYAN: u32 = 105;
pub const UCDN_SCRIPT_ELBASAN: u32 = 106;
pub const UCDN_SCRIPT_GRANTHA: u32 = 107;
pub const UCDN_SCRIPT_KHOJKI: u32 = 108;
pub const UCDN_SCRIPT_KHUDAWADI: u32 = 109;
pub const UCDN_SCRIPT_LINEAR_A: u32 = 110;
pub const UCDN_SCRIPT_MAHAJANI: u32 = 111;
pub const UCDN_SCRIPT_MANICHAEAN: u32 = 112;
pub const UCDN_SCRIPT_MENDE_KIKAKUI: u32 = 113;
pub const UCDN_SCRIPT_MODI: u32 = 114;
pub const UCDN_SCRIPT_MRO: u32 = 115;
pub const UCDN_SCRIPT_NABATAEAN: u32 = 116;
pub const UCDN_SCRIPT_OLD_NORTH_ARABIAN: u32 = 117;
pub const UCDN_SCRIPT_OLD_PERMIC: u32 = 118;
pub const UCDN_SCRIPT_PAHAWH_HMONG: u32 = 119;
pub const UCDN_SCRIPT_PALMYRENE: u32 = 120;
pub const UCDN_SCRIPT_PAU_CIN_HAU: u32 = 121;
pub const UCDN_SCRIPT_PSALTER_PAHLAVI: u32 = 122;
pub const UCDN_SCRIPT_SIDDHAM: u32 = 123;
pub const UCDN_SCRIPT_TIRHUTA: u32 = 124;
pub const UCDN_SCRIPT_WARANG_CITI: u32 = 125;
pub const UCDN_SCRIPT_AHOM: u32 = 126;
pub const UCDN_SCRIPT_ANATOLIAN_HIEROGLYPHS: u32 = 127;
pub const UCDN_SCRIPT_HATRAN: u32 = 128;
pub const UCDN_SCRIPT_MULTANI: u32 = 129;
pub const UCDN_SCRIPT_OLD_HUNGARIAN: u32 = 130;
pub const UCDN_SCRIPT_SIGNWRITING: u32 = 131;
pub const UCDN_SCRIPT_ADLAM: u32 = 132;
pub const UCDN_SCRIPT_BHAIKSUKI: u32 = 133;
pub const UCDN_SCRIPT_MARCHEN: u32 = 134;
pub const UCDN_SCRIPT_NEWA: u32 = 135;
pub const UCDN_SCRIPT_OSAGE: u32 = 136;
pub const UCDN_SCRIPT_TANGUT: u32 = 137;
pub const UCDN_SCRIPT_MASARAM_GONDI: u32 = 138;
pub const UCDN_SCRIPT_NUSHU: u32 = 139;
pub const UCDN_SCRIPT_SOYOMBO: u32 = 140;
pub const UCDN_SCRIPT_ZANABAZAR_SQUARE: u32 = 141;
pub const UCDN_SCRIPT_DOGRA: u32 = 142;
pub const UCDN_SCRIPT_GUNJALA_GONDI: u32 = 143;
pub const UCDN_SCRIPT_HANIFI_ROHINGYA: u32 = 144;
pub const UCDN_SCRIPT_MAKASAR: u32 = 145;
pub const UCDN_SCRIPT_MEDEFAIDRIN: u32 = 146;
pub const UCDN_SCRIPT_OLD_SOGDIAN: u32 = 147;
pub const UCDN_SCRIPT_SOGDIAN: u32 = 148;
pub const UCDN_SCRIPT_ELYMAIC: u32 = 149;
pub const UCDN_SCRIPT_NANDINAGARI: u32 = 150;
pub const UCDN_SCRIPT_NYIAKENG_PUACHUE_HMONG: u32 = 151;
pub const UCDN_SCRIPT_WANCHO: u32 = 152;
pub const UCDN_SCRIPT_CHORASMIAN: u32 = 153;
pub const UCDN_SCRIPT_DIVES_AKURU: u32 = 154;
pub const UCDN_SCRIPT_KHITAN_SMALL_SCRIPT: u32 = 155;
pub const UCDN_SCRIPT_YEZIDI: u32 = 156;
pub const UCDN_SCRIPT_VITHKUQI: u32 = 157;
pub const UCDN_SCRIPT_OLD_UYGHUR: u32 = 158;
pub const UCDN_SCRIPT_CYPRO_MINOAN: u32 = 159;
pub const UCDN_SCRIPT_TANGSA: u32 = 160;
pub const UCDN_SCRIPT_TOTO: u32 = 161;
pub const UCDN_SCRIPT_KAWI: u32 = 162;
pub const UCDN_SCRIPT_NAG_MUNDARI: u32 = 163;
pub const UCDN_SCRIPT_TODHRI: u32 = 164;
pub const UCDN_SCRIPT_GARAY: u32 = 165;
pub const UCDN_SCRIPT_TULU_TIGALARI: u32 = 166;
pub const UCDN_SCRIPT_SUNUWAR: u32 = 167;
pub const UCDN_SCRIPT_GURUNG_KHEMA: u32 = 168;
pub const UCDN_SCRIPT_KIRAT_RAI: u32 = 169;
pub const UCDN_SCRIPT_OL_ONAL: u32 = 170;
pub const UCDN_LAST_SCRIPT: u32 = 170;
pub const UCDN_LINEBREAK_CLASS_OP: u32 = 0;
pub const UCDN_LINEBREAK_CLASS_CL: u32 = 1;
pub const UCDN_LINEBREAK_CLASS_CP: u32 = 2;
pub const UCDN_LINEBREAK_CLASS_QU: u32 = 3;
pub const UCDN_LINEBREAK_CLASS_GL: u32 = 4;
pub const UCDN_LINEBREAK_CLASS_NS: u32 = 5;
pub const UCDN_LINEBREAK_CLASS_EX: u32 = 6;
pub const UCDN_LINEBREAK_CLASS_SY: u32 = 7;
pub const UCDN_LINEBREAK_CLASS_IS: u32 = 8;
pub const UCDN_LINEBREAK_CLASS_PR: u32 = 9;
pub const UCDN_LINEBREAK_CLASS_PO: u32 = 10;
pub const UCDN_LINEBREAK_CLASS_NU: u32 = 11;
pub const UCDN_LINEBREAK_CLASS_AL: u32 = 12;
pub const UCDN_LINEBREAK_CLASS_HL: u32 = 13;
pub const UCDN_LINEBREAK_CLASS_ID: u32 = 14;
pub const UCDN_LINEBREAK_CLASS_IN: u32 = 15;
pub const UCDN_LINEBREAK_CLASS_HY: u32 = 16;
pub const UCDN_LINEBREAK_CLASS_BA: u32 = 17;
pub const UCDN_LINEBREAK_CLASS_BB: u32 = 18;
pub const UCDN_LINEBREAK_CLASS_B2: u32 = 19;
pub const UCDN_LINEBREAK_CLASS_ZW: u32 = 20;
pub const UCDN_LINEBREAK_CLASS_CM: u32 = 21;
pub const UCDN_LINEBREAK_CLASS_WJ: u32 = 22;
pub const UCDN_LINEBREAK_CLASS_H2: u32 = 23;
pub const UCDN_LINEBREAK_CLASS_H3: u32 = 24;
pub const UCDN_LINEBREAK_CLASS_JL: u32 = 25;
pub const UCDN_LINEBREAK_CLASS_JV: u32 = 26;
pub const UCDN_LINEBREAK_CLASS_JT: u32 = 27;
pub const UCDN_LINEBREAK_CLASS_RI: u32 = 28;
pub const UCDN_LINEBREAK_CLASS_EB: u32 = 29;
pub const UCDN_LINEBREAK_CLASS_EM: u32 = 30;
pub const UCDN_LINEBREAK_CLASS_ZWJ: u32 = 31;
pub const UCDN_LINEBREAK_CLASS_AI: u32 = 32;
pub const UCDN_LINEBREAK_CLASS_BK: u32 = 33;
pub const UCDN_LINEBREAK_CLASS_CB: u32 = 34;
pub const UCDN_LINEBREAK_CLASS_CJ: u32 = 35;
pub const UCDN_LINEBREAK_CLASS_CR: u32 = 36;
pub const UCDN_LINEBREAK_CLASS_LF: u32 = 37;
pub const UCDN_LINEBREAK_CLASS_NL: u32 = 38;
pub const UCDN_LINEBREAK_CLASS_SA: u32 = 39;
pub const UCDN_LINEBREAK_CLASS_SG: u32 = 40;
pub const UCDN_LINEBREAK_CLASS_SP: u32 = 41;
pub const UCDN_LINEBREAK_CLASS_XX: u32 = 42;
pub const UCDN_LINEBREAK_CLASS_AK: u32 = 43;
pub const UCDN_LINEBREAK_CLASS_AP: u32 = 44;
pub const UCDN_LINEBREAK_CLASS_AS: u32 = 45;
pub const UCDN_LINEBREAK_CLASS_VF: u32 = 46;
pub const UCDN_LINEBREAK_CLASS_VI: u32 = 47;
pub const UCDN_GENERAL_CATEGORY_CC: u32 = 0;
pub const UCDN_GENERAL_CATEGORY_CF: u32 = 1;
pub const UCDN_GENERAL_CATEGORY_CN: u32 = 2;
pub const UCDN_GENERAL_CATEGORY_CO: u32 = 3;
pub const UCDN_GENERAL_CATEGORY_CS: u32 = 4;
pub const UCDN_GENERAL_CATEGORY_LL: u32 = 5;
pub const UCDN_GENERAL_CATEGORY_LM: u32 = 6;
pub const UCDN_GENERAL_CATEGORY_LO: u32 = 7;
pub const UCDN_GENERAL_CATEGORY_LT: u32 = 8;
pub const UCDN_GENERAL_CATEGORY_LU: u32 = 9;
pub const UCDN_GENERAL_CATEGORY_MC: u32 = 10;
pub const UCDN_GENERAL_CATEGORY_ME: u32 = 11;
pub const UCDN_GENERAL_CATEGORY_MN: u32 = 12;
pub const UCDN_GENERAL_CATEGORY_ND: u32 = 13;
pub const UCDN_GENERAL_CATEGORY_NL: u32 = 14;
pub const UCDN_GENERAL_CATEGORY_NO: u32 = 15;
pub const UCDN_GENERAL_CATEGORY_PC: u32 = 16;
pub const UCDN_GENERAL_CATEGORY_PD: u32 = 17;
pub const UCDN_GENERAL_CATEGORY_PE: u32 = 18;
pub const UCDN_GENERAL_CATEGORY_PF: u32 = 19;
pub const UCDN_GENERAL_CATEGORY_PI: u32 = 20;
pub const UCDN_GENERAL_CATEGORY_PO: u32 = 21;
pub const UCDN_GENERAL_CATEGORY_PS: u32 = 22;
pub const UCDN_GENERAL_CATEGORY_SC: u32 = 23;
pub const UCDN_GENERAL_CATEGORY_SK: u32 = 24;
pub const UCDN_GENERAL_CATEGORY_SM: u32 = 25;
pub const UCDN_GENERAL_CATEGORY_SO: u32 = 26;
pub const UCDN_GENERAL_CATEGORY_ZL: u32 = 27;
pub const UCDN_GENERAL_CATEGORY_ZP: u32 = 28;
pub const UCDN_GENERAL_CATEGORY_ZS: u32 = 29;
pub const UCDN_BIDI_CLASS_L: u32 = 0;
pub const UCDN_BIDI_CLASS_LRE: u32 = 1;
pub const UCDN_BIDI_CLASS_LRO: u32 = 2;
pub const UCDN_BIDI_CLASS_R: u32 = 3;
pub const UCDN_BIDI_CLASS_AL: u32 = 4;
pub const UCDN_BIDI_CLASS_RLE: u32 = 5;
pub const UCDN_BIDI_CLASS_RLO: u32 = 6;
pub const UCDN_BIDI_CLASS_PDF: u32 = 7;
pub const UCDN_BIDI_CLASS_EN: u32 = 8;
pub const UCDN_BIDI_CLASS_ES: u32 = 9;
pub const UCDN_BIDI_CLASS_ET: u32 = 10;
pub const UCDN_BIDI_CLASS_AN: u32 = 11;
pub const UCDN_BIDI_CLASS_CS: u32 = 12;
pub const UCDN_BIDI_CLASS_NSM: u32 = 13;
pub const UCDN_BIDI_CLASS_BN: u32 = 14;
pub const UCDN_BIDI_CLASS_B: u32 = 15;
pub const UCDN_BIDI_CLASS_S: u32 = 16;
pub const UCDN_BIDI_CLASS_WS: u32 = 17;
pub const UCDN_BIDI_CLASS_ON: u32 = 18;
pub const UCDN_BIDI_CLASS_LRI: u32 = 19;
pub const UCDN_BIDI_CLASS_RLI: u32 = 20;
pub const UCDN_BIDI_CLASS_FSI: u32 = 21;
pub const UCDN_BIDI_CLASS_PDI: u32 = 22;
pub const UCDN_BIDI_PAIRED_BRACKET_TYPE_OPEN: u32 = 0;
pub const UCDN_BIDI_PAIRED_BRACKET_TYPE_CLOSE: u32 = 1;
pub const UCDN_BIDI_PAIRED_BRACKET_TYPE_NONE: u32 = 2;
pub const PDF_MAX_OBJECT_NUMBER: u32 = 8388607;
pub const PDF_MAX_GEN_NUMBER: u32 = 65535;
pub const PDF_MRANGE_CAP: u32 = 256;
pub type wchar_t = ::core::ffi::c_int;
#[repr(C)]
#[repr(align(16))]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
    pub _bindgen_opaque_blob: [u128; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of max_align_t"][::core::mem::size_of::<max_align_t>() - 32usize];
    ["Alignment of max_align_t"][::core::mem::align_of::<max_align_t>() - 16usize];
};
pub type FILE = __BindgenOpaqueArray<u64, 27usize>;
unsafe extern "C" {
    pub fn Memento_checkBlock(arg1: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_checkAllMemory() -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_check() -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_setParanoia(arg1: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_paranoidAt(arg1: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_breakAt(arg1: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_breakOnFree(a: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    pub fn Memento_breakOnRealloc(a: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    pub fn Memento_getBlockNum(arg1: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_find(a: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_breakpoint();
}
unsafe extern "C" {
    pub fn Memento_failAt(arg1: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_failThisEvent() -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_listBlocks();
}
unsafe extern "C" {
    pub fn Memento_listNewBlocks();
}
unsafe extern "C" {
    pub fn Memento_listLargeBlocks();
}
unsafe extern "C" {
    pub fn Memento_listPhasedBlocks();
}
unsafe extern "C" {
    pub fn Memento_setMax(arg1: usize) -> usize;
}
unsafe extern "C" {
    pub fn Memento_stats();
}
unsafe extern "C" {
    pub fn Memento_label(
        arg1: *mut ::core::ffi::c_void,
        arg2: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_tick();
}
unsafe extern "C" {
    pub fn Memento_setVerbose(arg1: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_addBacktraceLimitFnname(
        fnname: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_setAtexitFin(atexitfin: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_setIgnoreNewDelete(ignore: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_malloc(s: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_realloc(arg1: *mut ::core::ffi::c_void, s: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_free(arg1: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    pub fn Memento_calloc(arg1: usize, arg2: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_strdup(arg1: *const ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn Memento_asprintf(
        ret: *mut *mut ::core::ffi::c_char,
        format: *const ::core::ffi::c_char,
        ...
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_info(addr: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    pub fn Memento_listBlockInfo();
}
unsafe extern "C" {
    pub fn Memento_blockInfo(blk: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    pub fn Memento_takeByteRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_dropByteRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_takeShortRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_dropShortRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_takeIntRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_dropIntRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_takeRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_dropRef(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_adjustRef(
        blk: *mut ::core::ffi::c_void,
        adjust: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_reference(blk: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_checkPointerOrNull(blk: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_checkBytePointerOrNull(blk: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_checkShortPointerOrNull(blk: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_checkIntPointerOrNull(blk: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_startLeaking();
}
unsafe extern "C" {
    pub fn Memento_stopLeaking();
}
unsafe extern "C" {
    pub fn Memento_sequence() -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_squeezing() -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn Memento_fin();
}
unsafe extern "C" {
    pub fn Memento_bt();
}
unsafe extern "C" {
    pub fn Memento_cpp_new(size: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_cpp_delete(pointer: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    pub fn Memento_cpp_new_array(size: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn Memento_cpp_delete_array(pointer: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    pub fn Memento_showHash(hash: ::core::ffi::c_uint);
}
unsafe extern "C" {
    pub fn fz_stat_ctime(path: *const ::core::ffi::c_char) -> i64;
}
unsafe extern "C" {
    pub fn fz_stat_mtime(path: *const ::core::ffi::c_char) -> i64;
}
unsafe extern "C" {
    pub fn fz_mkdir(path: *mut ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Range checking atof"]
    pub fn fz_atof(s: *const ::core::ffi::c_char) -> f32;
}
unsafe extern "C" {
    #[doc = "atoi that copes with `NULL`"]
    pub fn fz_atoi(s: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "64bit atoi that copes with `NULL`"]
    pub fn fz_atoi64(s: *const ::core::ffi::c_char) -> i64;
}
unsafe extern "C" {
    #[doc = "size_t atoi that copes with `NULL`.\n\n`NOTE`: limited to 63bits. Negative numbers<br>are returned as 0."]
    pub fn fz_atoz(s: *const ::core::ffi::c_char) -> usize;
}
#[doc = "[`fz_point`] is a point in a two-dimensional space."]
#[repr(C)]
#[derive(
    Debug, Copy, Clone, zerocopy :: FromBytes, zerocopy :: IntoBytes, zerocopy :: Immutable,
)]
pub struct fz_point {
    pub x: f32,
    pub y: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_point"][::core::mem::size_of::<fz_point>() - 8usize];
    ["Alignment of fz_point"][::core::mem::align_of::<fz_point>() - 4usize];
    ["Offset of field: fz_point::x"][::core::mem::offset_of!(fz_point, x) - 0usize];
    ["Offset of field: fz_point::y"][::core::mem::offset_of!(fz_point, y) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_rect {
    pub x0: f32,
    pub y0: f32,
    pub x1: f32,
    pub y1: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_rect"][::core::mem::size_of::<fz_rect>() - 16usize];
    ["Alignment of fz_rect"][::core::mem::align_of::<fz_rect>() - 4usize];
    ["Offset of field: fz_rect::x0"][::core::mem::offset_of!(fz_rect, x0) - 0usize];
    ["Offset of field: fz_rect::y0"][::core::mem::offset_of!(fz_rect, y0) - 4usize];
    ["Offset of field: fz_rect::x1"][::core::mem::offset_of!(fz_rect, x1) - 8usize];
    ["Offset of field: fz_rect::y1"][::core::mem::offset_of!(fz_rect, y1) - 12usize];
};
#[doc = "[`fz_irect`] is a rectangle using integers instead of floats.\n\nIt's used in the draw device and for pixmap dimensions."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_irect {
    pub x0: ::core::ffi::c_int,
    pub y0: ::core::ffi::c_int,
    pub x1: ::core::ffi::c_int,
    pub y1: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_irect"][::core::mem::size_of::<fz_irect>() - 16usize];
    ["Alignment of fz_irect"][::core::mem::align_of::<fz_irect>() - 4usize];
    ["Offset of field: fz_irect::x0"][::core::mem::offset_of!(fz_irect, x0) - 0usize];
    ["Offset of field: fz_irect::y0"][::core::mem::offset_of!(fz_irect, y0) - 4usize];
    ["Offset of field: fz_irect::x1"][::core::mem::offset_of!(fz_irect, x1) - 8usize];
    ["Offset of field: fz_irect::y1"][::core::mem::offset_of!(fz_irect, y1) - 12usize];
};
unsafe extern "C" {
    #[doc = "A rectangle with sides of length one.\n\nThe bottom left corner is at \\(0, 0\\) and the top right corner<br>is at \\(1, 1\\)."]
    pub static fz_unit_rect: fz_rect;
}
unsafe extern "C" {
    #[doc = "An empty rectangle with an area equal to zero."]
    pub static fz_empty_rect: fz_rect;
}
unsafe extern "C" {
    pub static fz_empty_irect: fz_irect;
}
unsafe extern "C" {
    #[doc = "An infinite rectangle."]
    pub static fz_infinite_rect: fz_rect;
}
unsafe extern "C" {
    pub static fz_infinite_irect: fz_irect;
}
unsafe extern "C" {
    #[doc = "An invalid rectangle."]
    pub static fz_invalid_rect: fz_rect;
}
unsafe extern "C" {
    pub static fz_invalid_irect: fz_irect;
}
#[doc = "[`fz_matrix`] is a row-major 3x3 matrix used for representing<br>transformations of coordinates throughout MuPDF.\n\nSince all points reside in a two-dimensional space, one vector<br>is always a constant unit vector; hence only some elements may<br>vary in a matrix. Below is how the elements map between<br>different representations.\n\n/ a b 0 \\<br>| c d 0 | normally represented as \\[ a b c d e f \\].<br>\\ e f 1 /"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_matrix {
    pub a: f32,
    pub b: f32,
    pub c: f32,
    pub d: f32,
    pub e: f32,
    pub f: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_matrix"][::core::mem::size_of::<fz_matrix>() - 24usize];
    ["Alignment of fz_matrix"][::core::mem::align_of::<fz_matrix>() - 4usize];
    ["Offset of field: fz_matrix::a"][::core::mem::offset_of!(fz_matrix, a) - 0usize];
    ["Offset of field: fz_matrix::b"][::core::mem::offset_of!(fz_matrix, b) - 4usize];
    ["Offset of field: fz_matrix::c"][::core::mem::offset_of!(fz_matrix, c) - 8usize];
    ["Offset of field: fz_matrix::d"][::core::mem::offset_of!(fz_matrix, d) - 12usize];
    ["Offset of field: fz_matrix::e"][::core::mem::offset_of!(fz_matrix, e) - 16usize];
    ["Offset of field: fz_matrix::f"][::core::mem::offset_of!(fz_matrix, f) - 20usize];
};
unsafe extern "C" {
    #[doc = "Identity transform matrix."]
    pub static fz_identity: fz_matrix;
}
unsafe extern "C" {
    #[doc = "Multiply two matrices.\n\nThe order of the two matrices are important since matrix<br>multiplication is not commutative.\n\nReturns result."]
    pub fn fz_concat(left: fz_matrix, right: fz_matrix) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Create a scaling matrix.\n\nThe returned matrix is of the form \\[ sx 0 0 sy 0 0 \\].\n\n`m`: Pointer to the matrix to populate\n\n`sx`, `sy`: Scaling factors along the X- and Y-axes. A scaling<br>factor of 1.0 will not cause any scaling along the relevant<br>axis.\n\nReturns m."]
    pub fn fz_scale(sx: f32, sy: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Scale a matrix by premultiplication.\n\n`m`: Pointer to the matrix to scale\n\n`sx`, `sy`: Scaling factors along the X- and Y-axes. A scaling<br>factor of 1.0 will not cause any scaling along the relevant<br>axis.\n\nReturns m \\(updated\\)."]
    pub fn fz_pre_scale(m: fz_matrix, sx: f32, sy: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Scale a matrix by postmultiplication.\n\n`m`: Pointer to the matrix to scale\n\n`sx`, `sy`: Scaling factors along the X- and Y-axes. A scaling<br>factor of 1.0 will not cause any scaling along the relevant<br>axis.\n\nReturns m \\(updated\\)."]
    pub fn fz_post_scale(m: fz_matrix, sx: f32, sy: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Create a shearing matrix.\n\nThe returned matrix is of the form \\[ 1 sy sx 1 0 0 \\].\n\n`m`: pointer to place to store returned matrix\n\n`sx`, `sy`: Shearing factors. A shearing factor of 0.0 will not<br>cause any shearing along the relevant axis.\n\nReturns m."]
    pub fn fz_shear(sx: f32, sy: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Premultiply a matrix with a shearing matrix.\n\nThe shearing matrix is of the form \\[ 1 sy sx 1 0 0 \\].\n\n`m`: pointer to matrix to premultiply\n\n`sx`, `sy`: Shearing factors. A shearing factor of 0.0 will not<br>cause any shearing along the relevant axis.\n\nReturns m \\(updated\\)."]
    pub fn fz_pre_shear(m: fz_matrix, sx: f32, sy: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Create a rotation matrix.\n\nThe returned matrix is of the form<br>\\[ cos\\(deg\\) sin\\(deg\\) -sin\\(deg\\) cos\\(deg\\) 0 0 \\].\n\n`m`: Pointer to place to store matrix\n\n`degrees`: Degrees of counter clockwise rotation. Values less<br>than zero and greater than 360 are handled as expected.\n\nReturns m."]
    pub fn fz_rotate(degrees: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Rotate a transformation by premultiplying.\n\nThe premultiplied matrix is of the form<br>\\[ cos\\(deg\\) sin\\(deg\\) -sin\\(deg\\) cos\\(deg\\) 0 0 \\].\n\n`m`: Pointer to matrix to premultiply.\n\n`degrees`: Degrees of counter clockwise rotation. Values less<br>than zero and greater than 360 are handled as expected.\n\nReturns m \\(updated\\)."]
    pub fn fz_pre_rotate(m: fz_matrix, degrees: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Create a translation matrix.\n\nThe returned matrix is of the form \\[ 1 0 0 1 tx ty \\].\n\n`m`: A place to store the created matrix.\n\n`tx`, `ty`: Translation distances along the X- and Y-axes. A<br>translation of 0 will not cause any translation along the<br>relevant axis.\n\nReturns m."]
    pub fn fz_translate(tx: f32, ty: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Translate a matrix by premultiplication.\n\n`m`: The matrix to translate\n\n`tx`, `ty`: Translation distances along the X- and Y-axes. A<br>translation of 0 will not cause any translation along the<br>relevant axis.\n\nReturns m."]
    pub fn fz_pre_translate(m: fz_matrix, tx: f32, ty: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Create transform matrix to draw page<br>at a given resolution and rotation. Adjusts the scaling<br>factors so that the page covers whole number of<br>pixels and adjust the page origin to be at 0,0."]
    pub fn fz_transform_page(mediabox: fz_rect, resolution: f32, rotate: f32) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Create an inverse matrix.\n\n`matrix`: Matrix to invert. A degenerate matrix, where the<br>determinant is equal to zero, can not be inverted and the<br>original matrix is returned instead.\n\nReturns inverse."]
    pub fn fz_invert_matrix(matrix: fz_matrix) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Attempt to create an inverse matrix.\n\n`inv`: Place to store inverse matrix.\n\n`src`: Matrix to invert. A degenerate matrix, where the<br>determinant is equal to zero, can not be inverted.\n\nReturns 1 if matrix is degenerate \\(singular\\), or 0 otherwise."]
    pub fn fz_try_invert_matrix(inv: *mut fz_matrix, src: fz_matrix) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Check if a transformation is rectilinear.\n\nRectilinear means that no shearing is present and that any<br>rotations present are a multiple of 90 degrees. Usually this<br>is used to make sure that axis-aligned rectangles before the<br>transformation are still axis-aligned rectangles afterwards."]
    pub fn fz_is_rectilinear(m: fz_matrix) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Calculate average scaling factor of matrix."]
    pub fn fz_matrix_expansion(m: fz_matrix) -> f32;
}
unsafe extern "C" {
    #[doc = "Compute intersection of two rectangles.\n\nGiven two rectangles, update the first to be the smallest<br>axis-aligned rectangle that covers the area covered by both<br>given rectangles. If either rectangle is empty then the<br>intersection is also empty. If either rectangle is infinite<br>then the intersection is simply the non-infinite rectangle.<br>Should both rectangles be infinite, then the intersection is<br>also infinite."]
    pub fn fz_intersect_rect(a: fz_rect, b: fz_rect) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Compute intersection of two bounding boxes.\n\nSimilar to [`fz_intersect_rect`] but operates on two bounding<br>boxes instead of two rectangles."]
    pub fn fz_intersect_irect(a: fz_irect, b: fz_irect) -> fz_irect;
}
unsafe extern "C" {
    #[doc = "Compute union of two rectangles.\n\nGiven two rectangles, update the first to be the smallest<br>axis-aligned rectangle that encompasses both given rectangles.<br>If either rectangle is infinite then the union is also infinite.<br>If either rectangle is empty then the union is simply the<br>non-empty rectangle. Should both rectangles be empty, then the<br>union is also empty."]
    pub fn fz_union_rect(a: fz_rect, b: fz_rect) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Convert a rect into the minimal bounding box<br>that covers the rectangle.\n\nCoordinates in a bounding box are integers, so rounding of the<br>rects coordinates takes place. The top left corner is rounded<br>upwards and left while the bottom right corner is rounded<br>downwards and to the right."]
    pub fn fz_irect_from_rect(rect: fz_rect) -> fz_irect;
}
unsafe extern "C" {
    #[doc = "Round rectangle coordinates.\n\nCoordinates in a bounding box are integers, so rounding of the<br>rects coordinates takes place. The top left corner is rounded<br>upwards and left while the bottom right corner is rounded<br>downwards and to the right.\n\nThis differs from [`fz_irect_from_rect`], in that [`fz_irect_from_rect`]<br>slavishly follows the numbers \\(i.e any slight over/under<br>calculations can cause whole extra pixels to be added\\).<br>[`fz_round_rect`] allows for a small amount of rounding error when<br>calculating the bbox."]
    pub fn fz_round_rect(rect: fz_rect) -> fz_irect;
}
unsafe extern "C" {
    #[doc = "Convert a bbox into a rect.\n\nFor our purposes, a rect can represent all the values we meet in<br>a bbox, so nothing can go wrong.\n\n`rect`: A place to store the generated rectangle.\n\n`bbox`: The bbox to convert.\n\nReturns rect \\(updated\\)."]
    pub fn fz_rect_from_irect(bbox: fz_irect) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Expand a bbox by a given amount in all directions."]
    pub fn fz_expand_rect(b: fz_rect, expand: f32) -> fz_rect;
}
unsafe extern "C" {
    pub fn fz_expand_irect(a: fz_irect, expand: ::core::ffi::c_int) -> fz_irect;
}
unsafe extern "C" {
    #[doc = "Expand a bbox to include a given point.<br>To create a rectangle that encompasses a sequence of points, the<br>rectangle must first be set to be the empty rectangle at one of<br>the points before including the others."]
    pub fn fz_include_point_in_rect(r: fz_rect, p: fz_point) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Translate bounding box.\n\nTranslate a bbox by a given x and y offset. Allows for overflow."]
    pub fn fz_translate_rect(a: fz_rect, xoff: f32, yoff: f32) -> fz_rect;
}
unsafe extern "C" {
    pub fn fz_translate_irect(
        a: fz_irect,
        xoff: ::core::ffi::c_int,
        yoff: ::core::ffi::c_int,
    ) -> fz_irect;
}
unsafe extern "C" {
    #[doc = "Test rectangle inclusion.\n\nReturn true if a entirely contains b."]
    pub fn fz_contains_rect(a: fz_rect, b: fz_rect) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Test rectangle overlap.\n\nReturns true if the area of the overlap is<br>non zero."]
    pub fn fz_overlaps_rect(a: fz_rect, b: fz_rect) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Apply a transformation to a point.\n\n`transform`: Transformation matrix to apply. See [`fz_concat`],<br>[`fz_scale`], [`fz_rotate`] and [`fz_translate`] for how to create a<br>matrix.\n\n`point`: Pointer to point to update.\n\nReturns transform \\(unchanged\\)."]
    pub fn fz_transform_point(point: fz_point, m: fz_matrix) -> fz_point;
}
unsafe extern "C" {
    pub fn fz_transform_point_xy(x: f32, y: f32, m: fz_matrix) -> fz_point;
}
unsafe extern "C" {
    #[doc = "Apply a transformation to a vector.\n\n`transform`: Transformation matrix to apply. See [`fz_concat`],<br>[`fz_scale`] and [`fz_rotate`] for how to create a matrix. Any<br>translation will be ignored.\n\n`vector`: Pointer to vector to update."]
    pub fn fz_transform_vector(vector: fz_point, m: fz_matrix) -> fz_point;
}
unsafe extern "C" {
    #[doc = "Apply a transform to a rectangle.\n\nAfter the four corner points of the axis-aligned rectangle<br>have been transformed it may not longer be axis-aligned. So a<br>new axis-aligned rectangle is created covering at least the<br>area of the transformed rectangle.\n\n`transform`: Transformation matrix to apply. See [`fz_concat`],<br>[`fz_scale`] and [`fz_rotate`] for how to create a matrix.\n\n`rect`: Rectangle to be transformed. The two special cases<br>[`fz_empty_rect`] and [`fz_infinite_rect`], may be used but are<br>returned unchanged as expected."]
    pub fn fz_transform_rect(rect: fz_rect, m: fz_matrix) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Normalize a vector to length one."]
    pub fn fz_normalize_vector(p: fz_point) -> fz_point;
}
unsafe extern "C" {
    #[doc = "Grid fit a matrix.\n\nas_tiled = 0 =\\> adjust the matrix so that the image of the unit<br>square completely covers any pixel that was touched by the<br>image of the unit square under the original matrix.\n\nas_tiled = 1 =\\> adjust the matrix so that the corners of the<br>image of the unit square align with the closest integer corner<br>of the image of the unit square under the original matrix."]
    pub fn fz_gridfit_matrix(as_tiled: ::core::ffi::c_int, m: fz_matrix) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Find the largest expansion performed by this matrix.<br>\\(i.e. max\\(abs\\(m.a\\),abs\\(m.b\\),abs\\(m.c\\),abs\\(m.d\\)\\)"]
    pub fn fz_matrix_max_expansion(m: fz_matrix) -> f32;
}
#[doc = "A representation for a region defined by 4 points.\n\nThe significant difference between quads and rects is that<br>the edges of quads are not axis aligned."]
#[repr(C)]
#[derive(
    Debug, Copy, Clone, zerocopy :: FromBytes, zerocopy :: IntoBytes, zerocopy :: Immutable,
)]
pub struct fz_quad {
    pub ul: fz_point,
    pub ur: fz_point,
    pub ll: fz_point,
    pub lr: fz_point,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_quad"][::core::mem::size_of::<fz_quad>() - 32usize];
    ["Alignment of fz_quad"][::core::mem::align_of::<fz_quad>() - 4usize];
    ["Offset of field: fz_quad::ul"][::core::mem::offset_of!(fz_quad, ul) - 0usize];
    ["Offset of field: fz_quad::ur"][::core::mem::offset_of!(fz_quad, ur) - 8usize];
    ["Offset of field: fz_quad::ll"][::core::mem::offset_of!(fz_quad, ll) - 16usize];
    ["Offset of field: fz_quad::lr"][::core::mem::offset_of!(fz_quad, lr) - 24usize];
};
unsafe extern "C" {
    pub static fz_invalid_quad: fz_quad;
}
unsafe extern "C" {
    pub static fz_infinite_quad: fz_quad;
}
unsafe extern "C" {
    #[doc = "Is a quad valid?"]
    pub fn fz_is_valid_quad(q: fz_quad) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Is a quad empty?"]
    pub fn fz_is_empty_quad(q: fz_quad) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Is a quad infinite?"]
    pub fn fz_is_infinite_quad(q: fz_quad) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Convert a rect to a quad \\(losslessly\\)."]
    pub fn fz_quad_from_rect(r: fz_rect) -> fz_quad;
}
unsafe extern "C" {
    #[doc = "Convert a quad to the smallest rect that covers it."]
    pub fn fz_rect_from_quad(q: fz_quad) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Transform a quad by a matrix."]
    pub fn fz_transform_quad(q: fz_quad, m: fz_matrix) -> fz_quad;
}
unsafe extern "C" {
    #[doc = "Inclusion test for quads."]
    pub fn fz_is_point_inside_quad(p: fz_point, q: fz_quad) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Inclusion test for rects. \\(Rect is assumed to be open, i.e.<br>top right corner is not included\\)."]
    pub fn fz_is_point_inside_rect(p: fz_point, r: fz_rect) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Inclusion test for irects. \\(Rect is assumed to be open, i.e.<br>top right corner is not included\\)."]
    pub fn fz_is_point_inside_irect(
        x: ::core::ffi::c_int,
        y: ::core::ffi::c_int,
        r: fz_irect,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Inclusion test for rects.\n\nrects are assumed to be both open or both closed.\n\nNo invalid rect can include any other rect.<br>No invalid rect can be included by any rect.<br>Empty \\(point\\) rects can include themselves.<br>Empty \\(line\\) rects can include many \\(subline\\) rects."]
    pub fn fz_is_rect_inside_rect(inner: fz_rect, outer: fz_rect) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Inclusion test for irects.\n\nrects are assumed to be both open or both closed.\n\nNo invalid rect can include any other rect.<br>No invalid rect can be included by any rect.<br>Empty \\(point\\) rects can include themselves.<br>Empty \\(line\\) rects can include many \\(subline\\) rects."]
    pub fn fz_is_irect_inside_irect(inner: fz_irect, outer: fz_irect) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Inclusion test for quad in quad.\n\nThis may break down if quads are not 'well formed'."]
    pub fn fz_is_quad_inside_quad(needle: fz_quad, haystack: fz_quad) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Intersection test for quads.\n\nThis may break down if quads are not 'well formed'."]
    pub fn fz_is_quad_intersecting_quad(a: fz_quad, b: fz_quad) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_font_context {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_hyph_context {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_colorspace_context {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_style_context {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_tuning_context {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_store {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_glyph_cache {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_document_handler_context {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_archive_handler_context {
    _unused: [u8; 0],
}
#[doc = "Allocator structure; holds callbacks and private data pointer."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_alloc_context {
    pub user: *mut ::core::ffi::c_void,
    pub malloc: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut ::core::ffi::c_void,
            arg2: usize,
        ) -> *mut ::core::ffi::c_void,
    >,
    pub realloc: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut ::core::ffi::c_void,
            arg2: *mut ::core::ffi::c_void,
            arg3: usize,
        ) -> *mut ::core::ffi::c_void,
    >,
    pub free: ::core::option::Option<
        unsafe extern "C" fn(arg1: *mut ::core::ffi::c_void, arg2: *mut ::core::ffi::c_void),
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_alloc_context"][::core::mem::size_of::<fz_alloc_context>() - 32usize];
    ["Alignment of fz_alloc_context"][::core::mem::align_of::<fz_alloc_context>() - 8usize];
    ["Offset of field: fz_alloc_context::user"]
        [::core::mem::offset_of!(fz_alloc_context, user) - 0usize];
    ["Offset of field: fz_alloc_context::malloc"]
        [::core::mem::offset_of!(fz_alloc_context, malloc) - 8usize];
    ["Offset of field: fz_alloc_context::realloc"]
        [::core::mem::offset_of!(fz_alloc_context, realloc) - 16usize];
    ["Offset of field: fz_alloc_context::free"]
        [::core::mem::offset_of!(fz_alloc_context, free) - 24usize];
};
unsafe extern "C" {
    pub fn fz_throw(
        ctx: *mut fz_context,
        errcode: ::core::ffi::c_int,
        arg1: *const ::core::ffi::c_char,
        ...
    ) -> !;
}
unsafe extern "C" {
    pub fn fz_rethrow(ctx: *mut fz_context) -> !;
}
unsafe extern "C" {
    #[doc = "Called within a catch block this modifies the current<br>exception's code. If it's of type 'fromcode' it is<br>modified to 'tocode'. Typically used for 'downgrading'<br>exception severity."]
    pub fn fz_morph_error(
        ctx: *mut fz_context,
        fromcode: ::core::ffi::c_int,
        tocode: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_warn(ctx: *mut fz_context, fmt: *const ::core::ffi::c_char, ...);
}
unsafe extern "C" {
    #[doc = "Within an [`fz_catch`]\\(\\) block, retrieve the formatted message<br>string for the current exception.\n\nThis assumes no intervening use of [`fz_try`]/[`fz_catch`]."]
    pub fn fz_caught_message(ctx: *mut fz_context) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Within an [`fz_catch`]\\(\\) block, retrieve the error code for<br>the current exception.\n\nThis assumes no intervening use of [`fz_try`]/[`fz_catch`]."]
    pub fn fz_caught(ctx: *mut fz_context) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_caught_errno(ctx: *mut fz_context) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Within an [`fz_catch`]\\(\\) block, rethrow the current exception<br>if the errcode of the current exception matches.\n\nThis assumes no intervening use of [`fz_try`]/[`fz_catch`]."]
    pub fn fz_rethrow_if(ctx: *mut fz_context, errcode: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_rethrow_unless(ctx: *mut fz_context, errcode: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Format an error message, and log it to the registered<br>error stream \\(stderr by default\\)."]
    pub fn fz_log_error_printf(ctx: *mut fz_context, fmt: *const ::core::ffi::c_char, ...);
}
unsafe extern "C" {
    #[doc = "Log a \\(preformatted\\) string to the registered<br>error stream \\(stderr by default\\)."]
    pub fn fz_log_error(ctx: *mut fz_context, str_: *const ::core::ffi::c_char);
}
unsafe extern "C" {
    pub fn fz_start_throw_on_repair(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn fz_end_throw_on_repair(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn fz_report_error(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn fz_ignore_error(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn fz_convert_error(
        ctx: *mut fz_context,
        code: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
pub const FZ_ERROR_NONE: fz_error_type = 0;
pub const FZ_ERROR_GENERIC: fz_error_type = 1;
pub const FZ_ERROR_SYSTEM: fz_error_type = 2;
pub const FZ_ERROR_LIBRARY: fz_error_type = 3;
pub const FZ_ERROR_ARGUMENT: fz_error_type = 4;
pub const FZ_ERROR_LIMIT: fz_error_type = 5;
pub const FZ_ERROR_UNSUPPORTED: fz_error_type = 6;
pub const FZ_ERROR_FORMAT: fz_error_type = 7;
pub const FZ_ERROR_SYNTAX: fz_error_type = 8;
pub const FZ_ERROR_TRYLATER: fz_error_type = 9;
pub const FZ_ERROR_ABORT: fz_error_type = 10;
pub const FZ_ERROR_REPAIRED: fz_error_type = 11;
pub type fz_error_type = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Flush any repeated warnings.\n\nRepeated warnings are buffered, counted and eventually printed<br>along with the number of repetitions. Call [`fz_flush_warnings`]<br>to force printing of the latest buffered warning and the<br>number of repetitions, for example to make sure that all<br>warnings are printed before exiting an application."]
    pub fn fz_flush_warnings(ctx: *mut fz_context);
}
#[doc = "Locking functions\n\nMuPDF is kept deliberately free of any knowledge of particular<br>threading systems. As such, in order for safe multi-threaded<br>operation, we rely on callbacks to client provided functions.\n\nA client is expected to provide [`FZ_LOCK_MAX`] number of mutexes,<br>and a function to lock/unlock each of them. These may be<br>recursive mutexes, but do not have to be.\n\nIf a client does not intend to use multiple threads, then it<br>may pass `NULL` instead of a lock structure.\n\nIn order to avoid deadlocks, we have one simple rule<br>internally as to how we use locks: We can never take lock n<br>when we already hold any lock i, where 0 \\<= i \\<= n. In order<br>to verify this, we have some debugging code, that can be<br>enabled by defining FITZ_DEBUG_LOCKING."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_locks_context {
    pub user: *mut ::core::ffi::c_void,
    pub lock: ::core::option::Option<
        unsafe extern "C" fn(user: *mut ::core::ffi::c_void, lock: ::core::ffi::c_int),
    >,
    pub unlock: ::core::option::Option<
        unsafe extern "C" fn(user: *mut ::core::ffi::c_void, lock: ::core::ffi::c_int),
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_locks_context"][::core::mem::size_of::<fz_locks_context>() - 24usize];
    ["Alignment of fz_locks_context"][::core::mem::align_of::<fz_locks_context>() - 8usize];
    ["Offset of field: fz_locks_context::user"]
        [::core::mem::offset_of!(fz_locks_context, user) - 0usize];
    ["Offset of field: fz_locks_context::lock"]
        [::core::mem::offset_of!(fz_locks_context, lock) - 8usize];
    ["Offset of field: fz_locks_context::unlock"]
        [::core::mem::offset_of!(fz_locks_context, unlock) - 16usize];
};
pub const FZ_LOCK_ALLOC: _bindgen_ty_2 = 0;
pub const FZ_LOCK_FREETYPE: _bindgen_ty_2 = 1;
pub const FZ_LOCK_GLYPHCACHE: _bindgen_ty_2 = 2;
pub const FZ_LOCK_MAX: _bindgen_ty_2 = 3;
pub type _bindgen_ty_2 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn fz_assert_lock_held(ctx: *mut fz_context, lock: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_assert_lock_not_held(ctx: *mut fz_context, lock: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_lock_debug_lock(ctx: *mut fz_context, lock: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_lock_debug_unlock(ctx: *mut fz_context, lock: ::core::ffi::c_int);
}
pub const FZ_STORE_UNLIMITED: _bindgen_ty_3 = 0;
pub const FZ_STORE_DEFAULT: _bindgen_ty_3 = 268435456;
#[doc = "Specifies the maximum size in bytes of the resource store in<br>[`fz_context`]. Given as argument to [`fz_new_context`].\n\n[`FZ_STORE_UNLIMITED`]: Let resource store grow unbounded.\n\n[`FZ_STORE_DEFAULT`]: A reasonable upper bound on the size, for<br>devices that are not memory constrained."]
pub type _bindgen_ty_3 = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Make a clone of an existing context.\n\nThis function is meant to be used in multi-threaded<br>applications where each thread requires its own context, yet<br>parts of the global state, for example caching, are shared.\n\n`ctx`: Context obtained from [`fz_new_context`] to make a copy of.<br>ctx must have had locks and lock/functions setup when created.<br>The two contexts will share the memory allocator, resource<br>store, locks and lock/unlock functions. They will each have<br>their own exception stacks though.\n\nMay return `NULL`."]
    pub fn fz_clone_context(ctx: *mut fz_context) -> *mut fz_context;
}
unsafe extern "C" {
    #[doc = "Free a context and its global state.\n\nThe context and all of its global state is freed, and any<br>buffered warnings are flushed \\(see [`fz_flush_warnings`]\\). If `NULL`<br>is passed in nothing will happen.\n\nMust not be called for a context that is being used in an active<br>[`fz_try`]\\(\\), [`fz_alway`](fz_alway)s\\(\\) or [`fz_catch`]\\(\\) block."]
    pub fn fz_drop_context(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Set the user field in the context.\n\n`NULL` initially, this field can be set to any opaque value<br>required by the user. It is copied on clones."]
    pub fn fz_set_user_context(ctx: *mut fz_context, user: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    #[doc = "Read the user field from the context."]
    pub fn fz_user_context(ctx: *mut fz_context) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "`FIXME`: Better not to expose [`fz_default_error_callback`], and<br>[`fz_default_warning`] callback and to allow '`NULL`' to be used<br>int [`fz_set_xxxx_callback`] to mean \"defaults\".\n\n`FIXME`: Do we need/want functions like<br>[`fz_error_callback`]\\(ctx, message\\) to allow callers to inject<br>stuff into the error/warning streams?<br>/<br>/**<br>The default error callback. Declared publicly just so that the<br>error callback can be set back to this after it has been<br>overridden."]
    pub fn fz_default_error_callback(
        user: *mut ::core::ffi::c_void,
        message: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "The default warning callback. Declared publicly just so that<br>the warning callback can be set back to this after it has been<br>overridden."]
    pub fn fz_default_warning_callback(
        user: *mut ::core::ffi::c_void,
        message: *const ::core::ffi::c_char,
    );
}
#[doc = "A callback called whenever an error message is generated.<br>The user pointer passed to [`fz_set_error_callback`]\\(\\) is passed<br>along with the error message."]
pub type fz_error_cb = ::core::option::Option<
    unsafe extern "C" fn(user: *mut ::core::ffi::c_void, message: *const ::core::ffi::c_char),
>;
#[doc = "A callback called whenever a warning message is generated.<br>The user pointer passed to [`fz_set_warning_callback`]\\(\\) is<br>passed along with the warning message."]
pub type fz_warning_cb = ::core::option::Option<
    unsafe extern "C" fn(user: *mut ::core::ffi::c_void, message: *const ::core::ffi::c_char),
>;
unsafe extern "C" {
    #[doc = "Set the error callback. This will be called as part of the<br>exception handling.\n\nThe callback must not throw exceptions!"]
    pub fn fz_set_error_callback(
        ctx: *mut fz_context,
        error_cb: fz_error_cb,
        user: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Retrieve the currently set error callback, or `NULL` if none<br>has been set. Optionally, if user is non-`NULL`, the user pointer<br>given when the warning callback was set is also passed back to<br>the caller."]
    pub fn fz_error_callback(
        ctx: *mut fz_context,
        user: *mut *mut ::core::ffi::c_void,
    ) -> fz_error_cb;
}
unsafe extern "C" {
    #[doc = "Set the warning callback. This will be called as part of the<br>exception handling.\n\nThe callback must not throw exceptions!"]
    pub fn fz_set_warning_callback(
        ctx: *mut fz_context,
        warning_cb: fz_warning_cb,
        user: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Retrieve the currently set warning callback, or `NULL` if none<br>has been set. Optionally, if user is non-`NULL`, the user pointer<br>given when the warning callback was set is also passed back to<br>the caller."]
    pub fn fz_warning_callback(
        ctx: *mut fz_context,
        user: *mut *mut ::core::ffi::c_void,
    ) -> fz_warning_cb;
}
#[doc = "Given the width and height of an image,<br>the subsample factor, and the subarea of the image actually<br>required, the caller can decide whether to decode the whole<br>image or just a subarea.\n\n`arg`: The caller supplied opaque argument.\n\n`w`, `h`: The width/height of the complete image.\n\n`l2factor`: The log2 factor for subsampling \\(i.e. image will be<br>decoded to \\(w\\>\\>l2factor, h\\>\\>l2factor\\)\\).\n\n`subarea`: The actual subarea required for the current operation.<br>The tuning function is allowed to increase this in size if<br>required."]
pub type fz_tune_image_decode_fn = ::core::option::Option<
    unsafe extern "C" fn(
        arg: *mut ::core::ffi::c_void,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        l2factor: ::core::ffi::c_int,
        subarea: *mut fz_irect,
    ),
>;
#[doc = "Given the source width and height of<br>image, together with the actual required width and height,<br>decide whether we should use mitchell scaling.\n\n`arg`: The caller supplied opaque argument.\n\n`dst_w`, `dst_h`: The actual width/height required on the target<br>device.\n\n`src_w`, `src_h`: The source width/height of the image.\n\nReturn 0 not to use the Mitchell scaler, 1 to use the Mitchell<br>scaler. All other values reserved."]
pub type fz_tune_image_scale_fn = ::core::option::Option<
    unsafe extern "C" fn(
        arg: *mut ::core::ffi::c_void,
        dst_w: ::core::ffi::c_int,
        dst_h: ::core::ffi::c_int,
        src_w: ::core::ffi::c_int,
        src_h: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int,
>;
unsafe extern "C" {
    #[doc = "Set the tuning function to use for<br>image decode.\n\n`image_decode`: Function to use.\n\n`arg`: Opaque argument to be passed to tuning function."]
    pub fn fz_tune_image_decode(
        ctx: *mut fz_context,
        image_decode: fz_tune_image_decode_fn,
        arg: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Set the tuning function to use for<br>image scaling.\n\n`image_scale`: Function to use.\n\n`arg`: Opaque argument to be passed to tuning function."]
    pub fn fz_tune_image_scale(
        ctx: *mut fz_context,
        image_scale: fz_tune_image_scale_fn,
        arg: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Get the number of bits of antialiasing we are<br>using \\(for graphics\\). Between 0 and 8."]
    pub fn fz_aa_level(ctx: *mut fz_context) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Set the number of bits of antialiasing we should<br>use \\(for both text and graphics\\).\n\n`bits`: The number of bits of antialiasing to use \\(values are<br>clamped to within the 0 to 8 range\\)."]
    pub fn fz_set_aa_level(ctx: *mut fz_context, bits: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Get the number of bits of antialiasing we are<br>using for text. Between 0 and 8."]
    pub fn fz_text_aa_level(ctx: *mut fz_context) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Set the number of bits of antialiasing we<br>should use for text.\n\n`bits`: The number of bits of antialiasing to use \\(values are<br>clamped to within the 0 to 8 range\\)."]
    pub fn fz_set_text_aa_level(ctx: *mut fz_context, bits: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Get the number of bits of antialiasing we are<br>using for graphics. Between 0 and 8."]
    pub fn fz_graphics_aa_level(ctx: *mut fz_context) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Set the number of bits of antialiasing we<br>should use for graphics.\n\n`bits`: The number of bits of antialiasing to use \\(values are<br>clamped to within the 0 to 8 range\\)."]
    pub fn fz_set_graphics_aa_level(ctx: *mut fz_context, bits: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Get the minimum line width to be<br>used for stroked lines.\n\n`min_line_width`: The minimum line width to use \\(in pixels\\)."]
    pub fn fz_graphics_min_line_width(ctx: *mut fz_context) -> f32;
}
unsafe extern "C" {
    #[doc = "Set the minimum line width to be<br>used for stroked lines.\n\n`min_line_width`: The minimum line width to use \\(in pixels\\)."]
    pub fn fz_set_graphics_min_line_width(ctx: *mut fz_context, min_line_width: f32);
}
unsafe extern "C" {
    #[doc = "Get the user stylesheet source text."]
    pub fn fz_user_css(ctx: *mut fz_context) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Set the user stylesheet source text for use with HTML and EPUB."]
    pub fn fz_set_user_css(ctx: *mut fz_context, text: *const ::core::ffi::c_char);
}
unsafe extern "C" {
    #[doc = "Set the user stylesheet by loading the source from a file.<br>If the file is missing, do nothing."]
    pub fn fz_load_user_css(ctx: *mut fz_context, filename: *const ::core::ffi::c_char);
}
unsafe extern "C" {
    #[doc = "Return whether to respect document styles in HTML and EPUB."]
    pub fn fz_use_document_css(ctx: *mut fz_context) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Toggle whether to respect document styles in HTML and EPUB."]
    pub fn fz_set_use_document_css(ctx: *mut fz_context, use_: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Enable icc profile based operation."]
    pub fn fz_enable_icc(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Disable icc profile based operation."]
    pub fn fz_disable_icc(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Allocate uninitialized memory of a given size.<br>Does NOT clear the memory!\n\nMay return `NULL` for size = 0.\n\nThrows exception in the event of failure to allocate."]
    pub fn fz_malloc(ctx: *mut fz_context, size: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Allocate array of memory of count entries of size bytes.<br>Clears the memory to zero.\n\nThrows exception in the event of failure to allocate."]
    pub fn fz_calloc(ctx: *mut fz_context, count: usize, size: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Reallocates a block of memory to given size. Existing contents<br>up to min\\(old_size,new_size\\) are maintained. The rest of the<br>block is uninitialised.\n\n[`fz_realloc`]\\(ctx, `NULL`, size\\) behaves like [`fz_malloc`]\\(ctx, size\\).\n\n[`fz_realloc`]\\(ctx, p, 0\\); behaves like [`fz_free`]\\(ctx, p\\).\n\nThrows exception in the event of failure to allocate."]
    pub fn fz_realloc(
        ctx: *mut fz_context,
        p: *mut ::core::ffi::c_void,
        size: usize,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Free a previously allocated block of memory.\n\n[`fz_free`]\\(ctx, `NULL`\\) does nothing.\n\nNever throws exceptions."]
    pub fn fz_free(ctx: *mut fz_context, p: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    #[doc = "[`fz_malloc`] equivalent that returns `NULL` rather than throwing<br>exceptions."]
    pub fn fz_malloc_no_throw(ctx: *mut fz_context, size: usize) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "[`fz_calloc`] equivalent that returns `NULL` rather than throwing<br>exceptions."]
    pub fn fz_calloc_no_throw(
        ctx: *mut fz_context,
        count: usize,
        size: usize,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "[`fz_realloc`] equivalent that returns `NULL` rather than throwing<br>exceptions."]
    pub fn fz_realloc_no_throw(
        ctx: *mut fz_context,
        p: *mut ::core::ffi::c_void,
        size: usize,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "[`fz_malloc`] equivalent, except that the block is guaranteed aligned.<br>Block must be freed later using [`fz_free_align`](fz_free_align)ed."]
    pub fn fz_malloc_aligned(
        ctx: *mut fz_context,
        size: usize,
        align: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "[`fz_free`] equivalent, for blocks allocated via [`fz_malloc_aligned`]."]
    pub fn fz_free_aligned(ctx: *mut fz_context, p: *mut ::core::ffi::c_void);
}
unsafe extern "C" {
    #[doc = "Portable strdup implementation, using fz allocators."]
    pub fn fz_strdup(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Fill block with len bytes of pseudo-randomness."]
    pub fn fz_memrnd(ctx: *mut fz_context, block: *mut u8, len: ::core::ffi::c_int);
}
#[repr(C)]
#[derive(Debug)]
pub struct fz_string {
    pub refs: ::core::ffi::c_int,
    pub str_: __IncompleteArrayField<::core::ffi::c_char>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_string"][::core::mem::size_of::<fz_string>() - 4usize];
    ["Alignment of fz_string"][::core::mem::align_of::<fz_string>() - 4usize];
    ["Offset of field: fz_string::refs"][::core::mem::offset_of!(fz_string, refs) - 0usize];
    ["Offset of field: fz_string::str_"][::core::mem::offset_of!(fz_string, str_) - 4usize];
};
unsafe extern "C" {
    pub fn fz_new_string(ctx: *mut fz_context, str_: *const ::core::ffi::c_char) -> *mut fz_string;
}
unsafe extern "C" {
    pub fn fz_keep_string(ctx: *mut fz_context, str_: *mut fz_string) -> *mut fz_string;
}
unsafe extern "C" {
    pub fn fz_drop_string(ctx: *mut fz_context, str_: *mut fz_string);
}
#[repr(C)]
#[repr(align(8))]
pub struct fz_context {
    pub _bindgen_opaque_blob: [u64; 7553usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_context"][::core::mem::size_of::<fz_context>() - 60424usize];
    ["Alignment of fz_context"][::core::mem::align_of::<fz_context>() - 8usize];
};
unsafe extern "C" {
    pub fn fz_new_context_imp(
        alloc: *const fz_alloc_context,
        locks: *const fz_locks_context,
        max_store: usize,
        version: *const ::core::ffi::c_char,
    ) -> *mut fz_context;
}
#[doc = "[`fz_buffer`] is a wrapper around a dynamically allocated array of<br>bytes.\n\nBuffers have a capacity \\(the number of bytes storage immediately<br>available\\) and a current size.\n\nThe contents of the structure are considered implementation<br>details and are subject to change. Users should use the accessor<br>functions in preference."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_buffer {
    pub refs: ::core::ffi::c_int,
    pub data: *mut ::core::ffi::c_uchar,
    pub cap: usize,
    pub len: usize,
    pub unused_bits: ::core::ffi::c_int,
    pub shared: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_buffer"][::core::mem::size_of::<fz_buffer>() - 40usize];
    ["Alignment of fz_buffer"][::core::mem::align_of::<fz_buffer>() - 8usize];
    ["Offset of field: fz_buffer::refs"][::core::mem::offset_of!(fz_buffer, refs) - 0usize];
    ["Offset of field: fz_buffer::data"][::core::mem::offset_of!(fz_buffer, data) - 8usize];
    ["Offset of field: fz_buffer::cap"][::core::mem::offset_of!(fz_buffer, cap) - 16usize];
    ["Offset of field: fz_buffer::len"][::core::mem::offset_of!(fz_buffer, len) - 24usize];
    ["Offset of field: fz_buffer::unused_bits"]
        [::core::mem::offset_of!(fz_buffer, unused_bits) - 32usize];
    ["Offset of field: fz_buffer::shared"][::core::mem::offset_of!(fz_buffer, shared) - 36usize];
};
unsafe extern "C" {
    #[doc = "Take an additional reference to the buffer. The same pointer<br>is returned.\n\nNever throws exceptions."]
    pub fn fz_keep_buffer(ctx: *mut fz_context, buf: *mut fz_buffer) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Drop a reference to the buffer. When the reference count reaches<br>zero, the buffer is destroyed.\n\nNever throws exceptions."]
    pub fn fz_drop_buffer(ctx: *mut fz_context, buf: *mut fz_buffer);
}
unsafe extern "C" {
    #[doc = "Retrieve internal memory of buffer.\n\n`datap`: Output parameter that will be pointed to the data.\n\nReturns the current size of the data in bytes."]
    pub fn fz_buffer_storage(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        datap: *mut *mut ::core::ffi::c_uchar,
    ) -> usize;
}
unsafe extern "C" {
    #[doc = "Ensure that a buffer's data ends in a<br>0 byte, and return a pointer to it."]
    pub fn fz_string_from_buffer(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_new_buffer(ctx: *mut fz_context, capacity: usize) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Create a new buffer with existing data.\n\n`data`: Pointer to existing data.<br>`size`: Size of existing data.\n\nTakes ownership of data. Does not make a copy. Calls [`fz_free`] on<br>the data when the buffer is deallocated. Do not use 'data' after<br>passing to this function.\n\nReturns pointer to new buffer. Throws exception on allocation<br>failure."]
    pub fn fz_new_buffer_from_data(
        ctx: *mut fz_context,
        data: *mut ::core::ffi::c_uchar,
        size: usize,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Like [`fz_new_buffer`], but does not take ownership."]
    pub fn fz_new_buffer_from_shared_data(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_uchar,
        size: usize,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Create a new buffer containing a copy of the passed data."]
    pub fn fz_new_buffer_from_copied_data(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_uchar,
        size: usize,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Create a new buffer with printf formatted data."]
    pub fn fz_new_buffer_from_printf(
        ctx: *mut fz_context,
        fmt: *const ::core::ffi::c_char,
        ...
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Make a new buffer, containing a copy of the data used in<br>the original."]
    pub fn fz_clone_buffer(ctx: *mut fz_context, buf: *mut fz_buffer) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Create a new buffer with data decoded from a base64 input string."]
    pub fn fz_new_buffer_from_base64(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_char,
        size: usize,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Ensure that a buffer has a given capacity,<br>truncating data if required.\n\n`capacity`: The desired capacity for the buffer. If the current<br>size of the buffer contents is smaller than capacity, it is<br>truncated."]
    pub fn fz_resize_buffer(ctx: *mut fz_context, buf: *mut fz_buffer, capacity: usize);
}
unsafe extern "C" {
    #[doc = "Make some space within a buffer \\(i.e. ensure that<br>capacity \\> size\\)."]
    pub fn fz_grow_buffer(ctx: *mut fz_context, buf: *mut fz_buffer);
}
unsafe extern "C" {
    #[doc = "Trim wasted capacity from a buffer by resizing internal memory."]
    pub fn fz_trim_buffer(ctx: *mut fz_context, buf: *mut fz_buffer);
}
unsafe extern "C" {
    #[doc = "Empties the buffer. Storage is not freed, but is held ready<br>to be reused as the buffer is refilled.\n\nNever throws exceptions."]
    pub fn fz_clear_buffer(ctx: *mut fz_context, buf: *mut fz_buffer);
}
unsafe extern "C" {
    #[doc = "Create a new buffer with a \\(subset of\\) the data from the buffer.\n\n`start`: if \\>= 0, offset from start of buffer, if \\< 0 offset from end of buffer.\n\n`end`: if \\>= 0, offset from start of buffer, if \\< 0 offset from end of buffer."]
    pub fn fz_slice_buffer(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        start: i64,
        end: i64,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Append the contents of the source buffer onto the end of the<br>destination buffer, extending automatically as required.\n\nOwnership of buffers does not change."]
    pub fn fz_append_buffer(
        ctx: *mut fz_context,
        destination: *mut fz_buffer,
        source: *mut fz_buffer,
    );
}
unsafe extern "C" {
    #[doc = "Write a base64 encoded data block, optionally with periodic newlines."]
    pub fn fz_append_base64(
        ctx: *mut fz_context,
        out: *mut fz_buffer,
        data: *const ::core::ffi::c_uchar,
        size: usize,
        newline: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Append a base64 encoded [`fz_buffer`], optionally with periodic newlines."]
    pub fn fz_append_base64_buffer(
        ctx: *mut fz_context,
        out: *mut fz_buffer,
        data: *mut fz_buffer,
        newline: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "`fz_append_*`: Append data to a buffer.\n\nThe buffer will automatically grow as required."]
    pub fn fz_append_data(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        data: *const ::core::ffi::c_void,
        len: usize,
    );
}
unsafe extern "C" {
    pub fn fz_append_string(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        data: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn fz_append_byte(ctx: *mut fz_context, buf: *mut fz_buffer, c: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_append_rune(ctx: *mut fz_context, buf: *mut fz_buffer, c: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_append_int32_le(ctx: *mut fz_context, buf: *mut fz_buffer, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_append_int16_le(ctx: *mut fz_context, buf: *mut fz_buffer, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_append_int32_be(ctx: *mut fz_context, buf: *mut fz_buffer, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_append_int16_be(ctx: *mut fz_context, buf: *mut fz_buffer, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_append_bits(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        value: ::core::ffi::c_int,
        count: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_append_bits_pad(ctx: *mut fz_context, buf: *mut fz_buffer);
}
unsafe extern "C" {
    #[doc = "[`fz_append_pdf_string`]: Append a string with PDF syntax quotes and<br>escapes.\n\nThe buffer will automatically grow as required."]
    pub fn fz_append_pdf_string(
        ctx: *mut fz_context,
        buffer: *mut fz_buffer,
        text: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "[`fz_append_printf`]: Format and append data to buffer using<br>printf-like formatting \\(see [`fz_vsnprintf`]\\).\n\nThe buffer will automatically grow as required."]
    pub fn fz_append_printf(
        ctx: *mut fz_context,
        buffer: *mut fz_buffer,
        fmt: *const ::core::ffi::c_char,
        ...
    );
}
unsafe extern "C" {
    #[doc = "Zero-terminate buffer in order to use as a C string.\n\nThis byte is invisible and does not affect the length of the<br>buffer as returned by [`fz_buffer_storage`]. The zero byte is<br>written *after* the data, and subsequent writes will overwrite<br>the terminating byte.\n\nSubsequent changes to the size of the buffer \\(such as by<br>[`fz_buffer_trim`], [`fz_buffer_grow`], [`fz_resize_buffer`], etc\\) may<br>invalidate this."]
    pub fn fz_terminate_buffer(ctx: *mut fz_context, buf: *mut fz_buffer);
}
unsafe extern "C" {
    #[doc = "Create an MD5 digest from buffer contents.\n\nNever throws exceptions."]
    pub fn fz_md5_buffer(
        ctx: *mut fz_context,
        buffer: *mut fz_buffer,
        digest: *mut ::core::ffi::c_uchar,
    );
}
unsafe extern "C" {
    #[doc = "Take ownership of buffer contents.\n\nPerforms the same task as [`fz_buffer_storage`], but ownership of<br>the data buffer returns with this call. The buffer is left<br>empty.\n\n`Note`: Bad things may happen if this is called on a buffer with<br>multiple references that is being used from multiple threads.\n\n`data`: Pointer to place to retrieve data pointer.\n\nReturns length of stream."]
    pub fn fz_buffer_extract(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        data: *mut *mut ::core::ffi::c_uchar,
    ) -> usize;
}
unsafe extern "C" {
    #[doc = "Return strlen\\(s\\), if that is less than maxlen, or maxlen if<br>there is no null byte \\('\\0'\\) among the first maxlen bytes."]
    pub fn fz_strnlen(s: *const ::core::ffi::c_char, maxlen: usize) -> usize;
}
unsafe extern "C" {
    #[doc = "Given a pointer to a C string \\(or a pointer to `NULL`\\) break<br>it at the first occurrence of a delimiter char \\(from a given<br>set\\).\n\n`stringp`: Pointer to a C string pointer \\(or `NULL`\\). Updated on<br>exit to point to the first char of the string after the<br>delimiter that was found. The string pointed to by stringp will<br>be corrupted by this call \\(as the found delimiter will be<br>overwritten by 0\\).\n\n`delim`: A C string of acceptable delimiter characters.\n\nReturns a pointer to a C string containing the chars of stringp<br>up to the first delimiter char \\(or the end of the string\\), or<br>`NULL`."]
    pub fn fz_strsep(
        stringp: *mut *mut ::core::ffi::c_char,
        delim: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Copy at most n-1 chars of a string into a destination<br>buffer with null termination, returning the real length of the<br>initial string \\(excluding terminator\\).\n\n`dst`: Destination buffer, at least n bytes long.\n\n`src`: C string \\(non-`NULL`\\).\n\n`n`: Size of dst buffer in bytes.\n\nReturns the length \\(excluding terminator\\) of src."]
    pub fn fz_strlcpy(
        dst: *mut ::core::ffi::c_char,
        src: *const ::core::ffi::c_char,
        n: usize,
    ) -> usize;
}
unsafe extern "C" {
    #[doc = "Concatenate 2 strings, with a maximum length.\n\n`dst`: pointer to first string in a buffer of n bytes.\n\n`src`: pointer to string to concatenate.\n\n`n`: Size \\(in bytes\\) of buffer that dst is in.\n\nReturns the real length that a concatenated dst + src would have<br>been \\(not including terminator\\)."]
    pub fn fz_strlcat(
        dst: *mut ::core::ffi::c_char,
        src: *const ::core::ffi::c_char,
        n: usize,
    ) -> usize;
}
unsafe extern "C" {
    #[doc = "Safe strstr function.\n\n`haystack`: Where to look \\(may be `NULL`\\).\n\n`needled`: What to look for.\n\nReturns `NULL` if unmatched, or pointer to start of match."]
    pub fn fz_strstr(
        haystack: *const ::core::ffi::c_char,
        needle: *const ::core::ffi::c_char,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Safe case-insensitive strstr function. \\(Accepts UTF-8\\).\n\n`haystack`: Where to look \\(may be `NULL`\\).\n\n`needled`: What to look for.\n\nReturns `NULL` if unmatched, or pointer to start of match."]
    pub fn fz_strstrcase(
        haystack: *const ::core::ffi::c_char,
        needle: *const ::core::ffi::c_char,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Find the start of the first occurrence of the substring needle in haystack."]
    pub fn fz_memmem(
        haystack: *const ::core::ffi::c_void,
        haystacklen: usize,
        needle: *const ::core::ffi::c_void,
        needlelen: usize,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "extract the directory component from a path."]
    pub fn fz_dirname(
        dir: *mut ::core::ffi::c_char,
        path: *const ::core::ffi::c_char,
        dirsize: usize,
    );
}
unsafe extern "C" {
    #[doc = "Find the filename component in a path."]
    pub fn fz_basename(path: *const ::core::ffi::c_char) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "portable strverscmp\\(3\\) function"]
    pub fn fz_strverscmp(
        s1: *const ::core::ffi::c_char,
        s2: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Like [`fz_decode_uri_component`] but in-place."]
    pub fn fz_urldecode(url: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return a new string representing the unencoded version of the given URI.<br>This decodes all escape sequences except those that would result in a reserved<br>character that are part of the URI syntax \\(; / ? : @ & = + $ , #\\)."]
    pub fn fz_decode_uri(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return a new string representing the unencoded version of the given URI component.<br>This decodes all escape sequences!"]
    pub fn fz_decode_uri_component(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return a new string representing the provided string encoded as a URI."]
    pub fn fz_encode_uri(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return a new string representing the provided string encoded as an URI component.<br>This also encodes the special reserved characters \\(; / ? : @ & = + $ , #\\)."]
    pub fn fz_encode_uri_component(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return a new string representing the provided string encoded as an URI path name.<br>This also encodes the special reserved characters except /."]
    pub fn fz_encode_uri_pathname(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "create output file name using a template.\n\nIf the path contains %\\[0-9\\]*d, the first such pattern will be<br>replaced with the page number. If the template does not contain<br>such a pattern, the page number will be inserted before the<br>filename extension. If the template does not have a filename<br>extension, the page number will be added to the end."]
    pub fn fz_format_output_path(
        ctx: *mut fz_context,
        path: *mut ::core::ffi::c_char,
        size: usize,
        fmt: *const ::core::ffi::c_char,
        page: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "rewrite path to the shortest string that names the same path.\n\nEliminates multiple and trailing slashes, interprets \".\" and<br>\"..\". Overwrites the string in place."]
    pub fn fz_cleanname(name: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "rewrite path to the shortest string that names the same path.\n\nEliminates multiple and trailing slashes, interprets \".\" and<br>\"..\". Allocates a new string that the caller must free."]
    pub fn fz_cleanname_strdup(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Resolve a path to an absolute file name.<br>The resolved path buffer must be of at least PATH_MAX size."]
    pub fn fz_realpath(
        path: *const ::core::ffi::c_char,
        resolved_path: *mut ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Case insensitive \\(UTF8\\) string comparison."]
    pub fn fz_strcasecmp(
        a: *const ::core::ffi::c_char,
        b: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Case insensitive \\(UTF8\\) string comparison.\n\nn = maximum number of bytes to read from either a or b."]
    pub fn fz_strncasecmp(
        a: *const ::core::ffi::c_char,
        b: *const ::core::ffi::c_char,
        n: usize,
    ) -> ::core::ffi::c_int;
}
pub const FZ_UTFMAX: _bindgen_ty_4 = 4;
#[doc = "[`FZ_UTFMAX`]: Maximum number of bytes in a decoded rune \\(maximum<br>length returned by [`fz_chartorune`]\\)."]
pub type _bindgen_ty_4 = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "UTF8 decode a single rune from a sequence of chars.\n\n`rune`: Pointer to an int to assign the decoded 'rune' to.<br>\\(0xFFFD on error\\).\n\n`str`: Pointer to a UTF8 encoded string.\n\nReturns the number of bytes consumed."]
    pub fn fz_chartorune(
        rune: *mut ::core::ffi::c_int,
        str_: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "UTF8 decode a single rune from a sequence of chars<br>of given length.\n\n`rune`: Pointer to an int to assign the decoded 'rune' to.<br>\\(0xFFFD on error\\).\n\n`str`: Pointer to a UTF8 encoded string.\n\n`n`: The number of bytes available at str.\n\nReturns the number of bytes consumed."]
    pub fn fz_chartorunen(
        rune: *mut ::core::ffi::c_int,
        str_: *const ::core::ffi::c_char,
        n: usize,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "UTF8 encode a rune to a sequence of chars.\n\n`str`: Pointer to a place to put the UTF8 encoded character.\n\n`rune`: Pointer to a 'rune'.\n\nReturns the number of bytes the rune took to output."]
    pub fn fz_runetochar(
        str_: *mut ::core::ffi::c_char,
        rune: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Count how many chars are required to represent a rune.\n\n`rune`: The rune to encode.\n\nReturns the number of bytes required to represent this run in<br>UTF8."]
    pub fn fz_runelen(rune: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Compute the index of a rune in a string.\n\n`str`: Pointer to beginning of a string.\n\n`p`: Pointer to a char in str.\n\nReturns the index of the rune pointed to by p in str."]
    pub fn fz_runeidx(
        str_: *const ::core::ffi::c_char,
        p: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Obtain a pointer to the char representing the rune<br>at a given index.\n\n`str`: Pointer to beginning of a string.\n\n`idx`: Index of a rune to return a char pointer to.\n\nReturns a pointer to the char where the desired rune starts,<br>or `NULL` if the string ends before the index is reached."]
    pub fn fz_runeptr(
        str_: *const ::core::ffi::c_char,
        idx: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Count how many runes the UTF-8 encoded string<br>consists of.\n\n`s`: The UTF-8 encoded, NUL-terminated text string.\n\nReturns the number of runes in the string."]
    pub fn fz_utflen(s: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_utf8_from_wchar(ctx: *mut fz_context, s: *const wchar_t) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_wchar_from_utf8(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
    ) -> *mut wchar_t;
}
unsafe extern "C" {
    #[doc = "Locale-independent decimal to binary conversion. On overflow<br>return \\(-\\)INFINITY and set errno to ERANGE. On underflow return<br>0 and set errno to ERANGE. Special inputs \\(case insensitive\\):<br>\"NAN\", \"INF\" or \"INFINITY\"."]
    pub fn fz_strtof(s: *const ::core::ffi::c_char, es: *mut *mut ::core::ffi::c_char) -> f32;
}
unsafe extern "C" {
    pub fn fz_grisu(
        f: f32,
        s: *mut ::core::ffi::c_char,
        exp: *mut ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Check and parse string into page ranges:<br>/,?\\(-?\\d+|N\\)\\(-\\(-?\\d+|N\\)\\)?/"]
    pub fn fz_is_page_range(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_parse_page_range(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
        a: *mut ::core::ffi::c_int,
        b: *mut ::core::ffi::c_int,
        n: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Unicode aware tolower and toupper functions."]
    pub fn fz_tolower(c: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_toupper(c: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return true if the named file exists and is readable."]
    pub fn fz_file_exists(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Open the named file and wrap it in a stream.\n\n`filename`: Path to a file. On non-Windows machines the filename<br>should be exactly as it would be passed to fopen\\(2\\). On Windows<br>machines, the path should be UTF-8 encoded so that non-ASCII<br>characters can be represented. Other platforms do the encoding<br>as standard anyway \\(and in most cases, particularly for MacOS<br>and Linux, the encoding they use is UTF-8 anyway\\)."]
    pub fn fz_open_file(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Do the same as [`fz_open_file`], but delete the file upon close."]
    pub fn fz_open_file_autodelete(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Open the named file and wrap it in a stream.\n\nDoes the same as [`fz_open_file`], but in the event the file<br>does not open, it will return `NULL` rather than throw an<br>exception."]
    pub fn fz_try_open_file(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Return the filename \\(UTF-8 encoded\\) from which a stream was opened.\n\nReturns `NULL` if the filename is not available \\(or the stream was<br>opened from a source other than a file\\)."]
    pub fn fz_stream_filename(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Open a block of memory as a stream.\n\n`data`: Pointer to start of data block. Ownership of the data<br>block is NOT passed in.\n\n`len`: Number of bytes in data block.\n\nReturns pointer to newly created stream. May throw exceptions on<br>failure to allocate."]
    pub fn fz_open_memory(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_uchar,
        len: usize,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Open a buffer as a stream.\n\n`buf`: The buffer to open. Ownership of the buffer is NOT passed<br>in \\(this function takes its own reference\\).\n\nReturns pointer to newly created stream. May throw exceptions on<br>failure to allocate."]
    pub fn fz_open_buffer(ctx: *mut fz_context, buf: *mut fz_buffer) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Attach a filter to a stream that will store any<br>characters read from the stream into the supplied buffer.\n\n`chain`: The underlying stream to leech from.\n\n`buf`: The buffer into which the read data should be appended.<br>The buffer will be resized as required.\n\nReturns pointer to newly created stream. May throw exceptions on<br>failure to allocate."]
    pub fn fz_open_leecher(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        buf: *mut fz_buffer,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Increments the reference count for a stream. Returns the same<br>pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_stream(ctx: *mut fz_context, stm: *mut fz_stream) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Decrements the reference count for a stream.\n\nWhen the reference count for the stream hits zero, frees the<br>storage used for the [`fz_stream`] itself, and \\(usually\\)<br>releases the underlying resources that the stream is based upon<br>\\(depends on the method used to open the stream initially\\)."]
    pub fn fz_drop_stream(ctx: *mut fz_context, stm: *mut fz_stream);
}
unsafe extern "C" {
    #[doc = "return the current reading position within a stream"]
    pub fn fz_tell(ctx: *mut fz_context, stm: *mut fz_stream) -> i64;
}
unsafe extern "C" {
    #[doc = "Seek within a stream.\n\n`stm`: The stream to seek within.\n\n`offset`: The offset to seek to.\n\n`whence`: From where the offset is measured \\(see fseek\\).<br>SEEK_SET - start of stream.<br>SEEK_CUR - current position.<br>SEEK_END - end of stream."]
    pub fn fz_seek(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        offset: i64,
        whence: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Read from a stream into a given data block.\n\n`stm`: The stream to read from.\n\n`data`: The data block to read into.\n\n`len`: The length of the data block \\(in bytes\\).\n\nReturns the number of bytes read. May throw exceptions."]
    pub fn fz_read(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        data: *mut ::core::ffi::c_uchar,
        len: usize,
    ) -> usize;
}
unsafe extern "C" {
    #[doc = "Read from a stream discarding data.\n\n`stm`: The stream to read from.\n\n`len`: The number of bytes to read.\n\nReturns the number of bytes read. May throw exceptions."]
    pub fn fz_skip(ctx: *mut fz_context, stm: *mut fz_stream, len: usize) -> usize;
}
unsafe extern "C" {
    #[doc = "Read all of a stream into a buffer.\n\n`stm`: The stream to read from\n\n`initial`: Suggested initial size for the buffer.\n\nReturns a buffer created from reading from the stream. May throw<br>exceptions on failure to allocate."]
    pub fn fz_read_all(ctx: *mut fz_context, stm: *mut fz_stream, initial: usize)
    -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Read all the contents of a file into a buffer."]
    pub fn fz_read_file(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Read all the contents of a file into a buffer.\n\nReturns `NULL` if the file does not exist, otherwise<br>behaves exactly as [`fz_read_file`]."]
    pub fn fz_try_read_file(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "[`fz_read_`]\\[u\\]int\\(16|24|32|64\\)\\(_le\\)?\n\nRead a 16/32/64 bit signed/unsigned integer from stream,<br>in big or little-endian byte orders.\n\nThrows an exception if EOF is encountered."]
    pub fn fz_read_uint16(ctx: *mut fz_context, stm: *mut fz_stream) -> u16;
}
unsafe extern "C" {
    pub fn fz_read_uint24(ctx: *mut fz_context, stm: *mut fz_stream) -> u32;
}
unsafe extern "C" {
    pub fn fz_read_uint32(ctx: *mut fz_context, stm: *mut fz_stream) -> u32;
}
unsafe extern "C" {
    pub fn fz_read_uint64(ctx: *mut fz_context, stm: *mut fz_stream) -> u64;
}
unsafe extern "C" {
    pub fn fz_read_uint16_le(ctx: *mut fz_context, stm: *mut fz_stream) -> u16;
}
unsafe extern "C" {
    pub fn fz_read_uint24_le(ctx: *mut fz_context, stm: *mut fz_stream) -> u32;
}
unsafe extern "C" {
    pub fn fz_read_uint32_le(ctx: *mut fz_context, stm: *mut fz_stream) -> u32;
}
unsafe extern "C" {
    pub fn fz_read_uint64_le(ctx: *mut fz_context, stm: *mut fz_stream) -> u64;
}
unsafe extern "C" {
    pub fn fz_read_int16(ctx: *mut fz_context, stm: *mut fz_stream) -> i16;
}
unsafe extern "C" {
    pub fn fz_read_int32(ctx: *mut fz_context, stm: *mut fz_stream) -> i32;
}
unsafe extern "C" {
    pub fn fz_read_int64(ctx: *mut fz_context, stm: *mut fz_stream) -> i64;
}
unsafe extern "C" {
    pub fn fz_read_int16_le(ctx: *mut fz_context, stm: *mut fz_stream) -> i16;
}
unsafe extern "C" {
    pub fn fz_read_int32_le(ctx: *mut fz_context, stm: *mut fz_stream) -> i32;
}
unsafe extern "C" {
    pub fn fz_read_int64_le(ctx: *mut fz_context, stm: *mut fz_stream) -> i64;
}
unsafe extern "C" {
    pub fn fz_read_float_le(ctx: *mut fz_context, stm: *mut fz_stream) -> f32;
}
unsafe extern "C" {
    pub fn fz_read_float(ctx: *mut fz_context, stm: *mut fz_stream) -> f32;
}
unsafe extern "C" {
    #[doc = "Read a null terminated string from the stream into<br>a buffer of a given length. The buffer will be null terminated.<br>Throws on failure \\(including the failure to fit the entire<br>string including the terminator into the buffer\\)."]
    pub fn fz_read_string(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        buffer: *mut ::core::ffi::c_char,
        len: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Read a utf-8 rune from a stream.\n\nIn the event of encountering badly formatted utf-8 codes<br>\\(such as a leading code with an unexpected number of following<br>codes\\) no error/exception is given, but undefined values may be<br>returned."]
    pub fn fz_read_rune(ctx: *mut fz_context, in_: *mut fz_stream) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Read a utf-16 rune from a stream. \\(little endian and<br>big endian respectively\\).\n\nIn the event of encountering badly formatted utf-16 codes<br>\\(mismatched surrogates\\) no error/exception is given, but<br>undefined values may be returned."]
    pub fn fz_read_utf16_le(ctx: *mut fz_context, stm: *mut fz_stream) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_read_utf16_be(ctx: *mut fz_context, stm: *mut fz_stream) -> ::core::ffi::c_int;
}
#[doc = "A function type for use when implementing<br>[`fz_stream`](fz_stream)s. The supplied function of this type is called<br>whenever data is required, and the current buffer is empty.\n\n`stm`: The stream to operate on.\n\n`max`: a hint as to the maximum number of bytes that the caller<br>needs to be ready immediately. Can safely be ignored.\n\nReturns -1 if there is no more data in the stream. Otherwise,<br>the function should find its internal state using stm-\\>state,<br>refill its buffer, update stm-\\>rp and stm-\\>wp to point to the<br>start and end of the new data respectively, and then<br>\"return *stm-\\>rp++\"."]
pub type fz_stream_next_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        max: usize,
    ) -> ::core::ffi::c_int,
>;
#[doc = "A function type for use when implementing<br>[`fz_stream`](fz_stream)s. The supplied function of this type is called<br>when the stream is dropped, to release the stream specific<br>state information.\n\n`state`: The stream state to release."]
pub type fz_stream_drop_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void),
>;
#[doc = "A function type for use when implementing<br>[`fz_stream`](fz_stream)s. The supplied function of this type is called when<br>[`fz_seek`] is requested, and the arguments are as defined for<br>[`fz_seek`].\n\nThe stream can find it's private state in stm-\\>state."]
pub type fz_stream_seek_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        offset: i64,
        whence: ::core::ffi::c_int,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stream {
    pub refs: ::core::ffi::c_int,
    pub error: ::core::ffi::c_int,
    pub eof: ::core::ffi::c_int,
    pub progressive: ::core::ffi::c_int,
    pub pos: i64,
    pub avail: ::core::ffi::c_int,
    pub bits: ::core::ffi::c_int,
    pub rp: *mut ::core::ffi::c_uchar,
    pub wp: *mut ::core::ffi::c_uchar,
    pub state: *mut ::core::ffi::c_void,
    pub next: fz_stream_next_fn,
    pub drop: fz_stream_drop_fn,
    pub seek: fz_stream_seek_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stream"][::core::mem::size_of::<fz_stream>() - 80usize];
    ["Alignment of fz_stream"][::core::mem::align_of::<fz_stream>() - 8usize];
    ["Offset of field: fz_stream::refs"][::core::mem::offset_of!(fz_stream, refs) - 0usize];
    ["Offset of field: fz_stream::error"][::core::mem::offset_of!(fz_stream, error) - 4usize];
    ["Offset of field: fz_stream::eof"][::core::mem::offset_of!(fz_stream, eof) - 8usize];
    ["Offset of field: fz_stream::progressive"]
        [::core::mem::offset_of!(fz_stream, progressive) - 12usize];
    ["Offset of field: fz_stream::pos"][::core::mem::offset_of!(fz_stream, pos) - 16usize];
    ["Offset of field: fz_stream::avail"][::core::mem::offset_of!(fz_stream, avail) - 24usize];
    ["Offset of field: fz_stream::bits"][::core::mem::offset_of!(fz_stream, bits) - 28usize];
    ["Offset of field: fz_stream::rp"][::core::mem::offset_of!(fz_stream, rp) - 32usize];
    ["Offset of field: fz_stream::wp"][::core::mem::offset_of!(fz_stream, wp) - 40usize];
    ["Offset of field: fz_stream::state"][::core::mem::offset_of!(fz_stream, state) - 48usize];
    ["Offset of field: fz_stream::next"][::core::mem::offset_of!(fz_stream, next) - 56usize];
    ["Offset of field: fz_stream::drop"][::core::mem::offset_of!(fz_stream, drop) - 64usize];
    ["Offset of field: fz_stream::seek"][::core::mem::offset_of!(fz_stream, seek) - 72usize];
};
unsafe extern "C" {
    #[doc = "Create a new stream object with the given<br>internal state and function pointers.\n\n`state`: Internal state \\(opaque to everything but implementation\\).\n\n`next`: Should provide the next set of bytes \\(up to max\\) of stream<br>data. Return the number of bytes read, or EOF when there is no<br>more data.\n\n`drop`: Should clean up and free the internal state. May not<br>throw exceptions."]
    pub fn fz_new_stream(
        ctx: *mut fz_context,
        state: *mut ::core::ffi::c_void,
        next: fz_stream_next_fn,
        drop: fz_stream_drop_fn,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Attempt to read a stream into a buffer. If truncated<br>is `NULL` behaves as [`fz_read_all`], sets a truncated flag in case of<br>error.\n\n`stm`: The stream to read from.\n\n`initial`: Suggested initial size for the buffer.\n\n`truncated`: Flag to store success/failure indication in.\n\n`worst_case`: 0 for unknown, otherwise an upper bound for the<br>size of the stream.\n\nReturns a buffer created from reading from the stream."]
    pub fn fz_read_best(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        initial: usize,
        truncated: *mut ::core::ffi::c_int,
        worst_case: usize,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Read a line from stream into the buffer until either a<br>terminating newline or EOF, which it replaces with a null byte<br>\\('\\0'\\).\n\nReturns buf on success, and `NULL` when end of file occurs while<br>no characters have been read."]
    pub fn fz_read_line(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        buf: *mut ::core::ffi::c_char,
        max: usize,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Skip over a given string in a stream. Return 0 if successfully<br>skipped, non-zero otherwise. As many characters will be skipped<br>over as matched in the string."]
    pub fn fz_skip_string(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        str_: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Skip over whitespace \\(bytes \\<= 32\\) in a stream."]
    pub fn fz_skip_space(ctx: *mut fz_context, stm: *mut fz_stream);
}
unsafe extern "C" {
    #[doc = "Create a stream from a FILE * that will not be closed<br>when the stream is dropped."]
    pub fn fz_open_file_ptr_no_close(ctx: *mut fz_context, file: *mut FILE) -> *mut fz_stream;
}
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called<br>whenever data is written to the output.\n\n`state`: The state for the output stream.\n\n`data`: a pointer to a buffer of data to write.\n\n`n`: The number of bytes of data to write."]
pub type fz_output_write_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        state: *mut ::core::ffi::c_void,
        data: *const ::core::ffi::c_void,
        n: usize,
    ),
>;
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called when<br>[`fz_seek_output`] is requested.\n\n`state`: The output stream state to seek within.\n\n`offset`, `whence`: as defined for [`fz_seek`]\\(\\)."]
pub type fz_output_seek_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        state: *mut ::core::ffi::c_void,
        offset: i64,
        whence: ::core::ffi::c_int,
    ),
>;
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called when<br>[`fz_tell_output`] is requested.\n\n`state`: The output stream state to report on.\n\nReturns the offset within the output stream."]
pub type fz_output_tell_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void) -> i64,
>;
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called<br>when the output stream is closed, to flush any pending writes."]
pub type fz_output_close_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void),
>;
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called<br>when the output stream is reset, and resets the state<br>to that when it was first initialised."]
pub type fz_output_reset_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void),
>;
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called<br>when the output stream is dropped, to release the stream<br>specific state information."]
pub type fz_output_drop_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void),
>;
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called<br>when the [`fz_stream_from_output`] is called."]
pub type fz_stream_from_output_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void) -> *mut fz_stream,
>;
#[doc = "A function type for use when implementing<br>[`fz_output`](fz_output)s. The supplied function of this type is called<br>when [`fz_truncate_output`] is called to truncate the file<br>at that point."]
pub type fz_truncate_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_output {
    pub state: *mut ::core::ffi::c_void,
    pub write: fz_output_write_fn,
    pub seek: fz_output_seek_fn,
    pub tell: fz_output_tell_fn,
    pub close: fz_output_close_fn,
    pub drop: fz_output_drop_fn,
    pub reset: fz_output_reset_fn,
    pub as_stream: fz_stream_from_output_fn,
    pub truncate: fz_truncate_fn,
    pub closed: ::core::ffi::c_int,
    pub bp: *mut ::core::ffi::c_char,
    pub wp: *mut ::core::ffi::c_char,
    pub ep: *mut ::core::ffi::c_char,
    pub buffered: ::core::ffi::c_int,
    pub bits: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_output"][::core::mem::size_of::<fz_output>() - 112usize];
    ["Alignment of fz_output"][::core::mem::align_of::<fz_output>() - 8usize];
    ["Offset of field: fz_output::state"][::core::mem::offset_of!(fz_output, state) - 0usize];
    ["Offset of field: fz_output::write"][::core::mem::offset_of!(fz_output, write) - 8usize];
    ["Offset of field: fz_output::seek"][::core::mem::offset_of!(fz_output, seek) - 16usize];
    ["Offset of field: fz_output::tell"][::core::mem::offset_of!(fz_output, tell) - 24usize];
    ["Offset of field: fz_output::close"][::core::mem::offset_of!(fz_output, close) - 32usize];
    ["Offset of field: fz_output::drop"][::core::mem::offset_of!(fz_output, drop) - 40usize];
    ["Offset of field: fz_output::reset"][::core::mem::offset_of!(fz_output, reset) - 48usize];
    ["Offset of field: fz_output::as_stream"]
        [::core::mem::offset_of!(fz_output, as_stream) - 56usize];
    ["Offset of field: fz_output::truncate"]
        [::core::mem::offset_of!(fz_output, truncate) - 64usize];
    ["Offset of field: fz_output::closed"][::core::mem::offset_of!(fz_output, closed) - 72usize];
    ["Offset of field: fz_output::bp"][::core::mem::offset_of!(fz_output, bp) - 80usize];
    ["Offset of field: fz_output::wp"][::core::mem::offset_of!(fz_output, wp) - 88usize];
    ["Offset of field: fz_output::ep"][::core::mem::offset_of!(fz_output, ep) - 96usize];
    ["Offset of field: fz_output::buffered"]
        [::core::mem::offset_of!(fz_output, buffered) - 104usize];
    ["Offset of field: fz_output::bits"][::core::mem::offset_of!(fz_output, bits) - 108usize];
};
unsafe extern "C" {
    #[doc = "Create a new output object with the given<br>internal state and function pointers.\n\n`state`: Internal state \\(opaque to everything but implementation\\).\n\n`write`: Function to output a given buffer.\n\n`close`: Cleanup function to destroy state when output closed.<br>May permissibly be null."]
    pub fn fz_new_output(
        ctx: *mut fz_context,
        bufsiz: ::core::ffi::c_int,
        state: *mut ::core::ffi::c_void,
        write: fz_output_write_fn,
        close: fz_output_close_fn,
        drop: fz_output_drop_fn,
    ) -> *mut fz_output;
}
unsafe extern "C" {
    #[doc = "Open an output stream that writes to a<br>given path. This stream will always be a binary stream.\n\nOn Windows, if this stream is stdout or stderr, these will<br>be set to binary.\n\n`filename`: The filename to write to \\(specified in UTF-8\\).\n\n`append`: non-zero if we should append to the file, rather than<br>overwriting it."]
    pub fn fz_new_output_with_path(
        arg1: *mut fz_context,
        filename: *const ::core::ffi::c_char,
        append: ::core::ffi::c_int,
    ) -> *mut fz_output;
}
unsafe extern "C" {
    #[doc = "Open an output stream that writes to a<br>given FILE *.\n\n`file`: The file pointers to write to. `NULL` is interpreted as effectively<br>meaning /dev/null or similar."]
    pub fn fz_new_output_with_file_ptr(ctx: *mut fz_context, file: *mut FILE) -> *mut fz_output;
}
unsafe extern "C" {
    #[doc = "Open an output stream that appends<br>to a buffer.\n\n`buf`: The buffer to append to."]
    pub fn fz_new_output_with_buffer(ctx: *mut fz_context, buf: *mut fz_buffer) -> *mut fz_output;
}
unsafe extern "C" {
    #[doc = "Retrieve an [`fz_output`] that directs to stdout.\n\nOptionally may be [`fz_dropp`](fz_dropp)ed when finished with."]
    pub fn fz_stdout(ctx: *mut fz_context) -> *mut fz_output;
}
unsafe extern "C" {
    #[doc = "Retrieve an [`fz_output`] that directs to stdout.\n\nOptionally may be [`fz_dropp`](fz_dropp)ed when finished with."]
    pub fn fz_stderr(ctx: *mut fz_context) -> *mut fz_output;
}
unsafe extern "C" {
    #[doc = "Set the output stream to be used for [`fz_stddbg`]. Set to `NULL` to<br>reset to default \\(stderr\\)."]
    pub fn fz_set_stddbg(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Retrieve an [`fz_output`] for the default debugging stream. On<br>Windows this will be OutputDebugString for non-console apps.<br>Otherwise, it is always [`fz_stderr`].\n\nOptionally may be [`fz_dropp`](fz_dropp)ed when finished with."]
    pub fn fz_stddbg(ctx: *mut fz_context) -> *mut fz_output;
}
unsafe extern "C" {
    #[doc = "Format and write data to an output stream.<br>See [`fz_format_string`] for formatting details."]
    pub fn fz_write_printf(
        ctx: *mut fz_context,
        out: *mut fz_output,
        fmt: *const ::core::ffi::c_char,
        ...
    );
}
unsafe extern "C" {
    #[doc = "Seek to the specified file position.<br>See fseek for arguments.\n\nThrow an error on unseekable outputs."]
    pub fn fz_seek_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        off: i64,
        whence: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Return the current file position.\n\nThrow an error on untellable outputs."]
    pub fn fz_tell_output(ctx: *mut fz_context, out: *mut fz_output) -> i64;
}
unsafe extern "C" {
    #[doc = "Flush unwritten data."]
    pub fn fz_flush_output(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Flush pending output and close an output stream."]
    pub fn fz_close_output(arg1: *mut fz_context, arg2: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Reset a closed output stream. Returns state to<br>\\(broadly\\) that which it was in when opened. Not<br>all outputs can be reset, so this may throw an<br>exception."]
    pub fn fz_reset_output(arg1: *mut fz_context, arg2: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Free an output stream. Don't forget to close it first!"]
    pub fn fz_drop_output(arg1: *mut fz_context, arg2: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Query whether a given [`fz_output`] supports [`fz_stream_from_output`]."]
    pub fn fz_output_supports_stream(
        ctx: *mut fz_context,
        out: *mut fz_output,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Obtain the [`fz_output`] in the form of a [`fz_stream`].\n\nThis allows data to be read back from some forms of [`fz_output`]<br>object. When finished reading, the [`fz_stream`] should be released<br>by calling [`fz_drop_stream`]. Until the [`fz_stream`] is dropped, no<br>further operations should be performed on the [`fz_output`] object."]
    pub fn fz_stream_from_output(arg1: *mut fz_context, arg2: *mut fz_output) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Truncate the output at the current position.\n\nThis allows output streams which have seeked back from the end<br>of their storage to be truncated at the current point."]
    pub fn fz_truncate_output(arg1: *mut fz_context, arg2: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Write data to output.\n\n`data`: Pointer to data to write.<br>`size`: Size of data to write in bytes."]
    pub fn fz_write_data(
        ctx: *mut fz_context,
        out: *mut fz_output,
        data: *const ::core::ffi::c_void,
        size: usize,
    );
}
unsafe extern "C" {
    pub fn fz_write_buffer(ctx: *mut fz_context, out: *mut fz_output, data: *mut fz_buffer);
}
unsafe extern "C" {
    #[doc = "Write a string. Does not write zero terminator."]
    pub fn fz_write_string(
        ctx: *mut fz_context,
        out: *mut fz_output,
        s: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Write different sized data to an output stream."]
    pub fn fz_write_int32_be(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_write_int32_le(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_write_uint32_be(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_uint);
}
unsafe extern "C" {
    pub fn fz_write_uint32_le(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_uint);
}
unsafe extern "C" {
    pub fn fz_write_int16_be(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_write_int16_le(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_write_uint16_be(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_uint);
}
unsafe extern "C" {
    pub fn fz_write_uint16_le(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_uint);
}
unsafe extern "C" {
    pub fn fz_write_char(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_char);
}
unsafe extern "C" {
    pub fn fz_write_byte(ctx: *mut fz_context, out: *mut fz_output, x: ::core::ffi::c_uchar);
}
unsafe extern "C" {
    pub fn fz_write_float_be(ctx: *mut fz_context, out: *mut fz_output, f: f32);
}
unsafe extern "C" {
    pub fn fz_write_float_le(ctx: *mut fz_context, out: *mut fz_output, f: f32);
}
unsafe extern "C" {
    #[doc = "Write a UTF-8 encoded unicode character."]
    pub fn fz_write_rune(ctx: *mut fz_context, out: *mut fz_output, rune: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Write a base64 encoded data block, optionally with periodic<br>newlines."]
    pub fn fz_write_base64(
        ctx: *mut fz_context,
        out: *mut fz_output,
        data: *const ::core::ffi::c_uchar,
        size: usize,
        newline: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Write a base64 encoded [`fz_buffer`], optionally with periodic<br>newlines."]
    pub fn fz_write_base64_buffer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        data: *mut fz_buffer,
        newline: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Write num_bits of data to the end of the output stream, assumed to be packed<br>most significant bits first."]
    pub fn fz_write_bits(
        ctx: *mut fz_context,
        out: *mut fz_output,
        data: ::core::ffi::c_uint,
        num_bits: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Sync to byte boundary after writing bits."]
    pub fn fz_write_bits_sync(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Copy the stream contents to the output."]
    pub fn fz_write_stream(ctx: *mut fz_context, out: *mut fz_output, in_: *mut fz_stream);
}
unsafe extern "C" {
    #[doc = "The non va_list equivalent of [`fz_vsnprintf`]."]
    pub fn fz_snprintf(
        buffer: *mut ::core::ffi::c_char,
        space: usize,
        fmt: *const ::core::ffi::c_char,
        ...
    ) -> usize;
}
unsafe extern "C" {
    #[doc = "Allocated sprintf.\n\nReturns a null terminated allocated block containing the<br>formatted version of the format string/args."]
    pub fn fz_asprintf(
        ctx: *mut fz_context,
        fmt: *const ::core::ffi::c_char,
        ...
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Save the contents of a buffer to a file."]
    pub fn fz_save_buffer(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Compression and other filtering outputs.\n\nThese outputs write encoded data to another output. Create a<br>filter output with the destination, write to the filter, then<br>close and drop it when you're done. These can also be chained<br>together, for example to write ASCII Hex encoded, Deflate<br>compressed, and RC4 encrypted data to a buffer output.\n\nOutput streams don't use reference counting, so make sure to<br>close all of the filters in the reverse order of creation so<br>that data is flushed properly.\n\nAccordingly, ownership of 'chain' is never passed into the<br>following functions, but remains with the caller, whose<br>responsibility it is to ensure they exist at least until<br>the returned [`fz_output`] is dropped."]
    pub fn fz_new_asciihex_output(ctx: *mut fz_context, chain: *mut fz_output) -> *mut fz_output;
}
unsafe extern "C" {
    pub fn fz_new_ascii85_output(ctx: *mut fz_context, chain: *mut fz_output) -> *mut fz_output;
}
unsafe extern "C" {
    pub fn fz_new_rle_output(ctx: *mut fz_context, chain: *mut fz_output) -> *mut fz_output;
}
unsafe extern "C" {
    pub fn fz_new_arc4_output(
        ctx: *mut fz_context,
        chain: *mut fz_output,
        key: *mut ::core::ffi::c_uchar,
        keylen: usize,
    ) -> *mut fz_output;
}
unsafe extern "C" {
    pub fn fz_new_deflate_output(
        ctx: *mut fz_context,
        chain: *mut fz_output,
        effort: ::core::ffi::c_int,
        raw: ::core::ffi::c_int,
    ) -> *mut fz_output;
}
unsafe extern "C" {
    pub fn fz_is_valid_xml_char(c: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_range_limit_xml_char(c: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_is_valid_xml_string(s: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Output a line to the log."]
    pub fn fz_log(ctx: *mut fz_context, fmt: *const ::core::ffi::c_char, ...);
}
unsafe extern "C" {
    #[doc = "Output a line to the log for a given module."]
    pub fn fz_log_module(
        ctx: *mut fz_context,
        module: *const ::core::ffi::c_char,
        fmt: *const ::core::ffi::c_char,
        ...
    );
}
unsafe extern "C" {
    #[doc = "Internal function to actually do the opening of the logfile.\n\nCaller should close/drop the output when finished with it."]
    pub fn fz_new_log_for_module(
        ctx: *mut fz_context,
        module: *const ::core::ffi::c_char,
    ) -> *mut fz_output;
}
#[doc = "Structure definition is public to enable stack<br>based allocation. Do not access the members directly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_md5 {
    pub lo: u32,
    pub hi: u32,
    pub a: u32,
    pub b: u32,
    pub c: u32,
    pub d: u32,
    pub buffer: [::core::ffi::c_uchar; 64usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_md5"][::core::mem::size_of::<fz_md5>() - 88usize];
    ["Alignment of fz_md5"][::core::mem::align_of::<fz_md5>() - 4usize];
    ["Offset of field: fz_md5::lo"][::core::mem::offset_of!(fz_md5, lo) - 0usize];
    ["Offset of field: fz_md5::hi"][::core::mem::offset_of!(fz_md5, hi) - 4usize];
    ["Offset of field: fz_md5::a"][::core::mem::offset_of!(fz_md5, a) - 8usize];
    ["Offset of field: fz_md5::b"][::core::mem::offset_of!(fz_md5, b) - 12usize];
    ["Offset of field: fz_md5::c"][::core::mem::offset_of!(fz_md5, c) - 16usize];
    ["Offset of field: fz_md5::d"][::core::mem::offset_of!(fz_md5, d) - 20usize];
    ["Offset of field: fz_md5::buffer"][::core::mem::offset_of!(fz_md5, buffer) - 24usize];
};
unsafe extern "C" {
    #[doc = "MD5 initialization. Begins an MD5 operation, writing a new<br>context.\n\nNever throws an exception."]
    pub fn fz_md5_init(state: *mut fz_md5);
}
unsafe extern "C" {
    #[doc = "MD5 block update operation. Continues an MD5 message-digest<br>operation, processing another message block, and updating the<br>context.\n\nNever throws an exception."]
    pub fn fz_md5_update(state: *mut fz_md5, input: *const ::core::ffi::c_uchar, inlen: usize);
}
unsafe extern "C" {
    #[doc = "MD5 block update operation. Continues an MD5 message-digest<br>operation, processing an int64, and updating the context.\n\nNever throws an exception."]
    pub fn fz_md5_update_int64(state: *mut fz_md5, i: i64);
}
unsafe extern "C" {
    #[doc = "MD5 finalization. Ends an MD5 message-digest operation, writing<br>the message digest and zeroizing the context.\n\nNever throws an exception."]
    pub fn fz_md5_final(state: *mut fz_md5, digest: *mut ::core::ffi::c_uchar);
}
#[doc = "Structure definition is public to enable stack<br>based allocation. Do not access the members directly."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_sha256 {
    pub state: [::core::ffi::c_uint; 8usize],
    pub count: [::core::ffi::c_uint; 2usize],
    pub buffer: fz_sha256__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_sha256__bindgen_ty_1 {
    pub u8_: [::core::ffi::c_uchar; 64usize],
    pub u32_: [::core::ffi::c_uint; 16usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_sha256__bindgen_ty_1"]
        [::core::mem::size_of::<fz_sha256__bindgen_ty_1>() - 64usize];
    ["Alignment of fz_sha256__bindgen_ty_1"]
        [::core::mem::align_of::<fz_sha256__bindgen_ty_1>() - 4usize];
    ["Offset of field: fz_sha256__bindgen_ty_1::u8_"]
        [::core::mem::offset_of!(fz_sha256__bindgen_ty_1, u8_) - 0usize];
    ["Offset of field: fz_sha256__bindgen_ty_1::u32_"]
        [::core::mem::offset_of!(fz_sha256__bindgen_ty_1, u32_) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_sha256"][::core::mem::size_of::<fz_sha256>() - 104usize];
    ["Alignment of fz_sha256"][::core::mem::align_of::<fz_sha256>() - 4usize];
    ["Offset of field: fz_sha256::state"][::core::mem::offset_of!(fz_sha256, state) - 0usize];
    ["Offset of field: fz_sha256::count"][::core::mem::offset_of!(fz_sha256, count) - 32usize];
    ["Offset of field: fz_sha256::buffer"][::core::mem::offset_of!(fz_sha256, buffer) - 40usize];
};
unsafe extern "C" {
    #[doc = "SHA256 initialization. Begins an SHA256 operation, initialising<br>the supplied context.\n\nNever throws an exception."]
    pub fn fz_sha256_init(state: *mut fz_sha256);
}
unsafe extern "C" {
    #[doc = "SHA256 block update operation. Continues an SHA256 message-<br>digest operation, processing another message block, and updating<br>the context.\n\nNever throws an exception."]
    pub fn fz_sha256_update(
        state: *mut fz_sha256,
        input: *const ::core::ffi::c_uchar,
        inlen: usize,
    );
}
unsafe extern "C" {
    #[doc = "MD5 finalization. Ends an MD5 message-digest operation, writing<br>the message digest and zeroizing the context.\n\nNever throws an exception."]
    pub fn fz_sha256_final(state: *mut fz_sha256, digest: *mut ::core::ffi::c_uchar);
}
#[doc = "Structure definition is public to enable stack<br>based allocation. Do not access the members directly."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_sha512 {
    pub state: [u64; 8usize],
    pub count: [::core::ffi::c_uint; 2usize],
    pub buffer: fz_sha512__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_sha512__bindgen_ty_1 {
    pub u8_: [::core::ffi::c_uchar; 128usize],
    pub u64_: [u64; 16usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_sha512__bindgen_ty_1"]
        [::core::mem::size_of::<fz_sha512__bindgen_ty_1>() - 128usize];
    ["Alignment of fz_sha512__bindgen_ty_1"]
        [::core::mem::align_of::<fz_sha512__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_sha512__bindgen_ty_1::u8_"]
        [::core::mem::offset_of!(fz_sha512__bindgen_ty_1, u8_) - 0usize];
    ["Offset of field: fz_sha512__bindgen_ty_1::u64_"]
        [::core::mem::offset_of!(fz_sha512__bindgen_ty_1, u64_) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_sha512"][::core::mem::size_of::<fz_sha512>() - 200usize];
    ["Alignment of fz_sha512"][::core::mem::align_of::<fz_sha512>() - 8usize];
    ["Offset of field: fz_sha512::state"][::core::mem::offset_of!(fz_sha512, state) - 0usize];
    ["Offset of field: fz_sha512::count"][::core::mem::offset_of!(fz_sha512, count) - 64usize];
    ["Offset of field: fz_sha512::buffer"][::core::mem::offset_of!(fz_sha512, buffer) - 72usize];
};
unsafe extern "C" {
    #[doc = "SHA512 initialization. Begins an SHA512 operation, initialising<br>the supplied context.\n\nNever throws an exception."]
    pub fn fz_sha512_init(state: *mut fz_sha512);
}
unsafe extern "C" {
    #[doc = "SHA512 block update operation. Continues an SHA512 message-<br>digest operation, processing another message block, and updating<br>the context.\n\nNever throws an exception."]
    pub fn fz_sha512_update(
        state: *mut fz_sha512,
        input: *const ::core::ffi::c_uchar,
        inlen: usize,
    );
}
unsafe extern "C" {
    #[doc = "SHA512 finalization. Ends an SHA512 message-digest operation,<br>writing the message digest and zeroizing the context.\n\nNever throws an exception."]
    pub fn fz_sha512_final(state: *mut fz_sha512, digest: *mut ::core::ffi::c_uchar);
}
#[doc = "Structure definition is public to enable stack<br>based allocation. Do not access the members directly."]
pub type fz_sha384 = fz_sha512;
unsafe extern "C" {
    #[doc = "SHA384 initialization. Begins an SHA384 operation, initialising<br>the supplied context.\n\nNever throws an exception."]
    pub fn fz_sha384_init(state: *mut fz_sha384);
}
unsafe extern "C" {
    #[doc = "SHA384 block update operation. Continues an SHA384 message-<br>digest operation, processing another message block, and updating<br>the context.\n\nNever throws an exception."]
    pub fn fz_sha384_update(
        state: *mut fz_sha384,
        input: *const ::core::ffi::c_uchar,
        inlen: usize,
    );
}
unsafe extern "C" {
    #[doc = "SHA384 finalization. Ends an SHA384 message-digest operation,<br>writing the message digest and zeroizing the context.\n\nNever throws an exception."]
    pub fn fz_sha384_final(state: *mut fz_sha384, digest: *mut ::core::ffi::c_uchar);
}
#[doc = "Structure definition is public to enable stack<br>based allocation. Do not access the members directly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_arc4 {
    pub x: ::core::ffi::c_uint,
    pub y: ::core::ffi::c_uint,
    pub state: [::core::ffi::c_uchar; 256usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_arc4"][::core::mem::size_of::<fz_arc4>() - 264usize];
    ["Alignment of fz_arc4"][::core::mem::align_of::<fz_arc4>() - 4usize];
    ["Offset of field: fz_arc4::x"][::core::mem::offset_of!(fz_arc4, x) - 0usize];
    ["Offset of field: fz_arc4::y"][::core::mem::offset_of!(fz_arc4, y) - 4usize];
    ["Offset of field: fz_arc4::state"][::core::mem::offset_of!(fz_arc4, state) - 8usize];
};
unsafe extern "C" {
    #[doc = "RC4 initialization. Begins an RC4 operation, writing a new<br>context.\n\nNever throws an exception."]
    pub fn fz_arc4_init(state: *mut fz_arc4, key: *const ::core::ffi::c_uchar, len: usize);
}
unsafe extern "C" {
    #[doc = "RC4 block encrypt operation; encrypt src into dst \\(both of<br>length len\\) updating the RC4 state as we go.\n\nNever throws an exception."]
    pub fn fz_arc4_encrypt(
        state: *mut fz_arc4,
        dest: *mut ::core::ffi::c_uchar,
        src: *const ::core::ffi::c_uchar,
        len: usize,
    );
}
unsafe extern "C" {
    #[doc = "RC4 finalization. Zero the context.\n\nNever throws an exception."]
    pub fn fz_arc4_final(state: *mut fz_arc4);
}
#[doc = "Structure definitions are public to enable stack<br>based allocation. Do not access the members directly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_aes {
    pub nr: ::core::ffi::c_int,
    pub rk: *mut u32,
    pub buf: [u32; 68usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_aes"][::core::mem::size_of::<fz_aes>() - 288usize];
    ["Alignment of fz_aes"][::core::mem::align_of::<fz_aes>() - 8usize];
    ["Offset of field: fz_aes::nr"][::core::mem::offset_of!(fz_aes, nr) - 0usize];
    ["Offset of field: fz_aes::rk"][::core::mem::offset_of!(fz_aes, rk) - 8usize];
    ["Offset of field: fz_aes::buf"][::core::mem::offset_of!(fz_aes, buf) - 16usize];
};
unsafe extern "C" {
    #[doc = "AES encryption initialization. Fills in the supplied context<br>and prepares for encryption using the given key.\n\nReturns non-zero for error \\(key size other than 128/192/256\\).\n\nNever throws an exception."]
    pub fn fz_aes_setkey_enc(
        ctx: *mut fz_aes,
        key: *const ::core::ffi::c_uchar,
        keysize: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "AES decryption initialization. Fills in the supplied context<br>and prepares for decryption using the given key.\n\nReturns non-zero for error \\(key size other than 128/192/256\\).\n\nNever throws an exception."]
    pub fn fz_aes_setkey_dec(
        ctx: *mut fz_aes,
        key: *const ::core::ffi::c_uchar,
        keysize: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "AES block processing. Encrypts or Decrypts \\(according to mode,<br>which must match what was initially set up\\) length bytes \\(which<br>must be a multiple of 16\\), using \\(and modifying\\) the insertion<br>vector iv, reading from input, and writing to output.\n\nNever throws an exception."]
    pub fn fz_aes_crypt_cbc(
        ctx: *mut fz_aes,
        mode: ::core::ffi::c_int,
        length: usize,
        iv: *mut ::core::ffi::c_uchar,
        input: *const ::core::ffi::c_uchar,
        output: *mut ::core::ffi::c_uchar,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_getopt_long_options {
    pub option: *mut ::core::ffi::c_char,
    pub flag: *mut ::core::ffi::c_int,
    pub opaque: *mut ::core::ffi::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_getopt_long_options"][::core::mem::size_of::<fz_getopt_long_options>() - 24usize];
    ["Alignment of fz_getopt_long_options"]
        [::core::mem::align_of::<fz_getopt_long_options>() - 8usize];
    ["Offset of field: fz_getopt_long_options::option"]
        [::core::mem::offset_of!(fz_getopt_long_options, option) - 0usize];
    ["Offset of field: fz_getopt_long_options::flag"]
        [::core::mem::offset_of!(fz_getopt_long_options, flag) - 8usize];
    ["Offset of field: fz_getopt_long_options::opaque"]
        [::core::mem::offset_of!(fz_getopt_long_options, opaque) - 16usize];
};
unsafe extern "C" {
    #[doc = "Simple functions/variables for use in tools.\n\nostr = option string. Comprises single letter options, followed by : if there<br>is an argument to the option.\n\n`longopts`: `NULL` \\(indicating no long options\\), or a pointer to an array of<br>longoptions, terminated by an entry with option == `NULL`.\n\nIn the event of matching a single char option, this function will normally<br>return the char. The exception to this is when the option requires an<br>argument and none is supplied; in this case we return ':'.\n\nIn the event of matching a long option, this function returns 0, with [`fz_optlong`]<br>set to point to the matching option.\n\nA long option entry may be followed with : to indicate there is an argument to the<br>option. If the need for an argument is specified in this way, and no argument is<br>given, an error will be displayed and argument processing will stop. If an argument<br>is given, and the long option record contains a non-null flag pointer, then the code<br>will decode the argument and fill in that flag pointer. Specifically,<br>case-insensitive matches to 'yes', 'no', 'true' and 'false' will cause a value of 0<br>or 1 as appropriate to be written; failing this the arg will be interpreted as a<br>decimal integer using atoi.\n\nA long option entry may be followed by an list of options \\(e.g. myoption=foo|bar|baz\\)<br>and the option will be passed to [`fz_opt_from_list`]. The return value of that will be<br>placed in [`fz_optitem`]. If the return value of that function is -1, then an error will<br>be displayed and argument processing will stop.\n\nIn the event of reaching the end of the arg list or '--', this function returns EOF.\n\nIn the event of failing to match anything, an error is printed, and we return '?'.\n\nIf an argument is expected for the option, then [`fz_optarg`] will be returned pointing<br>at the start of the argument. Examples of supported argument formats: '-r500', '-r 500',<br>'--resolution 500', '--resolution=500'."]
    pub fn fz_getopt_long(
        nargc: ::core::ffi::c_int,
        nargv: *const *mut ::core::ffi::c_char,
        ostr: *const ::core::ffi::c_char,
        longopts: *const fz_getopt_long_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Identical to [`fz_getopt_long`], but with a `NULL` longopts field, signifying no long<br>options."]
    pub fn fz_getopt(
        nargc: ::core::ffi::c_int,
        nargv: *const *mut ::core::ffi::c_char,
        ostr: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "[`fz_optind`] is updated to point to the current index being read from the<br>arguments."]
    pub static mut fz_optind: ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "[`fz_optarg`] is a pointer to the argument data for the most recently<br>read option."]
    pub static mut fz_optarg: *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "[`fz_optlong`] is a pointer to the record for the most recently<br>read long option. \\(i.e. if a long option is detected, this<br>will be set to point to the record for that option, otherwise<br>it will be `NULL`\\)."]
    pub static mut fz_optlong: *const fz_getopt_long_options;
}
unsafe extern "C" {
    #[doc = "The item number for the most recently matched item list.\n\nFirst item in the list is numbered 0. No match is -1."]
    pub static mut fz_optitem: ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the index of a \\(case-insensitive\\) option within an optlist.\n\nFor instance for optlist = \"Foo|Bar|Baz\", and  opt = \"bar\",<br>this would return 1.\n\nIf the optlist ends with \"|*\" then that is a catch all case and<br>matches all options allowing the caller to process it itself.<br>[`fz_optarg`] will be set to point to the option, and the return<br>value will be the index of the '*' option within that list.\n\nIf an optlist entry ends with ':' \\(e.g. \"Foo:\"\\) then that option<br>may have suboptions appended to it \\(for example \"JPG:80\"\\) and<br>[`fz_optarg`] will be set to point at \"80\". Otherwise [`fz_optarg`] will<br>be set to `NULL`.\n\nIn the event of no-match found, prints an error and returns -1."]
    pub fn fz_opt_from_list(
        opt: *mut ::core::ffi::c_char,
        optlist: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Convert \"-\" to \"/dev/stdout\" for use with command lines.<br>Also converts \"nul\" and \"con\" on Windows."]
    pub fn fz_optpath(opt: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_hash_table {
    _unused: [u8; 0],
}
#[doc = "Function type called when a hash table entry is dropped.\n\nOnly used when the entire hash table is dropped."]
pub type fz_hash_table_drop_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, val: *mut ::core::ffi::c_void),
>;
unsafe extern "C" {
    #[doc = "Create a new hash table.\n\n`initialsize`: The initial size of the hashtable. The hashtable<br>may grow \\(double in size\\) if it starts to get crowded \\(80%<br>full\\).\n\n`keylen`: byte length for each key.\n\n`lock`: -1 for no lock, otherwise the [`FZ_LOCK`] to use to protect<br>this table.\n\n`drop_val`: Function to use to destroy values on table drop."]
    pub fn fz_new_hash_table(
        ctx: *mut fz_context,
        initialsize: ::core::ffi::c_int,
        keylen: ::core::ffi::c_int,
        lock: ::core::ffi::c_int,
        drop_val: fz_hash_table_drop_fn,
    ) -> *mut fz_hash_table;
}
unsafe extern "C" {
    #[doc = "Destroy the hash table.\n\nValues are dropped using the drop function."]
    pub fn fz_drop_hash_table(ctx: *mut fz_context, table: *mut fz_hash_table);
}
unsafe extern "C" {
    #[doc = "Search for a matching hash within the table, and return the<br>associated value."]
    pub fn fz_hash_find(
        ctx: *mut fz_context,
        table: *mut fz_hash_table,
        key: *const ::core::ffi::c_void,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Insert a new key/value pair into the hash table.\n\nIf an existing entry with the same key is found, no change is<br>made to the hash table, and a pointer to the existing value is<br>returned.\n\nIf no existing entry with the same key is found, ownership of<br>val passes in, key is copied, and `NULL` is returned."]
    pub fn fz_hash_insert(
        ctx: *mut fz_context,
        table: *mut fz_hash_table,
        key: *const ::core::ffi::c_void,
        val: *mut ::core::ffi::c_void,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Remove the entry for a given key.\n\nThe value is NOT freed, so the caller is expected to take care<br>of this."]
    pub fn fz_hash_remove(
        ctx: *mut fz_context,
        table: *mut fz_hash_table,
        key: *const ::core::ffi::c_void,
    );
}
#[doc = "Callback function called on each key/value pair in the hash<br>table, when [`fz_hash_for_each`] is run."]
pub type fz_hash_table_for_each_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        state: *mut ::core::ffi::c_void,
        key: *mut ::core::ffi::c_void,
        keylen: ::core::ffi::c_int,
        val: *mut ::core::ffi::c_void,
    ),
>;
unsafe extern "C" {
    #[doc = "Iterate over the entries in a hash table."]
    pub fn fz_hash_for_each(
        ctx: *mut fz_context,
        table: *mut fz_hash_table,
        state: *mut ::core::ffi::c_void,
        callback: fz_hash_table_for_each_fn,
    );
}
#[doc = "Callback function called on each key/value pair in the hash<br>table, when [`fz_hash_filter`] is run to remove entries where the<br>callback returns true."]
pub type fz_hash_table_filter_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        state: *mut ::core::ffi::c_void,
        key: *mut ::core::ffi::c_void,
        keylen: ::core::ffi::c_int,
        val: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int,
>;
unsafe extern "C" {
    #[doc = "Iterate over the entries in a hash table, removing all the ones where callback returns true.<br>Does NOT free the value of the entry, so the caller is expected to take care of this."]
    pub fn fz_hash_filter(
        ctx: *mut fz_context,
        table: *mut fz_hash_table,
        state: *mut ::core::ffi::c_void,
        callback: fz_hash_table_filter_fn,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pool {
    _unused: [u8; 0],
}
unsafe extern "C" {
    #[doc = "Create a new pool to allocate from."]
    pub fn fz_new_pool(ctx: *mut fz_context) -> *mut fz_pool;
}
unsafe extern "C" {
    #[doc = "Allocate a block of size bytes from the pool.<br>Block will be inited to 0's."]
    pub fn fz_pool_alloc(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        size: usize,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "strdup equivalent allocating from the pool."]
    pub fn fz_pool_strdup(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        s: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "The current size of the pool.\n\nThe number of bytes of storage currently allocated to the pool.<br>This is the total of the storage used for the blocks making<br>up the pool, rather then total of the allocated blocks so far,<br>so it will increase in 'lumps'.<br>from the pool, then the pool size may still be X"]
    pub fn fz_pool_size(ctx: *mut fz_context, pool: *mut fz_pool) -> usize;
}
unsafe extern "C" {
    #[doc = "Drop a pool, freeing and invalidating all storage returned from<br>the pool."]
    pub fn fz_drop_pool(ctx: *mut fz_context, pool: *mut fz_pool);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pool_array {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn fz_new_pool_array_imp(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        size: usize,
        initial: usize,
    ) -> *mut fz_pool_array;
}
unsafe extern "C" {
    #[doc = "Append an element to the end of the array.\n\nReturns a pointer to the new element \\(initially all 0's\\), and<br>\\(optionally\\) the index of that element."]
    pub fn fz_pool_array_append(
        ctx: *mut fz_context,
        arr: *mut fz_pool_array,
        idx: *mut usize,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Lookup an element in the array."]
    pub fn fz_pool_array_lookup(
        ctx: *mut fz_context,
        arr: *mut fz_pool_array,
        idx: usize,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Get the length of the array."]
    pub fn fz_pool_array_len(ctx: *mut fz_context, arr: *mut fz_pool_array) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_tree {
    _unused: [u8; 0],
}
unsafe extern "C" {
    #[doc = "Look for the value of a node in the tree with the given key.\n\nSimple pointer equivalence is used for key.\n\nReturns `NULL` for no match."]
    pub fn fz_tree_lookup(
        ctx: *mut fz_context,
        node: *mut fz_tree,
        key: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Insert a new key/value pair and rebalance the tree.<br>Return the new root of the tree after inserting and rebalancing.<br>May be called with a `NULL` root to create a new tree.\n\nNo data is copied into the tree structure; key and value are<br>merely kept as pointers."]
    pub fn fz_tree_insert(
        ctx: *mut fz_context,
        root: *mut fz_tree,
        key: *const ::core::ffi::c_char,
        value: *mut ::core::ffi::c_void,
    ) -> *mut fz_tree;
}
unsafe extern "C" {
    #[doc = "Drop the tree.\n\nThe storage used by the tree is freed, and each value has<br>dropfunc called on it."]
    pub fn fz_drop_tree(
        ctx: *mut fz_context,
        node: *mut fz_tree,
        dropfunc: ::core::option::Option<
            unsafe extern "C" fn(ctx: *mut fz_context, value: *mut ::core::ffi::c_void),
        >,
    );
}
pub const FZ_BIDI_LTR: fz_bidi_direction = 0;
pub const FZ_BIDI_RTL: fz_bidi_direction = 1;
pub const FZ_BIDI_NEUTRAL: fz_bidi_direction = 2;
pub const FZ_BIDI_UNSET: fz_bidi_direction = 3;
pub type fz_bidi_direction = ::core::ffi::c_uint;
pub const FZ_BIDI_CLASSIFY_WHITE_SPACE: fz_bidi_flags = 1;
pub const FZ_BIDI_REPLACE_TAB: fz_bidi_flags = 2;
pub type fz_bidi_flags = ::core::ffi::c_uint;
#[doc = "Prototype for callback function supplied to [`fz_bidi_fragment_text`].\n# Arguments\n* \tfragment\tfirst character in fragment\n* \tfragmentLen\tnumber of characters in fragment\n* \tbidiLevel\tThe bidirectional level for this text.<br>The bottom bit will be set iff block<br>should concatenate with other blocks as<br>right-to-left\n* \tscript\t\tthe script in use for this fragment \\(other<br>than common or inherited\\)\n* \targ\t\tdata from caller of Bidi_fragmentText"]
pub type fz_bidi_fragment_fn = ::core::option::Option<
    unsafe extern "C" fn(
        fragment: *const u32,
        fragmentLen: usize,
        bidiLevel: ::core::ffi::c_int,
        script: ::core::ffi::c_int,
        arg: *mut ::core::ffi::c_void,
    ),
>;
unsafe extern "C" {
    #[doc = "Partitions the given Unicode sequence into one or more<br>unidirectional fragments and invokes the given callback<br>function for each fragment.\n\nFor example, if directionality of text is:<br>0123456789<br>rrlllrrrrr,<br>we'll invoke callback with:<br>&text\\[0\\], length == 2<br>&text\\[2\\], length == 3<br>&text\\[5\\], length == 5\n# Arguments\n* \\[in\\] text\tstart of Unicode sequence\n* \\[in\\] textlen   number of Unicodes to analyse\n* \\[in\\] baseDir   direction of paragraph \\(specify [`FZ_BIDI_NEUTRAL`] to force auto-detection\\)\n* \\[in\\] callback  function to be called for each fragment\n* \\[in\\] arg\tdata to be passed to the callback function\n* \\[in\\] flags     flags to control operation \\(see [`fz_bidi_flags`] above\\)"]
    pub fn fz_bidi_fragment_text(
        ctx: *mut fz_context,
        text: *const u32,
        textlen: usize,
        baseDir: *mut fz_bidi_direction,
        callback: fz_bidi_fragment_fn,
        arg: *mut ::core::ffi::c_void,
        flags: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Open a zip or tar archive\n\nOpen a file and identify its archive type based on the archive<br>signature contained inside.\n\n`filename`: a path to a file as it would be given to open\\(2\\)."]
    pub fn fz_open_archive(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open zip or tar archive stream.\n\nOpen an archive using a seekable stream object rather than<br>opening a file or directory on disk."]
    pub fn fz_open_archive_with_stream(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open zip or tar archive stream.\n\nDoes the same as [`fz_open_archive_with_stream`], but will not throw<br>an error in the event of failing to recognise the format. Will<br>still throw errors in other cases though!"]
    pub fn fz_try_open_archive_with_stream(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open a directory as if it was an archive.\n\nA special case where a directory is opened as if it was an<br>archive.\n\nNote that for directories it is not possible to retrieve the<br>number of entries or list the entries. It is however possible<br>to check if the archive has a particular entry.\n\n`path`: a path to a directory as it would be given to opendir\\(3\\)."]
    pub fn fz_open_directory(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Determine if a given path is a directory.\n\nIn the case of the path not existing, or having no access<br>we will return 0."]
    pub fn fz_is_directory(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Drop a reference to an archive.\n\nWhen the last reference is dropped, this closes and releases<br>any memory or filehandles associated with the archive."]
    pub fn fz_drop_archive(ctx: *mut fz_context, arch: *mut fz_archive);
}
unsafe extern "C" {
    #[doc = "Keep a reference to an archive."]
    pub fn fz_keep_archive(ctx: *mut fz_context, arch: *mut fz_archive) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Return a pointer to a string describing the format of the<br>archive.\n\nThe lifetime of the string is unspecified \\(in current<br>implementations the string will persist until the archive<br>is closed, but this is not guaranteed\\)."]
    pub fn fz_archive_format(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Number of entries in archive.\n\nWill always return a value \\>= 0.\n\nMay throw an exception if this type of archive cannot count the<br>entries \\(such as a directory\\)."]
    pub fn fz_count_archive_entries(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get listed name of entry position idx.\n\n`idx`: Must be a value \\>= 0 \\< return value from<br>[`fz_count_archive_entries`]. If not in range `NULL` will be<br>returned.\n\nMay throw an exception if this type of archive cannot list the<br>entries \\(such as a directory\\)."]
    pub fn fz_list_archive_entry(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
        idx: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Check if entry by given name exists.\n\nIf named entry does not exist 0 will be returned, if it does<br>exist 1 is returned.\n\n`name`: Entry name to look for, this must be an exact match to<br>the entry name in the archive."]
    pub fn fz_has_archive_entry(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
        name: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Opens an archive entry as a stream.\n\n`name`: Entry name to look for, this must be an exact match to<br>the entry name in the archive.\n\nThrows an exception if a matching entry cannot be found."]
    pub fn fz_open_archive_entry(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
        name: *const ::core::ffi::c_char,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Opens an archive entry as a stream.\n\nReturns `NULL` if a matching entry cannot be found, otherwise<br>behaves exactly as [`fz_open_archive_entry`]."]
    pub fn fz_try_open_archive_entry(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
        name: *const ::core::ffi::c_char,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Reads all bytes in an archive entry<br>into a buffer.\n\n`name`: Entry name to look for, this must be an exact match to<br>the entry name in the archive.\n\nThrows an exception if a matching entry cannot be found."]
    pub fn fz_read_archive_entry(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
        name: *const ::core::ffi::c_char,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Reads all bytes in an archive entry<br>into a buffer.\n\n`name`: Entry name to look for, this must be an exact match to<br>the entry name in the archive.\n\nReturns `NULL` if a matching entry cannot be found. Otherwise behaves<br>the same as [`fz_read_archive_entry`]. Exceptions may be thrown."]
    pub fn fz_try_read_archive_entry(
        ctx: *mut fz_context,
        arch: *mut fz_archive,
        name: *const ::core::ffi::c_char,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Detect if stream object is a tar archive.\n\nAssumes that the stream object is seekable."]
    pub fn fz_is_tar_archive(ctx: *mut fz_context, file: *mut fz_stream) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Detect if stream object is an archive supported by libarchive.\n\nAssumes that the stream object is seekable."]
    pub fn fz_is_libarchive_archive(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Detect if stream object is a cfb archive.\n\nAssumes that the stream object is seekable."]
    pub fn fz_is_cfb_archive(ctx: *mut fz_context, file: *mut fz_stream) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Open a tar archive file.\n\nAn exception is thrown if the file is not a tar archive as<br>indicated by the presence of a tar signature.\n\n`filename`: a path to a tar archive file as it would be given to<br>open\\(2\\)."]
    pub fn fz_open_tar_archive(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open a tar archive stream.\n\nOpen an archive using a seekable stream object rather than<br>opening a file or directory on disk.\n\nAn exception is thrown if the stream is not a tar archive as<br>indicated by the presence of a tar signature."]
    pub fn fz_open_tar_archive_with_stream(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open an archive using libarchive.\n\nAn exception is thrown if the file is not supported by libarchive.\n\n`filename`: a path to an archive file as it would be given to<br>open\\(2\\)."]
    pub fn fz_open_libarchive_archive(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open an archive using libarchive.\n\nOpen an archive using a seekable stream object rather than<br>opening a file or directory on disk.\n\nAn exception is thrown if the stream is not supported by libarchive."]
    pub fn fz_open_libarchive_archive_with_stream(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open a cfb file as an archive.\n\nAn exception is thrown if the file is not recognised as a cfb.\n\n`filename`: a path to an archive file as it would be given to<br>open\\(2\\)."]
    pub fn fz_open_cfb_archive(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open a cfb file as an archive.\n\nOpen an archive using a seekable stream object rather than<br>opening a file or directory on disk.\n\nAn exception is thrown if the file is not recognised as a chm."]
    pub fn fz_open_cfb_archive_with_stream(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Detect if stream object is a zip archive.\n\nAssumes that the stream object is seekable."]
    pub fn fz_is_zip_archive(ctx: *mut fz_context, file: *mut fz_stream) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Open a zip archive file.\n\nAn exception is thrown if the file is not a zip archive as<br>indicated by the presence of a zip signature.\n\n`filename`: a path to a zip archive file as it would be given to<br>open\\(2\\)."]
    pub fn fz_open_zip_archive(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open a zip archive stream.\n\nOpen an archive using a seekable stream object rather than<br>opening a file or directory on disk.\n\nAn exception is thrown if the stream is not a zip archive as<br>indicated by the presence of a zip signature."]
    pub fn fz_open_zip_archive_with_stream(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Open a zip archive from static data."]
    pub fn fz_open_zip_archive_with_memory(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_uchar,
        size: usize,
    ) -> *mut fz_archive;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_zip_writer {
    _unused: [u8; 0],
}
unsafe extern "C" {
    #[doc = "Create a new zip writer that writes to a given file.\n\nOpen an archive using a seekable stream object rather than<br>opening a file or directory on disk."]
    pub fn fz_new_zip_writer(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_zip_writer;
}
unsafe extern "C" {
    #[doc = "Create a new zip writer that writes to a given output stream.\n\nOwnership of out passes in immediately upon calling this function.<br>The caller should never drop the [`fz_output`], even if this function throws<br>an exception."]
    pub fn fz_new_zip_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
    ) -> *mut fz_zip_writer;
}
unsafe extern "C" {
    #[doc = "Given a buffer of data, \\(optionally\\) compress it, and add it to<br>the zip file with the given name."]
    pub fn fz_write_zip_entry(
        ctx: *mut fz_context,
        zip: *mut fz_zip_writer,
        name: *const ::core::ffi::c_char,
        buf: *mut fz_buffer,
        compress: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Close the zip file for writing.\n\nThis flushes any pending data to the file. This can throw<br>exceptions."]
    pub fn fz_close_zip_writer(ctx: *mut fz_context, zip: *mut fz_zip_writer);
}
unsafe extern "C" {
    #[doc = "Drop the reference to the zipfile.\n\nIn common with other 'drop' methods, this will never throw an<br>exception."]
    pub fn fz_drop_zip_writer(ctx: *mut fz_context, zip: *mut fz_zip_writer);
}
unsafe extern "C" {
    #[doc = "Create an archive that holds named buffers.\n\ntree can either be a preformed tree with [`fz_buffer`](fz_buffer)s as values,<br>or it can be `NULL` for an empty tree."]
    pub fn fz_new_tree_archive(ctx: *mut fz_context, tree: *mut fz_tree) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Add a named buffer to an existing tree archive.\n\nThe tree will take a new reference to the buffer. Ownership<br>is not transferred."]
    pub fn fz_tree_archive_add_buffer(
        ctx: *mut fz_context,
        arch_: *mut fz_archive,
        name: *const ::core::ffi::c_char,
        buf: *mut fz_buffer,
    );
}
unsafe extern "C" {
    #[doc = "Add a named block of data to an existing tree archive.\n\nThe data will be copied into a buffer, and so the caller<br>may free it as soon as this returns."]
    pub fn fz_tree_archive_add_data(
        ctx: *mut fz_context,
        arch_: *mut fz_archive,
        name: *const ::core::ffi::c_char,
        data: *const ::core::ffi::c_void,
        size: usize,
    );
}
unsafe extern "C" {
    #[doc = "Create a new multi archive \\(initially empty\\)."]
    pub fn fz_new_multi_archive(ctx: *mut fz_context) -> *mut fz_archive;
}
unsafe extern "C" {
    #[doc = "Add an archive to the set of archives handled by a multi<br>archive.\n\nIf path is `NULL`, then the archive contents will appear at the<br>top level, otherwise, the archives contents will appear prefixed<br>by path."]
    pub fn fz_mount_multi_archive(
        ctx: *mut fz_context,
        arch_: *mut fz_archive,
        sub: *mut fz_archive,
        path: *const ::core::ffi::c_char,
    );
}
pub type fz_recognize_archive_fn = ::core::option::Option<
    unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_stream) -> ::core::ffi::c_int,
>;
pub type fz_open_archive_fn = ::core::option::Option<
    unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_stream) -> *mut fz_archive,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_archive_handler {
    pub recognize: fz_recognize_archive_fn,
    pub open: fz_open_archive_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_archive_handler"][::core::mem::size_of::<fz_archive_handler>() - 16usize];
    ["Alignment of fz_archive_handler"][::core::mem::align_of::<fz_archive_handler>() - 8usize];
    ["Offset of field: fz_archive_handler::recognize"]
        [::core::mem::offset_of!(fz_archive_handler, recognize) - 0usize];
    ["Offset of field: fz_archive_handler::open"]
        [::core::mem::offset_of!(fz_archive_handler, open) - 8usize];
};
unsafe extern "C" {
    pub static fz_libarchive_archive_handler: fz_archive_handler;
}
unsafe extern "C" {
    pub fn fz_register_archive_handler(ctx: *mut fz_context, handler: *const fz_archive_handler);
}
#[doc = "Implementation details: Subject to change."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_archive {
    pub refs: ::core::ffi::c_int,
    pub file: *mut fz_stream,
    pub format: *const ::core::ffi::c_char,
    pub drop_archive:
        ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, arch: *mut fz_archive)>,
    pub count_entries: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, arch: *mut fz_archive) -> ::core::ffi::c_int,
    >,
    pub list_entry: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arch: *mut fz_archive,
            idx: ::core::ffi::c_int,
        ) -> *const ::core::ffi::c_char,
    >,
    pub has_entry: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arch: *mut fz_archive,
            name: *const ::core::ffi::c_char,
        ) -> ::core::ffi::c_int,
    >,
    pub read_entry: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arch: *mut fz_archive,
            name: *const ::core::ffi::c_char,
        ) -> *mut fz_buffer,
    >,
    pub open_entry: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arch: *mut fz_archive,
            name: *const ::core::ffi::c_char,
        ) -> *mut fz_stream,
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_archive"][::core::mem::size_of::<fz_archive>() - 72usize];
    ["Alignment of fz_archive"][::core::mem::align_of::<fz_archive>() - 8usize];
    ["Offset of field: fz_archive::refs"][::core::mem::offset_of!(fz_archive, refs) - 0usize];
    ["Offset of field: fz_archive::file"][::core::mem::offset_of!(fz_archive, file) - 8usize];
    ["Offset of field: fz_archive::format"][::core::mem::offset_of!(fz_archive, format) - 16usize];
    ["Offset of field: fz_archive::drop_archive"]
        [::core::mem::offset_of!(fz_archive, drop_archive) - 24usize];
    ["Offset of field: fz_archive::count_entries"]
        [::core::mem::offset_of!(fz_archive, count_entries) - 32usize];
    ["Offset of field: fz_archive::list_entry"]
        [::core::mem::offset_of!(fz_archive, list_entry) - 40usize];
    ["Offset of field: fz_archive::has_entry"]
        [::core::mem::offset_of!(fz_archive, has_entry) - 48usize];
    ["Offset of field: fz_archive::read_entry"]
        [::core::mem::offset_of!(fz_archive, read_entry) - 56usize];
    ["Offset of field: fz_archive::open_entry"]
        [::core::mem::offset_of!(fz_archive, open_entry) - 64usize];
};
unsafe extern "C" {
    pub fn fz_new_archive_of_size(
        ctx: *mut fz_context,
        file: *mut fz_stream,
        size: ::core::ffi::c_int,
    ) -> *mut fz_archive;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_xml {
    _unused: [u8; 0],
}
pub type fz_xml_doc = fz_xml;
unsafe extern "C" {
    #[doc = "Parse the contents of buffer into a tree of xml nodes.\n\n`preserve_white`: whether to keep or delete all-whitespace nodes."]
    pub fn fz_parse_xml(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        preserve_white: ::core::ffi::c_int,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Parse the contents of buffer into a tree of xml nodes.\n\n`preserve_white`: whether to keep or delete all-whitespace nodes."]
    pub fn fz_parse_xml_stream(
        ctx: *mut fz_context,
        stream: *mut fz_stream,
        preserve_white: ::core::ffi::c_int,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Parse the contents of an archive entry into a tree of xml nodes.\n\n`preserve_white`: whether to keep or delete all-whitespace nodes."]
    pub fn fz_parse_xml_archive_entry(
        ctx: *mut fz_context,
        dir: *mut fz_archive,
        filename: *const ::core::ffi::c_char,
        preserve_white: ::core::ffi::c_int,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Try and parse the contents of an archive entry into a tree of xml nodes.\n\n`preserve_white`: whether to keep or delete all-whitespace nodes.\n\nWill return `NULL` if the archive entry can't be found. Otherwise behaves<br>the same as [`fz_parse_xml_archive_entry`]. May throw exceptions."]
    pub fn fz_try_parse_xml_archive_entry(
        ctx: *mut fz_context,
        dir: *mut fz_archive,
        filename: *const ::core::ffi::c_char,
        preserve_white: ::core::ffi::c_int,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Parse the contents of a buffer into a tree of XML nodes,<br>using the HTML5 parsing algorithm."]
    pub fn fz_parse_xml_from_html5(ctx: *mut fz_context, buf: *mut fz_buffer) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Add a reference to the XML."]
    pub fn fz_keep_xml(ctx: *mut fz_context, xml: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Drop a reference to the XML. When the last reference is<br>dropped, the node and all its children and siblings will<br>be freed."]
    pub fn fz_drop_xml(ctx: *mut fz_context, xml: *mut fz_xml);
}
unsafe extern "C" {
    #[doc = "Detach a node from the tree, unlinking it from its parent,<br>and setting the document root to the node."]
    pub fn fz_detach_xml(ctx: *mut fz_context, node: *mut fz_xml);
}
unsafe extern "C" {
    #[doc = "Return the topmost XML node of a document."]
    pub fn fz_xml_root(xml: *mut fz_xml_doc) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return previous sibling of XML node."]
    pub fn fz_xml_prev(item: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return next sibling of XML node."]
    pub fn fz_xml_next(item: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return parent of XML node."]
    pub fn fz_xml_up(item: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return first child of XML node."]
    pub fn fz_xml_down(item: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return true if the tag name matches."]
    pub fn fz_xml_is_tag(item: *mut fz_xml, name: *const ::core::ffi::c_char)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return tag of XML node. Return `NULL` for text nodes."]
    pub fn fz_xml_tag(item: *mut fz_xml) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return the value of an attribute of an XML node.<br>`NULL` if the attribute doesn't exist."]
    pub fn fz_xml_att(
        item: *mut fz_xml,
        att: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return the value of an attribute of an XML node.<br>If the first attribute doesn't exist, try the second.<br>`NULL` if neither attribute exists."]
    pub fn fz_xml_att_alt(
        item: *mut fz_xml,
        one: *const ::core::ffi::c_char,
        two: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Check for a matching attribute on an XML node.\n\nIf the node has the requested attribute \\(name\\), and the value<br>matches \\(match\\) then return 1. Otherwise, 0."]
    pub fn fz_xml_att_eq(
        item: *mut fz_xml,
        name: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Add an attribute to an XML node."]
    pub fn fz_xml_add_att(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        node: *mut fz_xml,
        key: *const ::core::ffi::c_char,
        val: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Return the text content of an XML node.<br>Return `NULL` if the node is a tag."]
    pub fn fz_xml_text(item: *mut fz_xml) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Pretty-print an XML tree to given output."]
    pub fn fz_output_xml(
        ctx: *mut fz_context,
        out: *mut fz_output,
        item: *mut fz_xml,
        level: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Pretty-print an XML tree to stdout. \\(Deprecated, use<br>[`fz_output_xml`] in preference\\)."]
    pub fn fz_debug_xml(item: *mut fz_xml, level: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Search the siblings of XML nodes starting with item looking for<br>the first with the given tag.\n\nReturn `NULL` if none found."]
    pub fn fz_xml_find(item: *mut fz_xml, tag: *const ::core::ffi::c_char) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Search the siblings of XML nodes starting with the first sibling<br>of item looking for the first with the given tag.\n\nReturn `NULL` if none found."]
    pub fn fz_xml_find_next(item: *mut fz_xml, tag: *const ::core::ffi::c_char) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Search the siblings of XML nodes starting with the first child<br>of item looking for the first with the given tag.\n\nReturn `NULL` if none found."]
    pub fn fz_xml_find_down(item: *mut fz_xml, tag: *const ::core::ffi::c_char) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Search the siblings of XML nodes starting with item looking for<br>the first with the given tag \\(or any tag if tag is `NULL`\\), and<br>with a matching attribute.\n\nReturn `NULL` if none found."]
    pub fn fz_xml_find_match(
        item: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Search the siblings of XML nodes starting with the first sibling<br>of item looking for the first with the given tag \\(or any tag if tag<br>is `NULL`\\), and with a matching attribute.\n\nReturn `NULL` if none found."]
    pub fn fz_xml_find_next_match(
        item: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Search the siblings of XML nodes starting with the first child<br>of item looking for the first with the given tag \\(or any tag if<br>tag is `NULL`\\), and with a matching attribute.\n\nReturn `NULL` if none found."]
    pub fn fz_xml_find_down_match(
        item: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Perform a depth first search from item, returning the first<br>child that matches the given tag \\(or any tag if tag is `NULL`\\),<br>with the given attribute \\(if att is non `NULL`\\), that matches<br>match \\(if match is non `NULL`\\)."]
    pub fn fz_xml_find_dfs(
        item: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Perform a depth first search from item, returning the first<br>child that matches the given tag \\(or any tag if tag is `NULL`\\),<br>with the given attribute \\(if att is non `NULL`\\), that matches<br>match \\(if match is non `NULL`\\). The search stops if it ever<br>reaches the top of the tree, or the declared 'top' item."]
    pub fn fz_xml_find_dfs_top(
        item: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
        top: *mut fz_xml,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Perform a depth first search onwards from item, returning the first<br>child that matches the given tag \\(or any tag if tag is `NULL`\\),<br>with the given attribute \\(if att is non `NULL`\\), that matches<br>match \\(if match is non `NULL`\\)."]
    pub fn fz_xml_find_next_dfs(
        item: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Perform a depth first search onwards from item, returning the first<br>child that matches the given tag \\(or any tag if tag is `NULL`\\),<br>with the given attribute \\(if att is non `NULL`\\), that matches<br>match \\(if match is non `NULL`\\). The search stops if it ever reaches<br>the top of the tree, or the declared 'top' item."]
    pub fn fz_xml_find_next_dfs_top(
        item: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
        top: *mut fz_xml,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Extract and concatenate all plain text data from XML tree into a new string."]
    pub fn fz_new_text_from_xml(
        ctx: *mut fz_context,
        root: *mut fz_xml,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return a borrowed reference for the 'body' element of<br>the given DOM."]
    pub fn fz_dom_body(ctx: *mut fz_context, dom: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return a borrowed reference for the document \\(the top<br>level element\\) of the DOM."]
    pub fn fz_dom_document_element(ctx: *mut fz_context, dom: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Create an element of a given tag type for the given DOM.\n\nThe element is not linked into the DOM yet."]
    pub fn fz_dom_create_element(
        ctx: *mut fz_context,
        dom: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Create a text node for the given DOM.\n\nThe element is not linked into the DOM yet."]
    pub fn fz_dom_create_text_node(
        ctx: *mut fz_context,
        dom: *mut fz_xml,
        text: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Find the first element matching the requirements in a depth first traversal from elt.\n\nThe tagname must match tag, unless tag is `NULL`, when all tag names are considered to match.\n\nIf att is `NULL`, then all tags match.<br>Otherwise:<br>If match is `NULL`, then only nodes that have an att attribute match.<br>If match is non-`NULL`, then only nodes that have an att attribute that matches match match.\n\nReturns `NULL` \\(if no match found\\), or a borrowed reference to the first matching element."]
    pub fn fz_dom_find(
        ctx: *mut fz_context,
        elt: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Find the next element matching the requirements."]
    pub fn fz_dom_find_next(
        ctx: *mut fz_context,
        elt: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
        att: *const ::core::ffi::c_char,
        match_: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Insert an element as the last child of a parent, unlinking the<br>child from its current position if required."]
    pub fn fz_dom_append_child(ctx: *mut fz_context, parent: *mut fz_xml, child: *mut fz_xml);
}
unsafe extern "C" {
    #[doc = "Insert an element \\(new_elt\\), before another element \\(node\\),<br>unlinking the new_elt from its current position if required."]
    pub fn fz_dom_insert_before(ctx: *mut fz_context, node: *mut fz_xml, new_elt: *mut fz_xml);
}
unsafe extern "C" {
    #[doc = "Insert an element \\(new_elt\\), after another element \\(node\\),<br>unlinking the new_elt from its current position if required."]
    pub fn fz_dom_insert_after(ctx: *mut fz_context, node: *mut fz_xml, new_elt: *mut fz_xml);
}
unsafe extern "C" {
    #[doc = "Remove an element from the DOM. The element can be added back elsewhere<br>if required.\n\nNo reference counting changes for the element."]
    pub fn fz_dom_remove(ctx: *mut fz_context, elt: *mut fz_xml);
}
unsafe extern "C" {
    #[doc = "Clone an element \\(and its children\\).\n\nA borrowed reference to the clone is returned. The clone is not<br>yet linked into the DOM."]
    pub fn fz_dom_clone(ctx: *mut fz_context, elt: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return a borrowed reference to the first child of a node,<br>or `NULL` if there isn't one."]
    pub fn fz_dom_first_child(ctx: *mut fz_context, elt: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return a borrowed reference to the parent of a node,<br>or `NULL` if there isn't one."]
    pub fn fz_dom_parent(ctx: *mut fz_context, elt: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return a borrowed reference to the next sibling of a node,<br>or `NULL` if there isn't one."]
    pub fn fz_dom_next(ctx: *mut fz_context, elt: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Return a borrowed reference to the previous sibling of a node,<br>or `NULL` if there isn't one."]
    pub fn fz_dom_previous(ctx: *mut fz_context, elt: *mut fz_xml) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Add an attribute to an element.\n\nOwnership of att and value remain with the caller."]
    pub fn fz_dom_add_attribute(
        ctx: *mut fz_context,
        elt: *mut fz_xml,
        att: *const ::core::ffi::c_char,
        value: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Remove an attribute from an element."]
    pub fn fz_dom_remove_attribute(
        ctx: *mut fz_context,
        elt: *mut fz_xml,
        att: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Retrieve the value of a given attribute from a given element.\n\nReturns a borrowed pointer to the value or `NULL` if not found."]
    pub fn fz_dom_attribute(
        ctx: *mut fz_context,
        elt: *mut fz_xml,
        att: *const ::core::ffi::c_char,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Enumerate through the attributes of an element.\n\nCall with i=0,1,2,3... to enumerate attributes.\n\nOn return *att and the return value will be `NULL` if there are not<br>that many attributes to read. Otherwise, *att will be filled in<br>with a borrowed pointer to the attribute name, and the return<br>value will be a borrowed pointer to the value."]
    pub fn fz_dom_get_attribute(
        ctx: *mut fz_context,
        elt: *mut fz_xml,
        i: ::core::ffi::c_int,
        att: *mut *const ::core::ffi::c_char,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Make new xml dom root element."]
    pub fn fz_new_dom(ctx: *mut fz_context, tag: *const ::core::ffi::c_char) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Create a new dom node.\n\nThis will NOT be linked in yet."]
    pub fn fz_new_dom_node(
        ctx: *mut fz_context,
        dom: *mut fz_xml,
        tag: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Create a new dom text node.\n\nThis will NOT be linked in yet."]
    pub fn fz_new_dom_text_node(
        ctx: *mut fz_context,
        dom: *mut fz_xml,
        text: *const ::core::ffi::c_char,
    ) -> *mut fz_xml;
}
unsafe extern "C" {
    #[doc = "Write our xml structure out to an xml stream.\n\nProperly formatted XML is only allowed to have a single top-level node<br>under which everything must sit. Our structures allow for multiple<br>top level nodes. If required, we will output an extra 'ROOT' node<br>at the top so that the xml is well-formed.\n\nIf 'indented' is non-zero then additional whitespace will be added to<br>make the XML easier to read in a text editor. It will NOT be properly<br>compliant."]
    pub fn fz_write_xml(
        ctx: *mut fz_context,
        root: *mut fz_xml,
        out: *mut fz_output,
        indented: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "As for [`fz_write_xml`], but direct to a file."]
    pub fn fz_save_xml(
        ctx: *mut fz_context,
        root: *mut fz_xml,
        path: *const ::core::ffi::c_char,
        indented: ::core::ffi::c_int,
    );
}
pub const FZ_JSON_NULL: _bindgen_ty_5 = 0;
pub const FZ_JSON_TRUE: _bindgen_ty_5 = 1;
pub const FZ_JSON_FALSE: _bindgen_ty_5 = 2;
pub const FZ_JSON_NUMBER: _bindgen_ty_5 = 3;
pub const FZ_JSON_STRING: _bindgen_ty_5 = 4;
pub const FZ_JSON_ARRAY: _bindgen_ty_5 = 5;
pub const FZ_JSON_OBJECT: _bindgen_ty_5 = 6;
pub type _bindgen_ty_5 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_json {
    pub type_: ::core::ffi::c_int,
    pub u: fz_json__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_json__bindgen_ty_1 {
    pub number: f64,
    pub string: *const ::core::ffi::c_char,
    pub array: *mut fz_json_array,
    pub object: *mut fz_json_object,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_json__bindgen_ty_1"][::core::mem::size_of::<fz_json__bindgen_ty_1>() - 8usize];
    ["Alignment of fz_json__bindgen_ty_1"]
        [::core::mem::align_of::<fz_json__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_json__bindgen_ty_1::number"]
        [::core::mem::offset_of!(fz_json__bindgen_ty_1, number) - 0usize];
    ["Offset of field: fz_json__bindgen_ty_1::string"]
        [::core::mem::offset_of!(fz_json__bindgen_ty_1, string) - 0usize];
    ["Offset of field: fz_json__bindgen_ty_1::array"]
        [::core::mem::offset_of!(fz_json__bindgen_ty_1, array) - 0usize];
    ["Offset of field: fz_json__bindgen_ty_1::object"]
        [::core::mem::offset_of!(fz_json__bindgen_ty_1, object) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_json"][::core::mem::size_of::<fz_json>() - 16usize];
    ["Alignment of fz_json"][::core::mem::align_of::<fz_json>() - 8usize];
    ["Offset of field: fz_json::type_"][::core::mem::offset_of!(fz_json, type_) - 0usize];
    ["Offset of field: fz_json::u"][::core::mem::offset_of!(fz_json, u) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_json_array {
    pub value: *mut fz_json,
    pub next: *mut fz_json_array,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_json_array"][::core::mem::size_of::<fz_json_array>() - 16usize];
    ["Alignment of fz_json_array"][::core::mem::align_of::<fz_json_array>() - 8usize];
    ["Offset of field: fz_json_array::value"]
        [::core::mem::offset_of!(fz_json_array, value) - 0usize];
    ["Offset of field: fz_json_array::next"][::core::mem::offset_of!(fz_json_array, next) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_json_object {
    pub key: *const ::core::ffi::c_char,
    pub value: *mut fz_json,
    pub next: *mut fz_json_object,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_json_object"][::core::mem::size_of::<fz_json_object>() - 24usize];
    ["Alignment of fz_json_object"][::core::mem::align_of::<fz_json_object>() - 8usize];
    ["Offset of field: fz_json_object::key"][::core::mem::offset_of!(fz_json_object, key) - 0usize];
    ["Offset of field: fz_json_object::value"]
        [::core::mem::offset_of!(fz_json_object, value) - 8usize];
    ["Offset of field: fz_json_object::next"]
        [::core::mem::offset_of!(fz_json_object, next) - 16usize];
};
unsafe extern "C" {
    pub fn fz_parse_json(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        s: *const ::core::ffi::c_char,
    ) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_append_json(ctx: *mut fz_context, buf: *mut fz_buffer, value: *mut fz_json);
}
unsafe extern "C" {
    pub fn fz_write_json(ctx: *mut fz_context, out: *mut fz_output, value: *mut fz_json);
}
unsafe extern "C" {
    pub fn fz_json_new_null(ctx: *mut fz_context, pool: *mut fz_pool) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_json_new_boolean(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        x: ::core::ffi::c_int,
    ) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_json_new_number(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        number: f64,
    ) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_json_new_string(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        string: *const ::core::ffi::c_char,
    ) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_json_new_array(ctx: *mut fz_context, pool: *mut fz_pool) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_json_new_object(ctx: *mut fz_context, pool: *mut fz_pool) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_json_array_push(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        array: *mut fz_json,
        item: *mut fz_json,
    );
}
unsafe extern "C" {
    pub fn fz_json_object_set(
        ctx: *mut fz_context,
        pool: *mut fz_pool,
        object: *mut fz_json,
        key: *const ::core::ffi::c_char,
        item: *mut fz_json,
    );
}
unsafe extern "C" {
    pub fn fz_json_is_null(ctx: *mut fz_context, json: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_is_boolean(ctx: *mut fz_context, json: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_is_number(ctx: *mut fz_context, json: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_is_string(ctx: *mut fz_context, json: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_is_array(ctx: *mut fz_context, json: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_is_object(ctx: *mut fz_context, json: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_to_boolean(ctx: *mut fz_context, json: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_to_number(ctx: *mut fz_context, json: *mut fz_json) -> f64;
}
unsafe extern "C" {
    pub fn fz_json_to_string(
        ctx: *mut fz_context,
        json: *mut fz_json,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_json_array_length(ctx: *mut fz_context, array: *mut fz_json) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_json_array_get(
        ctx: *mut fz_context,
        array: *mut fz_json,
        ix: ::core::ffi::c_int,
    ) -> *mut fz_json;
}
unsafe extern "C" {
    pub fn fz_json_object_get(
        ctx: *mut fz_context,
        object: *mut fz_json,
        key: *const ::core::ffi::c_char,
    ) -> *mut fz_json;
}
#[doc = "Locations within the document are referred to in terms of<br>chapter and page, rather than just a page number. For some<br>documents \\(such as epub documents with large numbers of pages<br>broken into many chapters\\) this can make navigation much faster<br>as only the required chapter needs to be decoded at a time."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_location {
    pub chapter: ::core::ffi::c_int,
    pub page: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_location"][::core::mem::size_of::<fz_location>() - 8usize];
    ["Alignment of fz_location"][::core::mem::align_of::<fz_location>() - 4usize];
    ["Offset of field: fz_location::chapter"]
        [::core::mem::offset_of!(fz_location, chapter) - 0usize];
    ["Offset of field: fz_location::page"][::core::mem::offset_of!(fz_location, page) - 4usize];
};
#[doc = "Function type for a function to drop a storable object.\n\nObjects within the store are identified by type by comparing<br>their drop_fn pointers."]
pub type fz_store_drop_fn =
    ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_storable)>;
#[doc = "Function type for a function to check whether a storable<br>object can be dropped at the moment.\n\nReturn 0 for 'cannot be dropped', 1 otherwise."]
pub type fz_store_droppable_fn = ::core::option::Option<
    unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_storable) -> ::core::ffi::c_int,
>;
#[doc = "Any storable object should include an [`fz_storable`] structure<br>at the start \\(by convention at least\\) of their structure.<br>\\(Unless it starts with an [`fz_key_storable`], see below\\)."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_storable {
    pub refs: ::core::ffi::c_int,
    pub drop: fz_store_drop_fn,
    pub droppable: fz_store_droppable_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_storable"][::core::mem::size_of::<fz_storable>() - 24usize];
    ["Alignment of fz_storable"][::core::mem::align_of::<fz_storable>() - 8usize];
    ["Offset of field: fz_storable::refs"][::core::mem::offset_of!(fz_storable, refs) - 0usize];
    ["Offset of field: fz_storable::drop"][::core::mem::offset_of!(fz_storable, drop) - 8usize];
    ["Offset of field: fz_storable::droppable"]
        [::core::mem::offset_of!(fz_storable, droppable) - 16usize];
};
#[doc = "Any storable object that can appear in the key of another<br>storable object should include an [`fz_key_storable`] structure<br>at the start \\(by convention at least\\) of their structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_key_storable {
    pub storable: fz_storable,
    pub store_key_refs: ::core::ffi::c_short,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_key_storable"][::core::mem::size_of::<fz_key_storable>() - 32usize];
    ["Alignment of fz_key_storable"][::core::mem::align_of::<fz_key_storable>() - 8usize];
    ["Offset of field: fz_key_storable::storable"]
        [::core::mem::offset_of!(fz_key_storable, storable) - 0usize];
    ["Offset of field: fz_key_storable::store_key_refs"]
        [::core::mem::offset_of!(fz_key_storable, store_key_refs) - 24usize];
};
unsafe extern "C" {
    #[doc = "Increment the reference count for a storable object.<br>Returns the same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_storable(
        arg1: *mut fz_context,
        arg2: *const fz_storable,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for a storable object. When the<br>reference count hits zero, the drop function for that object<br>is called to free the object.\n\nNever throws exceptions."]
    pub fn fz_drop_storable(arg1: *mut fz_context, arg2: *const fz_storable);
}
unsafe extern "C" {
    #[doc = "Increment the \\(normal\\) reference count for a key storable<br>object. Returns the same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_key_storable(
        arg1: *mut fz_context,
        arg2: *const fz_key_storable,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Decrement the \\(normal\\) reference count for a storable object.<br>When the total reference count hits zero, the drop function for<br>that object is called to free the object.\n\nNever throws exceptions."]
    pub fn fz_drop_key_storable(arg1: *mut fz_context, arg2: *const fz_key_storable);
}
unsafe extern "C" {
    #[doc = "Increment the \\(key\\) reference count for a key storable<br>object. Returns the same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_key_storable_key(
        arg1: *mut fz_context,
        arg2: *const fz_key_storable,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Decrement the \\(key\\) reference count for a storable object.<br>When the total reference count hits zero, the drop function for<br>that object is called to free the object.\n\nNever throws exceptions."]
    pub fn fz_drop_key_storable_key(arg1: *mut fz_context, arg2: *const fz_key_storable);
}
#[doc = "The store can be seen as a dictionary that maps keys to<br>[`fz_storable`] values. In order to allow keys of different types to<br>be stored, we have a structure full of functions for each key<br>'type'; this [`fz_store_type`] pointer is stored with each key, and<br>tells the store how to perform certain operations \\(like taking/<br>dropping a reference, comparing two keys, outputting details for<br>debugging etc\\).\n\nThe store uses a hash table internally for speed where possible.<br>In order for this to work, we need a mechanism for turning a<br>generic 'key' into 'a hashable string'. For this purpose the<br>type structure contains a make_hash_key function pointer that<br>maps from a void * to a [`fz_store_hash`] structure. If<br>make_hash_key function returns 0, then the key is determined not<br>to be hashable, and the value is not stored in the hash table.\n\nSome objects can be used both as values within the store, and as<br>a component of keys within the store. We refer to these objects<br>as \"key storable\" objects. In this case, we need to take<br>additional care to ensure that we do not end up keeping an item<br>within the store, purely because its value is referred to by<br>another key in the store.\n\nAn example of this are [`fz_image`](fz_image)s in PDF files. Each [`fz_image`] is<br>placed into the\tstore to enable it to be easily reused. When the<br>image is rendered, a pixmap is generated from the image, and the<br>pixmap is placed into the store so it can be reused on<br>subsequent renders. The image forms part of the key for the<br>pixmap.\n\nWhen we close the pdf document \\(and any associated pages/display<br>lists etc\\), we drop the images from the store. This may leave us<br>in the position of the images having non-zero reference counts<br>purely because they are used as part of the keys for the<br>pixmaps.\n\nWe therefore use special reference counting functions to keep<br>track of these \"key storable\" items, and hence store the number<br>of references to these items that are used in keys.\n\nWhen the number of references to an object == the number of<br>references to an object from keys in the store, we know that we<br>can remove all the items which have that object as part of the<br>key. This is done by running a pass over the store, 'reaping'<br>those items.\n\nReap passes are slower than we would like as they touch every<br>item in the store. We therefore provide a way to 'batch' such<br>reap passes together, using [`fz_defer_reap_start`]/<br>[`fz_defer_reap_end`] to bracket a region in which many may be<br>triggered."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_store_hash {
    pub drop: fz_store_drop_fn,
    pub u: fz_store_hash__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_store_hash__bindgen_ty_1 {
    pub pi: fz_store_hash__bindgen_ty_1__bindgen_ty_1,
    pub pir: fz_store_hash__bindgen_ty_1__bindgen_ty_2,
    pub im: fz_store_hash__bindgen_ty_1__bindgen_ty_3,
    pub link: fz_store_hash__bindgen_ty_1__bindgen_ty_4,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_store_hash__bindgen_ty_1__bindgen_ty_1 {
    pub ptr: *const ::core::ffi::c_void,
    pub i: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_store_hash__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::size_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_1>() - 16usize];
    ["Alignment of fz_store_hash__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::align_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_1::ptr"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_1, ptr) - 0usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_1::i"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_1, i) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_store_hash__bindgen_ty_1__bindgen_ty_2 {
    pub ptr: *const ::core::ffi::c_void,
    pub i: ::core::ffi::c_int,
    pub r: fz_irect,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_store_hash__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::size_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_2>() - 32usize];
    ["Alignment of fz_store_hash__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::align_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_2>() - 8usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_2::ptr"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_2, ptr) - 0usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_2::i"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_2, i) - 8usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_2::r"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_2, r) - 12usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_store_hash__bindgen_ty_1__bindgen_ty_3 {
    pub id: ::core::ffi::c_int,
    pub has_shape: ::core::ffi::c_char,
    pub has_group_alpha: ::core::ffi::c_char,
    pub m: [f32; 4usize],
    pub ptr: *mut ::core::ffi::c_void,
    pub doc_id: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_store_hash__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::size_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_3>() - 40usize];
    ["Alignment of fz_store_hash__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::align_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_3>() - 8usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_3::id"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_3, id) - 0usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_3::has_shape"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_3, has_shape) - 4usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_3::has_group_alpha"][::core::mem::offset_of!(
        fz_store_hash__bindgen_ty_1__bindgen_ty_3,
        has_group_alpha
    ) - 5usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_3::m"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_3, m) - 8usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_3::ptr"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_3, ptr) - 24usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_3::doc_id"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_3, doc_id) - 32usize];
};
#[repr(C)]
#[repr(align(4))]
#[derive(Debug, Copy, Clone)]
pub struct fz_store_hash__bindgen_ty_1__bindgen_ty_4 {
    pub src_md5: [::core::ffi::c_uchar; 16usize],
    pub dst_md5: [::core::ffi::c_uchar; 16usize],
    pub _bitfield_align_1: [u8; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
    pub __bindgen_padding_0: u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_store_hash__bindgen_ty_1__bindgen_ty_4"]
        [::core::mem::size_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_4>() - 36usize];
    ["Alignment of fz_store_hash__bindgen_ty_1__bindgen_ty_4"]
        [::core::mem::align_of::<fz_store_hash__bindgen_ty_1__bindgen_ty_4>() - 4usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_4::src_md5"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_4, src_md5) - 0usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1__bindgen_ty_4::dst_md5"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1__bindgen_ty_4, dst_md5) - 16usize];
};
impl fz_store_hash__bindgen_ty_1__bindgen_ty_4 {
    #[inline]
    pub fn ri(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) }
    }
    #[inline]
    pub fn set_ri(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn ri_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                2u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_ri_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                2u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn bp(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_bp(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(2usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn bp_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                2usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_bp_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                2usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn format(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_format(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(3usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn format_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                3usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_format_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                3usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn proof(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_proof(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(4usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn proof_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                4usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_proof_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                4usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn src_extras(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 5u8) as u32) }
    }
    #[inline]
    pub fn set_src_extras(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(5usize, 5u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn src_extras_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                5usize,
                5u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_src_extras_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                5usize,
                5u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn dst_extras(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 5u8) as u32) }
    }
    #[inline]
    pub fn set_dst_extras(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(10usize, 5u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn dst_extras_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                10usize,
                5u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_dst_extras_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                10usize,
                5u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn copy_spots(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_copy_spots(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(15usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn copy_spots_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                15usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_copy_spots_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                15usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn bgr(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_bgr(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(16usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn bgr_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                16usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_bgr_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                16usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        ri: ::core::ffi::c_uint,
        bp: ::core::ffi::c_uint,
        format: ::core::ffi::c_uint,
        proof: ::core::ffi::c_uint,
        src_extras: ::core::ffi::c_uint,
        dst_extras: ::core::ffi::c_uint,
        copy_spots: ::core::ffi::c_uint,
        bgr: ::core::ffi::c_uint,
    ) -> __BindgenBitfieldUnit<[u8; 3usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 2u8, {
            let ri: u32 = unsafe { ::core::mem::transmute(ri) };
            ri as u64
        });
        __bindgen_bitfield_unit.set(2usize, 1u8, {
            let bp: u32 = unsafe { ::core::mem::transmute(bp) };
            bp as u64
        });
        __bindgen_bitfield_unit.set(3usize, 1u8, {
            let format: u32 = unsafe { ::core::mem::transmute(format) };
            format as u64
        });
        __bindgen_bitfield_unit.set(4usize, 1u8, {
            let proof: u32 = unsafe { ::core::mem::transmute(proof) };
            proof as u64
        });
        __bindgen_bitfield_unit.set(5usize, 5u8, {
            let src_extras: u32 = unsafe { ::core::mem::transmute(src_extras) };
            src_extras as u64
        });
        __bindgen_bitfield_unit.set(10usize, 5u8, {
            let dst_extras: u32 = unsafe { ::core::mem::transmute(dst_extras) };
            dst_extras as u64
        });
        __bindgen_bitfield_unit.set(15usize, 1u8, {
            let copy_spots: u32 = unsafe { ::core::mem::transmute(copy_spots) };
            copy_spots as u64
        });
        __bindgen_bitfield_unit.set(16usize, 1u8, {
            let bgr: u32 = unsafe { ::core::mem::transmute(bgr) };
            bgr as u64
        });
        __bindgen_bitfield_unit
    }
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_store_hash__bindgen_ty_1"]
        [::core::mem::size_of::<fz_store_hash__bindgen_ty_1>() - 40usize];
    ["Alignment of fz_store_hash__bindgen_ty_1"]
        [::core::mem::align_of::<fz_store_hash__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1::pi"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1, pi) - 0usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1::pir"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1, pir) - 0usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1::im"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1, im) - 0usize];
    ["Offset of field: fz_store_hash__bindgen_ty_1::link"]
        [::core::mem::offset_of!(fz_store_hash__bindgen_ty_1, link) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_store_hash"][::core::mem::size_of::<fz_store_hash>() - 48usize];
    ["Alignment of fz_store_hash"][::core::mem::align_of::<fz_store_hash>() - 8usize];
    ["Offset of field: fz_store_hash::drop"][::core::mem::offset_of!(fz_store_hash, drop) - 0usize];
    ["Offset of field: fz_store_hash::u"][::core::mem::offset_of!(fz_store_hash, u) - 8usize];
};
#[doc = "Every type of object to be placed into the store defines an<br>[`fz_store_type`]. This contains the pointers to functions to<br>make hashes, manipulate keys, and check for needing reaping."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_store_type {
    pub name: *const ::core::ffi::c_char,
    pub make_hash_key: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            hash: *mut fz_store_hash,
            key: *mut ::core::ffi::c_void,
        ) -> ::core::ffi::c_int,
    >,
    pub keep_key: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            key: *mut ::core::ffi::c_void,
        ) -> *mut ::core::ffi::c_void,
    >,
    pub drop_key: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, key: *mut ::core::ffi::c_void),
    >,
    pub cmp_key: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            a: *mut ::core::ffi::c_void,
            b: *mut ::core::ffi::c_void,
        ) -> ::core::ffi::c_int,
    >,
    pub format_key: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            buf: *mut ::core::ffi::c_char,
            size: usize,
            key: *mut ::core::ffi::c_void,
        ),
    >,
    pub needs_reap: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            key: *mut ::core::ffi::c_void,
        ) -> ::core::ffi::c_int,
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_store_type"][::core::mem::size_of::<fz_store_type>() - 56usize];
    ["Alignment of fz_store_type"][::core::mem::align_of::<fz_store_type>() - 8usize];
    ["Offset of field: fz_store_type::name"][::core::mem::offset_of!(fz_store_type, name) - 0usize];
    ["Offset of field: fz_store_type::make_hash_key"]
        [::core::mem::offset_of!(fz_store_type, make_hash_key) - 8usize];
    ["Offset of field: fz_store_type::keep_key"]
        [::core::mem::offset_of!(fz_store_type, keep_key) - 16usize];
    ["Offset of field: fz_store_type::drop_key"]
        [::core::mem::offset_of!(fz_store_type, drop_key) - 24usize];
    ["Offset of field: fz_store_type::cmp_key"]
        [::core::mem::offset_of!(fz_store_type, cmp_key) - 32usize];
    ["Offset of field: fz_store_type::format_key"]
        [::core::mem::offset_of!(fz_store_type, format_key) - 40usize];
    ["Offset of field: fz_store_type::needs_reap"]
        [::core::mem::offset_of!(fz_store_type, needs_reap) - 48usize];
};
unsafe extern "C" {
    #[doc = "Create a new store inside the context\n\n`max`: The maximum size \\(in bytes\\) that the store is allowed to<br>grow to. [`FZ_STORE_UNLIMITED`] means no limit."]
    pub fn fz_new_store_context(ctx: *mut fz_context, max: usize);
}
unsafe extern "C" {
    #[doc = "Increment the reference count for the store context. Returns<br>the same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_store_context(ctx: *mut fz_context) -> *mut fz_store;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for the store context. When the<br>reference count hits zero, the store context is freed.\n\nNever throws exceptions."]
    pub fn fz_drop_store_context(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Add an item to the store.\n\nAdd an item into the store, returning `NULL` for success. If an<br>item with the same key is found in the store, then our item will<br>not be inserted, and the function will return a pointer to that<br>value instead. This function takes its own reference to val, as<br>required \\(i.e. the caller maintains ownership of its own<br>reference\\).\n\n`key`: The key used to index the item.\n\n`val`: The value to store.\n\n`itemsize`: The size in bytes of the value \\(as counted towards the<br>store size\\).\n\n`type`: Functions used to manipulate the key."]
    pub fn fz_store_item(
        ctx: *mut fz_context,
        key: *mut ::core::ffi::c_void,
        val: *mut ::core::ffi::c_void,
        itemsize: usize,
        type_: *const fz_store_type,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Find an item within the store.\n\n`drop`: The function used to free the value \\(to ensure we get a<br>value of the correct type\\).\n\n`key`: The key used to index the item.\n\n`type`: Functions used to manipulate the key.\n\nReturns `NULL` for not found, otherwise returns a pointer to the<br>value indexed by key to which a reference has been taken."]
    pub fn fz_find_item(
        ctx: *mut fz_context,
        drop: fz_store_drop_fn,
        key: *mut ::core::ffi::c_void,
        type_: *const fz_store_type,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Remove an item from the store.\n\nIf an item indexed by the given key exists in the store, remove<br>it.\n\n`drop`: The function used to free the value \\(to ensure we get a<br>value of the correct type\\).\n\n`key`: The key used to find the item to remove.\n\n`type`: Functions used to manipulate the key."]
    pub fn fz_remove_item(
        ctx: *mut fz_context,
        drop: fz_store_drop_fn,
        key: *mut ::core::ffi::c_void,
        type_: *const fz_store_type,
    );
}
unsafe extern "C" {
    #[doc = "Evict every item from the store."]
    pub fn fz_empty_store(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Internal function used as part of the scavenging<br>allocator; when we fail to allocate memory, before returning a<br>failure to the caller, we try to scavenge space within the store<br>by evicting at least 'size' bytes. The allocator then retries.\n\n`size`: The number of bytes we are trying to have free.\n\n`phase`: What phase of the scavenge we are in. Updated on exit.\n\nReturns non zero if we managed to free any memory."]
    pub fn fz_store_scavenge(
        ctx: *mut fz_context,
        size: usize,
        phase: *mut ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "External function for callers to use<br>to scavenge while trying allocations.\n\n`size`: The number of bytes we are trying to have free.\n\n`phase`: What phase of the scavenge we are in. Updated on exit.\n\nReturns non zero if we managed to free any memory."]
    pub fn fz_store_scavenge_external(
        ctx: *mut fz_context,
        size: usize,
        phase: *mut ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Evict items from the store until the total size of<br>the objects in the store is reduced to a given percentage of its<br>current size.\n\n`percent`: %age of current size to reduce the store to.\n\nReturns non zero if we managed to free enough memory, zero<br>otherwise."]
    pub fn fz_shrink_store(
        ctx: *mut fz_context,
        percent: ::core::ffi::c_uint,
    ) -> ::core::ffi::c_int;
}
#[doc = "Callback function called by [`fz_filter_store`] on every item within<br>the store.\n\nReturn 1 to drop the item from the store, 0 to retain."]
pub type fz_store_filter_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        arg: *mut ::core::ffi::c_void,
        key: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int,
>;
unsafe extern "C" {
    #[doc = "Filter every element in the store with a matching type with the<br>given function.\n\nIf the function returns 1 for an element, drop the element."]
    pub fn fz_filter_store(
        ctx: *mut fz_context,
        fn_: fz_store_filter_fn,
        arg: *mut ::core::ffi::c_void,
        type_: *const fz_store_type,
    );
}
unsafe extern "C" {
    #[doc = "Filter the store and throw away any stored tiles drawn for a<br>given document."]
    pub fn fz_drop_drawn_tiles_for_document(ctx: *mut fz_context, doc: *mut fz_document);
}
unsafe extern "C" {
    #[doc = "Output debugging information for the current state of the store<br>to the given output channel."]
    pub fn fz_debug_store(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Increment the defer reap count.\n\nNo reap operations will take place \\(except for those<br>triggered by an immediate failed malloc\\) until the<br>defer reap count returns to 0.\n\nCall this at the start of a process during which you<br>potentially might drop many reapable objects.\n\nIt is vital that every [`fz_defer_reap_start`] is matched<br>by a [`fz_defer_reap_end`] call."]
    pub fn fz_defer_reap_start(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Decrement the defer reap count.\n\nIf the defer reap count returns to 0, and the store<br>has reapable objects in, a reap pass will begin.\n\nCall this at the end of a process during which you<br>potentially might drop many reapable objects.\n\nIt is vital that every [`fz_defer_reap_start`] is matched<br>by a [`fz_defer_reap_end`] call."]
    pub fn fz_defer_reap_end(ctx: *mut fz_context);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_icc_profile {
    _unused: [u8; 0],
}
pub const FZ_RI_PERCEPTUAL: _bindgen_ty_6 = 0;
pub const FZ_RI_RELATIVE_COLORIMETRIC: _bindgen_ty_6 = 1;
pub const FZ_RI_SATURATION: _bindgen_ty_6 = 2;
pub const FZ_RI_ABSOLUTE_COLORIMETRIC: _bindgen_ty_6 = 3;
pub type _bindgen_ty_6 = ::core::ffi::c_uint;
pub const FZ_RI_IN_SOFTMASK: _bindgen_ty_7 = 128;
pub type _bindgen_ty_7 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_color_params {
    pub ri: u8,
    pub bp: u8,
    pub op: u8,
    pub opm: u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_color_params"][::core::mem::size_of::<fz_color_params>() - 4usize];
    ["Alignment of fz_color_params"][::core::mem::align_of::<fz_color_params>() - 1usize];
    ["Offset of field: fz_color_params::ri"][::core::mem::offset_of!(fz_color_params, ri) - 0usize];
    ["Offset of field: fz_color_params::bp"][::core::mem::offset_of!(fz_color_params, bp) - 1usize];
    ["Offset of field: fz_color_params::op"][::core::mem::offset_of!(fz_color_params, op) - 2usize];
    ["Offset of field: fz_color_params::opm"]
        [::core::mem::offset_of!(fz_color_params, opm) - 3usize];
};
unsafe extern "C" {
    pub static fz_default_color_params: fz_color_params;
}
unsafe extern "C" {
    #[doc = "Map from \\(case sensitive\\) rendering intent string to enumeration<br>value."]
    pub fn fz_lookup_rendering_intent(name: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Map from enumerated rendering intent to string.\n\nThe returned string is static and therefore must not be freed."]
    pub fn fz_rendering_intent_name(ri: ::core::ffi::c_int) -> *const ::core::ffi::c_char;
}
pub const FZ_MAX_COLORS: _bindgen_ty_8 = 32;
#[doc = "The maximum number of colorants available in any given<br>color/colorspace \\(not including alpha\\).\n\nChanging this value will alter the amount of memory being used<br>\\(both stack and heap space\\), but not hugely. Speed should<br>\\(largely\\) be determined by the number of colors actually used."]
pub type _bindgen_ty_8 = ::core::ffi::c_uint;
pub const FZ_COLORSPACE_NONE: fz_colorspace_type = 0;
pub const FZ_COLORSPACE_GRAY: fz_colorspace_type = 1;
pub const FZ_COLORSPACE_RGB: fz_colorspace_type = 2;
pub const FZ_COLORSPACE_BGR: fz_colorspace_type = 3;
pub const FZ_COLORSPACE_CMYK: fz_colorspace_type = 4;
pub const FZ_COLORSPACE_LAB: fz_colorspace_type = 5;
pub const FZ_COLORSPACE_INDEXED: fz_colorspace_type = 6;
pub const FZ_COLORSPACE_SEPARATION: fz_colorspace_type = 7;
pub type fz_colorspace_type = ::core::ffi::c_uint;
pub const FZ_COLORSPACE_IS_DEVICE: _bindgen_ty_9 = 1;
pub const FZ_COLORSPACE_IS_ICC: _bindgen_ty_9 = 2;
pub const FZ_COLORSPACE_HAS_CMYK: _bindgen_ty_9 = 4;
pub const FZ_COLORSPACE_HAS_SPOTS: _bindgen_ty_9 = 8;
pub const FZ_COLORSPACE_HAS_CMYK_AND_SPOTS: _bindgen_ty_9 = 12;
pub type _bindgen_ty_9 = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Creates a new colorspace instance and returns a reference.\n\nNo internal checking is done that the colorspace type \\(e.g.<br>CMYK\\) matches with the flags \\(e.g. [`FZ_COLORSPACE_HAS_CMYK`]\\) or<br>colorant count \\(n\\) or name.\n\nThe reference should be dropped when it is finished with.\n\nColorspaces are immutable once created \\(with the exception of<br>setting up colorant names for separation spaces\\)."]
    pub fn fz_new_colorspace(
        ctx: *mut fz_context,
        type_: fz_colorspace_type,
        flags: ::core::ffi::c_int,
        n: ::core::ffi::c_int,
        name: *const ::core::ffi::c_char,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Increment the reference count for the colorspace.\n\nReturns the same pointer. Never throws an exception."]
    pub fn fz_keep_colorspace(
        ctx: *mut fz_context,
        colorspace: *mut fz_colorspace,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Drops a reference to the colorspace.\n\nWhen the reference count reaches zero, the colorspace is<br>destroyed."]
    pub fn fz_drop_colorspace(ctx: *mut fz_context, colorspace: *mut fz_colorspace);
}
unsafe extern "C" {
    #[doc = "Create an indexed colorspace.\n\nThe supplied lookup table is high palette entries long. Each<br>entry is n bytes long, where n is given by the number of<br>colorants in the base colorspace, one byte per colorant.\n\nOwnership of lookup is passed it; it will be freed on<br>destruction, so must be heap allocated.\n\nThe colorspace will keep an additional reference to the base<br>colorspace that will be dropped on destruction.\n\nThe returned reference should be dropped when it is finished<br>with.\n\nColorspaces are immutable once created."]
    pub fn fz_new_indexed_colorspace(
        ctx: *mut fz_context,
        base: *mut fz_colorspace,
        high: ::core::ffi::c_int,
        lookup: *mut ::core::ffi::c_uchar,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Create a colorspace from an ICC profile supplied in buf.\n\nLimited checking is done to ensure that the colorspace type is<br>appropriate for the supplied ICC profile.\n\nAn additional reference is taken to buf, which will be dropped<br>on destruction. Ownership is NOT passed in.\n\nThe returned reference should be dropped when it is finished<br>with.\n\nColorspaces are immutable once created."]
    pub fn fz_new_icc_colorspace(
        ctx: *mut fz_context,
        type_: fz_colorspace_type,
        flags: ::core::ffi::c_int,
        name: *const ::core::ffi::c_char,
        buf: *mut fz_buffer,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Create a calibrated gray colorspace.\n\nThe returned reference should be dropped when it is finished<br>with.\n\nColorspaces are immutable once created."]
    pub fn fz_new_cal_gray_colorspace(
        ctx: *mut fz_context,
        wp: *mut f32,
        bp: *mut f32,
        gamma: f32,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Create a calibrated rgb colorspace.\n\nThe returned reference should be dropped when it is finished<br>with.\n\nColorspaces are immutable once created."]
    pub fn fz_new_cal_rgb_colorspace(
        ctx: *mut fz_context,
        wp: *mut f32,
        bp: *mut f32,
        gamma: *mut f32,
        matrix: *mut f32,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Query the type of colorspace."]
    pub fn fz_colorspace_type(ctx: *mut fz_context, cs: *mut fz_colorspace) -> fz_colorspace_type;
}
unsafe extern "C" {
    #[doc = "Query the name of a colorspace.\n\nThe returned string has the same lifespan as the colorspace<br>does. Caller should not free it."]
    pub fn fz_colorspace_name(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Query the number of colorants in a colorspace."]
    pub fn fz_colorspace_n(ctx: *mut fz_context, cs: *mut fz_colorspace) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "True for CMYK, Separation and DeviceN colorspaces."]
    pub fn fz_colorspace_is_subtractive(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "True if DeviceN color space has only colorants from the CMYK set."]
    pub fn fz_colorspace_device_n_has_only_cmyk(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "True if DeviceN color space has cyan magenta yellow or black as<br>one of its colorants."]
    pub fn fz_colorspace_device_n_has_cmyk(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Tests for particular types of colorspaces"]
    pub fn fz_colorspace_is_gray(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_rgb(ctx: *mut fz_context, cs: *mut fz_colorspace)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_cmyk(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_lab(ctx: *mut fz_context, cs: *mut fz_colorspace)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_indexed(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_icc(ctx: *mut fz_context, cs: *mut fz_colorspace)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_device_n(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_device(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_device_gray(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_device_cmyk(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_colorspace_is_lab_icc(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get checksum of underlying ICC profile."]
    pub fn fz_colorspace_digest(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
        digest: *mut ::core::ffi::c_uchar,
    );
}
unsafe extern "C" {
    #[doc = "Check to see that a colorspace is appropriate to be used as<br>a blending space \\(i.e. only grey, rgb or cmyk\\)."]
    pub fn fz_is_valid_blend_colorspace(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get the 'base' colorspace for a colorspace.\n\nFor indexed colorspaces, this is the colorspace the index<br>decodes into. For all other colorspaces, it is the colorspace<br>itself.\n\nThe returned colorspace is 'borrowed' \\(i.e. no additional<br>references are taken or dropped\\)."]
    pub fn fz_base_colorspace(ctx: *mut fz_context, cs: *mut fz_colorspace) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Retrieve global default colorspaces.\n\nThese return borrowed references that should not be dropped,<br>unless they are kept first."]
    pub fn fz_device_gray(ctx: *mut fz_context) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn fz_device_rgb(ctx: *mut fz_context) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn fz_device_bgr(ctx: *mut fz_context) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn fz_device_cmyk(ctx: *mut fz_context) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn fz_device_lab(ctx: *mut fz_context) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Assign a name for a given colorant in a colorspace.\n\nUsed while initially setting up a colorspace. The string is<br>copied into local storage, so need not be retained by the<br>caller."]
    pub fn fz_colorspace_name_colorant(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
        n: ::core::ffi::c_int,
        name: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Retrieve a the name for a colorant.\n\nReturns a pointer with the same lifespan as the colorspace."]
    pub fn fz_colorspace_colorant(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
        n: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Clamp the samples in a color to the correct ranges for a<br>given colorspace."]
    pub fn fz_clamp_color(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
        in_: *const f32,
        out: *mut f32,
    );
}
unsafe extern "C" {
    #[doc = "Convert color values sv from colorspace ss into colorvalues dv<br>for colorspace ds, via an optional intervening space is,<br>respecting the given color_params."]
    pub fn fz_convert_color(
        ctx: *mut fz_context,
        ss: *mut fz_colorspace,
        sv: *const f32,
        ds: *mut fz_colorspace,
        dv: *mut f32,
        is: *mut fz_colorspace,
        params: fz_color_params,
    );
}
#[doc = "Structure to hold default colorspaces."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_default_colorspaces {
    pub refs: ::core::ffi::c_int,
    pub gray: *mut fz_colorspace,
    pub rgb: *mut fz_colorspace,
    pub cmyk: *mut fz_colorspace,
    pub oi: *mut fz_colorspace,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_default_colorspaces"][::core::mem::size_of::<fz_default_colorspaces>() - 40usize];
    ["Alignment of fz_default_colorspaces"]
        [::core::mem::align_of::<fz_default_colorspaces>() - 8usize];
    ["Offset of field: fz_default_colorspaces::refs"]
        [::core::mem::offset_of!(fz_default_colorspaces, refs) - 0usize];
    ["Offset of field: fz_default_colorspaces::gray"]
        [::core::mem::offset_of!(fz_default_colorspaces, gray) - 8usize];
    ["Offset of field: fz_default_colorspaces::rgb"]
        [::core::mem::offset_of!(fz_default_colorspaces, rgb) - 16usize];
    ["Offset of field: fz_default_colorspaces::cmyk"]
        [::core::mem::offset_of!(fz_default_colorspaces, cmyk) - 24usize];
    ["Offset of field: fz_default_colorspaces::oi"]
        [::core::mem::offset_of!(fz_default_colorspaces, oi) - 32usize];
};
unsafe extern "C" {
    #[doc = "Create a new default colorspace structure with values inherited<br>from the context, and return a reference to it.\n\nThese can be overridden using [`fz_set_default_xxxx`].\n\nThese should not be overridden while more than one caller has<br>the reference for fear of race conditions.\n\nThe caller should drop this reference once finished with it."]
    pub fn fz_new_default_colorspaces(ctx: *mut fz_context) -> *mut fz_default_colorspaces;
}
unsafe extern "C" {
    #[doc = "Keep an additional reference to the default colorspaces<br>structure.\n\nNever throws exceptions."]
    pub fn fz_keep_default_colorspaces(
        ctx: *mut fz_context,
        default_cs: *mut fz_default_colorspaces,
    ) -> *mut fz_default_colorspaces;
}
unsafe extern "C" {
    #[doc = "Drop a reference to the default colorspaces structure. When the<br>reference count reaches 0, the references it holds internally<br>to the underlying colorspaces will be dropped, and the structure<br>will be destroyed.\n\nNever throws exceptions."]
    pub fn fz_drop_default_colorspaces(
        ctx: *mut fz_context,
        default_cs: *mut fz_default_colorspaces,
    );
}
unsafe extern "C" {
    #[doc = "Returns a reference to a newly cloned default colorspaces<br>structure.\n\nThe new clone may safely be altered without fear of race<br>conditions as the caller is the only reference holder."]
    pub fn fz_clone_default_colorspaces(
        ctx: *mut fz_context,
        base: *mut fz_default_colorspaces,
    ) -> *mut fz_default_colorspaces;
}
unsafe extern "C" {
    #[doc = "Retrieve default colorspaces \\(typically page local\\).\n\nIf default_cs is non `NULL`, the default is retrieved from there,<br>otherwise the global default is retrieved.\n\nThese return borrowed references that should not be dropped,<br>unless they are kept first."]
    pub fn fz_default_gray(
        ctx: *mut fz_context,
        default_cs: *const fz_default_colorspaces,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn fz_default_rgb(
        ctx: *mut fz_context,
        default_cs: *const fz_default_colorspaces,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn fz_default_cmyk(
        ctx: *mut fz_context,
        default_cs: *const fz_default_colorspaces,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn fz_default_output_intent(
        ctx: *mut fz_context,
        default_cs: *const fz_default_colorspaces,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Set new defaults within the default colorspace structure.\n\nNew references are taken to the new default, and references to<br>the old defaults dropped.\n\nNever throws exceptions."]
    pub fn fz_set_default_gray(
        ctx: *mut fz_context,
        default_cs: *mut fz_default_colorspaces,
        cs: *mut fz_colorspace,
    );
}
unsafe extern "C" {
    pub fn fz_set_default_rgb(
        ctx: *mut fz_context,
        default_cs: *mut fz_default_colorspaces,
        cs: *mut fz_colorspace,
    );
}
unsafe extern "C" {
    pub fn fz_set_default_cmyk(
        ctx: *mut fz_context,
        default_cs: *mut fz_default_colorspaces,
        cs: *mut fz_colorspace,
    );
}
unsafe extern "C" {
    pub fn fz_set_default_output_intent(
        ctx: *mut fz_context,
        default_cs: *mut fz_default_colorspaces,
        cs: *mut fz_colorspace,
    );
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_colorspace {
    pub key_storable: fz_key_storable,
    pub type_: fz_colorspace_type,
    pub flags: ::core::ffi::c_int,
    pub n: ::core::ffi::c_int,
    pub name: *mut ::core::ffi::c_char,
    pub u: fz_colorspace__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_colorspace__bindgen_ty_1 {
    pub icc: fz_colorspace__bindgen_ty_1__bindgen_ty_1,
    pub indexed: fz_colorspace__bindgen_ty_1__bindgen_ty_2,
    pub separation: fz_colorspace__bindgen_ty_1__bindgen_ty_3,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_colorspace__bindgen_ty_1__bindgen_ty_1 {
    pub buffer: *mut fz_buffer,
    pub md5: [::core::ffi::c_uchar; 16usize],
    pub profile: *mut fz_icc_profile,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_colorspace__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::size_of::<fz_colorspace__bindgen_ty_1__bindgen_ty_1>() - 32usize];
    ["Alignment of fz_colorspace__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::align_of::<fz_colorspace__bindgen_ty_1__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_1::buffer"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_1, buffer) - 0usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_1::md5"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_1, md5) - 8usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_1::profile"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_1, profile) - 24usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_colorspace__bindgen_ty_1__bindgen_ty_2 {
    pub base: *mut fz_colorspace,
    pub high: ::core::ffi::c_int,
    pub lookup: *mut ::core::ffi::c_uchar,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_colorspace__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::size_of::<fz_colorspace__bindgen_ty_1__bindgen_ty_2>() - 24usize];
    ["Alignment of fz_colorspace__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::align_of::<fz_colorspace__bindgen_ty_1__bindgen_ty_2>() - 8usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_2::base"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_2, base) - 0usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_2::high"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_2, high) - 8usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_2::lookup"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_2, lookup) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_colorspace__bindgen_ty_1__bindgen_ty_3 {
    pub base: *mut fz_colorspace,
    pub eval: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            tint: *mut ::core::ffi::c_void,
            s: *const f32,
            sn: ::core::ffi::c_int,
            d: *mut f32,
            dn: ::core::ffi::c_int,
        ),
    >,
    pub drop: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, tint: *mut ::core::ffi::c_void),
    >,
    pub tint: *mut ::core::ffi::c_void,
    pub colorant: [*mut ::core::ffi::c_char; 32usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_colorspace__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::size_of::<fz_colorspace__bindgen_ty_1__bindgen_ty_3>() - 288usize];
    ["Alignment of fz_colorspace__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::align_of::<fz_colorspace__bindgen_ty_1__bindgen_ty_3>() - 8usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_3::base"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_3, base) - 0usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_3::eval"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_3, eval) - 8usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_3::drop"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_3, drop) - 16usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_3::tint"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_3, tint) - 24usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1__bindgen_ty_3::colorant"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1__bindgen_ty_3, colorant) - 32usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_colorspace__bindgen_ty_1"]
        [::core::mem::size_of::<fz_colorspace__bindgen_ty_1>() - 288usize];
    ["Alignment of fz_colorspace__bindgen_ty_1"]
        [::core::mem::align_of::<fz_colorspace__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1::icc"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1, icc) - 0usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1::indexed"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1, indexed) - 0usize];
    ["Offset of field: fz_colorspace__bindgen_ty_1::separation"]
        [::core::mem::offset_of!(fz_colorspace__bindgen_ty_1, separation) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_colorspace"][::core::mem::size_of::<fz_colorspace>() - 344usize];
    ["Alignment of fz_colorspace"][::core::mem::align_of::<fz_colorspace>() - 8usize];
    ["Offset of field: fz_colorspace::key_storable"]
        [::core::mem::offset_of!(fz_colorspace, key_storable) - 0usize];
    ["Offset of field: fz_colorspace::type_"]
        [::core::mem::offset_of!(fz_colorspace, type_) - 32usize];
    ["Offset of field: fz_colorspace::flags"]
        [::core::mem::offset_of!(fz_colorspace, flags) - 36usize];
    ["Offset of field: fz_colorspace::n"][::core::mem::offset_of!(fz_colorspace, n) - 40usize];
    ["Offset of field: fz_colorspace::name"]
        [::core::mem::offset_of!(fz_colorspace, name) - 48usize];
    ["Offset of field: fz_colorspace::u"][::core::mem::offset_of!(fz_colorspace, u) - 56usize];
};
unsafe extern "C" {
    pub fn fz_drop_colorspace_imp(ctx: *mut fz_context, cs_: *mut fz_storable);
}
unsafe extern "C" {
    pub static mut fz_glyph_name_from_adobe_standard: [*const ::core::ffi::c_char; 256usize];
}
unsafe extern "C" {
    pub static mut fz_glyph_name_from_iso8859_7: [*const ::core::ffi::c_char; 256usize];
}
unsafe extern "C" {
    pub static mut fz_glyph_name_from_koi8u: [*const ::core::ffi::c_char; 256usize];
}
unsafe extern "C" {
    pub static mut fz_glyph_name_from_mac_expert: [*const ::core::ffi::c_char; 256usize];
}
unsafe extern "C" {
    pub static mut fz_glyph_name_from_mac_roman: [*const ::core::ffi::c_char; 256usize];
}
unsafe extern "C" {
    pub static mut fz_glyph_name_from_win_ansi: [*const ::core::ffi::c_char; 256usize];
}
unsafe extern "C" {
    pub static mut fz_glyph_name_from_windows_1252: [*const ::core::ffi::c_char; 256usize];
}
unsafe extern "C" {
    pub static fz_unicode_from_iso8859_1: [::core::ffi::c_ushort; 256usize];
}
unsafe extern "C" {
    pub static fz_unicode_from_iso8859_7: [::core::ffi::c_ushort; 256usize];
}
unsafe extern "C" {
    pub static fz_unicode_from_koi8u: [::core::ffi::c_ushort; 256usize];
}
unsafe extern "C" {
    pub static fz_unicode_from_pdf_doc_encoding: [::core::ffi::c_ushort; 256usize];
}
unsafe extern "C" {
    pub static fz_unicode_from_windows_1250: [::core::ffi::c_ushort; 256usize];
}
unsafe extern "C" {
    pub static fz_unicode_from_windows_1251: [::core::ffi::c_ushort; 256usize];
}
unsafe extern "C" {
    pub static fz_unicode_from_windows_1252: [::core::ffi::c_ushort; 256usize];
}
unsafe extern "C" {
    pub fn fz_iso8859_1_from_unicode(u: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_iso8859_7_from_unicode(u: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_koi8u_from_unicode(u: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_windows_1250_from_unicode(u: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_windows_1251_from_unicode(u: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_windows_1252_from_unicode(u: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_unicode_from_glyph_name(name: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_unicode_from_glyph_name_strict(
        name: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_duplicate_glyph_names_from_unicode(
        unicode: ::core::ffi::c_int,
    ) -> *mut *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_glyph_name_from_unicode_sc(unicode: ::core::ffi::c_int)
    -> *const ::core::ffi::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_text_decoder {
    pub decode_bound: ::core::option::Option<
        unsafe extern "C" fn(
            dec: *mut fz_text_decoder,
            input: *mut ::core::ffi::c_uchar,
            n: ::core::ffi::c_int,
        ) -> ::core::ffi::c_int,
    >,
    pub decode_size: ::core::option::Option<
        unsafe extern "C" fn(
            dec: *mut fz_text_decoder,
            input: *mut ::core::ffi::c_uchar,
            n: ::core::ffi::c_int,
        ) -> ::core::ffi::c_int,
    >,
    pub decode: ::core::option::Option<
        unsafe extern "C" fn(
            dec: *mut fz_text_decoder,
            output: *mut ::core::ffi::c_char,
            input: *mut ::core::ffi::c_uchar,
            n: ::core::ffi::c_int,
        ),
    >,
    pub table1: *mut ::core::ffi::c_void,
    pub table2: *mut ::core::ffi::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_text_decoder"][::core::mem::size_of::<fz_text_decoder>() - 40usize];
    ["Alignment of fz_text_decoder"][::core::mem::align_of::<fz_text_decoder>() - 8usize];
    ["Offset of field: fz_text_decoder::decode_bound"]
        [::core::mem::offset_of!(fz_text_decoder, decode_bound) - 0usize];
    ["Offset of field: fz_text_decoder::decode_size"]
        [::core::mem::offset_of!(fz_text_decoder, decode_size) - 8usize];
    ["Offset of field: fz_text_decoder::decode"]
        [::core::mem::offset_of!(fz_text_decoder, decode) - 16usize];
    ["Offset of field: fz_text_decoder::table1"]
        [::core::mem::offset_of!(fz_text_decoder, table1) - 24usize];
    ["Offset of field: fz_text_decoder::table2"]
        [::core::mem::offset_of!(fz_text_decoder, table2) - 32usize];
};
unsafe extern "C" {
    pub fn fz_init_text_decoder(
        ctx: *mut fz_context,
        dec: *mut fz_text_decoder,
        encoding: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Retrieve the FT_Face handle<br>for the font.\n\n`font`: The font to query\n\nReturns the FT_Face handle for the font, or `NULL`<br>if not a freetype handled font. \\(Cast to void *<br>to avoid nasty header exposure\\)."]
    pub fn fz_font_ft_face(ctx: *mut fz_context, font: *mut fz_font) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Retrieve the Type3 procs<br>for a font.\n\n`font`: The font to query\n\nReturns the t3_procs pointer. Will be `NULL` for a<br>non type-3 font."]
    pub fn fz_font_t3_procs(ctx: *mut fz_context, font: *mut fz_font) -> *mut *mut fz_buffer;
}
pub const FZ_ADOBE_CNS: _bindgen_ty_10 = 0;
pub const FZ_ADOBE_GB: _bindgen_ty_10 = 1;
pub const FZ_ADOBE_JAPAN: _bindgen_ty_10 = 2;
pub const FZ_ADOBE_KOREA: _bindgen_ty_10 = 3;
pub type _bindgen_ty_10 = ::core::ffi::c_uint;
#[doc = "Every [`fz_font`] carries a set of flags<br>within it, in a [`fz_font_flags_t`] structure."]
#[repr(C)]
#[repr(align(4))]
#[derive(Debug, Copy, Clone)]
pub struct fz_font_flags_t {
    pub _bitfield_align_1: [u8; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
    pub __bindgen_padding_0: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_font_flags_t"][::core::mem::size_of::<fz_font_flags_t>() - 4usize];
    ["Alignment of fz_font_flags_t"][::core::mem::align_of::<fz_font_flags_t>() - 4usize];
};
impl fz_font_flags_t {
    #[inline]
    pub fn is_mono(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_is_mono(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn is_mono_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_is_mono_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn is_serif(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_is_serif(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(1usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn is_serif_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                1usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_is_serif_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                1usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn is_bold(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_is_bold(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(2usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn is_bold_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                2usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_is_bold_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                2usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn is_italic(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_is_italic(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(3usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn is_italic_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                3usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_is_italic_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                3usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn ft_substitute(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_ft_substitute(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(4usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn ft_substitute_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                4usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_ft_substitute_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                4usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn ft_stretch(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_ft_stretch(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(5usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn ft_stretch_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                5usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_ft_stretch_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                5usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn fake_bold(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_fake_bold(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(6usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn fake_bold_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                6usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_fake_bold_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                6usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn fake_italic(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_fake_italic(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(7usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn fake_italic_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                7usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_fake_italic_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                7usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn has_opentype(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_has_opentype(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn has_opentype_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                8usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_has_opentype_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                8usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn invalid_bbox(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_invalid_bbox(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(9usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn invalid_bbox_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                9usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_invalid_bbox_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                9usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn cjk(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_cjk(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(10usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn cjk_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                10usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_cjk_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                10usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn cjk_lang(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 2u8) as u32) }
    }
    #[inline]
    pub fn set_cjk_lang(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(11usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn cjk_lang_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                11usize,
                2u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_cjk_lang_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                11usize,
                2u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn embed(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_embed(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(13usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn embed_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                13usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_embed_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                13usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn never_embed(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_never_embed(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(14usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn never_embed_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                14usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_never_embed_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                14usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        is_mono: ::core::ffi::c_uint,
        is_serif: ::core::ffi::c_uint,
        is_bold: ::core::ffi::c_uint,
        is_italic: ::core::ffi::c_uint,
        ft_substitute: ::core::ffi::c_uint,
        ft_stretch: ::core::ffi::c_uint,
        fake_bold: ::core::ffi::c_uint,
        fake_italic: ::core::ffi::c_uint,
        has_opentype: ::core::ffi::c_uint,
        invalid_bbox: ::core::ffi::c_uint,
        cjk: ::core::ffi::c_uint,
        cjk_lang: ::core::ffi::c_uint,
        embed: ::core::ffi::c_uint,
        never_embed: ::core::ffi::c_uint,
    ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let is_mono: u32 = unsafe { ::core::mem::transmute(is_mono) };
            is_mono as u64
        });
        __bindgen_bitfield_unit.set(1usize, 1u8, {
            let is_serif: u32 = unsafe { ::core::mem::transmute(is_serif) };
            is_serif as u64
        });
        __bindgen_bitfield_unit.set(2usize, 1u8, {
            let is_bold: u32 = unsafe { ::core::mem::transmute(is_bold) };
            is_bold as u64
        });
        __bindgen_bitfield_unit.set(3usize, 1u8, {
            let is_italic: u32 = unsafe { ::core::mem::transmute(is_italic) };
            is_italic as u64
        });
        __bindgen_bitfield_unit.set(4usize, 1u8, {
            let ft_substitute: u32 = unsafe { ::core::mem::transmute(ft_substitute) };
            ft_substitute as u64
        });
        __bindgen_bitfield_unit.set(5usize, 1u8, {
            let ft_stretch: u32 = unsafe { ::core::mem::transmute(ft_stretch) };
            ft_stretch as u64
        });
        __bindgen_bitfield_unit.set(6usize, 1u8, {
            let fake_bold: u32 = unsafe { ::core::mem::transmute(fake_bold) };
            fake_bold as u64
        });
        __bindgen_bitfield_unit.set(7usize, 1u8, {
            let fake_italic: u32 = unsafe { ::core::mem::transmute(fake_italic) };
            fake_italic as u64
        });
        __bindgen_bitfield_unit.set(8usize, 1u8, {
            let has_opentype: u32 = unsafe { ::core::mem::transmute(has_opentype) };
            has_opentype as u64
        });
        __bindgen_bitfield_unit.set(9usize, 1u8, {
            let invalid_bbox: u32 = unsafe { ::core::mem::transmute(invalid_bbox) };
            invalid_bbox as u64
        });
        __bindgen_bitfield_unit.set(10usize, 1u8, {
            let cjk: u32 = unsafe { ::core::mem::transmute(cjk) };
            cjk as u64
        });
        __bindgen_bitfield_unit.set(11usize, 2u8, {
            let cjk_lang: u32 = unsafe { ::core::mem::transmute(cjk_lang) };
            cjk_lang as u64
        });
        __bindgen_bitfield_unit.set(13usize, 1u8, {
            let embed: u32 = unsafe { ::core::mem::transmute(embed) };
            embed as u64
        });
        __bindgen_bitfield_unit.set(14usize, 1u8, {
            let never_embed: u32 = unsafe { ::core::mem::transmute(never_embed) };
            never_embed as u64
        });
        __bindgen_bitfield_unit
    }
}
unsafe extern "C" {
    #[doc = "Retrieve a pointer to the font flags<br>for a given font. These can then be updated as required.\n\n`font`: The font to query\n\nReturns a pointer to the flags structure \\(or `NULL`, if<br>the font is `NULL`\\)."]
    pub fn fz_font_flags(font: *mut fz_font) -> *mut fz_font_flags_t;
}
#[doc = "In order to shape a given font, we need to<br>declare it to a shaper library \\(harfbuzz, by default, but others<br>are possible\\). To avoid redeclaring it every time we need to<br>shape, we hold a shaper handle and the destructor for it within<br>the font itself. The handle is initialised by the caller when<br>first required and the destructor is called when the [`fz_font`] is<br>destroyed."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_shaper_data_t {
    pub shaper_handle: *mut ::core::ffi::c_void,
    pub destroy: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, arg1: *mut ::core::ffi::c_void),
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_shaper_data_t"][::core::mem::size_of::<fz_shaper_data_t>() - 16usize];
    ["Alignment of fz_shaper_data_t"][::core::mem::align_of::<fz_shaper_data_t>() - 8usize];
    ["Offset of field: fz_shaper_data_t::shaper_handle"]
        [::core::mem::offset_of!(fz_shaper_data_t, shaper_handle) - 0usize];
    ["Offset of field: fz_shaper_data_t::destroy"]
        [::core::mem::offset_of!(fz_shaper_data_t, destroy) - 8usize];
};
unsafe extern "C" {
    #[doc = "Retrieve a pointer to the shaper data<br>structure for the given font.\n\n`font`: The font to query.\n\nReturns a pointer to the shaper data structure \\(or `NULL` if<br>font is `NULL`\\)."]
    pub fn fz_font_shaper_data(ctx: *mut fz_context, font: *mut fz_font) -> *mut fz_shaper_data_t;
}
unsafe extern "C" {
    #[doc = "Retrieve a pointer to the name of the font.\n\n`font`: The font to query.\n\nReturns a pointer to an internal copy of the font name.<br>Will never be `NULL`, but may be the empty string."]
    pub fn fz_font_name(ctx: *mut fz_context, font: *mut fz_font) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Query whether the font flags say that this font is bold."]
    pub fn fz_font_is_bold(ctx: *mut fz_context, font: *mut fz_font) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Query whether the font flags say that this font is italic."]
    pub fn fz_font_is_italic(ctx: *mut fz_context, font: *mut fz_font) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Query whether the font flags say that this font is serif."]
    pub fn fz_font_is_serif(ctx: *mut fz_context, font: *mut fz_font) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Query whether the font flags say that this font is monospaced."]
    pub fn fz_font_is_monospaced(ctx: *mut fz_context, font: *mut fz_font) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Retrieve the font bbox.\n\n`font`: The font to query.\n\nReturns the font bbox by value; it is valid only if<br>[`fz_font_flags`]\\(font\\)-\\>invalid_bbox is zero."]
    pub fn fz_font_bbox(ctx: *mut fz_context, font: *mut fz_font) -> fz_rect;
}
#[doc = "Type for user supplied system font loading hook.\n\n`name`: The name of the font to load.\n\n`bold`: 1 if a bold font desired, 0 otherwise.\n\n`italic`: 1 if an italic font desired, 0 otherwise.<br>`needs_exact_metrics`: 1 if an exact metric match is required for<br>the font requested.\n\nReturns a new font handle, or `NULL` if no font found \\(or on error\\)."]
pub type fz_load_system_font_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        bold: ::core::ffi::c_int,
        italic: ::core::ffi::c_int,
        needs_exact_metrics: ::core::ffi::c_int,
    ) -> *mut fz_font,
>;
#[doc = "Type for user supplied cjk font loading hook.\n\n`name`: The name of the font to load.\n\n`ordering`: The ordering for which to load the font \\(e.g.<br>[`FZ_ADOBE_KOREA`]\\)\n\n`serif`: 1 if a serif font is desired, 0 otherwise.\n\nReturns a new font handle, or `NULL` if no font found \\(or on error\\)."]
pub type fz_load_system_cjk_font_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        ordering: ::core::ffi::c_int,
        serif: ::core::ffi::c_int,
    ) -> *mut fz_font,
>;
#[doc = "Type for user supplied fallback font loading hook.\n\n`name`: The name of the font to load.\n\n`script`: UCDN script enum.\n\n`language`: [`FZ_LANG`] enum.\n\n`serif`, `bold`, `italic`: boolean style flags.\n\nReturns a new font handle, or `NULL` if no font found \\(or on error\\)."]
pub type fz_load_system_fallback_font_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        script: ::core::ffi::c_int,
        language: ::core::ffi::c_int,
        serif: ::core::ffi::c_int,
        bold: ::core::ffi::c_int,
        italic: ::core::ffi::c_int,
    ) -> *mut fz_font,
>;
unsafe extern "C" {
    #[doc = "Install functions to allow MuPDF to request fonts from the<br>system.\n\nOnly one set of hooks can be in use at a time."]
    pub fn fz_install_load_system_font_funcs(
        ctx: *mut fz_context,
        f: fz_load_system_font_fn,
        f_cjk: fz_load_system_cjk_font_fn,
        f_fallback: fz_load_system_fallback_font_fn,
    );
}
unsafe extern "C" {
    #[doc = "Attempt to load a given font from the system.\n\n`name`: The name of the desired font.\n\n`bold`: 1 if bold desired, 0 otherwise.\n\n`italic`: 1 if italic desired, 0 otherwise.\n\n`needs_exact_metrics`: 1 if an exact metrical match is required,<br>0 otherwise.\n\nReturns a new font handle, or `NULL` if no matching font was found<br>\\(or on error\\)."]
    pub fn fz_load_system_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        bold: ::core::ffi::c_int,
        italic: ::core::ffi::c_int,
        needs_exact_metrics: ::core::ffi::c_int,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Attempt to load a given font from<br>the system.\n\n`name`: The name of the desired font.\n\n`ordering`: The ordering to load the font from \\(e.g. [`FZ_ADOBE_KOREA`]\\)\n\n`serif`: 1 if serif desired, 0 otherwise.\n\nReturns a new font handle, or `NULL` if no matching font was found<br>\\(or on error\\)."]
    pub fn fz_load_system_cjk_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        ordering: ::core::ffi::c_int,
        serif: ::core::ffi::c_int,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Search the builtin fonts for a match.<br>Whether a given font is present or not will depend on the<br>configuration in which MuPDF is built.\n\n`name`: The name of the font desired.\n\n`bold`: 1 if bold desired, 0 otherwise.\n\n`italic`: 1 if italic desired, 0 otherwise.\n\n`len`: Pointer to a place to receive the length of the discovered<br>font buffer.\n\nReturns a pointer to the font file data, or `NULL` if not present."]
    pub fn fz_lookup_builtin_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        bold: ::core::ffi::c_int,
        italic: ::core::ffi::c_int,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Search the builtin base14 fonts for a match.<br>Whether a given font is present or not will depend on the<br>configuration in which MuPDF is built.\n\n`name`: The name of the font desired.\n\n`len`: Pointer to a place to receive the length of the discovered<br>font buffer.\n\nReturns a pointer to the font file data, or `NULL` if not present."]
    pub fn fz_lookup_base14_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Search the builtin cjk fonts for a match.<br>Whether a font is present or not will depend on the<br>configuration in which MuPDF is built.\n\n`ordering`: The desired ordering of the font \\(e.g. [`FZ_ADOBE_KOREA`]\\).\n\n`len`: Pointer to a place to receive the length of the discovered<br>font buffer.\n\nReturns a pointer to the font file data, or `NULL` if not present."]
    pub fn fz_lookup_cjk_font(
        ctx: *mut fz_context,
        ordering: ::core::ffi::c_int,
        len: *mut ::core::ffi::c_int,
        index: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Search the builtin cjk fonts for a match for a given language.<br>Whether a font is present or not will depend on the<br>configuration in which MuPDF is built.\n\n`lang`: Pointer to a \\(case sensitive\\) language string \\(e.g.<br>\"ja\", \"ko\", \"zh-Hant\" etc\\).\n\n`len`: Pointer to a place to receive the length of the discovered<br>font buffer.\n\n`subfont`: Pointer to a place to store the subfont index of the<br>discovered font.\n\nReturns a pointer to the font file data, or `NULL` if not present."]
    pub fn fz_lookup_cjk_font_by_language(
        ctx: *mut fz_context,
        lang: *const ::core::ffi::c_char,
        len: *mut ::core::ffi::c_int,
        subfont: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Return the matching `FZ_ADOBE_*` ordering<br>for the given language tag, such as \"zh-Hant\", \"zh-Hans\", \"ja\", or \"ko\"."]
    pub fn fz_lookup_cjk_ordering_by_language(
        name: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Search the builtin noto fonts for a match.<br>Whether a font is present or not will depend on the<br>configuration in which MuPDF is built.\n\n`script`: The script desired \\(e.g. UCDN_SCRIPT_KATAKANA\\).\n\n`lang`: The language desired \\(e.g. [`FZ_LANG_ja`]\\).\n\n`len`: Pointer to a place to receive the length of the discovered<br>font buffer.\n\nReturns a pointer to the font file data, or `NULL` if not present."]
    pub fn fz_lookup_noto_font(
        ctx: *mut fz_context,
        script: ::core::ffi::c_int,
        lang: ::core::ffi::c_int,
        len: *mut ::core::ffi::c_int,
        subfont: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Search the builtin noto fonts specific symbol fonts.<br>Whether a font is present or not will depend on the<br>configuration in which MuPDF is built."]
    pub fn fz_lookup_noto_math_font(
        ctx: *mut fz_context,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn fz_lookup_noto_music_font(
        ctx: *mut fz_context,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn fz_lookup_noto_symbol1_font(
        ctx: *mut fz_context,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn fz_lookup_noto_symbol2_font(
        ctx: *mut fz_context,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn fz_lookup_noto_emoji_font(
        ctx: *mut fz_context,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn fz_lookup_noto_boxes_font(
        ctx: *mut fz_context,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Look up the Noto font file name for a given script.<br>From the returned font stem, you can look for Noto fonts on the system in the form:<br>Noto\\(Sans|Serif\\)${STEM}-Regular.\\(otf|ttf\\)"]
    pub fn fz_lookup_noto_stem_from_script(
        ctx: *mut fz_context,
        script: ::core::ffi::c_int,
        language: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_lookup_script_name(
        ctx: *mut fz_context,
        script: ::core::ffi::c_int,
        language: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Try to load a fallback font for the<br>given combination of font attributes. Whether a font is<br>present or not will depend on the configuration in which<br>MuPDF is built.\n\n`script`: The script desired \\(e.g. UCDN_SCRIPT_KATAKANA\\).\n\n`language`: The language desired \\(e.g. [`FZ_LANG_ja`]\\).\n\n`serif`: 1 if serif desired, 0 otherwise.\n\n`bold`: 1 if bold desired, 0 otherwise.\n\n`italic`: 1 if italic desired, 0 otherwise.\n\nReturns a new font handle, or `NULL` if not available."]
    pub fn fz_load_fallback_font(
        ctx: *mut fz_context,
        script: ::core::ffi::c_int,
        language: ::core::ffi::c_int,
        serif: ::core::ffi::c_int,
        bold: ::core::ffi::c_int,
        italic: ::core::ffi::c_int,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Create a new \\(empty\\) type3 font.\n\n`name`: Name of font \\(or `NULL`\\).\n\n`matrix`: Font matrix.\n\nReturns a new font handle, or throws exception on<br>allocation failure."]
    pub fn fz_new_type3_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        matrix: fz_matrix,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Create a new font from a font file in memory.\n\nFonts created in this way, will be eligible for embedding by default.\n\n`name`: Name of font \\(leave `NULL` to use name from font\\).\n\n`data`: Pointer to the font file data.\n\n`len`: Length of the font file data.\n\n`index`: Which font from the file to load \\(0 for default\\).\n\n`use_glyph_box`: 1 if we should use the glyph bbox, 0 otherwise.\n\nReturns new font handle, or throws exception on error."]
    pub fn fz_new_font_from_memory(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        data: *const ::core::ffi::c_uchar,
        len: ::core::ffi::c_int,
        index: ::core::ffi::c_int,
        use_glyph_bbox: ::core::ffi::c_int,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Create a new font from a font file in a [`fz_buffer`].\n\nFonts created in this way, will be eligible for embedding by default.\n\n`name`: Name of font \\(leave `NULL` to use name from font\\).\n\n`buffer`: Buffer to load from.\n\n`index`: Which font from the file to load \\(0 for default\\).\n\n`use_glyph_box`: 1 if we should use the glyph bbox, 0 otherwise.\n\nReturns new font handle, or throws exception on error."]
    pub fn fz_new_font_from_buffer(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        buffer: *mut fz_buffer,
        index: ::core::ffi::c_int,
        use_glyph_bbox: ::core::ffi::c_int,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Create a new font from a font file.\n\nFonts created in this way, will be eligible for embedding by default.\n\n`name`: Name of font \\(leave `NULL` to use name from font\\).\n\n`path`: File path to load from.\n\n`index`: Which font from the file to load \\(0 for default\\).\n\n`use_glyph_box`: 1 if we should use the glyph bbox, 0 otherwise.\n\nReturns new font handle, or throws exception on error."]
    pub fn fz_new_font_from_file(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        path: *const ::core::ffi::c_char,
        index: ::core::ffi::c_int,
        use_glyph_bbox: ::core::ffi::c_int,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Create a new font from one of the built-in fonts."]
    pub fn fz_new_base14_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    pub fn fz_new_cjk_font(ctx: *mut fz_context, ordering: ::core::ffi::c_int) -> *mut fz_font;
}
unsafe extern "C" {
    pub fn fz_new_builtin_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        is_bold: ::core::ffi::c_int,
        is_italic: ::core::ffi::c_int,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Control whether a given font should be embedded or not when writing."]
    pub fn fz_set_font_embedding(
        ctx: *mut fz_context,
        font: *mut fz_font,
        embed: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Add a reference to an existing [`fz_font`].\n\n`font`: The font to add a reference to.\n\nReturns the same font."]
    pub fn fz_keep_font(ctx: *mut fz_context, font: *mut fz_font) -> *mut fz_font;
}
unsafe extern "C" {
    #[doc = "Drop a reference to a [`fz_font`], destroying the<br>font when the last reference is dropped.\n\n`font`: The font to drop a reference to."]
    pub fn fz_drop_font(ctx: *mut fz_context, font: *mut fz_font);
}
unsafe extern "C" {
    #[doc = "Set the font bbox.\n\n`font`: The font to set the bbox for.\n\n`xmin`, `ymin`, `xmax`, `ymax`: The bounding box."]
    pub fn fz_set_font_bbox(
        ctx: *mut fz_context,
        font: *mut fz_font,
        xmin: f32,
        ymin: f32,
        xmax: f32,
        ymax: f32,
    );
}
unsafe extern "C" {
    #[doc = "Return a bbox for a given glyph in a font.\n\n`font`: The font to look for the glyph in.\n\n`gid`: The glyph to bound.\n\n`trm`: The matrix to apply to the glyph before bounding.\n\nReturns rectangle by value containing the bounds of the given<br>glyph."]
    pub fn fz_bound_glyph(
        ctx: *mut fz_context,
        font: *mut fz_font,
        gid: ::core::ffi::c_int,
        trm: fz_matrix,
    ) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Determine if a given glyph in a font<br>is cacheable. Certain glyphs in a type 3 font cannot safely<br>be cached, as their appearance depends on the enclosing<br>graphic state.\n\n`font`: The font to look for the glyph in.\n\n`gif`: The glyph to query.\n\nReturns non-zero if cacheable, 0 if not."]
    pub fn fz_glyph_cacheable(
        ctx: *mut fz_context,
        font: *mut fz_font,
        gid: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Run a glyph from a Type3 font to<br>a given device.\n\n`font`: The font to find the glyph in.\n\n`gid`: The glyph to run.\n\n`trm`: The transform to apply.\n\n`dev`: The device to render onto."]
    pub fn fz_run_t3_glyph(
        ctx: *mut fz_context,
        font: *mut fz_font,
        gid: ::core::ffi::c_int,
        trm: fz_matrix,
        dev: *mut fz_device,
    );
}
unsafe extern "C" {
    #[doc = "Return the advance for a given glyph.\n\n`font`: The font to look for the glyph in.\n\n`glyph`: The glyph to find the advance for.\n\n`wmode`: 1 for vertical mode, 0 for horizontal.\n\nReturns the advance for the glyph."]
    pub fn fz_advance_glyph(
        ctx: *mut fz_context,
        font: *mut fz_font,
        glyph: ::core::ffi::c_int,
        wmode: ::core::ffi::c_int,
    ) -> f32;
}
unsafe extern "C" {
    #[doc = "Find the glyph id for a given unicode<br>character within a font.\n\n`font`: The font to look for the unicode character in.\n\n`unicode`: The unicode character to encode.\n\nReturns the glyph id for the given unicode value, or 0 if<br>unknown."]
    pub fn fz_encode_character(
        ctx: *mut fz_context,
        font: *mut fz_font,
        unicode: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Encode character, preferring small-caps variant if available.\n\n`font`: The font to look for the unicode character in.\n\n`unicode`: The unicode character to encode.\n\nReturns the glyph id for the given unicode value, or 0 if<br>unknown."]
    pub fn fz_encode_character_sc(
        ctx: *mut fz_context,
        font: *mut fz_font,
        unicode: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Encode character.\n\nEither by direct lookup of glyphname within a font, or, failing<br>that, by mapping glyphname to unicode and thence to the glyph<br>index within the given font.\n\nReturns zero for type3 fonts."]
    pub fn fz_encode_character_by_glyph_name(
        ctx: *mut fz_context,
        font: *mut fz_font,
        glyphname: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Find the glyph id for<br>a given unicode character within a font, falling back to<br>an alternative if not found.\n\n`font`: The font to look for the unicode character in.\n\n`unicode`: The unicode character to encode.\n\n`script`: The script in use.\n\n`language`: The language in use.\n\n`out_font`: The font handle in which the given glyph represents<br>the requested unicode character. The caller does not own the<br>reference it is passed, so should call [`fz_keep_font`] if it is<br>not simply to be used immediately.\n\nReturns the glyph id for the given unicode value in the supplied<br>font \\(and sets *out_font to font\\) if it is present. Otherwise<br>an alternative fallback font \\(based on script/language\\) is<br>searched for. If the glyph is found therein, *out_font is set<br>to this reference, and the glyph reference is returned. If it<br>cannot be found anywhere, the function returns 0."]
    pub fn fz_encode_character_with_fallback(
        ctx: *mut fz_context,
        font: *mut fz_font,
        unicode: ::core::ffi::c_int,
        script: ::core::ffi::c_int,
        language: ::core::ffi::c_int,
        out_font: *mut *mut fz_font,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Find the name of a glyph\n\n`font`: The font to look for the glyph in.\n\n`glyph`: The glyph id to look for.\n\n`buf`: Pointer to a buffer for the name to be inserted into.\n\n`size`: The size of the buffer.\n\nIf a font contains a name table, then the name of the glyph<br>will be returned in the supplied buffer. Otherwise a name<br>is synthesised. The name will be truncated to fit in<br>the buffer."]
    pub fn fz_get_glyph_name(
        ctx: *mut fz_context,
        font: *mut fz_font,
        glyph: ::core::ffi::c_int,
        buf: *mut ::core::ffi::c_char,
        size: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Retrieve font ascender in ems."]
    pub fn fz_font_ascender(ctx: *mut fz_context, font: *mut fz_font) -> f32;
}
unsafe extern "C" {
    #[doc = "Retrieve font descender in ems."]
    pub fn fz_font_descender(ctx: *mut fz_context, font: *mut fz_font) -> f32;
}
unsafe extern "C" {
    #[doc = "Retrieve the MD5 digest for the font's data."]
    pub fn fz_font_digest(
        ctx: *mut fz_context,
        font: *mut fz_font,
        digest: *mut ::core::ffi::c_uchar,
    );
}
unsafe extern "C" {
    pub fn fz_decouple_type3_font(
        ctx: *mut fz_context,
        font: *mut fz_font,
        t3doc: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Lock against Harfbuzz being called<br>simultaneously in several threads. This reuses<br>[`FZ_LOCK_FREETYPE`]."]
    pub fn fz_hb_lock(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Unlock after a Harfbuzz call. This reuses<br>[`FZ_LOCK_FREETYPE`]."]
    pub fn fz_hb_unlock(ctx: *mut fz_context);
}
#[doc = "Callback for use in font cmap enumeration."]
pub type fz_cmap_callback = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        opaque: *mut ::core::ffi::c_void,
        ucs: ::core::ffi::c_ulong,
        gid: ::core::ffi::c_uint,
    ),
>;
unsafe extern "C" {
    #[doc = "Enumerate a cmap using a callback."]
    pub fn fz_enumerate_font_cmap(
        ctx: *mut fz_context,
        font: *mut fz_font,
        cb: fz_cmap_callback,
        opaque: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Ensure that a font has its ascender/descender values calculated<br>from the actual bbox of the glyphs.\n\nNote, that we combine the declared values from the font \\(or the<br>default values if those are not present\\) with the actual bbox to<br>get the final result. So this can only cause ascender/descender<br>to move further apart!"]
    pub fn fz_calculate_font_ascender_descender(ctx: *mut fz_context, font: *mut fz_font);
}
pub const FZ_ASCDESC_FROM_FONT: fz_ascdesc_source = 0;
pub const FZ_ASCDESC_DEFAULT: fz_ascdesc_source = 1;
pub const FZ_ASCDESC_FROM_BOUNDS: fz_ascdesc_source = 2;
pub type fz_ascdesc_source = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_font {
    pub refs: ::core::ffi::c_int,
    pub name: [::core::ffi::c_char; 32usize],
    pub family: [::core::ffi::c_char; 32usize],
    pub buffer: *mut fz_buffer,
    pub flags: fz_font_flags_t,
    pub ft_face: *mut ::core::ffi::c_void,
    pub shaper_data: fz_shaper_data_t,
    pub t3matrix: fz_matrix,
    pub t3resources: *mut ::core::ffi::c_void,
    pub t3procs: *mut *mut fz_buffer,
    pub t3lists: *mut *mut fz_display_list,
    pub t3widths: *mut f32,
    pub t3flags: *mut ::core::ffi::c_ushort,
    pub t3doc: *mut ::core::ffi::c_void,
    pub t3run: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            doc: *mut ::core::ffi::c_void,
            resources: *mut ::core::ffi::c_void,
            contents: *mut fz_buffer,
            dev: *mut fz_device,
            ctm: fz_matrix,
            gstate: *mut ::core::ffi::c_void,
            default_cs: *mut fz_default_colorspaces,
            fill_gstate: *mut ::core::ffi::c_void,
            stroke_gstate: *mut ::core::ffi::c_void,
        ),
    >,
    pub t3freeres: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            doc: *mut ::core::ffi::c_void,
            resources: *mut ::core::ffi::c_void,
        ),
    >,
    pub bbox: fz_rect,
    pub ascender: f32,
    pub descender: f32,
    pub ascdesc_src: fz_ascdesc_source,
    pub glyph_count: ::core::ffi::c_int,
    pub bbox_table: *mut *mut fz_rect,
    pub use_glyph_bbox: ::core::ffi::c_int,
    pub width_count: ::core::ffi::c_int,
    pub width_default: ::core::ffi::c_short,
    pub width_table: *mut ::core::ffi::c_short,
    pub advance_cache: *mut *mut f32,
    pub encoding_cache: [*mut u16; 256usize],
    pub has_digest: ::core::ffi::c_int,
    pub digest: [::core::ffi::c_uchar; 16usize],
    pub subfont: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_font"][::core::mem::size_of::<fz_font>() - 2344usize];
    ["Alignment of fz_font"][::core::mem::align_of::<fz_font>() - 8usize];
    ["Offset of field: fz_font::refs"][::core::mem::offset_of!(fz_font, refs) - 0usize];
    ["Offset of field: fz_font::name"][::core::mem::offset_of!(fz_font, name) - 4usize];
    ["Offset of field: fz_font::family"][::core::mem::offset_of!(fz_font, family) - 36usize];
    ["Offset of field: fz_font::buffer"][::core::mem::offset_of!(fz_font, buffer) - 72usize];
    ["Offset of field: fz_font::flags"][::core::mem::offset_of!(fz_font, flags) - 80usize];
    ["Offset of field: fz_font::ft_face"][::core::mem::offset_of!(fz_font, ft_face) - 88usize];
    ["Offset of field: fz_font::shaper_data"]
        [::core::mem::offset_of!(fz_font, shaper_data) - 96usize];
    ["Offset of field: fz_font::t3matrix"][::core::mem::offset_of!(fz_font, t3matrix) - 112usize];
    ["Offset of field: fz_font::t3resources"]
        [::core::mem::offset_of!(fz_font, t3resources) - 136usize];
    ["Offset of field: fz_font::t3procs"][::core::mem::offset_of!(fz_font, t3procs) - 144usize];
    ["Offset of field: fz_font::t3lists"][::core::mem::offset_of!(fz_font, t3lists) - 152usize];
    ["Offset of field: fz_font::t3widths"][::core::mem::offset_of!(fz_font, t3widths) - 160usize];
    ["Offset of field: fz_font::t3flags"][::core::mem::offset_of!(fz_font, t3flags) - 168usize];
    ["Offset of field: fz_font::t3doc"][::core::mem::offset_of!(fz_font, t3doc) - 176usize];
    ["Offset of field: fz_font::t3run"][::core::mem::offset_of!(fz_font, t3run) - 184usize];
    ["Offset of field: fz_font::t3freeres"][::core::mem::offset_of!(fz_font, t3freeres) - 192usize];
    ["Offset of field: fz_font::bbox"][::core::mem::offset_of!(fz_font, bbox) - 200usize];
    ["Offset of field: fz_font::ascender"][::core::mem::offset_of!(fz_font, ascender) - 216usize];
    ["Offset of field: fz_font::descender"][::core::mem::offset_of!(fz_font, descender) - 220usize];
    ["Offset of field: fz_font::ascdesc_src"]
        [::core::mem::offset_of!(fz_font, ascdesc_src) - 224usize];
    ["Offset of field: fz_font::glyph_count"]
        [::core::mem::offset_of!(fz_font, glyph_count) - 228usize];
    ["Offset of field: fz_font::bbox_table"]
        [::core::mem::offset_of!(fz_font, bbox_table) - 232usize];
    ["Offset of field: fz_font::use_glyph_bbox"]
        [::core::mem::offset_of!(fz_font, use_glyph_bbox) - 240usize];
    ["Offset of field: fz_font::width_count"]
        [::core::mem::offset_of!(fz_font, width_count) - 244usize];
    ["Offset of field: fz_font::width_default"]
        [::core::mem::offset_of!(fz_font, width_default) - 248usize];
    ["Offset of field: fz_font::width_table"]
        [::core::mem::offset_of!(fz_font, width_table) - 256usize];
    ["Offset of field: fz_font::advance_cache"]
        [::core::mem::offset_of!(fz_font, advance_cache) - 264usize];
    ["Offset of field: fz_font::encoding_cache"]
        [::core::mem::offset_of!(fz_font, encoding_cache) - 272usize];
    ["Offset of field: fz_font::has_digest"]
        [::core::mem::offset_of!(fz_font, has_digest) - 2320usize];
    ["Offset of field: fz_font::digest"][::core::mem::offset_of!(fz_font, digest) - 2324usize];
    ["Offset of field: fz_font::subfont"][::core::mem::offset_of!(fz_font, subfont) - 2340usize];
};
unsafe extern "C" {
    pub fn fz_ft_lock(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn fz_ft_unlock(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn fz_ft_lock_held(ctx: *mut fz_context) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_extract_ttf_from_ttc(ctx: *mut fz_context, font: *mut fz_font) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_subset_ttf_for_gids(
        ctx: *mut fz_context,
        orig: *mut fz_buffer,
        gids: *mut ::core::ffi::c_int,
        num_gids: ::core::ffi::c_int,
        symbolic: ::core::ffi::c_int,
        cidfont: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_subset_cff_for_gids(
        ctx: *mut fz_context,
        orig: *mut fz_buffer,
        gids: *mut ::core::ffi::c_int,
        num_gids: ::core::ffi::c_int,
        symbolic: ::core::ffi::c_int,
        cidfont: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_path {
    _unused: [u8; 0],
}
pub const FZ_LINECAP_BUTT: fz_linecap = 0;
pub const FZ_LINECAP_ROUND: fz_linecap = 1;
pub const FZ_LINECAP_SQUARE: fz_linecap = 2;
pub const FZ_LINECAP_TRIANGLE: fz_linecap = 3;
pub type fz_linecap = ::core::ffi::c_uint;
pub const FZ_LINEJOIN_MITER: fz_linejoin = 0;
pub const FZ_LINEJOIN_ROUND: fz_linejoin = 1;
pub const FZ_LINEJOIN_BEVEL: fz_linejoin = 2;
pub const FZ_LINEJOIN_MITER_XPS: fz_linejoin = 3;
pub type fz_linejoin = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug)]
pub struct fz_stroke_state {
    pub refs: ::core::ffi::c_int,
    pub start_cap: fz_linecap,
    pub dash_cap: fz_linecap,
    pub end_cap: fz_linecap,
    pub linejoin: fz_linejoin,
    pub linewidth: f32,
    pub miterlimit: f32,
    pub dash_phase: f32,
    pub dash_len: ::core::ffi::c_int,
    pub dash_list: __IncompleteArrayField<f32>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stroke_state"][::core::mem::size_of::<fz_stroke_state>() - 36usize];
    ["Alignment of fz_stroke_state"][::core::mem::align_of::<fz_stroke_state>() - 4usize];
    ["Offset of field: fz_stroke_state::refs"]
        [::core::mem::offset_of!(fz_stroke_state, refs) - 0usize];
    ["Offset of field: fz_stroke_state::start_cap"]
        [::core::mem::offset_of!(fz_stroke_state, start_cap) - 4usize];
    ["Offset of field: fz_stroke_state::dash_cap"]
        [::core::mem::offset_of!(fz_stroke_state, dash_cap) - 8usize];
    ["Offset of field: fz_stroke_state::end_cap"]
        [::core::mem::offset_of!(fz_stroke_state, end_cap) - 12usize];
    ["Offset of field: fz_stroke_state::linejoin"]
        [::core::mem::offset_of!(fz_stroke_state, linejoin) - 16usize];
    ["Offset of field: fz_stroke_state::linewidth"]
        [::core::mem::offset_of!(fz_stroke_state, linewidth) - 20usize];
    ["Offset of field: fz_stroke_state::miterlimit"]
        [::core::mem::offset_of!(fz_stroke_state, miterlimit) - 24usize];
    ["Offset of field: fz_stroke_state::dash_phase"]
        [::core::mem::offset_of!(fz_stroke_state, dash_phase) - 28usize];
    ["Offset of field: fz_stroke_state::dash_len"]
        [::core::mem::offset_of!(fz_stroke_state, dash_len) - 32usize];
    ["Offset of field: fz_stroke_state::dash_list"]
        [::core::mem::offset_of!(fz_stroke_state, dash_list) - 36usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_path_walker {
    pub moveto: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, arg: *mut ::core::ffi::c_void, x: f32, y: f32),
    >,
    pub lineto: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, arg: *mut ::core::ffi::c_void, x: f32, y: f32),
    >,
    pub curveto: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arg: *mut ::core::ffi::c_void,
            x1: f32,
            y1: f32,
            x2: f32,
            y2: f32,
            x3: f32,
            y3: f32,
        ),
    >,
    pub closepath: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, arg: *mut ::core::ffi::c_void),
    >,
    pub quadto: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arg: *mut ::core::ffi::c_void,
            x1: f32,
            y1: f32,
            x2: f32,
            y2: f32,
        ),
    >,
    pub curvetov: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arg: *mut ::core::ffi::c_void,
            x2: f32,
            y2: f32,
            x3: f32,
            y3: f32,
        ),
    >,
    pub curvetoy: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arg: *mut ::core::ffi::c_void,
            x1: f32,
            y1: f32,
            x3: f32,
            y3: f32,
        ),
    >,
    pub rectto: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            arg: *mut ::core::ffi::c_void,
            x1: f32,
            y1: f32,
            x2: f32,
            y2: f32,
        ),
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_path_walker"][::core::mem::size_of::<fz_path_walker>() - 64usize];
    ["Alignment of fz_path_walker"][::core::mem::align_of::<fz_path_walker>() - 8usize];
    ["Offset of field: fz_path_walker::moveto"]
        [::core::mem::offset_of!(fz_path_walker, moveto) - 0usize];
    ["Offset of field: fz_path_walker::lineto"]
        [::core::mem::offset_of!(fz_path_walker, lineto) - 8usize];
    ["Offset of field: fz_path_walker::curveto"]
        [::core::mem::offset_of!(fz_path_walker, curveto) - 16usize];
    ["Offset of field: fz_path_walker::closepath"]
        [::core::mem::offset_of!(fz_path_walker, closepath) - 24usize];
    ["Offset of field: fz_path_walker::quadto"]
        [::core::mem::offset_of!(fz_path_walker, quadto) - 32usize];
    ["Offset of field: fz_path_walker::curvetov"]
        [::core::mem::offset_of!(fz_path_walker, curvetov) - 40usize];
    ["Offset of field: fz_path_walker::curvetoy"]
        [::core::mem::offset_of!(fz_path_walker, curvetoy) - 48usize];
    ["Offset of field: fz_path_walker::rectto"]
        [::core::mem::offset_of!(fz_path_walker, rectto) - 56usize];
};
unsafe extern "C" {
    #[doc = "Walk the segments of a path, calling the<br>appropriate callback function from a given set for each<br>segment of the path.\n\n`path`: The path to walk.\n\n`walker`: The set of callback functions to use. The first<br>4 callback pointers in the set must be non-`NULL`. The<br>subsequent ones can either be supplied, or can be left<br>as `NULL`, in which case the top 4 functions will be<br>called as appropriate to simulate them.\n\n`arg`: An opaque argument passed in to each callback.\n\nExceptions will only be thrown if the underlying callback<br>functions throw them."]
    pub fn fz_walk_path(
        ctx: *mut fz_context,
        path: *const fz_path,
        walker: *const fz_path_walker,
        arg: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Create a new \\(empty\\) path structure."]
    pub fn fz_new_path(ctx: *mut fz_context) -> *mut fz_path;
}
unsafe extern "C" {
    #[doc = "Increment the reference count. Returns the same pointer.\n\nAll paths can be kept, regardless of their packing type.\n\nNever throws exceptions."]
    pub fn fz_keep_path(ctx: *mut fz_context, path: *const fz_path) -> *mut fz_path;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count. When the reference count hits<br>zero, free the path.\n\nAll paths can be dropped, regardless of their packing type.<br>Packed paths do not own the blocks into which they are packed<br>so dropping them does not free those blocks.\n\nNever throws exceptions."]
    pub fn fz_drop_path(ctx: *mut fz_context, path: *const fz_path);
}
unsafe extern "C" {
    #[doc = "Minimise the internal storage used by a path.\n\nAs paths are constructed, the internal buffers<br>grow. To avoid repeated reallocations they<br>grow with some spare space. Once a path has<br>been fully constructed, this call allows the<br>excess space to be trimmed."]
    pub fn fz_trim_path(ctx: *mut fz_context, path: *mut fz_path);
}
unsafe extern "C" {
    #[doc = "Return the number of bytes required to pack a path."]
    pub fn fz_packed_path_size(path: *const fz_path) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Pack a path into the given block.<br>To minimise the size of paths, this function allows them to be<br>packed into a buffer with other information. Paths can be used<br>interchangeably regardless of how they are packed.\n\n`pack`: Pointer to a block of data to pack the path into. Should<br>be aligned by the caller to the same alignment as required for<br>a [`fz_path`] pointer.\n\n`path`: The path to pack.\n\nReturns the number of bytes within the block used. Callers can<br>access the packed path data by casting the value of pack on<br>entry to be a [`fz_path`] *.\n\nThrows exceptions on failure to allocate.\n\nImplementation details: Paths can be 'unpacked', 'flat', or<br>'open'. Standard paths, as created are 'unpacked'. Paths<br>will be packed as 'flat', unless they are too large<br>\\(where large indicates that they exceed some private<br>implementation defined limits, currently including having<br>more than 256 coordinates or commands\\).\n\nLarge paths are 'open' packed as a header into the given block,<br>plus pointers to other data blocks.\n\nUsers should not have to care about whether paths are 'open'<br>or 'flat' packed. Simply pack a path \\(if required\\), and then<br>forget about the details."]
    pub fn fz_pack_path(ctx: *mut fz_context, pack: *mut u8, path: *const fz_path) -> usize;
}
unsafe extern "C" {
    #[doc = "Clone the data for a path.\n\nThis is used in preference to [`fz_keep_path`] when a whole<br>new copy of a path is required, rather than just a shared<br>pointer. This probably indicates that the path is about to<br>be modified.\n\n`path`: path to clone.\n\nThrows exceptions on failure to allocate."]
    pub fn fz_clone_path(ctx: *mut fz_context, path: *mut fz_path) -> *mut fz_path;
}
unsafe extern "C" {
    #[doc = "Find out if a path is completely empty."]
    pub fn fz_path_is_empty(ctx: *mut fz_context, path: *const fz_path) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the current point that a path has<br>reached or \\(0,0\\) if empty.\n\n`path`: path to return the current point of."]
    pub fn fz_currentpoint(ctx: *mut fz_context, path: *mut fz_path) -> fz_point;
}
unsafe extern "C" {
    #[doc = "Append a 'moveto' command to a path.<br>This 'opens' a path.\n\n`path`: The path to modify.\n\n`x`, `y`: The coordinate to move to.\n\nThrows exceptions on failure to allocate, or attempting to<br>modify a packed path."]
    pub fn fz_moveto(ctx: *mut fz_context, path: *mut fz_path, x: f32, y: f32);
}
unsafe extern "C" {
    #[doc = "Append a 'lineto' command to an open path.\n\n`path`: The path to modify.\n\n`x`, `y`: The coordinate to line to.\n\nThrows exceptions on failure to allocate, or attempting to<br>modify a packed path."]
    pub fn fz_lineto(ctx: *mut fz_context, path: *mut fz_path, x: f32, y: f32);
}
unsafe extern "C" {
    #[doc = "Append a 'rectto' command to an open path.\n\nThe rectangle is equivalent to:<br>moveto x0 y0<br>lineto x1 y0<br>lineto x1 y1<br>lineto x0 y1<br>closepath\n\n`path`: The path to modify.\n\n`x0`, `y0`: First corner of the rectangle.\n\n`x1`, `y1`: Second corner of the rectangle.\n\nThrows exceptions on failure to allocate, or attempting to<br>modify a packed path."]
    pub fn fz_rectto(ctx: *mut fz_context, path: *mut fz_path, x0: f32, y0: f32, x1: f32, y1: f32);
}
unsafe extern "C" {
    #[doc = "Append a 'quadto' command to an open path. \\(For a<br>quadratic bezier\\).\n\n`path`: The path to modify.\n\n`x0`, `y0`: The control coordinates for the quadratic curve.\n\n`x1`, `y1`: The end coordinates for the quadratic curve.\n\nThrows exceptions on failure to allocate, or attempting to<br>modify a packed path."]
    pub fn fz_quadto(ctx: *mut fz_context, path: *mut fz_path, x0: f32, y0: f32, x1: f32, y1: f32);
}
unsafe extern "C" {
    #[doc = "Append a 'curveto' command to an open path. \\(For a<br>cubic bezier\\).\n\n`path`: The path to modify.\n\n`x0`, `y0`: The coordinates of the first control point for the<br>curve.\n\n`x1`, `y1`: The coordinates of the second control point for the<br>curve.\n\n`x2`, `y2`: The end coordinates for the curve.\n\nThrows exceptions on failure to allocate, or attempting to<br>modify a packed path."]
    pub fn fz_curveto(
        ctx: *mut fz_context,
        path: *mut fz_path,
        x0: f32,
        y0: f32,
        x1: f32,
        y1: f32,
        x2: f32,
        y2: f32,
    );
}
unsafe extern "C" {
    #[doc = "Append a 'curvetov' command to an open path. \\(For a<br>cubic bezier with the first control coordinate equal to<br>the start point\\).\n\n`path`: The path to modify.\n\n`x1`, `y1`: The coordinates of the second control point for the<br>curve.\n\n`x2`, `y2`: The end coordinates for the curve.\n\nThrows exceptions on failure to allocate, or attempting to<br>modify a packed path."]
    pub fn fz_curvetov(
        ctx: *mut fz_context,
        path: *mut fz_path,
        x1: f32,
        y1: f32,
        x2: f32,
        y2: f32,
    );
}
unsafe extern "C" {
    #[doc = "Append a 'curvetoy' command to an open path. \\(For a<br>cubic bezier with the second control coordinate equal to<br>the end point\\).\n\n`path`: The path to modify.\n\n`x0`, `y0`: The coordinates of the first control point for the<br>curve.\n\n`x2`, `y2`: The end coordinates for the curve \\(and the second<br>control coordinate\\).\n\nThrows exceptions on failure to allocate, or attempting to<br>modify a packed path."]
    pub fn fz_curvetoy(
        ctx: *mut fz_context,
        path: *mut fz_path,
        x0: f32,
        y0: f32,
        x2: f32,
        y2: f32,
    );
}
unsafe extern "C" {
    #[doc = "Close the current subpath.\n\n`path`: The path to modify.\n\nThrows exceptions on failure to allocate, attempting to modify<br>a packed path, and illegal path closes \\(i.e. closing a non open<br>path\\)."]
    pub fn fz_closepath(ctx: *mut fz_context, path: *mut fz_path);
}
unsafe extern "C" {
    #[doc = "Transform a path by a given<br>matrix.\n\n`path`: The path to modify \\(must not be a packed path\\).\n\n`transform`: The transform to apply.\n\nThrows exceptions if the path is packed, or on failure<br>to allocate."]
    pub fn fz_transform_path(ctx: *mut fz_context, path: *mut fz_path, transform: fz_matrix);
}
unsafe extern "C" {
    #[doc = "Return a bounding rectangle for a path.\n\n`path`: The path to bound.\n\n`stroke`: If `NULL`, the bounding rectangle given is for<br>the filled path. If non-`NULL` the bounding rectangle<br>given is for the path stroked with the given attributes.\n\n`ctm`: The matrix to apply to the path during stroking.\n\n`r`: Pointer to a [`fz_rect`] which will be used to hold<br>the result.\n\nReturns r, updated to contain the bounding rectangle."]
    pub fn fz_bound_path(
        ctx: *mut fz_context,
        path: *const fz_path,
        stroke: *const fz_stroke_state,
        ctm: fz_matrix,
    ) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Given a rectangle \\(assumed to be the bounding box for a path\\),<br>expand it to allow for the expansion of the bbox that would be<br>seen by stroking the path with the given stroke state and<br>transform."]
    pub fn fz_adjust_rect_for_stroke(
        ctx: *mut fz_context,
        rect: fz_rect,
        stroke: *const fz_stroke_state,
        ctm: fz_matrix,
    ) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "A sane 'default' stroke state."]
    pub static fz_default_stroke_state: fz_stroke_state;
}
unsafe extern "C" {
    #[doc = "Create a new \\(empty\\) stroke state structure \\(with no dash<br>data\\) and return a reference to it.\n\nThrows exception on failure to allocate."]
    pub fn fz_new_stroke_state(ctx: *mut fz_context) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    #[doc = "Create a new \\(empty\\) stroke state structure, with room for<br>dash data of the given length, and return a reference to it.\n\n`len`: The number of dash elements to allow room for.\n\nThrows exception on failure to allocate."]
    pub fn fz_new_stroke_state_with_dash_len(
        ctx: *mut fz_context,
        len: ::core::ffi::c_int,
    ) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    #[doc = "Take an additional reference to a stroke state structure.\n\nNo modifications should be carried out on a stroke<br>state to which more than one reference is held, as<br>this can cause race conditions."]
    pub fn fz_keep_stroke_state(
        ctx: *mut fz_context,
        stroke: *const fz_stroke_state,
    ) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    pub fn fz_stroke_state_eq(
        ctx: *mut fz_context,
        a: *const fz_stroke_state,
        b: *const fz_stroke_state,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Drop a reference to a stroke state structure, destroying the<br>structure if it is the last reference."]
    pub fn fz_drop_stroke_state(ctx: *mut fz_context, stroke: *const fz_stroke_state);
}
unsafe extern "C" {
    #[doc = "Given a reference to a \\(possibly\\) shared stroke_state structure,<br>return a reference to an equivalent stroke_state structure<br>that is guaranteed to be unshared \\(i.e. one that can<br>safely be modified\\).\n\n`shared`: The reference to a \\(possibly\\) shared structure<br>to unshare. Ownership of this reference is passed in<br>to this function, even in the case of exceptions being<br>thrown.\n\nExceptions may be thrown in the event of failure to<br>allocate if required."]
    pub fn fz_unshare_stroke_state(
        ctx: *mut fz_context,
        shared: *mut fz_stroke_state,
    ) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    #[doc = "Given a reference to a \\(possibly\\) shared stroke_state structure,<br>return a reference to a stroke_state structure \\(with room for a<br>given amount of dash data\\) that is guaranteed to be unshared<br>\\(i.e. one that can safely be modified\\).\n\n`shared`: The reference to a \\(possibly\\) shared structure<br>to unshare. Ownership of this reference is passed in<br>to this function, even in the case of exceptions being<br>thrown.\n\nExceptions may be thrown in the event of failure to<br>allocate if required."]
    pub fn fz_unshare_stroke_state_with_dash_len(
        ctx: *mut fz_context,
        shared: *mut fz_stroke_state,
        len: ::core::ffi::c_int,
    ) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    #[doc = "Create an identical stroke_state structure and return a<br>reference to it.\n\n`stroke`: The stroke state reference to clone.\n\nExceptions may be thrown in the event of a failure to<br>allocate."]
    pub fn fz_clone_stroke_state(
        ctx: *mut fz_context,
        stroke: *const fz_stroke_state,
    ) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    pub fn fz_linecap_from_string(s: *const ::core::ffi::c_char) -> fz_linecap;
}
unsafe extern "C" {
    pub fn fz_string_from_linecap(cap: fz_linecap) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_linejoin_from_string(s: *const ::core::ffi::c_char) -> fz_linejoin;
}
unsafe extern "C" {
    pub fn fz_string_from_linejoin(join: fz_linejoin) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Check whether a given path, under the given transform<br>is an axis-aligned rectangle.\n\nWe accept zero width or height rectangles, so<br>\"move 100, 100; line 200, 100\" would count as<br>a rectangle too."]
    pub fn fz_path_is_rect(
        ctx: *mut fz_context,
        path: *const fz_path,
        ctm: fz_matrix,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Check whether a given path, under the given transform<br>is an axis-aligned rectangle.\n\nWe accept zero width or height rectangles, so<br>\"move 100, 100; line 200, 100\" would count as<br>a rectangle too.\n\nbounds = `NULL`, or place to return the rectangle<br>bounds if the path is a rectangle."]
    pub fn fz_path_is_rect_with_bounds(
        ctx: *mut fz_context,
        path: *const fz_path,
        ctm: fz_matrix,
        bounds: *mut fz_rect,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Check whether a given path has all its segments closed.\n\nThis includes both explicit closepaths, and where segments are implicitly<br>closed by segments that end where they started."]
    pub fn fz_path_is_closed(ctx: *mut fz_context, path: *const fz_path) -> ::core::ffi::c_int;
}
#[doc = "Text buffer.\n\nThe trm field contains the a, b, c and d coefficients.<br>The e and f coefficients come from the individual elements,<br>together they form the transform matrix for the glyph.\n\nGlyphs are referenced by glyph ID.<br>The Unicode text equivalent is kept in a separate array<br>with indexes into the glyph array."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_text_item {
    pub x: f32,
    pub y: f32,
    pub adv: f32,
    pub gid: ::core::ffi::c_int,
    pub ucs: ::core::ffi::c_int,
    pub cid: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_text_item"][::core::mem::size_of::<fz_text_item>() - 24usize];
    ["Alignment of fz_text_item"][::core::mem::align_of::<fz_text_item>() - 4usize];
    ["Offset of field: fz_text_item::x"][::core::mem::offset_of!(fz_text_item, x) - 0usize];
    ["Offset of field: fz_text_item::y"][::core::mem::offset_of!(fz_text_item, y) - 4usize];
    ["Offset of field: fz_text_item::adv"][::core::mem::offset_of!(fz_text_item, adv) - 8usize];
    ["Offset of field: fz_text_item::gid"][::core::mem::offset_of!(fz_text_item, gid) - 12usize];
    ["Offset of field: fz_text_item::ucs"][::core::mem::offset_of!(fz_text_item, ucs) - 16usize];
    ["Offset of field: fz_text_item::cid"][::core::mem::offset_of!(fz_text_item, cid) - 20usize];
};
pub const FZ_LANG_UNSET: fz_text_language = 0;
pub const FZ_LANG_ur: fz_text_language = 507;
pub const FZ_LANG_urd: fz_text_language = 3423;
pub const FZ_LANG_ko: fz_text_language = 416;
pub const FZ_LANG_ja: fz_text_language = 37;
pub const FZ_LANG_zh: fz_text_language = 242;
pub const FZ_LANG_zh_Hans: fz_text_language = 14093;
pub const FZ_LANG_zh_Hant: fz_text_language = 14822;
pub type fz_text_language = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_text_span {
    pub font: *mut fz_font,
    pub trm: fz_matrix,
    pub _bitfield_align_1: [u16; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
    pub len: ::core::ffi::c_int,
    pub cap: ::core::ffi::c_int,
    pub items: *mut fz_text_item,
    pub next: *mut fz_text_span,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_text_span"][::core::mem::size_of::<fz_text_span>() - 64usize];
    ["Alignment of fz_text_span"][::core::mem::align_of::<fz_text_span>() - 8usize];
    ["Offset of field: fz_text_span::font"][::core::mem::offset_of!(fz_text_span, font) - 0usize];
    ["Offset of field: fz_text_span::trm"][::core::mem::offset_of!(fz_text_span, trm) - 8usize];
    ["Offset of field: fz_text_span::len"][::core::mem::offset_of!(fz_text_span, len) - 36usize];
    ["Offset of field: fz_text_span::cap"][::core::mem::offset_of!(fz_text_span, cap) - 40usize];
    ["Offset of field: fz_text_span::items"]
        [::core::mem::offset_of!(fz_text_span, items) - 48usize];
    ["Offset of field: fz_text_span::next"][::core::mem::offset_of!(fz_text_span, next) - 56usize];
};
impl fz_text_span {
    #[inline]
    pub fn wmode(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_wmode(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn wmode_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_wmode_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn bidi_level(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u32) }
    }
    #[inline]
    pub fn set_bidi_level(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(1usize, 7u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn bidi_level_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                1usize,
                7u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_bidi_level_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                1usize,
                7u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn markup_dir(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u32) }
    }
    #[inline]
    pub fn set_markup_dir(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn markup_dir_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                8usize,
                2u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_markup_dir_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                8usize,
                2u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn language(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 15u8) as u32) }
    }
    #[inline]
    pub fn set_language(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(10usize, 15u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn language_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                10usize,
                15u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_language_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                10usize,
                15u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        wmode: ::core::ffi::c_uint,
        bidi_level: ::core::ffi::c_uint,
        markup_dir: ::core::ffi::c_uint,
        language: ::core::ffi::c_uint,
    ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let wmode: u32 = unsafe { ::core::mem::transmute(wmode) };
            wmode as u64
        });
        __bindgen_bitfield_unit.set(1usize, 7u8, {
            let bidi_level: u32 = unsafe { ::core::mem::transmute(bidi_level) };
            bidi_level as u64
        });
        __bindgen_bitfield_unit.set(8usize, 2u8, {
            let markup_dir: u32 = unsafe { ::core::mem::transmute(markup_dir) };
            markup_dir as u64
        });
        __bindgen_bitfield_unit.set(10usize, 15u8, {
            let language: u32 = unsafe { ::core::mem::transmute(language) };
            language as u64
        });
        __bindgen_bitfield_unit
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_text {
    pub refs: ::core::ffi::c_int,
    pub head: *mut fz_text_span,
    pub tail: *mut fz_text_span,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_text"][::core::mem::size_of::<fz_text>() - 24usize];
    ["Alignment of fz_text"][::core::mem::align_of::<fz_text>() - 8usize];
    ["Offset of field: fz_text::refs"][::core::mem::offset_of!(fz_text, refs) - 0usize];
    ["Offset of field: fz_text::head"][::core::mem::offset_of!(fz_text, head) - 8usize];
    ["Offset of field: fz_text::tail"][::core::mem::offset_of!(fz_text, tail) - 16usize];
};
unsafe extern "C" {
    #[doc = "Create a new empty [`fz_text`] object.\n\nThrows exception on failure to allocate."]
    pub fn fz_new_text(ctx: *mut fz_context) -> *mut fz_text;
}
unsafe extern "C" {
    #[doc = "Increment the reference count for the text object. The same<br>pointer is returned.\n\nNever throws exceptions."]
    pub fn fz_keep_text(ctx: *mut fz_context, text: *const fz_text) -> *mut fz_text;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for the text object. When the<br>reference count hits zero, the text object is freed.\n\nNever throws exceptions."]
    pub fn fz_drop_text(ctx: *mut fz_context, text: *const fz_text);
}
unsafe extern "C" {
    #[doc = "Add a glyph/unicode value to a text object.\n\n`text`: Text object to add to.\n\n`font`: The font the glyph should be added in.\n\n`trm`: The transform to use for the glyph.\n\n`glyph`: The glyph id to add.\n\n`unicode`: The unicode character for the glyph.\n\n`cid`: The CJK CID value or raw character code.\n\n`wmode`: 1 for vertical mode, 0 for horizontal.\n\n`bidi_level`: The bidirectional level for this glyph.\n\n`markup_dir`: The direction of the text as specified in the<br>markup.\n\n`language`: The language in use \\(if known, 0 otherwise\\)<br>\\(e.g. [`FZ_LANG_zh_Hans`]\\).\n\nThrows exception on failure to allocate."]
    pub fn fz_show_glyph(
        ctx: *mut fz_context,
        text: *mut fz_text,
        font: *mut fz_font,
        trm: fz_matrix,
        glyph: ::core::ffi::c_int,
        unicode: ::core::ffi::c_int,
        wmode: ::core::ffi::c_int,
        bidi_level: ::core::ffi::c_int,
        markup_dir: fz_bidi_direction,
        language: fz_text_language,
    );
}
unsafe extern "C" {
    pub fn fz_show_glyph_aux(
        ctx: *mut fz_context,
        text: *mut fz_text,
        font: *mut fz_font,
        trm: fz_matrix,
        adv: f32,
        glyph: ::core::ffi::c_int,
        unicode: ::core::ffi::c_int,
        cid: ::core::ffi::c_int,
        wmode: ::core::ffi::c_int,
        bidi_level: ::core::ffi::c_int,
        markup_dir: fz_bidi_direction,
        lang: fz_text_language,
    );
}
unsafe extern "C" {
    #[doc = "Add a UTF8 string to a text object.\n\n`text`: Text object to add to.\n\n`font`: The font the string should be added in.\n\n`trm`: The transform to use.\n\n`s`: The utf-8 string to add.\n\n`wmode`: 1 for vertical mode, 0 for horizontal.\n\n`bidi_level`: The bidirectional level for this glyph.\n\n`markup_dir`: The direction of the text as specified in the markup.\n\n`language`: The language in use \\(if known, 0 otherwise\\)<br>\\(e.g. [`FZ_LANG_zh_Hans`]\\).\n\nReturns the transform updated with the advance width of the<br>string."]
    pub fn fz_show_string(
        ctx: *mut fz_context,
        text: *mut fz_text,
        font: *mut fz_font,
        trm: fz_matrix,
        s: *const ::core::ffi::c_char,
        wmode: ::core::ffi::c_int,
        bidi_level: ::core::ffi::c_int,
        markup_dir: fz_bidi_direction,
        language: fz_text_language,
    ) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Measure the advance width of a UTF8 string should it be added to a text object.\n\nThis uses the same layout algorithms as [`fz_show_string`], and can be used<br>to calculate text alignment adjustments."]
    pub fn fz_measure_string(
        ctx: *mut fz_context,
        user_font: *mut fz_font,
        trm: fz_matrix,
        s: *const ::core::ffi::c_char,
        wmode: ::core::ffi::c_int,
        bidi_level: ::core::ffi::c_int,
        markup_dir: fz_bidi_direction,
        language: fz_text_language,
    ) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Find the bounds of a given text object.\n\n`text`: The text object to find the bounds of.\n\n`stroke`: Pointer to the stroke attributes \\(for stroked<br>text\\), or `NULL` \\(for filled text\\).\n\n`ctm`: The matrix in use.\n\n`r`: pointer to storage for the bounds.\n\nReturns a pointer to r, which is updated to contain the<br>bounding box for the text object."]
    pub fn fz_bound_text(
        ctx: *mut fz_context,
        text: *const fz_text,
        stroke: *const fz_stroke_state,
        ctm: fz_matrix,
    ) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Convert ISO 639 \\(639-{1,2,3,5}\\) language specification<br>strings losslessly to a 15 bit [`fz_text_language`] code.\n\nNo validation is carried out. Obviously invalid \\(out<br>of spec\\) codes will be mapped to [`FZ_LANG_UNSET`], but<br>well-formed \\(but undefined\\) codes will be blithely<br>accepted."]
    pub fn fz_text_language_from_string(str_: *const ::core::ffi::c_char) -> fz_text_language;
}
unsafe extern "C" {
    #[doc = "Recover ISO 639 \\(639-{1,2,3,5}\\) language specification<br>strings losslessly from a 15 bit [`fz_text_language`] code.\n\nNo validation is carried out. See note above."]
    pub fn fz_string_from_text_language(
        str_: *mut ::core::ffi::c_char,
        lang: fz_text_language,
    ) -> *mut ::core::ffi::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_hyphenator {
    pub pool: *mut fz_pool,
    pub node_count: ::core::ffi::c_int,
    pub pattern_count: ::core::ffi::c_int,
    pub trie: *mut fz_hyph_trie,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_hyphenator"][::core::mem::size_of::<fz_hyphenator>() - 24usize];
    ["Alignment of fz_hyphenator"][::core::mem::align_of::<fz_hyphenator>() - 8usize];
    ["Offset of field: fz_hyphenator::pool"][::core::mem::offset_of!(fz_hyphenator, pool) - 0usize];
    ["Offset of field: fz_hyphenator::node_count"]
        [::core::mem::offset_of!(fz_hyphenator, node_count) - 8usize];
    ["Offset of field: fz_hyphenator::pattern_count"]
        [::core::mem::offset_of!(fz_hyphenator, pattern_count) - 12usize];
    ["Offset of field: fz_hyphenator::trie"]
        [::core::mem::offset_of!(fz_hyphenator, trie) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_hyph_trie {
    pub patval: *mut ::core::ffi::c_char,
    pub patlen: ::core::ffi::c_short,
    pub ch: ::core::ffi::c_int,
    pub child: *mut fz_hyph_trie,
    pub next: *mut fz_hyph_trie,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_hyph_trie"][::core::mem::size_of::<fz_hyph_trie>() - 32usize];
    ["Alignment of fz_hyph_trie"][::core::mem::align_of::<fz_hyph_trie>() - 8usize];
    ["Offset of field: fz_hyph_trie::patval"]
        [::core::mem::offset_of!(fz_hyph_trie, patval) - 0usize];
    ["Offset of field: fz_hyph_trie::patlen"]
        [::core::mem::offset_of!(fz_hyph_trie, patlen) - 8usize];
    ["Offset of field: fz_hyph_trie::ch"][::core::mem::offset_of!(fz_hyph_trie, ch) - 12usize];
    ["Offset of field: fz_hyph_trie::child"]
        [::core::mem::offset_of!(fz_hyph_trie, child) - 16usize];
    ["Offset of field: fz_hyph_trie::next"][::core::mem::offset_of!(fz_hyph_trie, next) - 24usize];
};
unsafe extern "C" {
    pub fn fz_new_hyphenator_from_stream(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
    ) -> *mut fz_hyphenator;
}
unsafe extern "C" {
    pub fn fz_register_hyphenator(
        ctx: *mut fz_context,
        lang: fz_text_language,
        hyph: *mut fz_hyphenator,
    );
}
unsafe extern "C" {
    pub fn fz_hyphenate_word(
        ctx: *mut fz_context,
        hyph: *mut fz_hyphenator,
        input: *const ::core::ffi::c_char,
        input_size: ::core::ffi::c_int,
        output: *mut ::core::ffi::c_char,
        output_size: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_drop_hyphenator(ctx: *mut fz_context, hyph: *mut fz_hyphenator);
}
unsafe extern "C" {
    pub fn fz_lookup_hyphenator(ctx: *mut fz_context, lang: fz_text_language)
    -> *mut fz_hyphenator;
}
pub const FZ_MAX_SEPARATIONS: _bindgen_ty_11 = 64;
#[doc = "A [`fz_separation`] structure holds details of a set of separations<br>\\(such as might be used on within a page of the document\\).\n\nThe app might control the separations by enabling/disabling them,<br>and subsequent renders would take this into account."]
pub type _bindgen_ty_11 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_separations {
    _unused: [u8; 0],
}
pub const FZ_SEPARATION_COMPOSITE: fz_separation_behavior = 0;
pub const FZ_SEPARATION_SPOT: fz_separation_behavior = 1;
pub const FZ_SEPARATION_DISABLED: fz_separation_behavior = 2;
pub type fz_separation_behavior = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Create a new separations structure \\(initially empty\\)"]
    pub fn fz_new_separations(
        ctx: *mut fz_context,
        controllable: ::core::ffi::c_int,
    ) -> *mut fz_separations;
}
unsafe extern "C" {
    #[doc = "Increment the reference count for a separations structure.<br>Returns the same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_separations(
        ctx: *mut fz_context,
        sep: *mut fz_separations,
    ) -> *mut fz_separations;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for a separations structure.<br>When the reference count hits zero, the separations structure<br>is freed.\n\nNever throws exceptions."]
    pub fn fz_drop_separations(ctx: *mut fz_context, sep: *mut fz_separations);
}
unsafe extern "C" {
    #[doc = "Add a separation \\(null terminated name, colorspace\\)"]
    pub fn fz_add_separation(
        ctx: *mut fz_context,
        sep: *mut fz_separations,
        name: *const ::core::ffi::c_char,
        cs: *mut fz_colorspace,
        cs_channel: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Add a separation with equivalents \\(null terminated name,<br>colorspace\\)\n\n\\(old, deprecated\\)"]
    pub fn fz_add_separation_equivalents(
        ctx: *mut fz_context,
        sep: *mut fz_separations,
        rgba: u32,
        cmyk: u32,
        name: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Control the rendering of a given separation."]
    pub fn fz_set_separation_behavior(
        ctx: *mut fz_context,
        sep: *mut fz_separations,
        separation: ::core::ffi::c_int,
        behavior: fz_separation_behavior,
    );
}
unsafe extern "C" {
    #[doc = "Test for the current behavior of a separation."]
    pub fn fz_separation_current_behavior(
        ctx: *mut fz_context,
        sep: *const fz_separations,
        separation: ::core::ffi::c_int,
    ) -> fz_separation_behavior;
}
unsafe extern "C" {
    pub fn fz_separation_name(
        ctx: *mut fz_context,
        sep: *const fz_separations,
        separation: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_count_separations(
        ctx: *mut fz_context,
        sep: *const fz_separations,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the number of active separations."]
    pub fn fz_count_active_separations(
        ctx: *mut fz_context,
        seps: *const fz_separations,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Compare 2 separations structures \\(or `NULL`s\\).\n\nReturn 0 if identical, non-zero if not identical."]
    pub fn fz_compare_separations(
        ctx: *mut fz_context,
        sep1: *const fz_separations,
        sep2: *const fz_separations,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return a separations object with all the spots in the input<br>separations object that are set to composite, reset to be<br>enabled. If there ARE no spots in the object, this returns<br>`NULL`. If the object already has all its spots enabled, then<br>just returns another handle on the same object."]
    pub fn fz_clone_separations_for_overprint(
        ctx: *mut fz_context,
        seps: *mut fz_separations,
    ) -> *mut fz_separations;
}
unsafe extern "C" {
    #[doc = "Convert a color given in terms of one colorspace,<br>to a color in terms of another colorspace/separations."]
    pub fn fz_convert_separation_colors(
        ctx: *mut fz_context,
        src_cs: *mut fz_colorspace,
        src_color: *const f32,
        dst_seps: *mut fz_separations,
        dst_cs: *mut fz_colorspace,
        dst_color: *mut f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    #[doc = "Get the equivalent separation color in a given colorspace."]
    pub fn fz_separation_equivalent(
        ctx: *mut fz_context,
        seps: *const fz_separations,
        idx: ::core::ffi::c_int,
        dst_cs: *mut fz_colorspace,
        dst_color: *mut f32,
        prf: *mut fz_colorspace,
        color_params: fz_color_params,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_overprint {
    _unused: [u8; 0],
}
unsafe extern "C" {
    #[doc = "Return the bounding box for a pixmap."]
    pub fn fz_pixmap_bbox(ctx: *mut fz_context, pix: *const fz_pixmap) -> fz_irect;
}
unsafe extern "C" {
    #[doc = "Return the width of the pixmap in pixels."]
    pub fn fz_pixmap_width(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the height of the pixmap in pixels."]
    pub fn fz_pixmap_height(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the x value of the pixmap in pixels."]
    pub fn fz_pixmap_x(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the y value of the pixmap in pixels."]
    pub fn fz_pixmap_y(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return sizeof [`fz_pixmap`] plus size of data, in bytes."]
    pub fn fz_pixmap_size(ctx: *mut fz_context, pix: *mut fz_pixmap) -> usize;
}
unsafe extern "C" {
    #[doc = "Create a new pixmap, with its origin at \\(0,0\\)\n\n`cs`: The colorspace to use for the pixmap, or `NULL` for an alpha<br>plane/mask.\n\n`w`: The width of the pixmap \\(in pixels\\)\n\n`h`: The height of the pixmap \\(in pixels\\)\n\n`seps`: Details of separations.\n\n`alpha`: 0 for no alpha, 1 for alpha.\n\nReturns a pointer to the new pixmap. Throws exception on failure<br>to allocate."]
    pub fn fz_new_pixmap(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Create a pixmap of a given size, location and pixel format.\n\nThe bounding box specifies the size of the created pixmap and<br>where it will be located. The colorspace determines the number<br>of components per pixel. Alpha is always present. Pixmaps are<br>reference counted, so drop references using [`fz_drop_pixmap`].\n\n`colorspace`: Colorspace format used for the created pixmap. The<br>pixmap will keep a reference to the colorspace.\n\n`bbox`: Bounding box specifying location/size of created pixmap.\n\n`seps`: Details of separations.\n\n`alpha`: 0 for no alpha, 1 for alpha.\n\nReturns a pointer to the new pixmap. Throws exception on failure<br>to allocate."]
    pub fn fz_new_pixmap_with_bbox(
        ctx: *mut fz_context,
        colorspace: *mut fz_colorspace,
        bbox: fz_irect,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Create a new pixmap, with its origin at<br>\\(0,0\\) using the supplied data block.\n\n`cs`: The colorspace to use for the pixmap, or `NULL` for an alpha<br>plane/mask.\n\n`w`: The width of the pixmap \\(in pixels\\)\n\n`h`: The height of the pixmap \\(in pixels\\)\n\n`seps`: Details of separations.\n\n`alpha`: 0 for no alpha, 1 for alpha.\n\n`stride`: The byte offset from the pixel data in a row to the<br>pixel data in the next row.\n\n`samples`: The data block to keep the samples in.\n\nReturns a pointer to the new pixmap. Throws exception on failure to<br>allocate."]
    pub fn fz_new_pixmap_with_data(
        ctx: *mut fz_context,
        colorspace: *mut fz_colorspace,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
        stride: ::core::ffi::c_int,
        samples: *mut ::core::ffi::c_uchar,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Create a pixmap of a given size, location and pixel format,<br>using the supplied data block.\n\nThe bounding box specifies the size of the created pixmap and<br>where it will be located. The colorspace determines the number<br>of components per pixel. Alpha is always present. Pixmaps are<br>reference counted, so drop references using [`fz_drop_pixmap`].\n\n`colorspace`: Colorspace format used for the created pixmap. The<br>pixmap will keep a reference to the colorspace.\n\n`rect`: Bounding box specifying location/size of created pixmap.\n\n`seps`: Details of separations.\n\n`alpha`: Number of alpha planes \\(0 or 1\\).\n\n`samples`: The data block to keep the samples in.\n\nReturns a pointer to the new pixmap. Throws exception on failure<br>to allocate."]
    pub fn fz_new_pixmap_with_bbox_and_data(
        ctx: *mut fz_context,
        colorspace: *mut fz_colorspace,
        rect: fz_irect,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
        samples: *mut ::core::ffi::c_uchar,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Create a new pixmap that represents a subarea of the specified<br>pixmap. A reference is taken to this pixmap that will be dropped<br>on destruction.\n\nThe supplied rectangle must be wholly contained within the<br>original pixmap.\n\nReturns a pointer to the new pixmap. Throws exception on failure<br>to allocate."]
    pub fn fz_new_pixmap_from_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        rect: *const fz_irect,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Clone a pixmap, copying the pixels and associated data to new<br>storage.\n\nThe reference count of 'old' is unchanged."]
    pub fn fz_clone_pixmap(ctx: *mut fz_context, old: *const fz_pixmap) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Increment the reference count for the pixmap. The same pointer<br>is returned.\n\nNever throws exceptions."]
    pub fn fz_keep_pixmap(ctx: *mut fz_context, pix: *mut fz_pixmap) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for the pixmap. When the<br>reference count hits 0, the pixmap is freed.\n\nNever throws exceptions."]
    pub fn fz_drop_pixmap(ctx: *mut fz_context, pix: *mut fz_pixmap);
}
unsafe extern "C" {
    #[doc = "Return the colorspace of a pixmap\n\nReturns colorspace."]
    pub fn fz_pixmap_colorspace(ctx: *mut fz_context, pix: *const fz_pixmap) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Return the number of components in a pixmap.\n\nReturns the number of components \\(including spots and alpha\\)."]
    pub fn fz_pixmap_components(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the number of colorants in a pixmap.\n\nReturns the number of colorants \\(components, less any spots and<br>alpha\\)."]
    pub fn fz_pixmap_colorants(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the number of spots in a pixmap.\n\nReturns the number of spots \\(components, less colorants and<br>alpha\\). Does not throw exceptions."]
    pub fn fz_pixmap_spots(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the number of alpha planes in a pixmap.\n\nReturns the number of alphas. Does not throw exceptions."]
    pub fn fz_pixmap_alpha(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Returns a pointer to the pixel data of a pixmap.\n\nReturns the pointer."]
    pub fn fz_pixmap_samples(
        ctx: *mut fz_context,
        pix: *const fz_pixmap,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Return the number of bytes in a row in the pixmap."]
    pub fn fz_pixmap_stride(ctx: *mut fz_context, pix: *const fz_pixmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Set the pixels per inch resolution of the pixmap."]
    pub fn fz_set_pixmap_resolution(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        xres: ::core::ffi::c_int,
        yres: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Clears a pixmap with the given value.\n\n`pix`: The pixmap to clear.\n\n`value`: Values in the range 0 to 255 are valid. Each component<br>sample for each pixel in the pixmap will be set to this value,<br>while alpha will always be set to 255 \\(non-transparent\\).\n\nThis function is horrible, and should be removed from the<br>API and replaced with a less magic one."]
    pub fn fz_clear_pixmap_with_value(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        value: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Fill pixmap with solid color."]
    pub fn fz_fill_pixmap_with_color(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        colorspace: *mut fz_colorspace,
        color: *mut f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    #[doc = "Clears a subrect of a pixmap with the given value.\n\n`pix`: The pixmap to clear.\n\n`value`: Values in the range 0 to 255 are valid. Each component<br>sample for each pixel in the pixmap will be set to this value,<br>while alpha will always be set to 255 \\(non-transparent\\).\n\n`r`: the rectangle."]
    pub fn fz_clear_pixmap_rect_with_value(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        value: ::core::ffi::c_int,
        r: fz_irect,
    );
}
unsafe extern "C" {
    #[doc = "Sets all components \\(including alpha\\) of<br>all pixels in a pixmap to 0.\n\n`pix`: The pixmap to clear."]
    pub fn fz_clear_pixmap(ctx: *mut fz_context, pix: *mut fz_pixmap);
}
unsafe extern "C" {
    #[doc = "Invert all the pixels in a pixmap. All components \\(process and<br>spots\\) of all pixels are inverted \\(except alpha, which is<br>unchanged\\)."]
    pub fn fz_invert_pixmap(ctx: *mut fz_context, pix: *mut fz_pixmap);
}
unsafe extern "C" {
    #[doc = "Invert the alpha of all the pixels in a pixmap."]
    pub fn fz_invert_pixmap_alpha(ctx: *mut fz_context, pix: *mut fz_pixmap);
}
unsafe extern "C" {
    #[doc = "Transform the pixels in a pixmap so that luminance of each<br>pixel is inverted, and the chrominance remains unchanged \\(as<br>much as accuracy allows\\).\n\nAll components of all pixels are inverted \\(except alpha, which<br>is unchanged\\). Only supports Grey and RGB bitmaps."]
    pub fn fz_invert_pixmap_luminance(ctx: *mut fz_context, pix: *mut fz_pixmap);
}
unsafe extern "C" {
    #[doc = "Tint all the pixels in an RGB, BGR, or Gray pixmap.\n\n`black`: Map black to this hexadecimal RGB color.\n\n`white`: Map white to this hexadecimal RGB color."]
    pub fn fz_tint_pixmap(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        black: ::core::ffi::c_int,
        white: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Invert all the pixels in a given rectangle of a \\(premultiplied\\)<br>pixmap. All components of all pixels in the rectangle are<br>inverted \\(except alpha, which is unchanged\\)."]
    pub fn fz_invert_pixmap_rect(ctx: *mut fz_context, image: *mut fz_pixmap, rect: fz_irect);
}
unsafe extern "C" {
    #[doc = "Invert all the pixels in a non-premultiplied pixmap in a<br>very naive manner."]
    pub fn fz_invert_pixmap_raw(ctx: *mut fz_context, pix: *mut fz_pixmap);
}
unsafe extern "C" {
    #[doc = "Apply gamma correction to a pixmap. All components<br>of all pixels are modified \\(except alpha, which is unchanged\\).\n\n`gamma`: The gamma value to apply; 1.0 for no change."]
    pub fn fz_gamma_pixmap(ctx: *mut fz_context, pix: *mut fz_pixmap, gamma: f32);
}
unsafe extern "C" {
    #[doc = "Convert an existing pixmap to a desired<br>colorspace. Other properties of the pixmap, such as resolution<br>and position are copied to the converted pixmap.\n\n`pix`: The pixmap to convert.\n\n`default_cs`: If `NULL` pix-\\>colorspace is used. It is possible that<br>the data may need to be interpreted as one of the color spaces<br>in default_cs.\n\n`cs_des`: Desired colorspace, may be `NULL` to denote alpha-only.\n\n`prf`: Proofing color space through which we need to convert.\n\n`color_params`: Parameters that may be used in conversion \\(e.g.<br>ri\\).\n\n`keep_alpha`: If 0 any alpha component is removed, otherwise<br>alpha is kept if present in the pixmap."]
    pub fn fz_convert_pixmap(
        ctx: *mut fz_context,
        pix: *const fz_pixmap,
        cs_des: *mut fz_colorspace,
        prf: *mut fz_colorspace,
        default_cs: *mut fz_default_colorspaces,
        color_params: fz_color_params,
        keep_alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Check if the pixmap is a 1-channel image containing samples with<br>only values 0 and 255"]
    pub fn fz_is_pixmap_monochrome(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_alpha_from_gray(ctx: *mut fz_context, gray: *mut fz_pixmap) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_alpha_from_rgb(ctx: *mut fz_context, color: *mut fz_pixmap) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_decode_tile(ctx: *mut fz_context, pix: *mut fz_pixmap, decode: *const f32);
}
unsafe extern "C" {
    pub fn fz_md5_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        digest: *mut ::core::ffi::c_uchar,
    );
}
unsafe extern "C" {
    pub fn fz_unpack_stream(
        ctx: *mut fz_context,
        src: *mut fz_stream,
        depth: ::core::ffi::c_int,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        n: ::core::ffi::c_int,
        indexed: ::core::ffi::c_int,
        pad: ::core::ffi::c_int,
        skip: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
#[doc = "Pixmaps represent a set of pixels for a 2 dimensional region of<br>a plane. Each pixel has n components per pixel. The components<br>are in the order process-components, spot-colors, alpha, where<br>there can be 0 of any of those types. The data is in<br>premultiplied alpha when rendering, but non-premultiplied for<br>colorspace conversions and rescaling.\n\n`x`, `y`: The minimum x and y coord of the region in pixels.\n\n`w`, `h`: The width and height of the region in pixels.\n\n`n`: The number of color components in the image.<br>n = num composite colors + num spots + num alphas\n\n`s`: The number of spot channels in the image.\n\n`alpha`: 0 for no alpha, 1 for alpha present.\n\n`flags`: flag bits.<br>Bit 0: If set, draw the image with linear interpolation.<br>Bit 1: If set, free the samples buffer when the pixmap<br>is destroyed.\n\n`stride`: The byte offset from the data for any given pixel<br>to the data for the same pixel on the row below.\n\n`seps`: `NULL`, or a pointer to a separations structure. If `NULL`,<br>s should be 0.\n\n`xres`, `yres`: Image resolution in dpi. Default is 96 dpi.\n\n`colorspace`: Pointer to a colorspace object describing the<br>colorspace the pixmap is in. If `NULL`, the image is a mask.\n\n`samples`: Pointer to the first byte of the pixmap sample data.<br>This is typically a simple block of memory w * h * n bytes of<br>memory in which the components are stored linearly, but with the<br>use of appropriate stride values, scanlines can be stored in<br>different orders, and have different amounts of padding. The<br>first n bytes are components 0 to n-1 for the pixel at \\(x,y\\).<br>Each successive n bytes gives another pixel in scanline order<br>as we move across the line. The start of each scanline is offset<br>the start of the previous one by stride bytes."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pixmap {
    pub storable: fz_storable,
    pub x: ::core::ffi::c_int,
    pub y: ::core::ffi::c_int,
    pub w: ::core::ffi::c_int,
    pub h: ::core::ffi::c_int,
    pub n: ::core::ffi::c_uchar,
    pub s: ::core::ffi::c_uchar,
    pub alpha: ::core::ffi::c_uchar,
    pub flags: ::core::ffi::c_uchar,
    pub stride: isize,
    pub seps: *mut fz_separations,
    pub xres: ::core::ffi::c_int,
    pub yres: ::core::ffi::c_int,
    pub colorspace: *mut fz_colorspace,
    pub samples: *mut ::core::ffi::c_uchar,
    pub underlying: *mut fz_pixmap,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_pixmap"][::core::mem::size_of::<fz_pixmap>() - 96usize];
    ["Alignment of fz_pixmap"][::core::mem::align_of::<fz_pixmap>() - 8usize];
    ["Offset of field: fz_pixmap::storable"][::core::mem::offset_of!(fz_pixmap, storable) - 0usize];
    ["Offset of field: fz_pixmap::x"][::core::mem::offset_of!(fz_pixmap, x) - 24usize];
    ["Offset of field: fz_pixmap::y"][::core::mem::offset_of!(fz_pixmap, y) - 28usize];
    ["Offset of field: fz_pixmap::w"][::core::mem::offset_of!(fz_pixmap, w) - 32usize];
    ["Offset of field: fz_pixmap::h"][::core::mem::offset_of!(fz_pixmap, h) - 36usize];
    ["Offset of field: fz_pixmap::n"][::core::mem::offset_of!(fz_pixmap, n) - 40usize];
    ["Offset of field: fz_pixmap::s"][::core::mem::offset_of!(fz_pixmap, s) - 41usize];
    ["Offset of field: fz_pixmap::alpha"][::core::mem::offset_of!(fz_pixmap, alpha) - 42usize];
    ["Offset of field: fz_pixmap::flags"][::core::mem::offset_of!(fz_pixmap, flags) - 43usize];
    ["Offset of field: fz_pixmap::stride"][::core::mem::offset_of!(fz_pixmap, stride) - 48usize];
    ["Offset of field: fz_pixmap::seps"][::core::mem::offset_of!(fz_pixmap, seps) - 56usize];
    ["Offset of field: fz_pixmap::xres"][::core::mem::offset_of!(fz_pixmap, xres) - 64usize];
    ["Offset of field: fz_pixmap::yres"][::core::mem::offset_of!(fz_pixmap, yres) - 68usize];
    ["Offset of field: fz_pixmap::colorspace"]
        [::core::mem::offset_of!(fz_pixmap, colorspace) - 72usize];
    ["Offset of field: fz_pixmap::samples"][::core::mem::offset_of!(fz_pixmap, samples) - 80usize];
    ["Offset of field: fz_pixmap::underlying"]
        [::core::mem::offset_of!(fz_pixmap, underlying) - 88usize];
};
pub const FZ_PIXMAP_FLAG_INTERPOLATE: _bindgen_ty_12 = 1;
pub const FZ_PIXMAP_FLAG_FREE_SAMPLES: _bindgen_ty_12 = 2;
pub type _bindgen_ty_12 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn fz_warp_pixmap(
        ctx: *mut fz_context,
        src: *mut fz_pixmap,
        points: fz_quad,
        width: ::core::ffi::c_int,
        height: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_autowarp_pixmap(
        ctx: *mut fz_context,
        src: *mut fz_pixmap,
        points: fz_quad,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_detect_document(
        ctx: *mut fz_context,
        points: *mut fz_quad,
        src: *mut fz_pixmap,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_clone_pixmap_area_with_different_seps(
        ctx: *mut fz_context,
        src: *mut fz_pixmap,
        bbox: *const fz_irect,
        dcs: *mut fz_colorspace,
        seps: *mut fz_separations,
        color_params: fz_color_params,
        default_cs: *mut fz_default_colorspaces,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_from_alpha_channel(
        ctx: *mut fz_context,
        src: *mut fz_pixmap,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_from_color_and_mask(
        ctx: *mut fz_context,
        color: *mut fz_pixmap,
        mask: *mut fz_pixmap,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_scale_pixmap(
        ctx: *mut fz_context,
        src: *mut fz_pixmap,
        x: f32,
        y: f32,
        w: f32,
        h: f32,
        clip: *const fz_irect,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_subsample_pixmap(
        ctx: *mut fz_context,
        tile: *mut fz_pixmap,
        factor: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_copy_pixmap_rect(
        ctx: *mut fz_context,
        dest: *mut fz_pixmap,
        src: *mut fz_pixmap,
        r: fz_irect,
        default_cs: *const fz_default_colorspaces,
    );
}
pub const FZ_DEFLATE_NONE: fz_deflate_level = 0;
pub const FZ_DEFLATE_BEST_SPEED: fz_deflate_level = 1;
pub const FZ_DEFLATE_BEST: fz_deflate_level = 9;
pub const FZ_DEFLATE_DEFAULT: fz_deflate_level = -1;
pub type fz_deflate_level = ::core::ffi::c_int;
unsafe extern "C" {
    #[doc = "Returns the upper bound on the<br>size of flated data of length size."]
    pub fn fz_deflate_bound(ctx: *mut fz_context, size: usize) -> usize;
}
unsafe extern "C" {
    #[doc = "Compress source_length bytes of data starting<br>at source, into a buffer of length *compressed_length, starting at<br>dest. *compressed_length will be updated on exit to contain the size<br>actually used."]
    pub fn fz_deflate(
        ctx: *mut fz_context,
        dest: *mut ::core::ffi::c_uchar,
        compressed_length: *mut usize,
        source: *const ::core::ffi::c_uchar,
        source_length: usize,
        level: fz_deflate_level,
    );
}
unsafe extern "C" {
    #[doc = "Compress source_length bytes of data starting<br>at source, into a new memory block malloced for that purpose.<br>compressed_length is updated on exit to contain the size used.<br>Ownership of the block is returned from this function, and the<br>caller is therefore responsible for freeing it. The block may be<br>considerably larger than is actually required. The caller is<br>free to [`fz_realloc`] it down if it wants to."]
    pub fn fz_new_deflated_data(
        ctx: *mut fz_context,
        compressed_length: *mut usize,
        source: *const ::core::ffi::c_uchar,
        source_length: usize,
        level: fz_deflate_level,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Compress the contents of a [`fz_buffer`] into a<br>new block malloced for that purpose. *compressed_length is<br>updated on exit to contain the size used. Ownership of the block<br>is returned from this function, and the caller is therefore<br>responsible for freeing it. The block may be considerably larger<br>than is actually required. The caller is free to [`fz_realloc`] it<br>down if it wants to."]
    pub fn fz_new_deflated_data_from_buffer(
        ctx: *mut fz_context,
        compressed_length: *mut usize,
        buffer: *mut fz_buffer,
        level: fz_deflate_level,
    ) -> *mut ::core::ffi::c_uchar;
}
pub const FZ_BROTLI_NONE: fz_brotli_level = 0;
pub const FZ_BROTLI_BEST_SPEED: fz_brotli_level = 1;
pub const FZ_BROTLI_BEST: fz_brotli_level = 11;
pub const FZ_BROTLI_DEFAULT: fz_brotli_level = 6;
pub type fz_brotli_level = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Returns the upper bound on the<br>size of brotli compressed data of length size."]
    pub fn fz_brotli_bound(ctx: *mut fz_context, size: usize) -> usize;
}
unsafe extern "C" {
    #[doc = "Compress source_length bytes of data starting<br>at source, into a buffer of length *destLen, starting at dest.<br>compressed_length will be updated on exit to contain the size<br>actually used."]
    pub fn fz_compress_brotli(
        ctx: *mut fz_context,
        dest: *mut ::core::ffi::c_uchar,
        compressed_length: *mut usize,
        source: *const ::core::ffi::c_uchar,
        source_length: usize,
        level: fz_brotli_level,
    );
}
unsafe extern "C" {
    #[doc = "Compress source_length bytes of data starting<br>at source, into a new memory block malloced for that purpose.<br>compressed_length is updated on exit to contain the size used.<br>Ownership of the block is returned from this function, and the<br>caller is therefore responsible for freeing it. The block may be<br>considerably larger than is actually required. The caller is<br>free to [`fz_realloc`] it down if it wants to."]
    pub fn fz_new_brotli_data(
        ctx: *mut fz_context,
        compressed_length: *mut usize,
        source: *const ::core::ffi::c_uchar,
        source_length: usize,
        level: fz_brotli_level,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Compress the contents of a [`fz_buffer`] into a<br>new block malloced for that purpose. *compressed_length is<br>updated on exit to contain the size used. Ownership of the block<br>is returned from this function, and the caller is therefore<br>responsible for freeing it. The block may be considerably larger<br>than is actually required. The caller is free to [`fz_realloc`] it<br>down if it wants to."]
    pub fn fz_new_brotli_data_from_buffer(
        ctx: *mut fz_context,
        compressed_length: *mut usize,
        buffer: *mut fz_buffer,
        level: fz_brotli_level,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    #[doc = "Compress bitmap data as CCITT Group 3 1D fax image.<br>Creates a stream assuming the default PDF parameters,<br>except the number of columns."]
    pub fn fz_compress_ccitt_fax_g3(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_uchar,
        columns: ::core::ffi::c_int,
        rows: ::core::ffi::c_int,
        stride: isize,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Compress bitmap data as CCITT Group 4 2D fax image.<br>Creates a stream assuming the default PDF parameters, except<br>K=-1 and the number of columns."]
    pub fn fz_compress_ccitt_fax_g4(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_uchar,
        columns: ::core::ffi::c_int,
        rows: ::core::ffi::c_int,
        stride: isize,
    ) -> *mut fz_buffer;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_jbig2_globals {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_range {
    pub offset: i64,
    pub length: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_range"][::core::mem::size_of::<fz_range>() - 16usize];
    ["Alignment of fz_range"][::core::mem::align_of::<fz_range>() - 8usize];
    ["Offset of field: fz_range::offset"][::core::mem::offset_of!(fz_range, offset) - 0usize];
    ["Offset of field: fz_range::length"][::core::mem::offset_of!(fz_range, length) - 8usize];
};
unsafe extern "C" {
    #[doc = "The null filter reads a specified amount of data from the<br>substream."]
    pub fn fz_open_null_filter(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        len: u64,
        offset: i64,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "The range filter copies data from specified ranges of the<br>chained stream."]
    pub fn fz_open_range_filter(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        ranges: *mut fz_range,
        nranges: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "The endstream filter reads a PDF substream, and starts to look<br>for an 'endstream' token after the specified length."]
    pub fn fz_open_endstream_filter(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        len: u64,
        offset: i64,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Concat filter concatenates several streams into one."]
    pub fn fz_open_concat(
        ctx: *mut fz_context,
        max: ::core::ffi::c_int,
        pad: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Add a chained stream to the end of the concatenate filter.\n\nOwnership of chain is passed in."]
    pub fn fz_concat_push_drop(ctx: *mut fz_context, concat: *mut fz_stream, chain: *mut fz_stream);
}
unsafe extern "C" {
    #[doc = "arc4 filter performs RC4 decoding of data read from the chained<br>filter using the supplied key."]
    pub fn fz_open_arc4(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        key: *mut ::core::ffi::c_uchar,
        keylen: ::core::ffi::c_uint,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "aesd filter performs AES decoding of data read from the chained<br>filter using the supplied key."]
    pub fn fz_open_aesd(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        key: *mut ::core::ffi::c_uchar,
        keylen: ::core::ffi::c_uint,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "a85d filter performs ASCII 85 Decoding of data read<br>from the chained filter."]
    pub fn fz_open_a85d(ctx: *mut fz_context, chain: *mut fz_stream) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "ahxd filter performs ASCII Hex decoding of data read<br>from the chained filter."]
    pub fn fz_open_ahxd(ctx: *mut fz_context, chain: *mut fz_stream) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "rld filter performs Run Length Decoding of data read<br>from the chained filter."]
    pub fn fz_open_rld(ctx: *mut fz_context, chain: *mut fz_stream) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "dctd filter performs DCT \\(JPEG\\) decoding of data read<br>from the chained filter.\n\ncolor_transform implements the PDF color_transform option<br>use -1 for default behavior<br>use 0 to disable YUV-RGB / YCCK-CMYK transforms<br>use 1 to enable YUV-RGB / YCCK-CMYK transforms\n\ninvert_cmyk implements the necessary inversion for Photoshop CMYK images<br>use 0 if embedded in PDF<br>use 1 if not embedded in PDF\n\nFor subsampling on decode, set l2factor to the log2 of the<br>reduction required \\(therefore 0 = full size decode\\).\n\njpegtables is an optional stream from which the JPEG tables<br>can be read. Use `NULL` if not required."]
    pub fn fz_open_dctd(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        color_transform: ::core::ffi::c_int,
        invert_cmyk: ::core::ffi::c_int,
        l2factor: ::core::ffi::c_int,
        jpegtables: *mut fz_stream,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "faxd filter performs FAX decoding of data read from<br>the chained filter.\n\n`k`: see fax specification \\(fax default is 0\\).\n\n`end_of_line`: whether we expect end of line markers \\(fax default<br>is 0\\).\n\n`encoded_byte_align`: whether we align to bytes after each line<br>\\(fax default is 0\\).\n\n`columns`: how many columns in the image \\(fax default is 1728\\).\n\n`rows`: 0 for unspecified or the number of rows of data to expect.\n\n`end_of_block`: whether we expect end of block markers \\(fax<br>default is 1\\).\n\n`black_is_1`: determines the polarity of the image \\(fax default is<br>0\\)."]
    pub fn fz_open_faxd(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        k: ::core::ffi::c_int,
        end_of_line: ::core::ffi::c_int,
        encoded_byte_align: ::core::ffi::c_int,
        columns: ::core::ffi::c_int,
        rows: ::core::ffi::c_int,
        end_of_block: ::core::ffi::c_int,
        black_is_1: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "flated filter performs LZ77 decoding \\(inflating\\) of data read<br>from the chained filter.\n\n`window_bits`: How large a decompression window to use. Typically<br>15. A negative number, -n, means to use n bits, but to expect<br>raw data with no header."]
    pub fn fz_open_flated(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        window_bits: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "libarchived filter performs generic compressed decoding of data<br>in any format understood by libarchive from the chained filter.\n\nThis will throw an exception if libarchive is not built in, or<br>if the compression format is not recognised."]
    pub fn fz_open_libarchived(ctx: *mut fz_context, chain: *mut fz_stream) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "brotlid filter performs Brotli decoding of data read<br>from the chained filter."]
    pub fn fz_open_brotlid(ctx: *mut fz_context, chain: *mut fz_stream) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "lzwd filter performs LZW decoding of data read from the chained<br>filter.\n\n`early_change`: \\(Default 1\\) specifies whether to change codes 1<br>bit early.\n\n`min_bits`: \\(Default 9\\) specifies the minimum number of bits to<br>use.\n\n`reverse_bits`: \\(Default 0\\) allows for compatibility with gif and<br>old style tiffs \\(1\\).\n\n`old_tiff`: \\(Default 0\\) allows for different handling of the clear<br>code, as found in old style tiffs."]
    pub fn fz_open_lzwd(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        early_change: ::core::ffi::c_int,
        min_bits: ::core::ffi::c_int,
        reverse_bits: ::core::ffi::c_int,
        old_tiff: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "predict filter performs pixel prediction on data read from<br>the chained filter.\n\n`predictor`: 1 = copy, 2 = tiff, other = inline PNG predictor\n\n`columns`: width of image in pixels\n\n`colors`: number of components.\n\n`bpc`: bits per component \\(typically 8\\)"]
    pub fn fz_open_predict(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        predictor: ::core::ffi::c_int,
        columns: ::core::ffi::c_int,
        colors: ::core::ffi::c_int,
        bpc: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Open a filter that performs jbig2 decompression on the chained<br>stream, using the optional globals record."]
    pub fn fz_open_jbig2d(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        globals: *mut fz_jbig2_globals,
        embedded: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Create a jbig2 globals record from a buffer.\n\nImmutable once created."]
    pub fn fz_load_jbig2_globals(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
    ) -> *mut fz_jbig2_globals;
}
unsafe extern "C" {
    #[doc = "Increment the reference count for a jbig2 globals record.\n\nNever throws an exception."]
    pub fn fz_keep_jbig2_globals(
        ctx: *mut fz_context,
        globals: *mut fz_jbig2_globals,
    ) -> *mut fz_jbig2_globals;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for a jbig2 globals record.<br>When the reference count hits zero, the record is freed.\n\nNever throws an exception."]
    pub fn fz_drop_jbig2_globals(ctx: *mut fz_context, globals: *mut fz_jbig2_globals);
}
unsafe extern "C" {
    #[doc = "Special jbig2 globals drop function for use in implementing<br>store support."]
    pub fn fz_drop_jbig2_globals_imp(ctx: *mut fz_context, globals: *mut fz_storable);
}
unsafe extern "C" {
    #[doc = "Return buffer containing jbig2 globals data stream."]
    pub fn fz_jbig2_globals_data(
        ctx: *mut fz_context,
        globals: *mut fz_jbig2_globals,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "SGI Log 16bit \\(greyscale\\) decode from the chained filter.<br>Decodes lines of w pixels to 8bpp greyscale."]
    pub fn fz_open_sgilog16(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        w: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "SGI Log 24bit \\(LUV\\) decode from the chained filter.<br>Decodes lines of w pixels to 8bpc rgb."]
    pub fn fz_open_sgilog24(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        w: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "SGI Log 32bit \\(LUV\\) decode from the chained filter.<br>Decodes lines of w pixels to 8bpc rgb."]
    pub fn fz_open_sgilog32(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        w: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "4bit greyscale Thunderscan decoding from the chained filter.<br>Decodes lines of w pixels to 8bpp greyscale."]
    pub fn fz_open_thunder(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        w: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
#[doc = "Compression parameters used for buffers of compressed data;<br>typically for the source data for images."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_compression_params {
    pub type_: ::core::ffi::c_int,
    pub u: fz_compression_params__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_compression_params__bindgen_ty_1 {
    pub jpeg: fz_compression_params__bindgen_ty_1__bindgen_ty_1,
    pub jpx: fz_compression_params__bindgen_ty_1__bindgen_ty_2,
    pub jbig2: fz_compression_params__bindgen_ty_1__bindgen_ty_3,
    pub fax: fz_compression_params__bindgen_ty_1__bindgen_ty_4,
    pub flate: fz_compression_params__bindgen_ty_1__bindgen_ty_5,
    pub brotli: fz_compression_params__bindgen_ty_1__bindgen_ty_6,
    pub lzw: fz_compression_params__bindgen_ty_1__bindgen_ty_7,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compression_params__bindgen_ty_1__bindgen_ty_1 {
    pub color_transform: ::core::ffi::c_int,
    pub invert_cmyk: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_1>() - 8usize];
    ["Alignment of fz_compression_params__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_1>() - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_1::color_transform"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_1,
        color_transform
    )
        - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_1::invert_cmyk"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_1,
        invert_cmyk
    ) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compression_params__bindgen_ty_1__bindgen_ty_2 {
    pub smask_in_data: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_2>() - 4usize];
    ["Alignment of fz_compression_params__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_2>() - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_2::smask_in_data"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_2,
        smask_in_data
    )
        - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compression_params__bindgen_ty_1__bindgen_ty_3 {
    pub globals: *mut fz_jbig2_globals,
    pub embedded: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_3>() - 16usize];
    ["Alignment of fz_compression_params__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_3>() - 8usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_3::globals"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_3,
        globals
    ) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_3::embedded"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_3,
        embedded
    ) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compression_params__bindgen_ty_1__bindgen_ty_4 {
    pub columns: ::core::ffi::c_int,
    pub rows: ::core::ffi::c_int,
    pub k: ::core::ffi::c_int,
    pub end_of_line: ::core::ffi::c_int,
    pub encoded_byte_align: ::core::ffi::c_int,
    pub end_of_block: ::core::ffi::c_int,
    pub black_is_1: ::core::ffi::c_int,
    pub damaged_rows_before_error: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1__bindgen_ty_4"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_4>() - 32usize];
    ["Alignment of fz_compression_params__bindgen_ty_1__bindgen_ty_4"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_4>() - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::columns"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_4,
        columns
    ) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::rows"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1__bindgen_ty_4, rows) - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::k"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1__bindgen_ty_4, k) - 8usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::end_of_line"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_4,
        end_of_line
    )
        - 12usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::encoded_byte_align"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_4,
        encoded_byte_align
    )
        - 16usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::end_of_block"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_4,
        end_of_block
    )
        - 20usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::black_is_1"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_4,
        black_is_1
    ) - 24usize];
    [
        "Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_4::damaged_rows_before_error",
    ][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_4,
        damaged_rows_before_error
    ) - 28usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compression_params__bindgen_ty_1__bindgen_ty_5 {
    pub columns: ::core::ffi::c_int,
    pub colors: ::core::ffi::c_int,
    pub predictor: ::core::ffi::c_int,
    pub bpc: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1__bindgen_ty_5"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_5>() - 16usize];
    ["Alignment of fz_compression_params__bindgen_ty_1__bindgen_ty_5"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_5>() - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_5::columns"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_5,
        columns
    ) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_5::colors"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_5,
        colors
    ) - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_5::predictor"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_5,
        predictor
    ) - 8usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_5::bpc"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1__bindgen_ty_5, bpc) - 12usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compression_params__bindgen_ty_1__bindgen_ty_6 {
    pub columns: ::core::ffi::c_int,
    pub colors: ::core::ffi::c_int,
    pub predictor: ::core::ffi::c_int,
    pub bpc: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1__bindgen_ty_6"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_6>() - 16usize];
    ["Alignment of fz_compression_params__bindgen_ty_1__bindgen_ty_6"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_6>() - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_6::columns"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_6,
        columns
    ) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_6::colors"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_6,
        colors
    ) - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_6::predictor"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_6,
        predictor
    ) - 8usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_6::bpc"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1__bindgen_ty_6, bpc) - 12usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compression_params__bindgen_ty_1__bindgen_ty_7 {
    pub columns: ::core::ffi::c_int,
    pub colors: ::core::ffi::c_int,
    pub predictor: ::core::ffi::c_int,
    pub bpc: ::core::ffi::c_int,
    pub early_change: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1__bindgen_ty_7"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_7>() - 20usize];
    ["Alignment of fz_compression_params__bindgen_ty_1__bindgen_ty_7"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1__bindgen_ty_7>() - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_7::columns"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_7,
        columns
    ) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_7::colors"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_7,
        colors
    ) - 4usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_7::predictor"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_7,
        predictor
    ) - 8usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_7::bpc"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1__bindgen_ty_7, bpc) - 12usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1__bindgen_ty_7::early_change"][::core::mem::offset_of!(
        fz_compression_params__bindgen_ty_1__bindgen_ty_7,
        early_change
    )
        - 16usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params__bindgen_ty_1"]
        [::core::mem::size_of::<fz_compression_params__bindgen_ty_1>() - 32usize];
    ["Alignment of fz_compression_params__bindgen_ty_1"]
        [::core::mem::align_of::<fz_compression_params__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1::jpeg"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1, jpeg) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1::jpx"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1, jpx) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1::jbig2"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1, jbig2) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1::fax"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1, fax) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1::flate"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1, flate) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1::brotli"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1, brotli) - 0usize];
    ["Offset of field: fz_compression_params__bindgen_ty_1::lzw"]
        [::core::mem::offset_of!(fz_compression_params__bindgen_ty_1, lzw) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compression_params"][::core::mem::size_of::<fz_compression_params>() - 40usize];
    ["Alignment of fz_compression_params"]
        [::core::mem::align_of::<fz_compression_params>() - 8usize];
    ["Offset of field: fz_compression_params::type_"]
        [::core::mem::offset_of!(fz_compression_params, type_) - 0usize];
    ["Offset of field: fz_compression_params::u"]
        [::core::mem::offset_of!(fz_compression_params, u) - 8usize];
};
#[doc = "Buffers of compressed data; typically for the source data<br>for images."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_compressed_buffer {
    pub refs: ::core::ffi::c_int,
    pub params: fz_compression_params,
    pub buffer: *mut fz_buffer,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_compressed_buffer"][::core::mem::size_of::<fz_compressed_buffer>() - 56usize];
    ["Alignment of fz_compressed_buffer"][::core::mem::align_of::<fz_compressed_buffer>() - 8usize];
    ["Offset of field: fz_compressed_buffer::refs"]
        [::core::mem::offset_of!(fz_compressed_buffer, refs) - 0usize];
    ["Offset of field: fz_compressed_buffer::params"]
        [::core::mem::offset_of!(fz_compressed_buffer, params) - 8usize];
    ["Offset of field: fz_compressed_buffer::buffer"]
        [::core::mem::offset_of!(fz_compressed_buffer, buffer) - 48usize];
};
unsafe extern "C" {
    #[doc = "Take a reference to an [`fz_compressed_buffer`]."]
    pub fn fz_keep_compressed_buffer(
        ctx: *mut fz_context,
        cbuf: *mut fz_compressed_buffer,
    ) -> *mut fz_compressed_buffer;
}
unsafe extern "C" {
    #[doc = "Return the storage size used for a buffer and its data.<br>Used in implementing store handling.\n\nNever throws exceptions."]
    pub fn fz_compressed_buffer_size(buffer: *mut fz_compressed_buffer) -> usize;
}
unsafe extern "C" {
    #[doc = "Open a stream to read the decompressed version of a buffer."]
    pub fn fz_open_compressed_buffer(
        ctx: *mut fz_context,
        arg1: *mut fz_compressed_buffer,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Open a stream to read the decompressed version of a buffer,<br>with optional log2 subsampling.\n\nl2factor = `NULL` for no subsampling, or a pointer to an integer<br>containing the maximum log2 subsample factor acceptable \\(0 =<br>none, 1 = halve dimensions, 2 = quarter dimensions etc\\). If<br>non-`NULL`, then *l2factor will be updated on exit with the actual<br>log2 subsample factor achieved."]
    pub fn fz_open_image_decomp_stream_from_buffer(
        ctx: *mut fz_context,
        arg1: *mut fz_compressed_buffer,
        l2factor: *mut ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Open a stream to read the decompressed version of another stream<br>with optional log2 subsampling."]
    pub fn fz_open_image_decomp_stream(
        ctx: *mut fz_context,
        arg1: *mut fz_stream,
        arg2: *mut fz_compression_params,
        l2factor: *mut ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    #[doc = "Recognise image format strings in the first 8 bytes from image<br>data."]
    pub fn fz_recognize_image_format(
        ctx: *mut fz_context,
        p: *mut ::core::ffi::c_uchar,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Map from `FZ_IMAGE_*` value to string.\n\nThe returned string is static and therefore must not be freed."]
    pub fn fz_image_type_name(type_: ::core::ffi::c_int) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Map from \\(case sensitive\\) image type string to `FZ_IMAGE_*`<br>type value."]
    pub fn fz_lookup_image_type(type_: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
pub const FZ_IMAGE_UNKNOWN: _bindgen_ty_13 = 0;
pub const FZ_IMAGE_RAW: _bindgen_ty_13 = 1;
pub const FZ_IMAGE_FAX: _bindgen_ty_13 = 2;
pub const FZ_IMAGE_FLATE: _bindgen_ty_13 = 3;
pub const FZ_IMAGE_LZW: _bindgen_ty_13 = 4;
pub const FZ_IMAGE_RLD: _bindgen_ty_13 = 5;
pub const FZ_IMAGE_BROTLI: _bindgen_ty_13 = 6;
pub const FZ_IMAGE_BMP: _bindgen_ty_13 = 7;
pub const FZ_IMAGE_GIF: _bindgen_ty_13 = 8;
pub const FZ_IMAGE_JBIG2: _bindgen_ty_13 = 9;
pub const FZ_IMAGE_JPEG: _bindgen_ty_13 = 10;
pub const FZ_IMAGE_JPX: _bindgen_ty_13 = 11;
pub const FZ_IMAGE_JXR: _bindgen_ty_13 = 12;
pub const FZ_IMAGE_PNG: _bindgen_ty_13 = 13;
pub const FZ_IMAGE_PNM: _bindgen_ty_13 = 14;
pub const FZ_IMAGE_TIFF: _bindgen_ty_13 = 15;
pub const FZ_IMAGE_PSD: _bindgen_ty_13 = 16;
pub type _bindgen_ty_13 = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Drop a reference to a compressed buffer. Destroys the buffer<br>and frees any storage/other references held by it.\n\nNever throws exceptions."]
    pub fn fz_drop_compressed_buffer(ctx: *mut fz_context, buf: *mut fz_compressed_buffer);
}
unsafe extern "C" {
    #[doc = "Create a new, UNKNOWN format, compressed_buffer."]
    pub fn fz_new_compressed_buffer(ctx: *mut fz_context) -> *mut fz_compressed_buffer;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_int_heap {
    pub max: ::core::ffi::c_int,
    pub len: ::core::ffi::c_int,
    pub heap: *mut ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_int_heap"][::core::mem::size_of::<fz_int_heap>() - 16usize];
    ["Alignment of fz_int_heap"][::core::mem::align_of::<fz_int_heap>() - 8usize];
    ["Offset of field: fz_int_heap::max"][::core::mem::offset_of!(fz_int_heap, max) - 0usize];
    ["Offset of field: fz_int_heap::len"][::core::mem::offset_of!(fz_int_heap, len) - 4usize];
    ["Offset of field: fz_int_heap::heap"][::core::mem::offset_of!(fz_int_heap, heap) - 8usize];
};
unsafe extern "C" {
    pub fn fz_int_heap_insert(ctx: *mut fz_context, heap: *mut fz_int_heap, v: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn fz_int_heap_sort(ctx: *mut fz_context, heap: *mut fz_int_heap);
}
unsafe extern "C" {
    pub fn fz_int_heap_uniq(ctx: *mut fz_context, heap: *mut fz_int_heap);
}
unsafe extern "C" {
    pub fn fz_int_heap_dump(ctx: *mut fz_context, out: *mut fz_output, heap: *mut fz_int_heap);
}
unsafe extern "C" {
    pub fn fz_int_heap_debug(ctx: *mut fz_context, heap: *mut fz_int_heap);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_ptr_heap {
    pub max: ::core::ffi::c_int,
    pub len: ::core::ffi::c_int,
    pub heap: *mut *mut ::core::ffi::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_ptr_heap"][::core::mem::size_of::<fz_ptr_heap>() - 16usize];
    ["Alignment of fz_ptr_heap"][::core::mem::align_of::<fz_ptr_heap>() - 8usize];
    ["Offset of field: fz_ptr_heap::max"][::core::mem::offset_of!(fz_ptr_heap, max) - 0usize];
    ["Offset of field: fz_ptr_heap::len"][::core::mem::offset_of!(fz_ptr_heap, len) - 4usize];
    ["Offset of field: fz_ptr_heap::heap"][::core::mem::offset_of!(fz_ptr_heap, heap) - 8usize];
};
unsafe extern "C" {
    pub fn fz_ptr_heap_insert(
        ctx: *mut fz_context,
        heap: *mut fz_ptr_heap,
        v: *mut ::core::ffi::c_void,
        HEAP_CMP: ::core::option::Option<
            unsafe extern "C" fn(
                a: *mut *mut ::core::ffi::c_void,
                b: *mut *mut ::core::ffi::c_void,
            ) -> ::core::ffi::c_int,
        >,
    );
}
unsafe extern "C" {
    pub fn fz_ptr_heap_sort(
        ctx: *mut fz_context,
        heap: *mut fz_ptr_heap,
        HEAP_CMP: ::core::option::Option<
            unsafe extern "C" fn(
                a: *mut *mut ::core::ffi::c_void,
                b: *mut *mut ::core::ffi::c_void,
            ) -> ::core::ffi::c_int,
        >,
    );
}
unsafe extern "C" {
    pub fn fz_ptr_heap_uniq(
        ctx: *mut fz_context,
        heap: *mut fz_ptr_heap,
        HEAP_CMP: ::core::option::Option<
            unsafe extern "C" fn(
                a: *mut *mut ::core::ffi::c_void,
                b: *mut *mut ::core::ffi::c_void,
            ) -> ::core::ffi::c_int,
        >,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_int2 {
    pub a: ::core::ffi::c_int,
    pub b: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_int2"][::core::mem::size_of::<fz_int2>() - 8usize];
    ["Alignment of fz_int2"][::core::mem::align_of::<fz_int2>() - 4usize];
    ["Offset of field: fz_int2::a"][::core::mem::offset_of!(fz_int2, a) - 0usize];
    ["Offset of field: fz_int2::b"][::core::mem::offset_of!(fz_int2, b) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_int2_heap {
    pub max: ::core::ffi::c_int,
    pub len: ::core::ffi::c_int,
    pub heap: *mut fz_int2,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_int2_heap"][::core::mem::size_of::<fz_int2_heap>() - 16usize];
    ["Alignment of fz_int2_heap"][::core::mem::align_of::<fz_int2_heap>() - 8usize];
    ["Offset of field: fz_int2_heap::max"][::core::mem::offset_of!(fz_int2_heap, max) - 0usize];
    ["Offset of field: fz_int2_heap::len"][::core::mem::offset_of!(fz_int2_heap, len) - 4usize];
    ["Offset of field: fz_int2_heap::heap"][::core::mem::offset_of!(fz_int2_heap, heap) - 8usize];
};
unsafe extern "C" {
    pub fn fz_int2_heap_insert(ctx: *mut fz_context, heap: *mut fz_int2_heap, v: fz_int2);
}
unsafe extern "C" {
    pub fn fz_int2_heap_sort(ctx: *mut fz_context, heap: *mut fz_int2_heap);
}
unsafe extern "C" {
    pub fn fz_int2_heap_uniq(ctx: *mut fz_context, heap: *mut fz_int2_heap);
}
unsafe extern "C" {
    pub fn fz_int2_heap_dump(ctx: *mut fz_context, out: *mut fz_output, heap: *mut fz_int2_heap);
}
unsafe extern "C" {
    pub fn fz_int2_heap_debug(ctx: *mut fz_context, heap: *mut fz_int2_heap);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_intptr {
    pub a: ::core::ffi::c_int,
    pub b: *mut ::core::ffi::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_intptr"][::core::mem::size_of::<fz_intptr>() - 16usize];
    ["Alignment of fz_intptr"][::core::mem::align_of::<fz_intptr>() - 8usize];
    ["Offset of field: fz_intptr::a"][::core::mem::offset_of!(fz_intptr, a) - 0usize];
    ["Offset of field: fz_intptr::b"][::core::mem::offset_of!(fz_intptr, b) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_intptr_heap {
    pub max: ::core::ffi::c_int,
    pub len: ::core::ffi::c_int,
    pub heap: *mut fz_intptr,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_intptr_heap"][::core::mem::size_of::<fz_intptr_heap>() - 16usize];
    ["Alignment of fz_intptr_heap"][::core::mem::align_of::<fz_intptr_heap>() - 8usize];
    ["Offset of field: fz_intptr_heap::max"][::core::mem::offset_of!(fz_intptr_heap, max) - 0usize];
    ["Offset of field: fz_intptr_heap::len"][::core::mem::offset_of!(fz_intptr_heap, len) - 4usize];
    ["Offset of field: fz_intptr_heap::heap"]
        [::core::mem::offset_of!(fz_intptr_heap, heap) - 8usize];
};
unsafe extern "C" {
    pub fn fz_intptr_heap_insert(ctx: *mut fz_context, heap: *mut fz_intptr_heap, v: fz_intptr);
}
unsafe extern "C" {
    pub fn fz_intptr_heap_sort(ctx: *mut fz_context, heap: *mut fz_intptr_heap);
}
unsafe extern "C" {
    pub fn fz_intptr_heap_uniq(ctx: *mut fz_context, heap: *mut fz_intptr_heap);
}
unsafe extern "C" {
    pub fn fz_intptr_heap_dump(
        ctx: *mut fz_context,
        out: *mut fz_output,
        heap: *mut fz_intptr_heap,
    );
}
unsafe extern "C" {
    pub fn fz_intptr_heap_debug(ctx: *mut fz_context, heap: *mut fz_intptr_heap);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_compressed_image {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pixmap_image {
    _unused: [u8; 0],
}
unsafe extern "C" {
    #[doc = "Called to get a handle to a pixmap from an image.\n\n`image`: The image to retrieve a pixmap from.\n\n`subarea`: The subarea of the image that we actually care about<br>\\(or `NULL` to indicate the whole image\\).\n\n`ctm`: Optional, unless subarea is given. If given, then on<br>entry this is the transform that will be applied to the complete<br>image. It should be updated on exit to the transform to apply to<br>the given subarea of the image. This is used to calculate the<br>desired width/height for subsampling.\n\n`w`: If non-`NULL`, a pointer to an int to be updated on exit to the<br>width \\(in pixels\\) that the scaled output will cover.\n\n`h`: If non-`NULL`, a pointer to an int to be updated on exit to the<br>height \\(in pixels\\) that the scaled output will cover.\n\nReturns a non `NULL` kept pixmap pointer. May throw exceptions."]
    pub fn fz_get_pixmap_from_image(
        ctx: *mut fz_context,
        image: *mut fz_image,
        subarea: *const fz_irect,
        ctm: *mut fz_matrix,
        w: *mut ::core::ffi::c_int,
        h: *mut ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Like [`fz_get_pixmap_from_image`] but convert to an alpha only mask using<br>luminance if the image is grayscale or RGB."]
    pub fn fz_get_pixmap_mask_from_image(
        ctx: *mut fz_context,
        image: *mut fz_image,
        subarea: *const fz_irect,
        ctm: *mut fz_matrix,
        dw: *mut ::core::ffi::c_int,
        dh: *mut ::core::ffi::c_int,
        in_smask: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Calls [`fz_get_pixmap_from_image`]\\(\\) with ctm, subarea, w and h all set to `NULL`."]
    pub fn fz_get_unscaled_pixmap_from_image(
        ctx: *mut fz_context,
        image: *mut fz_image,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Increment the \\(normal\\) reference count for an image. Returns the<br>same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_image(ctx: *mut fz_context, image: *mut fz_image) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Decrement the \\(normal\\) reference count for an image. When the<br>total \\(normal + key\\) reference count reaches zero, the image and<br>its resources are freed.\n\nNever throws exceptions."]
    pub fn fz_drop_image(ctx: *mut fz_context, image: *mut fz_image);
}
unsafe extern "C" {
    #[doc = "Increment the store key reference for an image. Returns the same<br>pointer. \\(This is the count of references for an image held by<br>keys in the image store\\).\n\nNever throws exceptions."]
    pub fn fz_keep_image_store_key(ctx: *mut fz_context, image: *mut fz_image) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Decrement the store key reference count for an image. When the<br>total \\(normal + key\\) reference count reaches zero, the image and<br>its resources are freed.\n\nNever throws exceptions."]
    pub fn fz_drop_image_store_key(ctx: *mut fz_context, image: *mut fz_image);
}
#[doc = "Function type to destroy an images data<br>when it's reference count reaches zero."]
pub type fz_drop_image_fn =
    ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, image: *mut fz_image)>;
#[doc = "Function type to get a decoded pixmap for an image.\n\n`im`: The image to decode.\n\n`subarea`: `NULL`, or the subarea of the image required. Expressed<br>in terms of a rectangle in the original width/height of the<br>image. If non `NULL`, this should be updated by the function to<br>the actual subarea decoded - which must include the requested<br>area!\n\n`w`, `h`: The actual width and height that the whole image would<br>need to be decoded to.\n\n`l2factor`: On entry, the log 2 subsample factor required. If<br>possible the decode process can take care of \\(all or some\\) of<br>this subsampling, and must then update the value so the caller<br>knows what remains to be done.\n\nReturns a reference to a decoded pixmap that satisfies the<br>requirements of the request. The caller owns the returned<br>reference."]
pub type fz_image_get_pixmap_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        im: *mut fz_image,
        subarea: *mut fz_irect,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        l2factor: *mut ::core::ffi::c_int,
    ) -> *mut fz_pixmap,
>;
#[doc = "Function type to get the given storage<br>size for an image.\n\nReturns the size in bytes used for a given image."]
pub type fz_image_get_size_fn = ::core::option::Option<
    unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_image) -> usize,
>;
unsafe extern "C" {
    #[doc = "Internal function to make a new [`fz_image`] structure<br>for a derived class.\n\n`w,h`: Width and height of the created image.\n\n`bpc`: Bits per component.\n\n`colorspace`: The colorspace \\(determines the number of components,<br>and any color conversions required while decoding\\).\n\n`xres`, `yres`: The X and Y resolutions respectively.\n\n`interpolate`: 1 if interpolation should be used when decoding<br>this image, 0 otherwise.\n\n`imagemask`: 1 if this is an imagemask \\(i.e. transparent\\), 0<br>otherwise.\n\n`decode`: `NULL`, or a pointer to to a decode array. The default<br>decode array is \\[0 1\\] \\(repeated n times, for n color components\\).\n\n`colorkey`: `NULL`, or a pointer to a colorkey array. The default<br>colorkey array is \\[0 255\\] \\(repeated n times, for n color<br>components\\).\n\n`mask`: `NULL`, or another image to use as a mask for this one.<br>A new reference is taken to this image. Supplying a masked<br>image as a mask to another image is illegal!\n\n`size`: The size of the required allocated structure \\(the size of<br>the derived structure\\).\n\n`get`: The function to be called to obtain a decoded pixmap.\n\n`get_size`: The function to be called to return the storage size<br>used by this image.\n\n`drop`: The function to be called to dispose of this image once<br>the last reference is dropped.\n\nReturns a pointer to an allocated structure of the required size,<br>with the first sizeof\\([`fz_image`]\\) bytes initialised as appropriate<br>given the supplied parameters, and the other bytes set to zero."]
    pub fn fz_new_image_of_size(
        ctx: *mut fz_context,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        bpc: ::core::ffi::c_int,
        colorspace: *mut fz_colorspace,
        xres: ::core::ffi::c_int,
        yres: ::core::ffi::c_int,
        interpolate: ::core::ffi::c_int,
        imagemask: ::core::ffi::c_int,
        decode: *const f32,
        colorkey: *const ::core::ffi::c_int,
        mask: *mut fz_image,
        size: usize,
        get_pixmap: fz_image_get_pixmap_fn,
        get_size: fz_image_get_size_fn,
        drop: fz_drop_image_fn,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Create an image based on<br>the data in the supplied compressed buffer.\n\n`w,h`: Width and height of the created image.\n\n`bpc`: Bits per component.\n\n`colorspace`: The colorspace \\(determines the number of components,<br>and any color conversions required while decoding\\).\n\n`xres`, `yres`: The X and Y resolutions respectively.\n\n`interpolate`: 1 if interpolation should be used when decoding<br>this image, 0 otherwise.\n\n`imagemask`: 1 if this is an imagemask \\(i.e. transparency bitmap<br>mask\\), 0 otherwise.\n\n`decode`: `NULL`, or a pointer to to a decode array. The default<br>decode array is \\[0 1\\] \\(repeated n times, for n color components\\).\n\n`colorkey`: `NULL`, or a pointer to a colorkey array. The default<br>colorkey array is \\[0 255\\] \\(repeated n times, for n color<br>components\\).\n\n`buffer`: Buffer of compressed data and compression parameters.<br>Ownership of this reference is passed in.\n\n`mask`: `NULL`, or another image to use as a mask for this one.<br>A new reference is taken to this image. Supplying a masked<br>image as a mask to another image is illegal!"]
    pub fn fz_new_image_from_compressed_buffer(
        ctx: *mut fz_context,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        bpc: ::core::ffi::c_int,
        colorspace: *mut fz_colorspace,
        xres: ::core::ffi::c_int,
        yres: ::core::ffi::c_int,
        interpolate: ::core::ffi::c_int,
        imagemask: ::core::ffi::c_int,
        decode: *const f32,
        colorkey: *const ::core::ffi::c_int,
        buffer: *mut fz_compressed_buffer,
        mask: *mut fz_image,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Create an image from the given<br>pixmap.\n\n`pixmap`: The pixmap to base the image upon. A new reference<br>to this is taken.\n\n`mask`: `NULL`, or another image to use as a mask for this one.<br>A new reference is taken to this image. Supplying a masked<br>image as a mask to another image is illegal!"]
    pub fn fz_new_image_from_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        mask: *mut fz_image,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Create a new image from a<br>buffer of data, inferring its type from the format<br>of the data."]
    pub fn fz_new_image_from_buffer(ctx: *mut fz_context, buffer: *mut fz_buffer) -> *mut fz_image;
}
unsafe extern "C" {
    pub fn fz_new_jpx_image_from_buffer(
        ctx: *mut fz_context,
        buffer: *mut fz_buffer,
        cs: *mut fz_colorspace,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Create a new image from the contents<br>of a file, inferring its type from the format of the<br>data."]
    pub fn fz_new_image_from_file(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Internal destructor exposed for [`fz_store`] integration."]
    pub fn fz_drop_image_imp(ctx: *mut fz_context, image: *mut fz_storable);
}
unsafe extern "C" {
    #[doc = "Internal destructor for the base image class members.\n\nExposed to allow derived image classes to be written."]
    pub fn fz_drop_image_base(ctx: *mut fz_context, image: *mut fz_image);
}
unsafe extern "C" {
    #[doc = "Decode a subarea of a compressed image. l2factor is the amount<br>of subsampling inbuilt to the stream \\(i.e. performed by the<br>decoder\\). If non `NULL`, l2extra is the extra amount of<br>subsampling that should be performed by this routine. This will<br>be updated on exit to the amount of subsampling that is still<br>required to be done.\n\nReturns a kept reference."]
    pub fn fz_decomp_image_from_stream(
        ctx: *mut fz_context,
        stm: *mut fz_stream,
        image: *mut fz_compressed_image,
        subarea: *mut fz_irect,
        indexed: ::core::ffi::c_int,
        l2factor: ::core::ffi::c_int,
        l2extra: *mut ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Convert pixmap from indexed to base colorspace.\n\nThis creates a new bitmap containing the converted pixmap data."]
    pub fn fz_convert_indexed_pixmap_to_base(
        ctx: *mut fz_context,
        src: *const fz_pixmap,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Convert pixmap from DeviceN/Separation to base colorspace.\n\nThis creates a new bitmap containing the converted pixmap data."]
    pub fn fz_convert_separation_pixmap_to_base(
        ctx: *mut fz_context,
        src: *const fz_pixmap,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Return the size of the storage used by an image."]
    pub fn fz_image_size(ctx: *mut fz_context, im: *mut fz_image) -> usize;
}
unsafe extern "C" {
    #[doc = "Return the type of a compressed image.\n\nAny non-compressed image will have the type returned as UNKNOWN."]
    pub fn fz_compressed_image_type(
        ctx: *mut fz_context,
        image: *mut fz_image,
    ) -> ::core::ffi::c_int;
}
#[doc = "Structure is public to allow other structures to<br>be derived from it. Do not access members directly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_image {
    pub key_storable: fz_key_storable,
    pub w: ::core::ffi::c_int,
    pub h: ::core::ffi::c_int,
    pub n: u8,
    pub bpc: u8,
    pub _bitfield_align_1: [u8; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
    pub orientation: u8,
    pub mask: *mut fz_image,
    pub xres: ::core::ffi::c_int,
    pub yres: ::core::ffi::c_int,
    pub colorspace: *mut fz_colorspace,
    pub drop_image: fz_drop_image_fn,
    pub get_pixmap: fz_image_get_pixmap_fn,
    pub get_size: fz_image_get_size_fn,
    pub colorkey: [::core::ffi::c_int; 64usize],
    pub decode: [f32; 64usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_image"][::core::mem::size_of::<fz_image>() - 608usize];
    ["Alignment of fz_image"][::core::mem::align_of::<fz_image>() - 8usize];
    ["Offset of field: fz_image::key_storable"]
        [::core::mem::offset_of!(fz_image, key_storable) - 0usize];
    ["Offset of field: fz_image::w"][::core::mem::offset_of!(fz_image, w) - 32usize];
    ["Offset of field: fz_image::h"][::core::mem::offset_of!(fz_image, h) - 36usize];
    ["Offset of field: fz_image::n"][::core::mem::offset_of!(fz_image, n) - 40usize];
    ["Offset of field: fz_image::bpc"][::core::mem::offset_of!(fz_image, bpc) - 41usize];
    ["Offset of field: fz_image::orientation"]
        [::core::mem::offset_of!(fz_image, orientation) - 44usize];
    ["Offset of field: fz_image::mask"][::core::mem::offset_of!(fz_image, mask) - 48usize];
    ["Offset of field: fz_image::xres"][::core::mem::offset_of!(fz_image, xres) - 56usize];
    ["Offset of field: fz_image::yres"][::core::mem::offset_of!(fz_image, yres) - 60usize];
    ["Offset of field: fz_image::colorspace"]
        [::core::mem::offset_of!(fz_image, colorspace) - 64usize];
    ["Offset of field: fz_image::drop_image"]
        [::core::mem::offset_of!(fz_image, drop_image) - 72usize];
    ["Offset of field: fz_image::get_pixmap"]
        [::core::mem::offset_of!(fz_image, get_pixmap) - 80usize];
    ["Offset of field: fz_image::get_size"][::core::mem::offset_of!(fz_image, get_size) - 88usize];
    ["Offset of field: fz_image::colorkey"][::core::mem::offset_of!(fz_image, colorkey) - 96usize];
    ["Offset of field: fz_image::decode"][::core::mem::offset_of!(fz_image, decode) - 352usize];
};
impl fz_image {
    #[inline]
    pub fn imagemask(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_imagemask(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn imagemask_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_imagemask_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn interpolate(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_interpolate(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(1usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn interpolate_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                1usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_interpolate_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                1usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn use_colorkey(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_use_colorkey(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(2usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn use_colorkey_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                2usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_use_colorkey_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                2usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn use_decode(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_use_decode(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(3usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn use_decode_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                3usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_use_decode_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                3usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn decoded(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_decoded(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(4usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn decoded_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                4usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_decoded_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                4usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn scalable(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_scalable(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(5usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn scalable_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                5usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_scalable_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                5usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn intent(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u32) }
    }
    #[inline]
    pub fn set_intent(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(6usize, 2u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn intent_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                6usize,
                2u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_intent_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                6usize,
                2u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn has_intent(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_has_intent(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn has_intent_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                8usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_has_intent_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                8usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        imagemask: ::core::ffi::c_uint,
        interpolate: ::core::ffi::c_uint,
        use_colorkey: ::core::ffi::c_uint,
        use_decode: ::core::ffi::c_uint,
        decoded: ::core::ffi::c_uint,
        scalable: ::core::ffi::c_uint,
        intent: ::core::ffi::c_uint,
        has_intent: ::core::ffi::c_uint,
    ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let imagemask: u32 = unsafe { ::core::mem::transmute(imagemask) };
            imagemask as u64
        });
        __bindgen_bitfield_unit.set(1usize, 1u8, {
            let interpolate: u32 = unsafe { ::core::mem::transmute(interpolate) };
            interpolate as u64
        });
        __bindgen_bitfield_unit.set(2usize, 1u8, {
            let use_colorkey: u32 = unsafe { ::core::mem::transmute(use_colorkey) };
            use_colorkey as u64
        });
        __bindgen_bitfield_unit.set(3usize, 1u8, {
            let use_decode: u32 = unsafe { ::core::mem::transmute(use_decode) };
            use_decode as u64
        });
        __bindgen_bitfield_unit.set(4usize, 1u8, {
            let decoded: u32 = unsafe { ::core::mem::transmute(decoded) };
            decoded as u64
        });
        __bindgen_bitfield_unit.set(5usize, 1u8, {
            let scalable: u32 = unsafe { ::core::mem::transmute(scalable) };
            scalable as u64
        });
        __bindgen_bitfield_unit.set(6usize, 2u8, {
            let intent: u32 = unsafe { ::core::mem::transmute(intent) };
            intent as u64
        });
        __bindgen_bitfield_unit.set(8usize, 1u8, {
            let has_intent: u32 = unsafe { ::core::mem::transmute(has_intent) };
            has_intent as u64
        });
        __bindgen_bitfield_unit
    }
}
unsafe extern "C" {
    #[doc = "Request the natural resolution<br>of an image.\n\n`xres`, `yres`: Pointers to ints to be updated with the<br>natural resolution of an image \\(or a sensible default<br>if not encoded\\)."]
    pub fn fz_image_resolution(
        image: *mut fz_image,
        xres: *mut ::core::ffi::c_int,
        yres: *mut ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Request the natural orientation of an image.\n\nThis is for images \\(such as JPEG\\) that can contain internal<br>specifications of rotation/flips. This is ignored by all the<br>internal decode/rendering routines, but can be used by callers<br>\\(such as the image document handler\\) to respect such<br>specifications.\n\nThe values used by MuPDF are as follows, with the equivalent<br>Exif specifications given for information:\n\n`0`: Undefined<br>`1`: 0 degree ccw rotation. \\(Exif = 1\\)<br>`2`: 90 degree ccw rotation. \\(Exif = 8\\)<br>`3`: 180 degree ccw rotation. \\(Exif = 3\\)<br>`4`: 270 degree ccw rotation. \\(Exif = 6\\)<br>`5`: flip on X. \\(Exif = 2\\)<br>`6`: flip on X, then rotate ccw by 90 degrees. \\(Exif = 5\\)<br>`7`: flip on X, then rotate ccw by 180 degrees. \\(Exif = 4\\)<br>`8`: flip on X, then rotate ccw by 270 degrees. \\(Exif = 7\\)"]
    pub fn fz_image_orientation(ctx: *mut fz_context, image: *mut fz_image) -> u8;
}
unsafe extern "C" {
    pub fn fz_is_lossy_image(ctx: *mut fz_context, image: *mut fz_image) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_image_orientation_matrix(ctx: *mut fz_context, image: *mut fz_image) -> fz_matrix;
}
unsafe extern "C" {
    #[doc = "Retrieve the underlying compressed data for an image.\n\nReturns a pointer to the underlying data buffer for an image,<br>or `NULL` if this image is not based upon a compressed data<br>buffer.\n\nThis is not a reference counted structure, so no reference is<br>returned. Lifespan is limited to that of the image itself."]
    pub fn fz_compressed_image_buffer(
        ctx: *mut fz_context,
        image: *mut fz_image,
    ) -> *mut fz_compressed_buffer;
}
unsafe extern "C" {
    pub fn fz_set_compressed_image_buffer(
        ctx: *mut fz_context,
        cimg: *mut fz_compressed_image,
        buf: *mut fz_compressed_buffer,
    );
}
unsafe extern "C" {
    #[doc = "Retrieve the underlying [`fz_pixmap`] for an image.\n\nReturns a pointer to the underlying [`fz_pixmap`] for an image,<br>or `NULL` if this image is not based upon an [`fz_pixmap`].\n\nNo reference is returned. Lifespan is limited to that of<br>the image itself. If required, use [`fz_keep_pixmap`] to take<br>a reference to keep it longer."]
    pub fn fz_pixmap_image_tile(ctx: *mut fz_context, cimg: *mut fz_pixmap_image)
    -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_set_pixmap_image_tile(
        ctx: *mut fz_context,
        cimg: *mut fz_pixmap_image,
        pix: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Exposed for PDF."]
    pub fn fz_load_jpx(
        ctx: *mut fz_context,
        data: *const ::core::ffi::c_uchar,
        size: usize,
        cs: *mut fz_colorspace,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Exposed because compression and decompression need to share this."]
    pub fn fz_opj_lock(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn fz_opj_unlock(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Exposed for CBZ."]
    pub fn fz_load_tiff_subimage_count(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_load_tiff_subimage(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
        subimage: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_load_pnm_subimage_count(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_load_pnm_subimage(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
        subimage: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_load_jbig2_subimage_count(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_load_jbig2_subimage(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
        subimage: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_load_bmp_subimage_count(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_load_bmp_subimage(
        ctx: *mut fz_context,
        buf: *const ::core::ffi::c_uchar,
        len: usize,
        subimage: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
#[doc = "Bitmaps have 1 bit per component. Only used for creating<br>halftoned versions of contone buffers, and saving out. Samples<br>are stored msb first, akin to pbms.\n\nThe internals of this struct are considered implementation<br>details and subject to change. Where possible, accessor<br>functions should be used in preference."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_bitmap {
    pub refs: ::core::ffi::c_int,
    pub w: ::core::ffi::c_int,
    pub h: ::core::ffi::c_int,
    pub stride: ::core::ffi::c_int,
    pub n: ::core::ffi::c_int,
    pub xres: ::core::ffi::c_int,
    pub yres: ::core::ffi::c_int,
    pub samples: *mut ::core::ffi::c_uchar,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_bitmap"][::core::mem::size_of::<fz_bitmap>() - 40usize];
    ["Alignment of fz_bitmap"][::core::mem::align_of::<fz_bitmap>() - 8usize];
    ["Offset of field: fz_bitmap::refs"][::core::mem::offset_of!(fz_bitmap, refs) - 0usize];
    ["Offset of field: fz_bitmap::w"][::core::mem::offset_of!(fz_bitmap, w) - 4usize];
    ["Offset of field: fz_bitmap::h"][::core::mem::offset_of!(fz_bitmap, h) - 8usize];
    ["Offset of field: fz_bitmap::stride"][::core::mem::offset_of!(fz_bitmap, stride) - 12usize];
    ["Offset of field: fz_bitmap::n"][::core::mem::offset_of!(fz_bitmap, n) - 16usize];
    ["Offset of field: fz_bitmap::xres"][::core::mem::offset_of!(fz_bitmap, xres) - 20usize];
    ["Offset of field: fz_bitmap::yres"][::core::mem::offset_of!(fz_bitmap, yres) - 24usize];
    ["Offset of field: fz_bitmap::samples"][::core::mem::offset_of!(fz_bitmap, samples) - 32usize];
};
unsafe extern "C" {
    #[doc = "Take an additional reference to the bitmap. The same pointer<br>is returned.\n\nNever throws exceptions."]
    pub fn fz_keep_bitmap(ctx: *mut fz_context, bit: *mut fz_bitmap) -> *mut fz_bitmap;
}
unsafe extern "C" {
    #[doc = "Drop a reference to the bitmap. When the reference count reaches<br>zero, the bitmap will be destroyed.\n\nNever throws exceptions."]
    pub fn fz_drop_bitmap(ctx: *mut fz_context, bit: *mut fz_bitmap);
}
unsafe extern "C" {
    #[doc = "Invert bitmap.\n\nNever throws exceptions."]
    pub fn fz_invert_bitmap(ctx: *mut fz_context, bmp: *mut fz_bitmap);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_halftone {
    _unused: [u8; 0],
}
unsafe extern "C" {
    #[doc = "Make a bitmap from a pixmap and a halftone.\n\n`pix`: The pixmap to generate from. Currently must be a single<br>color component with no alpha.\n\n`ht`: The halftone to use. `NULL` implies the default halftone.\n\nReturns the resultant bitmap. Throws exceptions in the case of<br>failure to allocate."]
    pub fn fz_new_bitmap_from_pixmap(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        ht: *mut fz_halftone,
    ) -> *mut fz_bitmap;
}
unsafe extern "C" {
    #[doc = "Make a bitmap from a pixmap and a halftone.\n\n`img`: The image to generate from. Currently must be a single<br>color component with no alpha.\n\n`ht`: The halftone to use. `NULL` implies the default halftone.\n\nReturns the resultant bitmap. Throws exceptions in the case of<br>failure to allocate."]
    pub fn fz_new_bitmap_from_image(
        ctx: *mut fz_context,
        img: *mut fz_image,
        ht: *mut fz_halftone,
    ) -> *mut fz_bitmap;
}
unsafe extern "C" {
    #[doc = "Make a bitmap from a pixmap and a<br>halftone, allowing for the position of the pixmap within an<br>overall banded rendering.\n\n`pix`: The pixmap to generate from. Currently must be a single<br>color component with no alpha.\n\n`ht`: The halftone to use. `NULL` implies the default halftone.\n\n`band_start`: Vertical offset within the overall banded rendering<br>\\(in pixels\\)\n\nReturns the resultant bitmap. Throws exceptions in the case of<br>failure to allocate."]
    pub fn fz_new_bitmap_from_pixmap_band(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        ht: *mut fz_halftone,
        band_start: ::core::ffi::c_int,
    ) -> *mut fz_bitmap;
}
unsafe extern "C" {
    #[doc = "Create a new bitmap.\n\n`w`, `h`: Width and Height for the bitmap\n\n`n`: Number of color components \\(assumed to be a divisor of 8\\)\n\n`xres`, `yres`: X and Y resolutions \\(in pixels per inch\\).\n\nReturns pointer to created bitmap structure. The bitmap<br>data is uninitialised."]
    pub fn fz_new_bitmap(
        ctx: *mut fz_context,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        n: ::core::ffi::c_int,
        xres: ::core::ffi::c_int,
        yres: ::core::ffi::c_int,
    ) -> *mut fz_bitmap;
}
unsafe extern "C" {
    #[doc = "Retrieve details of a given bitmap.\n\n`bitmap`: The bitmap to query.\n\n`w`: Pointer to storage to retrieve width \\(or `NULL`\\).\n\n`h`: Pointer to storage to retrieve height \\(or `NULL`\\).\n\n`n`: Pointer to storage to retrieve number of color components \\(or<br>`NULL`\\).\n\n`stride`: Pointer to storage to retrieve bitmap stride \\(or `NULL`\\)."]
    pub fn fz_bitmap_details(
        bitmap: *mut fz_bitmap,
        w: *mut ::core::ffi::c_int,
        h: *mut ::core::ffi::c_int,
        n: *mut ::core::ffi::c_int,
        stride: *mut ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Set the entire bitmap to 0.\n\nNever throws exceptions."]
    pub fn fz_clear_bitmap(ctx: *mut fz_context, bit: *mut fz_bitmap);
}
unsafe extern "C" {
    #[doc = "Create a 'default' halftone structure<br>for the given number of components.\n\n`num_comps`: The number of components to use.\n\nReturns a simple default halftone. The default halftone uses<br>the same halftone tile for each plane, which may not be ideal<br>for all purposes."]
    pub fn fz_default_halftone(
        ctx: *mut fz_context,
        num_comps: ::core::ffi::c_int,
    ) -> *mut fz_halftone;
}
unsafe extern "C" {
    #[doc = "Take an additional reference to the halftone. The same pointer<br>is returned.\n\nNever throws exceptions."]
    pub fn fz_keep_halftone(ctx: *mut fz_context, half: *mut fz_halftone) -> *mut fz_halftone;
}
unsafe extern "C" {
    #[doc = "Drop a reference to the halftone. When the reference count<br>reaches zero, the halftone is destroyed.\n\nNever throws exceptions."]
    pub fn fz_drop_halftone(ctx: *mut fz_context, ht: *mut fz_halftone);
}
pub const FZ_FUNCTION_BASED: _bindgen_ty_14 = 1;
pub const FZ_LINEAR: _bindgen_ty_14 = 2;
pub const FZ_RADIAL: _bindgen_ty_14 = 3;
pub const FZ_MESH_TYPE4: _bindgen_ty_14 = 4;
pub const FZ_MESH_TYPE5: _bindgen_ty_14 = 5;
pub const FZ_MESH_TYPE6: _bindgen_ty_14 = 6;
pub const FZ_MESH_TYPE7: _bindgen_ty_14 = 7;
#[doc = "The shading code uses gouraud shaded triangle meshes."]
pub type _bindgen_ty_14 = ::core::ffi::c_uint;
#[doc = "Structure is public to allow derived classes. Do not<br>access the members directly."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_shade {
    pub storable: fz_storable,
    pub bbox: fz_rect,
    pub colorspace: *mut fz_colorspace,
    pub matrix: fz_matrix,
    pub use_background: ::core::ffi::c_int,
    pub background: [f32; 32usize],
    pub function_stride: ::core::ffi::c_int,
    pub function: *mut f32,
    pub type_: ::core::ffi::c_int,
    pub u: fz_shade__bindgen_ty_1,
    pub buffer: *mut fz_compressed_buffer,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_shade__bindgen_ty_1 {
    pub l_or_r: fz_shade__bindgen_ty_1__bindgen_ty_1,
    pub m: fz_shade__bindgen_ty_1__bindgen_ty_2,
    pub f: fz_shade__bindgen_ty_1__bindgen_ty_3,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_shade__bindgen_ty_1__bindgen_ty_1 {
    pub extend: [::core::ffi::c_int; 2usize],
    pub coords: [[f32; 3usize]; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_shade__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::size_of::<fz_shade__bindgen_ty_1__bindgen_ty_1>() - 32usize];
    ["Alignment of fz_shade__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::align_of::<fz_shade__bindgen_ty_1__bindgen_ty_1>() - 4usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_1::extend"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_1, extend) - 0usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_1::coords"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_1, coords) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_shade__bindgen_ty_1__bindgen_ty_2 {
    pub vprow: ::core::ffi::c_int,
    pub bpflag: ::core::ffi::c_int,
    pub bpcoord: ::core::ffi::c_int,
    pub bpcomp: ::core::ffi::c_int,
    pub x0: f32,
    pub x1: f32,
    pub y0: f32,
    pub y1: f32,
    pub c0: [f32; 32usize],
    pub c1: [f32; 32usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_shade__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::size_of::<fz_shade__bindgen_ty_1__bindgen_ty_2>() - 288usize];
    ["Alignment of fz_shade__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::align_of::<fz_shade__bindgen_ty_1__bindgen_ty_2>() - 4usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::vprow"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, vprow) - 0usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::bpflag"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, bpflag) - 4usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::bpcoord"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, bpcoord) - 8usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::bpcomp"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, bpcomp) - 12usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::x0"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, x0) - 16usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::x1"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, x1) - 20usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::y0"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, y0) - 24usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::y1"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, y1) - 28usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::c0"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, c0) - 32usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_2::c1"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_2, c1) - 160usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_shade__bindgen_ty_1__bindgen_ty_3 {
    pub matrix: fz_matrix,
    pub xdivs: ::core::ffi::c_int,
    pub ydivs: ::core::ffi::c_int,
    pub domain: [[f32; 2usize]; 2usize],
    pub fn_vals: *mut f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_shade__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::size_of::<fz_shade__bindgen_ty_1__bindgen_ty_3>() - 56usize];
    ["Alignment of fz_shade__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::align_of::<fz_shade__bindgen_ty_1__bindgen_ty_3>() - 8usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_3::matrix"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_3, matrix) - 0usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_3::xdivs"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_3, xdivs) - 24usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_3::ydivs"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_3, ydivs) - 28usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_3::domain"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_3, domain) - 32usize];
    ["Offset of field: fz_shade__bindgen_ty_1__bindgen_ty_3::fn_vals"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1__bindgen_ty_3, fn_vals) - 48usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_shade__bindgen_ty_1"][::core::mem::size_of::<fz_shade__bindgen_ty_1>() - 288usize];
    ["Alignment of fz_shade__bindgen_ty_1"]
        [::core::mem::align_of::<fz_shade__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_shade__bindgen_ty_1::l_or_r"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1, l_or_r) - 0usize];
    ["Offset of field: fz_shade__bindgen_ty_1::m"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1, m) - 0usize];
    ["Offset of field: fz_shade__bindgen_ty_1::f"]
        [::core::mem::offset_of!(fz_shade__bindgen_ty_1, f) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_shade"][::core::mem::size_of::<fz_shade>() - 520usize];
    ["Alignment of fz_shade"][::core::mem::align_of::<fz_shade>() - 8usize];
    ["Offset of field: fz_shade::storable"][::core::mem::offset_of!(fz_shade, storable) - 0usize];
    ["Offset of field: fz_shade::bbox"][::core::mem::offset_of!(fz_shade, bbox) - 24usize];
    ["Offset of field: fz_shade::colorspace"]
        [::core::mem::offset_of!(fz_shade, colorspace) - 40usize];
    ["Offset of field: fz_shade::matrix"][::core::mem::offset_of!(fz_shade, matrix) - 48usize];
    ["Offset of field: fz_shade::use_background"]
        [::core::mem::offset_of!(fz_shade, use_background) - 72usize];
    ["Offset of field: fz_shade::background"]
        [::core::mem::offset_of!(fz_shade, background) - 76usize];
    ["Offset of field: fz_shade::function_stride"]
        [::core::mem::offset_of!(fz_shade, function_stride) - 204usize];
    ["Offset of field: fz_shade::function"][::core::mem::offset_of!(fz_shade, function) - 208usize];
    ["Offset of field: fz_shade::type_"][::core::mem::offset_of!(fz_shade, type_) - 216usize];
    ["Offset of field: fz_shade::u"][::core::mem::offset_of!(fz_shade, u) - 224usize];
    ["Offset of field: fz_shade::buffer"][::core::mem::offset_of!(fz_shade, buffer) - 512usize];
};
unsafe extern "C" {
    #[doc = "Increment the reference count for the shade structure. The<br>same pointer is returned.\n\nNever throws exceptions."]
    pub fn fz_keep_shade(ctx: *mut fz_context, shade: *mut fz_shade) -> *mut fz_shade;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for the shade structure. When<br>the reference count hits zero, the structure is freed.\n\nNever throws exceptions."]
    pub fn fz_drop_shade(ctx: *mut fz_context, shade: *mut fz_shade);
}
unsafe extern "C" {
    #[doc = "Bound a given shading.\n\n`shade`: The shade to bound.\n\n`ctm`: The transform to apply to the shade before bounding.\n\n`r`: Pointer to storage to put the bounds in.\n\nReturns r, updated to contain the bounds for the shading."]
    pub fn fz_bound_shade(ctx: *mut fz_context, shade: *mut fz_shade, ctm: fz_matrix) -> fz_rect;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_shade_color_cache {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn fz_drop_shade_color_cache(ctx: *mut fz_context, cache: *mut fz_shade_color_cache);
}
unsafe extern "C" {
    #[doc = "Render a shade to a given pixmap.\n\n`shade`: The shade to paint.\n\n`override_cs`: `NULL`, or colorspace to override the shades<br>inbuilt colorspace.\n\n`ctm`: The transform to apply.\n\n`dest`: The pixmap to render into.\n\n`color_params`: The color rendering settings\n\n`bbox`: Pointer to a bounding box to limit the rendering<br>of the shade.\n\n`eop`: `NULL`, or pointer to overprint bitmap.\n\n`cache`: *cache is used to cache color information. If *cache is `NULL` it<br>is set to point to a new [`fz_shade_color_cache`]. If cache is `NULL` it is<br>ignored."]
    pub fn fz_paint_shade(
        ctx: *mut fz_context,
        shade: *mut fz_shade,
        override_cs: *mut fz_colorspace,
        ctm: fz_matrix,
        dest: *mut fz_pixmap,
        color_params: fz_color_params,
        bbox: fz_irect,
        eop: *const fz_overprint,
        cache: *mut *mut fz_shade_color_cache,
    );
}
#[doc = "Handy routine for processing mesh based shades"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_vertex {
    pub p: fz_point,
    pub c: [f32; 32usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_vertex"][::core::mem::size_of::<fz_vertex>() - 136usize];
    ["Alignment of fz_vertex"][::core::mem::align_of::<fz_vertex>() - 4usize];
    ["Offset of field: fz_vertex::p"][::core::mem::offset_of!(fz_vertex, p) - 0usize];
    ["Offset of field: fz_vertex::c"][::core::mem::offset_of!(fz_vertex, c) - 8usize];
};
#[doc = "Callback function type for use with<br>[`fz_process_shade`].\n\n`arg`: Opaque pointer from [`fz_process_shade`] caller.\n\n`v`: Pointer to a [`fz_vertex`] structure to populate.\n\n`c`: Pointer to an array of floats used to populate v."]
pub type fz_shade_prepare_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        arg: *mut ::core::ffi::c_void,
        v: *mut fz_vertex,
        c: *const f32,
    ),
>;
#[doc = "Callback function type for use with<br>[`fz_process_shade`].\n\n`arg`: Opaque pointer from [`fz_process_shade`] caller.\n\n`av`, `bv`, `cv`: Pointers to a [`fz_vertex`] structure describing<br>the corner locations and colors of a triangle to be<br>filled."]
pub type fz_shade_process_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        arg: *mut ::core::ffi::c_void,
        av: *mut fz_vertex,
        bv: *mut fz_vertex,
        cv: *mut fz_vertex,
    ),
>;
unsafe extern "C" {
    #[doc = "Process a shade, using supplied callback functions. This<br>decomposes the shading to a mesh \\(even ones that are not<br>natively meshes, such as linear or radial shadings\\), and<br>processes triangles from those meshes.\n\n`shade`: The shade to process.\n\n`ctm`: The transform to use\n\n`prepare`: Callback function to 'prepare' each vertex.<br>This function is passed an array of floats, and populates<br>a [`fz_vertex`] structure.\n\n`process`: This function is passed 3 pointers to vertex<br>structures, and actually performs the processing \\(typically<br>filling the area between the vertices\\).\n\n`process_arg`: An opaque argument passed through from caller<br>to callback functions."]
    pub fn fz_process_shade(
        ctx: *mut fz_context,
        shade: *mut fz_shade,
        ctm: fz_matrix,
        scissor: fz_rect,
        prepare: fz_shade_prepare_fn,
        process: fz_shade_process_fn,
        process_arg: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Internal function to destroy a<br>shade. Only exposed for use with the [`fz_store`].\n\n`shade`: The reference to destroy."]
    pub fn fz_drop_shade_imp(ctx: *mut fz_context, shade: *mut fz_storable);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_glyph {
    _unused: [u8; 0],
}
unsafe extern "C" {
    #[doc = "Return the bounding box of the glyph in pixels."]
    pub fn fz_glyph_bbox(ctx: *mut fz_context, glyph: *mut fz_glyph) -> fz_irect;
}
unsafe extern "C" {
    pub fn fz_glyph_bbox_no_ctx(src: *mut fz_glyph) -> fz_irect;
}
unsafe extern "C" {
    #[doc = "Return the width of the glyph in pixels."]
    pub fn fz_glyph_width(ctx: *mut fz_context, glyph: *mut fz_glyph) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the height of the glyph in pixels."]
    pub fn fz_glyph_height(ctx: *mut fz_context, glyph: *mut fz_glyph) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Take a reference to a glyph.\n\n`pix`: The glyph to increment the reference for.\n\nReturns pix."]
    pub fn fz_keep_glyph(ctx: *mut fz_context, pix: *mut fz_glyph) -> *mut fz_glyph;
}
unsafe extern "C" {
    #[doc = "Drop a reference and free a glyph.\n\nDecrement the reference count for the glyph. When no<br>references remain the glyph will be freed."]
    pub fn fz_drop_glyph(ctx: *mut fz_context, pix: *mut fz_glyph);
}
unsafe extern "C" {
    #[doc = "Look a glyph up from a font, and return the outline of the<br>glyph using the given transform.\n\nThe caller owns the returned path, and so is responsible for<br>ensuring that it eventually gets dropped."]
    pub fn fz_outline_glyph(
        ctx: *mut fz_context,
        font: *mut fz_font,
        gid: ::core::ffi::c_int,
        ctm: fz_matrix,
    ) -> *mut fz_path;
}
pub const FZ_DEVFLAG_MASK: _bindgen_ty_15 = 1;
pub const FZ_DEVFLAG_COLOR: _bindgen_ty_15 = 2;
pub const FZ_DEVFLAG_UNCACHEABLE: _bindgen_ty_15 = 4;
pub const FZ_DEVFLAG_FILLCOLOR_UNDEFINED: _bindgen_ty_15 = 8;
pub const FZ_DEVFLAG_STROKECOLOR_UNDEFINED: _bindgen_ty_15 = 16;
pub const FZ_DEVFLAG_STARTCAP_UNDEFINED: _bindgen_ty_15 = 32;
pub const FZ_DEVFLAG_DASHCAP_UNDEFINED: _bindgen_ty_15 = 64;
pub const FZ_DEVFLAG_ENDCAP_UNDEFINED: _bindgen_ty_15 = 128;
pub const FZ_DEVFLAG_LINEJOIN_UNDEFINED: _bindgen_ty_15 = 256;
pub const FZ_DEVFLAG_MITERLIMIT_UNDEFINED: _bindgen_ty_15 = 512;
pub const FZ_DEVFLAG_LINEWIDTH_UNDEFINED: _bindgen_ty_15 = 1024;
pub const FZ_DEVFLAG_BBOX_DEFINED: _bindgen_ty_15 = 2048;
pub const FZ_DEVFLAG_GRIDFIT_AS_TILED: _bindgen_ty_15 = 4096;
pub const FZ_DEVFLAG_DASH_PATTERN_UNDEFINED: _bindgen_ty_15 = 8192;
pub type _bindgen_ty_15 = ::core::ffi::c_uint;
pub const FZ_BLEND_NORMAL: _bindgen_ty_16 = 0;
pub const FZ_BLEND_MULTIPLY: _bindgen_ty_16 = 1;
pub const FZ_BLEND_SCREEN: _bindgen_ty_16 = 2;
pub const FZ_BLEND_OVERLAY: _bindgen_ty_16 = 3;
pub const FZ_BLEND_DARKEN: _bindgen_ty_16 = 4;
pub const FZ_BLEND_LIGHTEN: _bindgen_ty_16 = 5;
pub const FZ_BLEND_COLOR_DODGE: _bindgen_ty_16 = 6;
pub const FZ_BLEND_COLOR_BURN: _bindgen_ty_16 = 7;
pub const FZ_BLEND_HARD_LIGHT: _bindgen_ty_16 = 8;
pub const FZ_BLEND_SOFT_LIGHT: _bindgen_ty_16 = 9;
pub const FZ_BLEND_DIFFERENCE: _bindgen_ty_16 = 10;
pub const FZ_BLEND_EXCLUSION: _bindgen_ty_16 = 11;
pub const FZ_BLEND_HUE: _bindgen_ty_16 = 12;
pub const FZ_BLEND_SATURATION: _bindgen_ty_16 = 13;
pub const FZ_BLEND_COLOR: _bindgen_ty_16 = 14;
pub const FZ_BLEND_LUMINOSITY: _bindgen_ty_16 = 15;
pub const FZ_BLEND_MODEMASK: _bindgen_ty_16 = 15;
pub const FZ_BLEND_ISOLATED: _bindgen_ty_16 = 16;
pub const FZ_BLEND_KNOCKOUT: _bindgen_ty_16 = 32;
pub type _bindgen_ty_16 = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Map from \\(case sensitive\\) blend mode string to enumeration."]
    pub fn fz_lookup_blendmode(name: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Map from enumeration to blend mode string.\n\nThe string is static, with arbitrary lifespan."]
    pub fn fz_blendmode_name(blendmode: ::core::ffi::c_int) -> *const ::core::ffi::c_char;
}
pub type fz_function_eval_fn = ::core::option::Option<
    unsafe extern "C" fn(
        arg1: *mut fz_context,
        arg2: *mut fz_function,
        arg3: *const f32,
        arg4: *mut f32,
    ),
>;
pub const FZ_FUNCTION_MAX_N: _bindgen_ty_17 = 32;
pub const FZ_FUNCTION_MAX_M: _bindgen_ty_17 = 32;
pub type _bindgen_ty_17 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_function {
    pub storable: fz_storable,
    pub size: usize,
    pub m: ::core::ffi::c_int,
    pub n: ::core::ffi::c_int,
    pub eval: fz_function_eval_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_function"][::core::mem::size_of::<fz_function>() - 48usize];
    ["Alignment of fz_function"][::core::mem::align_of::<fz_function>() - 8usize];
    ["Offset of field: fz_function::storable"]
        [::core::mem::offset_of!(fz_function, storable) - 0usize];
    ["Offset of field: fz_function::size"][::core::mem::offset_of!(fz_function, size) - 24usize];
    ["Offset of field: fz_function::m"][::core::mem::offset_of!(fz_function, m) - 32usize];
    ["Offset of field: fz_function::n"][::core::mem::offset_of!(fz_function, n) - 36usize];
    ["Offset of field: fz_function::eval"][::core::mem::offset_of!(fz_function, eval) - 40usize];
};
unsafe extern "C" {
    pub fn fz_new_function_of_size(
        ctx: *mut fz_context,
        size: ::core::ffi::c_int,
        size2: usize,
        m: ::core::ffi::c_int,
        n: ::core::ffi::c_int,
        eval: fz_function_eval_fn,
        drop: fz_store_drop_fn,
    ) -> *mut fz_function;
}
unsafe extern "C" {
    pub fn fz_eval_function(
        ctx: *mut fz_context,
        func: *mut fz_function,
        in_: *const f32,
        inlen: ::core::ffi::c_int,
        out: *mut f32,
        outlen: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_keep_function(ctx: *mut fz_context, func: *mut fz_function) -> *mut fz_function;
}
unsafe extern "C" {
    pub fn fz_drop_function(ctx: *mut fz_context, func: *mut fz_function);
}
unsafe extern "C" {
    pub fn fz_function_size(ctx: *mut fz_context, func: *mut fz_function) -> usize;
}
#[doc = "Devices can keep track of containers \\(clips/masks/groups/tiles\\)<br>as they go to save callers having to do it."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_device_container_stack {
    pub scissor: fz_rect,
    pub type_: ::core::ffi::c_int,
    pub user: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_device_container_stack"]
        [::core::mem::size_of::<fz_device_container_stack>() - 24usize];
    ["Alignment of fz_device_container_stack"]
        [::core::mem::align_of::<fz_device_container_stack>() - 4usize];
    ["Offset of field: fz_device_container_stack::scissor"]
        [::core::mem::offset_of!(fz_device_container_stack, scissor) - 0usize];
    ["Offset of field: fz_device_container_stack::type_"]
        [::core::mem::offset_of!(fz_device_container_stack, type_) - 16usize];
    ["Offset of field: fz_device_container_stack::user"]
        [::core::mem::offset_of!(fz_device_container_stack, user) - 20usize];
};
pub const fz_device_container_stack_is_clip: _bindgen_ty_18 = 0;
pub const fz_device_container_stack_is_mask: _bindgen_ty_18 = 1;
pub const fz_device_container_stack_is_group: _bindgen_ty_18 = 2;
pub const fz_device_container_stack_is_tile: _bindgen_ty_18 = 3;
pub type _bindgen_ty_18 = ::core::ffi::c_uint;
pub const FZ_STRUCTURE_INVALID: fz_structure = -1;
pub const FZ_STRUCTURE_DOCUMENT: fz_structure = 0;
pub const FZ_STRUCTURE_PART: fz_structure = 1;
pub const FZ_STRUCTURE_ART: fz_structure = 2;
pub const FZ_STRUCTURE_SECT: fz_structure = 3;
pub const FZ_STRUCTURE_DIV: fz_structure = 4;
pub const FZ_STRUCTURE_BLOCKQUOTE: fz_structure = 5;
pub const FZ_STRUCTURE_CAPTION: fz_structure = 6;
pub const FZ_STRUCTURE_TOC: fz_structure = 7;
pub const FZ_STRUCTURE_TOCI: fz_structure = 8;
pub const FZ_STRUCTURE_INDEX: fz_structure = 9;
pub const FZ_STRUCTURE_NONSTRUCT: fz_structure = 10;
pub const FZ_STRUCTURE_PRIVATE: fz_structure = 11;
pub const FZ_STRUCTURE_DOCUMENTFRAGMENT: fz_structure = 12;
pub const FZ_STRUCTURE_ASIDE: fz_structure = 13;
pub const FZ_STRUCTURE_TITLE: fz_structure = 14;
pub const FZ_STRUCTURE_FENOTE: fz_structure = 15;
pub const FZ_STRUCTURE_SUB: fz_structure = 16;
pub const FZ_STRUCTURE_P: fz_structure = 17;
pub const FZ_STRUCTURE_H: fz_structure = 18;
pub const FZ_STRUCTURE_H1: fz_structure = 19;
pub const FZ_STRUCTURE_H2: fz_structure = 20;
pub const FZ_STRUCTURE_H3: fz_structure = 21;
pub const FZ_STRUCTURE_H4: fz_structure = 22;
pub const FZ_STRUCTURE_H5: fz_structure = 23;
pub const FZ_STRUCTURE_H6: fz_structure = 24;
pub const FZ_STRUCTURE_LIST: fz_structure = 25;
pub const FZ_STRUCTURE_LISTITEM: fz_structure = 26;
pub const FZ_STRUCTURE_LABEL: fz_structure = 27;
pub const FZ_STRUCTURE_LISTBODY: fz_structure = 28;
pub const FZ_STRUCTURE_TABLE: fz_structure = 29;
pub const FZ_STRUCTURE_TR: fz_structure = 30;
pub const FZ_STRUCTURE_TH: fz_structure = 31;
pub const FZ_STRUCTURE_TD: fz_structure = 32;
pub const FZ_STRUCTURE_THEAD: fz_structure = 33;
pub const FZ_STRUCTURE_TBODY: fz_structure = 34;
pub const FZ_STRUCTURE_TFOOT: fz_structure = 35;
pub const FZ_STRUCTURE_SPAN: fz_structure = 36;
pub const FZ_STRUCTURE_QUOTE: fz_structure = 37;
pub const FZ_STRUCTURE_NOTE: fz_structure = 38;
pub const FZ_STRUCTURE_REFERENCE: fz_structure = 39;
pub const FZ_STRUCTURE_BIBENTRY: fz_structure = 40;
pub const FZ_STRUCTURE_CODE: fz_structure = 41;
pub const FZ_STRUCTURE_LINK: fz_structure = 42;
pub const FZ_STRUCTURE_ANNOT: fz_structure = 43;
pub const FZ_STRUCTURE_EM: fz_structure = 44;
pub const FZ_STRUCTURE_STRONG: fz_structure = 45;
pub const FZ_STRUCTURE_RUBY: fz_structure = 46;
pub const FZ_STRUCTURE_RB: fz_structure = 47;
pub const FZ_STRUCTURE_RT: fz_structure = 48;
pub const FZ_STRUCTURE_RP: fz_structure = 49;
pub const FZ_STRUCTURE_WARICHU: fz_structure = 50;
pub const FZ_STRUCTURE_WT: fz_structure = 51;
pub const FZ_STRUCTURE_WP: fz_structure = 52;
pub const FZ_STRUCTURE_FIGURE: fz_structure = 53;
pub const FZ_STRUCTURE_FORMULA: fz_structure = 54;
pub const FZ_STRUCTURE_FORM: fz_structure = 55;
pub const FZ_STRUCTURE_ARTIFACT: fz_structure = 56;
pub type fz_structure = ::core::ffi::c_int;
unsafe extern "C" {
    pub fn fz_structure_to_string(type_: fz_structure) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_structure_from_string(str_: *const ::core::ffi::c_char) -> fz_structure;
}
pub const FZ_METATEXT_ACTUALTEXT: fz_metatext = 0;
pub const FZ_METATEXT_ALT: fz_metatext = 1;
pub const FZ_METATEXT_ABBREVIATION: fz_metatext = 2;
pub const FZ_METATEXT_TITLE: fz_metatext = 3;
pub type fz_metatext = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_device {
    pub refs: ::core::ffi::c_int,
    pub hints: ::core::ffi::c_int,
    pub flags: ::core::ffi::c_int,
    pub close_device:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub drop_device:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub fill_path: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_path,
            even_odd: ::core::ffi::c_int,
            arg4: fz_matrix,
            arg5: *mut fz_colorspace,
            color: *const f32,
            alpha: f32,
            arg6: fz_color_params,
        ),
    >,
    pub stroke_path: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_path,
            arg4: *const fz_stroke_state,
            arg5: fz_matrix,
            arg6: *mut fz_colorspace,
            color: *const f32,
            alpha: f32,
            arg7: fz_color_params,
        ),
    >,
    pub clip_path: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_path,
            even_odd: ::core::ffi::c_int,
            arg4: fz_matrix,
            scissor: fz_rect,
        ),
    >,
    pub clip_stroke_path: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_path,
            arg4: *const fz_stroke_state,
            arg5: fz_matrix,
            scissor: fz_rect,
        ),
    >,
    pub fill_text: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_text,
            arg4: fz_matrix,
            arg5: *mut fz_colorspace,
            color: *const f32,
            alpha: f32,
            arg6: fz_color_params,
        ),
    >,
    pub stroke_text: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_text,
            arg4: *const fz_stroke_state,
            arg5: fz_matrix,
            arg6: *mut fz_colorspace,
            color: *const f32,
            alpha: f32,
            arg7: fz_color_params,
        ),
    >,
    pub clip_text: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_text,
            arg4: fz_matrix,
            scissor: fz_rect,
        ),
    >,
    pub clip_stroke_text: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_text,
            arg4: *const fz_stroke_state,
            arg5: fz_matrix,
            scissor: fz_rect,
        ),
    >,
    pub ignore_text: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *const fz_text,
            arg4: fz_matrix,
        ),
    >,
    pub fill_shade: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            shd: *mut fz_shade,
            ctm: fz_matrix,
            alpha: f32,
            color_params: fz_color_params,
        ),
    >,
    pub fill_image: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            img: *mut fz_image,
            ctm: fz_matrix,
            alpha: f32,
            color_params: fz_color_params,
        ),
    >,
    pub fill_image_mask: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            img: *mut fz_image,
            ctm: fz_matrix,
            arg3: *mut fz_colorspace,
            color: *const f32,
            alpha: f32,
            color_params: fz_color_params,
        ),
    >,
    pub clip_image_mask: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            img: *mut fz_image,
            ctm: fz_matrix,
            scissor: fz_rect,
        ),
    >,
    pub pop_clip:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub begin_mask: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            area: fz_rect,
            luminosity: ::core::ffi::c_int,
            arg3: *mut fz_colorspace,
            bc: *const f32,
            arg4: fz_color_params,
        ),
    >,
    pub end_mask: ::core::option::Option<
        unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device, fn_: *mut fz_function),
    >,
    pub begin_group: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            area: fz_rect,
            cs: *mut fz_colorspace,
            isolated: ::core::ffi::c_int,
            knockout: ::core::ffi::c_int,
            blendmode: ::core::ffi::c_int,
            alpha: f32,
        ),
    >,
    pub end_group:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub begin_tile: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            area: fz_rect,
            view: fz_rect,
            xstep: f32,
            ystep: f32,
            ctm: fz_matrix,
            id: ::core::ffi::c_int,
            doc_id: ::core::ffi::c_int,
        ) -> ::core::ffi::c_int,
    >,
    pub end_tile:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub render_flags: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            set: ::core::ffi::c_int,
            clear: ::core::ffi::c_int,
        ),
    >,
    pub set_default_colorspaces: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            arg3: *mut fz_default_colorspaces,
        ),
    >,
    pub begin_layer: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            layer_name: *const ::core::ffi::c_char,
        ),
    >,
    pub end_layer:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub begin_structure: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            standard: fz_structure,
            raw: *const ::core::ffi::c_char,
            idx: ::core::ffi::c_int,
        ),
    >,
    pub end_structure:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub begin_metatext: ::core::option::Option<
        unsafe extern "C" fn(
            arg1: *mut fz_context,
            arg2: *mut fz_device,
            meta: fz_metatext,
            text: *const ::core::ffi::c_char,
        ),
    >,
    pub end_metatext:
        ::core::option::Option<unsafe extern "C" fn(arg1: *mut fz_context, arg2: *mut fz_device)>,
    pub d1_rect: fz_rect,
    pub container_len: ::core::ffi::c_int,
    pub container_cap: ::core::ffi::c_int,
    pub container: *mut fz_device_container_stack,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_device"][::core::mem::size_of::<fz_device>() - 288usize];
    ["Alignment of fz_device"][::core::mem::align_of::<fz_device>() - 8usize];
    ["Offset of field: fz_device::refs"][::core::mem::offset_of!(fz_device, refs) - 0usize];
    ["Offset of field: fz_device::hints"][::core::mem::offset_of!(fz_device, hints) - 4usize];
    ["Offset of field: fz_device::flags"][::core::mem::offset_of!(fz_device, flags) - 8usize];
    ["Offset of field: fz_device::close_device"]
        [::core::mem::offset_of!(fz_device, close_device) - 16usize];
    ["Offset of field: fz_device::drop_device"]
        [::core::mem::offset_of!(fz_device, drop_device) - 24usize];
    ["Offset of field: fz_device::fill_path"]
        [::core::mem::offset_of!(fz_device, fill_path) - 32usize];
    ["Offset of field: fz_device::stroke_path"]
        [::core::mem::offset_of!(fz_device, stroke_path) - 40usize];
    ["Offset of field: fz_device::clip_path"]
        [::core::mem::offset_of!(fz_device, clip_path) - 48usize];
    ["Offset of field: fz_device::clip_stroke_path"]
        [::core::mem::offset_of!(fz_device, clip_stroke_path) - 56usize];
    ["Offset of field: fz_device::fill_text"]
        [::core::mem::offset_of!(fz_device, fill_text) - 64usize];
    ["Offset of field: fz_device::stroke_text"]
        [::core::mem::offset_of!(fz_device, stroke_text) - 72usize];
    ["Offset of field: fz_device::clip_text"]
        [::core::mem::offset_of!(fz_device, clip_text) - 80usize];
    ["Offset of field: fz_device::clip_stroke_text"]
        [::core::mem::offset_of!(fz_device, clip_stroke_text) - 88usize];
    ["Offset of field: fz_device::ignore_text"]
        [::core::mem::offset_of!(fz_device, ignore_text) - 96usize];
    ["Offset of field: fz_device::fill_shade"]
        [::core::mem::offset_of!(fz_device, fill_shade) - 104usize];
    ["Offset of field: fz_device::fill_image"]
        [::core::mem::offset_of!(fz_device, fill_image) - 112usize];
    ["Offset of field: fz_device::fill_image_mask"]
        [::core::mem::offset_of!(fz_device, fill_image_mask) - 120usize];
    ["Offset of field: fz_device::clip_image_mask"]
        [::core::mem::offset_of!(fz_device, clip_image_mask) - 128usize];
    ["Offset of field: fz_device::pop_clip"]
        [::core::mem::offset_of!(fz_device, pop_clip) - 136usize];
    ["Offset of field: fz_device::begin_mask"]
        [::core::mem::offset_of!(fz_device, begin_mask) - 144usize];
    ["Offset of field: fz_device::end_mask"]
        [::core::mem::offset_of!(fz_device, end_mask) - 152usize];
    ["Offset of field: fz_device::begin_group"]
        [::core::mem::offset_of!(fz_device, begin_group) - 160usize];
    ["Offset of field: fz_device::end_group"]
        [::core::mem::offset_of!(fz_device, end_group) - 168usize];
    ["Offset of field: fz_device::begin_tile"]
        [::core::mem::offset_of!(fz_device, begin_tile) - 176usize];
    ["Offset of field: fz_device::end_tile"]
        [::core::mem::offset_of!(fz_device, end_tile) - 184usize];
    ["Offset of field: fz_device::render_flags"]
        [::core::mem::offset_of!(fz_device, render_flags) - 192usize];
    ["Offset of field: fz_device::set_default_colorspaces"]
        [::core::mem::offset_of!(fz_device, set_default_colorspaces) - 200usize];
    ["Offset of field: fz_device::begin_layer"]
        [::core::mem::offset_of!(fz_device, begin_layer) - 208usize];
    ["Offset of field: fz_device::end_layer"]
        [::core::mem::offset_of!(fz_device, end_layer) - 216usize];
    ["Offset of field: fz_device::begin_structure"]
        [::core::mem::offset_of!(fz_device, begin_structure) - 224usize];
    ["Offset of field: fz_device::end_structure"]
        [::core::mem::offset_of!(fz_device, end_structure) - 232usize];
    ["Offset of field: fz_device::begin_metatext"]
        [::core::mem::offset_of!(fz_device, begin_metatext) - 240usize];
    ["Offset of field: fz_device::end_metatext"]
        [::core::mem::offset_of!(fz_device, end_metatext) - 248usize];
    ["Offset of field: fz_device::d1_rect"][::core::mem::offset_of!(fz_device, d1_rect) - 256usize];
    ["Offset of field: fz_device::container_len"]
        [::core::mem::offset_of!(fz_device, container_len) - 272usize];
    ["Offset of field: fz_device::container_cap"]
        [::core::mem::offset_of!(fz_device, container_cap) - 276usize];
    ["Offset of field: fz_device::container"]
        [::core::mem::offset_of!(fz_device, container) - 280usize];
};
unsafe extern "C" {
    #[doc = "Device calls; graphics primitives and containers."]
    pub fn fz_fill_path(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        path: *const fz_path,
        even_odd: ::core::ffi::c_int,
        ctm: fz_matrix,
        colorspace: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_stroke_path(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        path: *const fz_path,
        stroke: *const fz_stroke_state,
        ctm: fz_matrix,
        colorspace: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_clip_path(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        path: *const fz_path,
        even_odd: ::core::ffi::c_int,
        ctm: fz_matrix,
        scissor: fz_rect,
    );
}
unsafe extern "C" {
    pub fn fz_clip_stroke_path(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        path: *const fz_path,
        stroke: *const fz_stroke_state,
        ctm: fz_matrix,
        scissor: fz_rect,
    );
}
unsafe extern "C" {
    pub fn fz_fill_text(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        text: *const fz_text,
        ctm: fz_matrix,
        colorspace: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_stroke_text(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        text: *const fz_text,
        stroke: *const fz_stroke_state,
        ctm: fz_matrix,
        colorspace: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_clip_text(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        text: *const fz_text,
        ctm: fz_matrix,
        scissor: fz_rect,
    );
}
unsafe extern "C" {
    pub fn fz_clip_stroke_text(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        text: *const fz_text,
        stroke: *const fz_stroke_state,
        ctm: fz_matrix,
        scissor: fz_rect,
    );
}
unsafe extern "C" {
    pub fn fz_ignore_text(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        text: *const fz_text,
        ctm: fz_matrix,
    );
}
unsafe extern "C" {
    pub fn fz_pop_clip(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    pub fn fz_fill_shade(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        shade: *mut fz_shade,
        ctm: fz_matrix,
        alpha: f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_fill_image(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        image: *mut fz_image,
        ctm: fz_matrix,
        alpha: f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_fill_image_mask(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        image: *mut fz_image,
        ctm: fz_matrix,
        colorspace: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_clip_image_mask(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        image: *mut fz_image,
        ctm: fz_matrix,
        scissor: fz_rect,
    );
}
unsafe extern "C" {
    pub fn fz_begin_mask(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        area: fz_rect,
        luminosity: ::core::ffi::c_int,
        colorspace: *mut fz_colorspace,
        bc: *const f32,
        color_params: fz_color_params,
    );
}
unsafe extern "C" {
    pub fn fz_end_mask(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    pub fn fz_end_mask_tr(ctx: *mut fz_context, dev: *mut fz_device, fn_: *mut fz_function);
}
unsafe extern "C" {
    pub fn fz_begin_group(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        area: fz_rect,
        cs: *mut fz_colorspace,
        isolated: ::core::ffi::c_int,
        knockout: ::core::ffi::c_int,
        blendmode: ::core::ffi::c_int,
        alpha: f32,
    );
}
unsafe extern "C" {
    pub fn fz_end_group(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    pub fn fz_begin_tile(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        area: fz_rect,
        view: fz_rect,
        xstep: f32,
        ystep: f32,
        ctm: fz_matrix,
    );
}
unsafe extern "C" {
    pub fn fz_begin_tile_id(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        area: fz_rect,
        view: fz_rect,
        xstep: f32,
        ystep: f32,
        ctm: fz_matrix,
        id: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_begin_tile_tid(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        area: fz_rect,
        view: fz_rect,
        xstep: f32,
        ystep: f32,
        ctm: fz_matrix,
        id: ::core::ffi::c_int,
        doc_id: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_end_tile(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    pub fn fz_render_flags(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        set: ::core::ffi::c_int,
        clear: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_set_default_colorspaces(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        default_cs: *mut fz_default_colorspaces,
    );
}
unsafe extern "C" {
    pub fn fz_begin_layer(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        layer_name: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn fz_end_layer(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    pub fn fz_begin_structure(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        standard: fz_structure,
        raw: *const ::core::ffi::c_char,
        idx: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_end_structure(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    pub fn fz_begin_metatext(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        meta: fz_metatext,
        text: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn fz_end_metatext(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    #[doc = "Devices are created by calls to device implementations, for<br>`instance`: foo_new_device\\(\\). These will be implemented by calling<br>[`fz_new_derived_device`]\\(ctx, foo_device\\) where foo_device is a<br>structure \"derived from\" [`fz_device`], for instance<br>typedef struct { [`fz_device`] base;  ...extras...} foo_device;"]
    pub fn fz_new_device_of_size(ctx: *mut fz_context, size: ::core::ffi::c_int) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Signal the end of input, and flush any buffered output.<br>This is NOT called implicitly on [`fz_drop_device`]. This<br>may throw exceptions."]
    pub fn fz_close_device(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    #[doc = "Reduce the reference count on a device. When the reference count<br>reaches zero, the device and its resources will be freed.<br>Don't forget to call [`fz_close_device`] before dropping the device,<br>or you may get incomplete output!\n\nNever throws exceptions."]
    pub fn fz_drop_device(ctx: *mut fz_context, dev: *mut fz_device);
}
unsafe extern "C" {
    #[doc = "Increment the reference count for a device. Returns the same<br>pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_device(ctx: *mut fz_context, dev: *mut fz_device) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Enable \\(set\\) hint bits within the hint bitfield for a device."]
    pub fn fz_enable_device_hints(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        hints: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Disable \\(clear\\) hint bits within the hint bitfield for a device."]
    pub fn fz_disable_device_hints(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        hints: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Find current scissor region as tracked by the device."]
    pub fn fz_device_current_scissor(ctx: *mut fz_context, dev: *mut fz_device) -> fz_rect;
}
pub const FZ_DONT_INTERPOLATE_IMAGES: _bindgen_ty_19 = 1;
pub const FZ_NO_CACHE: _bindgen_ty_19 = 2;
pub const FZ_DONT_DECODE_IMAGES: _bindgen_ty_19 = 4;
pub type _bindgen_ty_19 = ::core::ffi::c_uint;
#[doc = "Provide two-way communication between application and library.<br>Intended for multi-threaded applications where one thread is<br>rendering pages and another thread wants to read progress<br>feedback or abort a job that takes a long time to finish. The<br>communication is unsynchronized without locking.\n\n`abort`: The application should set this field to 0 before<br>calling [`fz_run_page`] to render a page. At any point when the<br>page is being rendered the application my set this field to 1<br>which will cause the rendering to finish soon. This field is<br>checked periodically when the page is rendered, but exactly<br>when is not known, therefore there is no upper bound on<br>exactly when the rendering will abort. If the application<br>did not provide a set of locks to [`fz_new_context`], it must also<br>await the completion of [`fz_run_page`] before issuing another<br>call to [`fz_run_page`]. Note that once the application has set<br>this field to 1 after it called [`fz_run_page`] it may not change<br>the value again.\n\n`progress`: Communicates rendering progress back to the<br>application and is read only. Increments as a page is being<br>rendered. The value starts out at 0 and is limited to less<br>than or equal to progress_max, unless progress_max is -1.\n\n`progress_max`: Communicates the known upper bound of rendering<br>back to the application and is read only. The maximum value<br>that the progress field may take. If there is no known upper<br>bound on how long the rendering may take this value is -1 and<br>progress is not limited. Note that the value of progress_max<br>may change from -1 to a positive value once an upper bound is<br>known, so take this into consideration when comparing the<br>value of progress to that of progress_max.\n\n`errors`: count of errors during current rendering.\n\n`incomplete`: Initially should be set to 0. Will be set to<br>non-zero if a TRYLATER error is thrown during rendering."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_cookie {
    pub abort: ::core::ffi::c_int,
    pub progress: ::core::ffi::c_int,
    pub progress_max: usize,
    pub errors: ::core::ffi::c_int,
    pub incomplete: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_cookie"][::core::mem::size_of::<fz_cookie>() - 24usize];
    ["Alignment of fz_cookie"][::core::mem::align_of::<fz_cookie>() - 8usize];
    ["Offset of field: fz_cookie::abort"][::core::mem::offset_of!(fz_cookie, abort) - 0usize];
    ["Offset of field: fz_cookie::progress"][::core::mem::offset_of!(fz_cookie, progress) - 4usize];
    ["Offset of field: fz_cookie::progress_max"]
        [::core::mem::offset_of!(fz_cookie, progress_max) - 8usize];
    ["Offset of field: fz_cookie::errors"][::core::mem::offset_of!(fz_cookie, errors) - 16usize];
    ["Offset of field: fz_cookie::incomplete"]
        [::core::mem::offset_of!(fz_cookie, incomplete) - 20usize];
};
unsafe extern "C" {
    #[doc = "Create a device to print a debug trace of all device calls."]
    pub fn fz_new_trace_device(ctx: *mut fz_context, out: *mut fz_output) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to output raw information."]
    pub fn fz_new_xmltext_device(ctx: *mut fz_context, out: *mut fz_output) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to compute the bounding<br>box of all marks on a page.\n\nThe returned bounding box will be the union of all bounding<br>boxes of all objects on a page."]
    pub fn fz_new_bbox_device(ctx: *mut fz_context, rectp: *mut fz_rect) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to test for features.\n\nCurrently only tests for the presence of non-grayscale colors.\n\n`is_color`: Possible values returned:<br>`0`: Definitely greyscale<br>`1`: Probably color \\(all colors were grey, but there<br>were images or shadings in a non grey colorspace\\).<br>`2`: Definitely color\n\n`threshold`: The difference from grayscale that will be tolerated.<br>Typical values to use are either 0 \\(be exact\\) and 0.02 \\(allow an<br>imperceptible amount of slop\\).\n\n`options`: A set of bitfield options, from the [`FZ_TEST_OPT`] set.\n\n`passthrough`: A device to pass all calls through to, or `NULL`.<br>If set, then the test device can both test and pass through to<br>an underlying device \\(like, say, the display list device\\). This<br>means that a display list can be created and at the end we'll<br>know if it's colored or not.\n\nIn the absence of a passthrough device, the device will throw<br>an exception to stop page interpretation when color is found."]
    pub fn fz_new_test_device(
        ctx: *mut fz_context,
        is_color: *mut ::core::ffi::c_int,
        threshold: f32,
        options: ::core::ffi::c_int,
        passthrough: *mut fz_device,
    ) -> *mut fz_device;
}
pub const FZ_TEST_OPT_IMAGES: _bindgen_ty_20 = 1;
pub const FZ_TEST_OPT_SHADINGS: _bindgen_ty_20 = 2;
pub type _bindgen_ty_20 = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Create a device to draw on a pixmap.\n\n`dest`: Target pixmap for the draw device. See `fz_new_pixmap*`<br>for how to obtain a pixmap. The pixmap is not cleared by the<br>draw device, see `fz_clear_pixmap*` for how to clear it prior to<br>calling [`fz_new_draw_device`]. Free the device by calling<br>[`fz_drop_device`].\n\n`transform`: Transform from user space in points to device space<br>in pixels."]
    pub fn fz_new_draw_device(
        ctx: *mut fz_context,
        transform: fz_matrix,
        dest: *mut fz_pixmap,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to draw on a pixmap.\n\n`dest`: Target pixmap for the draw device. See `fz_new_pixmap*`<br>for how to obtain a pixmap. The pixmap is not cleared by the<br>draw device, see `fz_clear_pixmap*` for how to clear it prior to<br>calling [`fz_new_draw_device`]. Free the device by calling<br>[`fz_drop_device`].\n\n`transform`: Transform from user space in points to device space<br>in pixels.\n\n`clip`: Bounding box to restrict any marking operations of the<br>draw device."]
    pub fn fz_new_draw_device_with_bbox(
        ctx: *mut fz_context,
        transform: fz_matrix,
        dest: *mut fz_pixmap,
        clip: *const fz_irect,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to draw on a pixmap.\n\n`dest`: Target pixmap for the draw device. See `fz_new_pixmap*`<br>for how to obtain a pixmap. The pixmap is not cleared by the<br>draw device, see `fz_clear_pixmap*` for how to clear it prior to<br>calling [`fz_new_draw_device`]. Free the device by calling<br>[`fz_drop_device`].\n\n`transform`: Transform from user space in points to device space<br>in pixels.\n\n`proof_cs`: Intermediate color space to map though when mapping to<br>color space defined by pixmap."]
    pub fn fz_new_draw_device_with_proof(
        ctx: *mut fz_context,
        transform: fz_matrix,
        dest: *mut fz_pixmap,
        proof_cs: *mut fz_colorspace,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to draw on a pixmap.\n\n`dest`: Target pixmap for the draw device. See `fz_new_pixmap*`<br>for how to obtain a pixmap. The pixmap is not cleared by the<br>draw device, see `fz_clear_pixmap*` for how to clear it prior to<br>calling [`fz_new_draw_device`]. Free the device by calling<br>[`fz_drop_device`].\n\n`transform`: Transform from user space in points to device space<br>in pixels.\n\n`clip`: Bounding box to restrict any marking operations of the<br>draw device.\n\n`proof_cs`: Color space to render to prior to mapping to color<br>space defined by pixmap."]
    pub fn fz_new_draw_device_with_bbox_proof(
        ctx: *mut fz_context,
        transform: fz_matrix,
        dest: *mut fz_pixmap,
        clip: *const fz_irect,
        cs: *mut fz_colorspace,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn fz_new_draw_device_type3(
        ctx: *mut fz_context,
        transform: fz_matrix,
        dest: *mut fz_pixmap,
    ) -> *mut fz_device;
}
#[doc = "struct [`fz_draw_options`]: Options for creating a pixmap and draw<br>device."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_draw_options {
    pub rotate: ::core::ffi::c_int,
    pub x_resolution: ::core::ffi::c_int,
    pub y_resolution: ::core::ffi::c_int,
    pub width: ::core::ffi::c_int,
    pub height: ::core::ffi::c_int,
    pub colorspace: *mut fz_colorspace,
    pub alpha: ::core::ffi::c_int,
    pub graphics: ::core::ffi::c_int,
    pub text: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_draw_options"][::core::mem::size_of::<fz_draw_options>() - 48usize];
    ["Alignment of fz_draw_options"][::core::mem::align_of::<fz_draw_options>() - 8usize];
    ["Offset of field: fz_draw_options::rotate"]
        [::core::mem::offset_of!(fz_draw_options, rotate) - 0usize];
    ["Offset of field: fz_draw_options::x_resolution"]
        [::core::mem::offset_of!(fz_draw_options, x_resolution) - 4usize];
    ["Offset of field: fz_draw_options::y_resolution"]
        [::core::mem::offset_of!(fz_draw_options, y_resolution) - 8usize];
    ["Offset of field: fz_draw_options::width"]
        [::core::mem::offset_of!(fz_draw_options, width) - 12usize];
    ["Offset of field: fz_draw_options::height"]
        [::core::mem::offset_of!(fz_draw_options, height) - 16usize];
    ["Offset of field: fz_draw_options::colorspace"]
        [::core::mem::offset_of!(fz_draw_options, colorspace) - 24usize];
    ["Offset of field: fz_draw_options::alpha"]
        [::core::mem::offset_of!(fz_draw_options, alpha) - 32usize];
    ["Offset of field: fz_draw_options::graphics"]
        [::core::mem::offset_of!(fz_draw_options, graphics) - 36usize];
    ["Offset of field: fz_draw_options::text"]
        [::core::mem::offset_of!(fz_draw_options, text) - 40usize];
};
unsafe extern "C" {
    pub static mut fz_draw_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Parse draw device options from a comma separated key-value string."]
    pub fn fz_parse_draw_options(
        ctx: *mut fz_context,
        options: *mut fz_draw_options,
        string: *const ::core::ffi::c_char,
    ) -> *mut fz_draw_options;
}
unsafe extern "C" {
    #[doc = "Create a new pixmap and draw device, using the specified options.\n\n`options`: Options to configure the draw device, and choose the<br>resolution and colorspace.\n\n`mediabox`: The bounds of the page in points.\n\n`pixmap`: An out parameter containing the newly created pixmap."]
    pub fn fz_new_draw_device_with_options(
        ctx: *mut fz_context,
        options: *const fz_draw_options,
        mediabox: fz_rect,
        pixmap: *mut *mut fz_pixmap,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create an empty display list.\n\nA display list contains drawing commands \\(text, images, etc.\\).<br>Use [`fz_new_list_device`] for populating the list.\n\n`mediabox`: Bounds of the page \\(in points\\) represented by the<br>display list."]
    pub fn fz_new_display_list(ctx: *mut fz_context, mediabox: fz_rect) -> *mut fz_display_list;
}
unsafe extern "C" {
    #[doc = "Create a rendering device for a display list.\n\nWhen the device is rendering a page it will populate the<br>display list with drawing commands \\(text, images, etc.\\). The<br>display list can later be reused to render a page many times<br>without having to re-interpret the page from the document file<br>for each rendering. Once the device is no longer needed, free<br>it with [`fz_drop_device`].\n\n`list`: A display list that the list device takes a reference to."]
    pub fn fz_new_list_device(ctx: *mut fz_context, list: *mut fz_display_list) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "\\(Re\\)-run a display list through a device.\n\n`list`: A display list, created by [`fz_new_display_list`] and<br>populated with objects from a page by running [`fz_run_page`] on a<br>device obtained from [`fz_new_list_device`].\n\n`ctm`: Transform to apply to display list contents. May include<br>for example scaling and rotation, see [`fz_scale`], [`fz_rotate`] and<br>[`fz_concat`]. Set to [`fz_identity`] if no transformation is desired.\n\n`scissor`: Only the part of the contents of the display list<br>visible within this area will be considered when the list is<br>run through the device. This does not imply for tile objects<br>contained in the display list.\n\n`cookie`: Communication mechanism between caller and library<br>running the page. Intended for multi-threaded applications,<br>while single-threaded applications set cookie to `NULL`. The<br>caller may abort an ongoing page run. Cookie also communicates<br>progress information back to the caller. The fields inside<br>cookie are continually updated while the page is being run."]
    pub fn fz_run_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        dev: *mut fz_device,
        ctm: fz_matrix,
        scissor: fz_rect,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    #[doc = "Increment the reference count for a display list. Returns the<br>same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for a display list. When the<br>reference count reaches zero, all the references in the display<br>list itself are dropped, and the display list is freed.\n\nNever throws exceptions."]
    pub fn fz_drop_display_list(ctx: *mut fz_context, list: *mut fz_display_list);
}
unsafe extern "C" {
    #[doc = "Return the bounding box of the page recorded in a display list."]
    pub fn fz_bound_display_list(ctx: *mut fz_context, list: *mut fz_display_list) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Create a new image from a display list.\n\n`w`, `h`: The conceptual width/height of the image.\n\n`transform`: The matrix that needs to be applied to the given<br>list to make it render to the unit square.\n\n`list`: The display list."]
    pub fn fz_new_image_from_display_list(
        ctx: *mut fz_context,
        w: f32,
        h: f32,
        list: *mut fz_display_list,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Check for a display list being empty\n\n`list`: The list to check.\n\nReturns true if empty, false otherwise."]
    pub fn fz_display_list_is_empty(
        ctx: *mut fz_context,
        list: *const fz_display_list,
    ) -> ::core::ffi::c_int;
}
#[doc = "Simple text layout \\(for use with annotation editing primarily\\)."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_layout_char {
    pub x: f32,
    pub advance: f32,
    pub p: *const ::core::ffi::c_char,
    pub next: *mut fz_layout_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_layout_char"][::core::mem::size_of::<fz_layout_char>() - 24usize];
    ["Alignment of fz_layout_char"][::core::mem::align_of::<fz_layout_char>() - 8usize];
    ["Offset of field: fz_layout_char::x"][::core::mem::offset_of!(fz_layout_char, x) - 0usize];
    ["Offset of field: fz_layout_char::advance"]
        [::core::mem::offset_of!(fz_layout_char, advance) - 4usize];
    ["Offset of field: fz_layout_char::p"][::core::mem::offset_of!(fz_layout_char, p) - 8usize];
    ["Offset of field: fz_layout_char::next"]
        [::core::mem::offset_of!(fz_layout_char, next) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_layout_line {
    pub x: f32,
    pub y: f32,
    pub font_size: f32,
    pub p: *const ::core::ffi::c_char,
    pub text: *mut fz_layout_char,
    pub next: *mut fz_layout_line,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_layout_line"][::core::mem::size_of::<fz_layout_line>() - 40usize];
    ["Alignment of fz_layout_line"][::core::mem::align_of::<fz_layout_line>() - 8usize];
    ["Offset of field: fz_layout_line::x"][::core::mem::offset_of!(fz_layout_line, x) - 0usize];
    ["Offset of field: fz_layout_line::y"][::core::mem::offset_of!(fz_layout_line, y) - 4usize];
    ["Offset of field: fz_layout_line::font_size"]
        [::core::mem::offset_of!(fz_layout_line, font_size) - 8usize];
    ["Offset of field: fz_layout_line::p"][::core::mem::offset_of!(fz_layout_line, p) - 16usize];
    ["Offset of field: fz_layout_line::text"]
        [::core::mem::offset_of!(fz_layout_line, text) - 24usize];
    ["Offset of field: fz_layout_line::next"]
        [::core::mem::offset_of!(fz_layout_line, next) - 32usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_layout_block {
    pub pool: *mut fz_pool,
    pub matrix: fz_matrix,
    pub inv_matrix: fz_matrix,
    pub head: *mut fz_layout_line,
    pub tailp: *mut *mut fz_layout_line,
    pub text_tailp: *mut *mut fz_layout_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_layout_block"][::core::mem::size_of::<fz_layout_block>() - 80usize];
    ["Alignment of fz_layout_block"][::core::mem::align_of::<fz_layout_block>() - 8usize];
    ["Offset of field: fz_layout_block::pool"]
        [::core::mem::offset_of!(fz_layout_block, pool) - 0usize];
    ["Offset of field: fz_layout_block::matrix"]
        [::core::mem::offset_of!(fz_layout_block, matrix) - 8usize];
    ["Offset of field: fz_layout_block::inv_matrix"]
        [::core::mem::offset_of!(fz_layout_block, inv_matrix) - 32usize];
    ["Offset of field: fz_layout_block::head"]
        [::core::mem::offset_of!(fz_layout_block, head) - 56usize];
    ["Offset of field: fz_layout_block::tailp"]
        [::core::mem::offset_of!(fz_layout_block, tailp) - 64usize];
    ["Offset of field: fz_layout_block::text_tailp"]
        [::core::mem::offset_of!(fz_layout_block, text_tailp) - 72usize];
};
unsafe extern "C" {
    #[doc = "Create a new layout block, with new allocation pool, zero<br>matrices, and initialise linked pointers."]
    pub fn fz_new_layout(ctx: *mut fz_context) -> *mut fz_layout_block;
}
unsafe extern "C" {
    #[doc = "Drop layout block. Free the pool, and linked blocks.\n\nNever throws exceptions."]
    pub fn fz_drop_layout(ctx: *mut fz_context, block: *mut fz_layout_block);
}
unsafe extern "C" {
    #[doc = "Add a new line to the end of the layout block."]
    pub fn fz_add_layout_line(
        ctx: *mut fz_context,
        block: *mut fz_layout_block,
        x: f32,
        y: f32,
        h: f32,
        p: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Add a new char to the line at the end of the layout block."]
    pub fn fz_add_layout_char(
        ctx: *mut fz_context,
        block: *mut fz_layout_block,
        x: f32,
        w: f32,
        p: *const ::core::ffi::c_char,
    );
}
pub const FZ_STEXT_PRESERVE_LIGATURES: _bindgen_ty_21 = 1;
pub const FZ_STEXT_PRESERVE_WHITESPACE: _bindgen_ty_21 = 2;
pub const FZ_STEXT_PRESERVE_IMAGES: _bindgen_ty_21 = 4;
pub const FZ_STEXT_INHIBIT_SPACES: _bindgen_ty_21 = 8;
pub const FZ_STEXT_DEHYPHENATE: _bindgen_ty_21 = 16;
pub const FZ_STEXT_PRESERVE_SPANS: _bindgen_ty_21 = 32;
pub const FZ_STEXT_CLIP: _bindgen_ty_21 = 64;
pub const FZ_STEXT_USE_CID_FOR_UNKNOWN_UNICODE: _bindgen_ty_21 = 128;
pub const FZ_STEXT_COLLECT_STRUCTURE: _bindgen_ty_21 = 256;
pub const FZ_STEXT_ACCURATE_BBOXES: _bindgen_ty_21 = 512;
pub const FZ_STEXT_COLLECT_VECTORS: _bindgen_ty_21 = 1024;
pub const FZ_STEXT_IGNORE_ACTUALTEXT: _bindgen_ty_21 = 2048;
pub const FZ_STEXT_SEGMENT: _bindgen_ty_21 = 4096;
pub const FZ_STEXT_PARAGRAPH_BREAK: _bindgen_ty_21 = 8192;
pub const FZ_STEXT_TABLE_HUNT: _bindgen_ty_21 = 16384;
pub const FZ_STEXT_COLLECT_STYLES: _bindgen_ty_21 = 32768;
pub const FZ_STEXT_USE_GID_FOR_UNKNOWN_UNICODE: _bindgen_ty_21 = 65536;
pub const FZ_STEXT_CLIP_RECT: _bindgen_ty_21 = 131072;
pub const FZ_STEXT_ACCURATE_ASCENDERS: _bindgen_ty_21 = 262144;
pub const FZ_STEXT_ACCURATE_SIDE_BEARINGS: _bindgen_ty_21 = 524288;
pub const FZ_STEXT_LAZY_VECTORS: _bindgen_ty_21 = 1048576;
pub const FZ_STEXT_MEDIABOX_CLIP: _bindgen_ty_21 = 64;
#[doc = "[`FZ_STEXT_PRESERVE_LIGATURES`]: If this option is activated<br>ligatures are passed through to the application in their<br>original form. If this option is deactivated ligatures are<br>expanded into their constituent parts, e.g. the ligature ffi is<br>expanded into three separate characters f, f and i.\n\n[`FZ_STEXT_PRESERVE_WHITESPACE`]: If this option is activated<br>whitespace is passed through to the application in its original<br>form. If this option is deactivated any type of horizontal<br>whitespace \\(including horizontal tabs\\) will be replaced with<br>space characters of variable width.\n\n[`FZ_STEXT_PRESERVE_IMAGES`]: If this option is set, then images<br>will be stored in the structured text structure. The default is<br>to ignore all images.\n\n[`FZ_STEXT_INHIBIT_SPACES`]: If this option is set, we will not try<br>to add missing space characters where there are large gaps<br>between characters.\n\n[`FZ_STEXT_DEHYPHENATE`]: If this option is set, hyphens at the<br>end of a line will be recorded as being soft-hyphens; when flattened<br>soft-hyphens at the end of lines will cause the lines to be<br>joined.\n\n[`FZ_STEXT_PRESERVE_SPANS`]: If this option is set, spans on the same line<br>will not be merged. Each line will thus be a span of text with the same<br>font, colour, and size.\n\n[`FZ_STEXT_CLIP`]: If this option is set, characters that would be entirely<br>clipped away by the current clipping path \\(or, more accurate, the smallest<br>bbox that contains the current clipping path\\) will be ignored. The bboxes<br>of images will be similarly reduced in size. The clip path is guaranteed<br>to be smaller then the page mediabox, hence this option subsumes an older,<br>now deprecated, [`FZ_STEXT_MEDIABOX_CLIP`] option.\n\n[`FZ_STEXT_CLIP_RECT`]: If this option is set, characters that would be entirely<br>clipped away by the specified 'clip' rectangle in the options struct<br>will be ignored. This enables content from specific subsections of pages to<br>be extracted.\n\n[`FZ_STEXT_COLLECT_STRUCTURE`]: If this option is set, we will collect<br>the structure as specified using begin/end_structure calls. This will<br>change the returned stext structure from being a simple list of blocks<br>into effectively being a 'tree' that should be walked in depth-first<br>order.\n\n[`FZ_STEXT_COLLECT_VECTORS`]: If this option is set, we will collect<br>details \\(currently just the bbox\\) of vector graphics. This is intended<br>to be of use in segmentation analysis.\n\n[`FZ_STEXT_IGNORE_ACTUALTEXT`]: If this option is set, we will no longer<br>replace text by the ActualText replacement specified in the document.\n\n[`FZ_STEXT_SEGMENT`]: If this option is set, we will attempt to segment<br>the page into different regions. This will deliberately not do anything<br>to pages with structure information present.\n\n[`FZ_STEXT_PARAGRAPH_BREAK`]: If this option is set, we will break blocks<br>of text at what appear to be paragraph boundaries. This only works<br>for left-to-right, top-to-bottom paragraphs. Works best on a segmented<br>page.\n\n[`FZ_STEXT_TABLE_HUNT`]: If this option is set, we will hunt for tables<br>within the stext. Details of the potential tables found will be<br>inserted into the stext for the caller to interpret. This will work<br>best on a segmented page.\n\n[`FZ_STEXT_USE_CID_FOR_UNKNOWN_UNICODE`]: If this option is set, then<br>in the event that we fail to find a unicode value for a given<br>character, we we instead return its CID in the unicode field. We<br>will set the [`FZ_STEXT_UNICODE_IS_CID`] bit in the char flags word to<br>indicate that this has happened.\n\n[`FZ_STEXT_USE_GID_FOR_UNKNOWN_UNICODE`]: If this option is set, then<br>in the event that we fail to find a unicode value for a given<br>character, we we instead return its glyph in the unicode field.<br>We will set the [`FZ_STEXT_UNICODE_IS_GID`] bit in the char flags word<br>to indicate that this has happened.\n\nSetting both [`FZ_STEXT_USE_CID_FOR_UNKNOWN_UNICODE`] and<br>[`FZ_STEXT_USE_GID_FOR_UNKNOWN_UNICODE`] will give undefined behaviour."]
pub type _bindgen_ty_21 = ::core::ffi::c_uint;
#[doc = "A note on stext's handling of structure.\n\nA PDF document can contain a structure tree. This gives the<br>structure of a document in its entirety as a tree. e.g.\n\nTree\t\t\tMCID\tINDEX<br>-------------------------------------<br>DOC\t\t\t0\t0<br>TOC\t\t\t1\t0<br>TOC_ITEM\t\t2\t0<br>TOC_ITEM\t\t3\t1<br>TOC_ITEM\t\t4\t2<br>...<br>STORY\t\t\t100\t1<br>SECTION\t\t101\t0<br>HEADING\t\t102\t0<br>SUBSECTION\t\t103\t1<br>PARAGRAPH\t\t104\t0<br>PARAGRAPH\t\t105\t1<br>PARAGRAPH\t\t106\t2<br>SUBSECTION\t\t107\t2<br>PARAGRAPH\t\t108\t0<br>PARAGRAPH\t\t109\t1<br>PARAGRAPH\t\t110\t2<br>...<br>SECTION\t\t200\t1<br>...\n\nEach different section of the tree is identified as part of an<br>MCID by a number \\(this is a slight simplification, but makes the<br>explanation easier\\).\n\nThe PDF document contains markings that say \"Entering MCID 0\"<br>and \"Leaving MCID 0\". Any content within that region is therefore<br>identified as appearing in that particular structural region.\n\nThis means that content can be sent in the document in a different<br>order to which it appears 'logically' in the tree.\n\nMuPDF converts this tree form into a nested series of calls to<br>begin_structure and end_structure.\n\nFor instance, if the document started out with MCID 100, then<br>we'd send:<br>begin_structure\\(\"DOC\"\\)<br>begin_structure\\(\"STORY\"\\)\n\nThe problem with this is that if we send:<br>begin_structure\\(\"DOC\"\\)<br>begin_structure\\(\"STORY\"\\)<br>begin_structure\\(\"SECTION\"\\)<br>begin_structure\\(\"SUBSECTION\"\\)\n\nor<br>begin_structure\\(\"DOC\"\\)<br>begin_structure\\(\"STORY\"\\)<br>begin_structure\\(\"SECTION\"\\)<br>begin_structure\\(\"HEADING\"\\)\n\nHow do I know what order the SECTION and HEADING should appear in?<br>Are they even in the same STORY? Or the same DOC?\n\nAccordingly, every begin_structure is accompanied not only with the<br>node type, but with an index. The index is the number of this node<br>within this level of the tree. Hence:\n\nbegin_structure\\(\"DOC\", 0\\)<br>begin_structure\\(\"STORY\", 0\\)<br>begin_structure\\(\"SECTION\", 0\\)<br>begin_structure\\(\"HEADING\", 0\\)<br>and<br>begin_structure\\(\"DOC\", 0\\)<br>begin_structure\\(\"STORY\", 0\\)<br>begin_structure\\(\"SECTION\", 0\\)<br>begin_structure\\(\"SUBSECTION\", 1\\)\n\nare now unambiguous in their describing of the tree.\n\nMuPDF automatically sends the minimal end_structure/begin_structure<br>pairs to move us between nodes in the tree.\n\nIn order to accommodate this information within the structured text<br>data structures an additional block type is used. Previously a<br>\"page\" was just a list of blocks, either text or images. e.g.\n\n\\[BLOCK:TEXT\\] \\<-\\> \\[BLOCK:IMG\\] \\<-\\> \\[BLOCK:TEXT\\] \\<-\\> \\[BLOCK:TEXT\\] ...\n\nWe now introduce a new type of block, STRUCT, that turns this into<br>a tree:\n\n\\[BLOCK:TEXT\\] \\<-\\> \\[BLOCK:STRUCT\\(IDX=0\\)\\] \\<-\\> \\[BLOCK:TEXT\\] \\<-\\> ...<br>/|\\<br>\\[STRUCT:TYPE=DOC\\] \\<----<br>|<br>\\[BLOCK:TEXT\\] \\<-\\> \\[BLOCK:STRUCT\\(IDX=0\\)\\] \\<-\\> \\[BLOCK:TEXT\\] \\<-\\> ...<br>/|\\<br>\\[STRUCT:TYPE=STORY\\] \\<--<br>|<br>...\n\nRather than doing a simple linear traversal of the list to extract<br>the logical data, a caller now has to do a depth-first traversal."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_page_details {
    pub mediabox: fz_rect,
    pub chapter: ::core::ffi::c_int,
    pub page: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_page_details"][::core::mem::size_of::<fz_stext_page_details>() - 24usize];
    ["Alignment of fz_stext_page_details"]
        [::core::mem::align_of::<fz_stext_page_details>() - 4usize];
    ["Offset of field: fz_stext_page_details::mediabox"]
        [::core::mem::offset_of!(fz_stext_page_details, mediabox) - 0usize];
    ["Offset of field: fz_stext_page_details::chapter"]
        [::core::mem::offset_of!(fz_stext_page_details, chapter) - 16usize];
    ["Offset of field: fz_stext_page_details::page"]
        [::core::mem::offset_of!(fz_stext_page_details, page) - 20usize];
};
#[doc = "A text page is a list of blocks, together with an overall<br>bounding box.\n\nThe name of this structure is now slightly out of date. It<br>should really be [`fz_stext_document`], cos it can contain<br>content from multiple pages."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_page {
    pub refs: ::core::ffi::c_int,
    pub pool: *mut fz_pool,
    pub mediabox: fz_rect,
    pub first_block: *mut fz_stext_block,
    pub last_block: *mut fz_stext_block,
    pub last_struct: *mut fz_stext_struct,
    pub id_list: *mut fz_pool_array,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_page"][::core::mem::size_of::<fz_stext_page>() - 64usize];
    ["Alignment of fz_stext_page"][::core::mem::align_of::<fz_stext_page>() - 8usize];
    ["Offset of field: fz_stext_page::refs"][::core::mem::offset_of!(fz_stext_page, refs) - 0usize];
    ["Offset of field: fz_stext_page::pool"][::core::mem::offset_of!(fz_stext_page, pool) - 8usize];
    ["Offset of field: fz_stext_page::mediabox"]
        [::core::mem::offset_of!(fz_stext_page, mediabox) - 16usize];
    ["Offset of field: fz_stext_page::first_block"]
        [::core::mem::offset_of!(fz_stext_page, first_block) - 32usize];
    ["Offset of field: fz_stext_page::last_block"]
        [::core::mem::offset_of!(fz_stext_page, last_block) - 40usize];
    ["Offset of field: fz_stext_page::last_struct"]
        [::core::mem::offset_of!(fz_stext_page, last_struct) - 48usize];
    ["Offset of field: fz_stext_page::id_list"]
        [::core::mem::offset_of!(fz_stext_page, id_list) - 56usize];
};
unsafe extern "C" {
    #[doc = "Take a new reference to an [`fz_stext_page`]."]
    pub fn fz_keep_stext_page(ctx: *mut fz_context, page: *mut fz_stext_page)
    -> *mut fz_stext_page;
}
unsafe extern "C" {
    #[doc = "Helper function to retrieve the details for a given id from a block."]
    pub fn fz_stext_page_details_for_block(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        block: *mut fz_stext_block,
    ) -> *mut fz_stext_page_details;
}
pub const FZ_STEXT_BLOCK_TEXT: _bindgen_ty_22 = 0;
pub const FZ_STEXT_BLOCK_IMAGE: _bindgen_ty_22 = 1;
pub const FZ_STEXT_BLOCK_STRUCT: _bindgen_ty_22 = 2;
pub const FZ_STEXT_BLOCK_VECTOR: _bindgen_ty_22 = 3;
pub const FZ_STEXT_BLOCK_GRID: _bindgen_ty_22 = 4;
pub type _bindgen_ty_22 = ::core::ffi::c_uint;
pub const FZ_STEXT_TEXT_JUSTIFY_UNKNOWN: _bindgen_ty_23 = 0;
pub const FZ_STEXT_TEXT_JUSTIFY_LEFT: _bindgen_ty_23 = 1;
pub const FZ_STEXT_TEXT_JUSTIFY_CENTRE: _bindgen_ty_23 = 2;
pub const FZ_STEXT_TEXT_JUSTIFY_RIGHT: _bindgen_ty_23 = 3;
pub const FZ_STEXT_TEXT_JUSTIFY_FULL: _bindgen_ty_23 = 4;
pub type _bindgen_ty_23 = ::core::ffi::c_uint;
pub const FZ_STEXT_VECTOR_IS_STROKED: _bindgen_ty_24 = 1;
pub const FZ_STEXT_VECTOR_IS_RECTANGLE: _bindgen_ty_24 = 2;
pub const FZ_STEXT_VECTOR_CONTINUES: _bindgen_ty_24 = 4;
pub type _bindgen_ty_24 = ::core::ffi::c_uint;
pub const FZ_STEXT_GRID_H_CROSSED: _bindgen_ty_25 = 1;
pub const FZ_STEXT_GRID_V_CROSSED: _bindgen_ty_25 = 2;
pub const FZ_STEXT_GRID_L_BORDER: _bindgen_ty_25 = 4;
pub const FZ_STEXT_GRID_T_BORDER: _bindgen_ty_25 = 8;
pub const FZ_STEXT_GRID_FULL: _bindgen_ty_25 = 16;
pub type _bindgen_ty_25 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug)]
pub struct fz_stext_grid_info {
    pub w: ::core::ffi::c_int,
    pub h: ::core::ffi::c_int,
    pub info: __IncompleteArrayField<fz_stext_grid_info__bindgen_ty_1>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_grid_info__bindgen_ty_1 {
    pub flags: ::core::ffi::c_uint,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_grid_info__bindgen_ty_1"]
        [::core::mem::size_of::<fz_stext_grid_info__bindgen_ty_1>() - 4usize];
    ["Alignment of fz_stext_grid_info__bindgen_ty_1"]
        [::core::mem::align_of::<fz_stext_grid_info__bindgen_ty_1>() - 4usize];
    ["Offset of field: fz_stext_grid_info__bindgen_ty_1::flags"]
        [::core::mem::offset_of!(fz_stext_grid_info__bindgen_ty_1, flags) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_grid_info"][::core::mem::size_of::<fz_stext_grid_info>() - 8usize];
    ["Alignment of fz_stext_grid_info"][::core::mem::align_of::<fz_stext_grid_info>() - 4usize];
    ["Offset of field: fz_stext_grid_info::w"]
        [::core::mem::offset_of!(fz_stext_grid_info, w) - 0usize];
    ["Offset of field: fz_stext_grid_info::h"]
        [::core::mem::offset_of!(fz_stext_grid_info, h) - 4usize];
    ["Offset of field: fz_stext_grid_info::info"]
        [::core::mem::offset_of!(fz_stext_grid_info, info) - 8usize];
};
#[doc = "A text block is a list of lines of text \\(typically a paragraph\\),<br>or an image."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_stext_block {
    pub type_: ::core::ffi::c_int,
    pub id: ::core::ffi::c_int,
    pub bbox: fz_rect,
    pub u: fz_stext_block__bindgen_ty_1,
    pub prev: *mut fz_stext_block,
    pub next: *mut fz_stext_block,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_stext_block__bindgen_ty_1 {
    pub t: fz_stext_block__bindgen_ty_1__bindgen_ty_1,
    pub i: fz_stext_block__bindgen_ty_1__bindgen_ty_2,
    pub s: fz_stext_block__bindgen_ty_1__bindgen_ty_3,
    pub v: fz_stext_block__bindgen_ty_1__bindgen_ty_4,
    pub b: fz_stext_block__bindgen_ty_1__bindgen_ty_5,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_block__bindgen_ty_1__bindgen_ty_1 {
    pub first_line: *mut fz_stext_line,
    pub last_line: *mut fz_stext_line,
    pub flags: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_block__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::size_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_1>() - 24usize];
    ["Alignment of fz_stext_block__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::align_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_1::first_line"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_1, first_line) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_1::last_line"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_1, last_line) - 8usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_1::flags"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_1, flags) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_block__bindgen_ty_1__bindgen_ty_2 {
    pub transform: fz_matrix,
    pub image: *mut fz_image,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_block__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::size_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_2>() - 32usize];
    ["Alignment of fz_stext_block__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::align_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_2>() - 8usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_2::transform"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_2, transform) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_2::image"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_2, image) - 24usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_block__bindgen_ty_1__bindgen_ty_3 {
    pub down: *mut fz_stext_struct,
    pub index: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_block__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::size_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_3>() - 16usize];
    ["Alignment of fz_stext_block__bindgen_ty_1__bindgen_ty_3"]
        [::core::mem::align_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_3>() - 8usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_3::down"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_3, down) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_3::index"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_3, index) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_block__bindgen_ty_1__bindgen_ty_4 {
    pub flags: u32,
    pub argb: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_block__bindgen_ty_1__bindgen_ty_4"]
        [::core::mem::size_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_4>() - 8usize];
    ["Alignment of fz_stext_block__bindgen_ty_1__bindgen_ty_4"]
        [::core::mem::align_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_4>() - 4usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_4::flags"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_4, flags) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_4::argb"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_4, argb) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_block__bindgen_ty_1__bindgen_ty_5 {
    pub xs: *mut fz_stext_grid_positions,
    pub ys: *mut fz_stext_grid_positions,
    pub info: *mut fz_stext_grid_info,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_block__bindgen_ty_1__bindgen_ty_5"]
        [::core::mem::size_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_5>() - 24usize];
    ["Alignment of fz_stext_block__bindgen_ty_1__bindgen_ty_5"]
        [::core::mem::align_of::<fz_stext_block__bindgen_ty_1__bindgen_ty_5>() - 8usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_5::xs"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_5, xs) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_5::ys"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_5, ys) - 8usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1__bindgen_ty_5::info"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1__bindgen_ty_5, info) - 16usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_block__bindgen_ty_1"]
        [::core::mem::size_of::<fz_stext_block__bindgen_ty_1>() - 32usize];
    ["Alignment of fz_stext_block__bindgen_ty_1"]
        [::core::mem::align_of::<fz_stext_block__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1::t"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1, t) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1::i"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1, i) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1::s"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1, s) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1::v"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1, v) - 0usize];
    ["Offset of field: fz_stext_block__bindgen_ty_1::b"]
        [::core::mem::offset_of!(fz_stext_block__bindgen_ty_1, b) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_block"][::core::mem::size_of::<fz_stext_block>() - 72usize];
    ["Alignment of fz_stext_block"][::core::mem::align_of::<fz_stext_block>() - 8usize];
    ["Offset of field: fz_stext_block::type_"]
        [::core::mem::offset_of!(fz_stext_block, type_) - 0usize];
    ["Offset of field: fz_stext_block::id"][::core::mem::offset_of!(fz_stext_block, id) - 4usize];
    ["Offset of field: fz_stext_block::bbox"]
        [::core::mem::offset_of!(fz_stext_block, bbox) - 8usize];
    ["Offset of field: fz_stext_block::u"][::core::mem::offset_of!(fz_stext_block, u) - 24usize];
    ["Offset of field: fz_stext_block::prev"]
        [::core::mem::offset_of!(fz_stext_block, prev) - 56usize];
    ["Offset of field: fz_stext_block::next"]
        [::core::mem::offset_of!(fz_stext_block, next) - 64usize];
};
pub const FZ_STEXT_LINE_FLAGS_JOINED: fz_stext_line_flags = 1;
pub type fz_stext_line_flags = ::core::ffi::c_uint;
#[doc = "A text line is a list of characters that share a common baseline."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_line {
    pub wmode: u8,
    pub flags: u8,
    pub dir: fz_point,
    pub bbox: fz_rect,
    pub first_char: *mut fz_stext_char,
    pub last_char: *mut fz_stext_char,
    pub prev: *mut fz_stext_line,
    pub next: *mut fz_stext_line,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_line"][::core::mem::size_of::<fz_stext_line>() - 64usize];
    ["Alignment of fz_stext_line"][::core::mem::align_of::<fz_stext_line>() - 8usize];
    ["Offset of field: fz_stext_line::wmode"]
        [::core::mem::offset_of!(fz_stext_line, wmode) - 0usize];
    ["Offset of field: fz_stext_line::flags"]
        [::core::mem::offset_of!(fz_stext_line, flags) - 1usize];
    ["Offset of field: fz_stext_line::dir"][::core::mem::offset_of!(fz_stext_line, dir) - 4usize];
    ["Offset of field: fz_stext_line::bbox"]
        [::core::mem::offset_of!(fz_stext_line, bbox) - 12usize];
    ["Offset of field: fz_stext_line::first_char"]
        [::core::mem::offset_of!(fz_stext_line, first_char) - 32usize];
    ["Offset of field: fz_stext_line::last_char"]
        [::core::mem::offset_of!(fz_stext_line, last_char) - 40usize];
    ["Offset of field: fz_stext_line::prev"]
        [::core::mem::offset_of!(fz_stext_line, prev) - 48usize];
    ["Offset of field: fz_stext_line::next"]
        [::core::mem::offset_of!(fz_stext_line, next) - 56usize];
};
#[doc = "A text char is a unicode character, the style in which is<br>appears, and the point at which it is positioned."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_char {
    pub c: ::core::ffi::c_int,
    pub bidi: u16,
    pub flags: u16,
    pub argb: u32,
    pub origin: fz_point,
    pub quad: fz_quad,
    pub size: f32,
    pub font: *mut fz_font,
    pub next: *mut fz_stext_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_char"][::core::mem::size_of::<fz_stext_char>() - 72usize];
    ["Alignment of fz_stext_char"][::core::mem::align_of::<fz_stext_char>() - 8usize];
    ["Offset of field: fz_stext_char::c"][::core::mem::offset_of!(fz_stext_char, c) - 0usize];
    ["Offset of field: fz_stext_char::bidi"][::core::mem::offset_of!(fz_stext_char, bidi) - 4usize];
    ["Offset of field: fz_stext_char::flags"]
        [::core::mem::offset_of!(fz_stext_char, flags) - 6usize];
    ["Offset of field: fz_stext_char::argb"][::core::mem::offset_of!(fz_stext_char, argb) - 8usize];
    ["Offset of field: fz_stext_char::origin"]
        [::core::mem::offset_of!(fz_stext_char, origin) - 12usize];
    ["Offset of field: fz_stext_char::quad"]
        [::core::mem::offset_of!(fz_stext_char, quad) - 20usize];
    ["Offset of field: fz_stext_char::size"]
        [::core::mem::offset_of!(fz_stext_char, size) - 52usize];
    ["Offset of field: fz_stext_char::font"]
        [::core::mem::offset_of!(fz_stext_char, font) - 56usize];
    ["Offset of field: fz_stext_char::next"]
        [::core::mem::offset_of!(fz_stext_char, next) - 64usize];
};
pub const FZ_STEXT_STRIKEOUT: _bindgen_ty_26 = 1;
pub const FZ_STEXT_UNDERLINE: _bindgen_ty_26 = 2;
pub const FZ_STEXT_SYNTHETIC: _bindgen_ty_26 = 4;
pub const FZ_STEXT_BOLD: _bindgen_ty_26 = 8;
pub const FZ_STEXT_FILLED: _bindgen_ty_26 = 16;
pub const FZ_STEXT_STROKED: _bindgen_ty_26 = 32;
pub const FZ_STEXT_CLIPPED: _bindgen_ty_26 = 64;
pub const FZ_STEXT_UNICODE_IS_CID: _bindgen_ty_26 = 128;
pub const FZ_STEXT_UNICODE_IS_GID: _bindgen_ty_26 = 256;
pub const FZ_STEXT_SYNTHETIC_LARGE: _bindgen_ty_26 = 512;
pub type _bindgen_ty_26 = ::core::ffi::c_uint;
#[doc = "When we are collecting the structure information from<br>PDF structure trees/tags, we end up with a tree of<br>nodes. The structure should be walked in depth-first<br>traversal order to extract the content.\n\nAn [`fz_stext_struct`] pointer can be `NULL` to indicate that<br>we know there is a child there within the complete tree,<br>but we don't know what it is yet."]
#[repr(C)]
#[derive(Debug)]
pub struct fz_stext_struct {
    pub up: *mut fz_stext_block,
    pub parent: *mut fz_stext_struct,
    pub first_block: *mut fz_stext_block,
    pub last_block: *mut fz_stext_block,
    pub standard: fz_structure,
    pub raw: __IncompleteArrayField<::core::ffi::c_char>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_struct"][::core::mem::size_of::<fz_stext_struct>() - 40usize];
    ["Alignment of fz_stext_struct"][::core::mem::align_of::<fz_stext_struct>() - 8usize];
    ["Offset of field: fz_stext_struct::up"][::core::mem::offset_of!(fz_stext_struct, up) - 0usize];
    ["Offset of field: fz_stext_struct::parent"]
        [::core::mem::offset_of!(fz_stext_struct, parent) - 8usize];
    ["Offset of field: fz_stext_struct::first_block"]
        [::core::mem::offset_of!(fz_stext_struct, first_block) - 16usize];
    ["Offset of field: fz_stext_struct::last_block"]
        [::core::mem::offset_of!(fz_stext_struct, last_block) - 24usize];
    ["Offset of field: fz_stext_struct::standard"]
        [::core::mem::offset_of!(fz_stext_struct, standard) - 32usize];
    ["Offset of field: fz_stext_struct::raw"]
        [::core::mem::offset_of!(fz_stext_struct, raw) - 36usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct fz_stext_grid_positions {
    pub len: ::core::ffi::c_int,
    pub max_uncertainty: ::core::ffi::c_int,
    pub list: __IncompleteArrayField<fz_stext_grid_positions__bindgen_ty_1>,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_grid_positions__bindgen_ty_1 {
    pub reinforcement: ::core::ffi::c_int,
    pub pos: f32,
    pub min: f32,
    pub max: f32,
    pub uncertainty: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_grid_positions__bindgen_ty_1"]
        [::core::mem::size_of::<fz_stext_grid_positions__bindgen_ty_1>() - 20usize];
    ["Alignment of fz_stext_grid_positions__bindgen_ty_1"]
        [::core::mem::align_of::<fz_stext_grid_positions__bindgen_ty_1>() - 4usize];
    ["Offset of field: fz_stext_grid_positions__bindgen_ty_1::reinforcement"]
        [::core::mem::offset_of!(fz_stext_grid_positions__bindgen_ty_1, reinforcement) - 0usize];
    ["Offset of field: fz_stext_grid_positions__bindgen_ty_1::pos"]
        [::core::mem::offset_of!(fz_stext_grid_positions__bindgen_ty_1, pos) - 4usize];
    ["Offset of field: fz_stext_grid_positions__bindgen_ty_1::min"]
        [::core::mem::offset_of!(fz_stext_grid_positions__bindgen_ty_1, min) - 8usize];
    ["Offset of field: fz_stext_grid_positions__bindgen_ty_1::max"]
        [::core::mem::offset_of!(fz_stext_grid_positions__bindgen_ty_1, max) - 12usize];
    ["Offset of field: fz_stext_grid_positions__bindgen_ty_1::uncertainty"]
        [::core::mem::offset_of!(fz_stext_grid_positions__bindgen_ty_1, uncertainty) - 16usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_grid_positions"][::core::mem::size_of::<fz_stext_grid_positions>() - 8usize];
    ["Alignment of fz_stext_grid_positions"]
        [::core::mem::align_of::<fz_stext_grid_positions>() - 4usize];
    ["Offset of field: fz_stext_grid_positions::len"]
        [::core::mem::offset_of!(fz_stext_grid_positions, len) - 0usize];
    ["Offset of field: fz_stext_grid_positions::max_uncertainty"]
        [::core::mem::offset_of!(fz_stext_grid_positions, max_uncertainty) - 4usize];
    ["Offset of field: fz_stext_grid_positions::list"]
        [::core::mem::offset_of!(fz_stext_grid_positions, list) - 8usize];
};
unsafe extern "C" {
    pub static mut fz_stext_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Create an empty text page.\n\nThe text page is filled out by the text device to contain the<br>blocks and lines of text on the page.\n\n`mediabox`: optional mediabox information."]
    pub fn fz_new_stext_page(ctx: *mut fz_context, mediabox: fz_rect) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn fz_drop_stext_page(ctx: *mut fz_context, page: *mut fz_stext_page);
}
unsafe extern "C" {
    #[doc = "Output structured text to a file in HTML \\(visual\\) format."]
    pub fn fz_print_stext_page_as_html(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        id: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_print_stext_header_as_html(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    pub fn fz_print_stext_trailer_as_html(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Output structured text to a file in XHTML \\(semantic\\) format."]
    pub fn fz_print_stext_page_as_xhtml(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        id: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn fz_print_stext_header_as_xhtml(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    pub fn fz_print_stext_trailer_as_xhtml(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Output structured text to a file in XML format."]
    pub fn fz_print_stext_page_as_xml(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        id: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Output structured text to a file in JSON format."]
    pub fn fz_print_stext_page_as_json(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        scale: f32,
    );
}
unsafe extern "C" {
    #[doc = "Output structured text to a file in plain-text UTF-8 format."]
    pub fn fz_print_stext_page_as_text(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
    );
}
unsafe extern "C" {
    #[doc = "Search for occurrence of 'needle' in text page.<br>Case insensitive match.\n\nReturn the number of quads and store hit quads in the passed in<br>array.\n\n`NOTE`: This is an experimental interface and subject to change<br>without notice."]
    pub fn fz_search_stext_page(
        ctx: *mut fz_context,
        text: *mut fz_stext_page,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
#[doc = "Callback function for use in searching.\n\nCalled with the list of quads that correspond to a single hit.\n\nThe callback should return with 0 to continue the search, or 1 to abort it.<br>All other values are reserved at this point."]
pub type fz_search_callback_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        opaque: *mut ::core::ffi::c_void,
        num_quads: ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Callback function for use in searching.\n\nCalled with the list of quads that correspond to a single hit.\n\nThe callback should return with 0 to continue the search, or 1 to abort it.<br>All other values are reserved at this point."]
pub type fz_match_callback_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        opaque: *mut ::core::ffi::c_void,
        num_quads: ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int,
>;
unsafe extern "C" {
    #[doc = "Search for occurrence of 'needle' in text page.\n\nCall callback once for each hit. This callback will receive<br>\\(potentially\\) multiple quads for each hit.\n\nReturns the number of hits - note that this is potentially<br>different from \\(i.e. is not greater than\\) the number of quads<br>as returned by the non callback API.\n\n`NOTE`: This is an experimental interface and subject to change<br>without notice."]
    pub fn fz_search_stext_page_cb(
        ctx: *mut fz_context,
        text: *mut fz_stext_page,
        needle: *const ::core::ffi::c_char,
        cb: fz_search_callback_fn,
        opaque: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return a list of quads to highlight lines inside the selection<br>points."]
    pub fn fz_highlight_selection(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        a: fz_point,
        b: fz_point,
        quads: *mut fz_quad,
        max_quads: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
pub const FZ_SELECT_CHARS: _bindgen_ty_27 = 0;
pub const FZ_SELECT_WORDS: _bindgen_ty_27 = 1;
pub const FZ_SELECT_LINES: _bindgen_ty_27 = 2;
pub type _bindgen_ty_27 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn fz_snap_selection(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        ap: *mut fz_point,
        bp: *mut fz_point,
        mode: ::core::ffi::c_int,
    ) -> fz_quad;
}
unsafe extern "C" {
    #[doc = "Return a newly allocated UTF-8 string with the text for a given<br>selection.\n\n`crlf`: If true, write \"\\r\\n\" style line endings \\(otherwise \"\\n\"<br>only\\)."]
    pub fn fz_copy_selection(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        a: fz_point,
        b: fz_point,
        crlf: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return a newly allocated UTF-8 string with the text for a given<br>selection rectangle.\n\n`crlf`: If true, write \"\\r\\n\" style line endings \\(otherwise \"\\n\"<br>only\\)."]
    pub fn fz_copy_rectangle(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        area: fz_rect,
        crlf: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_char;
}
#[doc = "Options for creating structured text."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_options {
    pub flags: ::core::ffi::c_int,
    pub scale: f32,
    pub clip: fz_rect,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_options"][::core::mem::size_of::<fz_stext_options>() - 24usize];
    ["Alignment of fz_stext_options"][::core::mem::align_of::<fz_stext_options>() - 4usize];
    ["Offset of field: fz_stext_options::flags"]
        [::core::mem::offset_of!(fz_stext_options, flags) - 0usize];
    ["Offset of field: fz_stext_options::scale"]
        [::core::mem::offset_of!(fz_stext_options, scale) - 4usize];
    ["Offset of field: fz_stext_options::clip"]
        [::core::mem::offset_of!(fz_stext_options, clip) - 8usize];
};
unsafe extern "C" {
    #[doc = "Parse stext device options from a comma separated key-value<br>string."]
    pub fn fz_parse_stext_options(
        ctx: *mut fz_context,
        opts: *mut fz_stext_options,
        string: *const ::core::ffi::c_char,
    ) -> *mut fz_stext_options;
}
unsafe extern "C" {
    #[doc = "Perform segmentation analysis on an \\(unstructured\\) page to look for<br>recursive subdivisions.\n\nEssentially this code attempts to split the page horizontally and/or<br>vertically repeatedly into smaller and smaller \"segments\" \\(divisions\\).\n\nThis minimises the reordering of the content, but some reordering<br>may be unavoidable.\n\nReturns 0 if no changes were made to the document.\n\nThis is experimental code, and may change \\(or be removed\\) in future<br>versions!"]
    pub fn fz_segment_stext_page(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Perform segmentation analysis on a rectangle of a given<br>stext page.\n\nLike [`fz_segment_stext_page`], this attempts to split the given page<br>region horizontally and/or vertically repeatedly into smaller and<br>smaller \"segments\".\n\nThis works for pages with structure too, but splitting with<br>rectangles that cut across structure blocks may not behave as<br>expected.\n\nThis minimises the reordering of the content \\(as viewed from the<br>perspective of a depth first traversal\\), but some reordering may<br>be unavoidable.\n\nThis function accepts smaller gaps for segmentation than the full<br>page segmentation does.\n\nReturns 0 if no changes were made to the document.\n\nThis is experimental code, and may change \\(or be removed\\) in future<br>versions!"]
    pub fn fz_segment_stext_rect(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        rect: fz_rect,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Attempt to break paragraphs at plausible places."]
    pub fn fz_paragraph_break(ctx: *mut fz_context, page: *mut fz_stext_page);
}
unsafe extern "C" {
    #[doc = "Hunt for possible tables on a page, and update the stext with<br>information."]
    pub fn fz_table_hunt(ctx: *mut fz_context, page: *mut fz_stext_page);
}
unsafe extern "C" {
    #[doc = "Hunt for possible tables within a specific rect on a page, and<br>update the stext with information."]
    pub fn fz_table_hunt_within_bounds(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        bounds: fz_rect,
    );
}
unsafe extern "C" {
    #[doc = "Interpret the bounded contents of a given stext page as<br>a table.\n\nThe page contents will be rewritten to contain a Table<br>structure with the identified content in it.\n\nThis uses the same logic as for [`fz_table_hunt`], without the<br>actual hunting. [`fz_table_hunt`] hunts to find possible bounds<br>for multiple tables on the page; this routine just finds a<br>single table contained within the given rectangle.\n\nReturns the stext_block list that contains the content of<br>the table."]
    pub fn fz_find_table_within_bounds(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        bounds: fz_rect,
    ) -> *mut fz_stext_block;
}
unsafe extern "C" {
    #[doc = "Create a device to extract the text on a page.\n\nGather the text on a page into blocks and lines.\n\nThe reading order is taken from the order the text is drawn in<br>the source file, so may not be accurate.\n\n`page`: The text page to which content should be added. This will<br>usually be a newly created \\(empty\\) text page, but it can be one<br>containing data already \\(for example when merging multiple<br>pages, or watermarking\\).\n\n`options`: Options to configure the stext device."]
    pub fn fz_new_stext_device(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        options: *const fz_stext_options,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to extract the text on a page into an existing<br>[`fz_stext_page`] structure.\n\nGather the text on a page into blocks and lines.\n\nThe reading order is taken from the order the text is drawn in<br>the source file, so may not be accurate.\n\n`stext_page`: The text page to which content should be added. This will<br>usually be a newly created \\(empty\\) text page, but it can be one<br>containing data already \\(for example when merging multiple<br>pages, or watermarking\\).\n\n`options`: Options to configure the stext device.\n\nThe next 2 parameters are copied into the [`fz_stext_page`] structure's<br>ids section, so only have to be valid if you expect to interrogate<br>that section later.\n\n`chapter_num`: The chapter number that this page came from.\n\n`page_num`: The page number that this page came from.\n\nThe final parameter is copied into the [`fz_stext_page`] structure's<br>ids section. The mediabox for the enture [`fz_stext_page`] is unioned<br>with this, so pass [`fz_empty_bbox`] if you don't care about getting<br>a valid value back from the ids section, but you don't want to<br>upset the value in the page-\\>mediabox field.\n\n`mediabox`: The mediabox for this page."]
    pub fn fz_new_stext_device_for_page(
        ctx: *mut fz_context,
        stext_page: *mut fz_stext_page,
        opts: *const fz_stext_options,
        chapter_num: ::core::ffi::c_int,
        page_num: ::core::ffi::c_int,
        mediabox: fz_rect,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device to OCR the text on the page.\n\nRenders the page internally to a bitmap that is then OCRd. Text<br>is then forwarded onto the target device.\n\n`target`: The target device to receive the OCRd text.\n\n`ctm`: The transform to apply to the mediabox to get the size for<br>the rendered page image. Also used to calculate the resolution<br>for the page image. In general, this will be the same as the CTM<br>that you pass to [`fz_run_page`] \\(or [`fz_run_display_list`]\\) to feed<br>this device.\n\n`mediabox`: The mediabox \\(in points\\). Combined with the CTM to get<br>the bounds of the pixmap used internally for the rendered page<br>image.\n\n`with_list`: If with_list is false, then all non-text operations<br>are forwarded instantly to the target device. This results in<br>the target device seeing all NON-text operations, followed by<br>all the text operations \\(derived from OCR\\).\n\nIf with_list is true, then all the marking operations are<br>collated into a display list which is then replayed to the<br>target device at the end.\n\n`language`: `NULL` \\(for \"eng\"\\), or a pointer to a string to describe<br>the languages/scripts that should be used for OCR \\(e.g.<br>\"eng,ara\"\\).\n\n`datadir`: `NULL` \\(for \"\"\\), or a pointer to a path string otherwise<br>provided to Tesseract in the TESSDATA_PREFIX environment variable.\n\n`progress`: `NULL`, or function to be called periodically to indicate<br>progress. Return 0 to continue, or 1 to cancel. progress_arg is<br>returned as the void *. The int is a value between 0 and 100 to<br>indicate progress.\n\n`progress_arg`: A void * value to be parrotted back to the progress<br>function."]
    pub fn fz_new_ocr_device(
        ctx: *mut fz_context,
        target: *mut fz_device,
        ctm: fz_matrix,
        mediabox: fz_rect,
        with_list: ::core::ffi::c_int,
        language: *const ::core::ffi::c_char,
        datadir: *const ::core::ffi::c_char,
        progress: ::core::option::Option<
            unsafe extern "C" fn(
                arg1: *mut fz_context,
                arg2: *mut ::core::ffi::c_void,
                arg3: ::core::ffi::c_int,
            ) -> ::core::ffi::c_int,
        >,
        progress_arg: *mut ::core::ffi::c_void,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn fz_new_ocr_device_with_options(
        ctx: *mut fz_context,
        target: *mut fz_device,
        ctm: fz_matrix,
        mediabox: fz_rect,
        with_list: ::core::ffi::c_int,
        language: *const ::core::ffi::c_char,
        datadir: *const ::core::ffi::c_char,
        progress: ::core::option::Option<
            unsafe extern "C" fn(
                arg1: *mut fz_context,
                arg2: *mut ::core::ffi::c_void,
                arg3: ::core::ffi::c_int,
            ) -> ::core::ffi::c_int,
        >,
        progress_arg: *mut ::core::ffi::c_void,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn fz_open_reflowed_document(
        ctx: *mut fz_context,
        underdoc: *mut fz_document,
        opts: *const fz_stext_options,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Simple function to return if a given unicode char is equivalent to a space."]
    pub fn fz_is_unicode_space_equivalent(c: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Simple function to return if a given unicode char is whitespace."]
    pub fn fz_is_unicode_whitespace(c: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Simple function to return if a given unicode char is a hyphen."]
    pub fn fz_is_unicode_hyphen(c: ::core::ffi::c_int) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_search {
    _unused: [u8; 0],
}
pub const FZ_SEARCH_EXACT: fz_search_options = 0;
pub const FZ_SEARCH_IGNORE_CASE: fz_search_options = 1;
pub const FZ_SEARCH_IGNORE_DIACRITICS: fz_search_options = 2;
pub const FZ_SEARCH_REGEXP: fz_search_options = 4;
pub const FZ_SEARCH_KEEP_LINES: fz_search_options = 8;
pub const FZ_SEARCH_KEEP_PARAGRAPHS: fz_search_options = 16;
pub const FZ_SEARCH_KEEP_HYPHENS: fz_search_options = 32;
pub type fz_search_options = ::core::ffi::c_uint;
unsafe extern "C" {
    pub static mut fz_search_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_parse_search_options(options: *const ::core::ffi::c_char) -> fz_search_options;
}
unsafe extern "C" {
    #[doc = "Create a new search."]
    pub fn fz_new_search(ctx: *mut fz_context) -> *mut fz_search;
}
unsafe extern "C" {
    #[doc = "Change the options/needle to be used for a search.\n\nIf the needle is invalid \\(in the case of regexps, it fails to compile\\)<br>it will throw an error.\n\nIf the needle changes, the current position of the search within the<br>text is kept.\n\nIf the options change, the search position may revert to the beginning<br>of the current page."]
    pub fn fz_search_set_options(
        ctx: *mut fz_context,
        search: *mut fz_search,
        options: fz_search_options,
        needle: *const ::core::ffi::c_char,
    );
}
pub const FZ_SEARCH_MORE_INPUT: fz_search_reason = 0;
pub const FZ_SEARCH_MATCH: fz_search_reason = 1;
pub const FZ_SEARCH_COMPLETE: fz_search_reason = 2;
pub type fz_search_reason = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_match_quad {
    pub quad: fz_quad,
    pub seq: ::core::ffi::c_int,
    pub chapter_num: ::core::ffi::c_int,
    pub page_num: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_match_quad"][::core::mem::size_of::<fz_match_quad>() - 44usize];
    ["Alignment of fz_match_quad"][::core::mem::align_of::<fz_match_quad>() - 4usize];
    ["Offset of field: fz_match_quad::quad"][::core::mem::offset_of!(fz_match_quad, quad) - 0usize];
    ["Offset of field: fz_match_quad::seq"][::core::mem::offset_of!(fz_match_quad, seq) - 32usize];
    ["Offset of field: fz_match_quad::chapter_num"]
        [::core::mem::offset_of!(fz_match_quad, chapter_num) - 36usize];
    ["Offset of field: fz_match_quad::page_num"]
        [::core::mem::offset_of!(fz_match_quad, page_num) - 40usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_position {
    pub page: *mut fz_stext_page,
    pub parent: *mut fz_stext_struct,
    pub block: *mut fz_stext_block,
    pub line: *mut fz_stext_line,
    pub ch: *mut fz_stext_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_position"][::core::mem::size_of::<fz_stext_position>() - 40usize];
    ["Alignment of fz_stext_position"][::core::mem::align_of::<fz_stext_position>() - 8usize];
    ["Offset of field: fz_stext_position::page"]
        [::core::mem::offset_of!(fz_stext_position, page) - 0usize];
    ["Offset of field: fz_stext_position::parent"]
        [::core::mem::offset_of!(fz_stext_position, parent) - 8usize];
    ["Offset of field: fz_stext_position::block"]
        [::core::mem::offset_of!(fz_stext_position, block) - 16usize];
    ["Offset of field: fz_stext_position::line"]
        [::core::mem::offset_of!(fz_stext_position, line) - 24usize];
    ["Offset of field: fz_stext_position::ch"]
        [::core::mem::offset_of!(fz_stext_position, ch) - 32usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_search_result_details {
    pub num_quads: ::core::ffi::c_int,
    pub quads: *mut fz_match_quad,
    pub begin: fz_stext_position,
    pub end: fz_stext_position,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_search_result_details"]
        [::core::mem::size_of::<fz_search_result_details>() - 96usize];
    ["Alignment of fz_search_result_details"]
        [::core::mem::align_of::<fz_search_result_details>() - 8usize];
    ["Offset of field: fz_search_result_details::num_quads"]
        [::core::mem::offset_of!(fz_search_result_details, num_quads) - 0usize];
    ["Offset of field: fz_search_result_details::quads"]
        [::core::mem::offset_of!(fz_search_result_details, quads) - 8usize];
    ["Offset of field: fz_search_result_details::begin"]
        [::core::mem::offset_of!(fz_search_result_details, begin) - 16usize];
    ["Offset of field: fz_search_result_details::end"]
        [::core::mem::offset_of!(fz_search_result_details, end) - 56usize];
};
#[doc = "Structure used to represent the 'result' of a search."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct fz_search_result {
    pub reason: fz_search_reason,
    pub u: fz_search_result__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union fz_search_result__bindgen_ty_1 {
    pub more_input: fz_search_result__bindgen_ty_1__bindgen_ty_1,
    pub match_: fz_search_result__bindgen_ty_1__bindgen_ty_2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_search_result__bindgen_ty_1__bindgen_ty_1 {
    pub seq_needed: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_search_result__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::size_of::<fz_search_result__bindgen_ty_1__bindgen_ty_1>() - 4usize];
    ["Alignment of fz_search_result__bindgen_ty_1__bindgen_ty_1"]
        [::core::mem::align_of::<fz_search_result__bindgen_ty_1__bindgen_ty_1>() - 4usize];
    ["Offset of field: fz_search_result__bindgen_ty_1__bindgen_ty_1::seq_needed"][::core::mem::offset_of!(
        fz_search_result__bindgen_ty_1__bindgen_ty_1,
        seq_needed
    ) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_search_result__bindgen_ty_1__bindgen_ty_2 {
    pub result: *mut fz_search_result_details,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_search_result__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::size_of::<fz_search_result__bindgen_ty_1__bindgen_ty_2>() - 8usize];
    ["Alignment of fz_search_result__bindgen_ty_1__bindgen_ty_2"]
        [::core::mem::align_of::<fz_search_result__bindgen_ty_1__bindgen_ty_2>() - 8usize];
    ["Offset of field: fz_search_result__bindgen_ty_1__bindgen_ty_2::result"]
        [::core::mem::offset_of!(fz_search_result__bindgen_ty_1__bindgen_ty_2, result) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_search_result__bindgen_ty_1"]
        [::core::mem::size_of::<fz_search_result__bindgen_ty_1>() - 8usize];
    ["Alignment of fz_search_result__bindgen_ty_1"]
        [::core::mem::align_of::<fz_search_result__bindgen_ty_1>() - 8usize];
    ["Offset of field: fz_search_result__bindgen_ty_1::more_input"]
        [::core::mem::offset_of!(fz_search_result__bindgen_ty_1, more_input) - 0usize];
    ["Offset of field: fz_search_result__bindgen_ty_1::match_"]
        [::core::mem::offset_of!(fz_search_result__bindgen_ty_1, match_) - 0usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_search_result"][::core::mem::size_of::<fz_search_result>() - 16usize];
    ["Alignment of fz_search_result"][::core::mem::align_of::<fz_search_result>() - 8usize];
    ["Offset of field: fz_search_result::reason"]
        [::core::mem::offset_of!(fz_search_result, reason) - 0usize];
    ["Offset of field: fz_search_result::u"][::core::mem::offset_of!(fz_search_result, u) - 8usize];
};
unsafe extern "C" {
    #[doc = "Continue searching for the next match.\n\nWill return with a search result.\n\nIf it asks for more stext, feed it with the requested page \\(or<br>`NULL` to tell it it's the end of the document\\) before calling<br>this again.\n\nSeveral pages may be requested before searching begins."]
    pub fn fz_search_forwards(ctx: *mut fz_context, search: *mut fz_search) -> fz_search_result;
}
unsafe extern "C" {
    #[doc = "Continue searching backwards for the next match.\n\nWill return asking for more stext, having matched, or having<br>completed the search.\n\nIf it asks for more stext, then any further calls to this<br>function will give the same result, until stext is supplied,<br>or a `NULL` stext is fed in to indicate the end of the document.\n\nSeveral pages may be requested before searching begins."]
    pub fn fz_search_backwards(ctx: *mut fz_context, search: *mut fz_search) -> fz_search_result;
}
unsafe extern "C" {
    #[doc = "Supply more stext to be searched; ownership of the stext page is<br>passed in.\n\nThis can be called immediately after an [`fz_search`] has been created<br>to give it the first page to search, or it will be requested as soon<br>as the first search operation is done on that page.\n\nIf we are calling this in response to [`fz_search_forwards`] telling<br>us that we need another page, page will be the stext for the next<br>page.\n\nIf we are calling this in response to [`fz_search_backwards`] telling<br>is that we need another page, page will be the stext for the previous<br>page.\n\nseq is a simple integer value that will be parrotted back to us in the<br>match \\(typically the page number within the document\\).\n\nThe search function will retain the page for a while. When it has<br>finished with it, it will call [`fz_drop_stext_page`]\\(\\) to release it.\n\nPass page = `NULL` to indicate that there are no more pages \\(in this<br>direction\\) to be fed."]
    pub fn fz_feed_search(
        ctx: *mut fz_context,
        search: *mut fz_search,
        page: *mut fz_stext_page,
        seq: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Free the search structures."]
    pub fn fz_drop_search(ctx: *mut fz_context, search: *mut fz_search);
}
unsafe extern "C" {
    #[doc = "Search for occurrence of 'needle' in text page, matching in a given<br>style.\n\nReturn the number of quads and store hit quads in the passed in<br>array.\n\n`NOTE`: This is an experimental interface and subject to change<br>without notice."]
    pub fn fz_match_stext_page(
        ctx: *mut fz_context,
        text: *mut fz_stext_page,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Search for occurrence of 'needle' in text page.\n\nCall callback once for each hit. This callback will receive<br>\\(potentially\\) multiple quads for each hit.\n\nReturns the number of hits - note that this is potentially<br>different from \\(i.e. is not greater than\\) the number of quads<br>as returned by the non callback API.\n\n`NOTE`: This is an experimental interface and subject to change<br>without notice."]
    pub fn fz_match_stext_page_cb(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        needle: *const ::core::ffi::c_char,
        cb: fz_match_callback_fn,
        opaque: *mut ::core::ffi::c_void,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_new_stext_struct(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        standard: fz_structure,
        raw: *const ::core::ffi::c_char,
        index: ::core::ffi::c_int,
    ) -> *mut fz_stext_block;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_stext_page_block_iterator {
    pub page: *mut fz_stext_page,
    pub parent: *mut fz_stext_struct,
    pub block: *mut fz_stext_block,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_stext_page_block_iterator"]
        [::core::mem::size_of::<fz_stext_page_block_iterator>() - 24usize];
    ["Alignment of fz_stext_page_block_iterator"]
        [::core::mem::align_of::<fz_stext_page_block_iterator>() - 8usize];
    ["Offset of field: fz_stext_page_block_iterator::page"]
        [::core::mem::offset_of!(fz_stext_page_block_iterator, page) - 0usize];
    ["Offset of field: fz_stext_page_block_iterator::parent"]
        [::core::mem::offset_of!(fz_stext_page_block_iterator, parent) - 8usize];
    ["Offset of field: fz_stext_page_block_iterator::block"]
        [::core::mem::offset_of!(fz_stext_page_block_iterator, block) - 16usize];
};
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_begin(
        page: *mut fz_stext_page,
    ) -> fz_stext_page_block_iterator;
}
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_begin_dfs(
        page: *mut fz_stext_page,
    ) -> fz_stext_page_block_iterator;
}
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_next(
        pos: fz_stext_page_block_iterator,
    ) -> fz_stext_page_block_iterator;
}
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_down(
        pos: fz_stext_page_block_iterator,
    ) -> fz_stext_page_block_iterator;
}
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_up(
        pos: fz_stext_page_block_iterator,
    ) -> fz_stext_page_block_iterator;
}
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_next_dfs(
        pos: fz_stext_page_block_iterator,
    ) -> fz_stext_page_block_iterator;
}
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_eod(
        pos: fz_stext_page_block_iterator,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_stext_page_block_iterator_eod_dfs(
        pos: fz_stext_page_block_iterator,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_classify_stext_rect(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        classification: fz_structure,
        rect: fz_rect,
    );
}
unsafe extern "C" {
    pub fn fz_stext_remove_page_fill(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
    ) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_image_raft_options {
    pub max_size: ::core::ffi::c_int,
    pub combine_image: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_image_raft_options"][::core::mem::size_of::<fz_image_raft_options>() - 8usize];
    ["Alignment of fz_image_raft_options"]
        [::core::mem::align_of::<fz_image_raft_options>() - 4usize];
    ["Offset of field: fz_image_raft_options::max_size"]
        [::core::mem::offset_of!(fz_image_raft_options, max_size) - 0usize];
    ["Offset of field: fz_image_raft_options::combine_image"]
        [::core::mem::offset_of!(fz_image_raft_options, combine_image) - 4usize];
};
unsafe extern "C" {
    pub fn fz_stext_raft_images(
        ctx: *mut fz_context,
        stext: *mut fz_stext_page,
        options: *mut fz_image_raft_options,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_flotilla {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn fz_new_flotilla_from_stext_page_vectors(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
    ) -> *mut fz_flotilla;
}
unsafe extern "C" {
    pub fn fz_drop_flotilla(ctx: *mut fz_context, f: *mut fz_flotilla);
}
unsafe extern "C" {
    pub fn fz_flotilla_size(ctx: *mut fz_context, flot: *mut fz_flotilla) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_flotilla_raft_area(
        ctx: *mut fz_context,
        flot: *mut fz_flotilla,
        i: ::core::ffi::c_int,
    ) -> fz_rect;
}
pub const FZ_TRANSITION_NONE: _bindgen_ty_28 = 0;
pub const FZ_TRANSITION_SPLIT: _bindgen_ty_28 = 1;
pub const FZ_TRANSITION_BLINDS: _bindgen_ty_28 = 2;
pub const FZ_TRANSITION_BOX: _bindgen_ty_28 = 3;
pub const FZ_TRANSITION_WIPE: _bindgen_ty_28 = 4;
pub const FZ_TRANSITION_DISSOLVE: _bindgen_ty_28 = 5;
pub const FZ_TRANSITION_GLITTER: _bindgen_ty_28 = 6;
pub const FZ_TRANSITION_FLY: _bindgen_ty_28 = 7;
pub const FZ_TRANSITION_PUSH: _bindgen_ty_28 = 8;
pub const FZ_TRANSITION_COVER: _bindgen_ty_28 = 9;
pub const FZ_TRANSITION_UNCOVER: _bindgen_ty_28 = 10;
pub const FZ_TRANSITION_FADE: _bindgen_ty_28 = 11;
pub type _bindgen_ty_28 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_transition {
    pub type_: ::core::ffi::c_int,
    pub duration: f32,
    pub vertical: ::core::ffi::c_int,
    pub outwards: ::core::ffi::c_int,
    pub direction: ::core::ffi::c_int,
    pub state0: ::core::ffi::c_int,
    pub state1: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_transition"][::core::mem::size_of::<fz_transition>() - 28usize];
    ["Alignment of fz_transition"][::core::mem::align_of::<fz_transition>() - 4usize];
    ["Offset of field: fz_transition::type_"]
        [::core::mem::offset_of!(fz_transition, type_) - 0usize];
    ["Offset of field: fz_transition::duration"]
        [::core::mem::offset_of!(fz_transition, duration) - 4usize];
    ["Offset of field: fz_transition::vertical"]
        [::core::mem::offset_of!(fz_transition, vertical) - 8usize];
    ["Offset of field: fz_transition::outwards"]
        [::core::mem::offset_of!(fz_transition, outwards) - 12usize];
    ["Offset of field: fz_transition::direction"]
        [::core::mem::offset_of!(fz_transition, direction) - 16usize];
    ["Offset of field: fz_transition::state0"]
        [::core::mem::offset_of!(fz_transition, state0) - 20usize];
    ["Offset of field: fz_transition::state1"]
        [::core::mem::offset_of!(fz_transition, state1) - 24usize];
};
unsafe extern "C" {
    #[doc = "Generate a frame of a transition.\n\n`tpix`: Target pixmap<br>`opix`: Old pixmap<br>`npix`: New pixmap<br>`time`: Position within the transition \\(0 to 256\\)<br>`trans`: Transition details\n\nReturns 1 if successfully generated a frame.\n\n`Note`: Pixmaps must include alpha."]
    pub fn fz_generate_transition(
        ctx: *mut fz_context,
        tpix: *mut fz_pixmap,
        opix: *mut fz_pixmap,
        npix: *mut fz_pixmap,
        time: ::core::ffi::c_int,
        trans: *mut fz_transition,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Purge all the glyphs from the cache."]
    pub fn fz_purge_glyph_cache(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Create a pixmap containing a rendered glyph.\n\nLookup gid from font, clip it with scissor, and rendering it<br>with aa bits of antialiasing into a new pixmap.\n\nThe caller takes ownership of the pixmap and so must free it.\n\n`Note`: This function is no longer used for normal rendering<br>operations, and is kept around just because we use it in the<br>app. It should be considered \"at risk\" of removal from the API."]
    pub fn fz_render_glyph_pixmap(
        ctx: *mut fz_context,
        font: *mut fz_font,
        gid: ::core::ffi::c_int,
        ctm: *mut fz_matrix,
        scissor: *const fz_irect,
        aa: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Nasty PDF interpreter specific hernia, required to allow the<br>interpreter to replay glyphs from a type3 font directly into<br>the target device.\n\nThis is only used in exceptional circumstances \\(such as type3<br>glyphs that inherit current graphics state, or nested type3<br>glyphs\\)."]
    pub fn fz_render_t3_glyph_direct(
        ctx: *mut fz_context,
        dev: *mut fz_device,
        font: *mut fz_font,
        gid: ::core::ffi::c_int,
        trm: fz_matrix,
        gstate: *mut ::core::ffi::c_void,
        def_cs: *mut fz_default_colorspaces,
        fill_gstate: *mut ::core::ffi::c_void,
        stroke_gstate: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Force a type3 font to cache the displaylist for a given glyph<br>id.\n\nThis caching can involve reading the underlying file, so must<br>happen ahead of time, so we aren't suddenly forced to read the<br>file while playing a displaylist back."]
    pub fn fz_prepare_t3_glyph(ctx: *mut fz_context, font: *mut fz_font, gid: ::core::ffi::c_int);
}
unsafe extern "C" {
    #[doc = "Dump debug statistics for the glyph cache."]
    pub fn fz_dump_glyph_cache_stats(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Perform subpixel quantisation and adjustment on a glyph matrix.\n\n`ctm`: On entry, the desired 'ideal' transformation for a glyph.<br>On exit, adjusted to a \\(very similar\\) transformation quantised<br>for subpixel caching.\n\n`subpix_ctm`: Initialised by the routine to the transform that<br>should be used to render the glyph.\n\n`qe`, `qf`: which subpixel position we quantised to.\n\n`Returns`: the size of the glyph.\n\n`Note`: This is currently only exposed for use in our app. It<br>should be considered \"at risk\" of removal from the API."]
    pub fn fz_subpixel_adjust(
        ctx: *mut fz_context,
        ctm: *mut fz_matrix,
        subpix_ctm: *mut fz_matrix,
        qe: *mut ::core::ffi::c_uchar,
        qf: *mut ::core::ffi::c_uchar,
    ) -> f32;
}
pub type fz_link_set_rect_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, link: *mut fz_link, rect: fz_rect),
>;
pub type fz_link_set_uri_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, link: *mut fz_link, uri: *const ::core::ffi::c_char),
>;
pub type fz_link_drop_link_fn =
    ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, link: *mut fz_link)>;
#[doc = "[`fz_link`] is a list of interactive links on a page.\n\nThere is no relation between the order of the links in the<br>list and the order they appear on the page. The list of links<br>for a given page can be obtained from [`fz_load_link`](fz_load_link)s.\n\nA link is reference counted. Dropping a reference to a link is<br>done by calling [`fz_drop_link`].\n\n`rect`: The hot zone. The area that can be clicked in<br>untransformed coordinates.\n\n`uri`: Link destinations come in two forms: internal and external.<br>Internal links refer to other pages in the same document.<br>External links are URLs to other documents.\n\n`next`: A pointer to the next link on the same page."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_link {
    pub refs: ::core::ffi::c_int,
    pub next: *mut fz_link,
    pub rect: fz_rect,
    pub uri: *mut ::core::ffi::c_char,
    pub set_rect_fn: fz_link_set_rect_fn,
    pub set_uri_fn: fz_link_set_uri_fn,
    pub drop: fz_link_drop_link_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_link"][::core::mem::size_of::<fz_link>() - 64usize];
    ["Alignment of fz_link"][::core::mem::align_of::<fz_link>() - 8usize];
    ["Offset of field: fz_link::refs"][::core::mem::offset_of!(fz_link, refs) - 0usize];
    ["Offset of field: fz_link::next"][::core::mem::offset_of!(fz_link, next) - 8usize];
    ["Offset of field: fz_link::rect"][::core::mem::offset_of!(fz_link, rect) - 16usize];
    ["Offset of field: fz_link::uri"][::core::mem::offset_of!(fz_link, uri) - 32usize];
    ["Offset of field: fz_link::set_rect_fn"]
        [::core::mem::offset_of!(fz_link, set_rect_fn) - 40usize];
    ["Offset of field: fz_link::set_uri_fn"]
        [::core::mem::offset_of!(fz_link, set_uri_fn) - 48usize];
    ["Offset of field: fz_link::drop"][::core::mem::offset_of!(fz_link, drop) - 56usize];
};
pub const FZ_LINK_DEST_FIT: fz_link_dest_type = 0;
pub const FZ_LINK_DEST_FIT_B: fz_link_dest_type = 1;
pub const FZ_LINK_DEST_FIT_H: fz_link_dest_type = 2;
pub const FZ_LINK_DEST_FIT_BH: fz_link_dest_type = 3;
pub const FZ_LINK_DEST_FIT_V: fz_link_dest_type = 4;
pub const FZ_LINK_DEST_FIT_BV: fz_link_dest_type = 5;
pub const FZ_LINK_DEST_FIT_R: fz_link_dest_type = 6;
pub const FZ_LINK_DEST_XYZ: fz_link_dest_type = 7;
pub type fz_link_dest_type = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_link_dest {
    pub loc: fz_location,
    pub type_: fz_link_dest_type,
    pub x: f32,
    pub y: f32,
    pub w: f32,
    pub h: f32,
    pub zoom: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_link_dest"][::core::mem::size_of::<fz_link_dest>() - 32usize];
    ["Alignment of fz_link_dest"][::core::mem::align_of::<fz_link_dest>() - 4usize];
    ["Offset of field: fz_link_dest::loc"][::core::mem::offset_of!(fz_link_dest, loc) - 0usize];
    ["Offset of field: fz_link_dest::type_"][::core::mem::offset_of!(fz_link_dest, type_) - 8usize];
    ["Offset of field: fz_link_dest::x"][::core::mem::offset_of!(fz_link_dest, x) - 12usize];
    ["Offset of field: fz_link_dest::y"][::core::mem::offset_of!(fz_link_dest, y) - 16usize];
    ["Offset of field: fz_link_dest::w"][::core::mem::offset_of!(fz_link_dest, w) - 20usize];
    ["Offset of field: fz_link_dest::h"][::core::mem::offset_of!(fz_link_dest, h) - 24usize];
    ["Offset of field: fz_link_dest::zoom"][::core::mem::offset_of!(fz_link_dest, zoom) - 28usize];
};
unsafe extern "C" {
    pub fn fz_make_link_dest_none() -> fz_link_dest;
}
unsafe extern "C" {
    pub fn fz_make_link_dest_xyz(
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
        x: f32,
        y: f32,
        z: f32,
    ) -> fz_link_dest;
}
unsafe extern "C" {
    #[doc = "Create a new link record.\n\nnext is set to `NULL` with the expectation that the caller will<br>handle the linked list setup. Internal function.\n\nDifferent document types will be implemented by deriving from<br>[`fz_link`]. This macro allocates such derived structures, and<br>initialises the base sections."]
    pub fn fz_new_link_of_size(
        ctx: *mut fz_context,
        size: ::core::ffi::c_int,
        rect: fz_rect,
        uri: *const ::core::ffi::c_char,
    ) -> *mut fz_link;
}
unsafe extern "C" {
    #[doc = "Increment the reference count for a link. The same pointer is<br>returned.\n\nNever throws exceptions."]
    pub fn fz_keep_link(ctx: *mut fz_context, link: *mut fz_link) -> *mut fz_link;
}
unsafe extern "C" {
    #[doc = "Decrement the reference count for a link. When the reference<br>count reaches zero, the link is destroyed.\n\nWhen a link is freed, the reference for any linked link \\(next\\)<br>is dropped too, thus an entire linked list of [`fz_link`]'s can be<br>freed by just dropping the head."]
    pub fn fz_drop_link(ctx: *mut fz_context, link: *mut fz_link);
}
unsafe extern "C" {
    #[doc = "Query whether a link is external to a document \\(determined by<br>uri containing a ':', intended to match with '://' which<br>separates the scheme from the scheme specific parts in URIs\\)."]
    pub fn fz_is_external_link(
        ctx: *mut fz_context,
        uri: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_set_link_rect(ctx: *mut fz_context, link: *mut fz_link, rect: fz_rect);
}
unsafe extern "C" {
    pub fn fz_set_link_uri(
        ctx: *mut fz_context,
        link: *mut fz_link,
        uri: *const ::core::ffi::c_char,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_outline_item {
    pub title: *mut ::core::ffi::c_char,
    pub uri: *mut ::core::ffi::c_char,
    pub is_open: ::core::ffi::c_int,
    pub flags: ::core::ffi::c_int,
    pub r: f32,
    pub g: f32,
    pub b: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_outline_item"][::core::mem::size_of::<fz_outline_item>() - 40usize];
    ["Alignment of fz_outline_item"][::core::mem::align_of::<fz_outline_item>() - 8usize];
    ["Offset of field: fz_outline_item::title"]
        [::core::mem::offset_of!(fz_outline_item, title) - 0usize];
    ["Offset of field: fz_outline_item::uri"]
        [::core::mem::offset_of!(fz_outline_item, uri) - 8usize];
    ["Offset of field: fz_outline_item::is_open"]
        [::core::mem::offset_of!(fz_outline_item, is_open) - 16usize];
    ["Offset of field: fz_outline_item::flags"]
        [::core::mem::offset_of!(fz_outline_item, flags) - 20usize];
    ["Offset of field: fz_outline_item::r"][::core::mem::offset_of!(fz_outline_item, r) - 24usize];
    ["Offset of field: fz_outline_item::g"][::core::mem::offset_of!(fz_outline_item, g) - 28usize];
    ["Offset of field: fz_outline_item::b"][::core::mem::offset_of!(fz_outline_item, b) - 32usize];
};
pub const FZ_OUTLINE_FLAG_BOLD: _bindgen_ty_29 = 1;
pub const FZ_OUTLINE_FLAG_ITALIC: _bindgen_ty_29 = 2;
pub type _bindgen_ty_29 = ::core::ffi::c_uint;
pub const FZ_OUTLINE_ITERATOR_DID_NOT_MOVE: _bindgen_ty_30 = -1;
pub const FZ_OUTLINE_ITERATOR_AT_ITEM: _bindgen_ty_30 = 0;
pub const FZ_OUTLINE_ITERATOR_AT_EMPTY: _bindgen_ty_30 = 1;
pub type _bindgen_ty_30 = ::core::ffi::c_int;
unsafe extern "C" {
    #[doc = "Call to get the current outline item.\n\nCan return `NULL`. The item is only valid until the next call."]
    pub fn fz_outline_iterator_item(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> *mut fz_outline_item;
}
unsafe extern "C" {
    #[doc = "Calls to move the iterator position.\n\nA negative return value means we could not move as requested. Otherwise:<br>0 = the final position has a valid item.<br>1 = not a valid item, but we can insert an item here."]
    pub fn fz_outline_iterator_next(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_outline_iterator_prev(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_outline_iterator_up(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_outline_iterator_down(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Call to insert a new item BEFORE the current point.\n\nOwnership of pointers are retained by the caller. The item data will be copied.\n\nAfter an insert, we do not change where we are pointing.<br>The return code is the same as for next, it indicates the current iterator position.\n\nNote that for PDF documents at least, the is_open field is ignored. All childless<br>nodes are considered closed by PDF, hence \\(given every newly inserted node is<br>childless by definition\\) all new nodes are inserted with is_open == false."]
    pub fn fz_outline_iterator_insert(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
        item: *mut fz_outline_item,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Delete the current item.\n\nThis implicitly moves us to the 'next' item, and the return code is as for [`fz_outline_iterator_next`]."]
    pub fn fz_outline_iterator_delete(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Update the current item properties according to the given item."]
    pub fn fz_outline_iterator_update(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
        item: *mut fz_outline_item,
    );
}
unsafe extern "C" {
    #[doc = "Drop the current iterator."]
    pub fn fz_drop_outline_iterator(ctx: *mut fz_context, iter: *mut fz_outline_iterator);
}
#[doc = "[`fz_outline`] is a tree of the outline of a document \\(also known<br>as table of contents\\).\n\n`title`: Title of outline item using UTF-8 encoding. May be `NULL`<br>if the outline item has no text string.\n\n`uri`: Destination in the document to be displayed when this<br>outline item is activated. May be an internal or external<br>link, or `NULL` if the outline item does not have a destination.\n\n`page`: The page number of an internal link, or -1 for external<br>links or links with no destination.\n\n`next`: The next outline item at the same level as this outline<br>item. May be `NULL` if no more outline items exist at this level.\n\n`down`: The outline items immediate children in the hierarchy.<br>May be `NULL` if no children exist.\n\n`is_open`: If zero, the outline element is closed in the UI. If<br>1, it should be open, showing any child elements.\n\n`flags`: Bit 0 set -\\> Bold, Bit 1 set -\\> Italic. All other bits<br>reserved.\n\n`r`, `g`, `b`: The RGB components of the color of this entry."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_outline {
    pub refs: ::core::ffi::c_int,
    pub title: *mut ::core::ffi::c_char,
    pub uri: *mut ::core::ffi::c_char,
    pub page: fz_location,
    pub x: f32,
    pub y: f32,
    pub next: *mut fz_outline,
    pub down: *mut fz_outline,
    pub _bitfield_align_1: [u8; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
    pub __bindgen_padding_0: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_outline"][::core::mem::size_of::<fz_outline>() - 64usize];
    ["Alignment of fz_outline"][::core::mem::align_of::<fz_outline>() - 8usize];
    ["Offset of field: fz_outline::refs"][::core::mem::offset_of!(fz_outline, refs) - 0usize];
    ["Offset of field: fz_outline::title"][::core::mem::offset_of!(fz_outline, title) - 8usize];
    ["Offset of field: fz_outline::uri"][::core::mem::offset_of!(fz_outline, uri) - 16usize];
    ["Offset of field: fz_outline::page"][::core::mem::offset_of!(fz_outline, page) - 24usize];
    ["Offset of field: fz_outline::x"][::core::mem::offset_of!(fz_outline, x) - 32usize];
    ["Offset of field: fz_outline::y"][::core::mem::offset_of!(fz_outline, y) - 36usize];
    ["Offset of field: fz_outline::next"][::core::mem::offset_of!(fz_outline, next) - 40usize];
    ["Offset of field: fz_outline::down"][::core::mem::offset_of!(fz_outline, down) - 48usize];
};
impl fz_outline {
    #[inline]
    pub fn is_open(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_is_open(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn is_open_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_is_open_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn flags(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 7u8) as u32) }
    }
    #[inline]
    pub fn set_flags(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(1usize, 7u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn flags_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                1usize,
                7u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_flags_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                1usize,
                7u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn r(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) }
    }
    #[inline]
    pub fn set_r(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 8u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn r_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                8usize,
                8u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_r_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                8usize,
                8u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn g(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) }
    }
    #[inline]
    pub fn set_g(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(16usize, 8u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn g_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                16usize,
                8u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_g_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                16usize,
                8u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn b(&self) -> ::core::ffi::c_uint {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) }
    }
    #[inline]
    pub fn set_b(&mut self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(24usize, 8u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn b_raw(this: *const Self) -> ::core::ffi::c_uint {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                24usize,
                8u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_b_raw(this: *mut Self, val: ::core::ffi::c_uint) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                24usize,
                8u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        is_open: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
        r: ::core::ffi::c_uint,
        g: ::core::ffi::c_uint,
        b: ::core::ffi::c_uint,
    ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 1u8, {
            let is_open: u32 = unsafe { ::core::mem::transmute(is_open) };
            is_open as u64
        });
        __bindgen_bitfield_unit.set(1usize, 7u8, {
            let flags: u32 = unsafe { ::core::mem::transmute(flags) };
            flags as u64
        });
        __bindgen_bitfield_unit.set(8usize, 8u8, {
            let r: u32 = unsafe { ::core::mem::transmute(r) };
            r as u64
        });
        __bindgen_bitfield_unit.set(16usize, 8u8, {
            let g: u32 = unsafe { ::core::mem::transmute(g) };
            g as u64
        });
        __bindgen_bitfield_unit.set(24usize, 8u8, {
            let b: u32 = unsafe { ::core::mem::transmute(b) };
            b as u64
        });
        __bindgen_bitfield_unit
    }
}
unsafe extern "C" {
    #[doc = "Create a new outline entry with zeroed fields for the caller<br>to fill in."]
    pub fn fz_new_outline(ctx: *mut fz_context) -> *mut fz_outline;
}
unsafe extern "C" {
    #[doc = "Increment the reference count. Returns the same pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_outline(ctx: *mut fz_context, outline: *mut fz_outline) -> *mut fz_outline;
}
unsafe extern "C" {
    #[doc = "Decrements the reference count. When the reference point<br>reaches zero, the outline is freed.\n\nWhen freed, it will drop linked\toutline entries \\(next and down\\)<br>too, thus a whole outline structure can be dropped by dropping<br>the top entry.\n\nNever throws exceptions."]
    pub fn fz_drop_outline(ctx: *mut fz_context, outline: *mut fz_outline);
}
unsafe extern "C" {
    #[doc = "Routine to implement the old Structure based API from an iterator."]
    pub fn fz_load_outline_from_iterator(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> *mut fz_outline;
}
#[doc = "Function type for getting the current item.\n\nCan return `NULL`. The item is only valid until the next call."]
pub type fz_outline_iterator_item_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> *mut fz_outline_item,
>;
#[doc = "Function types for moving the iterator position.\n\nA negative return value means we could not move as requested. Otherwise:<br>0 = the final position has a valid item.<br>1 = not a valid item, but we can insert an item here."]
pub type fz_outline_iterator_next_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int,
>;
pub type fz_outline_iterator_prev_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int,
>;
pub type fz_outline_iterator_up_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int,
>;
pub type fz_outline_iterator_down_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Function type for inserting a new item BEFORE the current point.\n\nOwnership of pointers are retained by the caller. The item data will be copied.\n\nAfter an insert, we implicitly do a next, so that a successive insert operation<br>would insert after the item inserted here. The return code is therefore as for next."]
pub type fz_outline_iterator_insert_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
        item: *mut fz_outline_item,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Function type for deleting the current item.\n\nThis implicitly moves us to the 'next' item, and the return code is as for [`fz_outline_iterator_next`]."]
pub type fz_outline_iterator_delete_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Function type for updating the current item properties according to the given item."]
pub type fz_outline_iterator_update_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        iter: *mut fz_outline_iterator,
        item: *mut fz_outline_item,
    ),
>;
#[doc = "Function type for dropping the current iterator."]
pub type fz_outline_iterator_drop_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, iter: *mut fz_outline_iterator),
>;
unsafe extern "C" {
    pub fn fz_new_outline_iterator_of_size(
        ctx: *mut fz_context,
        size: usize,
        doc: *mut fz_document,
    ) -> *mut fz_outline_iterator;
}
unsafe extern "C" {
    pub fn fz_outline_iterator_from_outline(
        ctx: *mut fz_context,
        outline: *mut fz_outline,
    ) -> *mut fz_outline_iterator;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_outline_iterator {
    pub drop: fz_outline_iterator_drop_fn,
    pub item: fz_outline_iterator_item_fn,
    pub next: fz_outline_iterator_next_fn,
    pub prev: fz_outline_iterator_prev_fn,
    pub up: fz_outline_iterator_up_fn,
    pub down: fz_outline_iterator_down_fn,
    pub insert: fz_outline_iterator_insert_fn,
    pub update: fz_outline_iterator_update_fn,
    pub del: fz_outline_iterator_delete_fn,
    pub doc: *mut fz_document,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_outline_iterator"][::core::mem::size_of::<fz_outline_iterator>() - 80usize];
    ["Alignment of fz_outline_iterator"][::core::mem::align_of::<fz_outline_iterator>() - 8usize];
    ["Offset of field: fz_outline_iterator::drop"]
        [::core::mem::offset_of!(fz_outline_iterator, drop) - 0usize];
    ["Offset of field: fz_outline_iterator::item"]
        [::core::mem::offset_of!(fz_outline_iterator, item) - 8usize];
    ["Offset of field: fz_outline_iterator::next"]
        [::core::mem::offset_of!(fz_outline_iterator, next) - 16usize];
    ["Offset of field: fz_outline_iterator::prev"]
        [::core::mem::offset_of!(fz_outline_iterator, prev) - 24usize];
    ["Offset of field: fz_outline_iterator::up"]
        [::core::mem::offset_of!(fz_outline_iterator, up) - 32usize];
    ["Offset of field: fz_outline_iterator::down"]
        [::core::mem::offset_of!(fz_outline_iterator, down) - 40usize];
    ["Offset of field: fz_outline_iterator::insert"]
        [::core::mem::offset_of!(fz_outline_iterator, insert) - 48usize];
    ["Offset of field: fz_outline_iterator::update"]
        [::core::mem::offset_of!(fz_outline_iterator, update) - 56usize];
    ["Offset of field: fz_outline_iterator::del"]
        [::core::mem::offset_of!(fz_outline_iterator, del) - 64usize];
    ["Offset of field: fz_outline_iterator::doc"]
        [::core::mem::offset_of!(fz_outline_iterator, doc) - 72usize];
};
pub type fz_bookmark = isize;
pub const FZ_MEDIA_BOX: fz_box_type = 0;
pub const FZ_CROP_BOX: fz_box_type = 1;
pub const FZ_BLEED_BOX: fz_box_type = 2;
pub const FZ_TRIM_BOX: fz_box_type = 3;
pub const FZ_ART_BOX: fz_box_type = 4;
pub const FZ_UNKNOWN_BOX: fz_box_type = 5;
pub type fz_box_type = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn fz_box_type_from_string(name: *const ::core::ffi::c_char) -> fz_box_type;
}
unsafe extern "C" {
    pub fn fz_string_from_box_type(box_: fz_box_type) -> *const ::core::ffi::c_char;
}
pub const FZ_LAYOUT_KINDLE_W: _bindgen_ty_31 = 260;
pub const FZ_LAYOUT_KINDLE_H: _bindgen_ty_31 = 346;
pub const FZ_LAYOUT_KINDLE_EM: _bindgen_ty_31 = 9;
pub const FZ_LAYOUT_US_POCKET_W: _bindgen_ty_31 = 306;
pub const FZ_LAYOUT_US_POCKET_H: _bindgen_ty_31 = 495;
pub const FZ_LAYOUT_US_POCKET_EM: _bindgen_ty_31 = 10;
pub const FZ_LAYOUT_US_TRADE_W: _bindgen_ty_31 = 396;
pub const FZ_LAYOUT_US_TRADE_H: _bindgen_ty_31 = 612;
pub const FZ_LAYOUT_US_TRADE_EM: _bindgen_ty_31 = 11;
pub const FZ_LAYOUT_UK_A_FORMAT_W: _bindgen_ty_31 = 312;
pub const FZ_LAYOUT_UK_A_FORMAT_H: _bindgen_ty_31 = 504;
pub const FZ_LAYOUT_UK_A_FORMAT_EM: _bindgen_ty_31 = 10;
pub const FZ_LAYOUT_UK_B_FORMAT_W: _bindgen_ty_31 = 366;
pub const FZ_LAYOUT_UK_B_FORMAT_H: _bindgen_ty_31 = 561;
pub const FZ_LAYOUT_UK_B_FORMAT_EM: _bindgen_ty_31 = 10;
pub const FZ_LAYOUT_UK_C_FORMAT_W: _bindgen_ty_31 = 382;
pub const FZ_LAYOUT_UK_C_FORMAT_H: _bindgen_ty_31 = 612;
pub const FZ_LAYOUT_UK_C_FORMAT_EM: _bindgen_ty_31 = 11;
pub const FZ_LAYOUT_A5_W: _bindgen_ty_31 = 420;
pub const FZ_LAYOUT_A5_H: _bindgen_ty_31 = 595;
pub const FZ_LAYOUT_A5_EM: _bindgen_ty_31 = 11;
pub const FZ_DEFAULT_LAYOUT_W: _bindgen_ty_31 = 420;
pub const FZ_DEFAULT_LAYOUT_H: _bindgen_ty_31 = 595;
pub const FZ_DEFAULT_LAYOUT_EM: _bindgen_ty_31 = 11;
pub type _bindgen_ty_31 = ::core::ffi::c_uint;
pub const FZ_PERMISSION_PRINT: fz_permission = 112;
pub const FZ_PERMISSION_COPY: fz_permission = 99;
pub const FZ_PERMISSION_EDIT: fz_permission = 101;
pub const FZ_PERMISSION_ANNOTATE: fz_permission = 110;
pub const FZ_PERMISSION_FORM: fz_permission = 102;
pub const FZ_PERMISSION_ACCESSIBILITY: fz_permission = 121;
pub const FZ_PERMISSION_ASSEMBLE: fz_permission = 97;
pub const FZ_PERMISSION_PRINT_HQ: fz_permission = 104;
pub type fz_permission = ::core::ffi::c_uint;
#[doc = "Type for a function to be called when<br>the reference count for the [`fz_document`] drops to 0. The<br>implementation should release any resources held by the<br>document. The actual document pointer will be freed by the<br>caller."]
pub type fz_document_drop_fn =
    ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document)>;
#[doc = "Type for a function to be<br>called to enquire whether the document needs a password<br>or not. See [`fz_needs_password`] for more information."]
pub type fz_document_needs_password_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to be<br>called to attempt to authenticate a password. See<br>[`fz_authenticate_password`] for more information."]
pub type fz_document_authenticate_password_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        password: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to be<br>called to see if a document grants a certain permission. See<br>[`fz_document_has_permission`] for more information."]
pub type fz_document_has_permission_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        permission: fz_permission,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to be called to<br>load the outlines for a document. See [`fz_document_load_outline`]<br>for more information."]
pub type fz_document_load_outline_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document) -> *mut fz_outline,
>;
#[doc = "Type for a function to be called to obtain an outline iterator<br>for a document. See [`fz_document_outline_iterator`] for more information."]
pub type fz_document_outline_iterator_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document) -> *mut fz_outline_iterator,
>;
#[doc = "Type for a function to be called to lay<br>out a document. See [`fz_layout_document`] for more information."]
pub type fz_document_layout_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document, w: f32, h: f32, em: f32),
>;
#[doc = "Type for a function to be called to<br>resolve an internal link to a location \\(chapter/page number<br>tuple\\). See [`fz_resolve_link_dest`] for more information."]
pub type fz_document_resolve_link_dest_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        uri: *const ::core::ffi::c_char,
    ) -> fz_link_dest,
>;
#[doc = "Type for a function to be called to<br>create an internal link to a destination \\(chapter/page/x/y/w/h/zoom/type<br>tuple\\). See [`fz_resolve_link_dest`] for more information."]
pub type fz_document_format_link_uri_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        dest: fz_link_dest,
    ) -> *mut ::core::ffi::c_char,
>;
#[doc = "Type for a function to be called to<br>count the number of chapters in a document. See<br>[`fz_count_chapter`](fz_count_chapter)s for more information."]
pub type fz_document_count_chapters_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to be called to<br>count the number of pages in a document. See [`fz_count_page`](fz_count_page)s for<br>more information."]
pub type fz_document_count_pages_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to load a given<br>page from a document. See [`fz_load_page`] for more information."]
pub type fz_document_load_page_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
    ) -> *mut fz_page,
>;
#[doc = "Type for a function to get the page label of a page in the document.<br>See [`fz_page_label`] for more information."]
pub type fz_document_page_label_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
        buf: *mut ::core::ffi::c_char,
        size: usize,
    ),
>;
#[doc = "Type for a function to query<br>a document's metadata. See [`fz_lookup_metadata`] for more<br>information."]
pub type fz_document_lookup_metadata_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        key: *const ::core::ffi::c_char,
        buf: *mut ::core::ffi::c_char,
        size: usize,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to set<br>a document's metadata. See [`fz_set_metadata`] for more<br>information."]
pub type fz_document_set_metadata_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        key: *const ::core::ffi::c_char,
        value: *const ::core::ffi::c_char,
    ),
>;
#[doc = "Return output intent color space if it exists"]
pub type fz_document_output_intent_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document) -> *mut fz_colorspace,
>;
#[doc = "Write document accelerator data"]
pub type fz_document_output_accelerator_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document, out: *mut fz_output),
>;
#[doc = "Send document structure to device"]
pub type fz_document_run_structure_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        dev: *mut fz_device,
        cookie: *mut fz_cookie,
    ),
>;
#[doc = "Get a handle to this document as PDF.\n\nReturns a borrowed handle."]
pub type fz_document_as_pdf_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, doc: *mut fz_document) -> *mut fz_document,
>;
#[doc = "Type for a function to make<br>a bookmark. See [`fz_make_bookmark`] for more information."]
pub type fz_document_make_bookmark_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        loc: fz_location,
    ) -> fz_bookmark,
>;
#[doc = "Type for a function to lookup a bookmark.<br>See [`fz_lookup_bookmark`] for more information."]
pub type fz_document_lookup_bookmark_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        mark: fz_bookmark,
    ) -> fz_location,
>;
#[doc = "Type for a function to release all the<br>resources held by a page. Called automatically when the<br>reference count for that page reaches zero."]
pub type fz_page_drop_page_fn =
    ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, page: *mut fz_page)>;
#[doc = "Type for a function to return the<br>bounding box of a page. See [`fz_bound_page`] for more<br>information."]
pub type fz_page_bound_page_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, page: *mut fz_page, box_: fz_box_type) -> fz_rect,
>;
#[doc = "Type for a function to run the<br>contents of a page. See [`fz_run_page_content`](fz_run_page_content)s for more<br>information."]
pub type fz_page_run_page_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        page: *mut fz_page,
        dev: *mut fz_device,
        transform: fz_matrix,
        cookie: *mut fz_cookie,
    ),
>;
#[doc = "Type for a function to load the links<br>from a page. See [`fz_load_link`](fz_load_link)s for more information."]
pub type fz_page_load_links_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, page: *mut fz_page) -> *mut fz_link,
>;
#[doc = "Type for a function to<br>obtain the details of how this page should be presented when<br>in presentation mode. See [`fz_page_presentation`] for more<br>information."]
pub type fz_page_page_presentation_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        page: *mut fz_page,
        transition: *mut fz_transition,
        duration: *mut f32,
    ) -> *mut fz_transition,
>;
#[doc = "Type for a function to enable/<br>disable separations on a page. See [`fz_control_separation`] for<br>more information."]
pub type fz_page_control_separation_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        page: *mut fz_page,
        separation: ::core::ffi::c_int,
        disable: ::core::ffi::c_int,
    ),
>;
#[doc = "Type for a function to detect<br>whether a given separation is enabled or disabled on a page.<br>See [`FZ_SEPARATION_DISABLED`] for more information."]
pub type fz_page_separation_disabled_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        page: *mut fz_page,
        separation: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to retrieve<br>details of separations on a page. See [`fz_get_separation`](fz_get_separation)s<br>for more information."]
pub type fz_page_separations_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, page: *mut fz_page) -> *mut fz_separations,
>;
#[doc = "Type for a function to retrieve<br>whether or not a given page uses overprint."]
pub type fz_page_uses_overprint_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, page: *mut fz_page) -> ::core::ffi::c_int,
>;
#[doc = "Type for a function to create a link on a page."]
pub type fz_page_create_link_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        page: *mut fz_page,
        bbox: fz_rect,
        uri: *const ::core::ffi::c_char,
    ) -> *mut fz_link,
>;
#[doc = "Type for a function to delete a link on a page."]
pub type fz_page_delete_link_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, page: *mut fz_page, link: *mut fz_link),
>;
#[doc = "Function type to open a<br>document from a file.\n\n`handler`: the document handler in use.\n\n`stream`: [`fz_stream`] to read document data from. Must be<br>seekable for formats that require it.\n\n`accel`: [`fz_stream`] to read accelerator data from. May be<br>`NULL`. May be ignored.\n\n`dir`: 'Directory context' in which the document is loaded;<br>associated content from \\(like images for an html stream<br>will be loaded from this\\). Maybe `NULL`. May be ignored.\n\n`recognize_state`: `NULL`, or a state pointer passed back from the call<br>to recognise_content_fn. Ownership does not pass in. The<br>caller remains responsible for freeing state.\n\nPointer to opened document. Throws exception in case of error."]
pub type fz_document_open_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        handler: *const fz_document_handler,
        stream: *mut fz_stream,
        accel: *mut fz_stream,
        dir: *mut fz_archive,
        recognize_state: *mut ::core::ffi::c_void,
    ) -> *mut fz_document,
>;
#[doc = "Recognize a document type from<br>a magic string.\n\n`handler`: the handler in use.\n\n`magic`: string to recognise - typically a filename or mime<br>type.\n\nReturns a number between 0 \\(not recognized\\) and 100<br>\\(fully recognized\\) based on how certain the recognizer<br>is that this is of the required type."]
pub type fz_document_recognize_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        handler: *const fz_document_handler,
        magic: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int,
>;
pub type fz_document_recognize_state_free_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, state: *mut ::core::ffi::c_void),
>;
#[doc = "Recognize a document type from stream contents.\n\n`handler`: the handler in use.\n\n`stream`: stream contents to recognise \\(may be `NULL` if document is<br>a directory\\).\n\n`dir`: directory context from which stream is loaded.\n\n`recognize_state`: pointer to retrieve opaque state that may be used<br>by the open routine, or `NULL`.\n\n`free_recognize_state`: pointer to retrieve a function pointer to<br>free the opaque state, or `NULL`.\n\n`Note`: state and free_state should either both be `NULL` or<br>both be non-`NULL`!\n\nReturns a number between 0 \\(not recognized\\) and 100<br>\\(fully recognized\\) based on how certain the recognizer<br>is that this is of the required type."]
pub type fz_document_recognize_content_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        handler: *const fz_document_handler,
        stream: *mut fz_stream,
        dir: *mut fz_archive,
        recognize_state: *mut *mut ::core::ffi::c_void,
        free_recognize_state: *mut fz_document_recognize_state_free_fn,
    ) -> ::core::ffi::c_int,
>;
#[doc = "Finalise a document handler.\n\nThis will be called on shutdown for a document handler to<br>release resources. This should cope with being called with `NULL`.\n\n`opaque`: The value previously returned by the init call."]
pub type fz_document_handler_fin_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, handler: *const fz_document_handler),
>;
#[doc = "Type for a function to be called when processing an already opened page.<br>See [`fz_process_opened_page`](fz_process_opened_page)s."]
pub type fz_process_opened_page_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        page: *mut fz_page,
        state: *mut ::core::ffi::c_void,
    ) -> *mut ::core::ffi::c_void,
>;
unsafe extern "C" {
    #[doc = "Register a handler for a document type.\n\n`handler`: The handler to register. This must live on for the duration of the<br>use of this handler. It will be passed back to the handler for calls so<br>the caller can use it to retrieve state."]
    pub fn fz_register_document_handler(ctx: *mut fz_context, handler: *const fz_document_handler);
}
unsafe extern "C" {
    #[doc = "Register handlers for all the standard document types supported in<br>this build."]
    pub fn fz_register_document_handlers(ctx: *mut fz_context);
}
unsafe extern "C" {
    #[doc = "Given a magic find a document handler that can handle a<br>document of this type.\n\n`magic`: Can be a filename extension \\(including initial period\\) or<br>a mimetype."]
    pub fn fz_recognize_document(
        ctx: *mut fz_context,
        magic: *const ::core::ffi::c_char,
    ) -> *const fz_document_handler;
}
unsafe extern "C" {
    #[doc = "Given a filename find a document handler that can handle a<br>document of this type.\n\n`filename`: The filename of the document. This will be opened and sampled<br>to check data."]
    pub fn fz_recognize_document_content(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *const fz_document_handler;
}
unsafe extern "C" {
    #[doc = "Given a magic find a document handler that can handle a<br>document of this type.\n\n`stream`: the file stream to sample. May be `NULL` if the document is<br>a directory.\n\n`magic`: Can be a filename extension \\(including initial period\\) or<br>a mimetype."]
    pub fn fz_recognize_document_stream_content(
        ctx: *mut fz_context,
        stream: *mut fz_stream,
        magic: *const ::core::ffi::c_char,
    ) -> *const fz_document_handler;
}
unsafe extern "C" {
    #[doc = "Given a magic find a document handler that can handle a<br>document of this type.\n\n`stream`: the file stream to sample. May be `NULL` if the document is<br>a directory.\n\n`dir`: an [`fz_archive`] representing the directory from which the<br>stream was opened \\(or `NULL`\\).\n\n`magic`: Can be a filename extension \\(including initial period\\) or<br>a mimetype."]
    pub fn fz_recognize_document_stream_and_dir_content(
        ctx: *mut fz_context,
        stream: *mut fz_stream,
        dir: *mut fz_archive,
        magic: *const ::core::ffi::c_char,
    ) -> *const fz_document_handler;
}
unsafe extern "C" {
    #[doc = "Open a document file and read its basic structure so pages and<br>objects can be located. MuPDF will try to repair broken<br>documents \\(without actually changing the file contents\\).\n\nThe returned [`fz_document`] is used when calling most other<br>document related functions.\n\n`filename`: a path to a file as it would be given to open\\(2\\)."]
    pub fn fz_open_document(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Open a document file and read its basic structure so pages and<br>objects can be located. MuPDF will try to repair broken<br>documents \\(without actually changing the file contents\\).\n\nThe returned [`fz_document`] is used when calling most other<br>document related functions.\n\n`filename`: a path to a file as it would be given to open\\(2\\)."]
    pub fn fz_open_accelerated_document(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
        accel: *const ::core::ffi::c_char,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Open a document using the specified stream object rather than<br>opening a file on disk.\n\n`magic`: a string used to detect document type; either a file name<br>or mime-type.\n\n`stream`: a stream representing the contents of the document file.\n\n`NOTE`: The caller retains ownership of 'stream' - the document will take its<br>own reference if required."]
    pub fn fz_open_document_with_stream(
        ctx: *mut fz_context,
        magic: *const ::core::ffi::c_char,
        stream: *mut fz_stream,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Open a document using the specified stream object rather than<br>opening a file on disk.\n\n`magic`: a string used to detect document type; either a file name<br>or mime-type.\n\n`stream`: a stream representing the contents of the document file.\n\n`dir`: a 'directory context' for those filetypes that need it.\n\n`NOTE`: The caller retains ownership of 'stream' and 'dir' - the document will<br>take its own references if required."]
    pub fn fz_open_document_with_stream_and_dir(
        ctx: *mut fz_context,
        magic: *const ::core::ffi::c_char,
        stream: *mut fz_stream,
        dir: *mut fz_archive,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Open a document using a buffer rather than opening a file on disk."]
    pub fn fz_open_document_with_buffer(
        ctx: *mut fz_context,
        magic: *const ::core::ffi::c_char,
        buffer: *mut fz_buffer,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Open a document using the specified stream object rather than<br>opening a file on disk.\n\n`magic`: a string used to detect document type; either a file name<br>or mime-type.\n\n`stream`: a stream of the document contents.\n\n`accel`: `NULL`, or a stream of the 'accelerator' contents for this document.\n\n`NOTE`: The caller retains ownership of 'stream' and 'accel' - the document will<br>take its own references if required."]
    pub fn fz_open_accelerated_document_with_stream(
        ctx: *mut fz_context,
        magic: *const ::core::ffi::c_char,
        stream: *mut fz_stream,
        accel: *mut fz_stream,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Open a document using the specified stream object rather than<br>opening a file on disk.\n\n`magic`: a string used to detect document type; either a file name<br>or mime-type.\n\n`stream`: a stream of the document contents.\n\n`accel`: `NULL`, or a stream of the 'accelerator' contents for this document.\n\n`dir`: `NULL`, or the 'directory context' for the stream contents.\n\n`NOTE`: The caller retains ownership of 'stream', 'accel' and 'dir' - the document will<br>take its own references if required."]
    pub fn fz_open_accelerated_document_with_stream_and_dir(
        ctx: *mut fz_context,
        magic: *const ::core::ffi::c_char,
        stream: *mut fz_stream,
        accel: *mut fz_stream,
        dir: *mut fz_archive,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Query if the document supports the saving of accelerator data."]
    pub fn fz_document_supports_accelerator(
        ctx: *mut fz_context,
        doc: *mut fz_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Save accelerator data for the document to a given file."]
    pub fn fz_save_accelerator(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        accel: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Output accelerator data for the document to a given output<br>stream."]
    pub fn fz_output_accelerator(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        accel: *mut fz_output,
    );
}
unsafe extern "C" {
    #[doc = "New documents are typically created by calls like<br>foo_new_document\\([`fz_context`] *ctx, ...\\). These work by<br>deriving a new document type from [`fz_document`], for instance:<br>typedef struct { [`fz_document`] base; ...extras... } foo_document;<br>These are allocated by calling<br>[`fz_new_derived_document`]\\(ctx, foo_document\\)"]
    pub fn fz_new_document_of_size(
        ctx: *mut fz_context,
        size: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    #[doc = "Increment the document reference count. The same pointer is<br>returned.\n\nNever throws exceptions."]
    pub fn fz_keep_document(ctx: *mut fz_context, doc: *mut fz_document) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Decrement the document reference count. When the reference<br>count reaches 0, the document and all it's references are<br>freed.\n\nNever throws exceptions."]
    pub fn fz_drop_document(ctx: *mut fz_context, doc: *mut fz_document);
}
unsafe extern "C" {
    #[doc = "Check if a document is encrypted with a<br>non-blank password."]
    pub fn fz_needs_password(ctx: *mut fz_context, doc: *mut fz_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Test if the given password can decrypt the document.\n\n`password`: The password string to be checked. Some document<br>specifications do not specify any particular text encoding, so<br>neither do we.\n\nReturns 0 for failure to authenticate, non-zero for success.\n\nFor PDF documents, further information can be given by examining<br>the bits in the return code.\n\nBit 0 =\\> No password required<br>Bit 1 =\\> User password authenticated<br>Bit 2 =\\> Owner password authenticated"]
    pub fn fz_authenticate_password(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        password: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Load the hierarchical document outline.\n\nShould be freed by [`fz_drop_outline`]."]
    pub fn fz_load_outline(ctx: *mut fz_context, doc: *mut fz_document) -> *mut fz_outline;
}
unsafe extern "C" {
    #[doc = "Get an iterator for the document outline.\n\nShould be freed by [`fz_drop_outline_iterator`]."]
    pub fn fz_new_outline_iterator(
        ctx: *mut fz_context,
        doc: *mut fz_document,
    ) -> *mut fz_outline_iterator;
}
unsafe extern "C" {
    #[doc = "Is the document reflowable.\n\nReturns 1 to indicate reflowable documents, otherwise 0."]
    pub fn fz_is_document_reflowable(
        ctx: *mut fz_context,
        doc: *mut fz_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Layout reflowable document types.\n\n`w`, `h`: Page size in points.<br>`em`: Default font size in points."]
    pub fn fz_layout_document(ctx: *mut fz_context, doc: *mut fz_document, w: f32, h: f32, em: f32);
}
unsafe extern "C" {
    #[doc = "Create a bookmark for the given page, which can be used to find<br>the same location after the document has been laid out with<br>different parameters."]
    pub fn fz_make_bookmark(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        loc: fz_location,
    ) -> fz_bookmark;
}
unsafe extern "C" {
    #[doc = "Find a bookmark and return its page number."]
    pub fn fz_lookup_bookmark(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        mark: fz_bookmark,
    ) -> fz_location;
}
unsafe extern "C" {
    #[doc = "Return the number of pages in document\n\nMay return 0 for documents with no pages."]
    pub fn fz_count_pages(ctx: *mut fz_context, doc: *mut fz_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Resolve an internal link to a page number, location, and possible viewing parameters.\n\nReturns location \\(-1,-1\\) if the URI cannot be resolved."]
    pub fn fz_resolve_link_dest(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        uri: *const ::core::ffi::c_char,
    ) -> fz_link_dest;
}
unsafe extern "C" {
    #[doc = "Format an internal link to a page number, location, and possible viewing parameters,<br>suitable for use with [`fz_create_link`].\n\nReturns a newly allocated string that the caller must free."]
    pub fn fz_format_link_uri(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        dest: fz_link_dest,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Resolve an internal link to a page number.\n\n`xp`, `yp`: Pointer to store coordinate of destination on the page.\n\nReturns \\(-1,-1\\) if the URI cannot be resolved."]
    pub fn fz_resolve_link(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        uri: *const ::core::ffi::c_char,
        xp: *mut f32,
        yp: *mut f32,
    ) -> fz_location;
}
unsafe extern "C" {
    #[doc = "Run the document structure through a device.\n\n`doc`: Document in question.\n\n`dev`: Device obtained from `fz_new_*_device`.\n\n`cookie`: Communication mechanism between caller and library.<br>Intended for multi-threaded applications, while<br>single-threaded applications set cookie to `NULL`. The<br>caller may abort an ongoing rendering of a page. Cookie also<br>communicates progress information back to the caller. The<br>fields inside cookie are continually updated while the page is<br>rendering."]
    pub fn fz_run_document_structure(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        dev: *mut fz_device,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    #[doc = "Function to get the location for the last page in the document.<br>Using this can be far more efficient in some cases than calling<br>[`fz_count_pages`] and using the page number."]
    pub fn fz_last_page(ctx: *mut fz_context, doc: *mut fz_document) -> fz_location;
}
unsafe extern "C" {
    #[doc = "Function to get the location of the next page \\(allowing for the<br>end of chapters etc\\). If at the end of the document, returns the<br>current location."]
    pub fn fz_next_page(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        loc: fz_location,
    ) -> fz_location;
}
unsafe extern "C" {
    #[doc = "Function to get the location of the previous page \\(allowing for<br>the end of chapters etc\\). If already at the start of the<br>document, returns the current page."]
    pub fn fz_previous_page(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        loc: fz_location,
    ) -> fz_location;
}
unsafe extern "C" {
    #[doc = "Clamps a location into valid chapter/page range. \\(First clamps<br>the chapter into range, then the page into range\\)."]
    pub fn fz_clamp_location(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        loc: fz_location,
    ) -> fz_location;
}
unsafe extern "C" {
    #[doc = "Converts from page number to chapter+page. This may cause many<br>chapters to be laid out in order to calculate the number of<br>pages within those chapters."]
    pub fn fz_location_from_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
    ) -> fz_location;
}
unsafe extern "C" {
    #[doc = "Converts from chapter+page to page number. This may cause many<br>chapters to be laid out in order to calculate the number of<br>pages within those chapters."]
    pub fn fz_page_number_from_location(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        loc: fz_location,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Load a given page number from a document. This may be much less<br>efficient than loading by location \\(chapter+page\\) for some<br>document types."]
    pub fn fz_load_page(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
    ) -> *mut fz_page;
}
unsafe extern "C" {
    #[doc = "Return the number of chapters in the document.<br>At least 1."]
    pub fn fz_count_chapters(ctx: *mut fz_context, doc: *mut fz_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Return the number of pages in a chapter.<br>May return 0."]
    pub fn fz_count_chapter_pages(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Load a page.\n\nAfter [`fz_load_page`] is it possible to retrieve the size of the<br>page using [`fz_bound_page`], or to render the page using<br>`fz_run_page_*`. Free the page by calling [`fz_drop_page`].\n\n`chapter`: chapter number, 0 is the first chapter of the document.<br>`number`: page number, 0 is the first page of the chapter."]
    pub fn fz_load_chapter_page(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
    ) -> *mut fz_page;
}
unsafe extern "C" {
    #[doc = "Load the list of links for a page.\n\nReturns a linked list of all the links on the page, each with<br>its clickable region and link destination. Each link is<br>reference counted so drop and free the list of links by<br>calling [`fz_drop_link`] on the pointer return from [`fz_load_links`].\n\n`page`: Page obtained from [`fz_load_page`]."]
    pub fn fz_load_links(ctx: *mut fz_context, page: *mut fz_page) -> *mut fz_link;
}
unsafe extern "C" {
    #[doc = "Different document types will be implemented by deriving from<br>[`fz_page`]. This macro allocates such derived structures, and<br>initialises the base sections."]
    pub fn fz_new_page_of_size(
        ctx: *mut fz_context,
        size: ::core::ffi::c_int,
        doc: *mut fz_document,
    ) -> *mut fz_page;
}
unsafe extern "C" {
    #[doc = "Determine the size of a page at 72 dpi."]
    pub fn fz_bound_page(ctx: *mut fz_context, page: *mut fz_page) -> fz_rect;
}
unsafe extern "C" {
    pub fn fz_bound_page_box(
        ctx: *mut fz_context,
        page: *mut fz_page,
        box_: fz_box_type,
    ) -> fz_rect;
}
unsafe extern "C" {
    #[doc = "Run a page through a device.\n\n`page`: Page obtained from [`fz_load_page`].\n\n`dev`: Device obtained from `fz_new_*_device`.\n\n`transform`: Transform to apply to page. May include for example<br>scaling and rotation, see [`fz_scale`], [`fz_rotate`] and [`fz_concat`].<br>Set to [`fz_identity`] if no transformation is desired.\n\n`cookie`: Communication mechanism between caller and library<br>rendering the page. Intended for multi-threaded applications,<br>while single-threaded applications set cookie to `NULL`. The<br>caller may abort an ongoing rendering of a page. Cookie also<br>communicates progress information back to the caller. The<br>fields inside cookie are continually updated while the page is<br>rendering."]
    pub fn fz_run_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        dev: *mut fz_device,
        transform: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    #[doc = "Run a page through a device. Just the main<br>page content, without the annotations, if any.\n\n`page`: Page obtained from [`fz_load_page`].\n\n`dev`: Device obtained from `fz_new_*_device`.\n\n`transform`: Transform to apply to page. May include for example<br>scaling and rotation, see [`fz_scale`], [`fz_rotate`] and [`fz_concat`].<br>Set to [`fz_identity`] if no transformation is desired.\n\n`cookie`: Communication mechanism between caller and library<br>rendering the page. Intended for multi-threaded applications,<br>while single-threaded applications set cookie to `NULL`. The<br>caller may abort an ongoing rendering of a page. Cookie also<br>communicates progress information back to the caller. The<br>fields inside cookie are continually updated while the page is<br>rendering."]
    pub fn fz_run_page_contents(
        ctx: *mut fz_context,
        page: *mut fz_page,
        dev: *mut fz_device,
        transform: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    #[doc = "Run the annotations on a page through a device."]
    pub fn fz_run_page_annots(
        ctx: *mut fz_context,
        page: *mut fz_page,
        dev: *mut fz_device,
        transform: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    #[doc = "Run the widgets on a page through a device."]
    pub fn fz_run_page_widgets(
        ctx: *mut fz_context,
        page: *mut fz_page,
        dev: *mut fz_device,
        transform: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    #[doc = "Increment the reference count for the page. Returns the same<br>pointer.\n\nNever throws exceptions."]
    pub fn fz_keep_page(ctx: *mut fz_context, page: *mut fz_page) -> *mut fz_page;
}
unsafe extern "C" {
    #[doc = "Decrements the reference count for the page. When the reference<br>count hits 0, the page and its references are freed.\n\nNever throws exceptions."]
    pub fn fz_drop_page(ctx: *mut fz_context, page: *mut fz_page);
}
unsafe extern "C" {
    #[doc = "Get the presentation details for a given page.\n\n`transition`: A pointer to a transition struct to fill out.\n\n`duration`: A pointer to a place to set the page duration in<br>seconds. Will be set to 0 if no transition is specified for the<br>page.\n\n`Returns`: a pointer to the transition structure, or `NULL` if there<br>is no transition specified for the page."]
    pub fn fz_page_presentation(
        ctx: *mut fz_context,
        page: *mut fz_page,
        transition: *mut fz_transition,
        duration: *mut f32,
    ) -> *mut fz_transition;
}
unsafe extern "C" {
    #[doc = "Get page label for a given page."]
    pub fn fz_page_label(
        ctx: *mut fz_context,
        page: *mut fz_page,
        buf: *mut ::core::ffi::c_char,
        size: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Check permission flags on document."]
    pub fn fz_has_permission(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        p: fz_permission,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Retrieve document meta data strings.\n\n`doc`: The document to query.\n\n`key`: Which meta data key to retrieve...\n\nBasic information:<br>'format'\t-- Document format and version.<br>'encryption'\t-- Description of the encryption used.\n\nFrom the document information dictionary:<br>'info:Title'<br>'info:Author'<br>'info:Subject'<br>'info:Keywords'<br>'info:Creator'<br>'info:Producer'<br>'info:CreationDate'<br>'info:ModDate'\n\n`buf`: The buffer to hold the results \\(a nul-terminated UTF-8<br>string\\).\n\n`size`: Size of 'buf'.\n\nReturns the number of bytes need to store the string plus terminator<br>\\(will be larger than 'size' if the output was truncated\\), or -1 if the<br>key is not recognized or found."]
    pub fn fz_lookup_metadata(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        key: *const ::core::ffi::c_char,
        buf: *mut ::core::ffi::c_char,
        size: usize,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_set_metadata(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        key: *const ::core::ffi::c_char,
        value: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Find the output intent colorspace if the document has defined<br>one.\n\nReturns a borrowed reference that should not be dropped, unless<br>it is kept first."]
    pub fn fz_document_output_intent(
        ctx: *mut fz_context,
        doc: *mut fz_document,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    #[doc = "Get the separations details for a page.<br>This will be `NULL`, unless the format specifically supports<br>separations \\(such as PDF files\\). May be `NULL` even<br>so, if there are no separations on a page.\n\nReturns a reference that must be dropped."]
    pub fn fz_page_separations(ctx: *mut fz_context, page: *mut fz_page) -> *mut fz_separations;
}
unsafe extern "C" {
    #[doc = "Query if a given page requires overprint."]
    pub fn fz_page_uses_overprint(ctx: *mut fz_context, page: *mut fz_page) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Create a new link on a page."]
    pub fn fz_create_link(
        ctx: *mut fz_context,
        page: *mut fz_page,
        bbox: fz_rect,
        uri: *const ::core::ffi::c_char,
    ) -> *mut fz_link;
}
unsafe extern "C" {
    #[doc = "Delete an existing link on a page."]
    pub fn fz_delete_link(ctx: *mut fz_context, page: *mut fz_page, link: *mut fz_link);
}
unsafe extern "C" {
    #[doc = "Iterates over all opened pages of the document, calling the<br>provided callback for each page for processing. If the callback<br>returns non-`NULL` then the iteration stops and that value is returned<br>to the called of [`fz_process_opened_pages`]\\(\\).\n\nThe state pointer provided to [`fz_process_opened_pages`]\\(\\) is<br>passed on to the callback but is owned by the caller.\n\nReturns the first non-`NULL` value returned by the callback,<br>or `NULL` if the callback returned `NULL` for all opened pages."]
    pub fn fz_process_opened_pages(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        process_openend_page: fz_process_opened_page_fn,
        state: *mut ::core::ffi::c_void,
    ) -> *mut ::core::ffi::c_void;
}
#[doc = "Structure definition is public so other classes can<br>derive from it. Do not access the members directly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_page {
    pub refs: ::core::ffi::c_int,
    pub doc: *mut fz_document,
    pub chapter: ::core::ffi::c_int,
    pub number: ::core::ffi::c_int,
    pub incomplete: ::core::ffi::c_int,
    pub in_doc: ::core::ffi::c_int,
    pub drop_page: fz_page_drop_page_fn,
    pub bound_page: fz_page_bound_page_fn,
    pub run_page_contents: fz_page_run_page_fn,
    pub run_page_annots: fz_page_run_page_fn,
    pub run_page_widgets: fz_page_run_page_fn,
    pub load_links: fz_page_load_links_fn,
    pub page_presentation: fz_page_page_presentation_fn,
    pub control_separation: fz_page_control_separation_fn,
    pub separation_disabled: fz_page_separation_disabled_fn,
    pub separations: fz_page_separations_fn,
    pub overprint: fz_page_uses_overprint_fn,
    pub create_link: fz_page_create_link_fn,
    pub delete_link: fz_page_delete_link_fn,
    pub prev: *mut *mut fz_page,
    pub next: *mut fz_page,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_page"][::core::mem::size_of::<fz_page>() - 152usize];
    ["Alignment of fz_page"][::core::mem::align_of::<fz_page>() - 8usize];
    ["Offset of field: fz_page::refs"][::core::mem::offset_of!(fz_page, refs) - 0usize];
    ["Offset of field: fz_page::doc"][::core::mem::offset_of!(fz_page, doc) - 8usize];
    ["Offset of field: fz_page::chapter"][::core::mem::offset_of!(fz_page, chapter) - 16usize];
    ["Offset of field: fz_page::number"][::core::mem::offset_of!(fz_page, number) - 20usize];
    ["Offset of field: fz_page::incomplete"]
        [::core::mem::offset_of!(fz_page, incomplete) - 24usize];
    ["Offset of field: fz_page::in_doc"][::core::mem::offset_of!(fz_page, in_doc) - 28usize];
    ["Offset of field: fz_page::drop_page"][::core::mem::offset_of!(fz_page, drop_page) - 32usize];
    ["Offset of field: fz_page::bound_page"]
        [::core::mem::offset_of!(fz_page, bound_page) - 40usize];
    ["Offset of field: fz_page::run_page_contents"]
        [::core::mem::offset_of!(fz_page, run_page_contents) - 48usize];
    ["Offset of field: fz_page::run_page_annots"]
        [::core::mem::offset_of!(fz_page, run_page_annots) - 56usize];
    ["Offset of field: fz_page::run_page_widgets"]
        [::core::mem::offset_of!(fz_page, run_page_widgets) - 64usize];
    ["Offset of field: fz_page::load_links"]
        [::core::mem::offset_of!(fz_page, load_links) - 72usize];
    ["Offset of field: fz_page::page_presentation"]
        [::core::mem::offset_of!(fz_page, page_presentation) - 80usize];
    ["Offset of field: fz_page::control_separation"]
        [::core::mem::offset_of!(fz_page, control_separation) - 88usize];
    ["Offset of field: fz_page::separation_disabled"]
        [::core::mem::offset_of!(fz_page, separation_disabled) - 96usize];
    ["Offset of field: fz_page::separations"]
        [::core::mem::offset_of!(fz_page, separations) - 104usize];
    ["Offset of field: fz_page::overprint"][::core::mem::offset_of!(fz_page, overprint) - 112usize];
    ["Offset of field: fz_page::create_link"]
        [::core::mem::offset_of!(fz_page, create_link) - 120usize];
    ["Offset of field: fz_page::delete_link"]
        [::core::mem::offset_of!(fz_page, delete_link) - 128usize];
    ["Offset of field: fz_page::prev"][::core::mem::offset_of!(fz_page, prev) - 136usize];
    ["Offset of field: fz_page::next"][::core::mem::offset_of!(fz_page, next) - 144usize];
};
#[doc = "Structure definition is public so other classes can<br>derive from it. Callers should not access the members<br>directly, though implementations will need initialize<br>functions directly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_document {
    pub refs: ::core::ffi::c_int,
    pub drop_document: fz_document_drop_fn,
    pub needs_password: fz_document_needs_password_fn,
    pub authenticate_password: fz_document_authenticate_password_fn,
    pub has_permission: fz_document_has_permission_fn,
    pub load_outline: fz_document_load_outline_fn,
    pub outline_iterator: fz_document_outline_iterator_fn,
    pub layout: fz_document_layout_fn,
    pub make_bookmark: fz_document_make_bookmark_fn,
    pub lookup_bookmark: fz_document_lookup_bookmark_fn,
    pub resolve_link_dest: fz_document_resolve_link_dest_fn,
    pub format_link_uri: fz_document_format_link_uri_fn,
    pub count_chapters: fz_document_count_chapters_fn,
    pub count_pages: fz_document_count_pages_fn,
    pub load_page: fz_document_load_page_fn,
    pub page_label: fz_document_page_label_fn,
    pub lookup_metadata: fz_document_lookup_metadata_fn,
    pub set_metadata: fz_document_set_metadata_fn,
    pub get_output_intent: fz_document_output_intent_fn,
    pub output_accelerator: fz_document_output_accelerator_fn,
    pub run_structure: fz_document_run_structure_fn,
    pub as_pdf: fz_document_as_pdf_fn,
    pub did_layout: ::core::ffi::c_int,
    pub is_reflowable: ::core::ffi::c_int,
    pub id: ::core::ffi::c_int,
    pub open: *mut fz_page,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_document"][::core::mem::size_of::<fz_document>() - 200usize];
    ["Alignment of fz_document"][::core::mem::align_of::<fz_document>() - 8usize];
    ["Offset of field: fz_document::refs"][::core::mem::offset_of!(fz_document, refs) - 0usize];
    ["Offset of field: fz_document::drop_document"]
        [::core::mem::offset_of!(fz_document, drop_document) - 8usize];
    ["Offset of field: fz_document::needs_password"]
        [::core::mem::offset_of!(fz_document, needs_password) - 16usize];
    ["Offset of field: fz_document::authenticate_password"]
        [::core::mem::offset_of!(fz_document, authenticate_password) - 24usize];
    ["Offset of field: fz_document::has_permission"]
        [::core::mem::offset_of!(fz_document, has_permission) - 32usize];
    ["Offset of field: fz_document::load_outline"]
        [::core::mem::offset_of!(fz_document, load_outline) - 40usize];
    ["Offset of field: fz_document::outline_iterator"]
        [::core::mem::offset_of!(fz_document, outline_iterator) - 48usize];
    ["Offset of field: fz_document::layout"]
        [::core::mem::offset_of!(fz_document, layout) - 56usize];
    ["Offset of field: fz_document::make_bookmark"]
        [::core::mem::offset_of!(fz_document, make_bookmark) - 64usize];
    ["Offset of field: fz_document::lookup_bookmark"]
        [::core::mem::offset_of!(fz_document, lookup_bookmark) - 72usize];
    ["Offset of field: fz_document::resolve_link_dest"]
        [::core::mem::offset_of!(fz_document, resolve_link_dest) - 80usize];
    ["Offset of field: fz_document::format_link_uri"]
        [::core::mem::offset_of!(fz_document, format_link_uri) - 88usize];
    ["Offset of field: fz_document::count_chapters"]
        [::core::mem::offset_of!(fz_document, count_chapters) - 96usize];
    ["Offset of field: fz_document::count_pages"]
        [::core::mem::offset_of!(fz_document, count_pages) - 104usize];
    ["Offset of field: fz_document::load_page"]
        [::core::mem::offset_of!(fz_document, load_page) - 112usize];
    ["Offset of field: fz_document::page_label"]
        [::core::mem::offset_of!(fz_document, page_label) - 120usize];
    ["Offset of field: fz_document::lookup_metadata"]
        [::core::mem::offset_of!(fz_document, lookup_metadata) - 128usize];
    ["Offset of field: fz_document::set_metadata"]
        [::core::mem::offset_of!(fz_document, set_metadata) - 136usize];
    ["Offset of field: fz_document::get_output_intent"]
        [::core::mem::offset_of!(fz_document, get_output_intent) - 144usize];
    ["Offset of field: fz_document::output_accelerator"]
        [::core::mem::offset_of!(fz_document, output_accelerator) - 152usize];
    ["Offset of field: fz_document::run_structure"]
        [::core::mem::offset_of!(fz_document, run_structure) - 160usize];
    ["Offset of field: fz_document::as_pdf"]
        [::core::mem::offset_of!(fz_document, as_pdf) - 168usize];
    ["Offset of field: fz_document::did_layout"]
        [::core::mem::offset_of!(fz_document, did_layout) - 176usize];
    ["Offset of field: fz_document::is_reflowable"]
        [::core::mem::offset_of!(fz_document, is_reflowable) - 180usize];
    ["Offset of field: fz_document::id"][::core::mem::offset_of!(fz_document, id) - 184usize];
    ["Offset of field: fz_document::open"][::core::mem::offset_of!(fz_document, open) - 192usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_document_handler {
    pub recognize: fz_document_recognize_fn,
    pub open: fz_document_open_fn,
    pub extensions: *mut *const ::core::ffi::c_char,
    pub mimetypes: *mut *const ::core::ffi::c_char,
    pub recognize_content: fz_document_recognize_content_fn,
    pub wants_dir: ::core::ffi::c_int,
    pub wants_file: ::core::ffi::c_int,
    pub fin: fz_document_handler_fin_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_document_handler"][::core::mem::size_of::<fz_document_handler>() - 56usize];
    ["Alignment of fz_document_handler"][::core::mem::align_of::<fz_document_handler>() - 8usize];
    ["Offset of field: fz_document_handler::recognize"]
        [::core::mem::offset_of!(fz_document_handler, recognize) - 0usize];
    ["Offset of field: fz_document_handler::open"]
        [::core::mem::offset_of!(fz_document_handler, open) - 8usize];
    ["Offset of field: fz_document_handler::extensions"]
        [::core::mem::offset_of!(fz_document_handler, extensions) - 16usize];
    ["Offset of field: fz_document_handler::mimetypes"]
        [::core::mem::offset_of!(fz_document_handler, mimetypes) - 24usize];
    ["Offset of field: fz_document_handler::recognize_content"]
        [::core::mem::offset_of!(fz_document_handler, recognize_content) - 32usize];
    ["Offset of field: fz_document_handler::wants_dir"]
        [::core::mem::offset_of!(fz_document_handler, wants_dir) - 40usize];
    ["Offset of field: fz_document_handler::wants_file"]
        [::core::mem::offset_of!(fz_document_handler, wants_file) - 44usize];
    ["Offset of field: fz_document_handler::fin"]
        [::core::mem::offset_of!(fz_document_handler, fin) - 48usize];
};
unsafe extern "C" {
    #[doc = "Create a display list.\n\nOwnership of the display list is returned to the caller."]
    pub fn fz_new_display_list_from_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    pub fn fz_new_display_list_from_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    #[doc = "Create a display list from page contents \\(no annotations\\).\n\nOwnership of the display list is returned to the caller."]
    pub fn fz_new_display_list_from_page_contents(
        ctx: *mut fz_context,
        page: *mut fz_page,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    #[doc = "Render the page to a pixmap using the transform and colorspace.\n\nOwnership of the pixmap is returned to the caller."]
    pub fn fz_new_pixmap_from_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_from_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_from_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Render the page contents without annotations.\n\nOwnership of the pixmap is returned to the caller."]
    pub fn fz_new_pixmap_from_page_contents(
        ctx: *mut fz_context,
        page: *mut fz_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Render the page contents with control over spot colors.\n\nOwnership of the pixmap is returned to the caller."]
    pub fn fz_new_pixmap_from_display_list_with_separations(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_from_page_with_separations(
        ctx: *mut fz_context,
        page: *mut fz_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_from_page_number_with_separations(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_from_page_contents_with_separations(
        ctx: *mut fz_context,
        page: *mut fz_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_fill_pixmap_from_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        ctm: fz_matrix,
        pix: *mut fz_pixmap,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Extract text from page.\n\nOwnership of the [`fz_stext_page`] is returned to the caller."]
    pub fn fz_new_stext_page_from_page_with_cookie(
        ctx: *mut fz_context,
        page: *mut fz_page,
        options: *const fz_stext_options,
        cookie: *mut fz_cookie,
    ) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn fz_new_stext_page_from_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        options: *const fz_stext_options,
    ) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn fz_new_stext_page_from_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        options: *const fz_stext_options,
    ) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn fz_new_stext_page_from_chapter_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        number: ::core::ffi::c_int,
        options: *const fz_stext_options,
    ) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn fz_new_stext_page_from_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        options: *const fz_stext_options,
    ) -> *mut fz_stext_page;
}
pub const FZ_TEXT_FLATTEN_ALL: fz_text_flatten = 0;
pub const FZ_TEXT_FLATTEN_KEEP_LINES: fz_text_flatten = 1;
pub const FZ_TEXT_FLATTEN_KEEP_PARAGRAPHS: fz_text_flatten = 2;
pub const FZ_TEXT_FLATTEN_KEEP_HYPHENS: fz_text_flatten = 4;
#[doc = "Convert structured text into plain text."]
pub type fz_text_flatten = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Create a new buffer by flattening the text from an stext<br>page."]
    pub fn fz_new_buffer_from_flattened_stext_page(
        ctx: *mut fz_context,
        text: *mut fz_stext_page,
        flatten: fz_text_flatten,
        map: *mut *mut fz_stext_position,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Does the same as [`fz_new_buffer_from_flattened_stext_page`]\\(\\), with<br>the options [`FZ_TEXT_FLATTEN_KEEP_PARAGRAPHS`]."]
    pub fn fz_new_buffer_from_stext_page(
        ctx: *mut fz_context,
        text: *mut fz_stext_page,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Convenience functions built on [`fz_new_buffer_from_stext_page`]."]
    pub fn fz_new_buffer_from_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        options: *const fz_stext_options,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        options: *const fz_stext_options,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        options: *const fz_stext_options,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Convenience functions built on [`fz_new_buffer_from_flattened_stext_page`]."]
    pub fn fz_new_buffer_from_flattened_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        options: *const fz_stext_options,
        flatten: fz_text_flatten,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_flattened_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        options: *const fz_stext_options,
        flatten: fz_text_flatten,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_flattened_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        options: *const fz_stext_options,
        flatten: fz_text_flatten,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Search for the 'needle' text on the page.<br>Record the hits in the hit_bbox array and return the number of<br>hits. Will stop looking once it has filled hit_max rectangles."]
    pub fn fz_search_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_search_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_search_chapter_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_search_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_chapter_page_number(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        needle: *const ::core::ffi::c_char,
        hit_mark: *mut ::core::ffi::c_int,
        hit_bbox: *mut fz_quad,
        hit_max: ::core::ffi::c_int,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Search for the 'needle' text on the page."]
    pub fn fz_search_page_cb(
        ctx: *mut fz_context,
        page: *mut fz_page,
        needle: *const ::core::ffi::c_char,
        cb: fz_search_callback_fn,
        opaque: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_search_page_number_cb(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        cb: fz_search_callback_fn,
        opaque: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_search_chapter_page_number_cb(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        cb: fz_search_callback_fn,
        opaque: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_search_display_list_cb(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        needle: *const ::core::ffi::c_char,
        cb: fz_search_callback_fn,
        opaque: *mut ::core::ffi::c_void,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_page_cb(
        ctx: *mut fz_context,
        page: *mut fz_page,
        needle: *const ::core::ffi::c_char,
        cb: fz_match_callback_fn,
        opaque: *mut ::core::ffi::c_void,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_page_number_cb(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        number: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        cb: fz_match_callback_fn,
        opaque: *mut ::core::ffi::c_void,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_chapter_page_number_cb(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
        needle: *const ::core::ffi::c_char,
        cb: fz_match_callback_fn,
        opaque: *mut ::core::ffi::c_void,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_match_display_list_cb(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        needle: *const ::core::ffi::c_char,
        cb: fz_match_callback_fn,
        opaque: *mut ::core::ffi::c_void,
        options: fz_search_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Parse an SVG document into a display-list."]
    pub fn fz_new_display_list_from_svg(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        base_uri: *const ::core::ffi::c_char,
        dir: *mut fz_archive,
        w: *mut f32,
        h: *mut f32,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    #[doc = "Create a scalable image from an SVG document."]
    pub fn fz_new_image_from_svg(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        base_uri: *const ::core::ffi::c_char,
        dir: *mut fz_archive,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Parse an SVG document into a display-list."]
    pub fn fz_new_display_list_from_svg_xml(
        ctx: *mut fz_context,
        xmldoc: *mut fz_xml_doc,
        xml: *mut fz_xml,
        base_uri: *const ::core::ffi::c_char,
        dir: *mut fz_archive,
        w: *mut f32,
        h: *mut f32,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    #[doc = "Create a scalable image from an SVG document."]
    pub fn fz_new_image_from_svg_xml(
        ctx: *mut fz_context,
        xmldoc: *mut fz_xml_doc,
        xml: *mut fz_xml,
        base_uri: *const ::core::ffi::c_char,
        dir: *mut fz_archive,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Write image as a data URI \\(for HTML and SVG output\\)."]
    pub fn fz_write_image_as_data_uri(
        ctx: *mut fz_context,
        out: *mut fz_output,
        image: *mut fz_image,
    );
}
unsafe extern "C" {
    pub fn fz_write_pixmap_as_data_uri(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    pub fn fz_append_image_as_data_uri(
        ctx: *mut fz_context,
        out: *mut fz_buffer,
        image: *mut fz_image,
    );
}
unsafe extern "C" {
    pub fn fz_append_pixmap_as_data_uri(
        ctx: *mut fz_context,
        out: *mut fz_buffer,
        pixmap: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Use text extraction to convert the input document into XHTML,<br>then open the result as a new document that can be reflowed."]
    pub fn fz_new_xhtml_document_from_document(
        ctx: *mut fz_context,
        old_doc: *mut fz_document,
        opts: *const fz_stext_options,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    #[doc = "Returns an [`fz_buffer`] containing a page after conversion to specified format.\n\n`page`: The page to convert.<br>`format`, `options`: Passed to [`fz_new_document_writer_with_output`]\\(\\) internally.<br>`transform`, `cookie`: Passed to [`fz_run_page`]\\(\\) internally."]
    pub fn fz_new_buffer_from_page_with_format(
        ctx: *mut fz_context,
        page: *mut fz_page,
        format: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
        transform: fz_matrix,
        cookie: *mut fz_cookie,
    ) -> *mut fz_buffer;
}
#[doc = "Function type to start<br>the process of writing a page to a document.\n\n`mediabox`: page size rectangle in points.\n\nReturns a [`fz_device`] to write page contents to."]
pub type fz_document_writer_begin_page_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        wri: *mut fz_document_writer,
        mediabox: fz_rect,
    ) -> *mut fz_device,
>;
#[doc = "Function type to end the<br>process of writing a page to a document.\n\n`dev`: The device created by the begin_page function."]
pub type fz_document_writer_end_page_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, wri: *mut fz_document_writer, dev: *mut fz_device),
>;
#[doc = "Function type to end<br>the process of writing pages to a document.\n\nThis writes any file level trailers required. After this<br>completes successfully the file is up to date and complete."]
pub type fz_document_writer_close_writer_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, wri: *mut fz_document_writer),
>;
#[doc = "Function type to discard<br>an [`fz_document_writer`]. This may be called at any time during<br>the process to release all the resources owned by the writer.\n\nCalling drop without having previously called close may leave<br>the file in an inconsistent state and the user of the<br>[`fz_document_writer`] would need to do any cleanup required."]
pub type fz_document_writer_drop_writer_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, wri: *mut fz_document_writer),
>;
unsafe extern "C" {
    #[doc = "Look for a given option \\(key\\) in the opts string. Return 1 if<br>it has it, and update *val to point to the value within opts."]
    pub fn fz_has_option(
        ctx: *mut fz_context,
        opts: *const ::core::ffi::c_char,
        key: *const ::core::ffi::c_char,
        val: *mut *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Check to see if an option, a, from a string matches a reference<br>option, b.\n\n\\(i.e. a could be 'foo' or 'foo,bar...' etc, but b can only be<br>'foo'.\\)"]
    pub fn fz_option_eq(
        a: *const ::core::ffi::c_char,
        b: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Copy an option \\(val\\) into a destination buffer \\(dest\\), of maxlen<br>bytes.\n\nReturns the number of bytes \\(including terminator\\) that did not<br>fit. If val is maxlen or greater bytes in size, it will be left<br>unterminated."]
    pub fn fz_copy_option(
        ctx: *mut fz_context,
        val: *const ::core::ffi::c_char,
        dest: *mut ::core::ffi::c_char,
        maxlen: usize,
    ) -> usize;
}
unsafe extern "C" {
    #[doc = "Create a new [`fz_document_writer`], for a<br>file of the given type.\n\n`path`: The document name to write \\(or `NULL` for default\\)\n\n`format`: Which format to write \\(currently cbz, html, pdf, pam,<br>pbm, pgm, pkm, png, ppm, pnm, svg, text, xhtml, docx, odt\\)\n\n`options`: `NULL`, or pointer to comma separated string to control<br>file generation."]
    pub fn fz_new_document_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        format: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    #[doc = "Like [`fz_new_document_writer`] but takes a [`fz_output`] for writing<br>the result. Only works for multi-page formats."]
    pub fn fz_new_document_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        format: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_document_writer_with_buffer(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        format: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    #[doc = "Document writers for various possible output formats.\n\nAll of the \"_with_output\" variants pass the ownership of out in<br>immediately upon calling. The writers are responsible for<br>dropping the [`fz_output`] when they are finished with it \\(even<br>if they throw an exception during creation\\)."]
    pub fn fz_new_pdf_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pdf_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_svg_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_svg_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_text_writer(
        ctx: *mut fz_context,
        format: *const ::core::ffi::c_char,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_text_writer_with_output(
        ctx: *mut fz_context,
        format: *const ::core::ffi::c_char,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_odt_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_odt_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_docx_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_docx_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_ps_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_ps_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pcl_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pcl_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pclm_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pclm_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pwg_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pwg_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_cbz_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_cbz_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_csv_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_csv_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
#[doc = "Used to report progress of the OCR operation.\n\n`page`: Current page being processed.\n\n`percent`: Progress of the OCR operation for the<br>current page in percent. Whether it reaches 100<br>once a page is finished, depends on the OCR engine.\n\nReturn 0 to continue progress, return 1 to cancel the<br>operation."]
pub type fz_pdfocr_progress_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        progress_arg: *mut ::core::ffi::c_void,
        page: ::core::ffi::c_int,
        percent: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int,
>;
unsafe extern "C" {
    pub fn fz_new_pdfocr_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pdfocr_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_pdfocr_writer_set_progress(
        ctx: *mut fz_context,
        writer: *mut fz_document_writer,
        progress: fz_pdfocr_progress_fn,
        arg1: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn fz_new_jpeg_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_png_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pam_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pnm_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pgm_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_ppm_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pbm_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pkm_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    #[doc = "Called to start the process of writing a page to<br>a document.\n\n`mediabox`: page size rectangle in points.\n\nReturns a borrowed [`fz_device`] to write page contents to. This<br>should be kept if required, and only dropped if it was kept."]
    pub fn fz_begin_page(
        ctx: *mut fz_context,
        wri: *mut fz_document_writer,
        mediabox: fz_rect,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Called to end the process of writing a page to a<br>document."]
    pub fn fz_end_page(ctx: *mut fz_context, wri: *mut fz_document_writer);
}
unsafe extern "C" {
    #[doc = "Convenience function to feed all the pages of a document to<br>[`fz_begin_page`]/[`fz_run_page`]/[`fz_end_page`]."]
    pub fn fz_write_document(
        ctx: *mut fz_context,
        wri: *mut fz_document_writer,
        doc: *mut fz_document,
    );
}
unsafe extern "C" {
    #[doc = "Called to end the process of writing<br>pages to a document.\n\nThis writes any file level trailers required. After this<br>completes successfully the file is up to date and complete."]
    pub fn fz_close_document_writer(ctx: *mut fz_context, wri: *mut fz_document_writer);
}
unsafe extern "C" {
    #[doc = "Called to discard a [`fz_document_writer`].<br>This may be called at any time during the process to release all<br>the resources owned by the writer.\n\nCalling drop without having previously called close may leave<br>the file in an inconsistent state."]
    pub fn fz_drop_document_writer(ctx: *mut fz_context, wri: *mut fz_document_writer);
}
unsafe extern "C" {
    pub fn fz_new_pixmap_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
        default_path: *const ::core::ffi::c_char,
        n: ::core::ffi::c_int,
        save: ::core::option::Option<
            unsafe extern "C" fn(
                ctx: *mut fz_context,
                pix: *mut fz_pixmap,
                filename: *const ::core::ffi::c_char,
            ),
        >,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn fz_new_pixmap_writer_with_output(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const ::core::ffi::c_char,
        n: ::core::ffi::c_int,
        write: ::core::option::Option<
            unsafe extern "C" fn(ctx: *mut fz_context, out: *mut fz_output, pix: *mut fz_pixmap),
        >,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub static mut fz_pdf_write_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub static mut fz_svg_write_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub static mut fz_pcl_write_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub static mut fz_pclm_write_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub static mut fz_pwg_write_options_usage: *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub static mut fz_pdfocr_write_options_usage: *const ::core::ffi::c_char;
}
#[doc = "Structure is public to allow other structures to<br>be derived from it. Do not access members directly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_document_writer {
    pub begin_page: fz_document_writer_begin_page_fn,
    pub end_page: fz_document_writer_end_page_fn,
    pub close_writer: fz_document_writer_close_writer_fn,
    pub drop_writer: fz_document_writer_drop_writer_fn,
    pub dev: *mut fz_device,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_document_writer"][::core::mem::size_of::<fz_document_writer>() - 40usize];
    ["Alignment of fz_document_writer"][::core::mem::align_of::<fz_document_writer>() - 8usize];
    ["Offset of field: fz_document_writer::begin_page"]
        [::core::mem::offset_of!(fz_document_writer, begin_page) - 0usize];
    ["Offset of field: fz_document_writer::end_page"]
        [::core::mem::offset_of!(fz_document_writer, end_page) - 8usize];
    ["Offset of field: fz_document_writer::close_writer"]
        [::core::mem::offset_of!(fz_document_writer, close_writer) - 16usize];
    ["Offset of field: fz_document_writer::drop_writer"]
        [::core::mem::offset_of!(fz_document_writer, drop_writer) - 24usize];
    ["Offset of field: fz_document_writer::dev"]
        [::core::mem::offset_of!(fz_document_writer, dev) - 32usize];
};
unsafe extern "C" {
    #[doc = "Internal function to allocate a<br>block for a derived document_writer structure, with the base<br>structure's function pointers populated correctly, and the extra<br>space zero initialised."]
    pub fn fz_new_document_writer_of_size(
        ctx: *mut fz_context,
        size: usize,
        begin_page: fz_document_writer_begin_page_fn,
        end_page: fz_document_writer_end_page_fn,
        close: fz_document_writer_close_writer_fn,
        drop: fz_document_writer_drop_writer_fn,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    #[doc = "Cause a band writer to write the header for<br>a banded image with the given properties/dimensions etc. This<br>also configures the bandwriter for the format of the data to be<br>passed in future calls.\n\n`w`, `h`: Width and Height of the entire page.\n\n`n`: Number of components \\(including spots and alphas\\).\n\n`alpha`: Number of alpha components.\n\n`xres`, `yres`: X and Y resolutions in dpi.\n\n`cs`: Colorspace \\(`NULL` for bitmaps\\)\n\n`seps`: Separation details \\(or `NULL`\\)."]
    pub fn fz_write_header(
        ctx: *mut fz_context,
        writer: *mut fz_band_writer,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        n: ::core::ffi::c_int,
        alpha: ::core::ffi::c_int,
        xres: ::core::ffi::c_int,
        yres: ::core::ffi::c_int,
        pagenum: ::core::ffi::c_int,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
    );
}
unsafe extern "C" {
    #[doc = "Cause a band writer to write the next band<br>of data for an image.\n\n`stride`: The byte offset from the first byte of the data<br>for a pixel to the first byte of the data for the same pixel<br>on the row below.\n\n`band_height`: The number of lines in this band.\n\n`samples`: Pointer to first byte of the data."]
    pub fn fz_write_band(
        ctx: *mut fz_context,
        writer: *mut fz_band_writer,
        stride: ::core::ffi::c_int,
        band_height: ::core::ffi::c_int,
        samples: *const ::core::ffi::c_uchar,
    );
}
unsafe extern "C" {
    #[doc = "Finishes up the output and closes the band writer. After this<br>call no more headers or bands may be written."]
    pub fn fz_close_band_writer(ctx: *mut fz_context, writer: *mut fz_band_writer);
}
unsafe extern "C" {
    #[doc = "Drop the reference to the band writer, causing it to be<br>destroyed.\n\nNever throws an exception."]
    pub fn fz_drop_band_writer(ctx: *mut fz_context, writer: *mut fz_band_writer);
}
pub type fz_write_header_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, writer: *mut fz_band_writer, cs: *mut fz_colorspace),
>;
pub type fz_write_band_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        writer: *mut fz_band_writer,
        stride: ::core::ffi::c_int,
        band_start: ::core::ffi::c_int,
        band_height: ::core::ffi::c_int,
        samples: *const ::core::ffi::c_uchar,
    ),
>;
pub type fz_write_trailer_fn =
    ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, writer: *mut fz_band_writer)>;
pub type fz_close_band_writer_fn =
    ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, writer: *mut fz_band_writer)>;
pub type fz_drop_band_writer_fn =
    ::core::option::Option<unsafe extern "C" fn(ctx: *mut fz_context, writer: *mut fz_band_writer)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_band_writer {
    pub drop: fz_drop_band_writer_fn,
    pub close: fz_close_band_writer_fn,
    pub header: fz_write_header_fn,
    pub band: fz_write_band_fn,
    pub trailer: fz_write_trailer_fn,
    pub out: *mut fz_output,
    pub w: ::core::ffi::c_int,
    pub h: ::core::ffi::c_int,
    pub n: ::core::ffi::c_int,
    pub s: ::core::ffi::c_int,
    pub alpha: ::core::ffi::c_int,
    pub xres: ::core::ffi::c_int,
    pub yres: ::core::ffi::c_int,
    pub pagenum: ::core::ffi::c_int,
    pub line: ::core::ffi::c_int,
    pub seps: *mut fz_separations,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_band_writer"][::core::mem::size_of::<fz_band_writer>() - 96usize];
    ["Alignment of fz_band_writer"][::core::mem::align_of::<fz_band_writer>() - 8usize];
    ["Offset of field: fz_band_writer::drop"]
        [::core::mem::offset_of!(fz_band_writer, drop) - 0usize];
    ["Offset of field: fz_band_writer::close"]
        [::core::mem::offset_of!(fz_band_writer, close) - 8usize];
    ["Offset of field: fz_band_writer::header"]
        [::core::mem::offset_of!(fz_band_writer, header) - 16usize];
    ["Offset of field: fz_band_writer::band"]
        [::core::mem::offset_of!(fz_band_writer, band) - 24usize];
    ["Offset of field: fz_band_writer::trailer"]
        [::core::mem::offset_of!(fz_band_writer, trailer) - 32usize];
    ["Offset of field: fz_band_writer::out"]
        [::core::mem::offset_of!(fz_band_writer, out) - 40usize];
    ["Offset of field: fz_band_writer::w"][::core::mem::offset_of!(fz_band_writer, w) - 48usize];
    ["Offset of field: fz_band_writer::h"][::core::mem::offset_of!(fz_band_writer, h) - 52usize];
    ["Offset of field: fz_band_writer::n"][::core::mem::offset_of!(fz_band_writer, n) - 56usize];
    ["Offset of field: fz_band_writer::s"][::core::mem::offset_of!(fz_band_writer, s) - 60usize];
    ["Offset of field: fz_band_writer::alpha"]
        [::core::mem::offset_of!(fz_band_writer, alpha) - 64usize];
    ["Offset of field: fz_band_writer::xres"]
        [::core::mem::offset_of!(fz_band_writer, xres) - 68usize];
    ["Offset of field: fz_band_writer::yres"]
        [::core::mem::offset_of!(fz_band_writer, yres) - 72usize];
    ["Offset of field: fz_band_writer::pagenum"]
        [::core::mem::offset_of!(fz_band_writer, pagenum) - 76usize];
    ["Offset of field: fz_band_writer::line"]
        [::core::mem::offset_of!(fz_band_writer, line) - 80usize];
    ["Offset of field: fz_band_writer::seps"]
        [::core::mem::offset_of!(fz_band_writer, seps) - 88usize];
};
unsafe extern "C" {
    pub fn fz_new_band_writer_of_size(
        ctx: *mut fz_context,
        size: usize,
        out: *mut fz_output,
    ) -> *mut fz_band_writer;
}
#[doc = "PCL output"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pcl_options {
    pub features: ::core::ffi::c_int,
    pub odd_page_init: *const ::core::ffi::c_char,
    pub even_page_init: *const ::core::ffi::c_char,
    pub tumble: ::core::ffi::c_int,
    pub duplex_set: ::core::ffi::c_int,
    pub duplex: ::core::ffi::c_int,
    pub paper_size: ::core::ffi::c_int,
    pub manual_feed_set: ::core::ffi::c_int,
    pub manual_feed: ::core::ffi::c_int,
    pub media_position_set: ::core::ffi::c_int,
    pub media_position: ::core::ffi::c_int,
    pub orientation: ::core::ffi::c_int,
    pub page_count: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_pcl_options"][::core::mem::size_of::<fz_pcl_options>() - 64usize];
    ["Alignment of fz_pcl_options"][::core::mem::align_of::<fz_pcl_options>() - 8usize];
    ["Offset of field: fz_pcl_options::features"]
        [::core::mem::offset_of!(fz_pcl_options, features) - 0usize];
    ["Offset of field: fz_pcl_options::odd_page_init"]
        [::core::mem::offset_of!(fz_pcl_options, odd_page_init) - 8usize];
    ["Offset of field: fz_pcl_options::even_page_init"]
        [::core::mem::offset_of!(fz_pcl_options, even_page_init) - 16usize];
    ["Offset of field: fz_pcl_options::tumble"]
        [::core::mem::offset_of!(fz_pcl_options, tumble) - 24usize];
    ["Offset of field: fz_pcl_options::duplex_set"]
        [::core::mem::offset_of!(fz_pcl_options, duplex_set) - 28usize];
    ["Offset of field: fz_pcl_options::duplex"]
        [::core::mem::offset_of!(fz_pcl_options, duplex) - 32usize];
    ["Offset of field: fz_pcl_options::paper_size"]
        [::core::mem::offset_of!(fz_pcl_options, paper_size) - 36usize];
    ["Offset of field: fz_pcl_options::manual_feed_set"]
        [::core::mem::offset_of!(fz_pcl_options, manual_feed_set) - 40usize];
    ["Offset of field: fz_pcl_options::manual_feed"]
        [::core::mem::offset_of!(fz_pcl_options, manual_feed) - 44usize];
    ["Offset of field: fz_pcl_options::media_position_set"]
        [::core::mem::offset_of!(fz_pcl_options, media_position_set) - 48usize];
    ["Offset of field: fz_pcl_options::media_position"]
        [::core::mem::offset_of!(fz_pcl_options, media_position) - 52usize];
    ["Offset of field: fz_pcl_options::orientation"]
        [::core::mem::offset_of!(fz_pcl_options, orientation) - 56usize];
    ["Offset of field: fz_pcl_options::page_count"]
        [::core::mem::offset_of!(fz_pcl_options, page_count) - 60usize];
};
unsafe extern "C" {
    #[doc = "Initialize PCL option struct for a given preset.\n\nCurrently defined presets include:\n\ngeneric\tGeneric PCL printer<br>ljet4\tHP DeskJet<br>dj500\tHP DeskJet 500<br>fs600\tKyocera FS-600<br>lj\tHP LaserJet, HP LaserJet Plus<br>lj2\tHP LaserJet IIp, HP LaserJet IId<br>lj3\tHP LaserJet III<br>lj3d\tHP LaserJet IIId<br>lj4\tHP LaserJet 4<br>lj4pl\tHP LaserJet 4 PL<br>lj4d\tHP LaserJet 4d<br>lp2563b\tHP 2563B line printer<br>oce9050\tOce 9050 Line printer"]
    pub fn fz_pcl_preset(
        ctx: *mut fz_context,
        opts: *mut fz_pcl_options,
        preset: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Parse PCL options.\n\nCurrently defined options and values are as follows:\n\npreset=X\tEither \"generic\" or one of the presets as for [`fz_pcl_preset`].<br>spacing=0\tNo vertical spacing capability<br>spacing=1\tPCL 3 spacing \\(\\<ESC\\>*p+\\<n\\>Y\\)<br>spacing=2\tPCL 4 spacing \\(\\<ESC\\>*b\\<n\\>Y\\)<br>spacing=3\tPCL 5 spacing \\(\\<ESC\\>*b\\<n\\>Y and clear seed row\\)<br>mode2\t\tDisable/Enable mode 2 graphics compression<br>mode3\t\tDisable/Enable mode 3 graphics compression<br>eog_reset\tEnd of graphics \\(\\<ESC\\>*rB\\) resets all parameters<br>has_duplex\tDuplex supported \\(\\<ESC\\>&l\\<duplex\\>S\\)<br>has_papersize\tPapersize setting supported \\(\\<ESC\\>&l\\<sizecode\\>A\\)<br>has_copies\tNumber of copies supported \\(\\<ESC\\>&l\\<copies\\>X\\)<br>is_ljet4pjl\tDisable/Enable HP 4PJL model-specific output<br>is_oce9050\tDisable/Enable Oce 9050 model-specific output"]
    pub fn fz_parse_pcl_options(
        ctx: *mut fz_context,
        opts: *mut fz_pcl_options,
        args: *const ::core::ffi::c_char,
    ) -> *mut fz_pcl_options;
}
unsafe extern "C" {
    #[doc = "Create a new band writer, outputting monochrome pcl."]
    pub fn fz_new_mono_pcl_band_writer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const fz_pcl_options,
    ) -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Write a bitmap as mono PCL."]
    pub fn fz_write_bitmap_as_pcl(
        ctx: *mut fz_context,
        out: *mut fz_output,
        bitmap: *const fz_bitmap,
        pcl: *const fz_pcl_options,
    );
}
unsafe extern "C" {
    #[doc = "Save a bitmap as mono PCL."]
    pub fn fz_save_bitmap_as_pcl(
        ctx: *mut fz_context,
        bitmap: *mut fz_bitmap,
        filename: *mut ::core::ffi::c_char,
        append: ::core::ffi::c_int,
        pcl: *const fz_pcl_options,
    );
}
unsafe extern "C" {
    #[doc = "Create a new band writer, outputting color pcl."]
    pub fn fz_new_color_pcl_band_writer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const fz_pcl_options,
    ) -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Write an \\(RGB\\) pixmap as color PCL."]
    pub fn fz_write_pixmap_as_pcl(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *const fz_pixmap,
        pcl: *const fz_pcl_options,
    );
}
unsafe extern "C" {
    #[doc = "Save an \\(RGB\\) pixmap as color PCL."]
    pub fn fz_save_pixmap_as_pcl(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *mut ::core::ffi::c_char,
        append: ::core::ffi::c_int,
        pcl: *const fz_pcl_options,
    );
}
#[doc = "PCLm output"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pclm_options {
    pub compress: ::core::ffi::c_int,
    pub strip_height: ::core::ffi::c_int,
    pub page_count: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_pclm_options"][::core::mem::size_of::<fz_pclm_options>() - 12usize];
    ["Alignment of fz_pclm_options"][::core::mem::align_of::<fz_pclm_options>() - 4usize];
    ["Offset of field: fz_pclm_options::compress"]
        [::core::mem::offset_of!(fz_pclm_options, compress) - 0usize];
    ["Offset of field: fz_pclm_options::strip_height"]
        [::core::mem::offset_of!(fz_pclm_options, strip_height) - 4usize];
    ["Offset of field: fz_pclm_options::page_count"]
        [::core::mem::offset_of!(fz_pclm_options, page_count) - 8usize];
};
unsafe extern "C" {
    #[doc = "Parse PCLm options.\n\nCurrently defined options and values are as follows:\n\n`compression=none`: No compression<br>`compression=flate`: Flate compression<br>`strip-height=n`: Strip height \\(default 16\\)"]
    pub fn fz_parse_pclm_options(
        ctx: *mut fz_context,
        opts: *mut fz_pclm_options,
        args: *const ::core::ffi::c_char,
    ) -> *mut fz_pclm_options;
}
unsafe extern "C" {
    #[doc = "Create a new band writer, outputting pclm"]
    pub fn fz_new_pclm_band_writer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const fz_pclm_options,
    ) -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Write a \\(Greyscale or RGB\\) pixmap as pclm."]
    pub fn fz_write_pixmap_as_pclm(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *const fz_pixmap,
        options: *const fz_pclm_options,
    );
}
unsafe extern "C" {
    #[doc = "Save a \\(Greyscale or RGB\\) pixmap as pclm."]
    pub fn fz_save_pixmap_as_pclm(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
        append: ::core::ffi::c_int,
        options: *const fz_pclm_options,
    );
}
#[doc = "PDFOCR output"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pdfocr_options {
    pub compress: ::core::ffi::c_int,
    pub strip_height: ::core::ffi::c_int,
    pub language: [::core::ffi::c_char; 256usize],
    pub datadir: [::core::ffi::c_char; 1024usize],
    pub skew_correct: ::core::ffi::c_int,
    pub skew_angle: f32,
    pub skew_border: ::core::ffi::c_int,
    pub page_count: ::core::ffi::c_int,
    pub options: *mut ::core::ffi::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_pdfocr_options"][::core::mem::size_of::<fz_pdfocr_options>() - 1312usize];
    ["Alignment of fz_pdfocr_options"][::core::mem::align_of::<fz_pdfocr_options>() - 8usize];
    ["Offset of field: fz_pdfocr_options::compress"]
        [::core::mem::offset_of!(fz_pdfocr_options, compress) - 0usize];
    ["Offset of field: fz_pdfocr_options::strip_height"]
        [::core::mem::offset_of!(fz_pdfocr_options, strip_height) - 4usize];
    ["Offset of field: fz_pdfocr_options::language"]
        [::core::mem::offset_of!(fz_pdfocr_options, language) - 8usize];
    ["Offset of field: fz_pdfocr_options::datadir"]
        [::core::mem::offset_of!(fz_pdfocr_options, datadir) - 264usize];
    ["Offset of field: fz_pdfocr_options::skew_correct"]
        [::core::mem::offset_of!(fz_pdfocr_options, skew_correct) - 1288usize];
    ["Offset of field: fz_pdfocr_options::skew_angle"]
        [::core::mem::offset_of!(fz_pdfocr_options, skew_angle) - 1292usize];
    ["Offset of field: fz_pdfocr_options::skew_border"]
        [::core::mem::offset_of!(fz_pdfocr_options, skew_border) - 1296usize];
    ["Offset of field: fz_pdfocr_options::page_count"]
        [::core::mem::offset_of!(fz_pdfocr_options, page_count) - 1300usize];
    ["Offset of field: fz_pdfocr_options::options"]
        [::core::mem::offset_of!(fz_pdfocr_options, options) - 1304usize];
};
unsafe extern "C" {
    #[doc = "Parse PDFOCR options.\n\nCurrently defined options and values are as follows:\n\n`compression=none`: No compression<br>`compression=flate`: Flate compression<br>`strip-height=n`: Strip height \\(default 16\\)<br>`ocr-language=\\<lang\\>`: OCR Language \\(default eng\\)<br>`ocr-datadir=\\<datadir\\>`: OCR data path \\(default rely on TESSDATA_PREFIX\\)"]
    pub fn fz_parse_pdfocr_options(
        ctx: *mut fz_context,
        opts: *mut fz_pdfocr_options,
        args: *const ::core::ffi::c_char,
    ) -> *mut fz_pdfocr_options;
}
unsafe extern "C" {
    #[doc = "Create a new band writer, outputting pdfocr.\n\nOwnership of output stays with the caller, the band writer<br>borrows the reference. The caller must keep the output around<br>for the duration of the band writer, and then close/drop as<br>appropriate."]
    pub fn fz_new_pdfocr_band_writer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        options: *const fz_pdfocr_options,
    ) -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Set the progress callback for a pdfocr bandwriter."]
    pub fn fz_pdfocr_band_writer_set_progress(
        ctx: *mut fz_context,
        writer: *mut fz_band_writer,
        progress_fn: fz_pdfocr_progress_fn,
        progress_arg: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    #[doc = "Write a \\(Greyscale or RGB\\) pixmap as pdfocr."]
    pub fn fz_write_pixmap_as_pdfocr(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *const fz_pixmap,
        options: *const fz_pdfocr_options,
    );
}
unsafe extern "C" {
    #[doc = "Save a \\(Greyscale or RGB\\) pixmap as pdfocr."]
    pub fn fz_save_pixmap_as_pdfocr(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *mut ::core::ffi::c_char,
        append: ::core::ffi::c_int,
        options: *const fz_pdfocr_options,
    );
}
unsafe extern "C" {
    #[doc = "Save a \\(Greyscale or RGB\\) pixmap as a png."]
    pub fn fz_save_pixmap_as_png(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Write a pixmap as a JPEG."]
    pub fn fz_write_pixmap_as_jpeg(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pix: *mut fz_pixmap,
        quality: ::core::ffi::c_int,
        invert_cmyk: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Save a pixmap as a JPEG."]
    pub fn fz_save_pixmap_as_jpeg(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
        quality: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Write a \\(Greyscale or RGB\\) pixmap as a png."]
    pub fn fz_write_pixmap_as_png(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Pixmap data as JP2K with no subsampling.\n\nquality = 100 = lossless<br>otherwise for a factor of x compression use 100-x. \\(so 80 is 1:20 compression\\)"]
    pub fn fz_write_pixmap_as_jpx(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pix: *mut fz_pixmap,
        quality: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Save pixmap data as JP2K with no subsampling.\n\nquality = 100 = lossless<br>otherwise for a factor of x compression use 100-x. \\(so 80 is 1:20 compression\\)"]
    pub fn fz_save_pixmap_as_jpx(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
        q: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Create a new png band writer \\(greyscale or RGB, with or without<br>alpha\\)."]
    pub fn fz_new_png_band_writer(ctx: *mut fz_context, out: *mut fz_output)
    -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Re-encode a given image as a PNG into a buffer.\n\nOwnership of the buffer is returned."]
    pub fn fz_new_buffer_from_image_as_png(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_image_as_pbm(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_image_as_pkm(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_image_as_pnm(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_image_as_pam(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_image_as_psd(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_image_as_jpeg(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
        quality: ::core::ffi::c_int,
        invert_cmyk: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_image_as_jpx(
        ctx: *mut fz_context,
        image: *mut fz_image,
        color_params: fz_color_params,
        quality: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Re-encode a given pixmap as a PNG into a buffer.\n\nOwnership of the buffer is returned."]
    pub fn fz_new_buffer_from_pixmap_as_png(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_pixmap_as_pbm(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_pixmap_as_pkm(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_pixmap_as_pnm(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_pixmap_as_pam(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_pixmap_as_psd(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        color_params: fz_color_params,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_pixmap_as_jpeg(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        color_params: fz_color_params,
        quality: ::core::ffi::c_int,
        invert_cmyk: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn fz_new_buffer_from_pixmap_as_jpx(
        ctx: *mut fz_context,
        pix: *mut fz_pixmap,
        color_params: fz_color_params,
        quality: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    #[doc = "Save a pixmap as a pnm \\(greyscale or rgb, no alpha\\)."]
    pub fn fz_save_pixmap_as_pnm(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Write a pixmap as a pnm \\(greyscale or rgb, no alpha\\)."]
    pub fn fz_write_pixmap_as_pnm(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Create a band writer targeting pnm \\(greyscale or rgb, no<br>alpha\\)."]
    pub fn fz_new_pnm_band_writer(ctx: *mut fz_context, out: *mut fz_output)
    -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Save a pixmap as a pnm \\(greyscale, rgb or cmyk, with or without<br>alpha\\)."]
    pub fn fz_save_pixmap_as_pam(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Write a pixmap as a pnm \\(greyscale, rgb or cmyk, with or without<br>alpha\\)."]
    pub fn fz_write_pixmap_as_pam(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Create a band writer targeting pnm \\(greyscale, rgb or cmyk,<br>with or without alpha\\)."]
    pub fn fz_new_pam_band_writer(ctx: *mut fz_context, out: *mut fz_output)
    -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Save a bitmap as a pbm."]
    pub fn fz_save_bitmap_as_pbm(
        ctx: *mut fz_context,
        bitmap: *mut fz_bitmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Write a bitmap as a pbm."]
    pub fn fz_write_bitmap_as_pbm(
        ctx: *mut fz_context,
        out: *mut fz_output,
        bitmap: *mut fz_bitmap,
    );
}
unsafe extern "C" {
    #[doc = "Create a new band writer, targeting pbm."]
    pub fn fz_new_pbm_band_writer(ctx: *mut fz_context, out: *mut fz_output)
    -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Save a pixmap as a pbm. \\(Performing halftoning\\)."]
    pub fn fz_save_pixmap_as_pbm(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn fz_write_pixmap_as_pkm(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Save a CMYK bitmap as a pkm."]
    pub fn fz_save_bitmap_as_pkm(
        ctx: *mut fz_context,
        bitmap: *mut fz_bitmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn fz_write_pixmap_as_pbm(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *mut fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Write a CMYK bitmap as a pkm."]
    pub fn fz_write_bitmap_as_pkm(
        ctx: *mut fz_context,
        out: *mut fz_output,
        bitmap: *mut fz_bitmap,
    );
}
unsafe extern "C" {
    #[doc = "Create a new pkm band writer for CMYK pixmaps."]
    pub fn fz_new_pkm_band_writer(ctx: *mut fz_context, out: *mut fz_output)
    -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Save a CMYK pixmap as a pkm. \\(Performing halftoning\\)."]
    pub fn fz_save_pixmap_as_pkm(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Write a \\(gray, rgb, or cmyk, no alpha\\) pixmap out as postscript."]
    pub fn fz_write_pixmap_as_ps(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *const fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Save a \\(gray, rgb, or cmyk, no alpha\\) pixmap out as postscript."]
    pub fn fz_save_pixmap_as_ps(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *mut ::core::ffi::c_char,
        append: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Create a postscript band writer for gray, rgb, or cmyk, no<br>alpha."]
    pub fn fz_new_ps_band_writer(ctx: *mut fz_context, out: *mut fz_output) -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Write the file level header for ps band writer output."]
    pub fn fz_write_ps_file_header(ctx: *mut fz_context, out: *mut fz_output);
}
unsafe extern "C" {
    #[doc = "Write the file level trailer for ps band writer output."]
    pub fn fz_write_ps_file_trailer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pages: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    #[doc = "Save a pixmap as a PSD file."]
    pub fn fz_save_pixmap_as_psd(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    #[doc = "Write a pixmap as a PSD file."]
    pub fn fz_write_pixmap_as_psd(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *const fz_pixmap,
    );
}
unsafe extern "C" {
    #[doc = "Open a PSD band writer."]
    pub fn fz_new_psd_band_writer(ctx: *mut fz_context, out: *mut fz_output)
    -> *mut fz_band_writer;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_pwg_options {
    pub media_class: [::core::ffi::c_char; 64usize],
    pub media_color: [::core::ffi::c_char; 64usize],
    pub media_type: [::core::ffi::c_char; 64usize],
    pub output_type: [::core::ffi::c_char; 64usize],
    pub advance_distance: ::core::ffi::c_uint,
    pub advance_media: ::core::ffi::c_int,
    pub collate: ::core::ffi::c_int,
    pub cut_media: ::core::ffi::c_int,
    pub duplex: ::core::ffi::c_int,
    pub insert_sheet: ::core::ffi::c_int,
    pub jog: ::core::ffi::c_int,
    pub leading_edge: ::core::ffi::c_int,
    pub manual_feed: ::core::ffi::c_int,
    pub media_position: ::core::ffi::c_uint,
    pub media_weight: ::core::ffi::c_uint,
    pub mirror_print: ::core::ffi::c_int,
    pub negative_print: ::core::ffi::c_int,
    pub num_copies: ::core::ffi::c_uint,
    pub orientation: ::core::ffi::c_int,
    pub output_face_up: ::core::ffi::c_int,
    pub PageSize: [::core::ffi::c_uint; 2usize],
    pub separations: ::core::ffi::c_int,
    pub tray_switch: ::core::ffi::c_int,
    pub tumble: ::core::ffi::c_int,
    pub media_type_num: ::core::ffi::c_int,
    pub compression: ::core::ffi::c_int,
    pub row_count: ::core::ffi::c_uint,
    pub row_feed: ::core::ffi::c_uint,
    pub row_step: ::core::ffi::c_uint,
    pub rendering_intent: [::core::ffi::c_char; 64usize],
    pub page_size_name: [::core::ffi::c_char; 64usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_pwg_options"][::core::mem::size_of::<fz_pwg_options>() - 488usize];
    ["Alignment of fz_pwg_options"][::core::mem::align_of::<fz_pwg_options>() - 4usize];
    ["Offset of field: fz_pwg_options::media_class"]
        [::core::mem::offset_of!(fz_pwg_options, media_class) - 0usize];
    ["Offset of field: fz_pwg_options::media_color"]
        [::core::mem::offset_of!(fz_pwg_options, media_color) - 64usize];
    ["Offset of field: fz_pwg_options::media_type"]
        [::core::mem::offset_of!(fz_pwg_options, media_type) - 128usize];
    ["Offset of field: fz_pwg_options::output_type"]
        [::core::mem::offset_of!(fz_pwg_options, output_type) - 192usize];
    ["Offset of field: fz_pwg_options::advance_distance"]
        [::core::mem::offset_of!(fz_pwg_options, advance_distance) - 256usize];
    ["Offset of field: fz_pwg_options::advance_media"]
        [::core::mem::offset_of!(fz_pwg_options, advance_media) - 260usize];
    ["Offset of field: fz_pwg_options::collate"]
        [::core::mem::offset_of!(fz_pwg_options, collate) - 264usize];
    ["Offset of field: fz_pwg_options::cut_media"]
        [::core::mem::offset_of!(fz_pwg_options, cut_media) - 268usize];
    ["Offset of field: fz_pwg_options::duplex"]
        [::core::mem::offset_of!(fz_pwg_options, duplex) - 272usize];
    ["Offset of field: fz_pwg_options::insert_sheet"]
        [::core::mem::offset_of!(fz_pwg_options, insert_sheet) - 276usize];
    ["Offset of field: fz_pwg_options::jog"]
        [::core::mem::offset_of!(fz_pwg_options, jog) - 280usize];
    ["Offset of field: fz_pwg_options::leading_edge"]
        [::core::mem::offset_of!(fz_pwg_options, leading_edge) - 284usize];
    ["Offset of field: fz_pwg_options::manual_feed"]
        [::core::mem::offset_of!(fz_pwg_options, manual_feed) - 288usize];
    ["Offset of field: fz_pwg_options::media_position"]
        [::core::mem::offset_of!(fz_pwg_options, media_position) - 292usize];
    ["Offset of field: fz_pwg_options::media_weight"]
        [::core::mem::offset_of!(fz_pwg_options, media_weight) - 296usize];
    ["Offset of field: fz_pwg_options::mirror_print"]
        [::core::mem::offset_of!(fz_pwg_options, mirror_print) - 300usize];
    ["Offset of field: fz_pwg_options::negative_print"]
        [::core::mem::offset_of!(fz_pwg_options, negative_print) - 304usize];
    ["Offset of field: fz_pwg_options::num_copies"]
        [::core::mem::offset_of!(fz_pwg_options, num_copies) - 308usize];
    ["Offset of field: fz_pwg_options::orientation"]
        [::core::mem::offset_of!(fz_pwg_options, orientation) - 312usize];
    ["Offset of field: fz_pwg_options::output_face_up"]
        [::core::mem::offset_of!(fz_pwg_options, output_face_up) - 316usize];
    ["Offset of field: fz_pwg_options::PageSize"]
        [::core::mem::offset_of!(fz_pwg_options, PageSize) - 320usize];
    ["Offset of field: fz_pwg_options::separations"]
        [::core::mem::offset_of!(fz_pwg_options, separations) - 328usize];
    ["Offset of field: fz_pwg_options::tray_switch"]
        [::core::mem::offset_of!(fz_pwg_options, tray_switch) - 332usize];
    ["Offset of field: fz_pwg_options::tumble"]
        [::core::mem::offset_of!(fz_pwg_options, tumble) - 336usize];
    ["Offset of field: fz_pwg_options::media_type_num"]
        [::core::mem::offset_of!(fz_pwg_options, media_type_num) - 340usize];
    ["Offset of field: fz_pwg_options::compression"]
        [::core::mem::offset_of!(fz_pwg_options, compression) - 344usize];
    ["Offset of field: fz_pwg_options::row_count"]
        [::core::mem::offset_of!(fz_pwg_options, row_count) - 348usize];
    ["Offset of field: fz_pwg_options::row_feed"]
        [::core::mem::offset_of!(fz_pwg_options, row_feed) - 352usize];
    ["Offset of field: fz_pwg_options::row_step"]
        [::core::mem::offset_of!(fz_pwg_options, row_step) - 356usize];
    ["Offset of field: fz_pwg_options::rendering_intent"]
        [::core::mem::offset_of!(fz_pwg_options, rendering_intent) - 360usize];
    ["Offset of field: fz_pwg_options::page_size_name"]
        [::core::mem::offset_of!(fz_pwg_options, page_size_name) - 424usize];
};
unsafe extern "C" {
    #[doc = "Save a pixmap as a PWG."]
    pub fn fz_save_pixmap_as_pwg(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *mut ::core::ffi::c_char,
        append: ::core::ffi::c_int,
        pwg: *const fz_pwg_options,
    );
}
unsafe extern "C" {
    #[doc = "Save a bitmap as a PWG."]
    pub fn fz_save_bitmap_as_pwg(
        ctx: *mut fz_context,
        bitmap: *mut fz_bitmap,
        filename: *mut ::core::ffi::c_char,
        append: ::core::ffi::c_int,
        pwg: *const fz_pwg_options,
    );
}
unsafe extern "C" {
    #[doc = "Write a pixmap as a PWG."]
    pub fn fz_write_pixmap_as_pwg(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *const fz_pixmap,
        pwg: *const fz_pwg_options,
    );
}
unsafe extern "C" {
    #[doc = "Write a bitmap as a PWG."]
    pub fn fz_write_bitmap_as_pwg(
        ctx: *mut fz_context,
        out: *mut fz_output,
        bitmap: *const fz_bitmap,
        pwg: *const fz_pwg_options,
    );
}
unsafe extern "C" {
    #[doc = "Write a pixmap as a PWG page.\n\nCaller should provide a file header by calling<br>[`fz_write_pwg_file_header`], but can then write several pages to<br>the same file."]
    pub fn fz_write_pixmap_as_pwg_page(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pixmap: *const fz_pixmap,
        pwg: *const fz_pwg_options,
    );
}
unsafe extern "C" {
    #[doc = "Write a bitmap as a PWG page.\n\nCaller should provide a file header by calling<br>[`fz_write_pwg_file_header`], but can then write several pages to<br>the same file."]
    pub fn fz_write_bitmap_as_pwg_page(
        ctx: *mut fz_context,
        out: *mut fz_output,
        bitmap: *const fz_bitmap,
        pwg: *const fz_pwg_options,
    );
}
unsafe extern "C" {
    #[doc = "Create a new monochrome pwg band writer."]
    pub fn fz_new_mono_pwg_band_writer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pwg: *const fz_pwg_options,
    ) -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Create a new color pwg band writer."]
    pub fn fz_new_pwg_band_writer(
        ctx: *mut fz_context,
        out: *mut fz_output,
        pwg: *const fz_pwg_options,
    ) -> *mut fz_band_writer;
}
unsafe extern "C" {
    #[doc = "Output the file header to a pwg stream, ready for pages to follow it."]
    pub fn fz_write_pwg_file_header(ctx: *mut fz_context, out: *mut fz_output);
}
pub const FZ_SVG_TEXT_AS_PATH: _bindgen_ty_32 = 0;
pub const FZ_SVG_TEXT_AS_TEXT: _bindgen_ty_32 = 1;
pub type _bindgen_ty_32 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_svg_device_options {
    pub text_format: ::core::ffi::c_int,
    pub reuse_images: ::core::ffi::c_int,
    pub resolution: ::core::ffi::c_int,
    pub id: *mut ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_svg_device_options"][::core::mem::size_of::<fz_svg_device_options>() - 24usize];
    ["Alignment of fz_svg_device_options"]
        [::core::mem::align_of::<fz_svg_device_options>() - 8usize];
    ["Offset of field: fz_svg_device_options::text_format"]
        [::core::mem::offset_of!(fz_svg_device_options, text_format) - 0usize];
    ["Offset of field: fz_svg_device_options::reuse_images"]
        [::core::mem::offset_of!(fz_svg_device_options, reuse_images) - 4usize];
    ["Offset of field: fz_svg_device_options::resolution"]
        [::core::mem::offset_of!(fz_svg_device_options, resolution) - 8usize];
    ["Offset of field: fz_svg_device_options::id"]
        [::core::mem::offset_of!(fz_svg_device_options, id) - 16usize];
};
unsafe extern "C" {
    pub fn fz_parse_svg_device_options(
        ctx: *mut fz_context,
        opts: *mut fz_svg_device_options,
        args: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn fz_new_svg_device_with_options(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page_width: f32,
        page_height: f32,
        opts: *mut fz_svg_device_options,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device that outputs \\(single page\\) SVG files to<br>the given output stream.\n\nEquivalent to [`fz_new_svg_device_with_id`] passing id = `NULL`."]
    pub fn fz_new_svg_device(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page_width: f32,
        page_height: f32,
        text_format: ::core::ffi::c_int,
        reuse_images: ::core::ffi::c_int,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    #[doc = "Create a device that outputs \\(single page\\) SVG files to<br>the given output stream.\n\n`output`: The output stream to send the constructed SVG page to.\n\n`page_width`, `page_height`: The page dimensions to use \\(in points\\).\n\n`text_format`: How to emit text. One of the following values:<br>[`FZ_SVG_TEXT_AS_TEXT`]: As \\<text\\> elements with possible<br>layout errors and mismatching fonts.<br>[`FZ_SVG_TEXT_AS_PATH`]: As \\<path\\> elements with exact<br>visual appearance.\n\n`reuse_images`: Share image resources using \\<symbol\\> definitions.\n\n`resolution`: Resolution to use when rasterizing shadings \\(and such\\) to images.\n\n`id`: ID parameter to keep generated IDs unique across SVG files."]
    pub fn fz_new_svg_device_with_id(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page_width: f32,
        page_height: f32,
        text_format: ::core::ffi::c_int,
        reuse_images: ::core::ffi::c_int,
        id: *mut ::core::ffi::c_int,
    ) -> *mut fz_device;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_story {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn fz_new_story(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        user_css: *const ::core::ffi::c_char,
        em: f32,
        dir: *mut fz_archive,
    ) -> *mut fz_story;
}
unsafe extern "C" {
    pub fn fz_story_warnings(
        ctx: *mut fz_context,
        story: *mut fz_story,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn fz_place_story(
        ctx: *mut fz_context,
        story: *mut fz_story,
        where_: fz_rect,
        filled: *mut fz_rect,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn fz_place_story_flags(
        ctx: *mut fz_context,
        story: *mut fz_story,
        where_: fz_rect,
        filled: *mut fz_rect,
        flags: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
pub const FZ_PLACE_STORY_FLAG_NO_OVERFLOW: _bindgen_ty_33 = 1;
pub const FZ_PLACE_STORY_RETURN_ALL_FITTED: _bindgen_ty_33 = 0;
pub const FZ_PLACE_STORY_RETURN_OVERFLOW_WIDTH: _bindgen_ty_33 = 2;
pub type _bindgen_ty_33 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn fz_draw_story(
        ctx: *mut fz_context,
        story: *mut fz_story,
        dev: *mut fz_device,
        ctm: fz_matrix,
    );
}
unsafe extern "C" {
    pub fn fz_reset_story(ctx: *mut fz_context, story: *mut fz_story);
}
unsafe extern "C" {
    pub fn fz_drop_story(ctx: *mut fz_context, story: *mut fz_story);
}
unsafe extern "C" {
    pub fn fz_story_document(ctx: *mut fz_context, story: *mut fz_story) -> *mut fz_xml;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_story_element_position {
    pub depth: ::core::ffi::c_int,
    pub heading: ::core::ffi::c_int,
    pub id: *const ::core::ffi::c_char,
    pub href: *const ::core::ffi::c_char,
    pub rect: fz_rect,
    pub text: *const ::core::ffi::c_char,
    pub open_close: ::core::ffi::c_int,
    pub rectangle_num: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_story_element_position"]
        [::core::mem::size_of::<fz_story_element_position>() - 56usize];
    ["Alignment of fz_story_element_position"]
        [::core::mem::align_of::<fz_story_element_position>() - 8usize];
    ["Offset of field: fz_story_element_position::depth"]
        [::core::mem::offset_of!(fz_story_element_position, depth) - 0usize];
    ["Offset of field: fz_story_element_position::heading"]
        [::core::mem::offset_of!(fz_story_element_position, heading) - 4usize];
    ["Offset of field: fz_story_element_position::id"]
        [::core::mem::offset_of!(fz_story_element_position, id) - 8usize];
    ["Offset of field: fz_story_element_position::href"]
        [::core::mem::offset_of!(fz_story_element_position, href) - 16usize];
    ["Offset of field: fz_story_element_position::rect"]
        [::core::mem::offset_of!(fz_story_element_position, rect) - 24usize];
    ["Offset of field: fz_story_element_position::text"]
        [::core::mem::offset_of!(fz_story_element_position, text) - 40usize];
    ["Offset of field: fz_story_element_position::open_close"]
        [::core::mem::offset_of!(fz_story_element_position, open_close) - 48usize];
    ["Offset of field: fz_story_element_position::rectangle_num"]
        [::core::mem::offset_of!(fz_story_element_position, rectangle_num) - 52usize];
};
pub type fz_story_position_callback = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        arg: *mut ::core::ffi::c_void,
        arg1: *const fz_story_element_position,
    ),
>;
unsafe extern "C" {
    pub fn fz_story_positions(
        ctx: *mut fz_context,
        story: *mut fz_story,
        cb: fz_story_position_callback,
        arg: *mut ::core::ffi::c_void,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_write_story_position {
    pub element: fz_story_element_position,
    pub page_num: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_write_story_position"]
        [::core::mem::size_of::<fz_write_story_position>() - 64usize];
    ["Alignment of fz_write_story_position"]
        [::core::mem::align_of::<fz_write_story_position>() - 8usize];
    ["Offset of field: fz_write_story_position::element"]
        [::core::mem::offset_of!(fz_write_story_position, element) - 0usize];
    ["Offset of field: fz_write_story_position::page_num"]
        [::core::mem::offset_of!(fz_write_story_position, page_num) - 56usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_write_story_positions {
    pub positions: *mut fz_write_story_position,
    pub num: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of fz_write_story_positions"]
        [::core::mem::size_of::<fz_write_story_positions>() - 16usize];
    ["Alignment of fz_write_story_positions"]
        [::core::mem::align_of::<fz_write_story_positions>() - 8usize];
    ["Offset of field: fz_write_story_positions::positions"]
        [::core::mem::offset_of!(fz_write_story_positions, positions) - 0usize];
    ["Offset of field: fz_write_story_positions::num"]
        [::core::mem::offset_of!(fz_write_story_positions, num) - 8usize];
};
pub type fz_write_story_rectfn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        ref_: *mut ::core::ffi::c_void,
        num: ::core::ffi::c_int,
        filled: fz_rect,
        rect: *mut fz_rect,
        ctm: *mut fz_matrix,
        mediabox: *mut fz_rect,
    ) -> ::core::ffi::c_int,
>;
pub type fz_write_story_positionfn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        ref_: *mut ::core::ffi::c_void,
        position: *const fz_write_story_position,
    ),
>;
pub type fz_write_story_pagefn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        ref_: *mut ::core::ffi::c_void,
        page_num: ::core::ffi::c_int,
        mediabox: fz_rect,
        dev: *mut fz_device,
        after: ::core::ffi::c_int,
    ),
>;
pub type fz_write_story_contentfn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        ref_: *mut ::core::ffi::c_void,
        positions: *const fz_write_story_positions,
        buffer: *mut fz_buffer,
    ),
>;
unsafe extern "C" {
    pub fn fz_write_story(
        ctx: *mut fz_context,
        writer: *mut fz_document_writer,
        story: *mut fz_story,
        rectfn: fz_write_story_rectfn,
        rectfn_ref: *mut ::core::ffi::c_void,
        positionfn: fz_write_story_positionfn,
        positionfn_ref: *mut ::core::ffi::c_void,
        pagefn: fz_write_story_pagefn,
        pagefn_ref: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn fz_write_stabilized_story(
        ctx: *mut fz_context,
        writer: *mut fz_document_writer,
        user_css: *const ::core::ffi::c_char,
        em: f32,
        contentfn: fz_write_story_contentfn,
        contentfn_ref: *mut ::core::ffi::c_void,
        rectfn: fz_write_story_rectfn,
        rectfn_ref: *mut ::core::ffi::c_void,
        pagefn: fz_write_story_pagefn,
        pagefn_ref: *mut ::core::ffi::c_void,
        dir: *mut fz_archive,
    );
}
pub const FZ_DESKEW_BORDER_INCREASE: _bindgen_ty_34 = 0;
pub const FZ_DESKEW_BORDER_MAINTAIN: _bindgen_ty_34 = 1;
pub const FZ_DESKEW_BORDER_DECREASE: _bindgen_ty_34 = 2;
pub type _bindgen_ty_34 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn fz_deskew_pixmap(
        ctx: *mut fz_context,
        src: *mut fz_pixmap,
        degrees: f64,
        border: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn fz_detect_skew(ctx: *mut fz_context, pixmap: *mut fz_pixmap) -> f64;
}
pub const FZ_BARCODE_NONE: fz_barcode_type = 0;
pub const FZ_BARCODE_AZTEC: fz_barcode_type = 1;
pub const FZ_BARCODE_CODABAR: fz_barcode_type = 2;
pub const FZ_BARCODE_CODE39: fz_barcode_type = 3;
pub const FZ_BARCODE_CODE93: fz_barcode_type = 4;
pub const FZ_BARCODE_CODE128: fz_barcode_type = 5;
pub const FZ_BARCODE_DATABAR: fz_barcode_type = 6;
pub const FZ_BARCODE_DATABAREXPANDED: fz_barcode_type = 7;
pub const FZ_BARCODE_DATAMATRIX: fz_barcode_type = 8;
pub const FZ_BARCODE_EAN8: fz_barcode_type = 9;
pub const FZ_BARCODE_EAN13: fz_barcode_type = 10;
pub const FZ_BARCODE_ITF: fz_barcode_type = 11;
pub const FZ_BARCODE_MAXICODE: fz_barcode_type = 12;
pub const FZ_BARCODE_PDF417: fz_barcode_type = 13;
pub const FZ_BARCODE_QRCODE: fz_barcode_type = 14;
pub const FZ_BARCODE_UPCA: fz_barcode_type = 15;
pub const FZ_BARCODE_UPCE: fz_barcode_type = 16;
pub const FZ_BARCODE_MICROQRCODE: fz_barcode_type = 17;
pub const FZ_BARCODE_RMQRCODE: fz_barcode_type = 18;
pub const FZ_BARCODE_DXFILMEDGE: fz_barcode_type = 19;
pub const FZ_BARCODE_DATABARLIMITED: fz_barcode_type = 20;
pub const FZ_BARCODE__LIMIT: fz_barcode_type = 21;
pub type fz_barcode_type = ::core::ffi::c_uint;
unsafe extern "C" {
    #[doc = "Return barcode string matching one of the above barcode types.<br>All lowercase, e.g. \"none\", \"aztec\" etc."]
    pub fn fz_string_from_barcode_type(type_: fz_barcode_type) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Helper function to search the above list \\(case insensitively\\)<br>for an exact match. Returns [`FZ_BARCODE_NONE`] if no match found."]
    pub fn fz_barcode_type_from_string(str_: *const ::core::ffi::c_char) -> fz_barcode_type;
}
unsafe extern "C" {
    #[doc = "Create an [`fz_image`] from a barcode definition.\n\n`type`: The type of barcode to create.<br>`value`: The value of the barcode.<br>`size`: The size of the barcode.<br>`ec_level`: error correction level 0-8.<br>`quiet`: whether to include quiet zones \\(0 or 1\\).<br>`hrt`: whether to include human readable text below the barcode \\(0 or 1\\).\n\nreturns a created [`fz_image`]."]
    pub fn fz_new_barcode_image(
        ctx: *mut fz_context,
        type_: fz_barcode_type,
        value: *const ::core::ffi::c_char,
        size: ::core::ffi::c_int,
        ec_level: ::core::ffi::c_int,
        quiet: ::core::ffi::c_int,
        hrt: ::core::ffi::c_int,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    #[doc = "Create an [`fz_pixmap`] from a barcode definition.\n\n`type`: The type of barcode to create.<br>`value`: The value of the barcode.<br>`size`: The size of the barcode.<br>`ec_level`: error correction level 0-8.<br>`quiet`: whether to include quiet zones \\(0 or 1\\).<br>`hrt`: whether to include human readable text below the barcode \\(0 or 1\\).\n\nreturns a created [`fz_pixmap`]."]
    pub fn fz_new_barcode_pixmap(
        ctx: *mut fz_context,
        type_: fz_barcode_type,
        value: *const ::core::ffi::c_char,
        size: ::core::ffi::c_int,
        ec_level: ::core::ffi::c_int,
        quiet: ::core::ffi::c_int,
        hrt: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    #[doc = "Decode a barcode from a page.\n\n`type`: `NULL`, or a pointer to receive the barcode type decoded.<br>`page`: The page to decode.<br>`subarea`: subarea of the page to decode.<br>`rotate`: 0, 90, 180, or 270.\n\nreturns the decoded value."]
    pub fn fz_decode_barcode_from_page(
        ctx: *mut fz_context,
        type_: *mut fz_barcode_type,
        page: *mut fz_page,
        subarea: fz_rect,
        rotate: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Decode a barcode from a pixmap.\n\n`type`: `NULL`, or a pointer to receive the barcode type decoded.<br>`pix`: The pixmap to decode.<br>`rotate`: 0, 90, 180, or 270.\n\nreturns the decoded value as an [`fz_malloc`](fz_malloc)ed block. Should<br>be [`fz_free`]'d by the caller."]
    pub fn fz_decode_barcode_from_pixmap(
        ctx: *mut fz_context,
        type_: *mut fz_barcode_type,
        pix: *mut fz_pixmap,
        rotate: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Decode a barcode from a display list.\n\n`type`: `NULL`, or a pointer to receive the barcode type decoded.<br>`list`: The display list to render to get the barcode.<br>`subarea`: subarea of the page to decode.<br>`rotate`: 0, 90, 180, or 270.\n\nreturns the decoded value."]
    pub fn fz_decode_barcode_from_display_list(
        ctx: *mut fz_context,
        type_: *mut fz_barcode_type,
        list: *mut fz_display_list,
        subarea: fz_rect,
        rotate: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Return version of the Unicode database.\n\n@return Unicode database version"]
    pub fn ucdn_get_unicode_version() -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    #[doc = "Get combining class of a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return combining class value, as defined in UAX#44"]
    pub fn ucdn_get_combining_class(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get east-asian width of a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return value according to UCDN_EAST_ASIAN_* and as defined in UAX#11."]
    pub fn ucdn_get_east_asian_width(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get general category of a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return value according to UCDN_GENERAL_CATEGORY_* and as defined in<br>UAX#44."]
    pub fn ucdn_get_general_category(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get bidirectional class of a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return value according to UCDN_BIDI_CLASS_* and as defined in UAX#44."]
    pub fn ucdn_get_bidi_class(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get script of a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return value according to UCDN_SCRIPT_* and as defined in UAX#24."]
    pub fn ucdn_get_script(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get unresolved linebreak class of a codepoint. This does not take<br>rule LB1 of UAX#14 into account. See ucdn_get_resolved_linebreak_class\\(\\)<br>for resolved linebreak classes.\n# Arguments\n*  code Unicode codepoint<br>@return value according to UCDN_LINEBREAK_* and as defined in UAX#14."]
    pub fn ucdn_get_linebreak_class(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Get resolved linebreak class of a codepoint. This resolves characters<br>in the AI, SG, XX, SA and CJ classes according to rule LB1 of UAX#14.<br>In addition the CB class is resolved as the equivalent B2 class and<br>the NL class is resolved as the equivalent BK class.\n# Arguments\n*  code Unicode codepoint<br>@return value according to UCDN_LINEBREAK_* and as defined in UAX#14."]
    pub fn ucdn_get_resolved_linebreak_class(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Check if codepoint can be mirrored.\n# Arguments\n*  code Unicode codepoint<br>@return 1 if mirrored character exists, otherwise 0"]
    pub fn ucdn_get_mirrored(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Mirror a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return mirrored codepoint or the original codepoint if no<br>mirrored character exists"]
    pub fn ucdn_mirror(code: u32) -> u32;
}
unsafe extern "C" {
    #[doc = "Get paired bracket for a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return paired bracket codepoint or the original codepoint if no<br>paired bracket character exists"]
    pub fn ucdn_paired_bracket(code: u32) -> u32;
}
unsafe extern "C" {
    #[doc = "Get paired bracket type for a codepoint.\n# Arguments\n*  code Unicode codepoint<br>@return value according to UCDN_BIDI_PAIRED_BRACKET_TYPE_* and as defined<br>in UAX#9."]
    pub fn ucdn_paired_bracket_type(code: u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Pairwise canonical decomposition of a codepoint. This includes<br>Hangul Jamo decomposition \\(see chapter 3.12 of the Unicode core<br>specification\\).\n\nHangul is decomposed into L and V jamos for LV forms, and an<br>LV precomposed syllable and a T jamo for LVT forms.\n# Arguments\n*  code Unicode codepoint\n*  a filled with first codepoint of decomposition\n*  b filled with second codepoint of decomposition, or 0<br>@return success"]
    pub fn ucdn_decompose(code: u32, a: *mut u32, b: *mut u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Compatibility decomposition of a codepoint.\n# Arguments\n*  code Unicode codepoint\n*  decomposed filled with decomposition, must be able to hold 18<br>characters<br>@return length of decomposition or 0 in case none exists"]
    pub fn ucdn_compat_decompose(code: u32, decomposed: *mut u32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Pairwise canonical composition of two codepoints. This includes<br>Hangul Jamo composition \\(see chapter 3.12 of the Unicode core<br>specification\\).\n\nHangul composition expects either L and V jamos, or an LV<br>precomposed syllable and a T jamo. This is exactly the inverse<br>of pairwise Hangul decomposition.\n# Arguments\n*  code filled with composition\n*  a first codepoint\n*  b second codepoint<br>@return success"]
    pub fn ucdn_compose(code: *mut u32, a: u32, b: u32) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_crypt {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_journal {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_obj {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn pdf_new_int(ctx: *mut fz_context, i: i64) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_real(ctx: *mut fz_context, f: f32) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_name(ctx: *mut fz_context, str_: *const ::core::ffi::c_char) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_string(
        ctx: *mut fz_context,
        str_: *const ::core::ffi::c_char,
        len: usize,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_text_string(ctx: *mut fz_context, s: *const ::core::ffi::c_char)
    -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_indirect(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_array(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        initialcap: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_dict(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        initialcap: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_point(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        point: fz_point,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_rect(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        rect: fz_rect,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_matrix(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        mtx: fz_matrix,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_date(ctx: *mut fz_context, doc: *mut pdf_document, time: i64) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_copy_array(ctx: *mut fz_context, array: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_copy_dict(ctx: *mut fz_context, dict: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_deep_copy_obj(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_keep_obj(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_drop_obj(ctx: *mut fz_context, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_drop_singleton_obj(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_is_null(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_bool(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_int(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_real(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_number(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_name(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_string(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_array(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_dict(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_indirect(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_obj_num_is_stream(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_stream(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_objcmp(ctx: *mut fz_context, a: *mut pdf_obj, b: *mut pdf_obj)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_objcmp_resolve(
        ctx: *mut fz_context,
        a: *mut pdf_obj,
        b: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_objcmp_deep(
        ctx: *mut fz_context,
        a: *mut pdf_obj,
        b: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_name_eq(
        ctx: *mut fz_context,
        a: *mut pdf_obj,
        b: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_obj_marked(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_mark_obj(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_unmark_obj(ctx: *mut fz_context, obj: *mut pdf_obj);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_cycle_list {
    pub up: *mut pdf_cycle_list,
    pub num: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_cycle_list"][::core::mem::size_of::<pdf_cycle_list>() - 16usize];
    ["Alignment of pdf_cycle_list"][::core::mem::align_of::<pdf_cycle_list>() - 8usize];
    ["Offset of field: pdf_cycle_list::up"][::core::mem::offset_of!(pdf_cycle_list, up) - 0usize];
    ["Offset of field: pdf_cycle_list::num"][::core::mem::offset_of!(pdf_cycle_list, num) - 8usize];
};
unsafe extern "C" {
    pub fn pdf_cycle(
        ctx: *mut fz_context,
        here: *mut pdf_cycle_list,
        prev: *mut pdf_cycle_list,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug)]
pub struct pdf_mark_bits {
    pub len: ::core::ffi::c_int,
    pub bits: __IncompleteArrayField<::core::ffi::c_uchar>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_mark_bits"][::core::mem::size_of::<pdf_mark_bits>() - 4usize];
    ["Alignment of pdf_mark_bits"][::core::mem::align_of::<pdf_mark_bits>() - 4usize];
    ["Offset of field: pdf_mark_bits::len"][::core::mem::offset_of!(pdf_mark_bits, len) - 0usize];
    ["Offset of field: pdf_mark_bits::bits"][::core::mem::offset_of!(pdf_mark_bits, bits) - 4usize];
};
unsafe extern "C" {
    pub fn pdf_new_mark_bits(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut pdf_mark_bits;
}
unsafe extern "C" {
    pub fn pdf_drop_mark_bits(ctx: *mut fz_context, marks: *mut pdf_mark_bits);
}
unsafe extern "C" {
    pub fn pdf_mark_bits_reset(ctx: *mut fz_context, marks: *mut pdf_mark_bits);
}
unsafe extern "C" {
    pub fn pdf_mark_bits_set(
        ctx: *mut fz_context,
        marks: *mut pdf_mark_bits,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_mark_list {
    pub len: ::core::ffi::c_int,
    pub max: ::core::ffi::c_int,
    pub list: *mut ::core::ffi::c_int,
    pub local_list: [::core::ffi::c_int; 8usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_mark_list"][::core::mem::size_of::<pdf_mark_list>() - 48usize];
    ["Alignment of pdf_mark_list"][::core::mem::align_of::<pdf_mark_list>() - 8usize];
    ["Offset of field: pdf_mark_list::len"][::core::mem::offset_of!(pdf_mark_list, len) - 0usize];
    ["Offset of field: pdf_mark_list::max"][::core::mem::offset_of!(pdf_mark_list, max) - 4usize];
    ["Offset of field: pdf_mark_list::list"][::core::mem::offset_of!(pdf_mark_list, list) - 8usize];
    ["Offset of field: pdf_mark_list::local_list"]
        [::core::mem::offset_of!(pdf_mark_list, local_list) - 16usize];
};
unsafe extern "C" {
    pub fn pdf_mark_list_push(
        ctx: *mut fz_context,
        list: *mut pdf_mark_list,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_mark_list_pop(ctx: *mut fz_context, list: *mut pdf_mark_list);
}
unsafe extern "C" {
    pub fn pdf_mark_list_check(
        ctx: *mut fz_context,
        list: *mut pdf_mark_list,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_mark_list_init(ctx: *mut fz_context, list: *mut pdf_mark_list);
}
unsafe extern "C" {
    pub fn pdf_mark_list_free(ctx: *mut fz_context, list: *mut pdf_mark_list);
}
unsafe extern "C" {
    pub fn pdf_set_obj_memo(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        bit: ::core::ffi::c_int,
        memo: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_obj_memo(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        bit: ::core::ffi::c_int,
        memo: *mut ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_obj_is_dirty(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dirty_obj(ctx: *mut fz_context, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_clean_obj(ctx: *mut fz_context, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_to_bool(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_to_int(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_to_int64(ctx: *mut fz_context, obj: *mut pdf_obj) -> i64;
}
unsafe extern "C" {
    pub fn pdf_to_real(ctx: *mut fz_context, obj: *mut pdf_obj) -> f32;
}
unsafe extern "C" {
    pub fn pdf_to_name(ctx: *mut fz_context, obj: *mut pdf_obj) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_to_text_string(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_to_string(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        sizep: *mut usize,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_to_str_buf(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_to_str_len(ctx: *mut fz_context, obj: *mut pdf_obj) -> usize;
}
unsafe extern "C" {
    pub fn pdf_to_num(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_to_gen(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_to_bool_default(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        def: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_to_int_default(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        def: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_to_real_default(ctx: *mut fz_context, obj: *mut pdf_obj, def: f32) -> f32;
}
unsafe extern "C" {
    pub fn pdf_array_len(ctx: *mut fz_context, array: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_array_get(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_array_put(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        obj: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_array_put_drop(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        obj: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_array_push(ctx: *mut fz_context, array: *mut pdf_obj, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_array_push_drop(ctx: *mut fz_context, array: *mut pdf_obj, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_array_insert(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        obj: *mut pdf_obj,
        index: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_array_insert_drop(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        obj: *mut pdf_obj,
        index: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_array_delete(ctx: *mut fz_context, array: *mut pdf_obj, index: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_array_find(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_array_contains(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_len(ctx: *mut fz_context, dict: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_get_key(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        idx: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_get_val(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        idx: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_put_val_null(ctx: *mut fz_context, obj: *mut pdf_obj, idx: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_dict_get(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_getp(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        path: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_getl(ctx: *mut fz_context, dict: *mut pdf_obj, ...) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_geta(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        abbrev: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_gets(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_getsa(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *const ::core::ffi::c_char,
        abbrev: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_getp_inheritable(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        path: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_gets_inheritable(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_put(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        val: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_drop(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        val: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_get_put_drop(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        val: *mut pdf_obj,
        old_val: *mut *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_puts(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *const ::core::ffi::c_char,
        val: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_puts_drop(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *const ::core::ffi::c_char,
        val: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_putp(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        path: *const ::core::ffi::c_char,
        val: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_putp_drop(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        path: *const ::core::ffi::c_char,
        val: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_putl(ctx: *mut fz_context, dict: *mut pdf_obj, val: *mut pdf_obj, ...);
}
unsafe extern "C" {
    pub fn pdf_dict_putl_drop(ctx: *mut fz_context, dict: *mut pdf_obj, val: *mut pdf_obj, ...);
}
unsafe extern "C" {
    pub fn pdf_dict_del(ctx: *mut fz_context, dict: *mut pdf_obj, key: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_dict_dels(ctx: *mut fz_context, dict: *mut pdf_obj, key: *const ::core::ffi::c_char);
}
unsafe extern "C" {
    pub fn pdf_sort_dict(ctx: *mut fz_context, dict: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_dict_put_bool(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        x: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_int(ctx: *mut fz_context, dict: *mut pdf_obj, key: *mut pdf_obj, x: i64);
}
unsafe extern "C" {
    pub fn pdf_dict_put_real(ctx: *mut fz_context, dict: *mut pdf_obj, key: *mut pdf_obj, x: f64);
}
unsafe extern "C" {
    pub fn pdf_dict_put_name(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        x: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_string(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        x: *const ::core::ffi::c_char,
        n: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_text_string(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        x: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_indirect(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        num: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_point(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        x: fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_rect(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        x: fz_rect,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_matrix(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        x: fz_matrix,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_date(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        time: i64,
    );
}
unsafe extern "C" {
    pub fn pdf_dict_put_array(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_put_dict(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_puts_dict(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *const ::core::ffi::c_char,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_dict_get_bool(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_get_int(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_get_int64(ctx: *mut fz_context, dict: *mut pdf_obj, key: *mut pdf_obj) -> i64;
}
unsafe extern "C" {
    pub fn pdf_dict_get_real(ctx: *mut fz_context, dict: *mut pdf_obj, key: *mut pdf_obj) -> f32;
}
unsafe extern "C" {
    pub fn pdf_dict_get_name(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_dict_get_string(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        sizep: *mut usize,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_dict_get_text_string(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_dict_get_text_string_opt(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_dict_get_point(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> fz_point;
}
unsafe extern "C" {
    pub fn pdf_dict_get_rect(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_dict_get_matrix(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> fz_matrix;
}
unsafe extern "C" {
    pub fn pdf_dict_get_date(ctx: *mut fz_context, dict: *mut pdf_obj, key: *mut pdf_obj) -> i64;
}
unsafe extern "C" {
    pub fn pdf_dict_get_bool_default(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        def: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_get_int_default(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        def: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_get_real_default(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        def: f32,
    ) -> f32;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_bool(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_int(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_int64(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> i64;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_real(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> f32;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_name(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_string(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
        sizep: *mut usize,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_text_string(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_rect(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_matrix(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> fz_matrix;
}
unsafe extern "C" {
    pub fn pdf_dict_get_inheritable_date(
        ctx: *mut fz_context,
        dict: *mut pdf_obj,
        key: *mut pdf_obj,
    ) -> i64;
}
unsafe extern "C" {
    pub fn pdf_array_push_bool(ctx: *mut fz_context, array: *mut pdf_obj, x: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_array_push_int(ctx: *mut fz_context, array: *mut pdf_obj, x: i64);
}
unsafe extern "C" {
    pub fn pdf_array_push_real(ctx: *mut fz_context, array: *mut pdf_obj, x: f64);
}
unsafe extern "C" {
    pub fn pdf_array_push_name(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        x: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_array_push_string(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        x: *const ::core::ffi::c_char,
        n: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_array_push_text_string(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        x: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_array_push_array(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_array_push_dict(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_array_put_bool(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        x: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_array_put_int(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        x: i64,
    );
}
unsafe extern "C" {
    pub fn pdf_array_put_real(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        x: f64,
    );
}
unsafe extern "C" {
    pub fn pdf_array_put_name(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        x: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_array_put_string(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        x: *const ::core::ffi::c_char,
        n: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_array_put_text_string(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        x: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_array_put_array(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_array_put_dict(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        i: ::core::ffi::c_int,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_array_get_bool(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_array_get_int(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_array_get_real(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
    ) -> f32;
}
unsafe extern "C" {
    pub fn pdf_array_get_name(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_array_get_string(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
        sizep: *mut usize,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_array_get_text_string(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_array_get_rect(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_array_get_matrix(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        index: ::core::ffi::c_int,
    ) -> fz_matrix;
}
unsafe extern "C" {
    pub fn pdf_set_obj_parent(ctx: *mut fz_context, obj: *mut pdf_obj, num: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_obj_refs(ctx: *mut fz_context, ref_: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_obj_parent_num(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_sprint_obj(
        ctx: *mut fz_context,
        buf: *mut ::core::ffi::c_char,
        cap: usize,
        len: *mut usize,
        obj: *mut pdf_obj,
        tight: ::core::ffi::c_int,
        ascii: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_print_obj(
        ctx: *mut fz_context,
        out: *mut fz_output,
        obj: *mut pdf_obj,
        tight: ::core::ffi::c_int,
        ascii: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_print_encrypted_obj(
        ctx: *mut fz_context,
        out: *mut fz_output,
        obj: *mut pdf_obj,
        tight: ::core::ffi::c_int,
        ascii: ::core::ffi::c_int,
        crypt: *mut pdf_crypt,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
        sep: *mut ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_debug_obj(ctx: *mut fz_context, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_debug_ref(ctx: *mut fz_context, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_new_utf8_from_pdf_string(
        ctx: *mut fz_context,
        srcptr: *const ::core::ffi::c_char,
        srclen: usize,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_new_utf8_from_pdf_string_obj(
        ctx: *mut fz_context,
        src: *mut pdf_obj,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_new_utf8_from_pdf_stream_obj(
        ctx: *mut fz_context,
        src: *mut pdf_obj,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_load_stream_or_string_as_utf8(
        ctx: *mut fz_context,
        src: *mut pdf_obj,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_to_quad(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        offset: ::core::ffi::c_int,
    ) -> fz_quad;
}
unsafe extern "C" {
    pub fn pdf_to_point(
        ctx: *mut fz_context,
        array: *mut pdf_obj,
        offset: ::core::ffi::c_int,
    ) -> fz_point;
}
unsafe extern "C" {
    pub fn pdf_to_rect(ctx: *mut fz_context, array: *mut pdf_obj) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_to_matrix(ctx: *mut fz_context, array: *mut pdf_obj) -> fz_matrix;
}
unsafe extern "C" {
    pub fn pdf_to_date(ctx: *mut fz_context, time: *mut pdf_obj) -> i64;
}
unsafe extern "C" {
    pub fn pdf_get_indirect_document(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_get_bound_document(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_pin_document(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_set_int(ctx: *mut fz_context, obj: *mut pdf_obj, i: i64);
}
pub const PDF_ENUM_NULL: _bindgen_ty_35 = 0;
pub const PDF_ENUM_TRUE: _bindgen_ty_35 = 1;
pub const PDF_ENUM_FALSE: _bindgen_ty_35 = 2;
pub const PDF_ENUM_NAME_1_2: _bindgen_ty_35 = 3;
pub const PDF_ENUM_NAME_1_5: _bindgen_ty_35 = 4;
pub const PDF_ENUM_NAME_3D: _bindgen_ty_35 = 5;
pub const PDF_ENUM_NAME_A: _bindgen_ty_35 = 6;
pub const PDF_ENUM_NAME_A85: _bindgen_ty_35 = 7;
pub const PDF_ENUM_NAME_AA: _bindgen_ty_35 = 8;
pub const PDF_ENUM_NAME_AC: _bindgen_ty_35 = 9;
pub const PDF_ENUM_NAME_AESV2: _bindgen_ty_35 = 10;
pub const PDF_ENUM_NAME_AESV3: _bindgen_ty_35 = 11;
pub const PDF_ENUM_NAME_AF: _bindgen_ty_35 = 12;
pub const PDF_ENUM_NAME_AFRelationship: _bindgen_ty_35 = 13;
pub const PDF_ENUM_NAME_AHx: _bindgen_ty_35 = 14;
pub const PDF_ENUM_NAME_AP: _bindgen_ty_35 = 15;
pub const PDF_ENUM_NAME_AS: _bindgen_ty_35 = 16;
pub const PDF_ENUM_NAME_ASCII85Decode: _bindgen_ty_35 = 17;
pub const PDF_ENUM_NAME_ASCIIHexDecode: _bindgen_ty_35 = 18;
pub const PDF_ENUM_NAME_AbsoluteColorimetric: _bindgen_ty_35 = 19;
pub const PDF_ENUM_NAME_AcroForm: _bindgen_ty_35 = 20;
pub const PDF_ENUM_NAME_Action: _bindgen_ty_35 = 21;
pub const PDF_ENUM_NAME_ActualText: _bindgen_ty_35 = 22;
pub const PDF_ENUM_NAME_Adobe_PPKLite: _bindgen_ty_35 = 23;
pub const PDF_ENUM_NAME_All: _bindgen_ty_35 = 24;
pub const PDF_ENUM_NAME_AllOff: _bindgen_ty_35 = 25;
pub const PDF_ENUM_NAME_AllOn: _bindgen_ty_35 = 26;
pub const PDF_ENUM_NAME_Alpha: _bindgen_ty_35 = 27;
pub const PDF_ENUM_NAME_Alt: _bindgen_ty_35 = 28;
pub const PDF_ENUM_NAME_Alternate: _bindgen_ty_35 = 29;
pub const PDF_ENUM_NAME_Alternative: _bindgen_ty_35 = 30;
pub const PDF_ENUM_NAME_Annot: _bindgen_ty_35 = 31;
pub const PDF_ENUM_NAME_Annots: _bindgen_ty_35 = 32;
pub const PDF_ENUM_NAME_AnyOff: _bindgen_ty_35 = 33;
pub const PDF_ENUM_NAME_App: _bindgen_ty_35 = 34;
pub const PDF_ENUM_NAME_Approved: _bindgen_ty_35 = 35;
pub const PDF_ENUM_NAME_Art: _bindgen_ty_35 = 36;
pub const PDF_ENUM_NAME_ArtBox: _bindgen_ty_35 = 37;
pub const PDF_ENUM_NAME_Artifact: _bindgen_ty_35 = 38;
pub const PDF_ENUM_NAME_AsIs: _bindgen_ty_35 = 39;
pub const PDF_ENUM_NAME_Ascent: _bindgen_ty_35 = 40;
pub const PDF_ENUM_NAME_Aside: _bindgen_ty_35 = 41;
pub const PDF_ENUM_NAME_AuthEvent: _bindgen_ty_35 = 42;
pub const PDF_ENUM_NAME_Author: _bindgen_ty_35 = 43;
pub const PDF_ENUM_NAME_B: _bindgen_ty_35 = 44;
pub const PDF_ENUM_NAME_BBox: _bindgen_ty_35 = 45;
pub const PDF_ENUM_NAME_BC: _bindgen_ty_35 = 46;
pub const PDF_ENUM_NAME_BE: _bindgen_ty_35 = 47;
pub const PDF_ENUM_NAME_BG: _bindgen_ty_35 = 48;
pub const PDF_ENUM_NAME_BM: _bindgen_ty_35 = 49;
pub const PDF_ENUM_NAME_BPC: _bindgen_ty_35 = 50;
pub const PDF_ENUM_NAME_BS: _bindgen_ty_35 = 51;
pub const PDF_ENUM_NAME_Background: _bindgen_ty_35 = 52;
pub const PDF_ENUM_NAME_BaseEncoding: _bindgen_ty_35 = 53;
pub const PDF_ENUM_NAME_BaseFont: _bindgen_ty_35 = 54;
pub const PDF_ENUM_NAME_BaseState: _bindgen_ty_35 = 55;
pub const PDF_ENUM_NAME_BibEntry: _bindgen_ty_35 = 56;
pub const PDF_ENUM_NAME_BitsPerComponent: _bindgen_ty_35 = 57;
pub const PDF_ENUM_NAME_BitsPerCoordinate: _bindgen_ty_35 = 58;
pub const PDF_ENUM_NAME_BitsPerFlag: _bindgen_ty_35 = 59;
pub const PDF_ENUM_NAME_BitsPerSample: _bindgen_ty_35 = 60;
pub const PDF_ENUM_NAME_BlackIs1: _bindgen_ty_35 = 61;
pub const PDF_ENUM_NAME_BlackPoint: _bindgen_ty_35 = 62;
pub const PDF_ENUM_NAME_BleedBox: _bindgen_ty_35 = 63;
pub const PDF_ENUM_NAME_Blinds: _bindgen_ty_35 = 64;
pub const PDF_ENUM_NAME_BlockQuote: _bindgen_ty_35 = 65;
pub const PDF_ENUM_NAME_Border: _bindgen_ty_35 = 66;
pub const PDF_ENUM_NAME_Bounds: _bindgen_ty_35 = 67;
pub const PDF_ENUM_NAME_Box: _bindgen_ty_35 = 68;
pub const PDF_ENUM_NAME_Br: _bindgen_ty_35 = 69;
pub const PDF_ENUM_NAME_BrotliDecode: _bindgen_ty_35 = 70;
pub const PDF_ENUM_NAME_Bt: _bindgen_ty_35 = 71;
pub const PDF_ENUM_NAME_Btn: _bindgen_ty_35 = 72;
pub const PDF_ENUM_NAME_Butt: _bindgen_ty_35 = 73;
pub const PDF_ENUM_NAME_ByteRange: _bindgen_ty_35 = 74;
pub const PDF_ENUM_NAME_C: _bindgen_ty_35 = 75;
pub const PDF_ENUM_NAME_C0: _bindgen_ty_35 = 76;
pub const PDF_ENUM_NAME_C1: _bindgen_ty_35 = 77;
pub const PDF_ENUM_NAME_CA: _bindgen_ty_35 = 78;
pub const PDF_ENUM_NAME_CCF: _bindgen_ty_35 = 79;
pub const PDF_ENUM_NAME_CCITTFaxDecode: _bindgen_ty_35 = 80;
pub const PDF_ENUM_NAME_CF: _bindgen_ty_35 = 81;
pub const PDF_ENUM_NAME_CFM: _bindgen_ty_35 = 82;
pub const PDF_ENUM_NAME_CI: _bindgen_ty_35 = 83;
pub const PDF_ENUM_NAME_CIDFontType0: _bindgen_ty_35 = 84;
pub const PDF_ENUM_NAME_CIDFontType0C: _bindgen_ty_35 = 85;
pub const PDF_ENUM_NAME_CIDFontType2: _bindgen_ty_35 = 86;
pub const PDF_ENUM_NAME_CIDSystemInfo: _bindgen_ty_35 = 87;
pub const PDF_ENUM_NAME_CIDToGIDMap: _bindgen_ty_35 = 88;
pub const PDF_ENUM_NAME_CL: _bindgen_ty_35 = 89;
pub const PDF_ENUM_NAME_CMYK: _bindgen_ty_35 = 90;
pub const PDF_ENUM_NAME_CO: _bindgen_ty_35 = 91;
pub const PDF_ENUM_NAME_CP: _bindgen_ty_35 = 92;
pub const PDF_ENUM_NAME_CS: _bindgen_ty_35 = 93;
pub const PDF_ENUM_NAME_CalCMYK: _bindgen_ty_35 = 94;
pub const PDF_ENUM_NAME_CalGray: _bindgen_ty_35 = 95;
pub const PDF_ENUM_NAME_CalRGB: _bindgen_ty_35 = 96;
pub const PDF_ENUM_NAME_Cap: _bindgen_ty_35 = 97;
pub const PDF_ENUM_NAME_CapHeight: _bindgen_ty_35 = 98;
pub const PDF_ENUM_NAME_Caption: _bindgen_ty_35 = 99;
pub const PDF_ENUM_NAME_Caret: _bindgen_ty_35 = 100;
pub const PDF_ENUM_NAME_Catalog: _bindgen_ty_35 = 101;
pub const PDF_ENUM_NAME_Cert: _bindgen_ty_35 = 102;
pub const PDF_ENUM_NAME_Ch: _bindgen_ty_35 = 103;
pub const PDF_ENUM_NAME_Changes: _bindgen_ty_35 = 104;
pub const PDF_ENUM_NAME_CharProcs: _bindgen_ty_35 = 105;
pub const PDF_ENUM_NAME_CheckSum: _bindgen_ty_35 = 106;
pub const PDF_ENUM_NAME_Circle: _bindgen_ty_35 = 107;
pub const PDF_ENUM_NAME_ClosedArrow: _bindgen_ty_35 = 108;
pub const PDF_ENUM_NAME_Code: _bindgen_ty_35 = 109;
pub const PDF_ENUM_NAME_Collection: _bindgen_ty_35 = 110;
pub const PDF_ENUM_NAME_ColorSpace: _bindgen_ty_35 = 111;
pub const PDF_ENUM_NAME_ColorTransform: _bindgen_ty_35 = 112;
pub const PDF_ENUM_NAME_Colorants: _bindgen_ty_35 = 113;
pub const PDF_ENUM_NAME_Colors: _bindgen_ty_35 = 114;
pub const PDF_ENUM_NAME_Columns: _bindgen_ty_35 = 115;
pub const PDF_ENUM_NAME_Confidential: _bindgen_ty_35 = 116;
pub const PDF_ENUM_NAME_Configs: _bindgen_ty_35 = 117;
pub const PDF_ENUM_NAME_ContactInfo: _bindgen_ty_35 = 118;
pub const PDF_ENUM_NAME_Contents: _bindgen_ty_35 = 119;
pub const PDF_ENUM_NAME_Coords: _bindgen_ty_35 = 120;
pub const PDF_ENUM_NAME_Count: _bindgen_ty_35 = 121;
pub const PDF_ENUM_NAME_Cover: _bindgen_ty_35 = 122;
pub const PDF_ENUM_NAME_CreationDate: _bindgen_ty_35 = 123;
pub const PDF_ENUM_NAME_Creator: _bindgen_ty_35 = 124;
pub const PDF_ENUM_NAME_CropBox: _bindgen_ty_35 = 125;
pub const PDF_ENUM_NAME_Crypt: _bindgen_ty_35 = 126;
pub const PDF_ENUM_NAME_D: _bindgen_ty_35 = 127;
pub const PDF_ENUM_NAME_DA: _bindgen_ty_35 = 128;
pub const PDF_ENUM_NAME_DC: _bindgen_ty_35 = 129;
pub const PDF_ENUM_NAME_DCT: _bindgen_ty_35 = 130;
pub const PDF_ENUM_NAME_DCTDecode: _bindgen_ty_35 = 131;
pub const PDF_ENUM_NAME_DL: _bindgen_ty_35 = 132;
pub const PDF_ENUM_NAME_DOS: _bindgen_ty_35 = 133;
pub const PDF_ENUM_NAME_DP: _bindgen_ty_35 = 134;
pub const PDF_ENUM_NAME_DR: _bindgen_ty_35 = 135;
pub const PDF_ENUM_NAME_DS: _bindgen_ty_35 = 136;
pub const PDF_ENUM_NAME_DV: _bindgen_ty_35 = 137;
pub const PDF_ENUM_NAME_DW: _bindgen_ty_35 = 138;
pub const PDF_ENUM_NAME_DW2: _bindgen_ty_35 = 139;
pub const PDF_ENUM_NAME_DamagedRowsBeforeError: _bindgen_ty_35 = 140;
pub const PDF_ENUM_NAME_Data: _bindgen_ty_35 = 141;
pub const PDF_ENUM_NAME_Date: _bindgen_ty_35 = 142;
pub const PDF_ENUM_NAME_Decode: _bindgen_ty_35 = 143;
pub const PDF_ENUM_NAME_DecodeParms: _bindgen_ty_35 = 144;
pub const PDF_ENUM_NAME_Default: _bindgen_ty_35 = 145;
pub const PDF_ENUM_NAME_DefaultCMYK: _bindgen_ty_35 = 146;
pub const PDF_ENUM_NAME_DefaultGray: _bindgen_ty_35 = 147;
pub const PDF_ENUM_NAME_DefaultRGB: _bindgen_ty_35 = 148;
pub const PDF_ENUM_NAME_Departmental: _bindgen_ty_35 = 149;
pub const PDF_ENUM_NAME_Desc: _bindgen_ty_35 = 150;
pub const PDF_ENUM_NAME_DescendantFonts: _bindgen_ty_35 = 151;
pub const PDF_ENUM_NAME_Descent: _bindgen_ty_35 = 152;
pub const PDF_ENUM_NAME_Design: _bindgen_ty_35 = 153;
pub const PDF_ENUM_NAME_Dest: _bindgen_ty_35 = 154;
pub const PDF_ENUM_NAME_DestOutputProfile: _bindgen_ty_35 = 155;
pub const PDF_ENUM_NAME_Dests: _bindgen_ty_35 = 156;
pub const PDF_ENUM_NAME_DeviceCMYK: _bindgen_ty_35 = 157;
pub const PDF_ENUM_NAME_DeviceGray: _bindgen_ty_35 = 158;
pub const PDF_ENUM_NAME_DeviceN: _bindgen_ty_35 = 159;
pub const PDF_ENUM_NAME_DeviceRGB: _bindgen_ty_35 = 160;
pub const PDF_ENUM_NAME_Di: _bindgen_ty_35 = 161;
pub const PDF_ENUM_NAME_Diamond: _bindgen_ty_35 = 162;
pub const PDF_ENUM_NAME_Differences: _bindgen_ty_35 = 163;
pub const PDF_ENUM_NAME_DigestLocation: _bindgen_ty_35 = 164;
pub const PDF_ENUM_NAME_DigestMethod: _bindgen_ty_35 = 165;
pub const PDF_ENUM_NAME_DigestValue: _bindgen_ty_35 = 166;
pub const PDF_ENUM_NAME_Dissolve: _bindgen_ty_35 = 167;
pub const PDF_ENUM_NAME_Div: _bindgen_ty_35 = 168;
pub const PDF_ENUM_NAME_Dm: _bindgen_ty_35 = 169;
pub const PDF_ENUM_NAME_DocMDP: _bindgen_ty_35 = 170;
pub const PDF_ENUM_NAME_Document: _bindgen_ty_35 = 171;
pub const PDF_ENUM_NAME_DocumentFragment: _bindgen_ty_35 = 172;
pub const PDF_ENUM_NAME_Domain: _bindgen_ty_35 = 173;
pub const PDF_ENUM_NAME_Draft: _bindgen_ty_35 = 174;
pub const PDF_ENUM_NAME_Dur: _bindgen_ty_35 = 175;
pub const PDF_ENUM_NAME_E: _bindgen_ty_35 = 176;
pub const PDF_ENUM_NAME_EF: _bindgen_ty_35 = 177;
pub const PDF_ENUM_NAME_EarlyChange: _bindgen_ty_35 = 178;
pub const PDF_ENUM_NAME_Em: _bindgen_ty_35 = 179;
pub const PDF_ENUM_NAME_EmbeddedFile: _bindgen_ty_35 = 180;
pub const PDF_ENUM_NAME_EmbeddedFiles: _bindgen_ty_35 = 181;
pub const PDF_ENUM_NAME_Encode: _bindgen_ty_35 = 182;
pub const PDF_ENUM_NAME_EncodedByteAlign: _bindgen_ty_35 = 183;
pub const PDF_ENUM_NAME_Encoding: _bindgen_ty_35 = 184;
pub const PDF_ENUM_NAME_Encrypt: _bindgen_ty_35 = 185;
pub const PDF_ENUM_NAME_EncryptMetadata: _bindgen_ty_35 = 186;
pub const PDF_ENUM_NAME_EncryptedPayload: _bindgen_ty_35 = 187;
pub const PDF_ENUM_NAME_EndOfBlock: _bindgen_ty_35 = 188;
pub const PDF_ENUM_NAME_EndOfLine: _bindgen_ty_35 = 189;
pub const PDF_ENUM_NAME_Exclude: _bindgen_ty_35 = 190;
pub const PDF_ENUM_NAME_Experimental: _bindgen_ty_35 = 191;
pub const PDF_ENUM_NAME_Expired: _bindgen_ty_35 = 192;
pub const PDF_ENUM_NAME_ExtGState: _bindgen_ty_35 = 193;
pub const PDF_ENUM_NAME_Extend: _bindgen_ty_35 = 194;
pub const PDF_ENUM_NAME_F: _bindgen_ty_35 = 195;
pub const PDF_ENUM_NAME_FENote: _bindgen_ty_35 = 196;
pub const PDF_ENUM_NAME_FL: _bindgen_ty_35 = 197;
pub const PDF_ENUM_NAME_FRM: _bindgen_ty_35 = 198;
pub const PDF_ENUM_NAME_FS: _bindgen_ty_35 = 199;
pub const PDF_ENUM_NAME_FT: _bindgen_ty_35 = 200;
pub const PDF_ENUM_NAME_Fade: _bindgen_ty_35 = 201;
pub const PDF_ENUM_NAME_Ff: _bindgen_ty_35 = 202;
pub const PDF_ENUM_NAME_FieldMDP: _bindgen_ty_35 = 203;
pub const PDF_ENUM_NAME_Fields: _bindgen_ty_35 = 204;
pub const PDF_ENUM_NAME_Figure: _bindgen_ty_35 = 205;
pub const PDF_ENUM_NAME_FileAttachment: _bindgen_ty_35 = 206;
pub const PDF_ENUM_NAME_FileSize: _bindgen_ty_35 = 207;
pub const PDF_ENUM_NAME_Filespec: _bindgen_ty_35 = 208;
pub const PDF_ENUM_NAME_Filter: _bindgen_ty_35 = 209;
pub const PDF_ENUM_NAME_Final: _bindgen_ty_35 = 210;
pub const PDF_ENUM_NAME_Fingerprint: _bindgen_ty_35 = 211;
pub const PDF_ENUM_NAME_First: _bindgen_ty_35 = 212;
pub const PDF_ENUM_NAME_FirstChar: _bindgen_ty_35 = 213;
pub const PDF_ENUM_NAME_FirstPage: _bindgen_ty_35 = 214;
pub const PDF_ENUM_NAME_Fit: _bindgen_ty_35 = 215;
pub const PDF_ENUM_NAME_FitB: _bindgen_ty_35 = 216;
pub const PDF_ENUM_NAME_FitBH: _bindgen_ty_35 = 217;
pub const PDF_ENUM_NAME_FitBV: _bindgen_ty_35 = 218;
pub const PDF_ENUM_NAME_FitH: _bindgen_ty_35 = 219;
pub const PDF_ENUM_NAME_FitR: _bindgen_ty_35 = 220;
pub const PDF_ENUM_NAME_FitV: _bindgen_ty_35 = 221;
pub const PDF_ENUM_NAME_Fl: _bindgen_ty_35 = 222;
pub const PDF_ENUM_NAME_Flags: _bindgen_ty_35 = 223;
pub const PDF_ENUM_NAME_FlateDecode: _bindgen_ty_35 = 224;
pub const PDF_ENUM_NAME_Fly: _bindgen_ty_35 = 225;
pub const PDF_ENUM_NAME_Font: _bindgen_ty_35 = 226;
pub const PDF_ENUM_NAME_FontBBox: _bindgen_ty_35 = 227;
pub const PDF_ENUM_NAME_FontDescriptor: _bindgen_ty_35 = 228;
pub const PDF_ENUM_NAME_FontFile: _bindgen_ty_35 = 229;
pub const PDF_ENUM_NAME_FontFile2: _bindgen_ty_35 = 230;
pub const PDF_ENUM_NAME_FontFile3: _bindgen_ty_35 = 231;
pub const PDF_ENUM_NAME_FontMatrix: _bindgen_ty_35 = 232;
pub const PDF_ENUM_NAME_FontName: _bindgen_ty_35 = 233;
pub const PDF_ENUM_NAME_ForComment: _bindgen_ty_35 = 234;
pub const PDF_ENUM_NAME_ForPublicRelease: _bindgen_ty_35 = 235;
pub const PDF_ENUM_NAME_Form: _bindgen_ty_35 = 236;
pub const PDF_ENUM_NAME_FormData: _bindgen_ty_35 = 237;
pub const PDF_ENUM_NAME_FormEx: _bindgen_ty_35 = 238;
pub const PDF_ENUM_NAME_FormType: _bindgen_ty_35 = 239;
pub const PDF_ENUM_NAME_Formula: _bindgen_ty_35 = 240;
pub const PDF_ENUM_NAME_FreeText: _bindgen_ty_35 = 241;
pub const PDF_ENUM_NAME_FreeTextCallout: _bindgen_ty_35 = 242;
pub const PDF_ENUM_NAME_FreeTextTypeWriter: _bindgen_ty_35 = 243;
pub const PDF_ENUM_NAME_Function: _bindgen_ty_35 = 244;
pub const PDF_ENUM_NAME_FunctionType: _bindgen_ty_35 = 245;
pub const PDF_ENUM_NAME_Functions: _bindgen_ty_35 = 246;
pub const PDF_ENUM_NAME_G: _bindgen_ty_35 = 247;
pub const PDF_ENUM_NAME_GTS_PDFX: _bindgen_ty_35 = 248;
pub const PDF_ENUM_NAME_Gamma: _bindgen_ty_35 = 249;
pub const PDF_ENUM_NAME_Glitter: _bindgen_ty_35 = 250;
pub const PDF_ENUM_NAME_GoTo: _bindgen_ty_35 = 251;
pub const PDF_ENUM_NAME_GoToR: _bindgen_ty_35 = 252;
pub const PDF_ENUM_NAME_Group: _bindgen_ty_35 = 253;
pub const PDF_ENUM_NAME_H: _bindgen_ty_35 = 254;
pub const PDF_ENUM_NAME_H1: _bindgen_ty_35 = 255;
pub const PDF_ENUM_NAME_H2: _bindgen_ty_35 = 256;
pub const PDF_ENUM_NAME_H3: _bindgen_ty_35 = 257;
pub const PDF_ENUM_NAME_H4: _bindgen_ty_35 = 258;
pub const PDF_ENUM_NAME_H5: _bindgen_ty_35 = 259;
pub const PDF_ENUM_NAME_H6: _bindgen_ty_35 = 260;
pub const PDF_ENUM_NAME_Height: _bindgen_ty_35 = 261;
pub const PDF_ENUM_NAME_Helv: _bindgen_ty_35 = 262;
pub const PDF_ENUM_NAME_Highlight: _bindgen_ty_35 = 263;
pub const PDF_ENUM_NAME_HistoryPos: _bindgen_ty_35 = 264;
pub const PDF_ENUM_NAME_I: _bindgen_ty_35 = 265;
pub const PDF_ENUM_NAME_IC: _bindgen_ty_35 = 266;
pub const PDF_ENUM_NAME_ICCBased: _bindgen_ty_35 = 267;
pub const PDF_ENUM_NAME_ID: _bindgen_ty_35 = 268;
pub const PDF_ENUM_NAME_IM: _bindgen_ty_35 = 269;
pub const PDF_ENUM_NAME_IRT: _bindgen_ty_35 = 270;
pub const PDF_ENUM_NAME_IT: _bindgen_ty_35 = 271;
pub const PDF_ENUM_NAME_Identity: _bindgen_ty_35 = 272;
pub const PDF_ENUM_NAME_Identity_H: _bindgen_ty_35 = 273;
pub const PDF_ENUM_NAME_Identity_V: _bindgen_ty_35 = 274;
pub const PDF_ENUM_NAME_Image: _bindgen_ty_35 = 275;
pub const PDF_ENUM_NAME_ImageB: _bindgen_ty_35 = 276;
pub const PDF_ENUM_NAME_ImageC: _bindgen_ty_35 = 277;
pub const PDF_ENUM_NAME_ImageI: _bindgen_ty_35 = 278;
pub const PDF_ENUM_NAME_ImageMask: _bindgen_ty_35 = 279;
pub const PDF_ENUM_NAME_Include: _bindgen_ty_35 = 280;
pub const PDF_ENUM_NAME_Index: _bindgen_ty_35 = 281;
pub const PDF_ENUM_NAME_Indexed: _bindgen_ty_35 = 282;
pub const PDF_ENUM_NAME_Info: _bindgen_ty_35 = 283;
pub const PDF_ENUM_NAME_Ink: _bindgen_ty_35 = 284;
pub const PDF_ENUM_NAME_InkList: _bindgen_ty_35 = 285;
pub const PDF_ENUM_NAME_Intent: _bindgen_ty_35 = 286;
pub const PDF_ENUM_NAME_Interpolate: _bindgen_ty_35 = 287;
pub const PDF_ENUM_NAME_IsMap: _bindgen_ty_35 = 288;
pub const PDF_ENUM_NAME_ItalicAngle: _bindgen_ty_35 = 289;
pub const PDF_ENUM_NAME_JBIG2Decode: _bindgen_ty_35 = 290;
pub const PDF_ENUM_NAME_JBIG2Globals: _bindgen_ty_35 = 291;
pub const PDF_ENUM_NAME_JPXDecode: _bindgen_ty_35 = 292;
pub const PDF_ENUM_NAME_JS: _bindgen_ty_35 = 293;
pub const PDF_ENUM_NAME_JavaScript: _bindgen_ty_35 = 294;
pub const PDF_ENUM_NAME_K: _bindgen_ty_35 = 295;
pub const PDF_ENUM_NAME_Keywords: _bindgen_ty_35 = 296;
pub const PDF_ENUM_NAME_Kids: _bindgen_ty_35 = 297;
pub const PDF_ENUM_NAME_L: _bindgen_ty_35 = 298;
pub const PDF_ENUM_NAME_LBody: _bindgen_ty_35 = 299;
pub const PDF_ENUM_NAME_LC: _bindgen_ty_35 = 300;
pub const PDF_ENUM_NAME_LE: _bindgen_ty_35 = 301;
pub const PDF_ENUM_NAME_LI: _bindgen_ty_35 = 302;
pub const PDF_ENUM_NAME_LJ: _bindgen_ty_35 = 303;
pub const PDF_ENUM_NAME_LL: _bindgen_ty_35 = 304;
pub const PDF_ENUM_NAME_LLE: _bindgen_ty_35 = 305;
pub const PDF_ENUM_NAME_LLO: _bindgen_ty_35 = 306;
pub const PDF_ENUM_NAME_LW: _bindgen_ty_35 = 307;
pub const PDF_ENUM_NAME_LZ: _bindgen_ty_35 = 308;
pub const PDF_ENUM_NAME_LZW: _bindgen_ty_35 = 309;
pub const PDF_ENUM_NAME_LZWDecode: _bindgen_ty_35 = 310;
pub const PDF_ENUM_NAME_Lab: _bindgen_ty_35 = 311;
pub const PDF_ENUM_NAME_Label: _bindgen_ty_35 = 312;
pub const PDF_ENUM_NAME_Lang: _bindgen_ty_35 = 313;
pub const PDF_ENUM_NAME_Last: _bindgen_ty_35 = 314;
pub const PDF_ENUM_NAME_LastChar: _bindgen_ty_35 = 315;
pub const PDF_ENUM_NAME_LastPage: _bindgen_ty_35 = 316;
pub const PDF_ENUM_NAME_Launch: _bindgen_ty_35 = 317;
pub const PDF_ENUM_NAME_Layer: _bindgen_ty_35 = 318;
pub const PDF_ENUM_NAME_Lbl: _bindgen_ty_35 = 319;
pub const PDF_ENUM_NAME_Length: _bindgen_ty_35 = 320;
pub const PDF_ENUM_NAME_Length1: _bindgen_ty_35 = 321;
pub const PDF_ENUM_NAME_Length2: _bindgen_ty_35 = 322;
pub const PDF_ENUM_NAME_Length3: _bindgen_ty_35 = 323;
pub const PDF_ENUM_NAME_Limits: _bindgen_ty_35 = 324;
pub const PDF_ENUM_NAME_Line: _bindgen_ty_35 = 325;
pub const PDF_ENUM_NAME_LineArrow: _bindgen_ty_35 = 326;
pub const PDF_ENUM_NAME_LineDimension: _bindgen_ty_35 = 327;
pub const PDF_ENUM_NAME_Linearized: _bindgen_ty_35 = 328;
pub const PDF_ENUM_NAME_Link: _bindgen_ty_35 = 329;
pub const PDF_ENUM_NAME_List: _bindgen_ty_35 = 330;
pub const PDF_ENUM_NAME_Location: _bindgen_ty_35 = 331;
pub const PDF_ENUM_NAME_Lock: _bindgen_ty_35 = 332;
pub const PDF_ENUM_NAME_Locked: _bindgen_ty_35 = 333;
pub const PDF_ENUM_NAME_Luminosity: _bindgen_ty_35 = 334;
pub const PDF_ENUM_NAME_M: _bindgen_ty_35 = 335;
pub const PDF_ENUM_NAME_MCID: _bindgen_ty_35 = 336;
pub const PDF_ENUM_NAME_MK: _bindgen_ty_35 = 337;
pub const PDF_ENUM_NAME_ML: _bindgen_ty_35 = 338;
pub const PDF_ENUM_NAME_MMType1: _bindgen_ty_35 = 339;
pub const PDF_ENUM_NAME_Mac: _bindgen_ty_35 = 340;
pub const PDF_ENUM_NAME_Mask: _bindgen_ty_35 = 341;
pub const PDF_ENUM_NAME_Matrix: _bindgen_ty_35 = 342;
pub const PDF_ENUM_NAME_Matte: _bindgen_ty_35 = 343;
pub const PDF_ENUM_NAME_MaxLen: _bindgen_ty_35 = 344;
pub const PDF_ENUM_NAME_MediaBox: _bindgen_ty_35 = 345;
pub const PDF_ENUM_NAME_Metadata: _bindgen_ty_35 = 346;
pub const PDF_ENUM_NAME_MissingWidth: _bindgen_ty_35 = 347;
pub const PDF_ENUM_NAME_ModDate: _bindgen_ty_35 = 348;
pub const PDF_ENUM_NAME_Movie: _bindgen_ty_35 = 349;
pub const PDF_ENUM_NAME_Msg: _bindgen_ty_35 = 350;
pub const PDF_ENUM_NAME_Multiply: _bindgen_ty_35 = 351;
pub const PDF_ENUM_NAME_N: _bindgen_ty_35 = 352;
pub const PDF_ENUM_NAME_Name: _bindgen_ty_35 = 353;
pub const PDF_ENUM_NAME_Named: _bindgen_ty_35 = 354;
pub const PDF_ENUM_NAME_Names: _bindgen_ty_35 = 355;
pub const PDF_ENUM_NAME_NeedAppearances: _bindgen_ty_35 = 356;
pub const PDF_ENUM_NAME_NewWindow: _bindgen_ty_35 = 357;
pub const PDF_ENUM_NAME_Next: _bindgen_ty_35 = 358;
pub const PDF_ENUM_NAME_NextPage: _bindgen_ty_35 = 359;
pub const PDF_ENUM_NAME_NonEFontNoWarn: _bindgen_ty_35 = 360;
pub const PDF_ENUM_NAME_NonStruct: _bindgen_ty_35 = 361;
pub const PDF_ENUM_NAME_None: _bindgen_ty_35 = 362;
pub const PDF_ENUM_NAME_Normal: _bindgen_ty_35 = 363;
pub const PDF_ENUM_NAME_NotApproved: _bindgen_ty_35 = 364;
pub const PDF_ENUM_NAME_NotForPublicRelease: _bindgen_ty_35 = 365;
pub const PDF_ENUM_NAME_Note: _bindgen_ty_35 = 366;
pub const PDF_ENUM_NAME_NumSections: _bindgen_ty_35 = 367;
pub const PDF_ENUM_NAME_Nums: _bindgen_ty_35 = 368;
pub const PDF_ENUM_NAME_O: _bindgen_ty_35 = 369;
pub const PDF_ENUM_NAME_OC: _bindgen_ty_35 = 370;
pub const PDF_ENUM_NAME_OCG: _bindgen_ty_35 = 371;
pub const PDF_ENUM_NAME_OCGs: _bindgen_ty_35 = 372;
pub const PDF_ENUM_NAME_OCMD: _bindgen_ty_35 = 373;
pub const PDF_ENUM_NAME_OCProperties: _bindgen_ty_35 = 374;
pub const PDF_ENUM_NAME_OE: _bindgen_ty_35 = 375;
pub const PDF_ENUM_NAME_OFF: _bindgen_ty_35 = 376;
pub const PDF_ENUM_NAME_ON: _bindgen_ty_35 = 377;
pub const PDF_ENUM_NAME_OP: _bindgen_ty_35 = 378;
pub const PDF_ENUM_NAME_OPM: _bindgen_ty_35 = 379;
pub const PDF_ENUM_NAME_OS: _bindgen_ty_35 = 380;
pub const PDF_ENUM_NAME_ObjStm: _bindgen_ty_35 = 381;
pub const PDF_ENUM_NAME_Of: _bindgen_ty_35 = 382;
pub const PDF_ENUM_NAME_Off: _bindgen_ty_35 = 383;
pub const PDF_ENUM_NAME_Open: _bindgen_ty_35 = 384;
pub const PDF_ENUM_NAME_OpenArrow: _bindgen_ty_35 = 385;
pub const PDF_ENUM_NAME_OpenType: _bindgen_ty_35 = 386;
pub const PDF_ENUM_NAME_Opt: _bindgen_ty_35 = 387;
pub const PDF_ENUM_NAME_Order: _bindgen_ty_35 = 388;
pub const PDF_ENUM_NAME_Ordering: _bindgen_ty_35 = 389;
pub const PDF_ENUM_NAME_Outlines: _bindgen_ty_35 = 390;
pub const PDF_ENUM_NAME_OutputCondition: _bindgen_ty_35 = 391;
pub const PDF_ENUM_NAME_OutputConditionIdentifier: _bindgen_ty_35 = 392;
pub const PDF_ENUM_NAME_OutputIntent: _bindgen_ty_35 = 393;
pub const PDF_ENUM_NAME_OutputIntents: _bindgen_ty_35 = 394;
pub const PDF_ENUM_NAME_P: _bindgen_ty_35 = 395;
pub const PDF_ENUM_NAME_PDF: _bindgen_ty_35 = 396;
pub const PDF_ENUM_NAME_PS: _bindgen_ty_35 = 397;
pub const PDF_ENUM_NAME_Page: _bindgen_ty_35 = 398;
pub const PDF_ENUM_NAME_PageLabels: _bindgen_ty_35 = 399;
pub const PDF_ENUM_NAME_PageMode: _bindgen_ty_35 = 400;
pub const PDF_ENUM_NAME_Pages: _bindgen_ty_35 = 401;
pub const PDF_ENUM_NAME_PaintType: _bindgen_ty_35 = 402;
pub const PDF_ENUM_NAME_Params: _bindgen_ty_35 = 403;
pub const PDF_ENUM_NAME_Parent: _bindgen_ty_35 = 404;
pub const PDF_ENUM_NAME_ParentTree: _bindgen_ty_35 = 405;
pub const PDF_ENUM_NAME_Part: _bindgen_ty_35 = 406;
pub const PDF_ENUM_NAME_Pattern: _bindgen_ty_35 = 407;
pub const PDF_ENUM_NAME_PatternType: _bindgen_ty_35 = 408;
pub const PDF_ENUM_NAME_Perceptual: _bindgen_ty_35 = 409;
pub const PDF_ENUM_NAME_Perms: _bindgen_ty_35 = 410;
pub const PDF_ENUM_NAME_PieceInfo: _bindgen_ty_35 = 411;
pub const PDF_ENUM_NAME_PolyLine: _bindgen_ty_35 = 412;
pub const PDF_ENUM_NAME_PolyLineDimension: _bindgen_ty_35 = 413;
pub const PDF_ENUM_NAME_Polygon: _bindgen_ty_35 = 414;
pub const PDF_ENUM_NAME_PolygonCloud: _bindgen_ty_35 = 415;
pub const PDF_ENUM_NAME_PolygonDimension: _bindgen_ty_35 = 416;
pub const PDF_ENUM_NAME_Popup: _bindgen_ty_35 = 417;
pub const PDF_ENUM_NAME_PreRelease: _bindgen_ty_35 = 418;
pub const PDF_ENUM_NAME_Predictor: _bindgen_ty_35 = 419;
pub const PDF_ENUM_NAME_Prev: _bindgen_ty_35 = 420;
pub const PDF_ENUM_NAME_PrevPage: _bindgen_ty_35 = 421;
pub const PDF_ENUM_NAME_Preview: _bindgen_ty_35 = 422;
pub const PDF_ENUM_NAME_Print: _bindgen_ty_35 = 423;
pub const PDF_ENUM_NAME_PrinterMark: _bindgen_ty_35 = 424;
pub const PDF_ENUM_NAME_Private: _bindgen_ty_35 = 425;
pub const PDF_ENUM_NAME_ProcSet: _bindgen_ty_35 = 426;
pub const PDF_ENUM_NAME_Producer: _bindgen_ty_35 = 427;
pub const PDF_ENUM_NAME_Prop_AuthTime: _bindgen_ty_35 = 428;
pub const PDF_ENUM_NAME_Prop_AuthType: _bindgen_ty_35 = 429;
pub const PDF_ENUM_NAME_Prop_Build: _bindgen_ty_35 = 430;
pub const PDF_ENUM_NAME_Properties: _bindgen_ty_35 = 431;
pub const PDF_ENUM_NAME_PubSec: _bindgen_ty_35 = 432;
pub const PDF_ENUM_NAME_Push: _bindgen_ty_35 = 433;
pub const PDF_ENUM_NAME_Q: _bindgen_ty_35 = 434;
pub const PDF_ENUM_NAME_QuadPoints: _bindgen_ty_35 = 435;
pub const PDF_ENUM_NAME_Quote: _bindgen_ty_35 = 436;
pub const PDF_ENUM_NAME_R: _bindgen_ty_35 = 437;
pub const PDF_ENUM_NAME_RB: _bindgen_ty_35 = 438;
pub const PDF_ENUM_NAME_RBGroups: _bindgen_ty_35 = 439;
pub const PDF_ENUM_NAME_RC: _bindgen_ty_35 = 440;
pub const PDF_ENUM_NAME_RClosedArrow: _bindgen_ty_35 = 441;
pub const PDF_ENUM_NAME_RD: _bindgen_ty_35 = 442;
pub const PDF_ENUM_NAME_REx: _bindgen_ty_35 = 443;
pub const PDF_ENUM_NAME_RGB: _bindgen_ty_35 = 444;
pub const PDF_ENUM_NAME_RI: _bindgen_ty_35 = 445;
pub const PDF_ENUM_NAME_RL: _bindgen_ty_35 = 446;
pub const PDF_ENUM_NAME_RO: _bindgen_ty_35 = 447;
pub const PDF_ENUM_NAME_ROpenArrow: _bindgen_ty_35 = 448;
pub const PDF_ENUM_NAME_RP: _bindgen_ty_35 = 449;
pub const PDF_ENUM_NAME_RT: _bindgen_ty_35 = 450;
pub const PDF_ENUM_NAME_RV: _bindgen_ty_35 = 451;
pub const PDF_ENUM_NAME_Range: _bindgen_ty_35 = 452;
pub const PDF_ENUM_NAME_Reason: _bindgen_ty_35 = 453;
pub const PDF_ENUM_NAME_Rect: _bindgen_ty_35 = 454;
pub const PDF_ENUM_NAME_Redact: _bindgen_ty_35 = 455;
pub const PDF_ENUM_NAME_Ref: _bindgen_ty_35 = 456;
pub const PDF_ENUM_NAME_Reference: _bindgen_ty_35 = 457;
pub const PDF_ENUM_NAME_Registry: _bindgen_ty_35 = 458;
pub const PDF_ENUM_NAME_RelativeColorimetric: _bindgen_ty_35 = 459;
pub const PDF_ENUM_NAME_ResetForm: _bindgen_ty_35 = 460;
pub const PDF_ENUM_NAME_Resources: _bindgen_ty_35 = 461;
pub const PDF_ENUM_NAME_RoleMap: _bindgen_ty_35 = 462;
pub const PDF_ENUM_NAME_Root: _bindgen_ty_35 = 463;
pub const PDF_ENUM_NAME_Rotate: _bindgen_ty_35 = 464;
pub const PDF_ENUM_NAME_Rows: _bindgen_ty_35 = 465;
pub const PDF_ENUM_NAME_Ruby: _bindgen_ty_35 = 466;
pub const PDF_ENUM_NAME_RunLengthDecode: _bindgen_ty_35 = 467;
pub const PDF_ENUM_NAME_S: _bindgen_ty_35 = 468;
pub const PDF_ENUM_NAME_SMask: _bindgen_ty_35 = 469;
pub const PDF_ENUM_NAME_SMaskInData: _bindgen_ty_35 = 470;
pub const PDF_ENUM_NAME_Saturation: _bindgen_ty_35 = 471;
pub const PDF_ENUM_NAME_Schema: _bindgen_ty_35 = 472;
pub const PDF_ENUM_NAME_Screen: _bindgen_ty_35 = 473;
pub const PDF_ENUM_NAME_Sect: _bindgen_ty_35 = 474;
pub const PDF_ENUM_NAME_Separation: _bindgen_ty_35 = 475;
pub const PDF_ENUM_NAME_Shading: _bindgen_ty_35 = 476;
pub const PDF_ENUM_NAME_ShadingType: _bindgen_ty_35 = 477;
pub const PDF_ENUM_NAME_Si: _bindgen_ty_35 = 478;
pub const PDF_ENUM_NAME_Sig: _bindgen_ty_35 = 479;
pub const PDF_ENUM_NAME_SigFlags: _bindgen_ty_35 = 480;
pub const PDF_ENUM_NAME_SigQ: _bindgen_ty_35 = 481;
pub const PDF_ENUM_NAME_SigRef: _bindgen_ty_35 = 482;
pub const PDF_ENUM_NAME_Size: _bindgen_ty_35 = 483;
pub const PDF_ENUM_NAME_Slash: _bindgen_ty_35 = 484;
pub const PDF_ENUM_NAME_Sold: _bindgen_ty_35 = 485;
pub const PDF_ENUM_NAME_Sound: _bindgen_ty_35 = 486;
pub const PDF_ENUM_NAME_Source: _bindgen_ty_35 = 487;
pub const PDF_ENUM_NAME_Span: _bindgen_ty_35 = 488;
pub const PDF_ENUM_NAME_Split: _bindgen_ty_35 = 489;
pub const PDF_ENUM_NAME_Square: _bindgen_ty_35 = 490;
pub const PDF_ENUM_NAME_Squiggly: _bindgen_ty_35 = 491;
pub const PDF_ENUM_NAME_St: _bindgen_ty_35 = 492;
pub const PDF_ENUM_NAME_Stamp: _bindgen_ty_35 = 493;
pub const PDF_ENUM_NAME_StampImage: _bindgen_ty_35 = 494;
pub const PDF_ENUM_NAME_StampSnapshot: _bindgen_ty_35 = 495;
pub const PDF_ENUM_NAME_Standard: _bindgen_ty_35 = 496;
pub const PDF_ENUM_NAME_StdCF: _bindgen_ty_35 = 497;
pub const PDF_ENUM_NAME_StemV: _bindgen_ty_35 = 498;
pub const PDF_ENUM_NAME_StmF: _bindgen_ty_35 = 499;
pub const PDF_ENUM_NAME_StrF: _bindgen_ty_35 = 500;
pub const PDF_ENUM_NAME_StrikeOut: _bindgen_ty_35 = 501;
pub const PDF_ENUM_NAME_Strong: _bindgen_ty_35 = 502;
pub const PDF_ENUM_NAME_StructParent: _bindgen_ty_35 = 503;
pub const PDF_ENUM_NAME_StructParents: _bindgen_ty_35 = 504;
pub const PDF_ENUM_NAME_StructTreeRoot: _bindgen_ty_35 = 505;
pub const PDF_ENUM_NAME_Sub: _bindgen_ty_35 = 506;
pub const PDF_ENUM_NAME_SubFilter: _bindgen_ty_35 = 507;
pub const PDF_ENUM_NAME_Subject: _bindgen_ty_35 = 508;
pub const PDF_ENUM_NAME_Subtype: _bindgen_ty_35 = 509;
pub const PDF_ENUM_NAME_Subtype2: _bindgen_ty_35 = 510;
pub const PDF_ENUM_NAME_Supplement: _bindgen_ty_35 = 511;
pub const PDF_ENUM_NAME_Symb: _bindgen_ty_35 = 512;
pub const PDF_ENUM_NAME_T: _bindgen_ty_35 = 513;
pub const PDF_ENUM_NAME_TBody: _bindgen_ty_35 = 514;
pub const PDF_ENUM_NAME_TD: _bindgen_ty_35 = 515;
pub const PDF_ENUM_NAME_TFoot: _bindgen_ty_35 = 516;
pub const PDF_ENUM_NAME_TH: _bindgen_ty_35 = 517;
pub const PDF_ENUM_NAME_THead: _bindgen_ty_35 = 518;
pub const PDF_ENUM_NAME_TI: _bindgen_ty_35 = 519;
pub const PDF_ENUM_NAME_TOC: _bindgen_ty_35 = 520;
pub const PDF_ENUM_NAME_TOCI: _bindgen_ty_35 = 521;
pub const PDF_ENUM_NAME_TR: _bindgen_ty_35 = 522;
pub const PDF_ENUM_NAME_TR2: _bindgen_ty_35 = 523;
pub const PDF_ENUM_NAME_TU: _bindgen_ty_35 = 524;
pub const PDF_ENUM_NAME_Table: _bindgen_ty_35 = 525;
pub const PDF_ENUM_NAME_Text: _bindgen_ty_35 = 526;
pub const PDF_ENUM_NAME_Thumb: _bindgen_ty_35 = 527;
pub const PDF_ENUM_NAME_TilingType: _bindgen_ty_35 = 528;
pub const PDF_ENUM_NAME_Times: _bindgen_ty_35 = 529;
pub const PDF_ENUM_NAME_Title: _bindgen_ty_35 = 530;
pub const PDF_ENUM_NAME_ToUnicode: _bindgen_ty_35 = 531;
pub const PDF_ENUM_NAME_Top: _bindgen_ty_35 = 532;
pub const PDF_ENUM_NAME_TopSecret: _bindgen_ty_35 = 533;
pub const PDF_ENUM_NAME_Trans: _bindgen_ty_35 = 534;
pub const PDF_ENUM_NAME_TransformMethod: _bindgen_ty_35 = 535;
pub const PDF_ENUM_NAME_TransformParams: _bindgen_ty_35 = 536;
pub const PDF_ENUM_NAME_Transparency: _bindgen_ty_35 = 537;
pub const PDF_ENUM_NAME_TrapNet: _bindgen_ty_35 = 538;
pub const PDF_ENUM_NAME_TrimBox: _bindgen_ty_35 = 539;
pub const PDF_ENUM_NAME_TrueType: _bindgen_ty_35 = 540;
pub const PDF_ENUM_NAME_TrustedMode: _bindgen_ty_35 = 541;
pub const PDF_ENUM_NAME_Tx: _bindgen_ty_35 = 542;
pub const PDF_ENUM_NAME_Type: _bindgen_ty_35 = 543;
pub const PDF_ENUM_NAME_Type0: _bindgen_ty_35 = 544;
pub const PDF_ENUM_NAME_Type1: _bindgen_ty_35 = 545;
pub const PDF_ENUM_NAME_Type1C: _bindgen_ty_35 = 546;
pub const PDF_ENUM_NAME_Type3: _bindgen_ty_35 = 547;
pub const PDF_ENUM_NAME_U: _bindgen_ty_35 = 548;
pub const PDF_ENUM_NAME_UE: _bindgen_ty_35 = 549;
pub const PDF_ENUM_NAME_UF: _bindgen_ty_35 = 550;
pub const PDF_ENUM_NAME_URI: _bindgen_ty_35 = 551;
pub const PDF_ENUM_NAME_URL: _bindgen_ty_35 = 552;
pub const PDF_ENUM_NAME_Unchanged: _bindgen_ty_35 = 553;
pub const PDF_ENUM_NAME_Uncover: _bindgen_ty_35 = 554;
pub const PDF_ENUM_NAME_Underline: _bindgen_ty_35 = 555;
pub const PDF_ENUM_NAME_Unix: _bindgen_ty_35 = 556;
pub const PDF_ENUM_NAME_Unspecified: _bindgen_ty_35 = 557;
pub const PDF_ENUM_NAME_Usage: _bindgen_ty_35 = 558;
pub const PDF_ENUM_NAME_UseBlackPtComp: _bindgen_ty_35 = 559;
pub const PDF_ENUM_NAME_UseCMap: _bindgen_ty_35 = 560;
pub const PDF_ENUM_NAME_UseOutlines: _bindgen_ty_35 = 561;
pub const PDF_ENUM_NAME_UserUnit: _bindgen_ty_35 = 562;
pub const PDF_ENUM_NAME_V: _bindgen_ty_35 = 563;
pub const PDF_ENUM_NAME_V2: _bindgen_ty_35 = 564;
pub const PDF_ENUM_NAME_VE: _bindgen_ty_35 = 565;
pub const PDF_ENUM_NAME_Version: _bindgen_ty_35 = 566;
pub const PDF_ENUM_NAME_Vertices: _bindgen_ty_35 = 567;
pub const PDF_ENUM_NAME_VerticesPerRow: _bindgen_ty_35 = 568;
pub const PDF_ENUM_NAME_View: _bindgen_ty_35 = 569;
pub const PDF_ENUM_NAME_W: _bindgen_ty_35 = 570;
pub const PDF_ENUM_NAME_W2: _bindgen_ty_35 = 571;
pub const PDF_ENUM_NAME_WMode: _bindgen_ty_35 = 572;
pub const PDF_ENUM_NAME_WP: _bindgen_ty_35 = 573;
pub const PDF_ENUM_NAME_WT: _bindgen_ty_35 = 574;
pub const PDF_ENUM_NAME_Warichu: _bindgen_ty_35 = 575;
pub const PDF_ENUM_NAME_Watermark: _bindgen_ty_35 = 576;
pub const PDF_ENUM_NAME_WhitePoint: _bindgen_ty_35 = 577;
pub const PDF_ENUM_NAME_Widget: _bindgen_ty_35 = 578;
pub const PDF_ENUM_NAME_Width: _bindgen_ty_35 = 579;
pub const PDF_ENUM_NAME_Widths: _bindgen_ty_35 = 580;
pub const PDF_ENUM_NAME_WinAnsiEncoding: _bindgen_ty_35 = 581;
pub const PDF_ENUM_NAME_Wipe: _bindgen_ty_35 = 582;
pub const PDF_ENUM_NAME_XFA: _bindgen_ty_35 = 583;
pub const PDF_ENUM_NAME_XHeight: _bindgen_ty_35 = 584;
pub const PDF_ENUM_NAME_XML: _bindgen_ty_35 = 585;
pub const PDF_ENUM_NAME_XObject: _bindgen_ty_35 = 586;
pub const PDF_ENUM_NAME_XRef: _bindgen_ty_35 = 587;
pub const PDF_ENUM_NAME_XRefStm: _bindgen_ty_35 = 588;
pub const PDF_ENUM_NAME_XStep: _bindgen_ty_35 = 589;
pub const PDF_ENUM_NAME_XYZ: _bindgen_ty_35 = 590;
pub const PDF_ENUM_NAME_YStep: _bindgen_ty_35 = 591;
pub const PDF_ENUM_NAME_Yes: _bindgen_ty_35 = 592;
pub const PDF_ENUM_NAME_ZaDb: _bindgen_ty_35 = 593;
pub const PDF_ENUM_NAME_a: _bindgen_ty_35 = 594;
pub const PDF_ENUM_NAME_adbe_pkcs7_detached: _bindgen_ty_35 = 595;
pub const PDF_ENUM_NAME_ca: _bindgen_ty_35 = 596;
pub const PDF_ENUM_NAME_n0: _bindgen_ty_35 = 597;
pub const PDF_ENUM_NAME_n1: _bindgen_ty_35 = 598;
pub const PDF_ENUM_NAME_n2: _bindgen_ty_35 = 599;
pub const PDF_ENUM_NAME_op: _bindgen_ty_35 = 600;
pub const PDF_ENUM_NAME_r: _bindgen_ty_35 = 601;
pub const PDF_ENUM_LIMIT: _bindgen_ty_35 = 602;
pub type _bindgen_ty_35 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_set_str_len(ctx: *mut fz_context, obj: *mut pdf_obj, newlen: usize);
}
unsafe extern "C" {
    pub fn pdf_enable_journal(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_begin_operation(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        operation: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_begin_implicit_operation(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_end_operation(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_abandon_operation(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_undoredo_state(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        steps: *mut ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_undoredo_step(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        step: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_can_undo(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_can_redo(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_undo(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_redo(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_discard_journal(ctx: *mut fz_context, journal: *mut pdf_journal);
}
unsafe extern "C" {
    pub fn pdf_drop_journal(ctx: *mut fz_context, journal: *mut pdf_journal);
}
unsafe extern "C" {
    pub fn pdf_serialise_journal(ctx: *mut fz_context, doc: *mut pdf_document, out: *mut fz_output);
}
unsafe extern "C" {
    pub fn pdf_deserialise_journal(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        stm: *mut fz_stream,
    );
}
unsafe extern "C" {
    pub fn pdf_add_journal_fragment(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        parent: ::core::ffi::c_int,
        copy: *mut pdf_obj,
        copy_stream: *mut fz_buffer,
        newobj: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_format_date(
        ctx: *mut fz_context,
        time: i64,
        s: *mut ::core::ffi::c_char,
        n: usize,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_parse_date(ctx: *mut fz_context, s: *const ::core::ffi::c_char) -> i64;
}
unsafe extern "C" {
    pub fn pdf_is_image_stream(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_ocg_descriptor {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_annot {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_js {
    _unused: [u8; 0],
}
pub const PDF_LEXBUF_SMALL: _bindgen_ty_36 = 256;
pub const PDF_LEXBUF_LARGE: _bindgen_ty_36 = 65536;
pub type _bindgen_ty_36 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_lexbuf {
    pub size: usize,
    pub base_size: usize,
    pub len: usize,
    pub i: i64,
    pub f: f32,
    pub scratch: *mut ::core::ffi::c_char,
    pub buffer: [::core::ffi::c_char; 256usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_lexbuf"][::core::mem::size_of::<pdf_lexbuf>() - 304usize];
    ["Alignment of pdf_lexbuf"][::core::mem::align_of::<pdf_lexbuf>() - 8usize];
    ["Offset of field: pdf_lexbuf::size"][::core::mem::offset_of!(pdf_lexbuf, size) - 0usize];
    ["Offset of field: pdf_lexbuf::base_size"]
        [::core::mem::offset_of!(pdf_lexbuf, base_size) - 8usize];
    ["Offset of field: pdf_lexbuf::len"][::core::mem::offset_of!(pdf_lexbuf, len) - 16usize];
    ["Offset of field: pdf_lexbuf::i"][::core::mem::offset_of!(pdf_lexbuf, i) - 24usize];
    ["Offset of field: pdf_lexbuf::f"][::core::mem::offset_of!(pdf_lexbuf, f) - 32usize];
    ["Offset of field: pdf_lexbuf::scratch"]
        [::core::mem::offset_of!(pdf_lexbuf, scratch) - 40usize];
    ["Offset of field: pdf_lexbuf::buffer"][::core::mem::offset_of!(pdf_lexbuf, buffer) - 48usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_lexbuf_large {
    pub base: pdf_lexbuf,
    pub buffer: [::core::ffi::c_char; 65280usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_lexbuf_large"][::core::mem::size_of::<pdf_lexbuf_large>() - 65584usize];
    ["Alignment of pdf_lexbuf_large"][::core::mem::align_of::<pdf_lexbuf_large>() - 8usize];
    ["Offset of field: pdf_lexbuf_large::base"]
        [::core::mem::offset_of!(pdf_lexbuf_large, base) - 0usize];
    ["Offset of field: pdf_lexbuf_large::buffer"]
        [::core::mem::offset_of!(pdf_lexbuf_large, buffer) - 304usize];
};
pub type pdf_doc_event_cb = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        evt: *mut pdf_doc_event,
        data: *mut ::core::ffi::c_void,
    ),
>;
pub type pdf_free_doc_event_data_cb = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, data: *mut ::core::ffi::c_void),
>;
pub type pdf_js_console_drop_cb = ::core::option::Option<
    unsafe extern "C" fn(console: *mut pdf_js_console, user: *mut ::core::ffi::c_void),
>;
pub type pdf_js_console_show_cb =
    ::core::option::Option<unsafe extern "C" fn(user: *mut ::core::ffi::c_void)>;
pub type pdf_js_console_hide_cb =
    ::core::option::Option<unsafe extern "C" fn(user: *mut ::core::ffi::c_void)>;
pub type pdf_js_console_clear_cb =
    ::core::option::Option<unsafe extern "C" fn(user: *mut ::core::ffi::c_void)>;
pub type pdf_js_console_write_cb = ::core::option::Option<
    unsafe extern "C" fn(user: *mut ::core::ffi::c_void, msg: *const ::core::ffi::c_char),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_js_console {
    pub drop: pdf_js_console_drop_cb,
    pub show: pdf_js_console_show_cb,
    pub hide: pdf_js_console_hide_cb,
    pub clear: pdf_js_console_clear_cb,
    pub write: pdf_js_console_write_cb,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_js_console"][::core::mem::size_of::<pdf_js_console>() - 40usize];
    ["Alignment of pdf_js_console"][::core::mem::align_of::<pdf_js_console>() - 8usize];
    ["Offset of field: pdf_js_console::drop"]
        [::core::mem::offset_of!(pdf_js_console, drop) - 0usize];
    ["Offset of field: pdf_js_console::show"]
        [::core::mem::offset_of!(pdf_js_console, show) - 8usize];
    ["Offset of field: pdf_js_console::hide"]
        [::core::mem::offset_of!(pdf_js_console, hide) - 16usize];
    ["Offset of field: pdf_js_console::clear"]
        [::core::mem::offset_of!(pdf_js_console, clear) - 24usize];
    ["Offset of field: pdf_js_console::write"]
        [::core::mem::offset_of!(pdf_js_console, write) - 32usize];
};
unsafe extern "C" {
    pub fn pdf_js_get_console(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut pdf_js_console;
}
unsafe extern "C" {
    pub fn pdf_js_set_console(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        console: *mut pdf_js_console,
        user: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn pdf_open_document(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
    ) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_open_document_with_stream(
        ctx: *mut fz_context,
        file: *mut fz_stream,
    ) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_drop_document(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_keep_document(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_check_document(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_specifics(ctx: *mut fz_context, doc: *mut fz_document) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_document_from_fz_document(
        ctx: *mut fz_context,
        ptr: *mut fz_document,
    ) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_page_from_fz_page(ctx: *mut fz_context, ptr: *mut fz_page) -> *mut pdf_page;
}
unsafe extern "C" {
    pub fn fz_new_pdf_document_from_fz_document(
        ctx: *mut fz_context,
        ptr: *mut fz_document,
    ) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn pdf_needs_password(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_authenticate_password(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        pw: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_has_permission(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        p: fz_permission,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_lookup_metadata(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        key: *const ::core::ffi::c_char,
        ptr: *mut ::core::ffi::c_char,
        size: usize,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_load_outline(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut fz_outline;
}
unsafe extern "C" {
    pub fn pdf_new_outline_iterator(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> *mut fz_outline_iterator;
}
unsafe extern "C" {
    pub fn pdf_invalidate_xfa(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_count_layer_configs(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_count_layers(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_layer_name(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        layer: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_layer_is_enabled(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        layer: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_enable_layer(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        layer: ::core::ffi::c_int,
        enabled: ::core::ffi::c_int,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_layer_config {
    pub name: *const ::core::ffi::c_char,
    pub creator: *const ::core::ffi::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_layer_config"][::core::mem::size_of::<pdf_layer_config>() - 16usize];
    ["Alignment of pdf_layer_config"][::core::mem::align_of::<pdf_layer_config>() - 8usize];
    ["Offset of field: pdf_layer_config::name"]
        [::core::mem::offset_of!(pdf_layer_config, name) - 0usize];
    ["Offset of field: pdf_layer_config::creator"]
        [::core::mem::offset_of!(pdf_layer_config, creator) - 8usize];
};
unsafe extern "C" {
    pub fn pdf_layer_config_info(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        config_num: ::core::ffi::c_int,
        info: *mut pdf_layer_config,
    );
}
unsafe extern "C" {
    pub fn pdf_layer_config_creator(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        config_num: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_layer_config_name(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        config_num: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_select_layer_config(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        config_num: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_count_layer_config_ui(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_select_layer_config_ui(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        ui: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_deselect_layer_config_ui(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        ui: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_toggle_layer_config_ui(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        ui: ::core::ffi::c_int,
    );
}
pub const PDF_LAYER_UI_LABEL: pdf_layer_config_ui_type = 0;
pub const PDF_LAYER_UI_CHECKBOX: pdf_layer_config_ui_type = 1;
pub const PDF_LAYER_UI_RADIOBOX: pdf_layer_config_ui_type = 2;
pub type pdf_layer_config_ui_type = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_layer_config_ui_type_to_string(
        type_: pdf_layer_config_ui_type,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_layer_config_ui_type_from_string(
        str_: *const ::core::ffi::c_char,
    ) -> pdf_layer_config_ui_type;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_layer_config_ui {
    pub text: *const ::core::ffi::c_char,
    pub depth: ::core::ffi::c_int,
    pub type_: pdf_layer_config_ui_type,
    pub selected: ::core::ffi::c_int,
    pub locked: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_layer_config_ui"][::core::mem::size_of::<pdf_layer_config_ui>() - 24usize];
    ["Alignment of pdf_layer_config_ui"][::core::mem::align_of::<pdf_layer_config_ui>() - 8usize];
    ["Offset of field: pdf_layer_config_ui::text"]
        [::core::mem::offset_of!(pdf_layer_config_ui, text) - 0usize];
    ["Offset of field: pdf_layer_config_ui::depth"]
        [::core::mem::offset_of!(pdf_layer_config_ui, depth) - 8usize];
    ["Offset of field: pdf_layer_config_ui::type_"]
        [::core::mem::offset_of!(pdf_layer_config_ui, type_) - 12usize];
    ["Offset of field: pdf_layer_config_ui::selected"]
        [::core::mem::offset_of!(pdf_layer_config_ui, selected) - 16usize];
    ["Offset of field: pdf_layer_config_ui::locked"]
        [::core::mem::offset_of!(pdf_layer_config_ui, locked) - 20usize];
};
unsafe extern "C" {
    pub fn pdf_layer_config_ui_info(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        ui: ::core::ffi::c_int,
        info: *mut pdf_layer_config_ui,
    );
}
unsafe extern "C" {
    pub fn pdf_set_layer_config_as_default(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_has_unsaved_changes(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_was_repaired(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_unsaved_sig {
    pub field: *mut pdf_obj,
    pub byte_range_start: usize,
    pub byte_range_end: usize,
    pub contents_start: usize,
    pub contents_end: usize,
    pub signer: *mut pdf_pkcs7_signer,
    pub next: *mut pdf_unsaved_sig,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_unsaved_sig"][::core::mem::size_of::<pdf_unsaved_sig>() - 56usize];
    ["Alignment of pdf_unsaved_sig"][::core::mem::align_of::<pdf_unsaved_sig>() - 8usize];
    ["Offset of field: pdf_unsaved_sig::field"]
        [::core::mem::offset_of!(pdf_unsaved_sig, field) - 0usize];
    ["Offset of field: pdf_unsaved_sig::byte_range_start"]
        [::core::mem::offset_of!(pdf_unsaved_sig, byte_range_start) - 8usize];
    ["Offset of field: pdf_unsaved_sig::byte_range_end"]
        [::core::mem::offset_of!(pdf_unsaved_sig, byte_range_end) - 16usize];
    ["Offset of field: pdf_unsaved_sig::contents_start"]
        [::core::mem::offset_of!(pdf_unsaved_sig, contents_start) - 24usize];
    ["Offset of field: pdf_unsaved_sig::contents_end"]
        [::core::mem::offset_of!(pdf_unsaved_sig, contents_end) - 32usize];
    ["Offset of field: pdf_unsaved_sig::signer"]
        [::core::mem::offset_of!(pdf_unsaved_sig, signer) - 40usize];
    ["Offset of field: pdf_unsaved_sig::next"]
        [::core::mem::offset_of!(pdf_unsaved_sig, next) - 48usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_rev_page_map {
    pub page: ::core::ffi::c_int,
    pub object: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_rev_page_map"][::core::mem::size_of::<pdf_rev_page_map>() - 8usize];
    ["Alignment of pdf_rev_page_map"][::core::mem::align_of::<pdf_rev_page_map>() - 4usize];
    ["Offset of field: pdf_rev_page_map::page"]
        [::core::mem::offset_of!(pdf_rev_page_map, page) - 0usize];
    ["Offset of field: pdf_rev_page_map::object"]
        [::core::mem::offset_of!(pdf_rev_page_map, object) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_hint_page {
    pub number: ::core::ffi::c_int,
    pub offset: i64,
    pub index: i64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_hint_page"][::core::mem::size_of::<pdf_hint_page>() - 24usize];
    ["Alignment of pdf_hint_page"][::core::mem::align_of::<pdf_hint_page>() - 8usize];
    ["Offset of field: pdf_hint_page::number"]
        [::core::mem::offset_of!(pdf_hint_page, number) - 0usize];
    ["Offset of field: pdf_hint_page::offset"]
        [::core::mem::offset_of!(pdf_hint_page, offset) - 8usize];
    ["Offset of field: pdf_hint_page::index"]
        [::core::mem::offset_of!(pdf_hint_page, index) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_hint_shared {
    pub number: ::core::ffi::c_int,
    pub offset: i64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_hint_shared"][::core::mem::size_of::<pdf_hint_shared>() - 16usize];
    ["Alignment of pdf_hint_shared"][::core::mem::align_of::<pdf_hint_shared>() - 8usize];
    ["Offset of field: pdf_hint_shared::number"]
        [::core::mem::offset_of!(pdf_hint_shared, number) - 0usize];
    ["Offset of field: pdf_hint_shared::offset"]
        [::core::mem::offset_of!(pdf_hint_shared, offset) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_document {
    pub super_: fz_document,
    pub file: *mut fz_stream,
    pub version: ::core::ffi::c_int,
    pub checked: ::core::ffi::c_int,
    pub is_fdf: ::core::ffi::c_int,
    pub bias: ::core::ffi::c_int,
    pub startxref: i64,
    pub file_size: i64,
    pub crypt: *mut pdf_crypt,
    pub ocg: *mut pdf_ocg_descriptor,
    pub oi: *mut fz_colorspace,
    pub max_xref_len: ::core::ffi::c_int,
    pub num_xref_sections: ::core::ffi::c_int,
    pub saved_num_xref_sections: ::core::ffi::c_int,
    pub num_incremental_sections: ::core::ffi::c_int,
    pub xref_base: ::core::ffi::c_int,
    pub disallow_new_increments: ::core::ffi::c_int,
    pub local_xref: *mut pdf_xref,
    pub local_xref_nesting: ::core::ffi::c_int,
    pub xref_sections: *mut pdf_xref,
    pub saved_xref_sections: *mut pdf_xref,
    pub xref_index: *mut ::core::ffi::c_int,
    pub save_in_progress: ::core::ffi::c_int,
    pub last_xref_was_old_style: ::core::ffi::c_int,
    pub has_linearization_object: ::core::ffi::c_int,
    pub map_page_count: ::core::ffi::c_int,
    pub rev_page_map: *mut pdf_rev_page_map,
    pub fwd_page_map: *mut *mut pdf_obj,
    pub use_page_tree_map: ::core::ffi::c_int,
    pub repair_attempted: ::core::ffi::c_int,
    pub repair_in_progress: ::core::ffi::c_int,
    pub non_structural_change: ::core::ffi::c_int,
    pub file_reading_linearly: ::core::ffi::c_int,
    pub file_length: i64,
    pub linear_page_count: ::core::ffi::c_int,
    pub linear_obj: *mut pdf_obj,
    pub linear_page_refs: *mut *mut pdf_obj,
    pub linear_page1_obj_num: ::core::ffi::c_int,
    pub linear_pos: i64,
    pub linear_page_num: ::core::ffi::c_int,
    pub hint_object_offset: ::core::ffi::c_int,
    pub hint_object_length: ::core::ffi::c_int,
    pub hints_loaded: ::core::ffi::c_int,
    pub hint_page: *mut pdf_hint_page,
    pub hint_shared_ref: *mut ::core::ffi::c_int,
    pub hint_shared: *mut pdf_hint_shared,
    pub hint_obj_offsets_max: ::core::ffi::c_int,
    pub hint_obj_offsets: *mut i64,
    pub lexbuf: pdf_lexbuf_large,
    pub js: *mut pdf_js,
    pub recalculate: ::core::ffi::c_int,
    pub redacted: ::core::ffi::c_int,
    pub resynth_required: ::core::ffi::c_int,
    pub event_cb: pdf_doc_event_cb,
    pub free_event_data_cb: pdf_free_doc_event_data_cb,
    pub event_cb_data: *mut ::core::ffi::c_void,
    pub num_type3_fonts: ::core::ffi::c_int,
    pub max_type3_fonts: ::core::ffi::c_int,
    pub type3_fonts: *mut *mut fz_font,
    pub resources: pdf_document__bindgen_ty_1,
    pub orphans_max: ::core::ffi::c_int,
    pub orphans_count: ::core::ffi::c_int,
    pub orphans: *mut *mut pdf_obj,
    pub xfa: *mut fz_xml_doc,
    pub journal: *mut pdf_journal,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_document__bindgen_ty_1 {
    pub fonts: *mut fz_hash_table,
    pub colorspaces: *mut fz_hash_table,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_document__bindgen_ty_1"]
        [::core::mem::size_of::<pdf_document__bindgen_ty_1>() - 16usize];
    ["Alignment of pdf_document__bindgen_ty_1"]
        [::core::mem::align_of::<pdf_document__bindgen_ty_1>() - 8usize];
    ["Offset of field: pdf_document__bindgen_ty_1::fonts"]
        [::core::mem::offset_of!(pdf_document__bindgen_ty_1, fonts) - 0usize];
    ["Offset of field: pdf_document__bindgen_ty_1::colorspaces"]
        [::core::mem::offset_of!(pdf_document__bindgen_ty_1, colorspaces) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_document"][::core::mem::size_of::<pdf_document>() - 66184usize];
    ["Alignment of pdf_document"][::core::mem::align_of::<pdf_document>() - 8usize];
    ["Offset of field: pdf_document::super_"]
        [::core::mem::offset_of!(pdf_document, super_) - 0usize];
    ["Offset of field: pdf_document::file"][::core::mem::offset_of!(pdf_document, file) - 200usize];
    ["Offset of field: pdf_document::version"]
        [::core::mem::offset_of!(pdf_document, version) - 208usize];
    ["Offset of field: pdf_document::checked"]
        [::core::mem::offset_of!(pdf_document, checked) - 212usize];
    ["Offset of field: pdf_document::is_fdf"]
        [::core::mem::offset_of!(pdf_document, is_fdf) - 216usize];
    ["Offset of field: pdf_document::bias"][::core::mem::offset_of!(pdf_document, bias) - 220usize];
    ["Offset of field: pdf_document::startxref"]
        [::core::mem::offset_of!(pdf_document, startxref) - 224usize];
    ["Offset of field: pdf_document::file_size"]
        [::core::mem::offset_of!(pdf_document, file_size) - 232usize];
    ["Offset of field: pdf_document::crypt"]
        [::core::mem::offset_of!(pdf_document, crypt) - 240usize];
    ["Offset of field: pdf_document::ocg"][::core::mem::offset_of!(pdf_document, ocg) - 248usize];
    ["Offset of field: pdf_document::oi"][::core::mem::offset_of!(pdf_document, oi) - 256usize];
    ["Offset of field: pdf_document::max_xref_len"]
        [::core::mem::offset_of!(pdf_document, max_xref_len) - 264usize];
    ["Offset of field: pdf_document::num_xref_sections"]
        [::core::mem::offset_of!(pdf_document, num_xref_sections) - 268usize];
    ["Offset of field: pdf_document::saved_num_xref_sections"]
        [::core::mem::offset_of!(pdf_document, saved_num_xref_sections) - 272usize];
    ["Offset of field: pdf_document::num_incremental_sections"]
        [::core::mem::offset_of!(pdf_document, num_incremental_sections) - 276usize];
    ["Offset of field: pdf_document::xref_base"]
        [::core::mem::offset_of!(pdf_document, xref_base) - 280usize];
    ["Offset of field: pdf_document::disallow_new_increments"]
        [::core::mem::offset_of!(pdf_document, disallow_new_increments) - 284usize];
    ["Offset of field: pdf_document::local_xref"]
        [::core::mem::offset_of!(pdf_document, local_xref) - 288usize];
    ["Offset of field: pdf_document::local_xref_nesting"]
        [::core::mem::offset_of!(pdf_document, local_xref_nesting) - 296usize];
    ["Offset of field: pdf_document::xref_sections"]
        [::core::mem::offset_of!(pdf_document, xref_sections) - 304usize];
    ["Offset of field: pdf_document::saved_xref_sections"]
        [::core::mem::offset_of!(pdf_document, saved_xref_sections) - 312usize];
    ["Offset of field: pdf_document::xref_index"]
        [::core::mem::offset_of!(pdf_document, xref_index) - 320usize];
    ["Offset of field: pdf_document::save_in_progress"]
        [::core::mem::offset_of!(pdf_document, save_in_progress) - 328usize];
    ["Offset of field: pdf_document::last_xref_was_old_style"]
        [::core::mem::offset_of!(pdf_document, last_xref_was_old_style) - 332usize];
    ["Offset of field: pdf_document::has_linearization_object"]
        [::core::mem::offset_of!(pdf_document, has_linearization_object) - 336usize];
    ["Offset of field: pdf_document::map_page_count"]
        [::core::mem::offset_of!(pdf_document, map_page_count) - 340usize];
    ["Offset of field: pdf_document::rev_page_map"]
        [::core::mem::offset_of!(pdf_document, rev_page_map) - 344usize];
    ["Offset of field: pdf_document::fwd_page_map"]
        [::core::mem::offset_of!(pdf_document, fwd_page_map) - 352usize];
    ["Offset of field: pdf_document::use_page_tree_map"]
        [::core::mem::offset_of!(pdf_document, use_page_tree_map) - 360usize];
    ["Offset of field: pdf_document::repair_attempted"]
        [::core::mem::offset_of!(pdf_document, repair_attempted) - 364usize];
    ["Offset of field: pdf_document::repair_in_progress"]
        [::core::mem::offset_of!(pdf_document, repair_in_progress) - 368usize];
    ["Offset of field: pdf_document::non_structural_change"]
        [::core::mem::offset_of!(pdf_document, non_structural_change) - 372usize];
    ["Offset of field: pdf_document::file_reading_linearly"]
        [::core::mem::offset_of!(pdf_document, file_reading_linearly) - 376usize];
    ["Offset of field: pdf_document::file_length"]
        [::core::mem::offset_of!(pdf_document, file_length) - 384usize];
    ["Offset of field: pdf_document::linear_page_count"]
        [::core::mem::offset_of!(pdf_document, linear_page_count) - 392usize];
    ["Offset of field: pdf_document::linear_obj"]
        [::core::mem::offset_of!(pdf_document, linear_obj) - 400usize];
    ["Offset of field: pdf_document::linear_page_refs"]
        [::core::mem::offset_of!(pdf_document, linear_page_refs) - 408usize];
    ["Offset of field: pdf_document::linear_page1_obj_num"]
        [::core::mem::offset_of!(pdf_document, linear_page1_obj_num) - 416usize];
    ["Offset of field: pdf_document::linear_pos"]
        [::core::mem::offset_of!(pdf_document, linear_pos) - 424usize];
    ["Offset of field: pdf_document::linear_page_num"]
        [::core::mem::offset_of!(pdf_document, linear_page_num) - 432usize];
    ["Offset of field: pdf_document::hint_object_offset"]
        [::core::mem::offset_of!(pdf_document, hint_object_offset) - 436usize];
    ["Offset of field: pdf_document::hint_object_length"]
        [::core::mem::offset_of!(pdf_document, hint_object_length) - 440usize];
    ["Offset of field: pdf_document::hints_loaded"]
        [::core::mem::offset_of!(pdf_document, hints_loaded) - 444usize];
    ["Offset of field: pdf_document::hint_page"]
        [::core::mem::offset_of!(pdf_document, hint_page) - 448usize];
    ["Offset of field: pdf_document::hint_shared_ref"]
        [::core::mem::offset_of!(pdf_document, hint_shared_ref) - 456usize];
    ["Offset of field: pdf_document::hint_shared"]
        [::core::mem::offset_of!(pdf_document, hint_shared) - 464usize];
    ["Offset of field: pdf_document::hint_obj_offsets_max"]
        [::core::mem::offset_of!(pdf_document, hint_obj_offsets_max) - 472usize];
    ["Offset of field: pdf_document::hint_obj_offsets"]
        [::core::mem::offset_of!(pdf_document, hint_obj_offsets) - 480usize];
    ["Offset of field: pdf_document::lexbuf"]
        [::core::mem::offset_of!(pdf_document, lexbuf) - 488usize];
    ["Offset of field: pdf_document::js"][::core::mem::offset_of!(pdf_document, js) - 66072usize];
    ["Offset of field: pdf_document::recalculate"]
        [::core::mem::offset_of!(pdf_document, recalculate) - 66080usize];
    ["Offset of field: pdf_document::redacted"]
        [::core::mem::offset_of!(pdf_document, redacted) - 66084usize];
    ["Offset of field: pdf_document::resynth_required"]
        [::core::mem::offset_of!(pdf_document, resynth_required) - 66088usize];
    ["Offset of field: pdf_document::event_cb"]
        [::core::mem::offset_of!(pdf_document, event_cb) - 66096usize];
    ["Offset of field: pdf_document::free_event_data_cb"]
        [::core::mem::offset_of!(pdf_document, free_event_data_cb) - 66104usize];
    ["Offset of field: pdf_document::event_cb_data"]
        [::core::mem::offset_of!(pdf_document, event_cb_data) - 66112usize];
    ["Offset of field: pdf_document::num_type3_fonts"]
        [::core::mem::offset_of!(pdf_document, num_type3_fonts) - 66120usize];
    ["Offset of field: pdf_document::max_type3_fonts"]
        [::core::mem::offset_of!(pdf_document, max_type3_fonts) - 66124usize];
    ["Offset of field: pdf_document::type3_fonts"]
        [::core::mem::offset_of!(pdf_document, type3_fonts) - 66128usize];
    ["Offset of field: pdf_document::resources"]
        [::core::mem::offset_of!(pdf_document, resources) - 66136usize];
    ["Offset of field: pdf_document::orphans_max"]
        [::core::mem::offset_of!(pdf_document, orphans_max) - 66152usize];
    ["Offset of field: pdf_document::orphans_count"]
        [::core::mem::offset_of!(pdf_document, orphans_count) - 66156usize];
    ["Offset of field: pdf_document::orphans"]
        [::core::mem::offset_of!(pdf_document, orphans) - 66160usize];
    ["Offset of field: pdf_document::xfa"][::core::mem::offset_of!(pdf_document, xfa) - 66168usize];
    ["Offset of field: pdf_document::journal"]
        [::core::mem::offset_of!(pdf_document, journal) - 66176usize];
};
unsafe extern "C" {
    pub fn pdf_create_document(ctx: *mut fz_context) -> *mut pdf_document;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_graft_map {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn pdf_graft_object(
        ctx: *mut fz_context,
        dst: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_graft_map(ctx: *mut fz_context, dst: *mut pdf_document) -> *mut pdf_graft_map;
}
unsafe extern "C" {
    pub fn pdf_keep_graft_map(ctx: *mut fz_context, map: *mut pdf_graft_map) -> *mut pdf_graft_map;
}
unsafe extern "C" {
    pub fn pdf_drop_graft_map(ctx: *mut fz_context, map: *mut pdf_graft_map);
}
unsafe extern "C" {
    pub fn pdf_graft_mapped_object(
        ctx: *mut fz_context,
        map: *mut pdf_graft_map,
        obj: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_graft_page(
        ctx: *mut fz_context,
        dst: *mut pdf_document,
        page_to: ::core::ffi::c_int,
        src: *mut pdf_document,
        page_from: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_graft_mapped_page(
        ctx: *mut fz_context,
        map: *mut pdf_graft_map,
        page_to: ::core::ffi::c_int,
        src: *mut pdf_document,
        page_from: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_page_write(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        mediabox: fz_rect,
        presources: *mut *mut pdf_obj,
        pcontents: *mut *mut fz_buffer,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn pdf_new_pdf_device(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        topctm: fz_matrix,
        resources: *mut pdf_obj,
        contents: *mut fz_buffer,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn pdf_add_page(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        mediabox: fz_rect,
        rotate: ::core::ffi::c_int,
        resources: *mut pdf_obj,
        contents: *mut fz_buffer,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_insert_page(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        at: ::core::ffi::c_int,
        page: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_delete_page(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        number: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_delete_page_range(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        start: ::core::ffi::c_int,
        end: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_page_label(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        page: ::core::ffi::c_int,
        buf: *mut ::core::ffi::c_char,
        size: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_page_label_imp(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        page: ::core::ffi::c_int,
        buf: *mut ::core::ffi::c_char,
        size: usize,
    );
}
pub const PDF_PAGE_LABEL_NONE: pdf_page_label_style = 0;
pub const PDF_PAGE_LABEL_DECIMAL: pdf_page_label_style = 68;
pub const PDF_PAGE_LABEL_ROMAN_UC: pdf_page_label_style = 82;
pub const PDF_PAGE_LABEL_ROMAN_LC: pdf_page_label_style = 114;
pub const PDF_PAGE_LABEL_ALPHA_UC: pdf_page_label_style = 65;
pub const PDF_PAGE_LABEL_ALPHA_LC: pdf_page_label_style = 97;
pub type pdf_page_label_style = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_set_page_labels(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        index: ::core::ffi::c_int,
        style: pdf_page_label_style,
        prefix: *const ::core::ffi::c_char,
        start: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_delete_page_labels(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        index: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_document_language(ctx: *mut fz_context, doc: *mut pdf_document) -> fz_text_language;
}
unsafe extern "C" {
    pub fn pdf_set_document_language(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        lang: fz_text_language,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_write_options {
    pub do_incremental: ::core::ffi::c_int,
    pub do_pretty: ::core::ffi::c_int,
    pub do_ascii: ::core::ffi::c_int,
    pub do_compress: ::core::ffi::c_int,
    pub do_compress_images: ::core::ffi::c_int,
    pub do_compress_fonts: ::core::ffi::c_int,
    pub do_decompress: ::core::ffi::c_int,
    pub do_garbage: ::core::ffi::c_int,
    pub do_linear: ::core::ffi::c_int,
    pub do_clean: ::core::ffi::c_int,
    pub do_sanitize: ::core::ffi::c_int,
    pub do_appearance: ::core::ffi::c_int,
    pub do_encrypt: ::core::ffi::c_int,
    pub dont_regenerate_id: ::core::ffi::c_int,
    pub permissions: ::core::ffi::c_int,
    pub opwd_utf8: [::core::ffi::c_char; 128usize],
    pub upwd_utf8: [::core::ffi::c_char; 128usize],
    pub do_snapshot: ::core::ffi::c_int,
    pub do_preserve_metadata: ::core::ffi::c_int,
    pub do_use_objstms: ::core::ffi::c_int,
    pub compression_effort: ::core::ffi::c_int,
    pub do_labels: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_write_options"][::core::mem::size_of::<pdf_write_options>() - 336usize];
    ["Alignment of pdf_write_options"][::core::mem::align_of::<pdf_write_options>() - 4usize];
    ["Offset of field: pdf_write_options::do_incremental"]
        [::core::mem::offset_of!(pdf_write_options, do_incremental) - 0usize];
    ["Offset of field: pdf_write_options::do_pretty"]
        [::core::mem::offset_of!(pdf_write_options, do_pretty) - 4usize];
    ["Offset of field: pdf_write_options::do_ascii"]
        [::core::mem::offset_of!(pdf_write_options, do_ascii) - 8usize];
    ["Offset of field: pdf_write_options::do_compress"]
        [::core::mem::offset_of!(pdf_write_options, do_compress) - 12usize];
    ["Offset of field: pdf_write_options::do_compress_images"]
        [::core::mem::offset_of!(pdf_write_options, do_compress_images) - 16usize];
    ["Offset of field: pdf_write_options::do_compress_fonts"]
        [::core::mem::offset_of!(pdf_write_options, do_compress_fonts) - 20usize];
    ["Offset of field: pdf_write_options::do_decompress"]
        [::core::mem::offset_of!(pdf_write_options, do_decompress) - 24usize];
    ["Offset of field: pdf_write_options::do_garbage"]
        [::core::mem::offset_of!(pdf_write_options, do_garbage) - 28usize];
    ["Offset of field: pdf_write_options::do_linear"]
        [::core::mem::offset_of!(pdf_write_options, do_linear) - 32usize];
    ["Offset of field: pdf_write_options::do_clean"]
        [::core::mem::offset_of!(pdf_write_options, do_clean) - 36usize];
    ["Offset of field: pdf_write_options::do_sanitize"]
        [::core::mem::offset_of!(pdf_write_options, do_sanitize) - 40usize];
    ["Offset of field: pdf_write_options::do_appearance"]
        [::core::mem::offset_of!(pdf_write_options, do_appearance) - 44usize];
    ["Offset of field: pdf_write_options::do_encrypt"]
        [::core::mem::offset_of!(pdf_write_options, do_encrypt) - 48usize];
    ["Offset of field: pdf_write_options::dont_regenerate_id"]
        [::core::mem::offset_of!(pdf_write_options, dont_regenerate_id) - 52usize];
    ["Offset of field: pdf_write_options::permissions"]
        [::core::mem::offset_of!(pdf_write_options, permissions) - 56usize];
    ["Offset of field: pdf_write_options::opwd_utf8"]
        [::core::mem::offset_of!(pdf_write_options, opwd_utf8) - 60usize];
    ["Offset of field: pdf_write_options::upwd_utf8"]
        [::core::mem::offset_of!(pdf_write_options, upwd_utf8) - 188usize];
    ["Offset of field: pdf_write_options::do_snapshot"]
        [::core::mem::offset_of!(pdf_write_options, do_snapshot) - 316usize];
    ["Offset of field: pdf_write_options::do_preserve_metadata"]
        [::core::mem::offset_of!(pdf_write_options, do_preserve_metadata) - 320usize];
    ["Offset of field: pdf_write_options::do_use_objstms"]
        [::core::mem::offset_of!(pdf_write_options, do_use_objstms) - 324usize];
    ["Offset of field: pdf_write_options::compression_effort"]
        [::core::mem::offset_of!(pdf_write_options, compression_effort) - 328usize];
    ["Offset of field: pdf_write_options::do_labels"]
        [::core::mem::offset_of!(pdf_write_options, do_labels) - 332usize];
};
unsafe extern "C" {
    pub static pdf_default_write_options: pdf_write_options;
}
unsafe extern "C" {
    pub fn pdf_parse_write_options(
        ctx: *mut fz_context,
        opts: *mut pdf_write_options,
        args: *const ::core::ffi::c_char,
    ) -> *mut pdf_write_options;
}
unsafe extern "C" {
    pub fn pdf_has_unsaved_sigs(ctx: *mut fz_context, doc: *mut pdf_document)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_write_document(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        out: *mut fz_output,
        opts: *const pdf_write_options,
    );
}
unsafe extern "C" {
    pub fn pdf_save_document(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        filename: *const ::core::ffi::c_char,
        opts: *const pdf_write_options,
    );
}
unsafe extern "C" {
    pub fn pdf_save_snapshot(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_write_snapshot(ctx: *mut fz_context, doc: *mut pdf_document, out: *mut fz_output);
}
unsafe extern "C" {
    pub fn pdf_format_write_options(
        ctx: *mut fz_context,
        buffer: *mut ::core::ffi::c_char,
        buffer_len: usize,
        opts: *const pdf_write_options,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_can_be_saved_incrementally(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_write_journal(ctx: *mut fz_context, doc: *mut pdf_document, out: *mut fz_output);
}
unsafe extern "C" {
    pub fn pdf_save_journal(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_load_journal(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        filename: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_read_journal(ctx: *mut fz_context, doc: *mut pdf_document, stm: *mut fz_stream);
}
unsafe extern "C" {
    pub fn pdf_minimize_document(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_structure_type(
        ctx: *mut fz_context,
        role_map: *mut pdf_obj,
        tag: *mut pdf_obj,
    ) -> fz_structure;
}
unsafe extern "C" {
    pub fn pdf_run_document_structure(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        dev: *mut fz_device,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_count_document_associated_files(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_document_associated_file(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        idx: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_count_page_associated_files(
        ctx: *mut fz_context,
        page: *mut pdf_page,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_page_associated_file(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        idx: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_object_labels {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn pdf_load_object_labels(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> *mut pdf_object_labels;
}
unsafe extern "C" {
    pub fn pdf_drop_object_labels(ctx: *mut fz_context, g: *mut pdf_object_labels);
}
pub type pdf_label_object_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        arg: *mut ::core::ffi::c_void,
        label: *const ::core::ffi::c_char,
    ),
>;
unsafe extern "C" {
    pub fn pdf_label_object(
        ctx: *mut fz_context,
        g: *mut pdf_object_labels,
        num: ::core::ffi::c_int,
        callback: pdf_label_object_fn,
        arg: *mut ::core::ffi::c_void,
    );
}
pub const PDF_TOK_ERROR: pdf_token = 0;
pub const PDF_TOK_EOF: pdf_token = 1;
pub const PDF_TOK_OPEN_ARRAY: pdf_token = 2;
pub const PDF_TOK_CLOSE_ARRAY: pdf_token = 3;
pub const PDF_TOK_OPEN_DICT: pdf_token = 4;
pub const PDF_TOK_CLOSE_DICT: pdf_token = 5;
pub const PDF_TOK_OPEN_BRACE: pdf_token = 6;
pub const PDF_TOK_CLOSE_BRACE: pdf_token = 7;
pub const PDF_TOK_NAME: pdf_token = 8;
pub const PDF_TOK_INT: pdf_token = 9;
pub const PDF_TOK_REAL: pdf_token = 10;
pub const PDF_TOK_STRING: pdf_token = 11;
pub const PDF_TOK_KEYWORD: pdf_token = 12;
pub const PDF_TOK_R: pdf_token = 13;
pub const PDF_TOK_TRUE: pdf_token = 14;
pub const PDF_TOK_FALSE: pdf_token = 15;
pub const PDF_TOK_NULL: pdf_token = 16;
pub const PDF_TOK_OBJ: pdf_token = 17;
pub const PDF_TOK_ENDOBJ: pdf_token = 18;
pub const PDF_TOK_STREAM: pdf_token = 19;
pub const PDF_TOK_ENDSTREAM: pdf_token = 20;
pub const PDF_TOK_XREF: pdf_token = 21;
pub const PDF_TOK_TRAILER: pdf_token = 22;
pub const PDF_TOK_STARTXREF: pdf_token = 23;
pub const PDF_TOK_NEWOBJ: pdf_token = 24;
pub const PDF_NUM_TOKENS: pdf_token = 25;
pub type pdf_token = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_lexbuf_init(ctx: *mut fz_context, lexbuf: *mut pdf_lexbuf, size: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_lexbuf_fin(ctx: *mut fz_context, lexbuf: *mut pdf_lexbuf);
}
unsafe extern "C" {
    pub fn pdf_lexbuf_grow(ctx: *mut fz_context, lexbuf: *mut pdf_lexbuf) -> isize;
}
unsafe extern "C" {
    pub fn pdf_lex(ctx: *mut fz_context, f: *mut fz_stream, lexbuf: *mut pdf_lexbuf) -> pdf_token;
}
unsafe extern "C" {
    pub fn pdf_lex_no_string(
        ctx: *mut fz_context,
        f: *mut fz_stream,
        lexbuf: *mut pdf_lexbuf,
    ) -> pdf_token;
}
unsafe extern "C" {
    pub fn pdf_parse_array(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        f: *mut fz_stream,
        buf: *mut pdf_lexbuf,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_parse_dict(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        f: *mut fz_stream,
        buf: *mut pdf_lexbuf,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_parse_stm_obj(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        f: *mut fz_stream,
        buf: *mut pdf_lexbuf,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_parse_ind_obj(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        f: *mut fz_stream,
        num: *mut ::core::ffi::c_int,
        gen_: *mut ::core::ffi::c_int,
        stm_ofs: *mut i64,
        try_repair: *mut ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_parse_journal_obj(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        stm: *mut fz_stream,
        onum: *mut ::core::ffi::c_int,
        ostm: *mut *mut fz_buffer,
        newobj: *mut ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_append_token(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        tok: ::core::ffi::c_int,
        lex: *mut pdf_lexbuf,
    );
}
unsafe extern "C" {
    pub fn pdf_create_object(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_delete_object(ctx: *mut fz_context, doc: *mut pdf_document, num: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_update_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
        obj: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_update_stream(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        ref_: *mut pdf_obj,
        buf: *mut fz_buffer,
        compressed: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_is_local_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_add_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_object_drop(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_stream(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        buf: *mut fz_buffer,
        obj: *mut pdf_obj,
        compressed: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_new_dict(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_new_array(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        initial: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_xref_entry {
    pub type_: ::core::ffi::c_char,
    pub marked: ::core::ffi::c_uchar,
    pub gen_: ::core::ffi::c_ushort,
    pub num: ::core::ffi::c_int,
    pub ofs: i64,
    pub stm_ofs: i64,
    pub stm_buf: *mut fz_buffer,
    pub obj: *mut pdf_obj,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_xref_entry"][::core::mem::size_of::<pdf_xref_entry>() - 40usize];
    ["Alignment of pdf_xref_entry"][::core::mem::align_of::<pdf_xref_entry>() - 8usize];
    ["Offset of field: pdf_xref_entry::type_"]
        [::core::mem::offset_of!(pdf_xref_entry, type_) - 0usize];
    ["Offset of field: pdf_xref_entry::marked"]
        [::core::mem::offset_of!(pdf_xref_entry, marked) - 1usize];
    ["Offset of field: pdf_xref_entry::gen_"]
        [::core::mem::offset_of!(pdf_xref_entry, gen_) - 2usize];
    ["Offset of field: pdf_xref_entry::num"][::core::mem::offset_of!(pdf_xref_entry, num) - 4usize];
    ["Offset of field: pdf_xref_entry::ofs"][::core::mem::offset_of!(pdf_xref_entry, ofs) - 8usize];
    ["Offset of field: pdf_xref_entry::stm_ofs"]
        [::core::mem::offset_of!(pdf_xref_entry, stm_ofs) - 16usize];
    ["Offset of field: pdf_xref_entry::stm_buf"]
        [::core::mem::offset_of!(pdf_xref_entry, stm_buf) - 24usize];
    ["Offset of field: pdf_xref_entry::obj"]
        [::core::mem::offset_of!(pdf_xref_entry, obj) - 32usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_xref_subsec {
    pub next: *mut pdf_xref_subsec,
    pub len: ::core::ffi::c_int,
    pub start: ::core::ffi::c_int,
    pub table: *mut pdf_xref_entry,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_xref_subsec"][::core::mem::size_of::<pdf_xref_subsec>() - 24usize];
    ["Alignment of pdf_xref_subsec"][::core::mem::align_of::<pdf_xref_subsec>() - 8usize];
    ["Offset of field: pdf_xref_subsec::next"]
        [::core::mem::offset_of!(pdf_xref_subsec, next) - 0usize];
    ["Offset of field: pdf_xref_subsec::len"]
        [::core::mem::offset_of!(pdf_xref_subsec, len) - 8usize];
    ["Offset of field: pdf_xref_subsec::start"]
        [::core::mem::offset_of!(pdf_xref_subsec, start) - 12usize];
    ["Offset of field: pdf_xref_subsec::table"]
        [::core::mem::offset_of!(pdf_xref_subsec, table) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_xref {
    pub num_objects: ::core::ffi::c_int,
    pub subsec: *mut pdf_xref_subsec,
    pub trailer: *mut pdf_obj,
    pub pre_repair_trailer: *mut pdf_obj,
    pub unsaved_sigs: *mut pdf_unsaved_sig,
    pub unsaved_sigs_end: *mut *mut pdf_unsaved_sig,
    pub end_ofs: i64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_xref"][::core::mem::size_of::<pdf_xref>() - 56usize];
    ["Alignment of pdf_xref"][::core::mem::align_of::<pdf_xref>() - 8usize];
    ["Offset of field: pdf_xref::num_objects"]
        [::core::mem::offset_of!(pdf_xref, num_objects) - 0usize];
    ["Offset of field: pdf_xref::subsec"][::core::mem::offset_of!(pdf_xref, subsec) - 8usize];
    ["Offset of field: pdf_xref::trailer"][::core::mem::offset_of!(pdf_xref, trailer) - 16usize];
    ["Offset of field: pdf_xref::pre_repair_trailer"]
        [::core::mem::offset_of!(pdf_xref, pre_repair_trailer) - 24usize];
    ["Offset of field: pdf_xref::unsaved_sigs"]
        [::core::mem::offset_of!(pdf_xref, unsaved_sigs) - 32usize];
    ["Offset of field: pdf_xref::unsaved_sigs_end"]
        [::core::mem::offset_of!(pdf_xref, unsaved_sigs_end) - 40usize];
    ["Offset of field: pdf_xref::end_ofs"][::core::mem::offset_of!(pdf_xref, end_ofs) - 48usize];
};
unsafe extern "C" {
    #[doc = "Retrieve the pdf_xref_entry for a given object.\n\nThis can cause xref reorganisations \\(solidifications etc\\) due to<br>repairs, so all held pdf_xref_entries should be considered<br>invalid after this call \\(other than the returned one\\)."]
    pub fn pdf_cache_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> *mut pdf_xref_entry;
}
unsafe extern "C" {
    pub fn pdf_object_exists(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_count_objects(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    #[doc = "Resolve an indirect object \\(or chain of objects\\).\n\nThis can cause xref reorganisations \\(solidifications etc\\) due to<br>repairs, so all held pdf_xref_entries should be considered<br>invalid after this call \\(other than the returned one\\)."]
    pub fn pdf_resolve_indirect(ctx: *mut fz_context, ref_: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_resolve_indirect_chain(ctx: *mut fz_context, ref_: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    #[doc = "Load a given object.\n\nThis can cause xref reorganisations \\(solidifications etc\\) due to<br>repairs, so all held pdf_xref_entries should be considered<br>invalid after this call \\(other than the returned one\\)."]
    pub fn pdf_load_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_load_unencrypted_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_load_raw_stream_number(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn pdf_load_raw_stream(ctx: *mut fz_context, ref_: *mut pdf_obj) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn pdf_load_stream_number(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn pdf_load_stream(ctx: *mut fz_context, ref_: *mut pdf_obj) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn pdf_open_raw_stream_number(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_open_raw_stream(ctx: *mut fz_context, ref_: *mut pdf_obj) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_open_stream_number(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_open_stream(ctx: *mut fz_context, ref_: *mut pdf_obj) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_open_inline_stream(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        stmobj: *mut pdf_obj,
        length: ::core::ffi::c_int,
        chain: *mut fz_stream,
        params: *mut fz_compression_params,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_load_compressed_stream(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
        worst_case: usize,
    ) -> *mut fz_compressed_buffer;
}
unsafe extern "C" {
    pub fn pdf_load_compressed_inline_image(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        dict: *mut pdf_obj,
        length: ::core::ffi::c_int,
        cstm: *mut fz_stream,
        indexed: ::core::ffi::c_int,
        image: *mut fz_compressed_image,
    );
}
unsafe extern "C" {
    pub fn pdf_open_stream_with_offset(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
        dict: *mut pdf_obj,
        stm_ofs: i64,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_open_contents_stream(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_load_image_stream(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
        params: *mut fz_compression_params,
        truncated: *mut ::core::ffi::c_int,
        worst_case: usize,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn pdf_version(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_trailer(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_set_populating_xref_trailer(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        trailer: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_xref_len(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_metadata(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_get_populating_xref_entry(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        i: ::core::ffi::c_int,
    ) -> *mut pdf_xref_entry;
}
unsafe extern "C" {
    pub fn pdf_get_xref_entry(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        i: ::core::ffi::c_int,
    ) -> *mut pdf_xref_entry;
}
unsafe extern "C" {
    pub fn pdf_xref_entry_map(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        fn_: ::core::option::Option<
            unsafe extern "C" fn(
                arg1: *mut fz_context,
                arg2: *mut pdf_xref_entry,
                i: ::core::ffi::c_int,
                doc: *mut pdf_document,
                arg3: *mut ::core::ffi::c_void,
            ),
        >,
        arg: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn pdf_get_xref_entry_no_change(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        i: ::core::ffi::c_int,
    ) -> *mut pdf_xref_entry;
}
unsafe extern "C" {
    pub fn pdf_get_xref_entry_no_null(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        i: ::core::ffi::c_int,
    ) -> *mut pdf_xref_entry;
}
unsafe extern "C" {
    pub fn pdf_replace_xref(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        entries: *mut pdf_xref_entry,
        n: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_forget_xref(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_get_incremental_xref_entry(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        i: ::core::ffi::c_int,
    ) -> *mut pdf_xref_entry;
}
unsafe extern "C" {
    pub fn pdf_xref_ensure_incremental_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_xref_is_incremental(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_xref_store_unsaved_signature(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
        signer: *mut pdf_pkcs7_signer,
    );
}
unsafe extern "C" {
    pub fn pdf_xref_remove_unsaved_signature(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_xref_obj_is_unsaved_signature(
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_xref_ensure_local_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_obj_is_incremental(ctx: *mut fz_context, obj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_repair_xref(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_ensure_solid_xref(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_mark_xref(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_clear_xref(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_clear_xref_to_mark(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_repair_obj(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        buf: *mut pdf_lexbuf,
        stmofsp: *mut i64,
        stmlenp: *mut i64,
        encrypt: *mut *mut pdf_obj,
        id: *mut *mut pdf_obj,
        page: *mut *mut pdf_obj,
        tmpofs: *mut i64,
        root: *mut *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_progressive_advance(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        pagenum: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_count_versions(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_count_unsaved_versions(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_validate_changes(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        version: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_doc_was_linearized(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_locked_fields {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn pdf_is_field_locked(
        ctx: *mut fz_context,
        locked: *mut pdf_locked_fields,
        name: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_drop_locked_fields(ctx: *mut fz_context, locked: *mut pdf_locked_fields);
}
unsafe extern "C" {
    pub fn pdf_find_locked_fields(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        version: ::core::ffi::c_int,
    ) -> *mut pdf_locked_fields;
}
unsafe extern "C" {
    pub fn pdf_find_locked_fields_for_sig(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        sig: *mut pdf_obj,
    ) -> *mut pdf_locked_fields;
}
unsafe extern "C" {
    pub fn pdf_validate_change_history(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_find_version_for_obj(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_validate_signature(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_was_pure_xfa(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_new_local_xref(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut pdf_xref;
}
unsafe extern "C" {
    pub fn pdf_drop_local_xref(ctx: *mut fz_context, xref: *mut pdf_xref);
}
unsafe extern "C" {
    pub fn pdf_drop_local_xref_and_resources(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_debug_doc_changes(ctx: *mut fz_context, doc: *mut pdf_document);
}
pub const PDF_ENCRYPT_KEEP: _bindgen_ty_37 = 0;
pub const PDF_ENCRYPT_NONE: _bindgen_ty_37 = 1;
pub const PDF_ENCRYPT_RC4_40: _bindgen_ty_37 = 2;
pub const PDF_ENCRYPT_RC4_128: _bindgen_ty_37 = 3;
pub const PDF_ENCRYPT_AES_128: _bindgen_ty_37 = 4;
pub const PDF_ENCRYPT_AES_256: _bindgen_ty_37 = 5;
pub const PDF_ENCRYPT_UNKNOWN: _bindgen_ty_37 = 6;
pub type _bindgen_ty_37 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_new_crypt(
        ctx: *mut fz_context,
        enc: *mut pdf_obj,
        id: *mut pdf_obj,
    ) -> *mut pdf_crypt;
}
unsafe extern "C" {
    pub fn pdf_new_encrypt(
        ctx: *mut fz_context,
        opwd_utf8: *const ::core::ffi::c_char,
        upwd_utf8: *const ::core::ffi::c_char,
        id: *mut pdf_obj,
        permissions: ::core::ffi::c_int,
        algorithm: ::core::ffi::c_int,
    ) -> *mut pdf_crypt;
}
unsafe extern "C" {
    pub fn pdf_drop_crypt(ctx: *mut fz_context, crypt: *mut pdf_crypt);
}
unsafe extern "C" {
    pub fn pdf_crypt_obj(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
        obj: *mut pdf_obj,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_open_crypt(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        crypt: *mut pdf_crypt,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_open_crypt_with_filter(
        ctx: *mut fz_context,
        chain: *mut fz_stream,
        crypt: *mut pdf_crypt,
        name: *mut pdf_obj,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_crypt_version(ctx: *mut fz_context, crypt: *mut pdf_crypt) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_crypt_revision(ctx: *mut fz_context, crypt: *mut pdf_crypt) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_crypt_method(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_crypt_string_method(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_crypt_stream_method(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_crypt_length(ctx: *mut fz_context, crypt: *mut pdf_crypt) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_crypt_permissions(ctx: *mut fz_context, crypt: *mut pdf_crypt)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_crypt_encrypt_metadata(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_crypt_owner_password(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn pdf_crypt_user_password(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn pdf_crypt_owner_encryption(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn pdf_crypt_user_encryption(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn pdf_crypt_permissions_encryption(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
    ) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn pdf_crypt_key(ctx: *mut fz_context, crypt: *mut pdf_crypt) -> *mut ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn pdf_print_crypt(ctx: *mut fz_context, out: *mut fz_output, crypt: *mut pdf_crypt);
}
unsafe extern "C" {
    pub fn pdf_write_digest(
        ctx: *mut fz_context,
        out: *mut fz_output,
        byte_range: *mut pdf_obj,
        field: *mut pdf_obj,
        digest_offset: usize,
        digest_length: usize,
        signer: *mut pdf_pkcs7_signer,
    );
}
pub const PDF_PERM_PRINT: _bindgen_ty_38 = 4;
pub const PDF_PERM_MODIFY: _bindgen_ty_38 = 8;
pub const PDF_PERM_COPY: _bindgen_ty_38 = 16;
pub const PDF_PERM_ANNOTATE: _bindgen_ty_38 = 32;
pub const PDF_PERM_FORM: _bindgen_ty_38 = 256;
pub const PDF_PERM_ACCESSIBILITY: _bindgen_ty_38 = 512;
pub const PDF_PERM_ASSEMBLE: _bindgen_ty_38 = 1024;
pub const PDF_PERM_PRINT_HQ: _bindgen_ty_38 = 2048;
pub type _bindgen_ty_38 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_document_permissions(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_signature_byte_range(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        signature: *mut pdf_obj,
        byte_range: *mut fz_range,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_signature_hash_bytes(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        signature: *mut pdf_obj,
    ) -> *mut fz_stream;
}
unsafe extern "C" {
    pub fn pdf_signature_incremental_change_since_signing(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        signature: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_incremental_change_since_signing_widget(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_signature_contents(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        signature: *mut pdf_obj,
        contents: *mut *mut ::core::ffi::c_char,
    ) -> usize;
}
unsafe extern "C" {
    pub fn pdf_encrypt_data(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
        fmt_str_out: ::core::option::Option<
            unsafe extern "C" fn(
                arg1: *mut fz_context,
                arg2: *mut ::core::ffi::c_void,
                arg3: *const ::core::ffi::c_uchar,
                arg4: usize,
            ),
        >,
        arg: *mut ::core::ffi::c_void,
        s: *const ::core::ffi::c_uchar,
        n: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_encrypted_len(
        ctx: *mut fz_context,
        crypt: *mut pdf_crypt,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
        len: usize,
    ) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_range {
    pub low: ::core::ffi::c_ushort,
    pub high: ::core::ffi::c_ushort,
    pub out: ::core::ffi::c_ushort,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_range"][::core::mem::size_of::<pdf_range>() - 6usize];
    ["Alignment of pdf_range"][::core::mem::align_of::<pdf_range>() - 2usize];
    ["Offset of field: pdf_range::low"][::core::mem::offset_of!(pdf_range, low) - 0usize];
    ["Offset of field: pdf_range::high"][::core::mem::offset_of!(pdf_range, high) - 2usize];
    ["Offset of field: pdf_range::out"][::core::mem::offset_of!(pdf_range, out) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_xrange {
    pub low: ::core::ffi::c_uint,
    pub high: ::core::ffi::c_uint,
    pub out: ::core::ffi::c_uint,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_xrange"][::core::mem::size_of::<pdf_xrange>() - 12usize];
    ["Alignment of pdf_xrange"][::core::mem::align_of::<pdf_xrange>() - 4usize];
    ["Offset of field: pdf_xrange::low"][::core::mem::offset_of!(pdf_xrange, low) - 0usize];
    ["Offset of field: pdf_xrange::high"][::core::mem::offset_of!(pdf_xrange, high) - 4usize];
    ["Offset of field: pdf_xrange::out"][::core::mem::offset_of!(pdf_xrange, out) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_mrange {
    pub low: ::core::ffi::c_uint,
    pub out: ::core::ffi::c_uint,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_mrange"][::core::mem::size_of::<pdf_mrange>() - 8usize];
    ["Alignment of pdf_mrange"][::core::mem::align_of::<pdf_mrange>() - 4usize];
    ["Offset of field: pdf_mrange::low"][::core::mem::offset_of!(pdf_mrange, low) - 0usize];
    ["Offset of field: pdf_mrange::out"][::core::mem::offset_of!(pdf_mrange, out) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cmap_splay {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_cmap {
    pub storable: fz_storable,
    pub cmap_name: [::core::ffi::c_char; 32usize],
    pub usecmap_name: [::core::ffi::c_char; 32usize],
    pub usecmap: *mut pdf_cmap,
    pub wmode: ::core::ffi::c_int,
    pub codespace_len: ::core::ffi::c_int,
    pub codespace: [pdf_cmap__bindgen_ty_1; 40usize],
    pub rlen: ::core::ffi::c_int,
    pub rcap: ::core::ffi::c_int,
    pub ranges: *mut pdf_range,
    pub xlen: ::core::ffi::c_int,
    pub xcap: ::core::ffi::c_int,
    pub xranges: *mut pdf_xrange,
    pub mlen: ::core::ffi::c_int,
    pub mcap: ::core::ffi::c_int,
    pub mranges: *mut pdf_mrange,
    pub dlen: ::core::ffi::c_int,
    pub dcap: ::core::ffi::c_int,
    pub dict: *mut ::core::ffi::c_int,
    pub tlen: ::core::ffi::c_int,
    pub tcap: ::core::ffi::c_int,
    pub ttop: ::core::ffi::c_int,
    pub tree: *mut cmap_splay,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_cmap__bindgen_ty_1 {
    pub n: ::core::ffi::c_int,
    pub low: ::core::ffi::c_uint,
    pub high: ::core::ffi::c_uint,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_cmap__bindgen_ty_1"][::core::mem::size_of::<pdf_cmap__bindgen_ty_1>() - 12usize];
    ["Alignment of pdf_cmap__bindgen_ty_1"]
        [::core::mem::align_of::<pdf_cmap__bindgen_ty_1>() - 4usize];
    ["Offset of field: pdf_cmap__bindgen_ty_1::n"]
        [::core::mem::offset_of!(pdf_cmap__bindgen_ty_1, n) - 0usize];
    ["Offset of field: pdf_cmap__bindgen_ty_1::low"]
        [::core::mem::offset_of!(pdf_cmap__bindgen_ty_1, low) - 4usize];
    ["Offset of field: pdf_cmap__bindgen_ty_1::high"]
        [::core::mem::offset_of!(pdf_cmap__bindgen_ty_1, high) - 8usize];
};
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_cmap"][::core::mem::size_of::<pdf_cmap>() - 672usize];
    ["Alignment of pdf_cmap"][::core::mem::align_of::<pdf_cmap>() - 8usize];
    ["Offset of field: pdf_cmap::storable"][::core::mem::offset_of!(pdf_cmap, storable) - 0usize];
    ["Offset of field: pdf_cmap::cmap_name"]
        [::core::mem::offset_of!(pdf_cmap, cmap_name) - 24usize];
    ["Offset of field: pdf_cmap::usecmap_name"]
        [::core::mem::offset_of!(pdf_cmap, usecmap_name) - 56usize];
    ["Offset of field: pdf_cmap::usecmap"][::core::mem::offset_of!(pdf_cmap, usecmap) - 88usize];
    ["Offset of field: pdf_cmap::wmode"][::core::mem::offset_of!(pdf_cmap, wmode) - 96usize];
    ["Offset of field: pdf_cmap::codespace_len"]
        [::core::mem::offset_of!(pdf_cmap, codespace_len) - 100usize];
    ["Offset of field: pdf_cmap::codespace"]
        [::core::mem::offset_of!(pdf_cmap, codespace) - 104usize];
    ["Offset of field: pdf_cmap::rlen"][::core::mem::offset_of!(pdf_cmap, rlen) - 584usize];
    ["Offset of field: pdf_cmap::rcap"][::core::mem::offset_of!(pdf_cmap, rcap) - 588usize];
    ["Offset of field: pdf_cmap::ranges"][::core::mem::offset_of!(pdf_cmap, ranges) - 592usize];
    ["Offset of field: pdf_cmap::xlen"][::core::mem::offset_of!(pdf_cmap, xlen) - 600usize];
    ["Offset of field: pdf_cmap::xcap"][::core::mem::offset_of!(pdf_cmap, xcap) - 604usize];
    ["Offset of field: pdf_cmap::xranges"][::core::mem::offset_of!(pdf_cmap, xranges) - 608usize];
    ["Offset of field: pdf_cmap::mlen"][::core::mem::offset_of!(pdf_cmap, mlen) - 616usize];
    ["Offset of field: pdf_cmap::mcap"][::core::mem::offset_of!(pdf_cmap, mcap) - 620usize];
    ["Offset of field: pdf_cmap::mranges"][::core::mem::offset_of!(pdf_cmap, mranges) - 624usize];
    ["Offset of field: pdf_cmap::dlen"][::core::mem::offset_of!(pdf_cmap, dlen) - 632usize];
    ["Offset of field: pdf_cmap::dcap"][::core::mem::offset_of!(pdf_cmap, dcap) - 636usize];
    ["Offset of field: pdf_cmap::dict"][::core::mem::offset_of!(pdf_cmap, dict) - 640usize];
    ["Offset of field: pdf_cmap::tlen"][::core::mem::offset_of!(pdf_cmap, tlen) - 648usize];
    ["Offset of field: pdf_cmap::tcap"][::core::mem::offset_of!(pdf_cmap, tcap) - 652usize];
    ["Offset of field: pdf_cmap::ttop"][::core::mem::offset_of!(pdf_cmap, ttop) - 656usize];
    ["Offset of field: pdf_cmap::tree"][::core::mem::offset_of!(pdf_cmap, tree) - 664usize];
};
unsafe extern "C" {
    pub fn pdf_new_cmap(ctx: *mut fz_context) -> *mut pdf_cmap;
}
unsafe extern "C" {
    pub fn pdf_keep_cmap(ctx: *mut fz_context, cmap: *mut pdf_cmap) -> *mut pdf_cmap;
}
unsafe extern "C" {
    pub fn pdf_drop_cmap(ctx: *mut fz_context, cmap: *mut pdf_cmap);
}
unsafe extern "C" {
    pub fn pdf_drop_cmap_imp(ctx: *mut fz_context, cmap: *mut fz_storable);
}
unsafe extern "C" {
    pub fn pdf_cmap_size(ctx: *mut fz_context, cmap: *mut pdf_cmap) -> usize;
}
unsafe extern "C" {
    pub fn pdf_cmap_wmode(ctx: *mut fz_context, cmap: *mut pdf_cmap) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_cmap_wmode(ctx: *mut fz_context, cmap: *mut pdf_cmap, wmode: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_set_usecmap(ctx: *mut fz_context, cmap: *mut pdf_cmap, usecmap: *mut pdf_cmap);
}
unsafe extern "C" {
    pub fn pdf_add_codespace(
        ctx: *mut fz_context,
        cmap: *mut pdf_cmap,
        low: ::core::ffi::c_uint,
        high: ::core::ffi::c_uint,
        n: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_map_range_to_range(
        ctx: *mut fz_context,
        cmap: *mut pdf_cmap,
        srclo: ::core::ffi::c_uint,
        srchi: ::core::ffi::c_uint,
        dstlo: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_map_one_to_many(
        ctx: *mut fz_context,
        cmap: *mut pdf_cmap,
        one: ::core::ffi::c_uint,
        many: *mut ::core::ffi::c_int,
        len: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_sort_cmap(ctx: *mut fz_context, cmap: *mut pdf_cmap);
}
unsafe extern "C" {
    pub fn pdf_lookup_cmap(cmap: *mut pdf_cmap, cpt: ::core::ffi::c_uint) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_lookup_cmap_full(
        cmap: *mut pdf_cmap,
        cpt: ::core::ffi::c_uint,
        out: *mut ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_decode_cmap(
        cmap: *mut pdf_cmap,
        s: *mut ::core::ffi::c_uchar,
        e: *mut ::core::ffi::c_uchar,
        cpt: *mut ::core::ffi::c_uint,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_new_identity_cmap(
        ctx: *mut fz_context,
        wmode: ::core::ffi::c_int,
        bytes: ::core::ffi::c_int,
    ) -> *mut pdf_cmap;
}
unsafe extern "C" {
    pub fn pdf_load_cmap(ctx: *mut fz_context, file: *mut fz_stream) -> *mut pdf_cmap;
}
unsafe extern "C" {
    pub fn pdf_load_system_cmap(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
    ) -> *mut pdf_cmap;
}
unsafe extern "C" {
    pub fn pdf_load_builtin_cmap(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
    ) -> *mut pdf_cmap;
}
unsafe extern "C" {
    pub fn pdf_load_embedded_cmap(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        ref_: *mut pdf_obj,
    ) -> *mut pdf_cmap;
}
pub const PDF_FD_FIXED_PITCH: _bindgen_ty_39 = 1;
pub const PDF_FD_SERIF: _bindgen_ty_39 = 2;
pub const PDF_FD_SYMBOLIC: _bindgen_ty_39 = 4;
pub const PDF_FD_SCRIPT: _bindgen_ty_39 = 8;
pub const PDF_FD_NONSYMBOLIC: _bindgen_ty_39 = 32;
pub const PDF_FD_ITALIC: _bindgen_ty_39 = 64;
pub const PDF_FD_ALL_CAP: _bindgen_ty_39 = 65536;
pub const PDF_FD_SMALL_CAP: _bindgen_ty_39 = 131072;
pub const PDF_FD_FORCE_BOLD: _bindgen_ty_39 = 262144;
pub type _bindgen_ty_39 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_load_encoding(
        estrings: *mut *const ::core::ffi::c_char,
        encoding: *const ::core::ffi::c_char,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_hmtx {
    pub lo: ::core::ffi::c_ushort,
    pub hi: ::core::ffi::c_ushort,
    pub w: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_hmtx"][::core::mem::size_of::<pdf_hmtx>() - 8usize];
    ["Alignment of pdf_hmtx"][::core::mem::align_of::<pdf_hmtx>() - 4usize];
    ["Offset of field: pdf_hmtx::lo"][::core::mem::offset_of!(pdf_hmtx, lo) - 0usize];
    ["Offset of field: pdf_hmtx::hi"][::core::mem::offset_of!(pdf_hmtx, hi) - 2usize];
    ["Offset of field: pdf_hmtx::w"][::core::mem::offset_of!(pdf_hmtx, w) - 4usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_vmtx {
    pub lo: ::core::ffi::c_ushort,
    pub hi: ::core::ffi::c_ushort,
    pub x: ::core::ffi::c_short,
    pub y: ::core::ffi::c_short,
    pub w: ::core::ffi::c_short,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_vmtx"][::core::mem::size_of::<pdf_vmtx>() - 10usize];
    ["Alignment of pdf_vmtx"][::core::mem::align_of::<pdf_vmtx>() - 2usize];
    ["Offset of field: pdf_vmtx::lo"][::core::mem::offset_of!(pdf_vmtx, lo) - 0usize];
    ["Offset of field: pdf_vmtx::hi"][::core::mem::offset_of!(pdf_vmtx, hi) - 2usize];
    ["Offset of field: pdf_vmtx::x"][::core::mem::offset_of!(pdf_vmtx, x) - 4usize];
    ["Offset of field: pdf_vmtx::y"][::core::mem::offset_of!(pdf_vmtx, y) - 6usize];
    ["Offset of field: pdf_vmtx::w"][::core::mem::offset_of!(pdf_vmtx, w) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_font_desc {
    pub storable: fz_storable,
    pub size: usize,
    pub font: *mut fz_font,
    pub flags: ::core::ffi::c_int,
    pub italic_angle: f32,
    pub ascent: f32,
    pub descent: f32,
    pub cap_height: f32,
    pub x_height: f32,
    pub missing_width: f32,
    pub encoding: *mut pdf_cmap,
    pub to_ttf_cmap: *mut pdf_cmap,
    pub cid_to_gid_len: usize,
    pub cid_to_gid: *mut ::core::ffi::c_ushort,
    pub to_unicode: *mut pdf_cmap,
    pub cid_to_ucs_len: usize,
    pub cid_to_ucs: *mut ::core::ffi::c_ushort,
    pub wmode: ::core::ffi::c_int,
    pub hmtx_len: ::core::ffi::c_int,
    pub hmtx_cap: ::core::ffi::c_int,
    pub dhmtx: pdf_hmtx,
    pub hmtx: *mut pdf_hmtx,
    pub vmtx_len: ::core::ffi::c_int,
    pub vmtx_cap: ::core::ffi::c_int,
    pub dvmtx: pdf_vmtx,
    pub vmtx: *mut pdf_vmtx,
    pub is_embedded: ::core::ffi::c_int,
    pub t3loading: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_font_desc"][::core::mem::size_of::<pdf_font_desc>() - 200usize];
    ["Alignment of pdf_font_desc"][::core::mem::align_of::<pdf_font_desc>() - 8usize];
    ["Offset of field: pdf_font_desc::storable"]
        [::core::mem::offset_of!(pdf_font_desc, storable) - 0usize];
    ["Offset of field: pdf_font_desc::size"]
        [::core::mem::offset_of!(pdf_font_desc, size) - 24usize];
    ["Offset of field: pdf_font_desc::font"]
        [::core::mem::offset_of!(pdf_font_desc, font) - 32usize];
    ["Offset of field: pdf_font_desc::flags"]
        [::core::mem::offset_of!(pdf_font_desc, flags) - 40usize];
    ["Offset of field: pdf_font_desc::italic_angle"]
        [::core::mem::offset_of!(pdf_font_desc, italic_angle) - 44usize];
    ["Offset of field: pdf_font_desc::ascent"]
        [::core::mem::offset_of!(pdf_font_desc, ascent) - 48usize];
    ["Offset of field: pdf_font_desc::descent"]
        [::core::mem::offset_of!(pdf_font_desc, descent) - 52usize];
    ["Offset of field: pdf_font_desc::cap_height"]
        [::core::mem::offset_of!(pdf_font_desc, cap_height) - 56usize];
    ["Offset of field: pdf_font_desc::x_height"]
        [::core::mem::offset_of!(pdf_font_desc, x_height) - 60usize];
    ["Offset of field: pdf_font_desc::missing_width"]
        [::core::mem::offset_of!(pdf_font_desc, missing_width) - 64usize];
    ["Offset of field: pdf_font_desc::encoding"]
        [::core::mem::offset_of!(pdf_font_desc, encoding) - 72usize];
    ["Offset of field: pdf_font_desc::to_ttf_cmap"]
        [::core::mem::offset_of!(pdf_font_desc, to_ttf_cmap) - 80usize];
    ["Offset of field: pdf_font_desc::cid_to_gid_len"]
        [::core::mem::offset_of!(pdf_font_desc, cid_to_gid_len) - 88usize];
    ["Offset of field: pdf_font_desc::cid_to_gid"]
        [::core::mem::offset_of!(pdf_font_desc, cid_to_gid) - 96usize];
    ["Offset of field: pdf_font_desc::to_unicode"]
        [::core::mem::offset_of!(pdf_font_desc, to_unicode) - 104usize];
    ["Offset of field: pdf_font_desc::cid_to_ucs_len"]
        [::core::mem::offset_of!(pdf_font_desc, cid_to_ucs_len) - 112usize];
    ["Offset of field: pdf_font_desc::cid_to_ucs"]
        [::core::mem::offset_of!(pdf_font_desc, cid_to_ucs) - 120usize];
    ["Offset of field: pdf_font_desc::wmode"]
        [::core::mem::offset_of!(pdf_font_desc, wmode) - 128usize];
    ["Offset of field: pdf_font_desc::hmtx_len"]
        [::core::mem::offset_of!(pdf_font_desc, hmtx_len) - 132usize];
    ["Offset of field: pdf_font_desc::hmtx_cap"]
        [::core::mem::offset_of!(pdf_font_desc, hmtx_cap) - 136usize];
    ["Offset of field: pdf_font_desc::dhmtx"]
        [::core::mem::offset_of!(pdf_font_desc, dhmtx) - 140usize];
    ["Offset of field: pdf_font_desc::hmtx"]
        [::core::mem::offset_of!(pdf_font_desc, hmtx) - 152usize];
    ["Offset of field: pdf_font_desc::vmtx_len"]
        [::core::mem::offset_of!(pdf_font_desc, vmtx_len) - 160usize];
    ["Offset of field: pdf_font_desc::vmtx_cap"]
        [::core::mem::offset_of!(pdf_font_desc, vmtx_cap) - 164usize];
    ["Offset of field: pdf_font_desc::dvmtx"]
        [::core::mem::offset_of!(pdf_font_desc, dvmtx) - 168usize];
    ["Offset of field: pdf_font_desc::vmtx"]
        [::core::mem::offset_of!(pdf_font_desc, vmtx) - 184usize];
    ["Offset of field: pdf_font_desc::is_embedded"]
        [::core::mem::offset_of!(pdf_font_desc, is_embedded) - 192usize];
    ["Offset of field: pdf_font_desc::t3loading"]
        [::core::mem::offset_of!(pdf_font_desc, t3loading) - 196usize];
};
unsafe extern "C" {
    pub fn pdf_set_font_wmode(
        ctx: *mut fz_context,
        font: *mut pdf_font_desc,
        wmode: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_set_default_hmtx(
        ctx: *mut fz_context,
        font: *mut pdf_font_desc,
        w: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_set_default_vmtx(
        ctx: *mut fz_context,
        font: *mut pdf_font_desc,
        y: ::core::ffi::c_int,
        w: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_add_hmtx(
        ctx: *mut fz_context,
        font: *mut pdf_font_desc,
        lo: ::core::ffi::c_int,
        hi: ::core::ffi::c_int,
        w: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_add_vmtx(
        ctx: *mut fz_context,
        font: *mut pdf_font_desc,
        lo: ::core::ffi::c_int,
        hi: ::core::ffi::c_int,
        x: ::core::ffi::c_int,
        y: ::core::ffi::c_int,
        w: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_end_hmtx(ctx: *mut fz_context, font: *mut pdf_font_desc);
}
unsafe extern "C" {
    pub fn pdf_end_vmtx(ctx: *mut fz_context, font: *mut pdf_font_desc);
}
unsafe extern "C" {
    pub fn pdf_lookup_hmtx(
        ctx: *mut fz_context,
        font: *mut pdf_font_desc,
        cid: ::core::ffi::c_int,
    ) -> pdf_hmtx;
}
unsafe extern "C" {
    pub fn pdf_lookup_vmtx(
        ctx: *mut fz_context,
        font: *mut pdf_font_desc,
        cid: ::core::ffi::c_int,
    ) -> pdf_vmtx;
}
unsafe extern "C" {
    pub fn pdf_load_to_unicode(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        font: *mut pdf_font_desc,
        strings: *mut *const ::core::ffi::c_char,
        collection: *mut ::core::ffi::c_char,
        cmapstm: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_font_cid_to_gid(
        ctx: *mut fz_context,
        fontdesc: *mut pdf_font_desc,
        cid: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_clean_font_name(fontname: *const ::core::ffi::c_char) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_lookup_substitute_font(
        ctx: *mut fz_context,
        mono: ::core::ffi::c_int,
        serif: ::core::ffi::c_int,
        bold: ::core::ffi::c_int,
        italic: ::core::ffi::c_int,
        len: *mut ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn pdf_load_type3_font(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        rdb: *mut pdf_resource_stack,
        obj: *mut pdf_obj,
    ) -> *mut pdf_font_desc;
}
unsafe extern "C" {
    pub fn pdf_load_type3_glyphs(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        fontdesc: *mut pdf_font_desc,
    );
}
unsafe extern "C" {
    pub fn pdf_load_font(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        rdb: *mut pdf_resource_stack,
        obj: *mut pdf_obj,
    ) -> *mut pdf_font_desc;
}
unsafe extern "C" {
    pub fn pdf_load_hail_mary_font(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> *mut pdf_font_desc;
}
unsafe extern "C" {
    pub fn pdf_new_font_desc(ctx: *mut fz_context) -> *mut pdf_font_desc;
}
unsafe extern "C" {
    pub fn pdf_keep_font(ctx: *mut fz_context, fontdesc: *mut pdf_font_desc) -> *mut pdf_font_desc;
}
unsafe extern "C" {
    pub fn pdf_drop_font(ctx: *mut fz_context, font: *mut pdf_font_desc);
}
unsafe extern "C" {
    pub fn pdf_print_font(ctx: *mut fz_context, out: *mut fz_output, fontdesc: *mut pdf_font_desc);
}
unsafe extern "C" {
    pub fn pdf_run_glyph(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        resources: *mut pdf_obj,
        contents: *mut fz_buffer,
        dev: *mut fz_device,
        ctm: fz_matrix,
        gstate: *mut ::core::ffi::c_void,
        default_cs: *mut fz_default_colorspaces,
        fill_gstate: *mut ::core::ffi::c_void,
        stroke_gstate: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn pdf_add_simple_font(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        font: *mut fz_font,
        encoding: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_cid_font(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        font: *mut fz_font,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_cjk_font(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        font: *mut fz_font,
        script: ::core::ffi::c_int,
        wmode: ::core::ffi::c_int,
        serif: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_substitute_font(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        font: *mut fz_font,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_font_writing_supported(
        ctx: *mut fz_context,
        font: *mut fz_font,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_subset_fonts(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        pages_len: ::core::ffi::c_int,
        pages: *const ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_store_item(
        ctx: *mut fz_context,
        key: *mut pdf_obj,
        val: *mut ::core::ffi::c_void,
        itemsize: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_find_item(
        ctx: *mut fz_context,
        drop: fz_store_drop_fn,
        key: *mut pdf_obj,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn pdf_remove_item(ctx: *mut fz_context, drop: fz_store_drop_fn, key: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_empty_store(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_purge_locals_from_store(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_purge_object_from_store(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        num: ::core::ffi::c_int,
    );
}
pub const PDF_SIMPLE_FONT_RESOURCE: _bindgen_ty_40 = 1;
pub const PDF_CID_FONT_RESOURCE: _bindgen_ty_40 = 2;
pub const PDF_CJK_FONT_RESOURCE: _bindgen_ty_40 = 3;
pub type _bindgen_ty_40 = ::core::ffi::c_uint;
pub const PDF_SIMPLE_ENCODING_LATIN: _bindgen_ty_41 = 0;
pub const PDF_SIMPLE_ENCODING_GREEK: _bindgen_ty_41 = 1;
pub const PDF_SIMPLE_ENCODING_CYRILLIC: _bindgen_ty_41 = 2;
pub type _bindgen_ty_41 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_font_resource_key {
    pub digest: [::core::ffi::c_uchar; 16usize],
    pub type_: ::core::ffi::c_int,
    pub encoding: ::core::ffi::c_int,
    pub local_xref: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_font_resource_key"][::core::mem::size_of::<pdf_font_resource_key>() - 28usize];
    ["Alignment of pdf_font_resource_key"]
        [::core::mem::align_of::<pdf_font_resource_key>() - 4usize];
    ["Offset of field: pdf_font_resource_key::digest"]
        [::core::mem::offset_of!(pdf_font_resource_key, digest) - 0usize];
    ["Offset of field: pdf_font_resource_key::type_"]
        [::core::mem::offset_of!(pdf_font_resource_key, type_) - 16usize];
    ["Offset of field: pdf_font_resource_key::encoding"]
        [::core::mem::offset_of!(pdf_font_resource_key, encoding) - 20usize];
    ["Offset of field: pdf_font_resource_key::local_xref"]
        [::core::mem::offset_of!(pdf_font_resource_key, local_xref) - 24usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_colorspace_resource_key {
    pub digest: [::core::ffi::c_uchar; 16usize],
    pub local_xref: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_colorspace_resource_key"]
        [::core::mem::size_of::<pdf_colorspace_resource_key>() - 20usize];
    ["Alignment of pdf_colorspace_resource_key"]
        [::core::mem::align_of::<pdf_colorspace_resource_key>() - 4usize];
    ["Offset of field: pdf_colorspace_resource_key::digest"]
        [::core::mem::offset_of!(pdf_colorspace_resource_key, digest) - 0usize];
    ["Offset of field: pdf_colorspace_resource_key::local_xref"]
        [::core::mem::offset_of!(pdf_colorspace_resource_key, local_xref) - 16usize];
};
unsafe extern "C" {
    pub fn pdf_find_font_resource(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        type_: ::core::ffi::c_int,
        encoding: ::core::ffi::c_int,
        item: *mut fz_font,
        key: *mut pdf_font_resource_key,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_insert_font_resource(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        key: *mut pdf_font_resource_key,
        obj: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_find_colorspace_resource(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        item: *mut fz_colorspace,
        key: *mut pdf_colorspace_resource_key,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_insert_colorspace_resource(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        key: *mut pdf_colorspace_resource_key,
        obj: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_drop_resource_tables(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_purge_local_resources(ctx: *mut fz_context, doc: *mut pdf_document);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_function {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn pdf_eval_function(
        ctx: *mut fz_context,
        func: *mut pdf_function,
        in_: *const f32,
        inlen: ::core::ffi::c_int,
        out: *mut f32,
        outlen: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_keep_function(ctx: *mut fz_context, func: *mut pdf_function) -> *mut pdf_function;
}
unsafe extern "C" {
    pub fn pdf_drop_function(ctx: *mut fz_context, func: *mut pdf_function);
}
unsafe extern "C" {
    pub fn pdf_function_size(ctx: *mut fz_context, func: *mut pdf_function) -> usize;
}
unsafe extern "C" {
    pub fn pdf_load_function(
        ctx: *mut fz_context,
        ref_: *mut pdf_obj,
        in_: ::core::ffi::c_int,
        out: ::core::ffi::c_int,
    ) -> *mut pdf_function;
}
unsafe extern "C" {
    pub fn pdf_document_output_intent(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn pdf_load_colorspace(ctx: *mut fz_context, obj: *mut pdf_obj) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn pdf_is_tint_colorspace(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_load_shading(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> *mut fz_shade;
}
unsafe extern "C" {
    pub fn pdf_sample_shade_function(
        ctx: *mut fz_context,
        samples: *mut f32,
        n: ::core::ffi::c_int,
        funcs: ::core::ffi::c_int,
        func: *mut *mut pdf_function,
        t0: f32,
        t1: f32,
    );
}
unsafe extern "C" {
    pub fn pdf_guess_colorspace_components(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
#[doc = "Function to recolor a single color from a shade."]
pub type pdf_recolor_vertex = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        opaque: *mut ::core::ffi::c_void,
        dst_cs: *mut fz_colorspace,
        d: *mut f32,
        src_cs: *mut fz_colorspace,
        src: *const f32,
    ),
>;
#[doc = "Function to handle recoloring a shade.\n\nCalled with src_cs from the shade. If no recoloring is required, return `NULL`. Otherwise<br>fill in *dst_cs, and return a vertex recolorer."]
pub type pdf_shade_recolorer = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        opaque: *mut ::core::ffi::c_void,
        src_cs: *mut fz_colorspace,
        dst_cs: *mut *mut fz_colorspace,
    ) -> pdf_recolor_vertex,
>;
unsafe extern "C" {
    #[doc = "Recolor a shade."]
    pub fn pdf_recolor_shade(
        ctx: *mut fz_context,
        shade: *mut pdf_obj,
        reshade: pdf_shade_recolorer,
        opaque: *mut ::core::ffi::c_void,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_load_inline_image(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        rdb: *mut pdf_resource_stack,
        dict: *mut pdf_obj,
        file: *mut fz_stream,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    pub fn pdf_is_jpx_image(ctx: *mut fz_context, dict: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_load_image(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    pub fn pdf_add_image(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        image: *mut fz_image,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_add_colorspace(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        cs: *mut fz_colorspace,
    ) -> *mut pdf_obj;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_pattern {
    pub storable: fz_storable,
    pub ismask: ::core::ffi::c_int,
    pub xstep: f32,
    pub ystep: f32,
    pub matrix: fz_matrix,
    pub bbox: fz_rect,
    pub document: *mut pdf_document,
    pub resources: *mut pdf_obj,
    pub contents: *mut pdf_obj,
    pub id: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_pattern"][::core::mem::size_of::<pdf_pattern>() - 112usize];
    ["Alignment of pdf_pattern"][::core::mem::align_of::<pdf_pattern>() - 8usize];
    ["Offset of field: pdf_pattern::storable"]
        [::core::mem::offset_of!(pdf_pattern, storable) - 0usize];
    ["Offset of field: pdf_pattern::ismask"]
        [::core::mem::offset_of!(pdf_pattern, ismask) - 24usize];
    ["Offset of field: pdf_pattern::xstep"][::core::mem::offset_of!(pdf_pattern, xstep) - 28usize];
    ["Offset of field: pdf_pattern::ystep"][::core::mem::offset_of!(pdf_pattern, ystep) - 32usize];
    ["Offset of field: pdf_pattern::matrix"]
        [::core::mem::offset_of!(pdf_pattern, matrix) - 36usize];
    ["Offset of field: pdf_pattern::bbox"][::core::mem::offset_of!(pdf_pattern, bbox) - 60usize];
    ["Offset of field: pdf_pattern::document"]
        [::core::mem::offset_of!(pdf_pattern, document) - 80usize];
    ["Offset of field: pdf_pattern::resources"]
        [::core::mem::offset_of!(pdf_pattern, resources) - 88usize];
    ["Offset of field: pdf_pattern::contents"]
        [::core::mem::offset_of!(pdf_pattern, contents) - 96usize];
    ["Offset of field: pdf_pattern::id"][::core::mem::offset_of!(pdf_pattern, id) - 104usize];
};
unsafe extern "C" {
    pub fn pdf_load_pattern(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
    ) -> *mut pdf_pattern;
}
unsafe extern "C" {
    pub fn pdf_keep_pattern(ctx: *mut fz_context, pat: *mut pdf_pattern) -> *mut pdf_pattern;
}
unsafe extern "C" {
    pub fn pdf_drop_pattern(ctx: *mut fz_context, pat: *mut pdf_pattern);
}
unsafe extern "C" {
    pub fn pdf_new_xobject(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        bbox: fz_rect,
        matrix: fz_matrix,
        res: *mut pdf_obj,
        buffer: *mut fz_buffer,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_update_xobject(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        xobj: *mut pdf_obj,
        bbox: fz_rect,
        mat: fz_matrix,
        res: *mut pdf_obj,
        buffer: *mut fz_buffer,
    );
}
unsafe extern "C" {
    pub fn pdf_xobject_resources(ctx: *mut fz_context, xobj: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_xobject_bbox(ctx: *mut fz_context, xobj: *mut pdf_obj) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_xobject_matrix(ctx: *mut fz_context, xobj: *mut pdf_obj) -> fz_matrix;
}
unsafe extern "C" {
    pub fn pdf_xobject_isolated(ctx: *mut fz_context, xobj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_xobject_knockout(ctx: *mut fz_context, xobj: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_xobject_transparency(ctx: *mut fz_context, xobj: *mut pdf_obj)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_xobject_colorspace(ctx: *mut fz_context, xobj: *mut pdf_obj) -> *mut fz_colorspace;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_gstate {
    _unused: [u8; 0],
}
unsafe extern "C" {
    pub fn pdf_new_processor(
        ctx: *mut fz_context,
        size: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_void;
}
unsafe extern "C" {
    pub fn pdf_keep_processor(
        ctx: *mut fz_context,
        proc_: *mut pdf_processor,
    ) -> *mut pdf_processor;
}
unsafe extern "C" {
    pub fn pdf_close_processor(ctx: *mut fz_context, proc_: *mut pdf_processor);
}
unsafe extern "C" {
    pub fn pdf_drop_processor(ctx: *mut fz_context, proc_: *mut pdf_processor);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_resource_stack {
    pub next: *mut pdf_resource_stack,
    pub resources: *mut pdf_obj,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_resource_stack"][::core::mem::size_of::<pdf_resource_stack>() - 16usize];
    ["Alignment of pdf_resource_stack"][::core::mem::align_of::<pdf_resource_stack>() - 8usize];
    ["Offset of field: pdf_resource_stack::next"]
        [::core::mem::offset_of!(pdf_resource_stack, next) - 0usize];
    ["Offset of field: pdf_resource_stack::resources"]
        [::core::mem::offset_of!(pdf_resource_stack, resources) - 8usize];
};
unsafe extern "C" {
    pub fn pdf_lookup_resource(
        ctx: *mut fz_context,
        stack: *mut pdf_resource_stack,
        type_: *mut pdf_obj,
        name: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
pub const PDF_PROCESSOR_REQUIRES_DECODED_IMAGES: pdf_processor_requirements = 1;
pub type pdf_processor_requirements = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_processor {
    pub refs: ::core::ffi::c_int,
    pub closed: ::core::ffi::c_int,
    pub close_processor: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub drop_processor: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub reset_processor: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub push_resources: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, res: *mut pdf_obj),
    >,
    pub pop_resources: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor) -> *mut pdf_obj,
    >,
    pub op_w: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, linewidth: f32),
    >,
    pub op_j: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            linejoin: ::core::ffi::c_int,
        ),
    >,
    pub op_J: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            linecap: ::core::ffi::c_int,
        ),
    >,
    pub op_M: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, miterlimit: f32),
    >,
    pub op_d: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            array: *mut pdf_obj,
            phase: f32,
        ),
    >,
    pub op_ri: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            intent: *const ::core::ffi::c_char,
        ),
    >,
    pub op_i: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, flatness: f32),
    >,
    pub op_gs_begin: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            extgstate: *mut pdf_obj,
        ),
    >,
    pub op_gs_BM: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            blendmode: *const ::core::ffi::c_char,
        ),
    >,
    pub op_gs_ca: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, alpha: f32),
    >,
    pub op_gs_CA: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, alpha: f32),
    >,
    pub op_gs_SMask: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            smask: *mut pdf_obj,
            smask_cs: *mut fz_colorspace,
            bc: *mut f32,
            luminosity: ::core::ffi::c_int,
            tr: *mut pdf_obj,
        ),
    >,
    pub op_gs_end: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_q: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_Q: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_cm: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            a: f32,
            b: f32,
            c: f32,
            d: f32,
            e: f32,
            f: f32,
        ),
    >,
    pub op_m: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, x: f32, y: f32),
    >,
    pub op_l: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, x: f32, y: f32),
    >,
    pub op_c: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            x1: f32,
            y1: f32,
            x2: f32,
            y2: f32,
            x3: f32,
            y3: f32,
        ),
    >,
    pub op_v: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            x2: f32,
            y2: f32,
            x3: f32,
            y3: f32,
        ),
    >,
    pub op_y: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            x1: f32,
            y1: f32,
            x3: f32,
            y3: f32,
        ),
    >,
    pub op_h: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_re: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            x: f32,
            y: f32,
            w: f32,
            h: f32,
        ),
    >,
    pub op_S: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_s: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_F: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_f: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_fstar: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_B: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_Bstar: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_b: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_bstar: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_n: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_W: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_Wstar: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_BT: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_ET: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_Tc: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, charspace: f32),
    >,
    pub op_Tw: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, wordspace: f32),
    >,
    pub op_Tz: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, scale: f32),
    >,
    pub op_TL: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, leading: f32),
    >,
    pub op_Tf: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            font: *mut pdf_font_desc,
            size: f32,
        ),
    >,
    pub op_Tr: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            render: ::core::ffi::c_int,
        ),
    >,
    pub op_Ts: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, rise: f32),
    >,
    pub op_Td: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, tx: f32, ty: f32),
    >,
    pub op_TD: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, tx: f32, ty: f32),
    >,
    pub op_Tm: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            a: f32,
            b: f32,
            c: f32,
            d: f32,
            e: f32,
            f: f32,
        ),
    >,
    pub op_Tstar: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_TJ: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, array: *mut pdf_obj),
    >,
    pub op_Tj: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            str_: *mut ::core::ffi::c_char,
            len: usize,
        ),
    >,
    pub op_squote: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            str_: *mut ::core::ffi::c_char,
            len: usize,
        ),
    >,
    pub op_dquote: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            aw: f32,
            ac: f32,
            str_: *mut ::core::ffi::c_char,
            len: usize,
        ),
    >,
    pub op_d0: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, wx: f32, wy: f32),
    >,
    pub op_d1: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            wx: f32,
            wy: f32,
            llx: f32,
            lly: f32,
            urx: f32,
            ury: f32,
        ),
    >,
    pub op_CS: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            cs: *mut fz_colorspace,
        ),
    >,
    pub op_cs: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            cs: *mut fz_colorspace,
        ),
    >,
    pub op_SC_pattern: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            pat: *mut pdf_pattern,
            n: ::core::ffi::c_int,
            color: *mut f32,
        ),
    >,
    pub op_sc_pattern: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            pat: *mut pdf_pattern,
            n: ::core::ffi::c_int,
            color: *mut f32,
        ),
    >,
    pub op_SC_shade: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            shade: *mut fz_shade,
        ),
    >,
    pub op_sc_shade: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            shade: *mut fz_shade,
        ),
    >,
    pub op_SC_color: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            n: ::core::ffi::c_int,
            color: *mut f32,
        ),
    >,
    pub op_sc_color: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            n: ::core::ffi::c_int,
            color: *mut f32,
        ),
    >,
    pub op_G: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, g: f32),
    >,
    pub op_g: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, g: f32),
    >,
    pub op_RG: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            r: f32,
            g: f32,
            b: f32,
        ),
    >,
    pub op_rg: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            r: f32,
            g: f32,
            b: f32,
        ),
    >,
    pub op_K: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            c: f32,
            m: f32,
            y: f32,
            k: f32,
        ),
    >,
    pub op_k: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            c: f32,
            m: f32,
            y: f32,
            k: f32,
        ),
    >,
    pub op_BI: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            image: *mut fz_image,
            colorspace_name: *const ::core::ffi::c_char,
        ),
    >,
    pub op_sh: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            shade: *mut fz_shade,
        ),
    >,
    pub op_Do_image: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            image: *mut fz_image,
        ),
    >,
    pub op_Do_form: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            name: *const ::core::ffi::c_char,
            form: *mut pdf_obj,
        ),
    >,
    pub op_MP: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            tag: *const ::core::ffi::c_char,
        ),
    >,
    pub op_DP: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            tag: *const ::core::ffi::c_char,
            raw: *mut pdf_obj,
            cooked: *mut pdf_obj,
        ),
    >,
    pub op_BMC: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            tag: *const ::core::ffi::c_char,
        ),
    >,
    pub op_BDC: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            tag: *const ::core::ffi::c_char,
            raw: *mut pdf_obj,
            cooked: *mut pdf_obj,
        ),
    >,
    pub op_EMC: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_BX: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_EX: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_gs_OP: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            b: ::core::ffi::c_int,
        ),
    >,
    pub op_gs_op: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            b: ::core::ffi::c_int,
        ),
    >,
    pub op_gs_OPM: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            proc_: *mut pdf_processor,
            i: ::core::ffi::c_int,
        ),
    >,
    pub op_gs_UseBlackPtComp: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor, name: *mut pdf_obj),
    >,
    pub op_EOD: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub op_END: ::core::option::Option<
        unsafe extern "C" fn(ctx: *mut fz_context, proc_: *mut pdf_processor),
    >,
    pub usage: *const ::core::ffi::c_char,
    pub hidden: ::core::ffi::c_int,
    pub requirements: pdf_processor_requirements,
    pub rstack: *mut pdf_resource_stack,
    pub chain: *mut pdf_processor,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_processor"][::core::mem::size_of::<pdf_processor>() - 760usize];
    ["Alignment of pdf_processor"][::core::mem::align_of::<pdf_processor>() - 8usize];
    ["Offset of field: pdf_processor::refs"][::core::mem::offset_of!(pdf_processor, refs) - 0usize];
    ["Offset of field: pdf_processor::closed"]
        [::core::mem::offset_of!(pdf_processor, closed) - 4usize];
    ["Offset of field: pdf_processor::close_processor"]
        [::core::mem::offset_of!(pdf_processor, close_processor) - 8usize];
    ["Offset of field: pdf_processor::drop_processor"]
        [::core::mem::offset_of!(pdf_processor, drop_processor) - 16usize];
    ["Offset of field: pdf_processor::reset_processor"]
        [::core::mem::offset_of!(pdf_processor, reset_processor) - 24usize];
    ["Offset of field: pdf_processor::push_resources"]
        [::core::mem::offset_of!(pdf_processor, push_resources) - 32usize];
    ["Offset of field: pdf_processor::pop_resources"]
        [::core::mem::offset_of!(pdf_processor, pop_resources) - 40usize];
    ["Offset of field: pdf_processor::op_w"]
        [::core::mem::offset_of!(pdf_processor, op_w) - 48usize];
    ["Offset of field: pdf_processor::op_j"]
        [::core::mem::offset_of!(pdf_processor, op_j) - 56usize];
    ["Offset of field: pdf_processor::op_J"]
        [::core::mem::offset_of!(pdf_processor, op_J) - 64usize];
    ["Offset of field: pdf_processor::op_M"]
        [::core::mem::offset_of!(pdf_processor, op_M) - 72usize];
    ["Offset of field: pdf_processor::op_d"]
        [::core::mem::offset_of!(pdf_processor, op_d) - 80usize];
    ["Offset of field: pdf_processor::op_ri"]
        [::core::mem::offset_of!(pdf_processor, op_ri) - 88usize];
    ["Offset of field: pdf_processor::op_i"]
        [::core::mem::offset_of!(pdf_processor, op_i) - 96usize];
    ["Offset of field: pdf_processor::op_gs_begin"]
        [::core::mem::offset_of!(pdf_processor, op_gs_begin) - 104usize];
    ["Offset of field: pdf_processor::op_gs_BM"]
        [::core::mem::offset_of!(pdf_processor, op_gs_BM) - 112usize];
    ["Offset of field: pdf_processor::op_gs_ca"]
        [::core::mem::offset_of!(pdf_processor, op_gs_ca) - 120usize];
    ["Offset of field: pdf_processor::op_gs_CA"]
        [::core::mem::offset_of!(pdf_processor, op_gs_CA) - 128usize];
    ["Offset of field: pdf_processor::op_gs_SMask"]
        [::core::mem::offset_of!(pdf_processor, op_gs_SMask) - 136usize];
    ["Offset of field: pdf_processor::op_gs_end"]
        [::core::mem::offset_of!(pdf_processor, op_gs_end) - 144usize];
    ["Offset of field: pdf_processor::op_q"]
        [::core::mem::offset_of!(pdf_processor, op_q) - 152usize];
    ["Offset of field: pdf_processor::op_Q"]
        [::core::mem::offset_of!(pdf_processor, op_Q) - 160usize];
    ["Offset of field: pdf_processor::op_cm"]
        [::core::mem::offset_of!(pdf_processor, op_cm) - 168usize];
    ["Offset of field: pdf_processor::op_m"]
        [::core::mem::offset_of!(pdf_processor, op_m) - 176usize];
    ["Offset of field: pdf_processor::op_l"]
        [::core::mem::offset_of!(pdf_processor, op_l) - 184usize];
    ["Offset of field: pdf_processor::op_c"]
        [::core::mem::offset_of!(pdf_processor, op_c) - 192usize];
    ["Offset of field: pdf_processor::op_v"]
        [::core::mem::offset_of!(pdf_processor, op_v) - 200usize];
    ["Offset of field: pdf_processor::op_y"]
        [::core::mem::offset_of!(pdf_processor, op_y) - 208usize];
    ["Offset of field: pdf_processor::op_h"]
        [::core::mem::offset_of!(pdf_processor, op_h) - 216usize];
    ["Offset of field: pdf_processor::op_re"]
        [::core::mem::offset_of!(pdf_processor, op_re) - 224usize];
    ["Offset of field: pdf_processor::op_S"]
        [::core::mem::offset_of!(pdf_processor, op_S) - 232usize];
    ["Offset of field: pdf_processor::op_s"]
        [::core::mem::offset_of!(pdf_processor, op_s) - 240usize];
    ["Offset of field: pdf_processor::op_F"]
        [::core::mem::offset_of!(pdf_processor, op_F) - 248usize];
    ["Offset of field: pdf_processor::op_f"]
        [::core::mem::offset_of!(pdf_processor, op_f) - 256usize];
    ["Offset of field: pdf_processor::op_fstar"]
        [::core::mem::offset_of!(pdf_processor, op_fstar) - 264usize];
    ["Offset of field: pdf_processor::op_B"]
        [::core::mem::offset_of!(pdf_processor, op_B) - 272usize];
    ["Offset of field: pdf_processor::op_Bstar"]
        [::core::mem::offset_of!(pdf_processor, op_Bstar) - 280usize];
    ["Offset of field: pdf_processor::op_b"]
        [::core::mem::offset_of!(pdf_processor, op_b) - 288usize];
    ["Offset of field: pdf_processor::op_bstar"]
        [::core::mem::offset_of!(pdf_processor, op_bstar) - 296usize];
    ["Offset of field: pdf_processor::op_n"]
        [::core::mem::offset_of!(pdf_processor, op_n) - 304usize];
    ["Offset of field: pdf_processor::op_W"]
        [::core::mem::offset_of!(pdf_processor, op_W) - 312usize];
    ["Offset of field: pdf_processor::op_Wstar"]
        [::core::mem::offset_of!(pdf_processor, op_Wstar) - 320usize];
    ["Offset of field: pdf_processor::op_BT"]
        [::core::mem::offset_of!(pdf_processor, op_BT) - 328usize];
    ["Offset of field: pdf_processor::op_ET"]
        [::core::mem::offset_of!(pdf_processor, op_ET) - 336usize];
    ["Offset of field: pdf_processor::op_Tc"]
        [::core::mem::offset_of!(pdf_processor, op_Tc) - 344usize];
    ["Offset of field: pdf_processor::op_Tw"]
        [::core::mem::offset_of!(pdf_processor, op_Tw) - 352usize];
    ["Offset of field: pdf_processor::op_Tz"]
        [::core::mem::offset_of!(pdf_processor, op_Tz) - 360usize];
    ["Offset of field: pdf_processor::op_TL"]
        [::core::mem::offset_of!(pdf_processor, op_TL) - 368usize];
    ["Offset of field: pdf_processor::op_Tf"]
        [::core::mem::offset_of!(pdf_processor, op_Tf) - 376usize];
    ["Offset of field: pdf_processor::op_Tr"]
        [::core::mem::offset_of!(pdf_processor, op_Tr) - 384usize];
    ["Offset of field: pdf_processor::op_Ts"]
        [::core::mem::offset_of!(pdf_processor, op_Ts) - 392usize];
    ["Offset of field: pdf_processor::op_Td"]
        [::core::mem::offset_of!(pdf_processor, op_Td) - 400usize];
    ["Offset of field: pdf_processor::op_TD"]
        [::core::mem::offset_of!(pdf_processor, op_TD) - 408usize];
    ["Offset of field: pdf_processor::op_Tm"]
        [::core::mem::offset_of!(pdf_processor, op_Tm) - 416usize];
    ["Offset of field: pdf_processor::op_Tstar"]
        [::core::mem::offset_of!(pdf_processor, op_Tstar) - 424usize];
    ["Offset of field: pdf_processor::op_TJ"]
        [::core::mem::offset_of!(pdf_processor, op_TJ) - 432usize];
    ["Offset of field: pdf_processor::op_Tj"]
        [::core::mem::offset_of!(pdf_processor, op_Tj) - 440usize];
    ["Offset of field: pdf_processor::op_squote"]
        [::core::mem::offset_of!(pdf_processor, op_squote) - 448usize];
    ["Offset of field: pdf_processor::op_dquote"]
        [::core::mem::offset_of!(pdf_processor, op_dquote) - 456usize];
    ["Offset of field: pdf_processor::op_d0"]
        [::core::mem::offset_of!(pdf_processor, op_d0) - 464usize];
    ["Offset of field: pdf_processor::op_d1"]
        [::core::mem::offset_of!(pdf_processor, op_d1) - 472usize];
    ["Offset of field: pdf_processor::op_CS"]
        [::core::mem::offset_of!(pdf_processor, op_CS) - 480usize];
    ["Offset of field: pdf_processor::op_cs"]
        [::core::mem::offset_of!(pdf_processor, op_cs) - 488usize];
    ["Offset of field: pdf_processor::op_SC_pattern"]
        [::core::mem::offset_of!(pdf_processor, op_SC_pattern) - 496usize];
    ["Offset of field: pdf_processor::op_sc_pattern"]
        [::core::mem::offset_of!(pdf_processor, op_sc_pattern) - 504usize];
    ["Offset of field: pdf_processor::op_SC_shade"]
        [::core::mem::offset_of!(pdf_processor, op_SC_shade) - 512usize];
    ["Offset of field: pdf_processor::op_sc_shade"]
        [::core::mem::offset_of!(pdf_processor, op_sc_shade) - 520usize];
    ["Offset of field: pdf_processor::op_SC_color"]
        [::core::mem::offset_of!(pdf_processor, op_SC_color) - 528usize];
    ["Offset of field: pdf_processor::op_sc_color"]
        [::core::mem::offset_of!(pdf_processor, op_sc_color) - 536usize];
    ["Offset of field: pdf_processor::op_G"]
        [::core::mem::offset_of!(pdf_processor, op_G) - 544usize];
    ["Offset of field: pdf_processor::op_g"]
        [::core::mem::offset_of!(pdf_processor, op_g) - 552usize];
    ["Offset of field: pdf_processor::op_RG"]
        [::core::mem::offset_of!(pdf_processor, op_RG) - 560usize];
    ["Offset of field: pdf_processor::op_rg"]
        [::core::mem::offset_of!(pdf_processor, op_rg) - 568usize];
    ["Offset of field: pdf_processor::op_K"]
        [::core::mem::offset_of!(pdf_processor, op_K) - 576usize];
    ["Offset of field: pdf_processor::op_k"]
        [::core::mem::offset_of!(pdf_processor, op_k) - 584usize];
    ["Offset of field: pdf_processor::op_BI"]
        [::core::mem::offset_of!(pdf_processor, op_BI) - 592usize];
    ["Offset of field: pdf_processor::op_sh"]
        [::core::mem::offset_of!(pdf_processor, op_sh) - 600usize];
    ["Offset of field: pdf_processor::op_Do_image"]
        [::core::mem::offset_of!(pdf_processor, op_Do_image) - 608usize];
    ["Offset of field: pdf_processor::op_Do_form"]
        [::core::mem::offset_of!(pdf_processor, op_Do_form) - 616usize];
    ["Offset of field: pdf_processor::op_MP"]
        [::core::mem::offset_of!(pdf_processor, op_MP) - 624usize];
    ["Offset of field: pdf_processor::op_DP"]
        [::core::mem::offset_of!(pdf_processor, op_DP) - 632usize];
    ["Offset of field: pdf_processor::op_BMC"]
        [::core::mem::offset_of!(pdf_processor, op_BMC) - 640usize];
    ["Offset of field: pdf_processor::op_BDC"]
        [::core::mem::offset_of!(pdf_processor, op_BDC) - 648usize];
    ["Offset of field: pdf_processor::op_EMC"]
        [::core::mem::offset_of!(pdf_processor, op_EMC) - 656usize];
    ["Offset of field: pdf_processor::op_BX"]
        [::core::mem::offset_of!(pdf_processor, op_BX) - 664usize];
    ["Offset of field: pdf_processor::op_EX"]
        [::core::mem::offset_of!(pdf_processor, op_EX) - 672usize];
    ["Offset of field: pdf_processor::op_gs_OP"]
        [::core::mem::offset_of!(pdf_processor, op_gs_OP) - 680usize];
    ["Offset of field: pdf_processor::op_gs_op"]
        [::core::mem::offset_of!(pdf_processor, op_gs_op) - 688usize];
    ["Offset of field: pdf_processor::op_gs_OPM"]
        [::core::mem::offset_of!(pdf_processor, op_gs_OPM) - 696usize];
    ["Offset of field: pdf_processor::op_gs_UseBlackPtComp"]
        [::core::mem::offset_of!(pdf_processor, op_gs_UseBlackPtComp) - 704usize];
    ["Offset of field: pdf_processor::op_EOD"]
        [::core::mem::offset_of!(pdf_processor, op_EOD) - 712usize];
    ["Offset of field: pdf_processor::op_END"]
        [::core::mem::offset_of!(pdf_processor, op_END) - 720usize];
    ["Offset of field: pdf_processor::usage"]
        [::core::mem::offset_of!(pdf_processor, usage) - 728usize];
    ["Offset of field: pdf_processor::hidden"]
        [::core::mem::offset_of!(pdf_processor, hidden) - 736usize];
    ["Offset of field: pdf_processor::requirements"]
        [::core::mem::offset_of!(pdf_processor, requirements) - 740usize];
    ["Offset of field: pdf_processor::rstack"]
        [::core::mem::offset_of!(pdf_processor, rstack) - 744usize];
    ["Offset of field: pdf_processor::chain"]
        [::core::mem::offset_of!(pdf_processor, chain) - 752usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_csi {
    pub doc: *mut pdf_document,
    pub buf: *mut pdf_lexbuf,
    pub cookie: *mut fz_cookie,
    pub gstate: ::core::ffi::c_int,
    pub xbalance: ::core::ffi::c_int,
    pub in_text: ::core::ffi::c_int,
    pub d1_rect: fz_rect,
    pub obj: *mut pdf_obj,
    pub name: [::core::ffi::c_char; 256usize],
    pub string: [::core::ffi::c_char; 256usize],
    pub string_len: usize,
    pub top: ::core::ffi::c_int,
    pub stack: [f32; 32usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_csi"][::core::mem::size_of::<pdf_csi>() - 720usize];
    ["Alignment of pdf_csi"][::core::mem::align_of::<pdf_csi>() - 8usize];
    ["Offset of field: pdf_csi::doc"][::core::mem::offset_of!(pdf_csi, doc) - 0usize];
    ["Offset of field: pdf_csi::buf"][::core::mem::offset_of!(pdf_csi, buf) - 8usize];
    ["Offset of field: pdf_csi::cookie"][::core::mem::offset_of!(pdf_csi, cookie) - 16usize];
    ["Offset of field: pdf_csi::gstate"][::core::mem::offset_of!(pdf_csi, gstate) - 24usize];
    ["Offset of field: pdf_csi::xbalance"][::core::mem::offset_of!(pdf_csi, xbalance) - 28usize];
    ["Offset of field: pdf_csi::in_text"][::core::mem::offset_of!(pdf_csi, in_text) - 32usize];
    ["Offset of field: pdf_csi::d1_rect"][::core::mem::offset_of!(pdf_csi, d1_rect) - 36usize];
    ["Offset of field: pdf_csi::obj"][::core::mem::offset_of!(pdf_csi, obj) - 56usize];
    ["Offset of field: pdf_csi::name"][::core::mem::offset_of!(pdf_csi, name) - 64usize];
    ["Offset of field: pdf_csi::string"][::core::mem::offset_of!(pdf_csi, string) - 320usize];
    ["Offset of field: pdf_csi::string_len"]
        [::core::mem::offset_of!(pdf_csi, string_len) - 576usize];
    ["Offset of field: pdf_csi::top"][::core::mem::offset_of!(pdf_csi, top) - 584usize];
    ["Offset of field: pdf_csi::stack"][::core::mem::offset_of!(pdf_csi, stack) - 588usize];
};
unsafe extern "C" {
    pub fn pdf_count_q_balance(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        res: *mut pdf_obj,
        stm: *mut pdf_obj,
        prepend: *mut ::core::ffi::c_int,
        append: *mut ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_new_run_processor(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        dev: *mut fz_device,
        ctm: fz_matrix,
        struct_parent: ::core::ffi::c_int,
        usage: *const ::core::ffi::c_char,
        gstate: *mut pdf_gstate,
        default_cs: *mut fz_default_colorspaces,
        cookie: *mut fz_cookie,
        fill_gstate: *mut pdf_gstate,
        stroke_gstate: *mut pdf_gstate,
    ) -> *mut pdf_processor;
}
unsafe extern "C" {
    pub fn pdf_new_buffer_processor(
        ctx: *mut fz_context,
        buffer: *mut fz_buffer,
        ahxencode: ::core::ffi::c_int,
        newlines: ::core::ffi::c_int,
    ) -> *mut pdf_processor;
}
unsafe extern "C" {
    pub fn pdf_reset_processor(ctx: *mut fz_context, proc_: *mut pdf_processor);
}
unsafe extern "C" {
    pub fn pdf_new_output_processor(
        ctx: *mut fz_context,
        out: *mut fz_output,
        ahxencode: ::core::ffi::c_int,
        newlines: ::core::ffi::c_int,
    ) -> *mut pdf_processor;
}
pub type pdf_filter_factory_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        chain: *mut pdf_processor,
        struct_parents: ::core::ffi::c_int,
        transform: fz_matrix,
        options: *mut pdf_filter_options,
        factory_options: *mut ::core::ffi::c_void,
    ) -> *mut pdf_processor,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_filter_factory {
    pub filter: pdf_filter_factory_fn,
    pub options: *mut ::core::ffi::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_filter_factory"][::core::mem::size_of::<pdf_filter_factory>() - 16usize];
    ["Alignment of pdf_filter_factory"][::core::mem::align_of::<pdf_filter_factory>() - 8usize];
    ["Offset of field: pdf_filter_factory::filter"]
        [::core::mem::offset_of!(pdf_filter_factory, filter) - 0usize];
    ["Offset of field: pdf_filter_factory::options"]
        [::core::mem::offset_of!(pdf_filter_factory, options) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_filter_options {
    pub recurse: ::core::ffi::c_int,
    pub instance_forms: ::core::ffi::c_int,
    pub ascii: ::core::ffi::c_int,
    pub no_update: ::core::ffi::c_int,
    pub opaque: *mut ::core::ffi::c_void,
    pub complete: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            buffer: *mut fz_buffer,
            opaque: *mut ::core::ffi::c_void,
        ),
    >,
    pub filters: *mut pdf_filter_factory,
    pub newlines: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_filter_options"][::core::mem::size_of::<pdf_filter_options>() - 48usize];
    ["Alignment of pdf_filter_options"][::core::mem::align_of::<pdf_filter_options>() - 8usize];
    ["Offset of field: pdf_filter_options::recurse"]
        [::core::mem::offset_of!(pdf_filter_options, recurse) - 0usize];
    ["Offset of field: pdf_filter_options::instance_forms"]
        [::core::mem::offset_of!(pdf_filter_options, instance_forms) - 4usize];
    ["Offset of field: pdf_filter_options::ascii"]
        [::core::mem::offset_of!(pdf_filter_options, ascii) - 8usize];
    ["Offset of field: pdf_filter_options::no_update"]
        [::core::mem::offset_of!(pdf_filter_options, no_update) - 12usize];
    ["Offset of field: pdf_filter_options::opaque"]
        [::core::mem::offset_of!(pdf_filter_options, opaque) - 16usize];
    ["Offset of field: pdf_filter_options::complete"]
        [::core::mem::offset_of!(pdf_filter_options, complete) - 24usize];
    ["Offset of field: pdf_filter_options::filters"]
        [::core::mem::offset_of!(pdf_filter_options, filters) - 32usize];
    ["Offset of field: pdf_filter_options::newlines"]
        [::core::mem::offset_of!(pdf_filter_options, newlines) - 40usize];
};
pub const FZ_CULL_PATH_DROP: fz_cull_type = 0;
pub const FZ_CULL_PATH_FILL: fz_cull_type = 1;
pub const FZ_CULL_PATH_STROKE: fz_cull_type = 2;
pub const FZ_CULL_PATH_FILL_STROKE: fz_cull_type = 3;
pub const FZ_CULL_CLIP_PATH_DROP: fz_cull_type = 4;
pub const FZ_CULL_CLIP_PATH_FILL: fz_cull_type = 5;
pub const FZ_CULL_CLIP_PATH_STROKE: fz_cull_type = 6;
pub const FZ_CULL_CLIP_PATH_FILL_STROKE: fz_cull_type = 7;
pub const FZ_CULL_GLYPH: fz_cull_type = 8;
pub const FZ_CULL_IMAGE: fz_cull_type = 9;
pub const FZ_CULL_SHADING: fz_cull_type = 10;
pub type fz_cull_type = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_sanitize_filter_options {
    pub opaque: *mut ::core::ffi::c_void,
    pub image_filter: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            opaque: *mut ::core::ffi::c_void,
            ctm: fz_matrix,
            name: *const ::core::ffi::c_char,
            image: *mut fz_image,
            scissor: fz_rect,
        ) -> *mut fz_image,
    >,
    pub text_filter: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            opaque: *mut ::core::ffi::c_void,
            ucsbuf: *mut ::core::ffi::c_int,
            ucslen: ::core::ffi::c_int,
            trm: fz_matrix,
            ctm: fz_matrix,
            bbox: fz_rect,
            tr: ::core::ffi::c_int,
            ca: f32,
            CA: f32,
        ) -> ::core::ffi::c_int,
    >,
    pub after_text_object: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            opaque: *mut ::core::ffi::c_void,
            doc: *mut pdf_document,
            chain: *mut pdf_processor,
            ctm: fz_matrix,
        ),
    >,
    pub culler: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            opaque: *mut ::core::ffi::c_void,
            bbox: fz_rect,
            type_: fz_cull_type,
        ) -> ::core::ffi::c_int,
    >,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_sanitize_filter_options"]
        [::core::mem::size_of::<pdf_sanitize_filter_options>() - 40usize];
    ["Alignment of pdf_sanitize_filter_options"]
        [::core::mem::align_of::<pdf_sanitize_filter_options>() - 8usize];
    ["Offset of field: pdf_sanitize_filter_options::opaque"]
        [::core::mem::offset_of!(pdf_sanitize_filter_options, opaque) - 0usize];
    ["Offset of field: pdf_sanitize_filter_options::image_filter"]
        [::core::mem::offset_of!(pdf_sanitize_filter_options, image_filter) - 8usize];
    ["Offset of field: pdf_sanitize_filter_options::text_filter"]
        [::core::mem::offset_of!(pdf_sanitize_filter_options, text_filter) - 16usize];
    ["Offset of field: pdf_sanitize_filter_options::after_text_object"]
        [::core::mem::offset_of!(pdf_sanitize_filter_options, after_text_object) - 24usize];
    ["Offset of field: pdf_sanitize_filter_options::culler"]
        [::core::mem::offset_of!(pdf_sanitize_filter_options, culler) - 32usize];
};
unsafe extern "C" {
    pub fn pdf_new_sanitize_filter(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        chain: *mut pdf_processor,
        struct_parents: ::core::ffi::c_int,
        transform: fz_matrix,
        options: *mut pdf_filter_options,
        sopts: *mut ::core::ffi::c_void,
    ) -> *mut pdf_processor;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_vectorize_filter_options {
    pub opaque: *mut ::core::ffi::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_vectorize_filter_options"]
        [::core::mem::size_of::<pdf_vectorize_filter_options>() - 8usize];
    ["Alignment of pdf_vectorize_filter_options"]
        [::core::mem::align_of::<pdf_vectorize_filter_options>() - 8usize];
    ["Offset of field: pdf_vectorize_filter_options::opaque"]
        [::core::mem::offset_of!(pdf_vectorize_filter_options, opaque) - 0usize];
};
unsafe extern "C" {
    pub fn pdf_new_vectorize_filter(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        chain: *mut pdf_processor,
        structparents: ::core::ffi::c_int,
        transform: fz_matrix,
        options: *mut pdf_filter_options,
        vopts: *mut ::core::ffi::c_void,
    ) -> *mut pdf_processor;
}
unsafe extern "C" {
    pub fn pdf_filter_xobject_instance(
        ctx: *mut fz_context,
        old_xobj: *mut pdf_obj,
        page_res: *mut pdf_obj,
        ctm: fz_matrix,
        options: *mut pdf_filter_options,
        cycle_up: *mut pdf_cycle_list,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_processor_push_resources(
        ctx: *mut fz_context,
        proc_: *mut pdf_processor,
        res: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_processor_pop_resources(
        ctx: *mut fz_context,
        proc_: *mut pdf_processor,
    ) -> *mut pdf_obj;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_color_filter_options {
    pub opaque: *mut ::core::ffi::c_void,
    pub color_rewrite: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            opaque: *mut ::core::ffi::c_void,
            cs: *mut *mut pdf_obj,
            n: *mut ::core::ffi::c_int,
            color: *mut f32,
        ),
    >,
    pub image_rewrite: ::core::option::Option<
        unsafe extern "C" fn(
            ctx: *mut fz_context,
            opaque: *mut ::core::ffi::c_void,
            image: *mut *mut fz_image,
            ctm: fz_matrix,
            obj: *mut pdf_obj,
        ),
    >,
    pub shade_rewrite: pdf_shade_recolorer,
    pub repeated_image_rewrite: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_color_filter_options"]
        [::core::mem::size_of::<pdf_color_filter_options>() - 40usize];
    ["Alignment of pdf_color_filter_options"]
        [::core::mem::align_of::<pdf_color_filter_options>() - 8usize];
    ["Offset of field: pdf_color_filter_options::opaque"]
        [::core::mem::offset_of!(pdf_color_filter_options, opaque) - 0usize];
    ["Offset of field: pdf_color_filter_options::color_rewrite"]
        [::core::mem::offset_of!(pdf_color_filter_options, color_rewrite) - 8usize];
    ["Offset of field: pdf_color_filter_options::image_rewrite"]
        [::core::mem::offset_of!(pdf_color_filter_options, image_rewrite) - 16usize];
    ["Offset of field: pdf_color_filter_options::shade_rewrite"]
        [::core::mem::offset_of!(pdf_color_filter_options, shade_rewrite) - 24usize];
    ["Offset of field: pdf_color_filter_options::repeated_image_rewrite"]
        [::core::mem::offset_of!(pdf_color_filter_options, repeated_image_rewrite) - 32usize];
};
unsafe extern "C" {
    pub fn pdf_new_color_filter(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        chain: *mut pdf_processor,
        struct_parents: ::core::ffi::c_int,
        transform: fz_matrix,
        options: *mut pdf_filter_options,
        copts: *mut ::core::ffi::c_void,
    ) -> *mut pdf_processor;
}
unsafe extern "C" {
    pub fn pdf_process_contents(
        ctx: *mut fz_context,
        proc_: *mut pdf_processor,
        doc: *mut pdf_document,
        res: *mut pdf_obj,
        stm: *mut pdf_obj,
        cookie: *mut fz_cookie,
        out_res: *mut *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_process_annot(
        ctx: *mut fz_context,
        proc_: *mut pdf_processor,
        annot: *mut pdf_annot,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_process_glyph(
        ctx: *mut fz_context,
        proc_: *mut pdf_processor,
        doc: *mut pdf_document,
        resources: *mut pdf_obj,
        contents: *mut fz_buffer,
    );
}
unsafe extern "C" {
    pub fn pdf_process_raw_contents(
        ctx: *mut fz_context,
        proc_: *mut pdf_processor,
        doc: *mut pdf_document,
        stmobj: *mut pdf_obj,
        cookie: *mut fz_cookie,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_text_state {
    pub char_space: f32,
    pub word_space: f32,
    pub scale: f32,
    pub leading: f32,
    pub font: *mut pdf_font_desc,
    pub fontname: *mut fz_string,
    pub size: f32,
    pub render: ::core::ffi::c_int,
    pub rise: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_text_state"][::core::mem::size_of::<pdf_text_state>() - 48usize];
    ["Alignment of pdf_text_state"][::core::mem::align_of::<pdf_text_state>() - 8usize];
    ["Offset of field: pdf_text_state::char_space"]
        [::core::mem::offset_of!(pdf_text_state, char_space) - 0usize];
    ["Offset of field: pdf_text_state::word_space"]
        [::core::mem::offset_of!(pdf_text_state, word_space) - 4usize];
    ["Offset of field: pdf_text_state::scale"]
        [::core::mem::offset_of!(pdf_text_state, scale) - 8usize];
    ["Offset of field: pdf_text_state::leading"]
        [::core::mem::offset_of!(pdf_text_state, leading) - 12usize];
    ["Offset of field: pdf_text_state::font"]
        [::core::mem::offset_of!(pdf_text_state, font) - 16usize];
    ["Offset of field: pdf_text_state::fontname"]
        [::core::mem::offset_of!(pdf_text_state, fontname) - 24usize];
    ["Offset of field: pdf_text_state::size"]
        [::core::mem::offset_of!(pdf_text_state, size) - 32usize];
    ["Offset of field: pdf_text_state::render"]
        [::core::mem::offset_of!(pdf_text_state, render) - 36usize];
    ["Offset of field: pdf_text_state::rise"]
        [::core::mem::offset_of!(pdf_text_state, rise) - 40usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_text_object_state {
    pub text: *mut fz_text,
    pub text_bbox: fz_rect,
    pub tlm: fz_matrix,
    pub tm: fz_matrix,
    pub text_mode: ::core::ffi::c_int,
    pub cid: ::core::ffi::c_int,
    pub gid: ::core::ffi::c_int,
    pub char_bbox: fz_rect,
    pub fontdesc: *mut pdf_font_desc,
    pub char_tx: f32,
    pub char_ty: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_text_object_state"][::core::mem::size_of::<pdf_text_object_state>() - 120usize];
    ["Alignment of pdf_text_object_state"]
        [::core::mem::align_of::<pdf_text_object_state>() - 8usize];
    ["Offset of field: pdf_text_object_state::text"]
        [::core::mem::offset_of!(pdf_text_object_state, text) - 0usize];
    ["Offset of field: pdf_text_object_state::text_bbox"]
        [::core::mem::offset_of!(pdf_text_object_state, text_bbox) - 8usize];
    ["Offset of field: pdf_text_object_state::tlm"]
        [::core::mem::offset_of!(pdf_text_object_state, tlm) - 24usize];
    ["Offset of field: pdf_text_object_state::tm"]
        [::core::mem::offset_of!(pdf_text_object_state, tm) - 48usize];
    ["Offset of field: pdf_text_object_state::text_mode"]
        [::core::mem::offset_of!(pdf_text_object_state, text_mode) - 72usize];
    ["Offset of field: pdf_text_object_state::cid"]
        [::core::mem::offset_of!(pdf_text_object_state, cid) - 76usize];
    ["Offset of field: pdf_text_object_state::gid"]
        [::core::mem::offset_of!(pdf_text_object_state, gid) - 80usize];
    ["Offset of field: pdf_text_object_state::char_bbox"]
        [::core::mem::offset_of!(pdf_text_object_state, char_bbox) - 84usize];
    ["Offset of field: pdf_text_object_state::fontdesc"]
        [::core::mem::offset_of!(pdf_text_object_state, fontdesc) - 104usize];
    ["Offset of field: pdf_text_object_state::char_tx"]
        [::core::mem::offset_of!(pdf_text_object_state, char_tx) - 112usize];
    ["Offset of field: pdf_text_object_state::char_ty"]
        [::core::mem::offset_of!(pdf_text_object_state, char_ty) - 116usize];
};
unsafe extern "C" {
    pub fn pdf_tos_save(
        ctx: *mut fz_context,
        tos: *mut pdf_text_object_state,
        save: *mut fz_matrix,
    );
}
unsafe extern "C" {
    pub fn pdf_tos_restore(
        ctx: *mut fz_context,
        tos: *mut pdf_text_object_state,
        save: *mut fz_matrix,
    );
}
unsafe extern "C" {
    pub fn pdf_tos_get_text(ctx: *mut fz_context, tos: *mut pdf_text_object_state) -> *mut fz_text;
}
unsafe extern "C" {
    pub fn pdf_tos_reset(
        ctx: *mut fz_context,
        tos: *mut pdf_text_object_state,
        render: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_tos_make_trm(
        ctx: *mut fz_context,
        tos: *mut pdf_text_object_state,
        text: *mut pdf_text_state,
        fontdesc: *mut pdf_font_desc,
        cid: ::core::ffi::c_int,
        trm: *mut fz_matrix,
        adv: *mut f32,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_tos_move_after_char(ctx: *mut fz_context, tos: *mut pdf_text_object_state);
}
unsafe extern "C" {
    pub fn pdf_tos_translate(tos: *mut pdf_text_object_state, tx: f32, ty: f32);
}
unsafe extern "C" {
    pub fn pdf_tos_set_matrix(
        tos: *mut pdf_text_object_state,
        a: f32,
        b: f32,
        c: f32,
        d: f32,
        e: f32,
        f: f32,
    );
}
unsafe extern "C" {
    pub fn pdf_tos_newline(tos: *mut pdf_text_object_state, leading: f32);
}
unsafe extern "C" {
    pub fn pdf_keep_page(ctx: *mut fz_context, page: *mut pdf_page) -> *mut pdf_page;
}
unsafe extern "C" {
    pub fn pdf_drop_page(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_lookup_page_number(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        pageobj: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_count_pages(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_count_pages_imp(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_lookup_page_obj(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        needle: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_lookup_page_loc(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        needle: ::core::ffi::c_int,
        parentp: *mut *mut pdf_obj,
        indexp: *mut ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_set_page_tree_cache(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        enabled: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_load_page_tree(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_drop_page_tree(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_drop_page_tree_internal(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_flatten_inheritable_page_items(ctx: *mut fz_context, page: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_load_page(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        number: ::core::ffi::c_int,
    ) -> *mut pdf_page;
}
unsafe extern "C" {
    pub fn pdf_load_page_imp(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        chapter: ::core::ffi::c_int,
        number: ::core::ffi::c_int,
    ) -> *mut fz_page;
}
unsafe extern "C" {
    pub fn pdf_page_has_transparency(
        ctx: *mut fz_context,
        page: *mut pdf_page,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_page_obj_transform_box(
        ctx: *mut fz_context,
        pageobj: *mut pdf_obj,
        outbox: *mut fz_rect,
        out: *mut fz_matrix,
        box_: fz_box_type,
    );
}
unsafe extern "C" {
    pub fn pdf_page_obj_transform(
        ctx: *mut fz_context,
        pageobj: *mut pdf_obj,
        outbox: *mut fz_rect,
        outctm: *mut fz_matrix,
    );
}
unsafe extern "C" {
    pub fn pdf_page_transform_box(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        mediabox: *mut fz_rect,
        ctm: *mut fz_matrix,
        box_: fz_box_type,
    );
}
unsafe extern "C" {
    pub fn pdf_page_transform(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        mediabox: *mut fz_rect,
        ctm: *mut fz_matrix,
    );
}
unsafe extern "C" {
    pub fn pdf_page_resources(ctx: *mut fz_context, page: *mut pdf_page) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_page_contents(ctx: *mut fz_context, page: *mut pdf_page) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_page_group(ctx: *mut fz_context, page: *mut pdf_page) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_set_page_box(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        box_: fz_box_type,
        rect: fz_rect,
    );
}
unsafe extern "C" {
    pub fn pdf_page_separations(ctx: *mut fz_context, page: *mut pdf_page) -> *mut fz_separations;
}
unsafe extern "C" {
    pub fn pdf_read_ocg(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut pdf_ocg_descriptor;
}
unsafe extern "C" {
    pub fn pdf_drop_ocg(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_is_ocg_hidden(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        rdb: *mut pdf_resource_stack,
        usage: *const ::core::ffi::c_char,
        ocg: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_load_links(ctx: *mut fz_context, page: *mut pdf_page) -> *mut fz_link;
}
unsafe extern "C" {
    pub fn pdf_bound_page(ctx: *mut fz_context, page: *mut pdf_page, box_: fz_box_type) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_run_page(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_run_page_with_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        usage: *const ::core::ffi::c_char,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_run_page_contents(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_run_page_annots(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_run_page_widgets(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_run_page_contents_with_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        usage: *const ::core::ffi::c_char,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_run_page_annots_with_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        usage: *const ::core::ffi::c_char,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_run_page_widgets_with_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        dev: *mut fz_device,
        ctm: fz_matrix,
        usage: *const ::core::ffi::c_char,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_filter_page_contents(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        page: *mut pdf_page,
        options: *mut pdf_filter_options,
    );
}
unsafe extern "C" {
    pub fn pdf_filter_annot_contents(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        annot: *mut pdf_annot,
        options: *mut pdf_filter_options,
    );
}
unsafe extern "C" {
    pub fn pdf_new_pixmap_from_page_contents_with_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: ::core::ffi::c_int,
        usage: *const ::core::ffi::c_char,
        box_: fz_box_type,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn pdf_new_pixmap_from_page_with_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: ::core::ffi::c_int,
        usage: *const ::core::ffi::c_char,
        box_: fz_box_type,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn pdf_new_pixmap_from_page_contents_with_separations_and_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
        usage: *const ::core::ffi::c_char,
        box_: fz_box_type,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn pdf_new_pixmap_from_page_with_separations_and_usage(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
        usage: *const ::core::ffi::c_char,
        box_: fz_box_type,
    ) -> *mut fz_pixmap;
}
pub const PDF_REDACT_IMAGE_NONE: _bindgen_ty_42 = 0;
pub const PDF_REDACT_IMAGE_REMOVE: _bindgen_ty_42 = 1;
pub const PDF_REDACT_IMAGE_PIXELS: _bindgen_ty_42 = 2;
pub const PDF_REDACT_IMAGE_REMOVE_UNLESS_INVISIBLE: _bindgen_ty_42 = 3;
pub type _bindgen_ty_42 = ::core::ffi::c_uint;
pub const PDF_REDACT_LINE_ART_NONE: _bindgen_ty_43 = 0;
pub const PDF_REDACT_LINE_ART_REMOVE_IF_COVERED: _bindgen_ty_43 = 1;
pub const PDF_REDACT_LINE_ART_REMOVE_IF_TOUCHED: _bindgen_ty_43 = 2;
pub type _bindgen_ty_43 = ::core::ffi::c_uint;
pub const PDF_REDACT_TEXT_REMOVE: _bindgen_ty_44 = 0;
pub const PDF_REDACT_TEXT_NONE: _bindgen_ty_44 = 1;
pub const PDF_REDACT_TEXT_REMOVE_INVISIBLE: _bindgen_ty_44 = 2;
pub type _bindgen_ty_44 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_redact_options {
    pub black_boxes: ::core::ffi::c_int,
    pub image_method: ::core::ffi::c_int,
    pub line_art: ::core::ffi::c_int,
    pub text: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_redact_options"][::core::mem::size_of::<pdf_redact_options>() - 16usize];
    ["Alignment of pdf_redact_options"][::core::mem::align_of::<pdf_redact_options>() - 4usize];
    ["Offset of field: pdf_redact_options::black_boxes"]
        [::core::mem::offset_of!(pdf_redact_options, black_boxes) - 0usize];
    ["Offset of field: pdf_redact_options::image_method"]
        [::core::mem::offset_of!(pdf_redact_options, image_method) - 4usize];
    ["Offset of field: pdf_redact_options::line_art"]
        [::core::mem::offset_of!(pdf_redact_options, line_art) - 8usize];
    ["Offset of field: pdf_redact_options::text"]
        [::core::mem::offset_of!(pdf_redact_options, text) - 12usize];
};
unsafe extern "C" {
    pub fn pdf_redact_page(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        page: *mut pdf_page,
        opts: *mut pdf_redact_options,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_page_presentation(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        transition: *mut fz_transition,
        duration: *mut f32,
    ) -> *mut fz_transition;
}
unsafe extern "C" {
    pub fn pdf_load_default_colorspaces(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        page: *mut pdf_page,
    ) -> *mut fz_default_colorspaces;
}
unsafe extern "C" {
    pub fn pdf_clip_page(ctx: *mut fz_context, page: *mut pdf_page, clip: *mut fz_rect);
}
unsafe extern "C" {
    pub fn pdf_vectorize_page(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_update_default_colorspaces(
        ctx: *mut fz_context,
        old_cs: *mut fz_default_colorspaces,
        res: *mut pdf_obj,
    ) -> *mut fz_default_colorspaces;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_page {
    pub super_: fz_page,
    pub doc: *mut pdf_document,
    pub obj: *mut pdf_obj,
    pub transparency: ::core::ffi::c_int,
    pub overprint: ::core::ffi::c_int,
    pub links: *mut fz_link,
    pub annots: *mut pdf_annot,
    pub annot_tailp: *mut *mut pdf_annot,
    pub widgets: *mut pdf_annot,
    pub widget_tailp: *mut *mut pdf_annot,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_page"][::core::mem::size_of::<pdf_page>() - 216usize];
    ["Alignment of pdf_page"][::core::mem::align_of::<pdf_page>() - 8usize];
    ["Offset of field: pdf_page::super_"][::core::mem::offset_of!(pdf_page, super_) - 0usize];
    ["Offset of field: pdf_page::doc"][::core::mem::offset_of!(pdf_page, doc) - 152usize];
    ["Offset of field: pdf_page::obj"][::core::mem::offset_of!(pdf_page, obj) - 160usize];
    ["Offset of field: pdf_page::transparency"]
        [::core::mem::offset_of!(pdf_page, transparency) - 168usize];
    ["Offset of field: pdf_page::overprint"]
        [::core::mem::offset_of!(pdf_page, overprint) - 172usize];
    ["Offset of field: pdf_page::links"][::core::mem::offset_of!(pdf_page, links) - 176usize];
    ["Offset of field: pdf_page::annots"][::core::mem::offset_of!(pdf_page, annots) - 184usize];
    ["Offset of field: pdf_page::annot_tailp"]
        [::core::mem::offset_of!(pdf_page, annot_tailp) - 192usize];
    ["Offset of field: pdf_page::widgets"][::core::mem::offset_of!(pdf_page, widgets) - 200usize];
    ["Offset of field: pdf_page::widget_tailp"]
        [::core::mem::offset_of!(pdf_page, widget_tailp) - 208usize];
};
unsafe extern "C" {
    pub fn pdf_sync_open_pages(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_sync_page(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_sync_links(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_sync_annots(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_nuke_page(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_nuke_links(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_nuke_annots(ctx: *mut fz_context, page: *mut pdf_page);
}
pub const PDF_ANNOT_TEXT: pdf_annot_type = 0;
pub const PDF_ANNOT_LINK: pdf_annot_type = 1;
pub const PDF_ANNOT_FREE_TEXT: pdf_annot_type = 2;
pub const PDF_ANNOT_LINE: pdf_annot_type = 3;
pub const PDF_ANNOT_SQUARE: pdf_annot_type = 4;
pub const PDF_ANNOT_CIRCLE: pdf_annot_type = 5;
pub const PDF_ANNOT_POLYGON: pdf_annot_type = 6;
pub const PDF_ANNOT_POLY_LINE: pdf_annot_type = 7;
pub const PDF_ANNOT_HIGHLIGHT: pdf_annot_type = 8;
pub const PDF_ANNOT_UNDERLINE: pdf_annot_type = 9;
pub const PDF_ANNOT_SQUIGGLY: pdf_annot_type = 10;
pub const PDF_ANNOT_STRIKE_OUT: pdf_annot_type = 11;
pub const PDF_ANNOT_REDACT: pdf_annot_type = 12;
pub const PDF_ANNOT_STAMP: pdf_annot_type = 13;
pub const PDF_ANNOT_CARET: pdf_annot_type = 14;
pub const PDF_ANNOT_INK: pdf_annot_type = 15;
pub const PDF_ANNOT_POPUP: pdf_annot_type = 16;
pub const PDF_ANNOT_FILE_ATTACHMENT: pdf_annot_type = 17;
pub const PDF_ANNOT_SOUND: pdf_annot_type = 18;
pub const PDF_ANNOT_MOVIE: pdf_annot_type = 19;
pub const PDF_ANNOT_RICH_MEDIA: pdf_annot_type = 20;
pub const PDF_ANNOT_WIDGET: pdf_annot_type = 21;
pub const PDF_ANNOT_SCREEN: pdf_annot_type = 22;
pub const PDF_ANNOT_PRINTER_MARK: pdf_annot_type = 23;
pub const PDF_ANNOT_TRAP_NET: pdf_annot_type = 24;
pub const PDF_ANNOT_WATERMARK: pdf_annot_type = 25;
pub const PDF_ANNOT_3D: pdf_annot_type = 26;
pub const PDF_ANNOT_PROJECTION: pdf_annot_type = 27;
pub const PDF_ANNOT_UNKNOWN: pdf_annot_type = -1;
pub type pdf_annot_type = ::core::ffi::c_int;
unsafe extern "C" {
    pub fn pdf_string_from_annot_type(
        ctx: *mut fz_context,
        type_: pdf_annot_type,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_annot_type_from_string(
        ctx: *mut fz_context,
        subtype: *const ::core::ffi::c_char,
    ) -> pdf_annot_type;
}
pub const PDF_ANNOT_IS_INVISIBLE: _bindgen_ty_45 = 1;
pub const PDF_ANNOT_IS_HIDDEN: _bindgen_ty_45 = 2;
pub const PDF_ANNOT_IS_PRINT: _bindgen_ty_45 = 4;
pub const PDF_ANNOT_IS_NO_ZOOM: _bindgen_ty_45 = 8;
pub const PDF_ANNOT_IS_NO_ROTATE: _bindgen_ty_45 = 16;
pub const PDF_ANNOT_IS_NO_VIEW: _bindgen_ty_45 = 32;
pub const PDF_ANNOT_IS_READ_ONLY: _bindgen_ty_45 = 64;
pub const PDF_ANNOT_IS_LOCKED: _bindgen_ty_45 = 128;
pub const PDF_ANNOT_IS_TOGGLE_NO_VIEW: _bindgen_ty_45 = 256;
pub const PDF_ANNOT_IS_LOCKED_CONTENTS: _bindgen_ty_45 = 512;
pub type _bindgen_ty_45 = ::core::ffi::c_uint;
pub const PDF_ANNOT_LE_NONE: pdf_line_ending = 0;
pub const PDF_ANNOT_LE_SQUARE: pdf_line_ending = 1;
pub const PDF_ANNOT_LE_CIRCLE: pdf_line_ending = 2;
pub const PDF_ANNOT_LE_DIAMOND: pdf_line_ending = 3;
pub const PDF_ANNOT_LE_OPEN_ARROW: pdf_line_ending = 4;
pub const PDF_ANNOT_LE_CLOSED_ARROW: pdf_line_ending = 5;
pub const PDF_ANNOT_LE_BUTT: pdf_line_ending = 6;
pub const PDF_ANNOT_LE_R_OPEN_ARROW: pdf_line_ending = 7;
pub const PDF_ANNOT_LE_R_CLOSED_ARROW: pdf_line_ending = 8;
pub const PDF_ANNOT_LE_SLASH: pdf_line_ending = 9;
pub type pdf_line_ending = ::core::ffi::c_uint;
pub const PDF_ANNOT_Q_LEFT: _bindgen_ty_46 = 0;
pub const PDF_ANNOT_Q_CENTER: _bindgen_ty_46 = 1;
pub const PDF_ANNOT_Q_RIGHT: _bindgen_ty_46 = 2;
pub type _bindgen_ty_46 = ::core::ffi::c_uint;
pub const PDF_ANNOT_IT_DEFAULT: pdf_intent = 0;
pub const PDF_ANNOT_IT_FREETEXT_CALLOUT: pdf_intent = 1;
pub const PDF_ANNOT_IT_FREETEXT_TYPEWRITER: pdf_intent = 2;
pub const PDF_ANNOT_IT_LINE_ARROW: pdf_intent = 3;
pub const PDF_ANNOT_IT_LINE_DIMENSION: pdf_intent = 4;
pub const PDF_ANNOT_IT_POLYLINE_DIMENSION: pdf_intent = 5;
pub const PDF_ANNOT_IT_POLYGON_CLOUD: pdf_intent = 6;
pub const PDF_ANNOT_IT_POLYGON_DIMENSION: pdf_intent = 7;
pub const PDF_ANNOT_IT_STAMP_IMAGE: pdf_intent = 8;
pub const PDF_ANNOT_IT_STAMP_SNAPSHOT: pdf_intent = 9;
pub const PDF_ANNOT_IT_UNKNOWN: pdf_intent = 255;
pub type pdf_intent = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_string_from_intent(
        ctx: *mut fz_context,
        intent: pdf_intent,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_name_from_intent(ctx: *mut fz_context, intent: pdf_intent) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_intent_from_string(
        ctx: *mut fz_context,
        str_: *const ::core::ffi::c_char,
    ) -> pdf_intent;
}
unsafe extern "C" {
    pub fn pdf_intent_from_name(ctx: *mut fz_context, obj: *mut pdf_obj) -> pdf_intent;
}
unsafe extern "C" {
    pub fn pdf_line_ending_from_name(ctx: *mut fz_context, end: *mut pdf_obj) -> pdf_line_ending;
}
unsafe extern "C" {
    pub fn pdf_line_ending_from_string(
        ctx: *mut fz_context,
        end: *const ::core::ffi::c_char,
    ) -> pdf_line_ending;
}
unsafe extern "C" {
    pub fn pdf_name_from_line_ending(ctx: *mut fz_context, end: pdf_line_ending) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_string_from_line_ending(
        ctx: *mut fz_context,
        end: pdf_line_ending,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_keep_annot(ctx: *mut fz_context, annot: *mut pdf_annot) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_drop_annot(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_first_annot(ctx: *mut fz_context, page: *mut pdf_page) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_next_annot(ctx: *mut fz_context, annot: *mut pdf_annot) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_annot_obj(ctx: *mut fz_context, annot: *mut pdf_annot) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_annot_page(ctx: *mut fz_context, annot: *mut pdf_annot) -> *mut pdf_page;
}
unsafe extern "C" {
    pub fn pdf_bound_annot(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_annot_type(ctx: *mut fz_context, annot: *mut pdf_annot) -> pdf_annot_type;
}
unsafe extern "C" {
    pub fn pdf_run_annot(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        dev: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
    );
}
unsafe extern "C" {
    pub fn pdf_lookup_name(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        which: *mut pdf_obj,
        needle: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_load_name_tree(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        which: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_lookup_number(
        ctx: *mut fz_context,
        root: *mut pdf_obj,
        needle: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_walk_tree(
        ctx: *mut fz_context,
        tree: *mut pdf_obj,
        kid_name: *mut pdf_obj,
        arrive: ::core::option::Option<
            unsafe extern "C" fn(
                arg1: *mut fz_context,
                arg2: *mut pdf_obj,
                arg3: *mut ::core::ffi::c_void,
                arg4: *mut *mut pdf_obj,
            ),
        >,
        leave: ::core::option::Option<
            unsafe extern "C" fn(
                arg1: *mut fz_context,
                arg2: *mut pdf_obj,
                arg3: *mut ::core::ffi::c_void,
            ),
        >,
        arg: *mut ::core::ffi::c_void,
        names: *mut *mut pdf_obj,
        values: *mut *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_resolve_link(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        uri: *const ::core::ffi::c_char,
        xp: *mut f32,
        yp: *mut f32,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_resolve_link_dest(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        uri: *const ::core::ffi::c_char,
    ) -> fz_link_dest;
}
unsafe extern "C" {
    pub fn pdf_new_action_from_link(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        uri: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_dest_from_link(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        uri: *const ::core::ffi::c_char,
        is_remote: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_new_uri_from_explicit_dest(
        ctx: *mut fz_context,
        dest: fz_link_dest,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_append_named_dest_to_uri(
        ctx: *mut fz_context,
        url: *const ::core::ffi::c_char,
        name: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_append_explicit_dest_to_uri(
        ctx: *mut fz_context,
        url: *const ::core::ffi::c_char,
        dest: fz_link_dest,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_new_uri_from_path_and_named_dest(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        name: *const ::core::ffi::c_char,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_new_uri_from_path_and_explicit_dest(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        dest: fz_link_dest,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_annot_transform(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_matrix;
}
unsafe extern "C" {
    pub fn pdf_new_link(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        rect: fz_rect,
        uri: *const ::core::ffi::c_char,
        obj: *mut pdf_obj,
    ) -> *mut fz_link;
}
unsafe extern "C" {
    pub fn pdf_create_annot_raw(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        type_: pdf_annot_type,
    ) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_create_link(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        bbox: fz_rect,
        uri: *const ::core::ffi::c_char,
    ) -> *mut fz_link;
}
unsafe extern "C" {
    pub fn pdf_delete_link(ctx: *mut fz_context, page: *mut pdf_page, link: *mut fz_link);
}
pub const PDF_BORDER_STYLE_SOLID: pdf_border_style = 0;
pub const PDF_BORDER_STYLE_DASHED: pdf_border_style = 1;
pub const PDF_BORDER_STYLE_BEVELED: pdf_border_style = 2;
pub const PDF_BORDER_STYLE_INSET: pdf_border_style = 3;
pub const PDF_BORDER_STYLE_UNDERLINE: pdf_border_style = 4;
pub type pdf_border_style = ::core::ffi::c_uint;
pub const PDF_BORDER_EFFECT_NONE: pdf_border_effect = 0;
pub const PDF_BORDER_EFFECT_CLOUDY: pdf_border_effect = 1;
pub type pdf_border_effect = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_create_annot(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        type_: pdf_annot_type,
    ) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_delete_annot(ctx: *mut fz_context, page: *mut pdf_page, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_set_annot_popup(ctx: *mut fz_context, annot: *mut pdf_annot, rect: fz_rect);
}
unsafe extern "C" {
    pub fn pdf_annot_popup(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_annot_has_rect(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_ink_list(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_quad_points(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_vertices(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_line(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_interior_color(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_line_ending_styles(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_quadding(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_border(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_border_effect(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_icon_name(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_open(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_popup(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_author(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_rich_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_has_rich_defaults(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_flags(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_rect(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_annot_display_rect(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_annot_border(ctx: *mut fz_context, annot: *mut pdf_annot) -> f32;
}
unsafe extern "C" {
    pub fn pdf_annot_border_style(ctx: *mut fz_context, annot: *mut pdf_annot) -> pdf_border_style;
}
unsafe extern "C" {
    pub fn pdf_annot_border_width(ctx: *mut fz_context, annot: *mut pdf_annot) -> f32;
}
unsafe extern "C" {
    pub fn pdf_annot_border_dash_count(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_border_dash_item(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        i: ::core::ffi::c_int,
    ) -> f32;
}
unsafe extern "C" {
    pub fn pdf_annot_border_effect(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> pdf_border_effect;
}
unsafe extern "C" {
    pub fn pdf_annot_border_effect_intensity(ctx: *mut fz_context, annot: *mut pdf_annot) -> f32;
}
unsafe extern "C" {
    pub fn pdf_annot_opacity(ctx: *mut fz_context, annot: *mut pdf_annot) -> f32;
}
unsafe extern "C" {
    pub fn pdf_annot_color(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_interior_color(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_quadding(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_language(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_text_language;
}
unsafe extern "C" {
    pub fn pdf_annot_quad_point_count(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_quad_point(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        i: ::core::ffi::c_int,
    ) -> fz_quad;
}
unsafe extern "C" {
    pub fn pdf_annot_ink_list_count(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_ink_list_stroke_count(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        i: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_ink_list_stroke_vertex(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        i: ::core::ffi::c_int,
        k: ::core::ffi::c_int,
    ) -> fz_point;
}
unsafe extern "C" {
    pub fn pdf_set_annot_flags(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        flags: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_stamp_image_obj(ctx: *mut fz_context, annot: *mut pdf_annot) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_set_annot_stamp_image_obj(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        ref_: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_stamp_image(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        image: *mut fz_image,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_rect(ctx: *mut fz_context, annot: *mut pdf_annot, rect: fz_rect);
}
unsafe extern "C" {
    pub fn pdf_set_annot_border(ctx: *mut fz_context, annot: *mut pdf_annot, width: f32);
}
unsafe extern "C" {
    pub fn pdf_set_annot_border_style(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        style: pdf_border_style,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_border_width(ctx: *mut fz_context, annot: *mut pdf_annot, width: f32);
}
unsafe extern "C" {
    pub fn pdf_clear_annot_border_dash(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_add_annot_border_dash_item(ctx: *mut fz_context, annot: *mut pdf_annot, length: f32);
}
unsafe extern "C" {
    pub fn pdf_set_annot_border_effect(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        effect: pdf_border_effect,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_border_effect_intensity(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        intensity: f32,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_opacity(ctx: *mut fz_context, annot: *mut pdf_annot, opacity: f32);
}
unsafe extern "C" {
    pub fn pdf_set_annot_color(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: ::core::ffi::c_int,
        color: *const f32,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_interior_color(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: ::core::ffi::c_int,
        color: *const f32,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_quadding(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        q: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_language(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        lang: fz_text_language,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_quad_points(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: ::core::ffi::c_int,
        qv: *const fz_quad,
    );
}
unsafe extern "C" {
    pub fn pdf_clear_annot_quad_points(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_add_annot_quad_point(ctx: *mut fz_context, annot: *mut pdf_annot, quad: fz_quad);
}
unsafe extern "C" {
    pub fn pdf_set_annot_ink_list(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: ::core::ffi::c_int,
        count: *const ::core::ffi::c_int,
        v: *const fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_clear_annot_ink_list(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_add_annot_ink_list_stroke(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_add_annot_ink_list_stroke_vertex(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        p: fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_add_annot_ink_list(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: ::core::ffi::c_int,
        stroke: *mut fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_icon_name(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        name: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_is_open(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        is_open: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_line_start_style(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> pdf_line_ending;
}
unsafe extern "C" {
    pub fn pdf_annot_line_end_style(ctx: *mut fz_context, annot: *mut pdf_annot)
    -> pdf_line_ending;
}
unsafe extern "C" {
    pub fn pdf_annot_line_ending_styles(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        start_style: *mut pdf_line_ending,
        end_style: *mut pdf_line_ending,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_start_style(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        s: pdf_line_ending,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_end_style(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        e: pdf_line_ending,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_ending_styles(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        start_style: pdf_line_ending,
        end_style: pdf_line_ending,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_icon_name(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_annot_is_open(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_is_standard_stamp(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_line(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        a: *mut fz_point,
        b: *mut fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_line(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        a: fz_point,
        b: fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_line_leader(ctx: *mut fz_context, annot: *mut pdf_annot) -> f32;
}
unsafe extern "C" {
    pub fn pdf_annot_line_leader_extension(ctx: *mut fz_context, annot: *mut pdf_annot) -> f32;
}
unsafe extern "C" {
    pub fn pdf_annot_line_leader_offset(ctx: *mut fz_context, annot: *mut pdf_annot) -> f32;
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_leader(ctx: *mut fz_context, annot: *mut pdf_annot, ll: f32);
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_leader_extension(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        lle: f32,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_leader_offset(ctx: *mut fz_context, annot: *mut pdf_annot, llo: f32);
}
unsafe extern "C" {
    pub fn pdf_annot_line_caption(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_caption(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        cap: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_line_caption_offset(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_point;
}
unsafe extern "C" {
    pub fn pdf_set_annot_line_caption_offset(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        offset: fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_vertex_count(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_vertex(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        i: ::core::ffi::c_int,
    ) -> fz_point;
}
unsafe extern "C" {
    pub fn pdf_set_annot_vertices(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: ::core::ffi::c_int,
        v: *const fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_clear_annot_vertices(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_add_annot_vertex(ctx: *mut fz_context, annot: *mut pdf_annot, p: fz_point);
}
unsafe extern "C" {
    pub fn pdf_set_annot_vertex(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        i: ::core::ffi::c_int,
        p: fz_point,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_set_annot_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        text: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_author(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_set_annot_author(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        author: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_modification_date(ctx: *mut fz_context, annot: *mut pdf_annot) -> i64;
}
unsafe extern "C" {
    pub fn pdf_set_annot_modification_date(ctx: *mut fz_context, annot: *mut pdf_annot, time: i64);
}
unsafe extern "C" {
    pub fn pdf_annot_creation_date(ctx: *mut fz_context, annot: *mut pdf_annot) -> i64;
}
unsafe extern "C" {
    pub fn pdf_set_annot_creation_date(ctx: *mut fz_context, annot: *mut pdf_annot, time: i64);
}
unsafe extern "C" {
    pub fn pdf_annot_has_intent(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_intent(ctx: *mut fz_context, annot: *mut pdf_annot) -> pdf_intent;
}
unsafe extern "C" {
    pub fn pdf_set_annot_intent(ctx: *mut fz_context, annot: *mut pdf_annot, it: pdf_intent);
}
unsafe extern "C" {
    pub fn pdf_annot_has_callout(ctx: *mut fz_context, annot: *mut pdf_annot)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_callout_style(ctx: *mut fz_context, annot: *mut pdf_annot) -> pdf_line_ending;
}
unsafe extern "C" {
    pub fn pdf_set_annot_callout_style(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        style: pdf_line_ending,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_callout_line(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        callout: *mut fz_point,
        n: *mut ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_callout_line(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        callout: *mut fz_point,
        n: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_callout_point(ctx: *mut fz_context, annot: *mut pdf_annot) -> fz_point;
}
unsafe extern "C" {
    pub fn pdf_set_annot_callout_point(ctx: *mut fz_context, annot: *mut pdf_annot, p: fz_point);
}
unsafe extern "C" {
    pub fn pdf_annot_has_default_appearance(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_parse_default_appearance_unmapped(
        ctx: *mut fz_context,
        da: *const ::core::ffi::c_char,
        font_name: *mut ::core::ffi::c_char,
        font_name_len: ::core::ffi::c_int,
        size: *mut f32,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_parse_default_appearance(
        ctx: *mut fz_context,
        da: *const ::core::ffi::c_char,
        font: *mut *const ::core::ffi::c_char,
        size: *mut f32,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_print_default_appearance(
        ctx: *mut fz_context,
        buf: *mut ::core::ffi::c_char,
        nbuf: ::core::ffi::c_int,
        font: *const ::core::ffi::c_char,
        size: f32,
        n: ::core::ffi::c_int,
        color: *const f32,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_default_appearance_unmapped(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        font_name: *mut ::core::ffi::c_char,
        font_name_len: ::core::ffi::c_int,
        size: *mut f32,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_default_appearance(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        font: *mut *const ::core::ffi::c_char,
        size: *mut f32,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_default_appearance(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        font: *const ::core::ffi::c_char,
        size: f32,
        n: ::core::ffi::c_int,
        color: *const f32,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_rich_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_set_annot_rich_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        plain: *const ::core::ffi::c_char,
        rich: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_rich_defaults(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_set_annot_rich_defaults(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        style: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_request_synthesis(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_request_resynthesis(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_needs_resynthesis(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_annot_resynthesised(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_dirty_annot(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_field_flags(ctx: *mut fz_context, annot: *mut pdf_annot)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_field_value(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_annot_field_label(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_set_annot_field_value(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        widget: *mut pdf_annot,
        text: *const ::core::ffi::c_char,
        ignore_trigger_events: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_layout_fit_text(
        ctx: *mut fz_context,
        font: *mut fz_font,
        lang: fz_text_language,
        str_: *const ::core::ffi::c_char,
        bounds: fz_rect,
    ) -> *mut fz_text;
}
unsafe extern "C" {
    pub fn pdf_annot_push_local_xref(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_pop_local_xref(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_ensure_local_xref(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_pop_and_discard_local_xref(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_update_annot(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_update_page(ctx: *mut fz_context, page: *mut pdf_page) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_update_open_pages(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_widget_editing_state(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
        editing: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_get_widget_editing_state(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_toggle_widget(ctx: *mut fz_context, widget: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_new_display_list_from_annot(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    pub fn pdf_new_pixmap_from_annot(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        seps: *mut fz_separations,
        alpha: ::core::ffi::c_int,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn pdf_new_stext_page_from_annot(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        options: *const fz_stext_options,
    ) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn pdf_layout_text_widget(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> *mut fz_layout_block;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_filespec_params {
    pub filename: *const ::core::ffi::c_char,
    pub mimetype: *const ::core::ffi::c_char,
    pub size: ::core::ffi::c_int,
    pub created: i64,
    pub modified: i64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_filespec_params"][::core::mem::size_of::<pdf_filespec_params>() - 40usize];
    ["Alignment of pdf_filespec_params"][::core::mem::align_of::<pdf_filespec_params>() - 8usize];
    ["Offset of field: pdf_filespec_params::filename"]
        [::core::mem::offset_of!(pdf_filespec_params, filename) - 0usize];
    ["Offset of field: pdf_filespec_params::mimetype"]
        [::core::mem::offset_of!(pdf_filespec_params, mimetype) - 8usize];
    ["Offset of field: pdf_filespec_params::size"]
        [::core::mem::offset_of!(pdf_filespec_params, size) - 16usize];
    ["Offset of field: pdf_filespec_params::created"]
        [::core::mem::offset_of!(pdf_filespec_params, created) - 24usize];
    ["Offset of field: pdf_filespec_params::modified"]
        [::core::mem::offset_of!(pdf_filespec_params, modified) - 32usize];
};
unsafe extern "C" {
    pub fn pdf_is_filespec(ctx: *mut fz_context, fs: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_is_embedded_file(ctx: *mut fz_context, fs: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_add_embedded_file(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        filename: *const ::core::ffi::c_char,
        mimetype: *const ::core::ffi::c_char,
        contents: *mut fz_buffer,
        created: i64,
        modified: i64,
        add_checksum: ::core::ffi::c_int,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_get_filespec_params(
        ctx: *mut fz_context,
        fs: *mut pdf_obj,
        out: *mut pdf_filespec_params,
    );
}
unsafe extern "C" {
    pub fn pdf_load_embedded_file_contents(
        ctx: *mut fz_context,
        fs: *mut pdf_obj,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn pdf_verify_embedded_file_checksum(
        ctx: *mut fz_context,
        fs: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_lookup_dest(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        needle: *mut pdf_obj,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_load_link_annots(
        ctx: *mut fz_context,
        arg1: *mut pdf_document,
        arg2: *mut pdf_page,
        annots: *mut pdf_obj,
        pagenum: ::core::ffi::c_int,
        page_ctm: fz_matrix,
    ) -> *mut fz_link;
}
unsafe extern "C" {
    pub fn pdf_annot_MK_BG(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_MK_BC(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: *mut ::core::ffi::c_int,
        color: *mut f32,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_MK_BG_rgb(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        rgb: *mut f32,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_MK_BC_rgb(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        rgb: *mut f32,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_ap(ctx: *mut fz_context, annot: *mut pdf_annot) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_annot_active(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_annot_active(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        active: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_hot(ctx: *mut fz_context, annot: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_annot_hot(ctx: *mut fz_context, annot: *mut pdf_annot, hot: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_set_annot_appearance(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        appearance: *const ::core::ffi::c_char,
        state: *const ::core::ffi::c_char,
        ctm: fz_matrix,
        bbox: fz_rect,
        res: *mut pdf_obj,
        contents: *mut fz_buffer,
    );
}
unsafe extern "C" {
    pub fn pdf_set_annot_appearance_from_display_list(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        appearance: *const ::core::ffi::c_char,
        state: *const ::core::ffi::c_char,
        ctm: fz_matrix,
        list: *mut fz_display_list,
    );
}
unsafe extern "C" {
    pub fn pdf_annot_has_filespec(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_annot_filespec(ctx: *mut fz_context, annot: *mut pdf_annot) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_set_annot_filespec(ctx: *mut fz_context, annot: *mut pdf_annot, obj: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_annot_hidden_for_editing(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_annot_hidden_for_editing(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        hidden: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_apply_redaction(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        opts: *mut pdf_redact_options,
    ) -> ::core::ffi::c_int;
}
pub const PDF_WIDGET_TYPE_UNKNOWN: pdf_widget_type = 0;
pub const PDF_WIDGET_TYPE_BUTTON: pdf_widget_type = 1;
pub const PDF_WIDGET_TYPE_CHECKBOX: pdf_widget_type = 2;
pub const PDF_WIDGET_TYPE_COMBOBOX: pdf_widget_type = 3;
pub const PDF_WIDGET_TYPE_LISTBOX: pdf_widget_type = 4;
pub const PDF_WIDGET_TYPE_RADIOBUTTON: pdf_widget_type = 5;
pub const PDF_WIDGET_TYPE_SIGNATURE: pdf_widget_type = 6;
pub const PDF_WIDGET_TYPE_TEXT: pdf_widget_type = 7;
pub type pdf_widget_type = ::core::ffi::c_uint;
pub const PDF_WIDGET_TX_FORMAT_NONE: pdf_widget_tx_format = 0;
pub const PDF_WIDGET_TX_FORMAT_NUMBER: pdf_widget_tx_format = 1;
pub const PDF_WIDGET_TX_FORMAT_SPECIAL: pdf_widget_tx_format = 2;
pub const PDF_WIDGET_TX_FORMAT_DATE: pdf_widget_tx_format = 3;
pub const PDF_WIDGET_TX_FORMAT_TIME: pdf_widget_tx_format = 4;
pub type pdf_widget_tx_format = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_keep_widget(ctx: *mut fz_context, widget: *mut pdf_annot) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_drop_widget(ctx: *mut fz_context, widget: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_first_widget(ctx: *mut fz_context, page: *mut pdf_page) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_next_widget(ctx: *mut fz_context, previous: *mut pdf_annot) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_update_widget(ctx: *mut fz_context, widget: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_create_signature_widget(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        name: *mut ::core::ffi::c_char,
    ) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn pdf_widget_type(ctx: *mut fz_context, widget: *mut pdf_annot) -> pdf_widget_type;
}
unsafe extern "C" {
    pub fn pdf_bound_widget(ctx: *mut fz_context, widget: *mut pdf_annot) -> fz_rect;
}
unsafe extern "C" {
    pub fn pdf_text_widget_max_len(ctx: *mut fz_context, tw: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_text_widget_format(ctx: *mut fz_context, tw: *mut pdf_annot) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_choice_widget_options(
        ctx: *mut fz_context,
        tw: *mut pdf_annot,
        exportval: ::core::ffi::c_int,
        opts: *mut *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_choice_widget_is_multiselect(
        ctx: *mut fz_context,
        tw: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_choice_widget_value(
        ctx: *mut fz_context,
        tw: *mut pdf_annot,
        opts: *mut *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_choice_widget_set_value(
        ctx: *mut fz_context,
        tw: *mut pdf_annot,
        n: ::core::ffi::c_int,
        opts: *mut *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_choice_field_option_count(
        ctx: *mut fz_context,
        field: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_choice_field_option(
        ctx: *mut fz_context,
        field: *mut pdf_obj,
        exportval: ::core::ffi::c_int,
        i: ::core::ffi::c_int,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_widget_is_signed(ctx: *mut fz_context, widget: *mut pdf_annot)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_widget_is_readonly(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
    ) -> ::core::ffi::c_int;
}
pub const PDF_FIELD_IS_READ_ONLY: _bindgen_ty_47 = 1;
pub const PDF_FIELD_IS_REQUIRED: _bindgen_ty_47 = 2;
pub const PDF_FIELD_IS_NO_EXPORT: _bindgen_ty_47 = 4;
pub const PDF_TX_FIELD_IS_MULTILINE: _bindgen_ty_47 = 4096;
pub const PDF_TX_FIELD_IS_PASSWORD: _bindgen_ty_47 = 8192;
pub const PDF_TX_FIELD_IS_FILE_SELECT: _bindgen_ty_47 = 1048576;
pub const PDF_TX_FIELD_IS_DO_NOT_SPELL_CHECK: _bindgen_ty_47 = 4194304;
pub const PDF_TX_FIELD_IS_DO_NOT_SCROLL: _bindgen_ty_47 = 8388608;
pub const PDF_TX_FIELD_IS_COMB: _bindgen_ty_47 = 16777216;
pub const PDF_TX_FIELD_IS_RICH_TEXT: _bindgen_ty_47 = 33554432;
pub const PDF_BTN_FIELD_IS_NO_TOGGLE_TO_OFF: _bindgen_ty_47 = 16384;
pub const PDF_BTN_FIELD_IS_RADIO: _bindgen_ty_47 = 32768;
pub const PDF_BTN_FIELD_IS_PUSHBUTTON: _bindgen_ty_47 = 65536;
pub const PDF_BTN_FIELD_IS_RADIOS_IN_UNISON: _bindgen_ty_47 = 33554432;
pub const PDF_CH_FIELD_IS_COMBO: _bindgen_ty_47 = 131072;
pub const PDF_CH_FIELD_IS_EDIT: _bindgen_ty_47 = 262144;
pub const PDF_CH_FIELD_IS_SORT: _bindgen_ty_47 = 524288;
pub const PDF_CH_FIELD_IS_MULTI_SELECT: _bindgen_ty_47 = 2097152;
pub const PDF_CH_FIELD_IS_DO_NOT_SPELL_CHECK: _bindgen_ty_47 = 4194304;
pub const PDF_CH_FIELD_IS_COMMIT_ON_SEL_CHANGE: _bindgen_ty_47 = 33554432;
pub type _bindgen_ty_47 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_calculate_form(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_reset_form(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        fields: *mut pdf_obj,
        exclude: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_field_type(ctx: *mut fz_context, field: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_field_type_string(
        ctx: *mut fz_context,
        field: *mut pdf_obj,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_field_flags(ctx: *mut fz_context, field: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_load_field_name(
        ctx: *mut fz_context,
        field: *mut pdf_obj,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_field_value(ctx: *mut fz_context, field: *mut pdf_obj)
    -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_create_field_name(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        prefix: *const ::core::ffi::c_char,
        buf: *mut ::core::ffi::c_char,
        len: usize,
    );
}
unsafe extern "C" {
    pub fn pdf_field_border_style(
        ctx: *mut fz_context,
        field: *mut pdf_obj,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_field_set_border_style(
        ctx: *mut fz_context,
        field: *mut pdf_obj,
        text: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_field_set_button_caption(
        ctx: *mut fz_context,
        field: *mut pdf_obj,
        text: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_field_set_fill_color(ctx: *mut fz_context, field: *mut pdf_obj, col: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_field_set_text_color(ctx: *mut fz_context, field: *mut pdf_obj, col: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_field_display(ctx: *mut fz_context, field: *mut pdf_obj) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_field_set_display(ctx: *mut fz_context, field: *mut pdf_obj, d: ::core::ffi::c_int);
}
unsafe extern "C" {
    pub fn pdf_field_label(ctx: *mut fz_context, field: *mut pdf_obj)
    -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_button_field_on_state(ctx: *mut fz_context, field: *mut pdf_obj) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn pdf_set_field_value(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
        text: *const ::core::ffi::c_char,
        ignore_trigger_events: ::core::ffi::c_int,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_text_field_value(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
        value: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_set_choice_field_value(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
        value: *const ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_edit_text_field_value(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
        value: *const ::core::ffi::c_char,
        change: *const ::core::ffi::c_char,
        selStart: *mut ::core::ffi::c_int,
        selEnd: *mut ::core::ffi::c_int,
        newvalue: *mut *mut ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_pkcs7_distinguished_name {
    pub cn: *mut ::core::ffi::c_char,
    pub o: *mut ::core::ffi::c_char,
    pub ou: *mut ::core::ffi::c_char,
    pub email: *mut ::core::ffi::c_char,
    pub c: *mut ::core::ffi::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_pkcs7_distinguished_name"]
        [::core::mem::size_of::<pdf_pkcs7_distinguished_name>() - 40usize];
    ["Alignment of pdf_pkcs7_distinguished_name"]
        [::core::mem::align_of::<pdf_pkcs7_distinguished_name>() - 8usize];
    ["Offset of field: pdf_pkcs7_distinguished_name::cn"]
        [::core::mem::offset_of!(pdf_pkcs7_distinguished_name, cn) - 0usize];
    ["Offset of field: pdf_pkcs7_distinguished_name::o"]
        [::core::mem::offset_of!(pdf_pkcs7_distinguished_name, o) - 8usize];
    ["Offset of field: pdf_pkcs7_distinguished_name::ou"]
        [::core::mem::offset_of!(pdf_pkcs7_distinguished_name, ou) - 16usize];
    ["Offset of field: pdf_pkcs7_distinguished_name::email"]
        [::core::mem::offset_of!(pdf_pkcs7_distinguished_name, email) - 24usize];
    ["Offset of field: pdf_pkcs7_distinguished_name::c"]
        [::core::mem::offset_of!(pdf_pkcs7_distinguished_name, c) - 32usize];
};
pub const PDF_SIGNATURE_ERROR_OKAY: pdf_signature_error = 0;
pub const PDF_SIGNATURE_ERROR_NO_SIGNATURES: pdf_signature_error = 1;
pub const PDF_SIGNATURE_ERROR_NO_CERTIFICATE: pdf_signature_error = 2;
pub const PDF_SIGNATURE_ERROR_DIGEST_FAILURE: pdf_signature_error = 3;
pub const PDF_SIGNATURE_ERROR_SELF_SIGNED: pdf_signature_error = 4;
pub const PDF_SIGNATURE_ERROR_SELF_SIGNED_IN_CHAIN: pdf_signature_error = 5;
pub const PDF_SIGNATURE_ERROR_NOT_TRUSTED: pdf_signature_error = 6;
pub const PDF_SIGNATURE_ERROR_NOT_SIGNED: pdf_signature_error = 7;
pub const PDF_SIGNATURE_ERROR_UNKNOWN: pdf_signature_error = 8;
pub type pdf_signature_error = ::core::ffi::c_uint;
pub type pdf_pkcs7_keep_signer_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        signer: *mut pdf_pkcs7_signer,
    ) -> *mut pdf_pkcs7_signer,
>;
pub type pdf_pkcs7_drop_signer_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, signer: *mut pdf_pkcs7_signer),
>;
pub type pdf_pkcs7_get_signing_name_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        signer: *mut pdf_pkcs7_signer,
    ) -> *mut pdf_pkcs7_distinguished_name,
>;
pub type pdf_pkcs7_max_digest_size_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, signer: *mut pdf_pkcs7_signer) -> usize,
>;
pub type pdf_pkcs7_create_digest_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        signer: *mut pdf_pkcs7_signer,
        in_: *mut fz_stream,
        digest: *mut ::core::ffi::c_uchar,
        digest_len: usize,
    ) -> ::core::ffi::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_pkcs7_signer {
    pub keep: pdf_pkcs7_keep_signer_fn,
    pub drop: pdf_pkcs7_drop_signer_fn,
    pub get_signing_name: pdf_pkcs7_get_signing_name_fn,
    pub max_digest_size: pdf_pkcs7_max_digest_size_fn,
    pub create_digest: pdf_pkcs7_create_digest_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_pkcs7_signer"][::core::mem::size_of::<pdf_pkcs7_signer>() - 40usize];
    ["Alignment of pdf_pkcs7_signer"][::core::mem::align_of::<pdf_pkcs7_signer>() - 8usize];
    ["Offset of field: pdf_pkcs7_signer::keep"]
        [::core::mem::offset_of!(pdf_pkcs7_signer, keep) - 0usize];
    ["Offset of field: pdf_pkcs7_signer::drop"]
        [::core::mem::offset_of!(pdf_pkcs7_signer, drop) - 8usize];
    ["Offset of field: pdf_pkcs7_signer::get_signing_name"]
        [::core::mem::offset_of!(pdf_pkcs7_signer, get_signing_name) - 16usize];
    ["Offset of field: pdf_pkcs7_signer::max_digest_size"]
        [::core::mem::offset_of!(pdf_pkcs7_signer, max_digest_size) - 24usize];
    ["Offset of field: pdf_pkcs7_signer::create_digest"]
        [::core::mem::offset_of!(pdf_pkcs7_signer, create_digest) - 32usize];
};
pub type pdf_pkcs7_drop_verifier_fn = ::core::option::Option<
    unsafe extern "C" fn(ctx: *mut fz_context, verifier: *mut pdf_pkcs7_verifier),
>;
pub type pdf_pkcs7_check_certificate_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        signature: *mut ::core::ffi::c_uchar,
        len: usize,
    ) -> pdf_signature_error,
>;
pub type pdf_pkcs7_check_digest_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        in_: *mut fz_stream,
        signature: *mut ::core::ffi::c_uchar,
        len: usize,
    ) -> pdf_signature_error,
>;
pub type pdf_pkcs7_get_signatory_fn = ::core::option::Option<
    unsafe extern "C" fn(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        signature: *mut ::core::ffi::c_uchar,
        len: usize,
    ) -> *mut pdf_pkcs7_distinguished_name,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_pkcs7_verifier {
    pub drop: pdf_pkcs7_drop_verifier_fn,
    pub check_certificate: pdf_pkcs7_check_certificate_fn,
    pub check_digest: pdf_pkcs7_check_digest_fn,
    pub get_signatory: pdf_pkcs7_get_signatory_fn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_pkcs7_verifier"][::core::mem::size_of::<pdf_pkcs7_verifier>() - 32usize];
    ["Alignment of pdf_pkcs7_verifier"][::core::mem::align_of::<pdf_pkcs7_verifier>() - 8usize];
    ["Offset of field: pdf_pkcs7_verifier::drop"]
        [::core::mem::offset_of!(pdf_pkcs7_verifier, drop) - 0usize];
    ["Offset of field: pdf_pkcs7_verifier::check_certificate"]
        [::core::mem::offset_of!(pdf_pkcs7_verifier, check_certificate) - 8usize];
    ["Offset of field: pdf_pkcs7_verifier::check_digest"]
        [::core::mem::offset_of!(pdf_pkcs7_verifier, check_digest) - 16usize];
    ["Offset of field: pdf_pkcs7_verifier::get_signatory"]
        [::core::mem::offset_of!(pdf_pkcs7_verifier, get_signatory) - 24usize];
};
unsafe extern "C" {
    pub fn pdf_signature_is_signed(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_signature_set_value(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
        signer: *mut pdf_pkcs7_signer,
        stime: i64,
    );
}
unsafe extern "C" {
    pub fn pdf_count_signatures(ctx: *mut fz_context, doc: *mut pdf_document)
    -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_signature_error_description(err: pdf_signature_error) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_signature_get_signatory(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        doc: *mut pdf_document,
        signature: *mut pdf_obj,
    ) -> *mut pdf_pkcs7_distinguished_name;
}
unsafe extern "C" {
    pub fn pdf_signature_get_widget_signatory(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        widget: *mut pdf_annot,
    ) -> *mut pdf_pkcs7_distinguished_name;
}
unsafe extern "C" {
    pub fn pdf_signature_drop_distinguished_name(
        ctx: *mut fz_context,
        name: *mut pdf_pkcs7_distinguished_name,
    );
}
unsafe extern "C" {
    pub fn pdf_signature_format_distinguished_name(
        ctx: *mut fz_context,
        name: *mut pdf_pkcs7_distinguished_name,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_signature_info(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        dn: *mut pdf_pkcs7_distinguished_name,
        reason: *const ::core::ffi::c_char,
        location: *const ::core::ffi::c_char,
        date: i64,
        include_labels: ::core::ffi::c_int,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_signature_appearance_signed(
        ctx: *mut fz_context,
        rect: fz_rect,
        lang: fz_text_language,
        img: *mut fz_image,
        left_text: *const ::core::ffi::c_char,
        right_text: *const ::core::ffi::c_char,
        include_logo: ::core::ffi::c_int,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    pub fn pdf_signature_appearance_unsigned(
        ctx: *mut fz_context,
        rect: fz_rect,
        lang: fz_text_language,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    pub fn pdf_check_digest(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        doc: *mut pdf_document,
        signature: *mut pdf_obj,
    ) -> pdf_signature_error;
}
unsafe extern "C" {
    pub fn pdf_check_certificate(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        doc: *mut pdf_document,
        signature: *mut pdf_obj,
    ) -> pdf_signature_error;
}
unsafe extern "C" {
    pub fn pdf_check_widget_digest(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        widget: *mut pdf_annot,
    ) -> pdf_signature_error;
}
unsafe extern "C" {
    pub fn pdf_check_widget_certificate(
        ctx: *mut fz_context,
        verifier: *mut pdf_pkcs7_verifier,
        widget: *mut pdf_annot,
    ) -> pdf_signature_error;
}
unsafe extern "C" {
    pub fn pdf_clear_signature(ctx: *mut fz_context, widget: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_sign_signature_with_appearance(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
        signer: *mut pdf_pkcs7_signer,
        date: i64,
        disp_list: *mut fz_display_list,
    );
}
pub const PDF_SIGNATURE_SHOW_LABELS: _bindgen_ty_48 = 1;
pub const PDF_SIGNATURE_SHOW_DN: _bindgen_ty_48 = 2;
pub const PDF_SIGNATURE_SHOW_DATE: _bindgen_ty_48 = 4;
pub const PDF_SIGNATURE_SHOW_TEXT_NAME: _bindgen_ty_48 = 8;
pub const PDF_SIGNATURE_SHOW_GRAPHIC_NAME: _bindgen_ty_48 = 16;
pub const PDF_SIGNATURE_SHOW_LOGO: _bindgen_ty_48 = 32;
pub type _bindgen_ty_48 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_sign_signature(
        ctx: *mut fz_context,
        widget: *mut pdf_annot,
        signer: *mut pdf_pkcs7_signer,
        appearance_flags: ::core::ffi::c_int,
        graphic: *mut fz_image,
        reason: *const ::core::ffi::c_char,
        location: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_preview_signature_as_display_list(
        ctx: *mut fz_context,
        w: f32,
        h: f32,
        lang: fz_text_language,
        signer: *mut pdf_pkcs7_signer,
        appearance_flags: ::core::ffi::c_int,
        graphic: *mut fz_image,
        reason: *const ::core::ffi::c_char,
        location: *const ::core::ffi::c_char,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    pub fn pdf_preview_signature_as_pixmap(
        ctx: *mut fz_context,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        lang: fz_text_language,
        signer: *mut pdf_pkcs7_signer,
        appearance_flags: ::core::ffi::c_int,
        graphic: *mut fz_image,
        reason: *const ::core::ffi::c_char,
        location: *const ::core::ffi::c_char,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn pdf_drop_signer(ctx: *mut fz_context, signer: *mut pdf_pkcs7_signer);
}
unsafe extern "C" {
    pub fn pdf_drop_verifier(ctx: *mut fz_context, verifier: *mut pdf_pkcs7_verifier);
}
unsafe extern "C" {
    pub fn pdf_field_reset(ctx: *mut fz_context, doc: *mut pdf_document, field: *mut pdf_obj);
}
unsafe extern "C" {
    pub fn pdf_lookup_field(
        ctx: *mut fz_context,
        form: *mut pdf_obj,
        name: *const ::core::ffi::c_char,
    ) -> *mut pdf_obj;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_keystroke_event {
    pub value: *const ::core::ffi::c_char,
    pub change: *const ::core::ffi::c_char,
    pub selStart: ::core::ffi::c_int,
    pub selEnd: ::core::ffi::c_int,
    pub willCommit: ::core::ffi::c_int,
    pub newChange: *mut ::core::ffi::c_char,
    pub newValue: *mut ::core::ffi::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_keystroke_event"][::core::mem::size_of::<pdf_keystroke_event>() - 48usize];
    ["Alignment of pdf_keystroke_event"][::core::mem::align_of::<pdf_keystroke_event>() - 8usize];
    ["Offset of field: pdf_keystroke_event::value"]
        [::core::mem::offset_of!(pdf_keystroke_event, value) - 0usize];
    ["Offset of field: pdf_keystroke_event::change"]
        [::core::mem::offset_of!(pdf_keystroke_event, change) - 8usize];
    ["Offset of field: pdf_keystroke_event::selStart"]
        [::core::mem::offset_of!(pdf_keystroke_event, selStart) - 16usize];
    ["Offset of field: pdf_keystroke_event::selEnd"]
        [::core::mem::offset_of!(pdf_keystroke_event, selEnd) - 20usize];
    ["Offset of field: pdf_keystroke_event::willCommit"]
        [::core::mem::offset_of!(pdf_keystroke_event, willCommit) - 24usize];
    ["Offset of field: pdf_keystroke_event::newChange"]
        [::core::mem::offset_of!(pdf_keystroke_event, newChange) - 32usize];
    ["Offset of field: pdf_keystroke_event::newValue"]
        [::core::mem::offset_of!(pdf_keystroke_event, newValue) - 40usize];
};
unsafe extern "C" {
    pub fn pdf_field_event_keystroke(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
        evt: *mut pdf_keystroke_event,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_field_event_validate(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
        value: *const ::core::ffi::c_char,
        newvalue: *mut *mut ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_field_event_calculate(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
    );
}
unsafe extern "C" {
    pub fn pdf_field_event_format(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        field: *mut pdf_obj,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_annot_field_event_keystroke(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        annot: *mut pdf_annot,
        evt: *mut pdf_keystroke_event,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_document_event_will_close(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_document_event_will_save(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_document_event_did_save(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_document_event_will_print(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_document_event_did_print(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_page_event_open(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_page_event_close(ctx: *mut fz_context, page: *mut pdf_page);
}
unsafe extern "C" {
    pub fn pdf_annot_event_enter(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_exit(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_down(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_up(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_focus(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_blur(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_page_open(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_page_close(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_page_visible(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_annot_event_page_invisible(ctx: *mut fz_context, annot: *mut pdf_annot);
}
unsafe extern "C" {
    pub fn pdf_bake_document(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        bake_annots: ::core::ffi::c_int,
        bake_widgets: ::core::ffi::c_int,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_doc_event {
    pub type_: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_doc_event"][::core::mem::size_of::<pdf_doc_event>() - 4usize];
    ["Alignment of pdf_doc_event"][::core::mem::align_of::<pdf_doc_event>() - 4usize];
    ["Offset of field: pdf_doc_event::type_"]
        [::core::mem::offset_of!(pdf_doc_event, type_) - 0usize];
};
pub const PDF_DOCUMENT_EVENT_ALERT: _bindgen_ty_49 = 0;
pub const PDF_DOCUMENT_EVENT_PRINT: _bindgen_ty_49 = 1;
pub const PDF_DOCUMENT_EVENT_LAUNCH_URL: _bindgen_ty_49 = 2;
pub const PDF_DOCUMENT_EVENT_MAIL_DOC: _bindgen_ty_49 = 3;
pub const PDF_DOCUMENT_EVENT_SUBMIT: _bindgen_ty_49 = 4;
pub const PDF_DOCUMENT_EVENT_EXEC_MENU_ITEM: _bindgen_ty_49 = 5;
pub type _bindgen_ty_49 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_set_doc_event_callback(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        event_cb: pdf_doc_event_cb,
        free_event_data_cb: pdf_free_doc_event_data_cb,
        data: *mut ::core::ffi::c_void,
    );
}
unsafe extern "C" {
    pub fn pdf_get_doc_event_callback_data(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
    ) -> *mut ::core::ffi::c_void;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_alert_event {
    pub doc: *mut pdf_document,
    pub message: *const ::core::ffi::c_char,
    pub icon_type: ::core::ffi::c_int,
    pub button_group_type: ::core::ffi::c_int,
    pub title: *const ::core::ffi::c_char,
    pub has_check_box: ::core::ffi::c_int,
    pub check_box_message: *const ::core::ffi::c_char,
    pub initially_checked: ::core::ffi::c_int,
    pub finally_checked: ::core::ffi::c_int,
    pub button_pressed: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_alert_event"][::core::mem::size_of::<pdf_alert_event>() - 64usize];
    ["Alignment of pdf_alert_event"][::core::mem::align_of::<pdf_alert_event>() - 8usize];
    ["Offset of field: pdf_alert_event::doc"]
        [::core::mem::offset_of!(pdf_alert_event, doc) - 0usize];
    ["Offset of field: pdf_alert_event::message"]
        [::core::mem::offset_of!(pdf_alert_event, message) - 8usize];
    ["Offset of field: pdf_alert_event::icon_type"]
        [::core::mem::offset_of!(pdf_alert_event, icon_type) - 16usize];
    ["Offset of field: pdf_alert_event::button_group_type"]
        [::core::mem::offset_of!(pdf_alert_event, button_group_type) - 20usize];
    ["Offset of field: pdf_alert_event::title"]
        [::core::mem::offset_of!(pdf_alert_event, title) - 24usize];
    ["Offset of field: pdf_alert_event::has_check_box"]
        [::core::mem::offset_of!(pdf_alert_event, has_check_box) - 32usize];
    ["Offset of field: pdf_alert_event::check_box_message"]
        [::core::mem::offset_of!(pdf_alert_event, check_box_message) - 40usize];
    ["Offset of field: pdf_alert_event::initially_checked"]
        [::core::mem::offset_of!(pdf_alert_event, initially_checked) - 48usize];
    ["Offset of field: pdf_alert_event::finally_checked"]
        [::core::mem::offset_of!(pdf_alert_event, finally_checked) - 52usize];
    ["Offset of field: pdf_alert_event::button_pressed"]
        [::core::mem::offset_of!(pdf_alert_event, button_pressed) - 56usize];
};
pub const PDF_ALERT_ICON_ERROR: _bindgen_ty_50 = 0;
pub const PDF_ALERT_ICON_WARNING: _bindgen_ty_50 = 1;
pub const PDF_ALERT_ICON_QUESTION: _bindgen_ty_50 = 2;
pub const PDF_ALERT_ICON_STATUS: _bindgen_ty_50 = 3;
pub type _bindgen_ty_50 = ::core::ffi::c_uint;
pub const PDF_ALERT_BUTTON_GROUP_OK: _bindgen_ty_51 = 0;
pub const PDF_ALERT_BUTTON_GROUP_OK_CANCEL: _bindgen_ty_51 = 1;
pub const PDF_ALERT_BUTTON_GROUP_YES_NO: _bindgen_ty_51 = 2;
pub const PDF_ALERT_BUTTON_GROUP_YES_NO_CANCEL: _bindgen_ty_51 = 3;
pub type _bindgen_ty_51 = ::core::ffi::c_uint;
pub const PDF_ALERT_BUTTON_NONE: _bindgen_ty_52 = 0;
pub const PDF_ALERT_BUTTON_OK: _bindgen_ty_52 = 1;
pub const PDF_ALERT_BUTTON_CANCEL: _bindgen_ty_52 = 2;
pub const PDF_ALERT_BUTTON_NO: _bindgen_ty_52 = 3;
pub const PDF_ALERT_BUTTON_YES: _bindgen_ty_52 = 4;
pub type _bindgen_ty_52 = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_access_alert_event(
        ctx: *mut fz_context,
        evt: *mut pdf_doc_event,
    ) -> *mut pdf_alert_event;
}
unsafe extern "C" {
    pub fn pdf_access_exec_menu_item_event(
        ctx: *mut fz_context,
        evt: *mut pdf_doc_event,
    ) -> *const ::core::ffi::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_launch_url_event {
    pub url: *const ::core::ffi::c_char,
    pub new_frame: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_launch_url_event"][::core::mem::size_of::<pdf_launch_url_event>() - 16usize];
    ["Alignment of pdf_launch_url_event"][::core::mem::align_of::<pdf_launch_url_event>() - 8usize];
    ["Offset of field: pdf_launch_url_event::url"]
        [::core::mem::offset_of!(pdf_launch_url_event, url) - 0usize];
    ["Offset of field: pdf_launch_url_event::new_frame"]
        [::core::mem::offset_of!(pdf_launch_url_event, new_frame) - 8usize];
};
unsafe extern "C" {
    pub fn pdf_access_launch_url_event(
        ctx: *mut fz_context,
        evt: *mut pdf_doc_event,
    ) -> *mut pdf_launch_url_event;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_mail_doc_event {
    pub ask_user: ::core::ffi::c_int,
    pub to: *const ::core::ffi::c_char,
    pub cc: *const ::core::ffi::c_char,
    pub bcc: *const ::core::ffi::c_char,
    pub subject: *const ::core::ffi::c_char,
    pub message: *const ::core::ffi::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_mail_doc_event"][::core::mem::size_of::<pdf_mail_doc_event>() - 48usize];
    ["Alignment of pdf_mail_doc_event"][::core::mem::align_of::<pdf_mail_doc_event>() - 8usize];
    ["Offset of field: pdf_mail_doc_event::ask_user"]
        [::core::mem::offset_of!(pdf_mail_doc_event, ask_user) - 0usize];
    ["Offset of field: pdf_mail_doc_event::to"]
        [::core::mem::offset_of!(pdf_mail_doc_event, to) - 8usize];
    ["Offset of field: pdf_mail_doc_event::cc"]
        [::core::mem::offset_of!(pdf_mail_doc_event, cc) - 16usize];
    ["Offset of field: pdf_mail_doc_event::bcc"]
        [::core::mem::offset_of!(pdf_mail_doc_event, bcc) - 24usize];
    ["Offset of field: pdf_mail_doc_event::subject"]
        [::core::mem::offset_of!(pdf_mail_doc_event, subject) - 32usize];
    ["Offset of field: pdf_mail_doc_event::message"]
        [::core::mem::offset_of!(pdf_mail_doc_event, message) - 40usize];
};
unsafe extern "C" {
    pub fn pdf_access_mail_doc_event(
        ctx: *mut fz_context,
        evt: *mut pdf_doc_event,
    ) -> *mut pdf_mail_doc_event;
}
unsafe extern "C" {
    pub fn pdf_event_issue_alert(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        evt: *mut pdf_alert_event,
    );
}
unsafe extern "C" {
    pub fn pdf_event_issue_print(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_event_issue_exec_menu_item(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        item: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_event_issue_launch_url(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        url: *const ::core::ffi::c_char,
        new_frame: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_event_issue_mail_doc(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        evt: *mut pdf_mail_doc_event,
    );
}
unsafe extern "C" {
    pub fn pdf_enable_js(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_disable_js(ctx: *mut fz_context, doc: *mut pdf_document);
}
unsafe extern "C" {
    pub fn pdf_js_supported(ctx: *mut fz_context, doc: *mut pdf_document) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_drop_js(ctx: *mut fz_context, js: *mut pdf_js);
}
unsafe extern "C" {
    pub fn pdf_js_event_init(
        js: *mut pdf_js,
        target: *mut pdf_obj,
        value: *const ::core::ffi::c_char,
        willCommit: ::core::ffi::c_int,
    );
}
unsafe extern "C" {
    pub fn pdf_js_event_result(js: *mut pdf_js) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_js_event_result_validate(
        js: *mut pdf_js,
        newvalue: *mut *mut ::core::ffi::c_char,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_js_event_value(js: *mut pdf_js) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn pdf_js_event_init_keystroke(
        js: *mut pdf_js,
        target: *mut pdf_obj,
        evt: *mut pdf_keystroke_event,
    );
}
unsafe extern "C" {
    pub fn pdf_js_event_result_keystroke(
        js: *mut pdf_js,
        evt: *mut pdf_keystroke_event,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn pdf_js_execute(
        js: *mut pdf_js,
        name: *const ::core::ffi::c_char,
        code: *const ::core::ffi::c_char,
        result: *mut *mut ::core::ffi::c_char,
    );
}
pub const FZ_SUBSAMPLE_AVERAGE: _bindgen_ty_53 = 0;
pub const FZ_SUBSAMPLE_BICUBIC: _bindgen_ty_53 = 1;
pub type _bindgen_ty_53 = ::core::ffi::c_uint;
pub const FZ_RECOMPRESS_NEVER: _bindgen_ty_54 = 0;
pub const FZ_RECOMPRESS_SAME: _bindgen_ty_54 = 1;
pub const FZ_RECOMPRESS_LOSSLESS: _bindgen_ty_54 = 2;
pub const FZ_RECOMPRESS_JPEG: _bindgen_ty_54 = 3;
pub const FZ_RECOMPRESS_J2K: _bindgen_ty_54 = 4;
pub const FZ_RECOMPRESS_FAX: _bindgen_ty_54 = 5;
pub type _bindgen_ty_54 = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_image_rewriter_options {
    pub color_lossless_image_subsample_method: ::core::ffi::c_int,
    pub color_lossy_image_subsample_method: ::core::ffi::c_int,
    pub color_lossless_image_subsample_threshold: ::core::ffi::c_int,
    pub color_lossless_image_subsample_to: ::core::ffi::c_int,
    pub color_lossy_image_subsample_threshold: ::core::ffi::c_int,
    pub color_lossy_image_subsample_to: ::core::ffi::c_int,
    pub color_lossless_image_recompress_method: ::core::ffi::c_int,
    pub color_lossy_image_recompress_method: ::core::ffi::c_int,
    pub color_lossy_image_recompress_quality: *mut ::core::ffi::c_char,
    pub color_lossless_image_recompress_quality: *mut ::core::ffi::c_char,
    pub gray_lossless_image_subsample_method: ::core::ffi::c_int,
    pub gray_lossy_image_subsample_method: ::core::ffi::c_int,
    pub gray_lossless_image_subsample_threshold: ::core::ffi::c_int,
    pub gray_lossless_image_subsample_to: ::core::ffi::c_int,
    pub gray_lossy_image_subsample_threshold: ::core::ffi::c_int,
    pub gray_lossy_image_subsample_to: ::core::ffi::c_int,
    pub gray_lossless_image_recompress_method: ::core::ffi::c_int,
    pub gray_lossy_image_recompress_method: ::core::ffi::c_int,
    pub gray_lossy_image_recompress_quality: *mut ::core::ffi::c_char,
    pub gray_lossless_image_recompress_quality: *mut ::core::ffi::c_char,
    pub bitonal_image_subsample_method: ::core::ffi::c_int,
    pub bitonal_image_subsample_threshold: ::core::ffi::c_int,
    pub bitonal_image_subsample_to: ::core::ffi::c_int,
    pub bitonal_image_recompress_method: ::core::ffi::c_int,
    pub bitonal_image_recompress_quality: *mut ::core::ffi::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_image_rewriter_options"]
        [::core::mem::size_of::<pdf_image_rewriter_options>() - 120usize];
    ["Alignment of pdf_image_rewriter_options"]
        [::core::mem::align_of::<pdf_image_rewriter_options>() - 8usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossless_image_subsample_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossless_image_subsample_method
    )
        - 0usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossy_image_subsample_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossy_image_subsample_method
    ) - 4usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossless_image_subsample_threshold"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossless_image_subsample_threshold
    )
        - 8usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossless_image_subsample_to"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossless_image_subsample_to
    ) - 12usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossy_image_subsample_threshold"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossy_image_subsample_threshold
    )
        - 16usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossy_image_subsample_to"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossy_image_subsample_to
    ) - 20usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossless_image_recompress_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossless_image_recompress_method
    )
        - 24usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossy_image_recompress_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossy_image_recompress_method
    )
        - 28usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossy_image_recompress_quality"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossy_image_recompress_quality
    )
        - 32usize];
    ["Offset of field: pdf_image_rewriter_options::color_lossless_image_recompress_quality"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        color_lossless_image_recompress_quality
    )
        - 40usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossless_image_subsample_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossless_image_subsample_method
    )
        - 48usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossy_image_subsample_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossy_image_subsample_method
    ) - 52usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossless_image_subsample_threshold"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossless_image_subsample_threshold
    )
        - 56usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossless_image_subsample_to"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossless_image_subsample_to
    ) - 60usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossy_image_subsample_threshold"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossy_image_subsample_threshold
    )
        - 64usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossy_image_subsample_to"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossy_image_subsample_to
    ) - 68usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossless_image_recompress_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossless_image_recompress_method
    )
        - 72usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossy_image_recompress_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossy_image_recompress_method
    )
        - 76usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossy_image_recompress_quality"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossy_image_recompress_quality
    )
        - 80usize];
    ["Offset of field: pdf_image_rewriter_options::gray_lossless_image_recompress_quality"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        gray_lossless_image_recompress_quality
    )
        - 88usize];
    ["Offset of field: pdf_image_rewriter_options::bitonal_image_subsample_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        bitonal_image_subsample_method
    ) - 96usize];
    ["Offset of field: pdf_image_rewriter_options::bitonal_image_subsample_threshold"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        bitonal_image_subsample_threshold
    )
        - 100usize];
    ["Offset of field: pdf_image_rewriter_options::bitonal_image_subsample_to"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        bitonal_image_subsample_to
    ) - 104usize];
    ["Offset of field: pdf_image_rewriter_options::bitonal_image_recompress_method"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        bitonal_image_recompress_method
    ) - 108usize];
    ["Offset of field: pdf_image_rewriter_options::bitonal_image_recompress_quality"][::core::mem::offset_of!(
        pdf_image_rewriter_options,
        bitonal_image_recompress_quality
    ) - 112usize];
};
unsafe extern "C" {
    pub fn pdf_rewrite_images(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        opts: *mut pdf_image_rewriter_options,
    );
}
pub const PDF_CLEAN_STRUCTURE_DROP: pdf_clean_options_structure = 0;
pub const PDF_CLEAN_STRUCTURE_KEEP: pdf_clean_options_structure = 1;
#[doc = "Specifies whether the PDF's structure tree should be dropped or<br>kept when rearranging or subsetting its pages.\n\n`PDF_CLEAN_STRUCTURE_DROP`: Remove the structure tree entirely.\n\n`PDF_CLEAN_STRUCTURE_KEEP`: Preserve the structure tree. When<br>redacting a document, preserving the structure tree might leak<br>information."]
pub type pdf_clean_options_structure = ::core::ffi::c_uint;
pub const PDF_CLEAN_VECTORIZE_NO: pdf_clean_options_vectorize = 0;
pub const PDF_CLEAN_VECTORIZE_YES: pdf_clean_options_vectorize = 1;
pub type pdf_clean_options_vectorize = ::core::ffi::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_clean_options {
    pub write: pdf_write_options,
    pub image: pdf_image_rewriter_options,
    pub subset_fonts: ::core::ffi::c_int,
    pub structure: pdf_clean_options_structure,
    pub vectorize: pdf_clean_options_vectorize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_clean_options"][::core::mem::size_of::<pdf_clean_options>() - 472usize];
    ["Alignment of pdf_clean_options"][::core::mem::align_of::<pdf_clean_options>() - 8usize];
    ["Offset of field: pdf_clean_options::write"]
        [::core::mem::offset_of!(pdf_clean_options, write) - 0usize];
    ["Offset of field: pdf_clean_options::image"]
        [::core::mem::offset_of!(pdf_clean_options, image) - 336usize];
    ["Offset of field: pdf_clean_options::subset_fonts"]
        [::core::mem::offset_of!(pdf_clean_options, subset_fonts) - 456usize];
    ["Offset of field: pdf_clean_options::structure"]
        [::core::mem::offset_of!(pdf_clean_options, structure) - 460usize];
    ["Offset of field: pdf_clean_options::vectorize"]
        [::core::mem::offset_of!(pdf_clean_options, vectorize) - 464usize];
};
unsafe extern "C" {
    pub fn pdf_clean_file(
        ctx: *mut fz_context,
        infile: *mut ::core::ffi::c_char,
        outfile: *mut ::core::ffi::c_char,
        password: *mut ::core::ffi::c_char,
        opts: *mut pdf_clean_options,
        retainlen: ::core::ffi::c_int,
        retainlist: *mut *mut ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn pdf_rearrange_pages(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        count: ::core::ffi::c_int,
        pages: *const ::core::ffi::c_int,
        structure: pdf_clean_options_structure,
    );
}
unsafe extern "C" {
    pub fn pdf_vectorize_pages(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        count: ::core::ffi::c_int,
        new_page_list: *const ::core::ffi::c_int,
        vectorize: pdf_clean_options_vectorize,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pdf_recolor_options {
    pub num_comp: ::core::ffi::c_int,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of pdf_recolor_options"][::core::mem::size_of::<pdf_recolor_options>() - 4usize];
    ["Alignment of pdf_recolor_options"][::core::mem::align_of::<pdf_recolor_options>() - 4usize];
    ["Offset of field: pdf_recolor_options::num_comp"]
        [::core::mem::offset_of!(pdf_recolor_options, num_comp) - 0usize];
};
unsafe extern "C" {
    pub fn pdf_recolor_page(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        pagenum: ::core::ffi::c_int,
        opts: *const pdf_recolor_options,
    );
}
unsafe extern "C" {
    pub fn pdf_remove_output_intents(ctx: *mut fz_context, doc: *mut pdf_document);
}
pub const PDF_NOT_ZUGFERD: pdf_zugferd_profile = 0;
pub const PDF_ZUGFERD_COMFORT: pdf_zugferd_profile = 1;
pub const PDF_ZUGFERD_BASIC: pdf_zugferd_profile = 2;
pub const PDF_ZUGFERD_EXTENDED: pdf_zugferd_profile = 3;
pub const PDF_ZUGFERD_BASIC_WL: pdf_zugferd_profile = 4;
pub const PDF_ZUGFERD_MINIMUM: pdf_zugferd_profile = 5;
pub const PDF_ZUGFERD_XRECHNUNG: pdf_zugferd_profile = 6;
pub const PDF_ZUGFERD_UNKNOWN: pdf_zugferd_profile = 7;
pub type pdf_zugferd_profile = ::core::ffi::c_uint;
unsafe extern "C" {
    pub fn pdf_zugferd_profile(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        version: *mut f32,
    ) -> pdf_zugferd_profile;
}
unsafe extern "C" {
    pub fn pdf_zugferd_xml(ctx: *mut fz_context, doc: *mut pdf_document) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn pdf_zugferd_profile_to_string(
        ctx: *mut fz_context,
        profile: pdf_zugferd_profile,
    ) -> *const ::core::ffi::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mupdf_error {
    pub type_: ::core::ffi::c_int,
    pub message: *mut ::core::ffi::c_char,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of mupdf_error"][::core::mem::size_of::<mupdf_error>() - 16usize];
    ["Alignment of mupdf_error"][::core::mem::align_of::<mupdf_error>() - 8usize];
    ["Offset of field: mupdf_error::type_"][::core::mem::offset_of!(mupdf_error, type_) - 0usize];
    ["Offset of field: mupdf_error::message"]
        [::core::mem::offset_of!(mupdf_error, message) - 8usize];
};
pub type mupdf_error_t = mupdf_error;
unsafe extern "C" {
    pub fn mupdf_save_error(ctx: *mut fz_context, errptr: *mut *mut mupdf_error_t);
}
unsafe extern "C" {
    pub fn mupdf_new_error_from_str(message: *const ::core::ffi::c_char) -> *mut mupdf_error_t;
}
unsafe extern "C" {
    pub fn mupdf_new_bitmap_from_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_bitmap;
}
unsafe extern "C" {
    pub fn mupdf_highlight_selection(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        a: fz_point,
        b: fz_point,
        quads: *mut fz_quad,
        max_quads: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> i32;
}
unsafe extern "C" {
    pub fn mupdf_search_stext_page_cb(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        needle: *const ::core::ffi::c_char,
        cb: fz_search_callback_fn,
        opaque: *mut ::core::ffi::c_void,
        errptr: *mut *mut mupdf_error_t,
    ) -> i32;
}
unsafe extern "C" {
    pub fn mupdf_format_string(
        ctx: *mut fz_context,
        user: *mut ::core::ffi::c_void,
        emit: ::core::option::Option<
            unsafe extern "C" fn(
                ctx: *mut fz_context,
                user: *mut ::core::ffi::c_void,
                c: ::core::ffi::c_int,
            ),
        >,
        fmt: *const ::core::ffi::c_char,
        ...
    );
}
unsafe extern "C" {
    pub fn mupdf_buffer_read_bytes(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        at: usize,
        output: *mut ::core::ffi::c_uchar,
        buf_len: usize,
        errptr: *mut *mut mupdf_error_t,
    ) -> usize;
}
unsafe extern "C" {
    pub fn mupdf_buffer_write_bytes(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        bytes: *const ::core::ffi::c_uchar,
        len: usize,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_buffer_from_str(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_buffer_from_base64(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_new_cookie(
        ctx: *mut fz_context,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_cookie;
}
unsafe extern "C" {
    pub fn mupdf_convert_color(
        ctx: *mut fz_context,
        ss: *mut fz_colorspace,
        sv: *const f32,
        ds: *mut fz_colorspace,
        dv: *mut f32,
        is: *mut fz_colorspace,
        params: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_drop_base_context(ctx: *mut fz_context);
}
unsafe extern "C" {
    pub fn mupdf_new_base_context() -> *mut fz_context;
}
unsafe extern "C" {
    pub fn mupdf_new_draw_device(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        clip: fz_irect,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn mupdf_new_device_of_size(
        ctx: *mut fz_context,
        size: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn mupdf_new_display_list_device(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn mupdf_new_stext_device(
        ctx: *mut fz_context,
        tp: *mut fz_stext_page,
        flags: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn mupdf_fill_path(
        ctx: *mut fz_context,
        device: *mut fz_device,
        path: *mut fz_path,
        even_odd: bool,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_stroke_path(
        ctx: *mut fz_context,
        device: *mut fz_device,
        path: *mut fz_path,
        stroke: *mut fz_stroke_state,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_clip_path(
        ctx: *mut fz_context,
        device: *mut fz_device,
        path: *mut fz_path,
        even_odd: bool,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_clip_stroke_path(
        ctx: *mut fz_context,
        device: *mut fz_device,
        path: *mut fz_path,
        stroke: *mut fz_stroke_state,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_fill_text(
        ctx: *mut fz_context,
        device: *mut fz_device,
        text: *mut fz_text,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_stroke_text(
        ctx: *mut fz_context,
        device: *mut fz_device,
        text: *mut fz_text,
        stroke: *mut fz_stroke_state,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_clip_text(
        ctx: *mut fz_context,
        device: *mut fz_device,
        text: *mut fz_text,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_clip_stroke_text(
        ctx: *mut fz_context,
        device: *mut fz_device,
        text: *mut fz_text,
        stroke: *mut fz_stroke_state,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_ignore_text(
        ctx: *mut fz_context,
        device: *mut fz_device,
        text: *mut fz_text,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_fill_shade(
        ctx: *mut fz_context,
        device: *mut fz_device,
        shade: *mut fz_shade,
        ctm: fz_matrix,
        alpha: f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_fill_image(
        ctx: *mut fz_context,
        device: *mut fz_device,
        image: *mut fz_image,
        ctm: fz_matrix,
        alpha: f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_fill_image_mask(
        ctx: *mut fz_context,
        device: *mut fz_device,
        image: *mut fz_image,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        color: *const f32,
        alpha: f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_clip_image_mask(
        ctx: *mut fz_context,
        device: *mut fz_device,
        image: *mut fz_image,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pop_clip(
        ctx: *mut fz_context,
        device: *mut fz_device,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_begin_layer(
        ctx: *mut fz_context,
        device: *mut fz_device,
        name: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_end_layer(
        ctx: *mut fz_context,
        device: *mut fz_device,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_begin_structure(
        ctx: *mut fz_context,
        device: *mut fz_device,
        standard: fz_structure,
        raw: *const ::core::ffi::c_char,
        idx: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_end_structure(
        ctx: *mut fz_context,
        device: *mut fz_device,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_begin_metatext(
        ctx: *mut fz_context,
        device: *mut fz_device,
        meta: fz_metatext,
        text: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_end_metatext(
        ctx: *mut fz_context,
        device: *mut fz_device,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_begin_mask(
        ctx: *mut fz_context,
        device: *mut fz_device,
        area: fz_rect,
        luminosity: bool,
        cs: *mut fz_colorspace,
        color: *const f32,
        cp: fz_color_params,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_end_mask(
        ctx: *mut fz_context,
        device: *mut fz_device,
        fn_: *mut fz_function,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_begin_group(
        ctx: *mut fz_context,
        device: *mut fz_device,
        area: fz_rect,
        cs: *mut fz_colorspace,
        isolated: bool,
        knockout: bool,
        blendmode: ::core::ffi::c_int,
        alpha: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_end_group(
        ctx: *mut fz_context,
        device: *mut fz_device,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_begin_tile(
        ctx: *mut fz_context,
        device: *mut fz_device,
        area: fz_rect,
        view: fz_rect,
        xstep: f32,
        ystep: f32,
        ctm: fz_matrix,
        id: ::core::ffi::c_int,
        doc_id: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_end_tile(
        ctx: *mut fz_context,
        device: *mut fz_device,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_new_display_list(
        ctx: *mut fz_context,
        mediabox: fz_rect,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    pub fn mupdf_display_list_to_pixmap(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: bool,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn mupdf_display_list_to_svg(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_display_list_to_text_page(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        flags: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn mupdf_display_list_run(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        device: *mut fz_device,
        ctm: fz_matrix,
        area: fz_rect,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_search_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        needle: *const ::core::ffi::c_char,
        hit_max: ::core::ffi::c_int,
        hit_count: *mut ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_quad;
}
unsafe extern "C" {
    pub fn mupdf_open_document(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    pub fn mupdf_open_document_from_bytes(
        ctx: *mut fz_context,
        bytes: *mut fz_buffer,
        magic: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_document;
}
unsafe extern "C" {
    pub fn mupdf_recognize_document(
        ctx: *mut fz_context,
        magic: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_needs_password(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_authenticate_password(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        password: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_document_page_count(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_lookup_metadata(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        key: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn mupdf_is_document_reflowable(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_layout_document(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        w: f32,
        h: f32,
        em: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_load_page(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        page_no: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_page;
}
unsafe extern "C" {
    pub fn mupdf_convert_to_pdf(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        fp: ::core::ffi::c_int,
        tp: ::core::ffi::c_int,
        rotate: ::core::ffi::c_int,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn mupdf_resolve_link(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        uri: *const ::core::ffi::c_char,
        xp: *mut f32,
        yp: *mut f32,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_location;
}
unsafe extern "C" {
    pub fn mupdf_resolve_link_dest(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        uri: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_link_dest;
}
unsafe extern "C" {
    pub fn mupdf_document_output_intent(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_colorspace;
}
unsafe extern "C" {
    pub fn mupdf_load_outline(
        ctx: *mut fz_context,
        doc: *mut fz_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_outline;
}
unsafe extern "C" {
    pub fn mupdf_drop_error(err: *mut mupdf_error_t);
}
unsafe extern "C" {
    pub fn mupdf_drop_str(s: *mut ::core::ffi::c_char);
}
unsafe extern "C" {
    pub fn mupdf_new_font(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        index: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    pub fn mupdf_new_font_from_buffer(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        index: ::core::ffi::c_int,
        buffer: *mut fz_buffer,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_font;
}
unsafe extern "C" {
    pub fn mupdf_encode_character(
        ctx: *mut fz_context,
        font: *mut fz_font,
        unicode: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_advance_glyph(
        ctx: *mut fz_context,
        font: *mut fz_font,
        glyph: ::core::ffi::c_int,
        wmode: bool,
        errptr: *mut *mut mupdf_error_t,
    ) -> f32;
}
unsafe extern "C" {
    pub fn mupdf_outline_glyph(
        ctx: *mut fz_context,
        font: *mut fz_font,
        glyph: ::core::ffi::c_int,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_path;
}
unsafe extern "C" {
    pub fn mupdf_new_image_from_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    pub fn mupdf_new_image_from_file(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    pub fn mupdf_new_image_from_display_list(
        ctx: *mut fz_context,
        list: *mut fz_display_list,
        w: f32,
        h: f32,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_image;
}
unsafe extern "C" {
    pub fn mupdf_get_pixmap_from_image(
        ctx: *mut fz_context,
        image: *mut fz_image,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn mupdf_bound_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn mupdf_page_to_pixmap(
        ctx: *mut fz_context,
        page: *mut fz_page,
        ctm: fz_matrix,
        cs: *mut fz_colorspace,
        alpha: bool,
        show_extras: bool,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn mupdf_page_to_svg(
        ctx: *mut fz_context,
        page: *mut fz_page,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_new_stext_page_from_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        options: *const fz_stext_options,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_stext_page;
}
unsafe extern "C" {
    pub fn mupdf_page_to_display_list(
        ctx: *mut fz_context,
        page: *mut fz_page,
        annots: bool,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_display_list;
}
unsafe extern "C" {
    pub fn mupdf_run_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        device: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_run_page_contents(
        ctx: *mut fz_context,
        page: *mut fz_page,
        device: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_run_page_annots(
        ctx: *mut fz_context,
        page: *mut fz_page,
        device: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_run_page_widgets(
        ctx: *mut fz_context,
        page: *mut fz_page,
        device: *mut fz_device,
        ctm: fz_matrix,
        cookie: *mut fz_cookie,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_new_output_with_buffer(
        ctx: *mut fz_context,
        buf: *mut fz_buffer,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_output;
}
unsafe extern "C" {
    pub fn mupdf_print_stext_page_as_html(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        id: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_header_as_html(
        ctx: *mut fz_context,
        out: *mut fz_output,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_trailer_as_html(
        ctx: *mut fz_context,
        out: *mut fz_output,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_page_as_xhtml(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        id: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_header_as_xhtml(
        ctx: *mut fz_context,
        out: *mut fz_output,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_trailer_as_xhtml(
        ctx: *mut fz_context,
        out: *mut fz_output,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_page_as_xml(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        id: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_page_as_text(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_print_stext_page_as_json(
        ctx: *mut fz_context,
        out: *mut fz_output,
        page: *mut fz_stext_page,
        scale: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_load_links(
        ctx: *mut fz_context,
        page: *mut fz_page,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_link;
}
unsafe extern "C" {
    pub fn mupdf_page_separations(
        ctx: *mut fz_context,
        page: *mut fz_page,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_separations;
}
unsafe extern "C" {
    pub fn mupdf_search_page(
        ctx: *mut fz_context,
        page: *mut fz_page,
        needle: *const ::core::ffi::c_char,
        hit_max: ::core::ffi::c_int,
        hit_count: *mut ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_quad;
}
unsafe extern "C" {
    pub fn mupdf_search_stext_page(
        ctx: *mut fz_context,
        page: *mut fz_stext_page,
        needle: *const ::core::ffi::c_char,
        hit_max: ::core::ffi::c_int,
        hit_count: *mut ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_quad;
}
unsafe extern "C" {
    pub fn mupdf_new_path(ctx: *mut fz_context, errptr: *mut *mut mupdf_error_t) -> *mut fz_path;
}
unsafe extern "C" {
    pub fn mupdf_clone_path(
        ctx: *mut fz_context,
        old_path: *mut fz_path,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_path;
}
unsafe extern "C" {
    pub fn mupdf_trim_path(
        ctx: *mut fz_context,
        path: *mut fz_path,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_moveto(
        ctx: *mut fz_context,
        path: *mut fz_path,
        x: f32,
        y: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_lineto(
        ctx: *mut fz_context,
        path: *mut fz_path,
        x: f32,
        y: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_closepath(
        ctx: *mut fz_context,
        path: *mut fz_path,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_rectto(
        ctx: *mut fz_context,
        path: *mut fz_path,
        x1: f32,
        y1: f32,
        x2: f32,
        y2: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_curveto(
        ctx: *mut fz_context,
        path: *mut fz_path,
        cx1: f32,
        cy1: f32,
        cx2: f32,
        cy2: f32,
        ex: f32,
        ey: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_curvetov(
        ctx: *mut fz_context,
        path: *mut fz_path,
        cx: f32,
        cy: f32,
        ex: f32,
        ey: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_curvetoy(
        ctx: *mut fz_context,
        path: *mut fz_path,
        cx: f32,
        cy: f32,
        ex: f32,
        ey: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_transform_path(
        ctx: *mut fz_context,
        path: *mut fz_path,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_bound_path(
        ctx: *mut fz_context,
        path: *mut fz_path,
        stroke: *mut fz_stroke_state,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn mupdf_walk_path(
        ctx: *mut fz_context,
        path: *const fz_path,
        walker: *const fz_path_walker,
        arg: *mut ::core::ffi::c_void,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_annot_type(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_pdf_annot_author(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        errptr: *mut *mut mupdf_error_t,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn mupdf_pdf_annot_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        errptr: *mut *mut mupdf_error_t,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        text: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_author(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        author: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_line(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        a: fz_point,
        b: fz_point,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_rect(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        rect: fz_rect,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_annot_rect(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_color(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        n: ::core::ffi::c_int,
        color: *const f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_flags(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        flags: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_popup(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        rect: fz_rect,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_active(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        active: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_border_width(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        width: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_set_annot_intent(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        intent: pdf_intent,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_filter_annot_contents(
        ctx: *mut fz_context,
        annot: *mut pdf_annot,
        filter: *mut pdf_filter_options,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_lookup_page_number(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        page_obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_pdf_open_document_from_bytes(
        ctx: *mut fz_context,
        bytes: *mut fz_buffer,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn mupdf_pdf_add_object(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_create_object(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_delete_object(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        num: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_add_image(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        image: *mut fz_image,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_add_font(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        font: *mut fz_font,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_add_cjk_font(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        font: *mut fz_font,
        ordering: ::core::ffi::c_int,
        wmode: ::core::ffi::c_int,
        serif: bool,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_add_simple_font(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        font: *mut fz_font,
        encoding: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_save_document(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        filename: *const ::core::ffi::c_char,
        pwo: pdf_write_options,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_write_document(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        pwo: pdf_write_options,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_pdf_enable_js(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_disable_js(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_js_supported(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_calculate_form(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_trailer(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_load_name_tree(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        name: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_catalog(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_count_objects(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_graft_map(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_graft_map;
}
unsafe extern "C" {
    pub fn mupdf_pdf_graft_object(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_graft_mapped_object(
        ctx: *mut fz_context,
        map: *mut pdf_graft_map,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_page(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        page_no: ::core::ffi::c_int,
        width: f32,
        height: f32,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_page;
}
unsafe extern "C" {
    pub fn mupdf_pdf_lookup_page_obj(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        page_no: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_insert_page(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        page_no: ::core::ffi::c_int,
        page: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_delete_page(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        page_no: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_begin_operation(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        operation: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_end_operation(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_abandon_operation(
        ctx: *mut fz_context,
        doc: *mut pdf_document,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_clone_obj(
        ctx: *mut fz_context,
        self_: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_get_bound_document(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
    ) -> *mut pdf_document;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_indirect(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_null(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_bool(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_int(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_real(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_number(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_string(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_name(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_array(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_dict(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_is_stream(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_null() -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_bool(b: bool) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_int(
        ctx: *mut fz_context,
        i: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_real(
        ctx: *mut fz_context,
        f: f32,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_string(
        ctx: *mut fz_context,
        s: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_name(
        ctx: *mut fz_context,
        name: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_indirect(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        num: ::core::ffi::c_int,
        gen_: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_array(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        capacity: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_new_dict(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        capacity: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_obj_from_str(
        ctx: *mut fz_context,
        pdf: *mut pdf_document,
        src: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_to_bool(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_to_int(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_pdf_to_float(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> f32;
}
unsafe extern "C" {
    pub fn mupdf_pdf_to_indirect(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_pdf_to_string(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn mupdf_pdf_to_name(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn mupdf_pdf_to_bytes(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        len: *mut usize,
        errptr: *mut *mut mupdf_error_t,
    ) -> *const ::core::ffi::c_uchar;
}
unsafe extern "C" {
    pub fn mupdf_pdf_resolve_indirect(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_array_get(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        index: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_dict_get_val(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        idx: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_dict_get_key(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        idx: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_dict_get(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        key: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_dict_get_inheritable(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        key: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_read_stream(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_pdf_read_raw_stream(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_pdf_write_object(
        ctx: *mut fz_context,
        self_: *mut pdf_obj,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_write_stream_buffer(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        buf: *mut fz_buffer,
        compressed: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_copy_array(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_obj;
}
unsafe extern "C" {
    pub fn mupdf_pdf_array_len(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_pdf_array_put(
        ctx: *mut fz_context,
        self_: *mut pdf_obj,
        i: ::core::ffi::c_int,
        item: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_array_push(
        ctx: *mut fz_context,
        self_: *mut pdf_obj,
        item: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_array_delete(
        ctx: *mut fz_context,
        self_: *mut pdf_obj,
        i: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_dict_len(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn mupdf_pdf_dict_put(
        ctx: *mut fz_context,
        self_: *mut pdf_obj,
        key: *mut pdf_obj,
        value: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_dict_delete(
        ctx: *mut fz_context,
        self_: *mut pdf_obj,
        key: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_obj_to_string(
        ctx: *mut fz_context,
        obj: *mut pdf_obj,
        tight: bool,
        ascii: bool,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut ::core::ffi::c_char;
}
unsafe extern "C" {
    pub fn mupdf_pdf_create_annot(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        subtype: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut pdf_annot;
}
unsafe extern "C" {
    pub fn mupdf_pdf_delete_annot(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        annot: *mut pdf_annot,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_update_page(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_redact_page(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        errptr: *mut *mut mupdf_error_t,
    ) -> bool;
}
unsafe extern "C" {
    pub fn mupdf_pdf_filter_page_contents(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        filter: *mut pdf_filter_options,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_page_set_rotation(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        rotation: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_page_set_crop_box(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        rect: fz_rect,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pdf_page_crop_box_position(ctx: *mut fz_context, page: *mut pdf_page) -> fz_point;
}
unsafe extern "C" {
    pub fn mupdf_pdf_page_media_box(ctx: *mut fz_context, page: *mut pdf_page) -> fz_rect;
}
unsafe extern "C" {
    pub fn mupdf_pdf_page_transform(
        ctx: *mut fz_context,
        page: *mut pdf_page,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_matrix;
}
unsafe extern "C" {
    pub fn mupdf_pdf_page_obj_transform(
        ctx: *mut fz_context,
        page: *mut pdf_obj,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_matrix;
}
unsafe extern "C" {
    pub fn mupdf_new_pixmap(
        ctx: *mut fz_context,
        cs: *mut fz_colorspace,
        x: ::core::ffi::c_int,
        y: ::core::ffi::c_int,
        w: ::core::ffi::c_int,
        h: ::core::ffi::c_int,
        alpha: bool,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn mupdf_clone_pixmap(
        ctx: *mut fz_context,
        self_: *mut fz_pixmap,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_pixmap;
}
unsafe extern "C" {
    pub fn mupdf_clear_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_clear_pixmap_with_value(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        value: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_invert_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_gamma_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        gamma: f32,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_tint_pixmap(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        black: ::core::ffi::c_int,
        white: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_save_pixmap_as(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        filename: *const ::core::ffi::c_char,
        format: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    );
}
unsafe extern "C" {
    pub fn mupdf_pixmap_get_image_data(
        ctx: *mut fz_context,
        pixmap: *mut fz_pixmap,
        format: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_buffer;
}
unsafe extern "C" {
    pub fn mupdf_adjust_rect_for_stroke(
        ctx: *mut fz_context,
        self_: fz_rect,
        stroke: *mut fz_stroke_state,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn mupdf_new_text(ctx: *mut fz_context, errptr: *mut *mut mupdf_error_t) -> *mut fz_text;
}
unsafe extern "C" {
    pub fn mupdf_default_stroke_state(ctx: *mut fz_context) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    pub fn mupdf_new_stroke_state(
        ctx: *mut fz_context,
        start_cap: fz_linecap,
        dash_cap: fz_linecap,
        end_cap: fz_linecap,
        line_join: fz_linejoin,
        line_width: f32,
        miter_limit: f32,
        dash_phase: f32,
        dash: *const f32,
        dash_len: ::core::ffi::c_int,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_stroke_state;
}
unsafe extern "C" {
    pub fn mupdf_bound_text(
        ctx: *mut fz_context,
        text: *mut fz_text,
        stroke: *mut fz_stroke_state,
        ctm: fz_matrix,
        errptr: *mut *mut mupdf_error_t,
    ) -> fz_rect;
}
unsafe extern "C" {
    pub fn mupdf_new_document_writer(
        ctx: *mut fz_context,
        filename: *const ::core::ffi::c_char,
        format: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn mupdf_new_pdfocr_writer(
        ctx: *mut fz_context,
        path: *const ::core::ffi::c_char,
        options: *const ::core::ffi::c_char,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_document_writer;
}
unsafe extern "C" {
    pub fn mupdf_document_writer_begin_page(
        ctx: *mut fz_context,
        writer: *mut fz_document_writer,
        mediabox: fz_rect,
        errptr: *mut *mut mupdf_error_t,
    ) -> *mut fz_device;
}
unsafe extern "C" {
    pub fn mupdf_document_writer_end_page(
        ctx: *mut fz_context,
        writer: *mut fz_document_writer,
        errptr: *mut *mut mupdf_error_t,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fz_display_list {
    pub _address: u8,
}
