<commit_before>/* Copyright (c) 2005-2022 <NAME>
 *
 * This file is part of qpdf.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Versions of qpdf prior to version 7 were released under the terms
 * of version 2.0 of the Artistic License. At your option, you may
 * continue to consider qpdf to be licensed under those terms. Please
 * see the manual for additional information.
 */

#ifndef QPDFCONSTANTS_H
#define QPDFCONSTANTS_H

/* Keep this file 'C' compatible so it can be used from the C and C++
 * interfaces.
 */

/* Error Codes */

enum qpdf_error_code_e {
    qpdf_e_success = 0,
    qpdf_e_internal,    /* logic/programming error -- indicates bug */
    qpdf_e_system,      /* I/O error, memory error, etc. */
    qpdf_e_unsupported, /* PDF feature not (yet) supported by qpdf */
    qpdf_e_password,    /* incorrect password for encrypted file */
    qpdf_e_damaged_pdf, /* syntax errors or other damage in PDF */
    qpdf_e_pages,       /* erroneous or unsupported pages structure */
    qpdf_e_object,      /* type/bounds errors accessing objects */
};

/* Object Types */

/* PDF objects represented by QPDFObjectHandle or, in the C API, by
 * qpdf_oh, have a unique type code that has one of the values in the
 * list below. As new object types are added to qpdf, additional items
 * may be added to the list, so code that switches on these values
 * should take that into consideration. (Maintainer note: it would be
 * better to call this qpdf_ot_* rather than ot_* to reduce likelihood
 * of name collision, but since QPDFObject::object_type_e is an alias
 * to this type, changing the names of the values breaks backward
 * compatibility.)
 */
enum qpdf_object_type_e {
    /* Object types internal to qpdf */
    ot_uninitialized,
    ot_reserved,
    /* Object types that can occur in the main document */
    ot_null,
    ot_boolean,
    ot_integer,
    ot_real,
    ot_string,
    ot_name,
    ot_array,
    ot_dictionary,
    ot_stream,
    /* Additional object types that can occur in content streams */
    ot_operator,<commit_msg>Add new error type for JSON<commit_after>/* Copyright (c) 2005-2022 <NAME>
 *
 * This file is part of qpdf.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Versions of qpdf prior to version 7 were released under the terms
 * of version 2.0 of the Artistic License. At your option, you may
 * continue to consider qpdf to be licensed under those terms. Please
 * see the manual for additional information.
 */

#ifndef QPDFCONSTANTS_H
#define QPDFCONSTANTS_H

/* Keep this file 'C' compatible so it can be used from the C and C++
 * interfaces.
 */

/* Error Codes */

enum qpdf_error_code_e {
    qpdf_e_success = 0,
    qpdf_e_internal,    /* logic/programming error -- indicates bug */
    qpdf_e_system,      /* I/O error, memory error, etc. */
    qpdf_e_unsupported, /* PDF feature not (yet) supported by qpdf */
    qpdf_e_password,    /* incorrect password for encrypted file */
    qpdf_e_damaged_pdf, /* syntax errors or other damage in PDF */
    qpdf_e_pages,       /* erroneous or unsupported pages structure */
    qpdf_e_object,      /* type/bounds errors accessing objects */
    qpdf_e_json,        /* error in qpdf JSON */
};

/* Object Types */

/* PDF objects represented by QPDFObjectHandle or, in the C API, by
 * qpdf_oh, have a unique type code that has one of the values in the
 * list below. As new object types are added to qpdf, additional items
 * may be added to the list, so code that switches on these values
 * should take that into consideration. (Maintainer note: it would be
 * better to call this qpdf_ot_* rather than ot_* to reduce likelihood
 * of name collision, but since QPDFObject::object_type_e is an alias
 * to this type, changing the names of the values breaks backward
 * compatibility.)
 */
enum qpdf_object_type_e {
    /* Object types internal to qpdf */
    ot_uninitialized,
    ot_reserved,
    /* Object types that can occur in the main document */
    ot_null,
    ot_boolean,
    ot_integer,
    ot_real,
    ot_string,
    ot_name,
    ot_array,
    ot_dictionary,
    ot_stream,
    /* Additional object types that can occur in content streams */
    ot_operator,
{'fraction_non_alphanumeric': 0.07199078517949703, 'fraction_numerical': 0.006143213668650413, 'mean_word_length': 3.228896103896104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5075959', 'n_tokens_mistral': 1495, 'n_tokens_neox': 1454, 'n_words': 671}