diff --git a/data/miniconda3/include/ImageMagick-7/Magick++.h b/data/miniconda3/include/ImageMagick-7/Magick++.h new file mode 100644 index 0000000000000000000000000000000000000000..7ba39cb64405120a8cb4299f33f0f54ec34e0a5e --- /dev/null +++ b/data/miniconda3/include/ImageMagick-7/Magick++.h @@ -0,0 +1,25 @@ +// This may look like C code, but it is really -*- C++ -*- +// +// Copyright Bob Friesenhahn, 1999, 2000 +// +// Copyright @ 2013 ImageMagick Studio LLC, a non-profit organization +// dedicated to making software imaging solutions freely available. +// +// Simplified includes for Magick++. +// Inclusion of this header is sufficient to use all Magick++ APIs. +// +#ifndef MagickPlusPlus_Header +#include +#include +#include +#include +#include +#include + +// Don't leak our definition of the 'restrict' keyword. 'restrict' is a valid +// identifier in C++, and leaking it could cause extraneous build failures. +#ifdef restrict +#undef restrict +#endif +#define MagickPlusPlus_Header +#endif // MagickPlusPlus_Header diff --git a/data/miniconda3/include/graphite2/Font.h b/data/miniconda3/include/graphite2/Font.h new file mode 100644 index 0000000000000000000000000000000000000000..fe569295a53fd29156dcf88dcaa4547d135b14ad --- /dev/null +++ b/data/miniconda3/include/graphite2/Font.h @@ -0,0 +1,389 @@ +/* GRAPHITE2 LICENSING + + Copyright 2010, SIL International + All rights reserved. + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should also have received a copy of the GNU Lesser General Public + License along with this library in the file named "LICENSE". + If not, write to the Free Software Foundation, 51 Franklin Street, + Suite 500, Boston, MA 02110-1335, USA or visit their web page on the + internet at http://www.fsf.org/licenses/lgpl.html. + + Alternatively, the contents of this file may be used under the terms + of the Mozilla Public License (http://mozilla.org/MPL) or the GNU + General Public License, as published by the Free Software Foundation, + either version 2 of the License or (at your option) any later version. +*/ +#pragma once + +#include "graphite2/Types.h" + +#define GR2_VERSION_MAJOR 1 +#define GR2_VERSION_MINOR 3 +#define GR2_VERSION_BUGFIX 14 + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct gr_face gr_face; +typedef struct gr_font gr_font; +typedef struct gr_feature_ref gr_feature_ref; +typedef struct gr_feature_val gr_feature_val; + +/** +* Returns version information on this engine +*/ +GR2_API void gr_engine_version(int *nMajor, int *nMinor, int *nBugFix); + +/** +* The Face Options allow the application to require that certain tables are +* read during face construction. This may be of concern if the appFaceHandle +* used in the gr_get_table_fn may change. +* The values can be combined +*/ +enum gr_face_options { + /** No preload, no cmap caching, fail if the graphite tables are invalid */ + gr_face_default = 0, + /** Dumb rendering will be enabled if the graphite tables are invalid. @deprecated Since 1.311 */ + gr_face_dumbRendering = 1, + /** preload glyphs at construction time */ + gr_face_preloadGlyphs = 2, + /** Cache the lookup from code point to glyph ID at construction time */ + gr_face_cacheCmap = 4, + /** Preload everything */ + gr_face_preloadAll = gr_face_preloadGlyphs | gr_face_cacheCmap +}; + +/** Holds information about a particular Graphite silf table that has been loaded */ +struct gr_faceinfo { + gr_uint16 extra_ascent; /**< The extra_ascent in the GDL, in design units */ + gr_uint16 extra_descent; /**< The extra_descent in the GDL, in design units */ + gr_uint16 upem; /**< The design units for the font */ + enum gr_space_contextuals { + gr_space_unknown = 0, /**< no information is known. */ + gr_space_none = 1, /**< the space character never occurs in any rules. */ + gr_space_left_only = 2, /**< the space character only occurs as the first element in a rule. */ + gr_space_right_only = 3, /**< the space character only occurs as the last element in a rule. */ + gr_space_either_only = 4, /**< the space character only occurs as the only element in a rule. */ + gr_space_both = 5, /**< the space character may occur as the first or last element of a rule. */ + gr_space_cross = 6 /**< the space character occurs in a rule not as a first or last element. */ + } space_contextuals; + unsigned int has_bidi_pass : 1; /**< the table specifies that a bidirectional pass should run */ + unsigned int line_ends : 1; /**< there are line end contextuals somewhere */ + unsigned int justifies : 1; /**< there are .justify properties set somewhere on some glyphs */ +}; + +typedef struct gr_faceinfo gr_faceinfo; + +/** type describing function to retrieve font table information + * + * @return a pointer to the table in memory. The pointed to memory must exist as + * long as the gr_face which makes the call. + * @param appFaceHandle is the unique information passed to gr_make_face() + * @param name is a 32bit tag to the table name. + * @param len returned by this function to say how long the table is in memory. + */ +typedef const void *(*gr_get_table_fn)(const void* appFaceHandle, unsigned int name, size_t *len); + +/** type describing function to release any resources allocated by the above get_table table function + * + * @param appFaceHandle is the unique information passed to gr_make_face() + * @param pointer to table memory returned by get_table. + */ +typedef void (*gr_release_table_fn)(const void* appFaceHandle, const void *table_buffer); + +/** struct housing function pointers to manage font table buffers for the graphite engine. */ +struct gr_face_ops +{ + /** size in bytes of this structure */ + size_t size; + /** a pointer to a function to request a table from the client. */ + gr_get_table_fn get_table; + /** is a pointer to a function to notify the client the a table can be released. + * This can be NULL to signify that the client does not wish to do any release handling. */ + gr_release_table_fn release_table; +}; +typedef struct gr_face_ops gr_face_ops; + +/** Create a gr_face object given application information and a table functions. + * + * @return gr_face or NULL if the font fails to load for some reason. + * @param appFaceHandle This is application specific information that is passed + * to the getTable function. The appFaceHandle must stay + * alive as long as the gr_face is alive. + * @param face_ops Pointer to face specific callback structure for table + * management. Must stay alive for the duration of the + * call only. + * @param faceOptions Bitfield describing various options. See enum gr_face_options for details. + */ +GR2_API gr_face* gr_make_face_with_ops(const void* appFaceHandle/*non-NULL*/, const gr_face_ops *face_ops, unsigned int faceOptions); + +/** @deprecated Since v1.2.0 in favour of gr_make_face_with_ops. + * Create a gr_face object given application information and a getTable function. + * + * @return gr_face or NULL if the font fails to load for some reason. + * @param appFaceHandle This is application specific information that is passed + * to the getTable function. The appFaceHandle must stay + * alive as long as the gr_face is alive. + * @param getTable Callback function to get table data. + * @param faceOptions Bitfield describing various options. See enum gr_face_options for details. + */ +GR2_DEPRECATED_API gr_face* gr_make_face(const void* appFaceHandle/*non-NULL*/, gr_get_table_fn getTable, unsigned int faceOptions); + +/** @deprecated Since 1.3.7 this function is now an alias for gr_make_face_with_ops(). + * + * Create a gr_face object given application information, with subsegmental caching support + * + * @return gr_face or NULL if the font fails to load. + * @param appFaceHandle is a pointer to application specific information that is passed to getTable. + * This may not be NULL and must stay alive as long as the gr_face is alive. + * @param face_ops Pointer to face specific callback structure for table management. Must stay + * alive for the duration of the call only. + * @param segCacheMaxSize Unused. + * @param faceOptions Bitfield of values from enum gr_face_options + */ +GR2_DEPRECATED_API gr_face* gr_make_face_with_seg_cache_and_ops(const void* appFaceHandle, const gr_face_ops *face_ops, unsigned int segCacheMaxSize, unsigned int faceOptions); + +/** @deprecated Since 1.3.7 this function is now an alias for gr_make_face(). + * + * Create a gr_face object given application information, with subsegmental caching support. + * This function is deprecated as of v1.2.0 in favour of gr_make_face_with_seg_cache_and_ops. + * + * @return gr_face or NULL if the font fails to load. + * @param appFaceHandle is a pointer to application specific information that is passed to getTable. + * This may not be NULL and must stay alive as long as the gr_face is alive. + * @param getTable The function graphite calls to access font table data + * @param segCacheMaxSize How large the segment cache is. + * @param faceOptions Bitfield of values from enum gr_face_options + */ +GR2_DEPRECATED_API gr_face* gr_make_face_with_seg_cache(const void* appFaceHandle, gr_get_table_fn getTable, unsigned int segCacheMaxSize, unsigned int faceOptions); + +/** Convert a tag in a string into a gr_uint32 + * + * @return gr_uint32 tag, zero padded + * @param str a nul terminated string of which at most the first 4 characters are read + */ +GR2_API gr_uint32 gr_str_to_tag(const char *str); + +/** Convert a gr_uint32 tag into a string + * + * @param tag contains the tag to convert + * @param str is a pointer to a char array of at least size 4 bytes. The first 4 bytes of this array + * will be overwritten by this function. No nul is appended. + */ +GR2_API void gr_tag_to_str(gr_uint32 tag, char *str); + +/** Get feature values for a given language or default + * + * @return a copy of the default feature values for a given language. The application must call + * gr_featureval_destroy() to free this object when done. + * @param pFace The font face to get feature values from + * @param langname The language tag to get feature values for. If there is no such language or + * langname is 0, the default feature values for the font are returned. + * langname is right 0 padded and assumes lowercase. Thus the en langauge + * would be 0x656E0000. Langname may also be space padded, thus 0x656E2020. + */ +GR2_API gr_feature_val* gr_face_featureval_for_lang(const gr_face* pFace, gr_uint32 langname); + +/** Get feature reference for a given feature id from a face + * + * @return a feature reference corresponding to the given id. This data is part of the gr_face and + * will be freed when the face is destroyed. + * @param pFace Font face to get information on. + * @param featId Feature id tag to get reference to. + */ +GR2_API const gr_feature_ref* gr_face_find_fref(const gr_face* pFace, gr_uint32 featId); + +/** Returns number of feature references in a face **/ +GR2_API gr_uint16 gr_face_n_fref(const gr_face* pFace); + +/** Returns feature reference at given index in face **/ +GR2_API const gr_feature_ref* gr_face_fref(const gr_face* pFace, gr_uint16 i); + +/** Return number of languages the face knows about **/ +GR2_API unsigned short gr_face_n_languages(const gr_face* pFace); + +/** Returns a language id corresponding to a language of given index in the face **/ +GR2_API gr_uint32 gr_face_lang_by_index(const gr_face* pFace, gr_uint16 i); + +/** Destroy the given face and free its memory **/ +GR2_API void gr_face_destroy(gr_face *face); + +/** Returns the number of glyphs in the face **/ +GR2_API unsigned short gr_face_n_glyphs(const gr_face* pFace); + +/** Returns a faceinfo for the face and script **/ +GR2_API const gr_faceinfo *gr_face_info(const gr_face *pFace, gr_uint32 script); + +/** Returns whether the font supports a given Unicode character + * + * @return true if the character is supported. + * @param pFace face to test within + * @param usv Unicode Scalar Value of character to test + * @param script Tag of script for selecting which set of pseudo glyphs to test. May be NULL. + */ +GR2_API int gr_face_is_char_supported(const gr_face *pFace, gr_uint32 usv, gr_uint32 script); + +#ifndef GRAPHITE2_NFILEFACE +/** Create gr_face from a font file + * + * @return gr_face that accesses a font file directly. Returns NULL on failure. + * @param filename Full path and filename to font file + * @param faceOptions Bitfile from enum gr_face_options to control face options. + */ +GR2_API gr_face* gr_make_file_face(const char *filename, unsigned int faceOptions); + +/** @deprecated Since 1.3.7. This function is now an alias for gr_make_file_face(). + * + * Create gr_face from a font file, with subsegment caching support. + * + * @return gr_face that accesses a font file directly. Returns NULL on failure. + * @param filename Full path and filename to font file + * @param segCacheMaxSize Specifies how big to make the cache in segments. + * @param faceOptions Bitfield from enum gr_face_options to control face options. + */ +GR2_DEPRECATED_API gr_face* gr_make_file_face_with_seg_cache(const char *filename, unsigned int segCacheMaxSize, unsigned int faceOptions); +#endif // !GRAPHITE2_NFILEFACE + +/** Create a font from a face + * + * @return gr_font Call font_destroy to free this font + * @param ppm Resolution of the font in pixels per em + * @param face Face this font corresponds to. This must stay alive as long as the font is alive. + */ +GR2_API gr_font* gr_make_font(float ppm, const gr_face *face); + +/** query function to find the hinted advance of a glyph + * + * @param appFontHandle is the unique information passed to gr_make_font_with_advance() + * @param glyphid is the glyph to retireve the hinted advance for. + */ +typedef float (*gr_advance_fn)(const void* appFontHandle, gr_uint16 glyphid); + +/** struct housing function pointers to manage font hinted metrics for the + * graphite engine. */ +struct gr_font_ops +{ + /** size of the structure in bytes to allow for future extensibility */ + size_t size; + /** a pointer to a function to retrieve the hinted + * advance width of a glyph which the font cannot + * provide without client assistance. This can be + * NULL to signify no horizontal hinted metrics are necessary. */ + gr_advance_fn glyph_advance_x; + /** a pointer to a function to retrieve the hinted + * advance height of a glyph which the font cannot + * provide without client assistance. This can be + * NULL to signify no horizontal hinted metrics are necessary. */ + gr_advance_fn glyph_advance_y; +}; +typedef struct gr_font_ops gr_font_ops; + +/** Creates a font with hinted advance width query functions + * + * @return gr_font to be destroyed via font_destroy + * @param ppm size of font in pixels per em + * @param appFontHandle font specific information that must stay alive as long + * as the font does + * @param font_ops pointer font specific callback structure for hinted metrics. + * Need only stay alive for the duration of the call. + * @param face the face this font corresponds to. Must stay alive as long as + * the font does. + */ +GR2_API gr_font* gr_make_font_with_ops(float ppm, const void* appFontHandle, const gr_font_ops * font_ops, const gr_face *face); + +/** Creates a font with hinted advance width query function. + * This function is deprecated. Use gr_make_font_with_ops instead. + * + * @return gr_font to be destroyed via font_destroy + * @param ppm size of font in pixels per em + * @param appFontHandle font specific information that must stay alive as long + * as the font does + * @param getAdvance callback function reference that returns horizontal advance in pixels for a glyph. + * @param face the face this font corresponds to. Must stay alive as long as + * the font does. + */ +GR2_API gr_font* gr_make_font_with_advance_fn(float ppm, const void* appFontHandle, gr_advance_fn getAdvance, const gr_face *face); + +/** Free a font **/ +GR2_API void gr_font_destroy(gr_font *font); + +/** get a feature value + * + * @return value of specific feature or 0 if any problems. + * @param pfeatureref gr_feature_ref to the feature + * @param feats gr_feature_val containing all the values + */ +GR2_API gr_uint16 gr_fref_feature_value(const gr_feature_ref* pfeatureref, const gr_feature_val* feats); + +/** set a feature value + * + * @return false if there were any problems (value out of range, etc.) + * @param pfeatureref gr_feature_ref to the feature + * @param val value to set the feature to + * @param pDest the gr_feature_val containing all the values for all the features + */ +GR2_API int gr_fref_set_feature_value(const gr_feature_ref* pfeatureref, gr_uint16 val, gr_feature_val* pDest); + +/** Returns the id tag for a gr_feature_ref **/ +GR2_API gr_uint32 gr_fref_id(const gr_feature_ref* pfeatureref); + +/** Returns number of values a feature may take, given a gr_feature_ref **/ +GR2_API gr_uint16 gr_fref_n_values(const gr_feature_ref* pfeatureref); + +/** Returns the value associated with a particular value in a feature + * + * @return value + * @param pfeatureref gr_feature_ref of the feature of interest + * @param settingno Index up to the return value of gr_fref_n_values() of the value + */ +GR2_API gr_int16 gr_fref_value(const gr_feature_ref* pfeatureref, gr_uint16 settingno); + +/** Returns a string of the UI name of a feature + * + * @return string of the UI name, in the encoding form requested. Call gr_label_destroy() after use. + * @param pfeatureref gr_feature_ref of the feature + * @param langId This is a pointer since the face may not support a string in the requested + * language. The actual language of the string is returned in langId + * @param utf Encoding form for the string + * @param length Used to return the length of the string returned in bytes. + */ +GR2_API void* gr_fref_label(const gr_feature_ref* pfeatureref, gr_uint16 *langId, enum gr_encform utf, gr_uint32 *length); + +/** Return a UI string for a possible value of a feature + * + * @return string of the UI name, in the encoding form requested. nul terminated. Call gr_label_destroy() + * after use. + * @param pfeatureref gr_feature_ref of the feature + * @param settingno Value setting index + * @param langId This is a pointer to the requested language. The requested language id is + * replaced by the actual language id of the string returned. + * @param utf Encoding form for the string + * @param length Returns the length of the string returned in bytes. + */ +GR2_API void* gr_fref_value_label(const gr_feature_ref* pfeatureref, gr_uint16 settingno/*rather than a value*/, gr_uint16 *langId, enum gr_encform utf, gr_uint32 *length); + +/** Destroy a previously returned label string **/ +GR2_API void gr_label_destroy(void * label); + +/** Copies a gr_feature_val **/ +GR2_API gr_feature_val* gr_featureval_clone(const gr_feature_val* pfeatures); + +/** Destroys a gr_feature_val **/ +GR2_API void gr_featureval_destroy(gr_feature_val *pfeatures); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphite2/Log.h b/data/miniconda3/include/graphite2/Log.h new file mode 100644 index 0000000000000000000000000000000000000000..a5a6947fabe96ff9f4ca05567a72420d464fabf4 --- /dev/null +++ b/data/miniconda3/include/graphite2/Log.h @@ -0,0 +1,85 @@ +/* GRAPHITE2 LICENSING + + Copyright 2010, SIL International + All rights reserved. + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should also have received a copy of the GNU Lesser General Public + License along with this library in the file named "LICENSE". + If not, write to the Free Software Foundation, 51 Franklin Street, + Suite 500, Boston, MA 02110-1335, USA or visit their web page on the + internet at http://www.fsf.org/licenses/lgpl.html. + + Alternatively, the contents of this file may be used under the terms + of the Mozilla Public License (http://mozilla.org/MPL) or the GNU + General Public License, as published by the Free Software Foundation, + either version 2 of the License or (at your option) any later version. +*/ +#pragma once + +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** deprecated mechanism that doesn't do anything now. */ +typedef enum { + GRLOG_NONE = 0x0, + GRLOG_FACE = 0x01, + GRLOG_SEGMENT = 0x02, + GRLOG_PASS = 0x04, + GRLOG_CACHE = 0x08, + + GRLOG_OPCODE = 0x80, + GRLOG_ALL = 0xFF +} GrLogMask; + +/** Start logging all segment creation and updates on the provided face. This + * is logged to a JSON file, see "Segment JSON Schema.txt" for a precise + * definition of the file + * + * @return true if the file was successfully created and logging is correctly + * initialised. + * @param face the gr_face whose segments you want to log to the given file + * @param log_path a utf8 encoded file name and path to log to. + */ +GR2_API bool gr_start_logging(gr_face * face, const char *log_path); + + +/** Stop logging on the given face. This will close the log file created by + * gr_start_logging. + * + * @param face the gr_face whose segments you want to stop logging + */ +GR2_API void gr_stop_logging(gr_face * face); + +/** Start logging to a FILE object. + * This function is deprecated as of 1.2.0, use the _face versions instead. + * + * @return True on success + * @param logfile FILE reference to output logging to + * @param mask What aspects of logging to report (ignored) + */ +GR2_API bool graphite_start_logging(FILE * logFile, GrLogMask mask); //may not do anthing if disabled in the implementation of the engine. + +/** Stop logging to a FILE object. + * This function is deprecated as of 1.2.0, use the _face versions instead. + */ +GR2_API void graphite_stop_logging(); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphite2/Segment.h b/data/miniconda3/include/graphite2/Segment.h new file mode 100644 index 0000000000000000000000000000000000000000..0e24f5d7955a453e7647eb942531d6446f13a19a --- /dev/null +++ b/data/miniconda3/include/graphite2/Segment.h @@ -0,0 +1,461 @@ +/* GRAPHITE2 LICENSING + + Copyright 2010, SIL International + All rights reserved. + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should also have received a copy of the GNU Lesser General Public + License along with this library in the file named "LICENSE". + If not, write to the Free Software Foundation, 51 Franklin Street, + Suite 500, Boston, MA 02110-1335, USA or visit their web page on the + internet at http://www.fsf.org/licenses/lgpl.html. + + Alternatively, the contents of this file may be used under the terms + of the Mozilla Public License (http://mozilla.org/MPL) or the GNU + General Public License, as published by the Free Software Foundation, + either version 2 of the License or (at your option) any later version. +*/ +#pragma once + +#include "graphite2/Types.h" +#include "graphite2/Font.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +enum gr_break_weight { + gr_breakNone = 0, + /* after break weights */ + gr_breakWhitespace = 10, + gr_breakWord = 15, + gr_breakIntra = 20, + gr_breakLetter = 30, + gr_breakClip = 40, + /* before break weights */ + gr_breakBeforeWhitespace = -10, + gr_breakBeforeWord = -15, + gr_breakBeforeIntra = -20, + gr_breakBeforeLetter = -30, + gr_breakBeforeClip = -40 +}; + +enum gr_justFlags { + /// Indicates that this segment is a complete line + gr_justCompleteLine = 0, + /// Indicates that the start of the slot list is not at the start of a line + gr_justStartInline = 1, + /// Indicates that the end of the slot list is not at the end of a line + gr_justEndInline = 2 +}; + +/** Used for looking up slot attributes. Most are already available in other functions **/ +enum gr_attrCode { + /// adjusted glyph advance in x direction in design units + gr_slatAdvX = 0, + /// adjusted glyph advance in y direction (usually 0) in design units + gr_slatAdvY, + /// returns 0. Deprecated. + gr_slatAttTo, + /// This slot attaches to its parent at the given design units in the x direction + gr_slatAttX, + /// This slot attaches to its parent at the given design units in the y direction + gr_slatAttY, + /// This slot attaches to its parent at the given glyph point (not implemented) + gr_slatAttGpt, + /// x-direction adjustment from the given glyph point (not implemented) + gr_slatAttXOff, + /// y-direction adjustment from the given glyph point (not implemented) + gr_slatAttYOff, + /// Where on this glyph should align with the attachment point on the parent glyph in the x-direction. + gr_slatAttWithX, + /// Where on this glyph should align with the attachment point on the parent glyph in the y-direction + gr_slatAttWithY, + /// Which glyph point on this glyph should align with the attachment point on the parent glyph (not implemented). + gr_slatWithGpt, + /// Adjustment to gr_slatWithGpt in x-direction (not implemented) + gr_slatAttWithXOff, + /// Adjustment to gr_slatWithGpt in y-direction (not implemented) + gr_slatAttWithYOff, + /// Attach at given nesting level (not implemented) + gr_slatAttLevel, + /// Line break breakweight for this glyph + gr_slatBreak, + /// Ligature component reference (not implemented) + gr_slatCompRef, + /// bidi directionality of this glyph (not implemented) + gr_slatDir, + /// Whether insertion is allowed before this glyph + gr_slatInsert, + /// Final positioned position of this glyph relative to its parent in x-direction in pixels + gr_slatPosX, + /// Final positioned position of this glyph relative to its parent in y-direction in pixels + gr_slatPosY, + /// Amount to shift glyph by in x-direction design units + gr_slatShiftX, + /// Amount to shift glyph by in y-direction design units + gr_slatShiftY, + /// attribute user1 + gr_slatUserDefnV1, + /// not implemented + gr_slatMeasureSol, + /// not implemented + gr_slatMeasureEol, + /// Amount this slot can stretch (not implemented) + gr_slatJStretch, + /// Amount this slot can shrink (not implemented) + gr_slatJShrink, + /// Granularity by which this slot can stretch or shrink (not implemented) + gr_slatJStep, + /// Justification weight for this glyph (not implemented) + gr_slatJWeight, + /// Amount this slot mush shrink or stretch in design units + gr_slatJWidth = 29, + /// SubSegment split point + gr_slatSegSplit = gr_slatJStretch + 29, + /// User defined attribute, see subattr for user attr number + gr_slatUserDefn, + /// Bidi level + gr_slatBidiLevel = 56, + /// Collision flags + gr_slatColFlags, + /// Collision constraint rectangle left (bl.x) + gr_slatColLimitblx, + /// Collision constraint rectangle lower (bl.y) + gr_slatColLimitbly, + /// Collision constraint rectangle right (tr.x) + gr_slatColLimittrx, + /// Collision constraint rectangle upper (tr.y) + gr_slatColLimittry, + /// Collision shift x + gr_slatColShiftx, + /// Collision shift y + gr_slatColShifty, + /// Collision margin + gr_slatColMargin, + /// Margin cost weight + gr_slatColMarginWt, + // Additional glyph that excludes movement near this one: + gr_slatColExclGlyph, + gr_slatColExclOffx, + gr_slatColExclOffy, + // Collision sequence enforcing attributes: + gr_slatSeqClass, + gr_slatSeqProxClass, + gr_slatSeqOrder, + gr_slatSeqAboveXoff, + gr_slatSeqAboveWt, + gr_slatSeqBelowXlim, + gr_slatSeqBelowWt, + gr_slatSeqValignHt, + gr_slatSeqValignWt, + + /// not implemented + gr_slatMax, + /// not implemented + gr_slatNoEffect = gr_slatMax + 1 +}; + +enum gr_bidirtl { + /// Underlying paragraph direction is RTL + gr_rtl = 1, + /// Set this to not run the bidi pass internally, even if the font asks for it. + /// This presumes that the segment is in a single direction. Most of the time + /// this bit should be set unless you know you are passing full paragraphs of text. + gr_nobidi = 2, + /// Disable auto mirroring for rtl text + gr_nomirror = 4 +}; + +typedef struct gr_char_info gr_char_info; +typedef struct gr_segment gr_segment; +typedef struct gr_slot gr_slot; + +/** Returns Unicode character for a charinfo. + * + * @param p Pointer to charinfo to return information on. + */ +GR2_API unsigned int gr_cinfo_unicode_char(const gr_char_info* p/*not NULL*/); + +/** Returns breakweight for a charinfo. + * + * @return Breakweight is a number between -50 and 50 indicating the cost of a + * break before or after this character. If the value < 0, the absolute value + * is this character's contribution to the overall breakweight before it. If the value + * > 0, then the value is this character's contribution to the overall breakweight after it. + * The overall breakweight between two characters is the maximum of the breakweight + * contributions from the characters either side of it. If a character makes no + * contribution to the breakweight on one side of it, the contribution is considered + * to be 0. + * @param p Pointer to charinfo to return information on. + */ +GR2_API int gr_cinfo_break_weight(const gr_char_info* p/*not NULL*/); + +/** Returns the slot index that after this character is after in the slot stream + * + * In effect each character is associated with a set of slots and this returns + * the index of the last slot in the segment this character is associated with. + * + * @return after slot index between 0 and gr_seg_n_slots() + * @param p Pointer to charinfo to return information on. + */ +GR2_API int gr_cinfo_after(const gr_char_info* p/*not NULL*/); + +/** Returns the slot index that before this character is before in the slot stream + * + * In effect each character is associated with a set of slots and this returns + * the index of the first slot in the segment this character is associated with. + * + * @return before slot index between 0 and gr_seg_n_slots() + * @param p Pointer to charinfo to return information on. + */ +GR2_API int gr_cinfo_before(const gr_char_info* p/*not NULL*/); + +/** Returns the code unit index of this character in the input string + * + * @return code unit index between 0 and the end of the string + * @param p Pointer to charinfo to return information on. + */ +GR2_API size_t gr_cinfo_base(const gr_char_info* p/*not NULL*/); + +/** Returns the number of unicode characters in a string. + * + * @return number of characters in the string + * @param enc Specifies the type of data in the string: utf8, utf16, utf32 + * @param buffer_begin The start of the string + * @param buffer_end Measure up to the first nul or when end is reached, whichever is earliest. + * This parameter may be NULL. + * @param pError If there is a structural fault in the string, the location is returned + * in this variable. If no error occurs, pError will contain NULL. NULL + * may be passed for pError if no such information is required. + */ +GR2_API size_t gr_count_unicode_characters(enum gr_encform enc, const void* buffer_begin, const void* buffer_end, const void** pError); + +/** Creates and returns a segment. + * + * @return a segment that needs seg_destroy called on it. May return NULL if bad problems + * in segment processing. + * @param font Gives the size of the font in pixels per em for final positioning. If + * NULL, positions are returned in design units, i.e. at a ppm of the upem + * of the face. + * @param face The face containing all the non-size dependent information. + * @param script This is a tag containing a script identifier that is used to choose + * which graphite table within the font to use. Maybe 0. Tag may be 4 chars + * NULL padded in LSBs or space padded in LSBs. + * @param pFeats Pointer to a feature values to be used for the segment. Only one + * feature values may be used for a segment. If NULL the default features + * for the font will be used. + * @param enc Specifies what encoding form the string is in (utf8, utf16, utf32) + * @param pStart Start of the string + * @param nChars Number of unicode characters to process in the string. The string will + * be processed either up to the first NULL or until nChars have been + * processed. nChars is also used to initialise the internal memory + * allocations of the segment. So it is wise not to make nChars too much + * greater than the actual number of characters being processed. + * @param dir Specifies whether the segment is processed right to left (1) or left to + * right (0) and whether to run the internal bidi pass, if a font requests it. + * See enum gr_bidirtl for details. + */ +GR2_API gr_segment* gr_make_seg(const gr_font* font, const gr_face* face, gr_uint32 script, const gr_feature_val* pFeats, enum gr_encform enc, const void* pStart, size_t nChars, int dir); + +/** Destroys a segment, freeing the memory. + * + * @param p The segment to destroy + */ +GR2_API void gr_seg_destroy(gr_segment* p); + +/** Returns the advance for the whole segment. + * + * Returns the width of the segment up to the next glyph origin after the segment + */ +GR2_API float gr_seg_advance_X(const gr_segment* pSeg/*not NULL*/); + +/** Returns the height advance for the segment. **/ +GR2_API float gr_seg_advance_Y(const gr_segment* pSeg/*not NULL*/); + +/** Returns the number of gr_char_infos in the segment. **/ +GR2_API unsigned int gr_seg_n_cinfo(const gr_segment* pSeg/*not NULL*/); + +/** Returns a gr_char_info at a given index in the segment. **/ +GR2_API const gr_char_info* gr_seg_cinfo(const gr_segment* pSeg/*not NULL*/, unsigned int index/*must be + +typedef unsigned char gr_uint8; +typedef gr_uint8 gr_byte; +typedef signed char gr_int8; +typedef unsigned short gr_uint16; +typedef short gr_int16; +typedef unsigned int gr_uint32; +typedef int gr_int32; + +enum gr_encform { + gr_utf8 = 1/*sizeof(uint8)*/, gr_utf16 = 2/*sizeof(uint16)*/, gr_utf32 = 4/*sizeof(uint32)*/ +}; + + +// Define API function declspec/attributes and how each supported compiler or OS +// allows us to specify them. +#if defined __GNUC__ + #define _gr2_and , + #define _gr2_tag_fn(a) __attribute__((a)) + #define _gr2_deprecated_flag deprecated + #define _gr2_export_flag visibility("default") + #define _gr2_import_flag visibility("default") + #define _gr2_static_flag visibility("hidden") +#endif + +#if defined _WIN32 || defined __CYGWIN__ + #if defined __GNUC__ // These three will be redefined for Windows + #undef _gr2_export_flag + #undef _gr2_import_flag + #undef _gr2_static_flag + #else // How MSVC sepcifies function level attributes adn deprecation + #define _gr2_and + #define _gr2_tag_fn(a) __declspec(a) + #define _gr2_deprecated_flag deprecated + #endif + #define _gr2_export_flag dllexport + #define _gr2_import_flag dllimport + #define _gr2_static_flag +#endif + +#if defined GRAPHITE2_STATIC + #define GR2_API _gr2_tag_fn(_gr2_static_flag) + #define GR2_DEPRECATED_API _gr2_tag_fn(_gr2_deprecated_flag _gr2_and _gr2_static_flag) +#elif defined GRAPHITE2_EXPORTING + #define GR2_API _gr2_tag_fn(_gr2_export_flag) + #define GR2_DEPRECATED_API _gr2_tag_fn(_gr2_deprecated_flag _gr2_and _gr2_export_flag) +#else + #define GR2_API _gr2_tag_fn(_gr2_import_flag) + #define GR2_DEPRECATED_API _gr2_tag_fn(_gr2_deprecated_flag _gr2_and _gr2_import_flag) +#endif diff --git a/data/miniconda3/include/graphviz/arith.h b/data/miniconda3/include/graphviz/arith.h new file mode 100644 index 0000000000000000000000000000000000000000..44556cec55e421acc6d6c8fdf403d774fe88d4c7 --- /dev/null +++ b/data/miniconda3/include/graphviz/arith.h @@ -0,0 +1,73 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +/* geometric functions (e.g. on points and boxes) with application to, but + * no specific dependence on graphs */ + +#pragma once + +/* for sincos */ +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef MIN +#undef MIN +#endif +#define MIN(a,b) ((a)<(b)?(a):(b)) + +#ifdef MAX +#undef MAX +#endif +#define MAX(a,b) ((a)>(b)?(a):(b)) + +#define AVG(a,b) ((a + b) / 2) +#define SGN(a) (((a)<0)? -1 : 1) +#define CMP(a,b) (((a)<(b)) ? -1 : (((a)>(b)) ? 1 : 0)) + +#ifndef MAXDOUBLE +#define MAXDOUBLE 1.7976931348623157e+308 +#endif + +#ifdef BETWEEN +#undef BETWEEN +#endif +#define BETWEEN(a,b,c) (((a) <= (b)) && ((b) <= (c))) + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + +#ifndef SQRT2 +#define SQRT2 1.41421356237309504880 +#endif + +#define ROUND(f) ((f>=0)?(int)(f + .5):(int)(f - .5)) +#define RADIANS(deg) ((deg)/180.0 * M_PI) +#define DEGREES(rad) ((rad)/M_PI * 180.0) + +#define SQR(a) ((a) * (a)) + +#ifdef HAVE_SINCOS + extern void sincos(double x, double *s, double *c); +#else +# define sincos(x,s,c) *s = sin(x); *c = cos(x) +#endif + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/cdt.h b/data/miniconda3/include/graphviz/cdt.h new file mode 100644 index 0000000000000000000000000000000000000000..a285ac26b2fd1f3b0cf51fe01a2b4e067e37b0b3 --- /dev/null +++ b/data/miniconda3/include/graphviz/cdt.h @@ -0,0 +1,283 @@ +/** + * @file + * @brief container data types API + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* Public interface for the dictionary library +** +** Written by Kiem-Phong Vo +*/ + +#define CDT_VERSION 20050420L + +#include /* size_t */ +#include + +#ifdef GVDLL +#ifdef EXPORT_CDT +#define CDT_API __declspec(dllexport) +#else +#define CDT_API __declspec(dllimport) +#endif +#endif + +#ifndef CDT_API +#define CDT_API /* nothing */ +#endif + +typedef struct _dtlink_s Dtlink_t; +typedef struct _dthold_s Dthold_t; +typedef struct _dtdisc_s Dtdisc_t; +typedef struct _dtmethod_s Dtmethod_t; +typedef struct _dtdata_s Dtdata_t; +typedef struct _dt_s Dt_t; +typedef struct _dt_s Dict_t; /* for libdict compatibility */ +typedef struct _dtstat_s Dtstat_t; +typedef void* (*Dtmemory_f)(Dt_t*,void*,size_t,Dtdisc_t*); +typedef void* (*Dtsearch_f)(Dt_t*,void*,int); +typedef void* (*Dtmake_f)(Dt_t*,void*,Dtdisc_t*); +typedef void (*Dtfree_f)(Dt_t*,void*,Dtdisc_t*); +typedef int (*Dtcompar_f)(Dt_t*,void*,void*,Dtdisc_t*); +typedef unsigned int (*Dthash_f)(Dt_t*,void*,Dtdisc_t*); +typedef int (*Dtevent_f)(Dt_t*,int,void*,Dtdisc_t*); + +struct _dtlink_s +{ Dtlink_t* right; /* right child */ + union + { unsigned int _hash; /* hash value */ + Dtlink_t* _left; /* left child */ + } hl; +}; + +/* private structure to hold an object */ +struct _dthold_s +{ Dtlink_t hdr; /* header */ + void* obj; /* user object */ +}; + +/* method to manipulate dictionary structure */ +struct _dtmethod_s +{ Dtsearch_f searchf; /* search function */ + int type; /* type of operation */ +}; + +/* stuff that may be in shared memory */ +struct _dtdata_s +{ int type; /* type of dictionary */ + Dtlink_t* here; /* finger to last search element */ + union + { Dtlink_t** _htab; /* hash table */ + Dtlink_t* _head; /* linked list */ + } hh; + int ntab; /* number of hash slots */ + int size; /* number of objects */ + int loop; /* number of nested loops */ + int minp; /* min path before splay, always even */ + /* for hash dt, > 0: fixed table size */ +}; + +/* structure to hold methods that manipulate an object */ +struct _dtdisc_s +{ int key; /* where the key begins in an object */ + int size; /* key size and type */ + int link; /* offset to Dtlink_t field */ + Dtmake_f makef; /* object constructor */ + Dtfree_f freef; /* object destructor */ + Dtcompar_f comparf;/* to compare two objects */ + Dthash_f hashf; /* to compute hash value of an object */ + Dtmemory_f memoryf;/* to allocate/free memory */ + Dtevent_f eventf; /* to process events */ +}; + +#define DTDISC(dc,ky,sz,lk,mkf,frf,cmpf,hshf,memf,evf) \ + ( (dc)->key = (ky), (dc)->size = (sz), (dc)->link = (lk), \ + (dc)->makef = (mkf), (dc)->freef = (frf), \ + (dc)->comparf = (cmpf), (dc)->hashf = (hshf), \ + (dc)->memoryf = (memf), (dc)->eventf = (evf) ) + +/* the dictionary structure itself */ +struct _dt_s +{ Dtsearch_f searchf;/* search function */ + Dtdisc_t* disc; /* method to manipulate objs */ + Dtdata_t* data; /* sharable data */ + Dtmemory_f memoryf;/* function to alloc/free memory */ + Dtmethod_t* meth; /* dictionary method */ + int type; /* type information */ + int nview; /* number of parent view dictionaries */ + Dt_t* view; /* next on viewpath */ + Dt_t* walk; /* dictionary being walked */ + void* user; /* for user's usage */ +}; + +/* structure to get status of a dictionary */ +struct _dtstat_s +{ int dt_meth; /* method type */ + int dt_size; /* number of elements */ + size_t dt_n; // number of chains or levels + size_t dt_max; // max size of a chain or a level + size_t* dt_count; // counts of chains or levels by size +}; + +/* flag set if the last search operation actually found the object */ +#define DT_FOUND 0100000 + +/* supported storage methods */ +#define DT_SET 0000001 /* set with unique elements */ +#define DT_BAG 0000002 /* multiset */ +#define DT_OSET 0000004 /* ordered set (self-adjusting tree) */ +#define DT_OBAG 0000010 /* ordered multiset */ +#define DT_LIST 0000020 /* linked list */ +#define DT_STACK 0000040 /* stack: insert/delete at top */ +#define DT_QUEUE 0000100 /* queue: insert at top, delete at tail */ +#define DT_DEQUE 0000200 /* deque: insert at top, append at tail */ +#define DT_METHODS 0000377 /* all currently supported methods */ + +/* asserts to dtdisc() */ +#define DT_SAMECMP 0000001 /* compare methods equivalent */ +#define DT_SAMEHASH 0000002 /* hash methods equivalent */ + +/* types of search */ +#define DT_INSERT 0000001 /* insert object if not found */ +#define DT_DELETE 0000002 /* delete object if found */ +#define DT_SEARCH 0000004 /* look for an object */ +#define DT_NEXT 0000010 /* look for next element */ +#define DT_PREV 0000020 /* find previous element */ +#define DT_RENEW 0000040 /* renewing an object */ +#define DT_CLEAR 0000100 /* clearing all objects */ +#define DT_FIRST 0000200 /* get first object */ +#define DT_LAST 0000400 /* get last object */ +#define DT_MATCH 0001000 /* find object matching key */ +#define DT_VSEARCH 0002000 /* search using internal representation */ +#define DT_ATTACH 0004000 /* attach an object to the dictionary */ +#define DT_DETACH 0010000 /* detach an object from the dictionary */ +#define DT_APPEND 0020000 /* used on Dtlist to append an object */ + +/* events */ +#define DT_OPEN 1 /* a dictionary is being opened */ +#define DT_CLOSE 2 /* a dictionary is being closed */ +#define DT_DISC 3 /* discipline is about to be changed */ +#define DT_METH 4 /* method is about to be changed */ +#define DT_ENDOPEN 5 /* dtopen() is done */ +#define DT_ENDCLOSE 6 /* dtclose() is done */ +#define DT_HASHSIZE 7 /* setting hash table size */ + +CDT_API extern Dtmethod_t* Dtset; ///< set with unique elements +CDT_API extern Dtmethod_t* Dtbag; ///< multiset +CDT_API extern Dtmethod_t* Dtoset; ///< ordered set (self-adjusting tree) +CDT_API extern Dtmethod_t* Dtobag; ///< ordered multiset +CDT_API extern Dtmethod_t* Dtlist; ///< linked list +CDT_API extern Dtmethod_t* Dtstack; ///< stack: insert/delete at top +CDT_API extern Dtmethod_t* Dtqueue; ///< queue: insert at top, delete at tail +CDT_API extern Dtmethod_t* Dtdeque; ///< deque: insert at top, append at tail + +CDT_API extern Dtmethod_t* Dtorder; +CDT_API extern Dtmethod_t* Dttree; +CDT_API extern Dtmethod_t* Dthash; +CDT_API extern Dtmethod_t _Dttree; +CDT_API extern Dtmethod_t _Dthash; +CDT_API extern Dtmethod_t _Dtlist; +CDT_API extern Dtmethod_t _Dtqueue; +CDT_API extern Dtmethod_t _Dtstack; + +CDT_API Dt_t* dtopen(Dtdisc_t*, Dtmethod_t*); +CDT_API int dtclose(Dt_t*); +CDT_API Dt_t* dtview(Dt_t*, Dt_t*); +CDT_API Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t*, int); +CDT_API Dtmethod_t* dtmethod(Dt_t*, Dtmethod_t*); + +CDT_API Dtlink_t* dtflatten(Dt_t*); +CDT_API Dtlink_t* dtextract(Dt_t*); +CDT_API int dtrestore(Dt_t*, Dtlink_t*); + +CDT_API int dtwalk(Dt_t*, int(*)(Dt_t*,void*,void*), void*); + +CDT_API void* dtrenew(Dt_t*, void*); + +CDT_API int dtsize(Dt_t*); +CDT_API int dtstat(Dt_t*, Dtstat_t*, int); +CDT_API unsigned int dtstrhash(unsigned int, void*, int); + +/* internal functions for translating among holder, object and key */ +#define _DT(dt) ((Dt_t*)(dt)) +#define _DTDSC(dc,ky,sz,lk,cmpf) \ + (ky = dc->key, sz = dc->size, lk = dc->link, cmpf = dc->comparf) +#define _DTLNK(o,lk) ((Dtlink_t*)((char*)(o) + lk) ) +#define _DTOBJ(e,lk) (lk < 0 ? ((Dthold_t*)(e))->obj : (void*)((char*)(e) - lk) ) +#define _DTKEY(o,ky,sz) (void*)(sz < 0 ? *((char**)((char*)(o)+ky)) : ((char*)(o)+ky)) + +#define _DTCMP(dt,k1,k2,dc,cmpf,sz) \ + (cmpf ? (*cmpf)(dt,k1,k2,dc) : \ + (sz <= 0 ? strcmp(k1,k2) : memcmp(k1,k2,(size_t)sz)) ) +#define _DTHSH(dt,ky,dc,sz) (dc->hashf ? (*dc->hashf)(dt,ky,dc) : dtstrhash(0,ky,sz) ) + +/* special search function for tree structure only */ +#define _DTMTCH(dt,key,action) \ + do { Dtlink_t* _e; void *_o, *_k, *_key; Dtdisc_t* _dc; \ + int _ky, _sz, _lk, _cmp; Dtcompar_f _cmpf; \ + _dc = (dt)->disc; _DTDSC(_dc, _ky, _sz, _lk, _cmpf); \ + _key = (key); \ + for(_e = (dt)->data->here; _e; _e = _cmp < 0 ? _e->hl._left : _e->right) \ + { _o = _DTOBJ(_e, _lk); _k = _DTKEY(_o, _ky, _sz); \ + if((_cmp = _DTCMP((dt), _key, _k, _dc, _cmpf, _sz)) == 0) \ + break; \ + } \ + action (_e ? _o : (void*)0); \ + } while(0) + +#define _DTSRCH(dt,obj,action) \ + do { Dtlink_t* _e; void *_o, *_k, *_key; Dtdisc_t* _dc; \ + int _ky, _sz, _lk, _cmp; Dtcompar_f _cmpf; \ + _dc = (dt)->disc; _DTDSC(_dc, _ky, _sz, _lk, _cmpf); \ + _key = _DTKEY(obj, _ky, _sz); \ + for(_e = (dt)->data->here; _e; _e = _cmp < 0 ? _e->hl._left : _e->right) \ + { _o = _DTOBJ(_e, _lk); _k = _DTKEY(_o, _ky, _sz); \ + if((_cmp = _DTCMP((dt), _key, _k, _dc, _cmpf, _sz)) == 0) \ + break; \ + } \ + action (_e ? _o : (void*)0); \ + } while(0) + +#define DTTREEMATCH(dt,key,action) _DTMTCH(_DT(dt),(void*)(key),action) +#define DTTREESEARCH(dt,obj,action) _DTSRCH(_DT(dt),(void*)(obj),action) + +#define dtvnext(d) (_DT(d)->view) +#define dtvcount(d) (_DT(d)->nview) +#define dtvhere(d) (_DT(d)->walk) + +#define dtlink(d,e) (((Dtlink_t*)(e))->right) +#define dtobj(d,e) _DTOBJ((e), _DT(d)->disc->link) +#define dtfinger(d) (_DT(d)->data->here ? dtobj((d),_DT(d)->data->here):(void*)(0)) + +#define dtfirst(d) (*(_DT(d)->searchf))((d),(void*)(0),DT_FIRST) +#define dtnext(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_NEXT) +#define dtleast(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_SEARCH|DT_NEXT) +#define dtlast(d) (*(_DT(d)->searchf))((d),(void*)(0),DT_LAST) +#define dtprev(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_PREV) +#define dtmost(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_SEARCH|DT_PREV) +#define dtsearch(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_SEARCH) +#define dtmatch(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_MATCH) +#define dtinsert(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_INSERT) +#define dtappend(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_INSERT|DT_APPEND) +#define dtdelete(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_DELETE) +#define dtattach(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_ATTACH) +#define dtdetach(d,o) (*(_DT(d)->searchf))((d),(void*)(o),DT_DETACH) +#define dtclear(d) (*(_DT(d)->searchf))((d),(void*)(0),DT_CLEAR) +#define dtfound(d) (_DT(d)->type & DT_FOUND) + +#define DT_PRIME 17109811 /* 2#00000001 00000101 00010011 00110011 */ +#define dtcharhash(h,c) (((unsigned int)(h) + (unsigned int)(c)) * DT_PRIME ) + +/** + * @dir lib/cdt + * @brief container data types, API cdt.h + */ + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/cgraph.h b/data/miniconda3/include/graphviz/cgraph.h new file mode 100644 index 0000000000000000000000000000000000000000..a0089effdd57a99199f299d29e94b23d6176079c --- /dev/null +++ b/data/miniconda3/include/graphviz/cgraph.h @@ -0,0 +1,491 @@ +/** + * @file + * @brief abstract graph C library, @ref cgraph_api + * + * [man 3 cgraph](https://graphviz.org/pdf/cgraph.3.pdf) + * + * @defgroup cgraph_api Cgraph API + * @brief Abstract graph C library + * + * Main types @ref Agraph_t, @ref Agnode_t, @ref Agedge_t. + * @{ + */ + +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include +#include "cdt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// @cond + +#ifdef GVDLL +#ifdef EXPORT_CGRAPH +#define CGRAPH_API __declspec(dllexport) +#else +#define CGRAPH_API __declspec(dllimport) +#endif +#endif + +#ifndef CGRAPH_API +#define CGRAPH_API /* nothing */ +#endif + +#ifndef FALSE +#define FALSE (0) +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +/// @endcond + +typedef uint64_t IDTYPE; + +/* forward struct type declarations */ +typedef struct Agtag_s Agtag_t; +typedef struct Agobj_s Agobj_t; ///< generic object header +typedef struct Agraph_s Agraph_t; ///< graph, subgraph (or hyperedge) +typedef struct Agnode_s Agnode_t; ///< node (atom) +typedef struct Agedge_s Agedge_t; ///< node pair +typedef struct Agdesc_s Agdesc_t; ///< graph descriptor +typedef struct Agmemdisc_s Agmemdisc_t; ///< memory allocator +typedef struct Agiddisc_s Agiddisc_t; ///< object ID allocator +typedef struct Agiodisc_s Agiodisc_t; ///< IO services +typedef struct Agdisc_s Agdisc_t; ///< union of client discipline methods +typedef struct Agdstate_s Agdstate_t; ///< client state (closures) +typedef struct Agsym_s Agsym_t; ///< string attribute descriptors +typedef struct Agattr_s Agattr_t; ///< string attribute container +typedef struct Agcbdisc_s Agcbdisc_t; ///< client event callbacks +typedef struct Agcbstack_s Agcbstack_t; ///< enclosing state for cbdisc +typedef struct Agclos_s Agclos_t; ///< common fields for graph/subgs +typedef struct Agrec_s Agrec_t; ///< generic runtime record +typedef struct Agdatadict_s Agdatadict_t; ///< set of dictionaries per graph +typedef struct Agedgepair_s Agedgepair_t; ///< the edge object +typedef struct Agsubnode_s Agsubnode_t; + +/** @brief Header of a user record. + +These records are attached by client programs +dynamically at runtime. A unique string ID must be given to each record +attached to the same object. Cgraph has functions to create, search for, +and delete these records. The records are maintained in a circular list, +with obj->data pointing somewhere in the list. The search function has +an option to lock this pointer on a given record. The application must +be written so only one such lock is outstanding at a time. */ + +struct Agrec_s { + char *name; + Agrec_t *next; + /* following this would be any programmer-defined data */ +}; + +/** @brief Object tag for graphs, nodes, and edges. + +While there may be several structs +for a given node or edges, there is only one unique ID (per main graph). */ + +struct Agtag_s { + unsigned objtype:2; /* see literal tags below */ + unsigned mtflock:1; /* move-to-front lock, see above */ + unsigned attrwf:1; /* attrs written (parity, write.c) */ + unsigned seq:(sizeof(unsigned) * 8 - 4); /* sequence no. */ + IDTYPE id; /* client ID */ +}; + + /* object tags */ +#define AGRAPH 0 /* can't exceed 2 bits. see Agtag_t. */ +#define AGNODE 1 +#define AGOUTEDGE 2 +#define AGINEDGE 3 /* (1 << 1) indicates an edge tag. */ +#define AGEDGE AGOUTEDGE /* synonym in object kind args */ + +/// a generic graph/node/edge header +struct Agobj_s { + Agtag_t tag; + Agrec_t *data; +}; + +#define AGTAG(obj) (((Agobj_t*)(obj))->tag) +#define AGTYPE(obj) (AGTAG(obj).objtype) +#define AGID(obj) (AGTAG(obj).id) +#define AGSEQ(obj) (AGTAG(obj).seq) +#define AGATTRWF(obj) (AGTAG(obj).attrwf) +#define AGDATA(obj) (((Agobj_t*)(obj))->data) + +/** @brief This is the node struct allocated per graph (or subgraph). + +It resides in the n_dict of the graph. +The node set is maintained by libdict, but transparently to libgraph callers. +Every node may be given an optional string name at its time of creation, +or it is permissible to pass NIL(char*) for the name. */ + +struct Agsubnode_s { /* the node-per-graph-or-subgraph record */ + Dtlink_t seq_link; /* must be first */ + Dtlink_t id_link; + Agnode_t *node; /* the object */ + Dtlink_t *in_id, *out_id; /* by node/ID for random access */ + Dtlink_t *in_seq, *out_seq; /* by node/sequence for serial access */ +}; + +struct Agnode_s { + Agobj_t base; + Agraph_t *root; + Agsubnode_t mainsub; /* embedded for main graph */ +}; + +struct Agedge_s { + Agobj_t base; + Dtlink_t id_link; /* main graph only */ + Dtlink_t seq_link; + Agnode_t *node; /* the endpoint node */ +}; + +struct Agedgepair_s { + Agedge_t out, in; +}; + +struct Agdesc_s { /* graph descriptor */ + unsigned directed:1; /* if edges are asymmetric */ + unsigned strict:1; /* if multi-edges forbidden */ + unsigned no_loop:1; /* if no loops */ + unsigned maingraph:1; /* if this is the top level graph */ + unsigned flatlock:1; /* if sets are flattened into lists in cdt */ + unsigned no_write:1; /* if a temporary subgraph */ + unsigned has_attrs:1; /* if string attr tables should be initialized */ + unsigned has_cmpnd:1; /* if may contain collapsed nodes */ +}; + +/* disciplines for external resources needed by libgraph */ + +/// memory allocator discipline, independent of other resources + +struct Agmemdisc_s { + void *(*open) (Agdisc_t*); + void *(*alloc) (void *state, size_t req); + void *(*resize) (void *state, void *ptr, size_t old, size_t req); + void (*free) (void *state, void *ptr); + void (*close) (void *state); +}; + +/// object ID allocator discipline + +struct Agiddisc_s { + void *(*open) (Agraph_t * g, Agdisc_t*); /* associated with a graph */ + long (*map) (void *state, int objtype, char *str, IDTYPE *id, + int createflag); + long (*alloc) (void *state, int objtype, IDTYPE id); + void (*free) (void *state, int objtype, IDTYPE id); + char *(*print) (void *state, int objtype, IDTYPE id); + void (*close) (void *state); + void (*idregister) (void *state, int objtype, void *obj); +}; + +struct Agiodisc_s { + int (*afread) (void *chan, char *buf, int bufsize); + int (*putstr) (void *chan, const char *str); + int (*flush) (void *chan); /* sync */ + /* error messages? */ +}; + +/// user's discipline + +struct Agdisc_s { + Agmemdisc_t *mem; + Agiddisc_t *id; + Agiodisc_t *io; +}; + + /* default resource disciplines */ + +CGRAPH_API extern Agmemdisc_t AgMemDisc; +CGRAPH_API extern Agiddisc_t AgIdDisc; +CGRAPH_API extern Agiodisc_t AgIoDisc; + +CGRAPH_API extern Agdisc_t AgDefaultDisc; + +struct Agdstate_s { + void *mem; + void *id; + /* IO must be initialized and finalized outside Cgraph, + * and channels (FILES) are passed as void* arguments. */ +}; + +typedef void (*agobjfn_t) (Agraph_t * g, Agobj_t * obj, void *arg); +typedef void (*agobjupdfn_t) (Agraph_t * g, Agobj_t * obj, void *arg, + Agsym_t * sym); + +struct Agcbdisc_s { + struct { + agobjfn_t ins; + agobjupdfn_t mod; + agobjfn_t del; + } graph, node, edge; +}; + +/// object event callbacks + +struct Agcbstack_s { + Agcbdisc_t *f; /* methods */ + void *state; /* closure */ + Agcbstack_t *prev; /* kept in a stack, unlike other disciplines */ +}; + +struct Agclos_s { + Agdisc_t disc; /* resource discipline functions */ + Agdstate_t state; /* resource closures */ + Dict_t *strdict; /* shared string dict */ + uint64_t seq[3]; /* local object sequence number counter */ + Agcbstack_t *cb; /* user and system callback function stacks */ + unsigned char callbacks_enabled; /* issue user callbacks or hold them? */ + Dict_t *lookup_by_name[3]; + Dict_t *lookup_by_id[3]; +}; + +struct Agraph_s { + Agobj_t base; + Agdesc_t desc; + Dtlink_t link; + Dict_t *n_seq; /* the node set in sequence */ + Dict_t *n_id; /* the node set indexed by ID */ + Dict_t *e_seq, *e_id; /* holders for edge sets */ + Dict_t *g_dict; /* subgraphs - descendants */ + Agraph_t *parent, *root; /* subgraphs - ancestors */ + Agclos_t *clos; /* shared resources */ +}; + +CGRAPH_API void agpushdisc(Agraph_t * g, Agcbdisc_t * disc, void *state); +CGRAPH_API int agpopdisc(Agraph_t * g, Agcbdisc_t * disc); +CGRAPH_API int agcallbacks(Agraph_t * g, int flag); /* return prev value */ + +/* graphs */ +CGRAPH_API Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * disc); +CGRAPH_API int agclose(Agraph_t * g); +CGRAPH_API Agraph_t *agread(void *chan, Agdisc_t * disc); +CGRAPH_API Agraph_t *agmemread(const char *cp); +CGRAPH_API Agraph_t *agmemconcat(Agraph_t *g, const char *cp); +CGRAPH_API void agreadline(int); +CGRAPH_API void agsetfile(const char *); +CGRAPH_API Agraph_t *agconcat(Agraph_t * g, void *chan, Agdisc_t * disc); +CGRAPH_API int agwrite(Agraph_t * g, void *chan); +CGRAPH_API int agisdirected(Agraph_t * g); +CGRAPH_API int agisundirected(Agraph_t * g); +CGRAPH_API int agisstrict(Agraph_t * g); +CGRAPH_API int agissimple(Agraph_t * g); + +/* nodes */ +CGRAPH_API Agnode_t *agnode(Agraph_t * g, char *name, int createflag); +CGRAPH_API Agnode_t *agidnode(Agraph_t * g, IDTYPE id, int createflag); +CGRAPH_API Agnode_t *agsubnode(Agraph_t * g, Agnode_t * n, int createflag); +CGRAPH_API Agnode_t *agfstnode(Agraph_t * g); +CGRAPH_API Agnode_t *agnxtnode(Agraph_t * g, Agnode_t * n); +CGRAPH_API Agnode_t *aglstnode(Agraph_t * g); +CGRAPH_API Agnode_t *agprvnode(Agraph_t * g, Agnode_t * n); + +CGRAPH_API Agsubnode_t *agsubrep(Agraph_t * g, Agnode_t * n); +CGRAPH_API int agnodebefore(Agnode_t *u, Agnode_t *v); /* we have no shame */ + +/* edges */ +CGRAPH_API Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, + char *name, int createflag); +CGRAPH_API Agedge_t *agidedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, + IDTYPE id, int createflag); +CGRAPH_API Agedge_t *agsubedge(Agraph_t * g, Agedge_t * e, int createflag); +CGRAPH_API Agedge_t *agfstin(Agraph_t * g, Agnode_t * n); +CGRAPH_API Agedge_t *agnxtin(Agraph_t * g, Agedge_t * e); +CGRAPH_API Agedge_t *agfstout(Agraph_t * g, Agnode_t * n); +CGRAPH_API Agedge_t *agnxtout(Agraph_t * g, Agedge_t * e); +CGRAPH_API Agedge_t *agfstedge(Agraph_t * g, Agnode_t * n); +CGRAPH_API Agedge_t *agnxtedge(Agraph_t * g, Agedge_t * e, Agnode_t * n); + +/* generic */ +CGRAPH_API Agraph_t *agraphof(void* obj); +CGRAPH_API Agraph_t *agroot(void* obj); +CGRAPH_API int agcontains(Agraph_t *, void *); +CGRAPH_API char *agnameof(void *); +CGRAPH_API int agrelabel_node(Agnode_t * n, char *newname); +CGRAPH_API int agdelete(Agraph_t * g, void *obj); +CGRAPH_API int agdelsubg(Agraph_t * g, Agraph_t * sub); /* could be agclose */ +CGRAPH_API int agdelnode(Agraph_t * g, Agnode_t * arg_n); +CGRAPH_API int agdeledge(Agraph_t * g, Agedge_t * arg_e); +CGRAPH_API int agobjkind(void *); + +/* strings */ +CGRAPH_API char *agstrdup(Agraph_t *, const char *); +CGRAPH_API char *agstrdup_html(Agraph_t *, const char *); +CGRAPH_API int aghtmlstr(const char *); +CGRAPH_API char *agstrbind(Agraph_t * g, const char *); +CGRAPH_API int agstrfree(Agraph_t *, const char *); +CGRAPH_API char *agcanon(char *, int); +CGRAPH_API char *agstrcanon(char *, char *); +CGRAPH_API char *agcanonStr(char *str); /* manages its own buf */ + +/// definitions for dynamic string attributes + +struct Agattr_s { /* dynamic string attributes */ + Agrec_t h; /* common data header */ + Dict_t *dict; /* shared dict to interpret attr field */ + char **str; /* the attribute string values */ +}; + +/// symbol in one of the above dictionaries + +struct Agsym_s { + Dtlink_t link; + char *name; /* attribute's name */ + char *defval; /* its default value for initialization */ + int id; /* its index in attr[] */ + unsigned char kind; /* referent object type */ + unsigned char fixed; /* immutable value */ + unsigned char print; /* always print */ +}; + +struct Agdatadict_s { /* set of dictionaries per graph */ + Agrec_t h; /* installed in list of graph recs */ + struct { + Dict_t *n, *e, *g; + } dict; +}; + +CGRAPH_API Agsym_t *agattr(Agraph_t * g, int kind, char *name, + const char *value); +CGRAPH_API Agsym_t *agattrsym(void *obj, char *name); +CGRAPH_API Agsym_t *agnxtattr(Agraph_t * g, int kind, Agsym_t * attr); +CGRAPH_API int agcopyattr(void *oldobj, void *newobj); + +CGRAPH_API void *agbindrec(void *obj, const char *name, unsigned int recsize, + int move_to_front); +CGRAPH_API Agrec_t *aggetrec(void *obj, const char *name, int move_to_front); +CGRAPH_API int agdelrec(void *obj, const char *name); +CGRAPH_API void aginit(Agraph_t * g, int kind, const char *rec_name, + int rec_size, int move_to_front); +CGRAPH_API void agclean(Agraph_t * g, int kind, char *rec_name); + +CGRAPH_API char *agget(void *obj, char *name); +CGRAPH_API char *agxget(void *obj, Agsym_t * sym); +CGRAPH_API int agset(void *obj, char *name, const char *value); +CGRAPH_API int agxset(void *obj, Agsym_t * sym, const char *value); +CGRAPH_API int agsafeset(void* obj, char* name, const char* value, + const char* def); + +/* definitions for subgraphs */ +CGRAPH_API Agraph_t *agsubg(Agraph_t * g, char *name, int cflag); /* constructor */ +CGRAPH_API Agraph_t *agidsubg(Agraph_t * g, IDTYPE id, int cflag); /* constructor */ +CGRAPH_API Agraph_t *agfstsubg(Agraph_t * g); +CGRAPH_API Agraph_t *agnxtsubg(Agraph_t * subg); +CGRAPH_API Agraph_t *agparent(Agraph_t * g); + +/* set cardinality */ +CGRAPH_API int agnnodes(Agraph_t * g); +CGRAPH_API int agnedges(Agraph_t * g); +CGRAPH_API int agnsubg(Agraph_t * g); +CGRAPH_API int agdegree(Agraph_t * g, Agnode_t * n, int in, int out); +CGRAPH_API int agcountuniqedges(Agraph_t * g, Agnode_t * n, int in, int out); + +/* memory */ +CGRAPH_API void *agalloc(Agraph_t * g, size_t size); +CGRAPH_API void *agrealloc(Agraph_t * g, void *ptr, size_t oldsize, + size_t size); +CGRAPH_API void agfree(Agraph_t * g, void *ptr); + +/* an engineering compromise is a joy forever */ +CGRAPH_API void aginternalmapclearlocalnames(Agraph_t * g); + +#define agnew(g,t) ((t*)agalloc(g,sizeof(t))) +#define agnnew(g,n,t) ((t*)agalloc(g,(n)*sizeof(t))) + +/// @cond + +/* support for extra API misuse warnings if available */ +#ifdef __GNUC__ + #define PRINTF_LIKE(index, first) __attribute__((format(printf, index, first))) +#else + #define PRINTF_LIKE(index, first) /* nothing */ +#endif + +/// @endcond + +/* error handling */ +typedef enum { AGWARN, AGERR, AGMAX, AGPREV } agerrlevel_t; +typedef int (*agusererrf) (char*); +CGRAPH_API agerrlevel_t agseterr(agerrlevel_t); +CGRAPH_API char *aglasterr(void); +CGRAPH_API int agerr(agerrlevel_t level, const char *fmt, ...) + PRINTF_LIKE(2, 3); +CGRAPH_API void agerrorf(const char *fmt, ...) PRINTF_LIKE(1, 2); +CGRAPH_API void agwarningf(const char *fmt, ...) PRINTF_LIKE(1, 2); +CGRAPH_API int agerrors(void); +CGRAPH_API int agreseterrors(void); +CGRAPH_API agusererrf agseterrf(agusererrf); + +#undef PRINTF_LIKE + +/* data access macros */ +/* this assumes that e[0] is out and e[1] is inedge, see edgepair in edge.c */ +#define AGIN2OUT(e) ((e)-1) +#define AGOUT2IN(e) ((e)+1) +#define AGOPP(e) ((AGTYPE(e)==AGINEDGE)?AGIN2OUT(e):AGOUT2IN(e)) +#define AGMKOUT(e) (AGTYPE(e) == AGOUTEDGE? (e): AGIN2OUT(e)) +#define AGMKIN(e) (AGTYPE(e) == AGINEDGE? (e): AGOUT2IN(e)) +#define AGTAIL(e) (AGMKIN(e)->node) +#define AGHEAD(e) (AGMKOUT(e)->node) +#define AGEQEDGE(e,f) (AGMKOUT(e) == AGMKOUT(f)) +/* These macros are also exposed as functions, so they can be linked against. */ +#define agtail(e) AGTAIL(e) +#define aghead(e) AGHEAD(e) +#define agopp(e) AGOPP(e) +#define ageqedge(e,f) AGEQEDGE(e,f) + +#define TAILPORT_ID "tailport" +#define HEADPORT_ID "headport" + +CGRAPH_API extern Agdesc_t Agdirected; +CGRAPH_API extern Agdesc_t Agstrictdirected; +CGRAPH_API extern Agdesc_t Agundirected; +CGRAPH_API extern Agdesc_t Agstrictundirected; + +/* fast graphs */ +void agflatten(Agraph_t * g, int flag); +typedef Agsubnode_t Agnoderef_t; +typedef Dtlink_t Agedgeref_t; + +#define AGHEADPOINTER(g) ((Agnoderef_t*)(g->n_seq->data->hh._head)) +#define AGRIGHTPOINTER(rep) ((Agnoderef_t*)((rep)->seq_link.right?((void*)((rep)->seq_link.right) - offsetof(Agsubnode_t,seq_link)):0)) +#define AGLEFTPOINTER(rep) ((Agnoderef_t*)((rep)->seq_link.hl._left?((void*)((rep)->seq_link.hl._left) - offsetof(Agsubnode_t,seq_link)):0)) + +#define FIRSTNREF(g) (agflatten(g,1), AGHEADPOINTER(g)) + +#define NEXTNREF(g,rep) (AGRIGHTPOINTER(rep) == AGHEADPOINTER(g)?0:AGRIGHTPOINTER(rep)) + +#define PREVNREF(g,rep) (((rep)==AGHEADPOINTER(g))?0:(AGLEFTPOINTER(rep))) + +#define LASTNREF(g) (agflatten(g,1), AGHEADPOINTER(g)?AGLEFTPOINTER(AGHEADPOINTER(g)):0) +#define NODEOF(rep) ((rep)->node) + +#define FIRSTOUTREF(g,sn) (agflatten(g,1), (sn)->out_seq) +#define LASTOUTREF(g,sn) (agflatten(g,1), (Agedgeref_t*)dtlast(sn->out_seq)) +#define FIRSTINREF(g,sn) (agflatten(g,1), (sn)->in_seq) +#define NEXTEREF(g,rep) ((rep)->right) +#define PREVEREF(g,rep) ((rep)->hl._left) +/* this is expedient but a bit slimey because it "knows" that dict entries of both nodes +and edges are embedded in main graph objects but allocated separately in subgraphs */ +#define AGSNMAIN(sn) ((sn)==(&((sn)->node->mainsub))) +#define EDGEOF(sn,rep) (AGSNMAIN(sn)?((Agedge_t*)((unsigned char*)(rep) - offsetof(Agedge_t,seq_link))) : ((Dthold_t*)(rep))->obj) + +#ifdef __cplusplus +} +#endif +/// @} diff --git a/data/miniconda3/include/graphviz/color.h b/data/miniconda3/include/graphviz/color.h new file mode 100644 index 0000000000000000000000000000000000000000..e5d8a8014b5c5df9885bcbc594f983f230d900cc --- /dev/null +++ b/data/miniconda3/include/graphviz/color.h @@ -0,0 +1,47 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct hsvrgbacolor_t { + char *name; + unsigned char h, s, v; + unsigned char r, g, b, a; +} hsvrgbacolor_t; + +/* possible representations of color in gvcolor_t */ +typedef enum { HSVA_DOUBLE, RGBA_BYTE, RGBA_WORD, CMYK_BYTE, + RGBA_DOUBLE, COLOR_STRING, COLOR_INDEX } color_type_t; + +/* gvcolor_t can hold a color spec in a choice or representations */ +typedef struct color_s { + union { + double RGBA[4]; + double HSVA[4]; + unsigned char rgba[4]; + unsigned char cmyk[4]; + int rrggbbaa[4]; + char *string; + int index; + } u; + color_type_t type; +} gvcolor_t; + +#define COLOR_MALLOC_FAIL -1 +#define COLOR_UNKNOWN 1 +#define COLOR_OK 0 + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/geom.h b/data/miniconda3/include/graphviz/geom.h new file mode 100644 index 0000000000000000000000000000000000000000..23450e72a31c606f7f0867d165fb0805303bb01f --- /dev/null +++ b/data/miniconda3/include/graphviz/geom.h @@ -0,0 +1,80 @@ +/** + * @file + * @brief geometric types and macros (e.g. points and boxes) + * + * with application to, but no specific dependence on graphs + */ + +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ +#pragma once + +#include "arith.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { int x, y; } point; + +typedef struct pointf_s { double x, y; } pointf; + +/* tell pathplan/pathgeom.h */ +#define HAVE_POINTF_S + +typedef struct { point LL, UR; } box; + +typedef struct { pointf LL, UR; } boxf; + + +/* true if point p is inside box b */ +#define INSIDE(p,b) (BETWEEN((b).LL.x,(p).x,(b).UR.x) && BETWEEN((b).LL.y,(p).y,(b).UR.y)) + +/* true if boxes b0 and b1 overlap */ +#define OVERLAP(b0,b1) (((b0).UR.x >= (b1).LL.x) && ((b1).UR.x >= (b0).LL.x) && ((b0).UR.y >= (b1).LL.y) && ((b1).UR.y >= (b0).LL.y)) + +/* true if box b0 completely contains b1*/ +#define CONTAINS(b0,b1) (((b0).UR.x >= (b1).UR.x) && ((b0).UR.y >= (b1).UR.y) && ((b0).LL.x <= (b1).LL.x) && ((b0).LL.y <= (b1).LL.y)) + +/* expand box b as needed to enclose point p */ +#define EXPANDBP(b, p) ((b).LL.x = MIN((b).LL.x, (p).x), (b).LL.y = MIN((b).LL.y, (p).y), (b).UR.x = MAX((b).UR.x, (p).x), (b).UR.y = MAX((b).UR.y, (p).y)) + +/* expand box b0 as needed to enclose box b1 */ +#define EXPANDBB(b0, b1) ((b0).LL.x = MIN((b0).LL.x, (b1).LL.x), (b0).LL.y = MIN((b0).LL.y, (b1).LL.y), (b0).UR.x = MAX((b0).UR.x, (b1).UR.x), (b0).UR.y = MAX((b0).UR.y, (b1).UR.y)) + +#define LEN2(a,b) (SQR(a) + SQR(b)) +#define LEN(a,b) (sqrt(LEN2((a),(b)))) + +#define DIST2(p,q) (LEN2(((p).x - (q).x),((p).y - (q).y))) +#define DIST(p,q) (sqrt(DIST2((p),(q)))) + +#define POINTS_PER_INCH 72 +#define POINTS_PER_PC ((double)POINTS_PER_INCH / 6) +#define POINTS_PER_CM ((double)POINTS_PER_INCH * 0.393700787) +#define POINTS_PER_MM ((double)POINTS_PER_INCH * 0.0393700787) + +#define POINTS(a_inches) (ROUND((a_inches)*POINTS_PER_INCH)) +#define INCH2PS(a_inches) ((a_inches)*(double)POINTS_PER_INCH) +#define PS2INCH(a_points) ((a_points)/(double)POINTS_PER_INCH) + +#define P2PF(p,pf) ((pf).x = (p).x,(pf).y = (p).y) +#define PF2P(pf,p) ((p).x = ROUND((pf).x),(p).y = ROUND((pf).y)) + +#define B2BF(b,bf) (P2PF((b).LL,(bf).LL),P2PF((b).UR,(bf).UR)) +#define BF2B(bf,b) (PF2P((bf).LL,(b).LL),PF2P((bf).UR,(b).UR)) + +#define APPROXEQPT(p,q,tol) (DIST2((p),(q)) < SQR(tol)) + +/* common tolerance value */ +#define MILLIPOINT .001 + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/graphviz_version.h b/data/miniconda3/include/graphviz/graphviz_version.h new file mode 100644 index 0000000000000000000000000000000000000000..67ef3b6f66b2f3e470f5e592d8d91423bf74efc5 --- /dev/null +++ b/data/miniconda3/include/graphviz/graphviz_version.h @@ -0,0 +1,9 @@ +#pragma once +#define GVPLUGIN_CONFIG_FILE "config6" +#define GVPLUGIN_VERSION 6 +#define PACKAGE_BUGREPORT "https://gitlab.com/graphviz/graphviz/-/issues" +#define PACKAGE_NAME "graphviz" +#define PACKAGE_STRING "graphviz 7.1.0" +#define PACKAGE_TARNAME "graphviz" +#define PACKAGE_URL "" +#define PACKAGE_VERSION "7.1.0" diff --git a/data/miniconda3/include/graphviz/gv.cpp b/data/miniconda3/include/graphviz/gv.cpp new file mode 100644 index 0000000000000000000000000000000000000000..454ecd2c9968e959dfe4a98ffb4f2a394e7dddb5 --- /dev/null +++ b/data/miniconda3/include/graphviz/gv.cpp @@ -0,0 +1,739 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#include +#include +#include +#include +#include "gv_channel.h" + +#define agfindattr(x, s) agattrsym(x, s) +#define agraphattr(g, n, s) agattr(g, AGRAPH, n, s) +#define agnodeattr(g, n, s) agattr(g, AGNODE, n, s) +#define agedgeattr(g, n, s) agattr(g, AGEDGE, n, s) + +static char emptystring[] = {'\0'}; + +static GVC_t *gvc; + +static void gv_init(void) { + // list of builtins, enable demand loading + gvc = gvContextPlugins(lt_preloaded_symbols, DEMAND_LOADING); +} + +Agraph_t *graph(char *name) { + if (!gvc) + gv_init(); + return agopen(name, Agundirected, 0); +} + +Agraph_t *digraph(char *name) { + if (!gvc) + gv_init(); + return agopen(name, Agdirected, 0); +} + +Agraph_t *strictgraph(char *name) { + if (!gvc) + gv_init(); + return agopen(name, Agstrictundirected, 0); +} + +Agraph_t *strictdigraph(char *name) { + if (!gvc) + gv_init(); + return agopen(name, Agstrictdirected, 0); +} + +Agraph_t *readstring(char *string) { + if (!gvc) + gv_init(); + return agmemread(string); +} + +Agraph_t *read(FILE *f) { + if (!gvc) + gv_init(); + return agread(f, nullptr); +} + +Agraph_t *read(const char *filename) { + FILE *f = fopen(filename, "r"); + if (!f) + return nullptr; + if (!gvc) + gv_init(); + Agraph_t *g = agread(f, nullptr); + fclose(f); + return g; +} + +//------------------------------------------------- +Agraph_t *graph(Agraph_t *g, char *name) { + if (!gvc) + gv_init(); + return agsubg(g, name, 1); +} + +Agnode_t *node(Agraph_t *g, char *name) { + if (!gvc) + return nullptr; + return agnode(g, name, 1); +} + +Agedge_t *edge(Agraph_t *g, Agnode_t *t, Agnode_t *h) { + if (!gvc || !t || !h || !g) + return nullptr; + // edges from/to the protonode are not permitted + if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH) + return nullptr; + return agedge(g, t, h, nullptr, 1); +} + +Agedge_t *edge(Agnode_t *t, Agnode_t *h) { return edge(agraphof(t), t, h); } + +// induce tail if necessary +Agedge_t *edge(char *tname, Agnode_t *h) { + return edge(node(agraphof(h), tname), h); +} + +// induce head if necessary +Agedge_t *edge(Agnode_t *t, char *hname) { + return edge(t, node(agraphof(t), hname)); +} + +// induce tail/head if necessary +Agedge_t *edge(Agraph_t *g, char *tname, char *hname) { + return edge(g, node(g, tname), node(g, hname)); +} + +//------------------------------------------------- +static char *myagxget(void *obj, Agsym_t *a) { + if (!obj || !a) + return emptystring; + char *val = agxget(obj, a); + if (!val) + return emptystring; + if (strcmp(a->name, "label") == 0 && aghtmlstr(val)) { + size_t len = strlen(val); + auto hs = reinterpret_cast(malloc(len + 3)); + hs[0] = '<'; + strcpy(hs + 1, val); + hs[len + 1] = '>'; + hs[len + 2] = '\0'; + return hs; + } + return val; +} +char *getv(Agraph_t *g, Agsym_t *a) { return myagxget(g, a); } +char *getv(Agraph_t *g, char *attr) { + if (!g || !attr) + return nullptr; + Agsym_t *a = agfindattr(agroot(g), attr); + return myagxget(g, a); +} +static void myagxset(void *obj, Agsym_t *a, char *val) { + if (strcmp(a->name, "label") == 0 && val[0] == '<') { + size_t len = strlen(val); + if (val[len - 1] == '>') { + std::string hs(val + 1, len - 2); + val = agstrdup_html(agraphof(obj), hs.c_str()); + } + } + agxset(obj, a, val); +} +char *setv(Agraph_t *g, Agsym_t *a, char *val) { + if (!g || !a || !val) + return nullptr; + myagxset(g, a, val); + return val; +} +char *setv(Agraph_t *g, char *attr, char *val) { + if (!g || !attr || !val) + return nullptr; + Agsym_t *a = agfindattr(agroot(g), attr); + if (!a) + a = agraphattr(g->root, attr, emptystring); + myagxset(g, a, val); + return val; +} +//------------------------------------------------- +char *getv(Agnode_t *n, Agsym_t *a) { + if (!n || !a) + return nullptr; + if (AGTYPE(n) == AGRAPH) // protonode + return nullptr; // FIXME ?? + return myagxget(n, a); +} +char *getv(Agnode_t *n, char *attr) { + if (!n || !attr) + return nullptr; + if (AGTYPE(n) == AGRAPH) // protonode + return nullptr; // FIXME ?? + Agraph_t *g = agroot(agraphof(n)); + Agsym_t *a = agattr(g, AGNODE, attr, nullptr); + return myagxget(n, a); +} +char *setv(Agnode_t *n, Agsym_t *a, char *val) { + if (!n || !a || !val) + return nullptr; + if (AGTYPE(n) == AGRAPH) // protonode + return nullptr; // FIXME ?? + myagxset(n, a, val); + return val; +} +char *setv(Agnode_t *n, char *attr, char *val) { + + if (!n || !attr || !val) + return nullptr; + if (AGTYPE(n) == AGRAPH) { // protonode + auto g = reinterpret_cast(n); + (void)agattr(g, AGNODE, attr, + val); // create default attribute in pseudo protonode + // FIXME? - deal with html in "label" attributes + return val; + } + Agraph_t *g = agroot(agraphof(n)); + Agsym_t *a = agattr(g, AGNODE, attr, nullptr); + if (!a) + a = agnodeattr(g, attr, emptystring); + myagxset(n, a, val); + return val; +} +//------------------------------------------------- +char *getv(Agedge_t *e, Agsym_t *a) { + if (!e || !a) + return nullptr; + if (AGTYPE(e) == AGRAPH) // protoedge + return nullptr; // FIXME ?? + return myagxget(e, a); +} +char *getv(Agedge_t *e, char *attr) { + if (!e || !attr) + return nullptr; + if (AGTYPE(e) == AGRAPH) // protoedge + return nullptr; // FIXME ?? + Agraph_t *g = agraphof(agtail(e)); + Agsym_t *a = agattr(g, AGEDGE, attr, nullptr); + return myagxget(e, a); +} +char *setv(Agedge_t *e, Agsym_t *a, char *val) { + if (!e || !a || !val) + return nullptr; + if (AGTYPE(e) == AGRAPH) // protoedge + return nullptr; // FIXME ?? + myagxset(e, a, val); + return val; +} +char *setv(Agedge_t *e, char *attr, char *val) { + if (!e || !attr || !val) + return nullptr; + if (AGTYPE(e) == AGRAPH) { // protoedge + auto g = reinterpret_cast(e); + (void)agattr(g, AGEDGE, attr, + val); // create default attribute in pseudo protoedge + // FIXME? - deal with html in "label" attributes + return val; + } + Agraph_t *g = agroot(agraphof(agtail(e))); + Agsym_t *a = agattr(g, AGEDGE, attr, nullptr); + if (!a) + a = agattr(g, AGEDGE, attr, emptystring); + myagxset(e, a, val); + return val; +} +//------------------------------------------------- +Agraph_t *findsubg(Agraph_t *g, char *name) { + if (!g || !name) + return nullptr; + return agsubg(g, name, 0); +} + +Agnode_t *findnode(Agraph_t *g, char *name) { + if (!g || !name) + return nullptr; + return agnode(g, name, 0); +} + +Agedge_t *findedge(Agnode_t *t, Agnode_t *h) { + if (!t || !h) + return nullptr; + if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH) + return nullptr; + return agfindedge(agraphof(t), t, h); +} + +Agsym_t *findattr(Agraph_t *g, char *name) { + if (!g || !name) + return nullptr; + return agfindattr(g, name); +} + +Agsym_t *findattr(Agnode_t *n, char *name) { + if (!n || !name) + return nullptr; + return agfindattr(n, name); +} + +Agsym_t *findattr(Agedge_t *e, char *name) { + if (!e || !name) + return nullptr; + return agfindattr(e, name); +} + +//------------------------------------------------- + +Agnode_t *headof(Agedge_t *e) { + if (!e) + return nullptr; + if (AGTYPE(e) == AGRAPH) + return nullptr; + return aghead(e); +} + +Agnode_t *tailof(Agedge_t *e) { + if (!e) + return nullptr; + if (AGTYPE(e) == AGRAPH) + return nullptr; + return agtail(e); +} + +Agraph_t *graphof(Agraph_t *g) { + if (!g || g == g->root) + return nullptr; + return agroot(g); +} + +Agraph_t *graphof(Agedge_t *e) { + if (!e) + return nullptr; + if (AGTYPE(e) == AGRAPH) + return reinterpret_cast( + e); // graph of protoedge is itself recast + return agraphof(agtail(e)); +} + +Agraph_t *graphof(Agnode_t *n) { + if (!n) + return nullptr; + if (AGTYPE(n) == AGRAPH) + return reinterpret_cast( + n); // graph of protonode is itself recast + return agraphof(n); +} + +Agraph_t *rootof(Agraph_t *g) { + if (!g) + return nullptr; + return agroot(g); +} + +//------------------------------------------------- +Agnode_t *protonode(Agraph_t *g) { + return reinterpret_cast(g); // gross abuse of the type system! +} + +Agedge_t *protoedge(Agraph_t *g) { + return reinterpret_cast(g); // gross abuse of the type system! +} + +//------------------------------------------------- +char *nameof(Agraph_t *g) { + if (!g) + return nullptr; + return agnameof(g); +} +char *nameof(Agnode_t *n) { + if (!n) + return nullptr; + if (AGTYPE(n) == AGRAPH) + return nullptr; + return agnameof(n); +} +char *nameof(Agsym_t *a) { + if (!a) + return nullptr; + return a->name; +} + +//------------------------------------------------- +bool ok(Agraph_t *g) { return g != nullptr; } +bool ok(Agnode_t *n) { return n != nullptr; } +bool ok(Agedge_t *e) { return e != nullptr; } +bool ok(Agsym_t *a) { return a != nullptr; } +//------------------------------------------------- +Agraph_t *firstsubg(Agraph_t *g) { + if (!g) + return nullptr; + return agfstsubg(g); +} + +Agraph_t *nextsubg(Agraph_t *g, Agraph_t *sg) { + + if (!g || !sg) + return nullptr; + return agnxtsubg(sg); +} + +Agraph_t *firstsupg(Agraph_t *g) { return g->parent; } + +Agraph_t *nextsupg(Agraph_t *, Agraph_t *) { return nullptr; } + +Agedge_t *firstout(Agraph_t *g) { + if (!g) + return nullptr; + for (Agnode_t *n = agfstnode(g); n; n = agnxtnode(g, n)) { + Agedge_t *e = agfstout(g, n); + if (e) + return e; + } + return nullptr; +} + +Agedge_t *nextout(Agraph_t *g, Agedge_t *e) { + if (!g || !e) + return nullptr; + Agedge_t *ne = agnxtout(g, e); + if (ne) + return (ne); + for (Agnode_t *n = agnxtnode(g, agtail(e)); n; n = agnxtnode(g, n)) { + ne = agfstout(g, n); + if (ne) + return ne; + } + return nullptr; +} + +Agedge_t *firstedge(Agraph_t *g) { return firstout(g); } + +Agedge_t *nextedge(Agraph_t *g, Agedge_t *e) { return nextout(g, e); } + +Agedge_t *firstout(Agnode_t *n) { + if (!n) + return nullptr; + return agfstout(agraphof(n), n); +} + +Agedge_t *nextout(Agnode_t *n, Agedge_t *e) { + if (!n || !e) + return nullptr; + return agnxtout(agraphof(n), e); +} + +Agnode_t *firsthead(Agnode_t *n) { + if (!n) + return nullptr; + Agedge_t *e = agfstout(agraphof(n), n); + if (!e) + return nullptr; + return aghead(e); +} + +Agnode_t *nexthead(Agnode_t *n, Agnode_t *h) { + if (!n || !h) + return nullptr; + Agraph_t *g = agraphof(n); + Agedge_t *e = agfindedge(g, n, h); + if (!e) + return nullptr; + do { + e = agnxtout(g, AGMKOUT(e)); + if (!e) + return nullptr; + } while (aghead(e) == h); + return aghead(e); +} + +Agedge_t *firstedge(Agnode_t *n) { + if (!n) + return nullptr; + return agfstedge(agraphof(n), n); +} + +Agedge_t *nextedge(Agnode_t *n, Agedge_t *e) { + if (!n || !e) + return nullptr; + return agnxtedge(agraphof(n), e, n); +} + +Agedge_t *firstin(Agraph_t *g) { + if (!g) + return nullptr; + Agnode_t *n = agfstnode(g); + if (!n) + return nullptr; + return agfstin(g, n); +} + +Agedge_t *nextin(Agraph_t *g, Agedge_t *e) { + if (!g || !e) + return nullptr; + Agedge_t *ne = agnxtin(g, e); + if (ne) + return (ne); + Agnode_t *n = agnxtnode(g, aghead(e)); + if (!n) + return nullptr; + return agfstin(g, n); +} + +Agedge_t *firstin(Agnode_t *n) { + if (!n) + return nullptr; + return agfstin(agraphof(n), n); +} + +Agedge_t *nextin(Agnode_t *n, Agedge_t *e) { + if (!n || !e) + return nullptr; + return agnxtin(agraphof(n), e); +} + +Agnode_t *firsttail(Agnode_t *n) { + if (!n) + return nullptr; + Agedge_t *e = agfstin(agraphof(n), n); + if (!e) + return nullptr; + return agtail(e); +} + +Agnode_t *nexttail(Agnode_t *n, Agnode_t *t) { + if (!n || !t) + return nullptr; + Agraph_t *g = agraphof(n); + Agedge_t *e = agfindedge(g, t, n); + if (!e) + return nullptr; + do { + e = agnxtin(g, AGMKIN(e)); + if (!e) + return nullptr; + } while (agtail(e) == t); + return agtail(e); +} + +Agnode_t *firstnode(Agraph_t *g) { + if (!g) + return nullptr; + return agfstnode(g); +} + +Agnode_t *nextnode(Agraph_t *g, Agnode_t *n) { + if (!g || !n) + return nullptr; + return agnxtnode(g, n); +} + +Agnode_t *firstnode(Agedge_t *e) { + if (!e) + return nullptr; + return agtail(e); +} + +Agnode_t *nextnode(Agedge_t *e, Agnode_t *n) { + if (!e || n != agtail(e)) + return nullptr; + return aghead(e); +} + +Agsym_t *firstattr(Agraph_t *g) { + if (!g) + return nullptr; + g = agroot(g); + return agnxtattr(g, AGRAPH, nullptr); +} + +Agsym_t *nextattr(Agraph_t *g, Agsym_t *a) { + if (!g || !a) + return nullptr; + g = agroot(g); + return agnxtattr(g, AGRAPH, a); +} + +Agsym_t *firstattr(Agnode_t *n) { + if (!n) + return nullptr; + Agraph_t *g = agraphof(n); + return agnxtattr(g, AGNODE, nullptr); +} + +Agsym_t *nextattr(Agnode_t *n, Agsym_t *a) { + if (!n || !a) + return nullptr; + Agraph_t *g = agraphof(n); + return agnxtattr(g, AGNODE, a); +} + +Agsym_t *firstattr(Agedge_t *e) { + if (!e) + return nullptr; + Agraph_t *g = agraphof(agtail(e)); + return agnxtattr(g, AGEDGE, nullptr); +} + +Agsym_t *nextattr(Agedge_t *e, Agsym_t *a) { + if (!e || !a) + return nullptr; + Agraph_t *g = agraphof(agtail(e)); + return agnxtattr(g, AGEDGE, a); +} + +bool rm(Agraph_t *g) { + if (!g) + return false; + // The rm function appears to have the semantics of agclose, so + // we should just do that, and let cgraph take care of all the + // details. + agclose(g); + return true; +} + +bool rm(Agnode_t *n) { + if (!n) + return false; + // removal of the protonode is not permitted + if (strcmp(agnameof(n), "\001proto") == 0) + return false; + agdelete(agraphof(n), n); + return true; +} + +bool rm(Agedge_t *e) { + if (!e) + return false; + // removal of the protoedge is not permitted + if (strcmp(agnameof(aghead(e)), "\001proto") == 0 || + strcmp(agnameof(agtail(e)), "\001proto") == 0) + return false; + agdelete(agroot(agraphof(aghead(e))), e); + return true; +} + +bool layout(Agraph_t *g, const char *engine) { + if (!g) + return false; + (void)gvFreeLayout(gvc, g); // ignore errors + int err = gvLayout(gvc, g, engine); + return err == 0; +} + +// annotate the graph with layout information +bool render(Agraph_t *g) { + if (!g) + return false; + attach_attrs(g); + return true; +} + +// render to stdout +bool render(Agraph_t *g, const char *format) { + if (!g) + return false; + int err = gvRender(gvc, g, format, stdout); + return err == 0; +} + +// render to an open FILE +bool render(Agraph_t *g, const char *format, FILE *f) { + if (!g) + return false; + int err = gvRender(gvc, g, format, f); + return err == 0; +} + +// render to an open channel +bool renderchannel(Agraph_t *g, const char *format, const char *channelname) { + if (!g) + return false; + gv_channel_writer_init(gvc); + int err = gvRender(gvc, g, format, (FILE *)channelname); + gv_writer_reset(gvc); // Reset to default + return err == 0; +} + +// render to a filename +bool render(Agraph_t *g, const char *format, const char *filename) { + if (!g) + return false; + int err = gvRenderFilename(gvc, g, format, filename); + return err == 0; +} + +typedef struct { + char *data; + int sz; // buffer size + int len; // length of array +} BA; + +// render to string result, using binding-dependent gv_string_writer() +char *renderresult(Agraph_t *g, const char *format) { + if (!g) + return nullptr; + if (!GD_alg(g)) + return nullptr; + BA ba; + ba.sz = BUFSIZ; + // must be freed by wrapper code + ba.data = reinterpret_cast(malloc(ba.sz * sizeof(char))); + ba.len = 0; + gv_string_writer_init(gvc); + (void)gvRender(gvc, g, format, reinterpret_cast(&ba)); + gv_writer_reset(gvc); // Reset to default + *reinterpret_cast(GD_alg(g)) = ba.len; + return ba.data; +} + +// render to string result, using binding-dependent gv_string_writer() +void renderresult(Agraph_t *g, const char *format, char *outdata) { + if (!g) + return; + gv_string_writer_init(gvc); + (void)gvRender(gvc, g, format, reinterpret_cast(outdata)); + gv_writer_reset(gvc); // Reset to default +} + +// render to a malloc'ed data string, to be free'd by caller. +char *renderdata(Agraph_t *g, const char *format) { + if (!g) + return nullptr; + char *data; + unsigned int length; + int err = gvRenderData(gvc, g, format, &data, &length); + if (err) + return nullptr; + return data; +} + +bool write(Agraph_t *g, FILE *f) { + if (!g) + return false; + int err = agwrite(g, f); + return err == 0; +} + +bool write(Agraph_t *g, const char *filename) { + if (!g) + return false; + FILE *f = fopen(filename, "w"); + if (!f) + return false; + int err = agwrite(g, f); + fclose(f); + return err == 0; +} + +bool tred(Agraph_t *g) { + if (!g) + return false; + int err = gvToolTred(g); + return err == 0; +} diff --git a/data/miniconda3/include/graphviz/gv.i b/data/miniconda3/include/graphviz/gv.i new file mode 100644 index 0000000000000000000000000000000000000000..ea65ada2f2689e6dc4263333f21251760965342a --- /dev/null +++ b/data/miniconda3/include/graphviz/gv.i @@ -0,0 +1,245 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +%module gv + +#ifdef SWIGTCL +// A typemap telling SWIG to ignore an argument for input +// However, we still need to pass a pointer to the C function +%typemap(in,numinputs=0) char *outdata (Tcl_Obj *o) { + o = Tcl_NewStringObj(NULL, -1); + $1 = (char*)o; +} +// A typemap defining how to return an argument by appending it to the result +%typemap(argout) char *outdata { + Tcl_ListObjAppendElement(interp,$result,(Tcl_Obj*)$1); +} + +// A typemap telling SWIG to map const char *channelname to Tcl_Channel *chan +%typemap(in) const char *channelname (int mode) { + $1 = (char*)Tcl_GetChannel(interp, Tcl_GetString($input), &mode); +// FIXME - need to error if chan is NULL or mode not TCL_WRITABLE +} +#endif + +#ifdef SWIGJAVA +%typemap(jstype) char* renderresult "byte[]" +%typemap(jtype) char* renderresult "byte[]" +%typemap(jni) char* renderresult "jbyteArray" +%typemap(in) Agraph_t *ing (int sz) { + $1 = *(Agraph_t **)&jarg1; + GD_alg($1) = &sz; +} +%typemap(out) char* renderresult { + $result = jenv->NewByteArray (sz1); + jenv->SetByteArrayRegion ($result, 0, sz1, (jbyte*)$1); + free ($1); +} +#endif + +/* */ +%inline %{ +/* some language headers (e.g. php.h, ruby.h) leave these defined */ +#undef PACKAGE_BUGREPORT +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION +#undef PACKAGE_NAME + +#ifdef SWIGOCAML +#include +#endif + +#include "config.h" +#include + +/** New graphs */ +/*** New empty graph */ +extern Agraph_t *graph(char *name); +extern Agraph_t *digraph(char *name); +extern Agraph_t *strictgraph(char *name); +extern Agraph_t *strictdigraph(char *name); +/*** New graph from a dot-syntax string or file */ +extern Agraph_t *readstring(char *string); +extern Agraph_t *read(const char *filename); +extern Agraph_t *read(FILE *f); +/*** Add new subgraph to existing graph */ +extern Agraph_t *graph(Agraph_t *g, char *name); + +/** New nodes */ +/*** Add new node to existing graph */ +extern Agnode_t *node(Agraph_t *g, char *name); + +/** New edges */ +/*** Add new edge between existing nodes */ +extern Agedge_t *edge(Agnode_t *t, Agnode_t *h); +/*** Add a new edge between an existing tail node, and a named head node which will be induced in the graph if it doesn't already exist */ +extern Agedge_t *edge(Agnode_t *t, char *hname); +/*** Add a new edge between an existing head node, and a named tail node which will be induced in the graph if it doesn't already exist */ +extern Agedge_t *edge(char *tname, Agnode_t *h); +/*** Add a new edge between named tail and head nodes which will be induced in the graph if they don't already exist */ +extern Agedge_t *edge(Agraph_t *g, char *tname, char *hname); + +/** Setting attribute values */ +/*** Set value of named attribute of graph/node/edge - creating attribute if necessary */ +extern char *setv(Agraph_t *g, char *attr, char *val); +extern char *setv(Agnode_t *n, char *attr, char *val); +extern char *setv(Agedge_t *e, char *attr, char *val); + +/*** Set value of existing attribute of graph/node/edge (using attribute handle) */ +extern char *setv(Agraph_t *g, Agsym_t *a, char *val); +extern char *setv(Agnode_t *n, Agsym_t *a, char *val); +extern char *setv(Agedge_t *e, Agsym_t *a, char *val); + +/** Getting attribute values */ +/*** Get value of named attribute of graph/node/edge */ +extern char *getv(Agraph_t *g, char *attr); +extern char *getv(Agnode_t *n, char *attr); +extern char *getv(Agedge_t *e, char *attr); + +/*** Get value of attribute of graph/node/edge (using attribute handle) */ +extern char *getv(Agraph_t *g, Agsym_t *a); +extern char *getv(Agnode_t *n, Agsym_t *a); +extern char *getv(Agedge_t *e, Agsym_t *a); + +/** Obtain names from handles */ +extern char *nameof(Agraph_t *g); +extern char *nameof(Agnode_t *n); +extern char *nameof(Agsym_t *a); + +/** Find handles from names */ +extern Agraph_t *findsubg(Agraph_t *g, char *name); +extern Agnode_t *findnode(Agraph_t *g, char *name); +extern Agedge_t *findedge(Agnode_t *t, Agnode_t *h); + +/** */ +extern Agsym_t *findattr(Agraph_t *g, char *name); +extern Agsym_t *findattr(Agnode_t *n, char *name); +extern Agsym_t *findattr(Agedge_t *e, char *name); + +/** Misc graph navigators returning handles */ +extern Agnode_t *headof(Agedge_t *e); +extern Agnode_t *tailof(Agedge_t *e); +extern Agraph_t *graphof(Agraph_t *g); +extern Agraph_t *graphof(Agedge_t *e); +extern Agraph_t *graphof(Agnode_t *n); +extern Agraph_t *rootof(Agraph_t *g); + +/** Obtain handles of proto node/edge for setting default attribute values */ +extern Agnode_t *protonode(Agraph_t *g); +extern Agedge_t *protoedge(Agraph_t *g); + +/** Iterators */ +/*** Iteration termination tests */ +extern bool ok(Agraph_t *g); +extern bool ok(Agnode_t *n); +extern bool ok(Agedge_t *e); +extern bool ok(Agsym_t *a); + +/*** Iterate over subgraphs of a graph */ +extern Agraph_t *firstsubg(Agraph_t *g); +extern Agraph_t *nextsubg(Agraph_t *g, Agraph_t *sg); + +/*** Iterate over supergraphs of a graph (obscure and rarely useful) */ +extern Agraph_t *firstsupg(Agraph_t *g); +extern Agraph_t *nextsupg(Agraph_t *g, Agraph_t *sg); + +/*** Iterate over edges of a graph */ +extern Agedge_t *firstedge(Agraph_t *g); +extern Agedge_t *nextedge(Agraph_t *g, Agedge_t *e); + +/*** Iterate over outedges of a graph */ +extern Agedge_t *firstout(Agraph_t *g); +extern Agedge_t *nextout(Agraph_t *g, Agedge_t *e); + +/*** Iterate over edges of a node */ +extern Agedge_t *firstedge(Agnode_t *n); +extern Agedge_t *nextedge(Agnode_t *n, Agedge_t *e); + +/*** Iterate over out-edges of a node */ +extern Agedge_t *firstout(Agnode_t *n); +extern Agedge_t *nextout(Agnode_t *n, Agedge_t *e); + +/*** Iterate over head nodes reachable from out-edges of a node */ +extern Agnode_t *firsthead(Agnode_t *n); +extern Agnode_t *nexthead(Agnode_t *n, Agnode_t *h); + +/*** Iterate over in-edges of a graph */ +extern Agedge_t *firstin(Agraph_t *g); +extern Agedge_t *nextin(Agnode_t *n, Agedge_t *e); + +/*** Iterate over in-edges of a node */ +extern Agedge_t *firstin(Agnode_t *n); +extern Agedge_t *nextin(Agraph_t *g, Agedge_t *e); + +/*** Iterate over tail nodes reachable from in-edges of a node */ +extern Agnode_t *firsttail(Agnode_t *n); +extern Agnode_t *nexttail(Agnode_t *n, Agnode_t *t); + +/*** Iterate over nodes of a graph */ +extern Agnode_t *firstnode(Agraph_t *g); +extern Agnode_t *nextnode(Agraph_t *g, Agnode_t *n); + +/*** Iterate over nodes of an edge */ +extern Agnode_t *firstnode(Agedge_t *e); +extern Agnode_t *nextnode(Agedge_t *e, Agnode_t *n); + +/*** Iterate over attributes of a graph */ +extern Agsym_t *firstattr(Agraph_t *g); +extern Agsym_t *nextattr(Agraph_t *g, Agsym_t *a); + +/*** Iterate over attributes of an edge */ +extern Agsym_t *firstattr(Agedge_t *e); +extern Agsym_t *nextattr(Agedge_t *e, Agsym_t *a); + +/*** Iterate over attributes of a node */ +extern Agsym_t *firstattr(Agnode_t *n); +extern Agsym_t *nextattr(Agnode_t *n, Agsym_t *a); + +/** Remove graph objects */ +extern bool rm(Agraph_t *g); +extern bool rm(Agnode_t *n); +extern bool rm(Agedge_t *e); + +/** Layout */ +/*** Annotate a graph with layout attributes and values using a specific layout engine */ +extern bool layout(Agraph_t *g, const char *engine); + +/** Render */ +/*** Render a layout into attributes of the graph */ +extern bool render(Agraph_t *g); +/*** Render a layout to stdout */ +extern bool render(Agraph_t *g, const char *format); +/*** Render to an open file */ +extern bool render(Agraph_t *g, const char *format, FILE *fout); +/*** Render a layout to an unopened file by name */ +extern bool render(Agraph_t *g, const char *format, const char *filename); +/*** Render to a string result */ +#ifdef SWIGJAVA +extern char* renderresult(Agraph_t *ing, const char *format); +#else +extern void renderresult(Agraph_t *g, const char *format, char *outdata); +/*** Render to an open channel */ +extern bool renderchannel(Agraph_t *g, const char *format, const char *channelname); +/*** Render a layout to a malloc'ed string, to be free'd by the caller */ +/*** (deprecated - too easy to leak memory) */ +/*** (still needed for "eval [gv::renderdata $G tk]" ) */ +#endif +extern char* renderdata(Agraph_t *g, const char *format); + +/*** Writing graph back to file */ +extern bool write(Agraph_t *g, const char *filename); +extern bool write(Agraph_t *g, FILE *f); + +/*** Graph transformation tools */ +extern bool tred(Agraph_t *g); + +%} + diff --git a/data/miniconda3/include/graphviz/gvc.h b/data/miniconda3/include/graphviz/gvc.h new file mode 100644 index 0000000000000000000000000000000000000000..8c8a5284210e9c9a1d6abc878819386b1087b442 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvc.h @@ -0,0 +1,128 @@ +/** + * @file + * @brief Graphviz context library + */ + +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include + +#include "types.h" +#include "gvplugin.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef GVDLL +#ifdef GVC_EXPORTS +#define GVC_API __declspec(dllexport) +#else +#define GVC_API __declspec(dllimport) +#endif +#endif + +#ifndef GVC_API +#define GVC_API /* nothing */ +#endif + +#define LAYOUT_DONE(g) (agbindrec(g, "Agraphinfo_t", 0, TRUE) && GD_drawing(g)) + +/* misc */ +/* FIXME - this needs eliminating or renaming */ +GVC_API void gvToggle(int); + +/* set up a graphviz context */ +GVC_API GVC_t *gvNEWcontext(const lt_symlist_t *builtins, int demand_loading); + +/* set up a graphviz context - and init graph - retaining old API */ +GVC_API GVC_t *gvContext(void); +/* set up a graphviz context - and init graph - with builtins */ +GVC_API GVC_t *gvContextPlugins(const lt_symlist_t *builtins, int demand_loading); + +/* get information associated with a graphviz context */ +GVC_API char **gvcInfo(GVC_t*); +GVC_API char *gvcVersion(GVC_t*); +GVC_API char *gvcBuildDate(GVC_t*); + +/* parse command line args - minimally argv[0] sets layout engine */ +GVC_API int gvParseArgs(GVC_t *gvc, int argc, char **argv); +GVC_API graph_t *gvNextInputGraph(GVC_t *gvc); +GVC_API graph_t *gvPluginsGraph(GVC_t *gvc); + +/* Compute a layout using a specified engine */ +GVC_API int gvLayout(GVC_t *gvc, graph_t *g, const char *engine); + +/* Compute a layout using layout engine from command line args */ +GVC_API int gvLayoutJobs(GVC_t *gvc, graph_t *g); + +/* Check if a layout has been done */ +GVC_API bool gvLayoutDone(graph_t *g); + +/* Render layout into string attributes of the graph */ +GVC_API void attach_attrs(graph_t *g); + +/* Render layout in a specified format to an open FILE */ +GVC_API int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out); + +/* Render layout in a specified format to a file with the given name */ +GVC_API int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename); + +/* Render layout in a specified format to an GVC_APIal context */ +GVC_API int gvRenderContext(GVC_t *gvc, graph_t *g, const char *format, void *context); + +/* Render layout in a specified format to a malloc'ed string */ +GVC_API int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsigned int *length); + +/* Free memory allocated and pointed to by *result in gvRenderData */ +GVC_API void gvFreeRenderData (char* data); + +/* Render layout according to -T and -o options found by gvParseArgs */ +GVC_API int gvRenderJobs(GVC_t *gvc, graph_t *g); + +/* Clean up layout data structures - layouts are not nestable (yet) */ +GVC_API int gvFreeLayout(GVC_t *gvc, graph_t *g); + +/* Clean up graphviz context */ +GVC_API void gvFinalize(GVC_t *gvc); +GVC_API int gvFreeContext(GVC_t *gvc); + +/* Return list of plugins of type kind. + * kind would normally be "render" "layout" "textlayout" "device" "loadimage" + * The size of the list is stored in sz. + * The caller is responsible for freeing the storage. This involves + * freeing each item, then the list. + * Returns NULL on error, or if there are no plugins. + * In the former case, sz is unchanged; in the latter, sz = 0. + * + * At present, the str argument is unused, but may be used to modify + * the search as in gvplugin_list above. + */ +GVC_API char** gvPluginList (GVC_t *gvc, const char* kind, int* sz, char*); + +/** Add a library from your user application + * @param gvc Graphviz context to add library to + * @param lib library to add + */ +GVC_API void gvAddLibrary(GVC_t *gvc, gvplugin_library_t *lib); + +/** Perform a Transitive Reduction on a graph + * @param g graph to be transformed. + */ +GVC_API int gvToolTred(graph_t *g); + +#undef GVC_API + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvcext.h b/data/miniconda3/include/graphviz/gvcext.h new file mode 100644 index 0000000000000000000000000000000000000000..7c2c4e3252d10522cdc45e148f5aa290e74ba74e --- /dev/null +++ b/data/miniconda3/include/graphviz/gvcext.h @@ -0,0 +1,50 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +/* Common header used by both clients and plugins */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Define an apis array of name strings using an enumerated api_t as index. + * The enumerated type is defined here. The apis array is + * inititialized in gvplugin.c by redefining ELEM and reinvoking APIS. + */ +#define APIS ELEM(render) ELEM(layout) ELEM(textlayout) ELEM(device) ELEM(loadimage) + +/* + * Define api_t using names based on the plugin names with API_ prefixed. + */ +#define ELEM(x) API_##x, + typedef enum { APIS } api_t; /* API_render, API_layout, ... */ +#undef ELEM + + typedef struct GVJ_s GVJ_t; + typedef struct GVG_s GVG_t; + typedef struct GVC_s GVC_t; + + typedef struct { + const char *name; + void* address; + } lt_symlist_t; + + typedef struct gvplugin_available_s gvplugin_available_t; + +#if !defined(LTDL_H) +extern lt_symlist_t lt_preloaded_symbols[]; +#endif + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvcjob.h b/data/miniconda3/include/graphviz/gvcjob.h new file mode 100644 index 0000000000000000000000000000000000000000..7db10ed21bf3e32f7009d2ea58bffb2821cfa300 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvcjob.h @@ -0,0 +1,373 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +/* Common header used by both clients and plugins */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "gvcommon.h" +#include "color.h" +#include + +#define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0])) + + typedef struct gvdevice_engine_s gvdevice_engine_t; + typedef struct gvformatter_engine_s gvformatter_engine_t; + typedef struct gvrender_engine_s gvrender_engine_t; + typedef struct gvlayout_engine_s gvlayout_engine_t; + typedef struct gvtextlayout_engine_s gvtextlayout_engine_t; + typedef struct gvloadimage_engine_s gvloadimage_engine_t; + + typedef enum { PEN_NONE, PEN_DASHED, PEN_DOTTED, PEN_SOLID } pen_type; + typedef enum { FILL_NONE, FILL_SOLID, FILL_LINEAR, FILL_RADIAL } fill_type; + typedef enum { FONT_REGULAR, FONT_BOLD, FONT_ITALIC } font_type; + typedef enum { LABEL_PLAIN, LABEL_HTML } label_type; + +#define PENWIDTH_NORMAL 1. +#define PENWIDTH_BOLD 2. + typedef enum { GVATTR_STRING, GVATTR_BOOL, GVATTR_COLOR } gvattr_t; + +/* The -T output formats listed below are examples only, they are not definitive or inclusive, + other outputs may use the flags now, or in the future + + Default emit order is breadth first graph walk order + EMIT_SORTED emits nodes before edges + EMIT_COLORS emits colors before nodes or edge -Tfig + EMIT_CLUSTERS_LAST emits cluster after nodes and edges + EMIT_PREORDER emit in preorder traversal ??? + EMIT_EDGE_SORTED emits edges before nodes + + GVDEVICE_DOES_PAGES provides pagination support -Tps + GVDEVICE_DOES_LAYERS provides support for layers -Tps + GVDEVICE_EVENTS supports mouse events -Tgtk, -Txlib + GVDEVICE_DOES_TRUECOLOR supports alpha channel -Tpng, -Tgtk, -Txlib + GVDEVICE_BINARY_FORMAT Suppresses \r\n substitution for linends + GVDEVICE_COMPRESSED_FORMAT controls libz compression + GVDEVICE_NO_WRITER used when gvdevice is not used because device uses its own writer, devil outputs (FIXME seems to overlap OUTPUT_NOT_REQUIRED) + + GVRENDER_Y_GOES_DOWN device origin top left, y goes down, otherwise + device origin lower left, y goes up + GVRENDER_DOES_TRANSFORM device uses scale, translate, rotate to do its own + coordinate transformations, otherwise coordinates + are pre-transformed + GVRENDER_DOES_ARROWS renderer has its own idea of arrow shapes (deprecated) + GVRENDER_DOES_LABELS basically, maps don't need labels + GVRENDER_DOES_MAPS renderer encodes mapping information for mouse events -Tcmapx -Tsvg + GVRENDER_DOES_MAP_RECTANGLE supports a 2 coord rectngle optimization + GVRENDER_DOES_MAP_CIRCLE supports a 1 coord + radius circle optimization + GVRENDER_DOES_MAP_POLYGON supports polygons (basically, -Tsvg uses anchors, so doesn't need to support any map shapes) + GVRENDER_DOES_MAP_ELLIPSE supports a 2 coord ellipse optimization + GVRENDER_DOES_MAP_BSPLINE supports mapping of splines + GVRENDER_DOES_TOOLTIPS can represent tooltip info -Tcmapx, -Tsvg + GVRENDER_DOES_TARGETS can represent target info (open link in a new tab or window) + GVRENDER_DOES_Z render support 2.5D representation -Tvrml + GVRENDER_NO_WHITE_BG don't paint white background, assumes white paper -Tps + LAYOUT_NOT_REQUIRED don't perform layout -Tcanon + OUTPUT_NOT_REQUIRED don't use gvdevice for output (basically when agwrite() used instead) -Tcanon, -Txdot + */ + + +#define EMIT_SORTED (1<<0) +#define EMIT_COLORS (1<<1) +#define EMIT_CLUSTERS_LAST (1<<2) +#define EMIT_PREORDER (1<<3) +#define EMIT_EDGE_SORTED (1<<4) +#define GVDEVICE_DOES_PAGES (1<<5) +#define GVDEVICE_DOES_LAYERS (1<<6) +#define GVDEVICE_EVENTS (1<<7) +#define GVDEVICE_DOES_TRUECOLOR (1<<8) +#define GVDEVICE_BINARY_FORMAT (1<<9) +#define GVDEVICE_COMPRESSED_FORMAT (1<<10) +#define GVDEVICE_NO_WRITER (1<<11) +#define GVRENDER_Y_GOES_DOWN (1<<12) +#define GVRENDER_DOES_TRANSFORM (1<<13) +#define GVRENDER_DOES_ARROWS (1<<14) +#define GVRENDER_DOES_LABELS (1<<15) +#define GVRENDER_DOES_MAPS (1<<16) +#define GVRENDER_DOES_MAP_RECTANGLE (1<<17) +#define GVRENDER_DOES_MAP_CIRCLE (1<<18) +#define GVRENDER_DOES_MAP_POLYGON (1<<19) +#define GVRENDER_DOES_MAP_ELLIPSE (1<<20) +#define GVRENDER_DOES_MAP_BSPLINE (1<<21) +#define GVRENDER_DOES_TOOLTIPS (1<<22) +#define GVRENDER_DOES_TARGETS (1<<23) +#define GVRENDER_DOES_Z (1<<24) +#define GVRENDER_NO_WHITE_BG (1<<25) +#define LAYOUT_NOT_REQUIRED (1<<26) +#define OUTPUT_NOT_REQUIRED (1<<27) + + typedef struct { + int flags; + double default_pad; /* graph units */ + char **knowncolors; + int sz_knowncolors; + color_type_t color_type; + } gvrender_features_t; + + typedef struct { + int flags; + pointf default_margin; /* left/right, top/bottom - points */ + pointf default_pagesize;/* default page width, height - points */ + pointf default_dpi; + } gvdevice_features_t; + +#define LAYOUT_USES_RANKDIR (1<<0) + + typedef struct gvplugin_active_device_s { + gvdevice_engine_t *engine; + int id; + gvdevice_features_t *features; + const char *type; + } gvplugin_active_device_t; + + typedef struct gvplugin_active_render_s { + gvrender_engine_t *engine; + int id; + gvrender_features_t *features; + const char *type; + } gvplugin_active_render_t; + + typedef struct gvplugin_active_loadimage_t { + gvloadimage_engine_t *engine; + int id; + const char *type; + } gvplugin_active_loadimage_t; + + typedef struct gv_argvlist_s { + char **argv; + int argc; + int alloc; + } gv_argvlist_t; + + typedef struct gvdevice_callbacks_s { + void (*refresh) (GVJ_t * job); + void (*button_press) (GVJ_t * job, int button, pointf pointer); + void (*button_release) (GVJ_t * job, int button, pointf pointer); + void (*motion) (GVJ_t * job, pointf pointer); + void (*modify) (GVJ_t * job, const char *name, const char *value); + void (*del) (GVJ_t * job); /* can't use "delete" 'cos C++ stole it */ + void (*read) (GVJ_t * job, const char *filename, const char *layout); + void (*layout) (GVJ_t * job, const char *layout); + void (*render) (GVJ_t * job, const char *format, const char *filename); + } gvdevice_callbacks_t; + + typedef int (*gvevent_key_callback_t) (GVJ_t * job); + + typedef struct gvevent_key_binding_s { + char *keystring; + gvevent_key_callback_t callback; + } gvevent_key_binding_t; + + typedef enum {MAP_RECTANGLE, MAP_CIRCLE, MAP_POLYGON, } map_shape_t; + + typedef enum {ROOTGRAPH_OBJTYPE, CLUSTER_OBJTYPE, NODE_OBJTYPE, EDGE_OBJTYPE} obj_type; + + /* If this enum is changed, the implementation of xbuf and xbufs in + * gvrender_core_dot.c will probably need to be changed. + */ + typedef enum { + EMIT_GDRAW, EMIT_CDRAW, EMIT_TDRAW, EMIT_HDRAW, + EMIT_GLABEL, EMIT_CLABEL, EMIT_TLABEL, EMIT_HLABEL, + EMIT_NDRAW, EMIT_EDRAW, EMIT_NLABEL, EMIT_ELABEL, + } emit_state_t; + + typedef struct obj_state_s obj_state_t; + + struct obj_state_s { + obj_state_t *parent; + + obj_type type; + union { + graph_t *g; + graph_t *sg; + node_t *n; + edge_t *e; + } u; + + emit_state_t emit_state; + + gvcolor_t pencolor, fillcolor, stopcolor; + int gradient_angle; + float gradient_frac; + pen_type pen; + fill_type fill; + double penwidth; + char **rawstyle; + + double z, tail_z, head_z; /* z depths for 2.5D renderers such as vrml */ + + /* fully substituted text strings */ + char *label; + char *xlabel; + char *taillabel; + char *headlabel; + + char *url; /* if GVRENDER_DOES_MAPS */ + char *id; + char *labelurl; + char *tailurl; + char *headurl; + + char *tooltip; /* if GVRENDER_DOES_TOOLTIPS */ + char *labeltooltip; + char *tailtooltip; + char *headtooltip; + + char *target; /* if GVRENDER_DOES_TARGETS */ + char *labeltarget; + char *tailtarget; + char *headtarget; + + unsigned explicit_tooltip:1; + unsigned explicit_tailtooltip:1; + unsigned explicit_headtooltip:1; + unsigned explicit_labeltooltip:1; + unsigned explicit_tailtarget:1; + unsigned explicit_headtarget:1; + unsigned explicit_edgetarget:1; + unsigned explicit_tailurl:1; + unsigned explicit_headurl:1; + unsigned labeledgealigned:1; + + /* primary mapped region - node shape, edge labels */ + map_shape_t url_map_shape; + int url_map_n; /* number of points for url map if GVRENDER_DOES_MAPS */ + pointf *url_map_p; + + /* additional mapped regions for edges */ + int url_bsplinemap_poly_n; /* number of polygons in url bspline map + if GVRENDER_DOES_MAPS && GVRENDER_DOES_MAP_BSPLINES */ + int *url_bsplinemap_n; /* array of url_bsplinemap_poly_n ints + of number of points in each polygon */ + pointf *url_bsplinemap_p; /* all the polygon points */ + + int tailendurl_map_n; /* tail end intersection with node */ + pointf *tailendurl_map_p; + + int headendurl_map_n; /* head end intersection with node */ + pointf *headendurl_map_p; + }; + +/* Note on units: + * points - a physical distance (1/72 inch) unaffected by zoom or dpi. + * graph units - related to physical distance by zoom. Equals points at zoom=1 + * device units - related to physical distance in points by dpi/72 + */ + + struct GVJ_s { + GVC_t *gvc; /* parent gvc */ + GVJ_t *next; /* linked list of jobs */ + GVJ_t *next_active; /* linked list of active jobs (e.g. multiple windows) */ + + GVCOMMON_t *common; + + obj_state_t *obj; /* objects can be nested (at least clusters can) + so keep object state on a stack */ + char *input_filename; + int graph_index; + + const char *layout_type; + + const char *output_filename; + FILE *output_file; + char *output_data; + unsigned int output_data_allocated; + unsigned int output_data_position; + + const char *output_langname; + int output_lang; + + gvplugin_active_render_t render; + gvplugin_active_device_t device; + gvplugin_active_loadimage_t loadimage; + gvdevice_callbacks_t *callbacks; + pointf device_dpi; + bool device_sets_dpi; + + void *display; + int screen; + + void *context; /* gd or cairo surface */ + bool external_context; /* context belongs to caller */ + char *imagedata; /* location of imagedata */ + + int flags; /* emit_graph flags */ + + int numLayers; /* number of layers */ + int layerNum; /* current layer - 1 based*/ + + point pagesArraySize; /* 2D size of page array */ + point pagesArrayFirst;/* 2D starting corner in */ + point pagesArrayMajor;/* 2D major increment */ + point pagesArrayMinor;/* 2D minor increment */ + point pagesArrayElem; /* 2D coord of current page - 0,0 based */ + int numPages; /* number of pages */ + + boxf bb; /* graph bb with padding - graph units */ + pointf pad; /* padding around bb - graph units */ + boxf clip; /* clip region in graph units */ + boxf pageBox; /* current page in graph units */ + pointf pageSize; /* page size in graph units */ + pointf focus; /* viewport focus - graph units */ + + double zoom; /* viewport zoom factor (points per graph unit) */ + int rotation; /* viewport rotation (degrees) 0=portrait, 90=landscape */ + + pointf view; /* viewport size - points */ + boxf canvasBox; /* viewport area - points */ + pointf margin; /* job-specific margin - points */ + + pointf dpi; /* device resolution device-units-per-inch */ + + unsigned int width; /* device width - device units */ + unsigned int height; /* device height - device units */ + box pageBoundingBox;/* rotated boundingBox - device units */ + box boundingBox; /* cumulative boundingBox over all pages - device units */ + + pointf scale; /* composite device to graph units (zoom and dpi) */ + pointf translation; /* composite translation */ + pointf devscale; /* composite device to points: dpi, y_goes_down */ + + bool fit_mode, + needs_refresh, + click, + has_grown, + has_been_rendered; + + unsigned char button; /* active button */ + pointf pointer; /* pointer position in device units */ + pointf oldpointer; /* old pointer position in device units */ + + void *current_obj; /* graph object that pointer is in currently */ + + void *selected_obj; /* graph object that has been selected */ + /* (e.g. button 1 clicked on current obj) */ + char *active_tooltip; /* tooltip of active object - or NULL */ + char *selected_href; /* href of selected object - or NULL */ + gv_argvlist_t selected_obj_type_name; /* (e.g. "edge" "node3" "e" "->" "node5" "") */ + gv_argvlist_t selected_obj_attributes; /* attribute triplets: name, value, type */ + /* e.g. "color", "red", GVATTR_COLOR, + "style", "filled", GVATTR_BOOL, */ + + void *window; /* display-specific data for gvrender plugin */ + + /* keybindings for keyboard events */ + gvevent_key_binding_t *keybindings; + int numkeys; + void *keycodes; + }; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvcommon.h b/data/miniconda3/include/graphviz/gvcommon.h new file mode 100644 index 0000000000000000000000000000000000000000..02deefae4be27a63ff4e77edf6a8fec07abefc5d --- /dev/null +++ b/data/miniconda3/include/graphviz/gvcommon.h @@ -0,0 +1,35 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + + typedef struct GVCOMMON_s { + char **info; + char *cmdname; + int verbose; + bool config, auto_outfile_names; + void (*errorfn) (const char *fmt, ...); + const char **show_boxes; /* emit code for correct box coordinates */ + const char **lib; + + /* rendering state */ + int viewNum; /* current view - 1 based count of views, + all pages in all layers */ + const lt_symlist_t *builtins; + int demand_loading; + } GVCOMMON_t; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvconfig.h b/data/miniconda3/include/graphviz/gvconfig.h new file mode 100644 index 0000000000000000000000000000000000000000..9f0f1ab437446deac8951744f7c6ebbcee9b44d6 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvconfig.h @@ -0,0 +1,27 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +/* Header used by plugins */ + +#pragma once + +#include "gvplugin.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern void gvconfig_plugin_install_from_library(GVC_t * gvc, + char *package_path, + gvplugin_library_t *library); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvplugin.h b/data/miniconda3/include/graphviz/gvplugin.h new file mode 100644 index 0000000000000000000000000000000000000000..4aa2871e9d43ea76ac7f3ddb8db9c1f6a894222f --- /dev/null +++ b/data/miniconda3/include/graphviz/gvplugin.h @@ -0,0 +1,58 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +/* Header used by plugins */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "gvcext.h" + +/* + * Terminology: + * + * package - e.g. libgvplugin_cairo.so + * api - e.g. render + * type - e.g. "png", "ps" + */ + + typedef struct { + int id; /* an id that is only unique within a package + of plugins of the same api. + A renderer-type such as "png" in the cairo package + has an id that is different from the "ps" type + in the same package */ + const char *type; /* a string name, such as "png" or "ps" that + distinguishes different types within the same + (renderer in this case) */ + int quality; /* an arbitrary integer used for ordering plugins of + the same type from different packages */ + void *engine; /* pointer to the jump table for the plugin */ + void *features; /* pointer to the feature description + void* because type varies by api */ + } gvplugin_installed_t; + + typedef struct { + api_t api; + gvplugin_installed_t *types; + } gvplugin_api_t; + + typedef struct { + char *packagename; /* used when this plugin is builtin and has + no pathname */ + gvplugin_api_t *apis; + } gvplugin_library_t; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvplugin_device.h b/data/miniconda3/include/graphviz/gvplugin_device.h new file mode 100644 index 0000000000000000000000000000000000000000..60c4ea34609115f024f596c78b7c2150625f3003 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvplugin_device.h @@ -0,0 +1,29 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include "types.h" +#include "gvplugin.h" +#include "gvcjob.h" + +#ifdef __cplusplus +extern "C" { +#endif + + struct gvdevice_engine_s { + void (*initialize) (GVJ_t * firstjob); + void (*format) (GVJ_t * firstjob); + void (*finalize) (GVJ_t * firstjob); + }; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvplugin_layout.h b/data/miniconda3/include/graphviz/gvplugin_layout.h new file mode 100644 index 0000000000000000000000000000000000000000..9bbb155eefc3f0703eb95745f02ca699f7360910 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvplugin_layout.h @@ -0,0 +1,28 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include "types.h" +#include "gvplugin.h" +#include "gvcjob.h" + +#ifdef __cplusplus +extern "C" { +#endif + + struct gvlayout_engine_s { + void (*layout) (graph_t * g); + void (*cleanup) (graph_t * g); + }; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvplugin_loadimage.h b/data/miniconda3/include/graphviz/gvplugin_loadimage.h new file mode 100644 index 0000000000000000000000000000000000000000..ed81a82afb7dec8f4552edc9d61de49ace3de724 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvplugin_loadimage.h @@ -0,0 +1,45 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include "types.h" +#include "gvplugin.h" +#include "gvcjob.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef GVDLL +#ifdef GVC_EXPORTS +#define GVPLUGIN_LOADIMAGE_API __declspec(dllexport) +#else +#define GVPLUGIN_LOADIMAGE_API __declspec(dllimport) +#endif +#endif + +#ifndef GVPLUGIN_LOADIMAGE_API +#define GVPLUGIN_LOADIMAGE_API /* nothing */ +#endif + +GVPLUGIN_LOADIMAGE_API bool gvusershape_file_access(usershape_t *us); +GVPLUGIN_LOADIMAGE_API void gvusershape_file_release(usershape_t *us); + + struct gvloadimage_engine_s { + void (*loadimage) (GVJ_t *job, usershape_t *us, boxf b, bool filled); + }; + +#undef GVPLUGIN_LOADIMAGE_API + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvplugin_render.h b/data/miniconda3/include/graphviz/gvplugin_render.h new file mode 100644 index 0000000000000000000000000000000000000000..342adbf39cf80c5761e9f392da70ee382cffa876 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvplugin_render.h @@ -0,0 +1,59 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include "types.h" +#include "gvplugin.h" +#include "gvcjob.h" + +#ifdef __cplusplus +extern "C" { +#endif + + struct gvrender_engine_s { + void (*begin_job) (GVJ_t * job); + void (*end_job) (GVJ_t * job); + void (*begin_graph) (GVJ_t * job); + void (*end_graph) (GVJ_t * job); + void (*begin_layer) (GVJ_t * job, char *layername, + int layerNum, int numLayers); + void (*end_layer) (GVJ_t * job); + void (*begin_page) (GVJ_t * job); + void (*end_page) (GVJ_t * job); + void (*begin_cluster) (GVJ_t * job); + void (*end_cluster) (GVJ_t * job); + void (*begin_nodes) (GVJ_t * job); + void (*end_nodes) (GVJ_t * job); + void (*begin_edges) (GVJ_t * job); + void (*end_edges) (GVJ_t * job); + void (*begin_node) (GVJ_t * job); + void (*end_node) (GVJ_t * job); + void (*begin_edge) (GVJ_t * job); + void (*end_edge) (GVJ_t * job); + void (*begin_anchor) (GVJ_t * job, + char *href, char *tooltip, char *target, char *id); + void (*end_anchor) (GVJ_t * job); + void (*begin_label) (GVJ_t * job, label_type type); + void (*end_label) (GVJ_t * job); + void (*textspan) (GVJ_t * job, pointf p, textspan_t * span); + void (*resolve_color) (GVJ_t * job, gvcolor_t * color); + void (*ellipse) (GVJ_t * job, pointf * A, int filled); + void (*polygon) (GVJ_t * job, pointf * A, int n, int filled); + void (*beziercurve) (GVJ_t * job, pointf * A, int n, + int arrow_at_start, int arrow_at_end, int); + void (*polyline) (GVJ_t * job, pointf * A, int n); + void (*comment) (GVJ_t * job, char *comment); + void (*library_shape) (GVJ_t * job, char *name, pointf * A, int n, int filled); + }; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvplugin_textlayout.h b/data/miniconda3/include/graphviz/gvplugin_textlayout.h new file mode 100644 index 0000000000000000000000000000000000000000..45fe2f72e9461bada8af78bd0cedbffd37319c27 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvplugin_textlayout.h @@ -0,0 +1,29 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include "types.h" +#include "gvplugin.h" +#include "gvcjob.h" +#include "gvcommon.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + struct gvtextlayout_engine_s { + bool (*textlayout) (textspan_t *span, char** fontpath); + }; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/gvpr.h b/data/miniconda3/include/graphviz/gvpr.h new file mode 100644 index 0000000000000000000000000000000000000000..85845eab03698eb03dacb258b857391492af6ba8 --- /dev/null +++ b/data/miniconda3/include/graphviz/gvpr.h @@ -0,0 +1,74 @@ +/** + * @file + * @brief graph pattern scanning and processing language API, main function @ref gvpr + */ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef GVDLL +#ifdef EXPORT_GVPR +#define GVPR_API __declspec(dllexport) +#else +#define GVPR_API __declspec(dllimport) +#endif +#endif + +#ifndef GVPR_API +#define GVPR_API /* nothing */ +#endif + +#include "cgraph.h" +#ifdef _MSC_VER +#include +typedef SSIZE_T ssize_t; +#endif + +/* Bits for flags variable in gvprstate_t. + * Included here so that calling programs can use the first + * two in gvpropts.flags + */ + /* If set, gvpr calls exit() on errors */ +#define GV_USE_EXIT 1 + /* If set, gvpr stores output graphs in gvpropts */ +#define GV_USE_OUTGRAPH 2 + /* Use longjmp to return to top-level call in gvpr */ +#define GV_USE_JUMP 4 + /* $tvnext has been set but not used */ +#define GV_NEXT_SET 8 + + +typedef ssize_t (*gvprwr) (void*, const char *buf, size_t nbyte, void*); +typedef int (*gvpruserfn) (char *); +typedef struct { + char* name; + gvpruserfn fn; +} gvprbinding; + +typedef struct { + Agraph_t** ingraphs; /* NULL-terminated array of input graphs */ + int n_outgraphs; /* if GV_USE_OUTGRAPH set, output graphs */ + Agraph_t** outgraphs; + gvprwr out; /* write function for stdout */ + gvprwr err; /* write function for stderr */ + int flags; + gvprbinding* bindings; /* array of bindings, terminated with {NULL,NULL} */ +} gvpropts; + +GVPR_API extern int gvpr (int argc, char *argv[], gvpropts* opts); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/pack.h b/data/miniconda3/include/graphviz/pack.h new file mode 100644 index 0000000000000000000000000000000000000000..9c6adccaafc13d3342cd49ab9a9530a481310410 --- /dev/null +++ b/data/miniconda3/include/graphviz/pack.h @@ -0,0 +1,99 @@ +/** + * @file + * @brief support for connected components + */ + +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include "types.h" + +/* Type indicating granularity and method + * l_undef - unspecified + * l_node - polyomino using nodes and edges + * l_clust - polyomino using nodes and edges and top-level clusters + * (assumes ND_clust(n) unused by application) + * l_graph - polyomino using computer graph bounding box + * l_array - array based on graph bounding boxes + * l_aspect - tiling based on graph bounding boxes preserving aspect ratio + * l_hull - polyomino using convex hull (unimplemented) + * l_tile - tiling using graph bounding box (unimplemented) + * l_bisect - alternate bisection using graph bounding box (unimplemented) + */ + typedef enum { l_undef, l_clust, l_node, l_graph, l_array, l_aspect } pack_mode; + +#define PK_COL_MAJOR (1 << 0) +#define PK_USER_VALS (1 << 1) +#define PK_LEFT_ALIGN (1 << 2) +#define PK_RIGHT_ALIGN (1 << 3) +#define PK_TOP_ALIGN (1 << 4) +#define PK_BOT_ALIGN (1 << 5) +#define PK_INPUT_ORDER (1 << 6) + +typedef unsigned int packval_t; + + typedef struct { + float aspect; /* desired aspect ratio */ + int sz; /* row/column size size */ + unsigned int margin; /* margin left around objects, in points */ + int doSplines; /* use splines in constructing graph shape */ + pack_mode mode; /* granularity and method */ + bool *fixed; /* fixed[i] == true implies g[i] should not be moved */ + packval_t* vals; /* for arrays, sort numbers */ + int flags; + } pack_info; + +#ifdef GVDLL +#ifdef GVC_EXPORTS +#define PACK_API __declspec(dllexport) +#else +#define PACK_API __declspec(dllimport) +#endif +#endif + +#ifndef PACK_API +#define PACK_API /* nothing */ +#endif + + PACK_API point *putRects(int ng, boxf* bbs, pack_info* pinfo); + PACK_API int packRects(int ng, boxf* bbs, pack_info* pinfo); + + PACK_API point *putGraphs(int, Agraph_t **, Agraph_t *, pack_info *); + PACK_API int packGraphs(int, Agraph_t **, Agraph_t *, pack_info *); + PACK_API int packSubgraphs(int, Agraph_t **, Agraph_t *, pack_info *); + PACK_API int pack_graph(int ng, Agraph_t** gs, Agraph_t* root, bool *fixed); + + PACK_API int shiftGraphs(int, Agraph_t**, point*, Agraph_t*, int); + + PACK_API pack_mode getPackMode(Agraph_t * g, pack_mode dflt); + PACK_API int getPack(Agraph_t *, int not_def, int dflt); + PACK_API pack_mode getPackInfo(Agraph_t * g, pack_mode dflt, int dfltMargin, pack_info*); + PACK_API pack_mode getPackModeInfo(Agraph_t * g, pack_mode dflt, pack_info*); + PACK_API pack_mode parsePackModeInfo(const char* p, pack_mode dflt, + pack_info* pinfo); + + PACK_API int isConnected(Agraph_t *); + PACK_API Agraph_t **ccomps(Agraph_t *, int *, char *); + PACK_API Agraph_t **cccomps(Agraph_t *, int *, char *); + PACK_API Agraph_t **pccomps(Agraph_t *, int *, char *, bool *); + PACK_API int nodeInduce(Agraph_t *); + PACK_API Agraph_t *mapClust(Agraph_t *); +#undef PACK_API +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/pathgeom.h b/data/miniconda3/include/graphviz/pathgeom.h new file mode 100644 index 0000000000000000000000000000000000000000..437d987d214705ce51f21b72d0eb700bc197f883 --- /dev/null +++ b/data/miniconda3/include/graphviz/pathgeom.h @@ -0,0 +1,61 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef GVDLL +#ifdef PATHPLAN_EXPORTS +#define PATHGEOM_API __declspec(dllexport) +#else +#define PATHGEOM_API __declspec(dllimport) +#endif +#endif + +#ifndef PATHGEOM_API +#define PATHGEOM_API /* nothing */ +#endif + +#ifdef HAVE_POINTF_S + typedef struct pointf_s Ppoint_t; + typedef struct pointf_s Pvector_t; +#else + typedef struct Pxy_t { + double x, y; + } Pxy_t; + + typedef struct Pxy_t Ppoint_t; + typedef struct Pxy_t Pvector_t; +#endif + + typedef struct Ppoly_t { + Ppoint_t *ps; + int pn; + } Ppoly_t; + + typedef Ppoly_t Ppolyline_t; + + typedef struct Pedge_t { + Ppoint_t a, b; + } Pedge_t; + +/* opaque state handle for visibility graph operations */ + typedef struct vconfig_s vconfig_t; + + PATHGEOM_API void freePath(Ppolyline_t* p); + +#undef PATHGEOM_API + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/pathplan.h b/data/miniconda3/include/graphviz/pathplan.h new file mode 100644 index 0000000000000000000000000000000000000000..f1eb9d675e012314e9cd316796a1fd56ea832843 --- /dev/null +++ b/data/miniconda3/include/graphviz/pathplan.h @@ -0,0 +1,57 @@ +/** + * @file + * @brief finds and smooths shortest paths + */ + +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include "pathgeom.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef GVDLL +#ifdef PATHPLAN_EXPORTS +#define PATHPLAN_API __declspec(dllexport) +#else +#define PATHPLAN_API __declspec(dllimport) +#endif +#endif + +#ifndef PATHPLAN_API +#define PATHPLAN_API /* nothing */ +#endif + +/* find shortest euclidean path within a simple polygon */ + PATHPLAN_API int Pshortestpath(Ppoly_t * boundary, Ppoint_t endpoints[2], + Ppolyline_t * output_route); + +/* fit a spline to an input polyline, without touching barrier segments */ + PATHPLAN_API int Proutespline(Pedge_t * barriers, int n_barriers, + Ppolyline_t input_route, + Pvector_t endpoint_slopes[2], + Ppolyline_t * output_route); + +/* utility function to convert from a set of polygonal obstacles to barriers */ + PATHPLAN_API int Ppolybarriers(Ppoly_t ** polys, int npolys, + Pedge_t ** barriers, int *n_barriers); + +/* function to convert a polyline into a spline representation */ + PATHPLAN_API void make_polyline(Ppolyline_t line, Ppolyline_t* sline); + +#undef PATHPLAN_API + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/textspan.h b/data/miniconda3/include/graphviz/textspan.h new file mode 100644 index 0000000000000000000000000000000000000000..4fa0651ed2ccc434df04329fdb53bb86bc6e2ac1 --- /dev/null +++ b/data/miniconda3/include/graphviz/textspan.h @@ -0,0 +1,74 @@ +/** + * @file + * @brief @ref textspan_t, @ref textfont_t, @ref PostscriptAlias + */ + +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#define GV_TEXTFONT_FLAGS_WIDTH 7 + +/* Bold, Italic, Underline, Sup, Sub, Strike */ +/* Stored in textfont_t.flags, which is GV_TEXTFONT_FLAGS_WIDTH bits, so full */ +/* Probably should be moved to textspan_t */ +#define HTML_BF (1 << 0) +#define HTML_IF (1 << 1) +#define HTML_UL (1 << 2) +#define HTML_SUP (1 << 3) +#define HTML_SUB (1 << 4) +#define HTML_S (1 << 5) +#define HTML_OL (1 << 6) + + typedef struct _PostscriptAlias { + char* name; + char* family; + char* weight; + char* stretch; + char* style; + int xfig_code; + char* svg_font_family; + char* svg_font_weight; + char* svg_font_style; + } PostscriptAlias; + + /* font information + * If name or color is NULL, or size < 0, that attribute + * is unspecified. + */ + typedef struct { + char* name; + char* color; + PostscriptAlias *postscript_alias; + double size; + unsigned int flags:GV_TEXTFONT_FLAGS_WIDTH; // HTML_UL, HTML_IF, HTML_BF, etc. + unsigned int cnt:(sizeof(unsigned int) * 8 - GV_TEXTFONT_FLAGS_WIDTH); + ///< reference count + } textfont_t; + + /* atomic unit of text emitted using a single htmlfont_t */ + typedef struct { + char *str; /* stored in utf-8 */ + textfont_t *font; + void *layout; + void (*free_layout) (void *layout); /* FIXME - this is ugly */ + double yoffset_layout, yoffset_centerline; + pointf size; + char just; /* 'l' 'n' 'r' */ /* FIXME */ + } textspan_t; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/types.h b/data/miniconda3/include/graphviz/types.h new file mode 100644 index 0000000000000000000000000000000000000000..a7acbcde54c300c470f2924183f3d4c3a48eed88 --- /dev/null +++ b/data/miniconda3/include/graphviz/types.h @@ -0,0 +1,619 @@ +/** + * @file + * @brief graphs, nodes and edges info: Agraphinfo_t, Agnodeinfo_t and Agedgeinfo_t + */ + +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +/* Define if you want CGRAPH */ +#define WITH_CGRAPH 1 + +#include +#include +#include +#include + +/// @cond + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!FALSE) +#endif + +/// @endcond + +#include "geom.h" +#include "gvcext.h" +#include "pathgeom.h" +#include "textspan.h" +#include "cgraph.h" + +#ifdef __cplusplus +extern "C" { +#endif + + typedef int (*qsort_cmpf) (const void *, const void *); + typedef int (*bsearch_cmpf) (const void *, const void *); + typedef struct Agraph_s graph_t; + typedef struct Agnode_s node_t; + typedef struct Agedge_s edge_t; + typedef struct Agsym_s attrsym_t; +#define TAIL_ID "tailport" +#define HEAD_ID "headport" + + typedef struct htmllabel_t htmllabel_t; + + typedef union inside_t { + struct { + pointf* p; + double* r; + } a; + struct { + node_t* n; + boxf* bp; + } s; + } inside_t; + + typedef struct port { /* internal edge endpoint specification */ + pointf p; /* aiming point relative to node center */ + double theta; /* slope in radians */ + boxf *bp; /* if not null, points to bbox of + * rectangular area that is port target + */ + bool defined; /* if true, edge has port info at this end */ + bool constrained; /* if true, constraints such as theta are set */ + bool clip; /* if true, clip end to node/port shape */ + bool dyna; /* if true, assign compass point dynamically */ + unsigned char order; /* for mincross */ + unsigned char side; /* if port is on perimeter of node, this + * contains the bitwise OR of the sides (TOP, + * BOTTOM, etc.) it is on. + */ + char *name; /* port name, if it was explicitly given, otherwise NULL */ + } port; + + typedef struct { + bool(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */ + bool(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */ + bool ignoreSwap; /* Test for swapped edges if false */ + bool isOrtho; /* Orthogonal routing used */ + } splineInfo; + + typedef struct pathend_t { + boxf nb; /* the node box */ + pointf np; /* node port */ + int sidemask; + int boxn; + boxf boxes[20]; + } pathend_t; + + typedef struct path { /* internal specification for an edge spline */ + port start; + port end; + int nbox; /* number of subdivisions */ + boxf *boxes; /* rectangular regions of subdivision */ + void *data; + } path; + + typedef struct bezier { + pointf *list; + int size; + int sflag; + int eflag; + pointf sp; + pointf ep; + } bezier; + + typedef struct splines { + bezier *list; + int size; + boxf bb; + } splines; + + typedef struct textlabel_t { + char *text; + char *fontname; + char *fontcolor; + int charset; + double fontsize; + pointf dimen; /* the diagonal size of the label (estimated by layout) */ + pointf space; /* the diagonal size of the space for the label */ + /* the rendered label is aligned in this box */ + /* space does not include pad or margin */ + pointf pos; /* the center of the space for the label */ + union { + struct { + textspan_t *span; + short nspans; + } txt; + htmllabel_t *html; + } u; + char valign; /* 't' 'c' 'b' */ + bool set; /* true if position is set */ + bool html; /* true if html label */ + } textlabel_t; + + typedef struct polygon_t { /* mutable shape information for a node */ + int regular; /* true for symmetric shapes */ + int peripheries; /* number of periphery lines */ + int sides; /* number of sides */ + double orientation; /* orientation of shape (+ve degrees) */ + double distortion; /* distortion factor - as in trapezium */ + double skew; /* skew factor - as in parallelogram */ + int option; /* ROUNDED, DIAGONAL corners, etc. */ + pointf *vertices; /* array of vertex points */ + } polygon_t; + + typedef struct stroke_t { /* information about a single stroke */ + /* we would have called it a path if that term wasn't already used */ + int nvertices; /* number of points in the stroke */ + int flags; /* stroke style flags */ + pointf *vertices; /* array of vertex points */ + } stroke_t; + +/* flag definitions for stroke_t */ +#define STROKE_CLOSED (1 << 0) +#define STROKE_FILLED (1 << 1) +#define STROKE_PENDOWN (1 << 2) +#define STROKE_VERTICES_ALLOCATED (1 << 3) + + typedef struct shape_functions { /* read-only shape functions */ + void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */ + void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */ + port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */ + bool(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */ + int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr); /* finds box path to reach port */ + void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */ + } shape_functions; + + typedef enum { SH_UNSET, SH_POLY, SH_RECORD, SH_POINT, SH_EPSF} shape_kind; + + typedef struct shape_desc { /* read-only shape descriptor */ + char *name; /* as read from graph file */ + shape_functions *fns; + polygon_t *polygon; /* base polygon info */ + bool usershape; + } shape_desc; + +#include "usershape.h" /* usershapes needed by gvc */ + + typedef struct nodequeue { + node_t **store; + node_t **limit; + node_t **head; + node_t **tail; + } nodequeue; + + typedef struct adjmatrix_t { + int nrows; + int ncols; + char *data; + } adjmatrix_t; + + typedef struct rank_t { + int n; /* number of nodes in this rank */ + node_t **v; /* ordered list of nodes in rank */ + int an; /* globally allocated number of nodes */ + node_t **av; /* allocated list of nodes in rank */ + double ht1; /* height below/above centerline */ + double ht2; /* height below/above centerline */ + double pht1; /* as above, but only primitive nodes */ + double pht2; /* as above, but only primitive nodes */ + bool candidate; /* for transpose () */ + bool valid; + int cache_nc; /* caches number of crossings */ + adjmatrix_t *flat; + } rank_t; + + typedef enum { R_NONE = + 0, R_VALUE, R_FILL, R_COMPRESS, R_AUTO, R_EXPAND } ratio_t; + + typedef struct layout_t { + double quantum; + double scale; + double ratio; /* set only if ratio_kind == R_VALUE */ + double dpi; + pointf margin; + pointf page; + pointf size; + bool filled; + bool landscape; + bool centered; + ratio_t ratio_kind; + void* xdots; + char* id; + } layout_t; + +/* for "record" shapes */ + typedef struct field_t { + pointf size; /* its dimension */ + boxf b; /* its placement in node's coordinates */ + int n_flds; + textlabel_t *lp; /* n_flds == 0 */ + struct field_t **fld; /* n_flds > 0 */ + char *id; /* user's identifier */ + unsigned char LR; /* if box list is horizontal (left to right) */ + unsigned char sides; /* sides of node exposed to field */ + } field_t; + + typedef struct nlist_t { + node_t **list; + int size; + } nlist_t; + + typedef struct elist { + edge_t **list; + int size; + } elist; + +#define GUI_STATE_ACTIVE (1<<0) +#define GUI_STATE_SELECTED (1<<1) +#define GUI_STATE_VISITED (1<<2) +#define GUI_STATE_DELETED (1<<3) + +#define elist_fastapp(item,L) do {L.list[L.size++] = item; L.list[L.size] = NULL;} while(0) +#define elist_append(item,L) do {L.list = ALLOC(L.size + 2,L.list,edge_t*); L.list[L.size++] = item; L.list[L.size] = NULL;} while(0) +#define alloc_elist(n,L) do {L.size = 0; L.list = N_NEW(n + 1,edge_t*); } while (0) +#define free_list(L) free(L.list) + +typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind; + + typedef struct Agraphinfo_t { + Agrec_t hdr; + /* to generate code */ + layout_t *drawing; + textlabel_t *label; /* if the cluster has a title */ + boxf bb; /* bounding box */ + pointf border[4]; /* sizes of margins for graph labels */ + unsigned char gui_state; /* Graph state for GUI ops */ + unsigned char has_labels; + bool has_images; + unsigned char charset; /* input character set */ + int rankdir; + double ht1; /* below and above extremal ranks */ + double ht2; /* below and above extremal ranks */ + unsigned short flags; + void *alg; + GVC_t *gvc; /* context for "globals" over multiple graphs */ + void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */ + +#ifndef DOT_ONLY + /* to place nodes */ + node_t **neato_nlist; + int move; + double **dist; + double **spring; + double **sum_t; + double ***t; + unsigned short ndim; + unsigned short odim; +#endif +#ifndef NEATO_ONLY + /* to have subgraphs */ + int n_cluster; + graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */ + graph_t *dotroot; + node_t *nlist; + rank_t *rank; + graph_t *parent; /* containing cluster (not parent subgraph) */ + int level; /* cluster nesting level (not node level!) */ + node_t *minrep; /* set leaders for min and max rank */ + node_t *maxrep; /* set leaders for min and max rank */ + + /* fast graph node list */ + nlist_t comp; + /* connected components */ + node_t *minset; /* set leaders */ + node_t *maxset; /* set leaders */ + long n_nodes; + /* includes virtual */ + int minrank; + int maxrank; + + /* various flags */ + bool has_flat_edges; + bool has_sourcerank; + bool has_sinkrank; + unsigned char showboxes; + fontname_kind fontnames; /* to override mangling in SVG */ + + int nodesep; + int ranksep; + node_t *ln; /* left nodes of bounding box */ + node_t *rn; /* right nodes of bounding box */ + + /* for clusters */ + node_t *leader; + node_t **rankleader; + bool expanded; + char installed; + char set_type; + char label_pos; + bool exact_ranksep; +#endif + + } Agraphinfo_t; + +#define GD_parent(g) (((Agraphinfo_t*)AGDATA(g))->parent) +#define GD_level(g) (((Agraphinfo_t*)AGDATA(g))->level) +#define GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing) +#define GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb) +#define GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc) +#define GD_cleanup(g) (((Agraphinfo_t*)AGDATA(g))->cleanup) +#define GD_dist(g) (((Agraphinfo_t*)AGDATA(g))->dist) +#define GD_alg(g) (((Agraphinfo_t*)AGDATA(g))->alg) +#define GD_border(g) (((Agraphinfo_t*)AGDATA(g))->border) +#define GD_clust(g) (((Agraphinfo_t*)AGDATA(g))->clust) +#define GD_dotroot(g) (((Agraphinfo_t*)AGDATA(g))->dotroot) +#define GD_comp(g) (((Agraphinfo_t*)AGDATA(g))->comp) +#define GD_exact_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->exact_ranksep) +#define GD_expanded(g) (((Agraphinfo_t*)AGDATA(g))->expanded) +#define GD_flags(g) (((Agraphinfo_t*)AGDATA(g))->flags) +#define GD_gui_state(g) (((Agraphinfo_t*)AGDATA(g))->gui_state) +#define GD_charset(g) (((Agraphinfo_t*)AGDATA(g))->charset) +#define GD_has_labels(g) (((Agraphinfo_t*)AGDATA(g))->has_labels) +#define GD_has_images(g) (((Agraphinfo_t*)AGDATA(g))->has_images) +#define GD_has_flat_edges(g) (((Agraphinfo_t*)AGDATA(g))->has_flat_edges) +#define GD_has_sourcerank(g) (((Agraphinfo_t*)AGDATA(g))->has_sourcerank) +#define GD_has_sinkrank(g) (((Agraphinfo_t*)AGDATA(g))->has_sinkrank) +#define GD_ht1(g) (((Agraphinfo_t*)AGDATA(g))->ht1) +#define GD_ht2(g) (((Agraphinfo_t*)AGDATA(g))->ht2) +#define GD_installed(g) (((Agraphinfo_t*)AGDATA(g))->installed) +#define GD_label(g) (((Agraphinfo_t*)AGDATA(g))->label) +#define GD_leader(g) (((Agraphinfo_t*)AGDATA(g))->leader) +#define GD_rankdir2(g) (((Agraphinfo_t*)AGDATA(g))->rankdir) +#define GD_rankdir(g) (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3) +#define GD_flip(g) (GD_rankdir(g) & 1) +#define GD_realrankdir(g) ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2) +#define GD_realflip(g) (GD_realrankdir(g) & 1) +#define GD_ln(g) (((Agraphinfo_t*)AGDATA(g))->ln) +#define GD_maxrank(g) (((Agraphinfo_t*)AGDATA(g))->maxrank) +#define GD_maxset(g) (((Agraphinfo_t*)AGDATA(g))->maxset) +#define GD_minrank(g) (((Agraphinfo_t*)AGDATA(g))->minrank) +#define GD_minset(g) (((Agraphinfo_t*)AGDATA(g))->minset) +#define GD_minrep(g) (((Agraphinfo_t*)AGDATA(g))->minrep) +#define GD_maxrep(g) (((Agraphinfo_t*)AGDATA(g))->maxrep) +#define GD_move(g) (((Agraphinfo_t*)AGDATA(g))->move) +#define GD_n_cluster(g) (((Agraphinfo_t*)AGDATA(g))->n_cluster) +#define GD_n_nodes(g) (((Agraphinfo_t*)AGDATA(g))->n_nodes) +#define GD_ndim(g) (((Agraphinfo_t*)AGDATA(g))->ndim) +#define GD_odim(g) (((Agraphinfo_t*)AGDATA(g))->odim) +#define GD_neato_nlist(g) (((Agraphinfo_t*)AGDATA(g))->neato_nlist) +#define GD_nlist(g) (((Agraphinfo_t*)AGDATA(g))->nlist) +#define GD_nodesep(g) (((Agraphinfo_t*)AGDATA(g))->nodesep) +#define GD_outleaf(g) (((Agraphinfo_t*)AGDATA(g))->outleaf) +#define GD_rank(g) (((Agraphinfo_t*)AGDATA(g))->rank) +#define GD_rankleader(g) (((Agraphinfo_t*)AGDATA(g))->rankleader) +#define GD_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->ranksep) +#define GD_rn(g) (((Agraphinfo_t*)AGDATA(g))->rn) +#define GD_set_type(g) (((Agraphinfo_t*)AGDATA(g))->set_type) +#define GD_label_pos(g) (((Agraphinfo_t*)AGDATA(g))->label_pos) +#define GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes) +#define GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames) +#define GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring) +#define GD_sum_t(g) (((Agraphinfo_t*)AGDATA(g))->sum_t) +#define GD_t(g) (((Agraphinfo_t*)AGDATA(g))->t) + + typedef struct Agnodeinfo_t { + Agrec_t hdr; + shape_desc *shape; + void *shape_info; + pointf coord; + double width; /* inches */ + double height; /* inches */ + boxf bb; + double ht; + double lw; + double rw; + double outline_width; /* width in points with penwidth taken into account */ + double outline_height; /* height in points with penwidth taken into account */ + textlabel_t *label; + textlabel_t *xlabel; + void *alg; + char state; + unsigned char gui_state; /* Node state for GUI ops */ + bool clustnode; + +#ifndef DOT_ONLY + unsigned char pinned; + int id; + int heapindex; + int hops; + double *pos; + double dist; +#endif +#ifndef NEATO_ONLY + unsigned char showboxes; + bool has_port; + node_t* rep; + node_t *set; + + /* fast graph */ + char node_type; + size_t mark; + char onstack; + char ranktype; + char weight_class; + node_t *next; + node_t *prev; + elist in; + elist out; + elist flat_out; + elist flat_in; + elist other; + graph_t *clust; + + /* for union-find and collapsing nodes */ + int UF_size; + node_t *UF_parent; + node_t *inleaf; + node_t *outleaf; + + /* for placing nodes */ + int rank; + int order; /* initially, order = 1 for ordered edges */ + double mval; + elist save_in; + elist save_out; + + /* for network-simplex */ + elist tree_in; + elist tree_out; + edge_t *par; + int low; + int lim; + int priority; + + double pad[1]; +#endif + + } Agnodeinfo_t; + +#define ND_id(n) (((Agnodeinfo_t*)AGDATA(n))->id) +#define ND_alg(n) (((Agnodeinfo_t*)AGDATA(n))->alg) +#define ND_UF_parent(n) (((Agnodeinfo_t*)AGDATA(n))->UF_parent) +#define ND_set(n) (((Agnodeinfo_t*)AGDATA(n))->set) +#define ND_UF_size(n) (((Agnodeinfo_t*)AGDATA(n))->UF_size) +#define ND_bb(n) (((Agnodeinfo_t*)AGDATA(n))->bb) +#define ND_clust(n) (((Agnodeinfo_t*)AGDATA(n))->clust) +#define ND_coord(n) (((Agnodeinfo_t*)AGDATA(n))->coord) +#define ND_dist(n) (((Agnodeinfo_t*)AGDATA(n))->dist) +#define ND_flat_in(n) (((Agnodeinfo_t*)AGDATA(n))->flat_in) +#define ND_flat_out(n) (((Agnodeinfo_t*)AGDATA(n))->flat_out) +#define ND_gui_state(n) (((Agnodeinfo_t*)AGDATA(n))->gui_state) +#define ND_has_port(n) (((Agnodeinfo_t*)AGDATA(n))->has_port) +#define ND_rep(n) (((Agnodeinfo_t*)AGDATA(n))->rep) +#define ND_heapindex(n) (((Agnodeinfo_t*)AGDATA(n))->heapindex) +#define ND_height(n) (((Agnodeinfo_t*)AGDATA(n))->height) +#define ND_hops(n) (((Agnodeinfo_t*)AGDATA(n))->hops) +#define ND_ht(n) (((Agnodeinfo_t*)AGDATA(n))->ht) +#define ND_in(n) (((Agnodeinfo_t*)AGDATA(n))->in) +#define ND_inleaf(n) (((Agnodeinfo_t*)AGDATA(n))->inleaf) +#define ND_label(n) (((Agnodeinfo_t*)AGDATA(n))->label) +#define ND_xlabel(n) (((Agnodeinfo_t*)AGDATA(n))->xlabel) +#define ND_lim(n) (((Agnodeinfo_t*)AGDATA(n))->lim) +#define ND_low(n) (((Agnodeinfo_t*)AGDATA(n))->low) +#define ND_lw(n) (((Agnodeinfo_t*)AGDATA(n))->lw) +#define ND_mark(n) (((Agnodeinfo_t*)AGDATA(n))->mark) +#define ND_mval(n) (((Agnodeinfo_t*)AGDATA(n))->mval) +#define ND_n_cluster(n) (((Agnodeinfo_t*)AGDATA(n))->n_cluster) +#define ND_next(n) (((Agnodeinfo_t*)AGDATA(n))->next) +#define ND_node_type(n) (((Agnodeinfo_t*)AGDATA(n))->node_type) +#define ND_onstack(n) (((Agnodeinfo_t*)AGDATA(n))->onstack) +#define ND_order(n) (((Agnodeinfo_t*)AGDATA(n))->order) +#define ND_other(n) (((Agnodeinfo_t*)AGDATA(n))->other) +#define ND_out(n) (((Agnodeinfo_t*)AGDATA(n))->out) +#define ND_outleaf(n) (((Agnodeinfo_t*)AGDATA(n))->outleaf) +#define ND_outline_width(n) (((Agnodeinfo_t*)AGDATA(n))->outline_width) +#define ND_outline_height(n) (((Agnodeinfo_t*)AGDATA(n))->outline_height) +#define ND_par(n) (((Agnodeinfo_t*)AGDATA(n))->par) +#define ND_pinned(n) (((Agnodeinfo_t*)AGDATA(n))->pinned) +#define ND_pos(n) (((Agnodeinfo_t*)AGDATA(n))->pos) +#define ND_prev(n) (((Agnodeinfo_t*)AGDATA(n))->prev) +#define ND_priority(n) (((Agnodeinfo_t*)AGDATA(n))->priority) +#define ND_rank(n) (((Agnodeinfo_t*)AGDATA(n))->rank) +#define ND_ranktype(n) (((Agnodeinfo_t*)AGDATA(n))->ranktype) +#define ND_rw(n) (((Agnodeinfo_t*)AGDATA(n))->rw) +#define ND_save_in(n) (((Agnodeinfo_t*)AGDATA(n))->save_in) +#define ND_save_out(n) (((Agnodeinfo_t*)AGDATA(n))->save_out) +#define ND_shape(n) (((Agnodeinfo_t*)AGDATA(n))->shape) +#define ND_shape_info(n) (((Agnodeinfo_t*)AGDATA(n))->shape_info) +#define ND_showboxes(n) (((Agnodeinfo_t*)AGDATA(n))->showboxes) +#define ND_state(n) (((Agnodeinfo_t*)AGDATA(n))->state) +#define ND_clustnode(n) (((Agnodeinfo_t*)AGDATA(n))->clustnode) +#define ND_tree_in(n) (((Agnodeinfo_t*)AGDATA(n))->tree_in) +#define ND_tree_out(n) (((Agnodeinfo_t*)AGDATA(n))->tree_out) +#define ND_weight_class(n) (((Agnodeinfo_t*)AGDATA(n))->weight_class) +#define ND_width(n) (((Agnodeinfo_t*)AGDATA(n))->width) +#define ND_xsize(n) (ND_lw(n)+ND_rw(n)) +#define ND_ysize(n) (ND_ht(n)) + + typedef struct Agedgeinfo_t { + Agrec_t hdr; + splines *spl; + port tail_port; + port head_port; + textlabel_t *label; + textlabel_t *head_label; + textlabel_t *tail_label; + textlabel_t *xlabel; + char edge_type; + char compound; + char adjacent; /* true for flat edge with adjacent nodes */ + char label_ontop; + unsigned char gui_state; /* Edge state for GUI ops */ + edge_t *to_orig; /* for dot's shapes.c */ + void *alg; + +#ifndef DOT_ONLY + double factor; + double dist; + Ppolyline_t path; +#endif +#ifndef NEATO_ONLY + unsigned char showboxes; + bool conc_opp_flag; + short xpenalty; + int weight; + int cutvalue; + int tree_index; + short count; + unsigned short minlen; + edge_t *to_virt; +#endif + } Agedgeinfo_t; + +#define ED_alg(e) (((Agedgeinfo_t*)AGDATA(e))->alg) +#define ED_conc_opp_flag(e) (((Agedgeinfo_t*)AGDATA(e))->conc_opp_flag) +#define ED_count(e) (((Agedgeinfo_t*)AGDATA(e))->count) +#define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue) +#define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type) +#define ED_compound(e) (((Agedgeinfo_t*)AGDATA(e))->compound) +#define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent) +#define ED_factor(e) (((Agedgeinfo_t*)AGDATA(e))->factor) +#define ED_gui_state(e) (((Agedgeinfo_t*)AGDATA(e))->gui_state) +#define ED_head_label(e) (((Agedgeinfo_t*)AGDATA(e))->head_label) +#define ED_head_port(e) (((Agedgeinfo_t*)AGDATA(e))->head_port) +#define ED_label(e) (((Agedgeinfo_t*)AGDATA(e))->label) +#define ED_xlabel(e) (((Agedgeinfo_t*)AGDATA(e))->xlabel) +#define ED_label_ontop(e) (((Agedgeinfo_t*)AGDATA(e))->label_ontop) +#define ED_minlen(e) (((Agedgeinfo_t*)AGDATA(e))->minlen) +#define ED_path(e) (((Agedgeinfo_t*)AGDATA(e))->path) +#define ED_showboxes(e) (((Agedgeinfo_t*)AGDATA(e))->showboxes) +#define ED_spl(e) (((Agedgeinfo_t*)AGDATA(e))->spl) +#define ED_tail_label(e) (((Agedgeinfo_t*)AGDATA(e))->tail_label) +#define ED_tail_port(e) (((Agedgeinfo_t*)AGDATA(e))->tail_port) +#define ED_to_orig(e) (((Agedgeinfo_t*)AGDATA(e))->to_orig) +#define ED_to_virt(e) (((Agedgeinfo_t*)AGDATA(e))->to_virt) +#define ED_tree_index(e) (((Agedgeinfo_t*)AGDATA(e))->tree_index) +#define ED_xpenalty(e) (((Agedgeinfo_t*)AGDATA(e))->xpenalty) +#define ED_dist(e) (((Agedgeinfo_t*)AGDATA(e))->dist) +#define ED_weight(e) (((Agedgeinfo_t*)AGDATA(e))->weight) + +#define ag_xget(x,a) agxget(x,a) +#define SET_RANKDIR(g,rd) (GD_rankdir2(g) = rd) +#define agfindedge(g,t,h) (agedge(g,t,h,NULL,0)) +#define agfindnode(g,n) (agnode(g,n,0)) +#define agfindgraphattr(g,a) (agattr(g,AGRAPH,a,NULL)) +#define agfindnodeattr(g,a) (agattr(g,AGNODE,a,NULL)) +#define agfindedgeattr(g,a) (agattr(g,AGEDGE,a,NULL)) + + typedef struct { + int flags; + } gvlayout_features_t; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/usershape.h b/data/miniconda3/include/graphviz/usershape.h new file mode 100644 index 0000000000000000000000000000000000000000..853708094034af5f57f6a9ff0e1a5b18ec5a10bb --- /dev/null +++ b/data/miniconda3/include/graphviz/usershape.h @@ -0,0 +1,65 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include "cdt.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + + typedef enum { FT_NULL, + FT_BMP, FT_GIF, FT_PNG, FT_JPEG, + FT_PDF, FT_PS, FT_EPS, FT_SVG, FT_XML, + FT_RIFF, FT_WEBP, FT_ICO, FT_TIFF + } imagetype_t; + + typedef enum { + IMAGESCALE_FALSE, /* no image scaling */ + IMAGESCALE_TRUE, /* scale image to fit but keep aspect ratio */ + IMAGESCALE_WIDTH, /* scale image width to fit, keep height fixed */ + IMAGESCALE_HEIGHT, /* scale image height to fit, keep width fixed */ + IMAGESCALE_BOTH /* scale image to fit without regard for aspect ratio */ + } imagescale_t; + + typedef enum { + IMAGEPOS_TOP_LEFT, /* top left */ + IMAGEPOS_TOP_CENTER, /* top center */ + IMAGEPOS_TOP_RIGHT, /* top right */ + IMAGEPOS_MIDDLE_LEFT, /* middle left */ + IMAGEPOS_MIDDLE_CENTER, /* middle center (true center, the default)*/ + IMAGEPOS_MIDDLE_RIGHT, /* middle right */ + IMAGEPOS_BOTTOM_LEFT, /* bottom left */ + IMAGEPOS_BOTTOM_CENTER, /* bottom center */ + IMAGEPOS_BOTTOM_RIGHT /* bottom right */ + } imagepos_t; + + typedef struct usershape_s usershape_t; + + struct usershape_s { + Dtlink_t link; + const char *name; + int macro_id; + bool must_inline; + bool nocache; + FILE *f; + imagetype_t type; + char *stringtype; + int x, y, w, h, dpi; + void *data; /* data loaded by a renderer */ + size_t datasize; /* size of data (if mmap'ed) */ + void (*datafree)(usershape_t *us); /* renderer's function for freeing data */ + }; + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/graphviz/xdot.h b/data/miniconda3/include/graphviz/xdot.h new file mode 100644 index 0000000000000000000000000000000000000000..f226bdb9c1f923333e0aef2c3e360b947fdc81f7 --- /dev/null +++ b/data/miniconda3/include/graphviz/xdot.h @@ -0,0 +1,187 @@ +/************************************************************************* + * Copyright (c) 2011 AT&T Intellectual Property + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: Details at https://graphviz.org + *************************************************************************/ + +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef GVDLL +#ifdef EXPORT_XDOT +#define XDOT_API __declspec(dllexport) +#else +#define XDOT_API __declspec(dllimport) +#endif +#endif + +#ifndef XDOT_API +#define XDOT_API /* nothing */ +#endif + +#define INITIAL_XDOT_CAPACITY 512 + +typedef enum { + xd_none, + xd_linear, + xd_radial +} xdot_grad_type; + +typedef struct { + float frac; + char* color; +} xdot_color_stop; + +typedef struct { + double x0, y0; + double x1, y1; + int n_stops; + xdot_color_stop* stops; +} xdot_linear_grad; + +typedef struct { + double x0, y0, r0; + double x1, y1, r1; + int n_stops; + xdot_color_stop* stops; +} xdot_radial_grad; + +typedef struct { + xdot_grad_type type; + union { + char* clr; + xdot_linear_grad ling; + xdot_radial_grad ring; + } u; +} xdot_color; + +typedef enum { + xd_left, xd_center, xd_right +} xdot_align; + +typedef struct { + double x, y, z; +} xdot_point; + +typedef struct { + double x, y, w, h; +} xdot_rect; + +typedef struct { + size_t cnt; + xdot_point* pts; +} xdot_polyline; + +typedef struct { + double x, y; + xdot_align align; + double width; + char* text; +} xdot_text; + +typedef struct { + xdot_rect pos; + char* name; +} xdot_image; + +typedef struct { + double size; + char* name; +} xdot_font; + +typedef enum { + xd_filled_ellipse, xd_unfilled_ellipse, + xd_filled_polygon, xd_unfilled_polygon, + xd_filled_bezier, xd_unfilled_bezier, + xd_polyline, xd_text, + xd_fill_color, xd_pen_color, xd_font, xd_style, xd_image, + xd_grad_fill_color, xd_grad_pen_color, + xd_fontchar +} xdot_kind; + +typedef enum { + xop_ellipse, + xop_polygon, + xop_bezier, + xop_polyline, xop_text, + xop_fill_color, xop_pen_color, xop_font, xop_style, xop_image, + xop_grad_color, + xop_fontchar +} xop_kind; + +typedef struct _xdot_op xdot_op; +typedef void (*drawfunc_t)(xdot_op*, int); +typedef void (*freefunc_t)(xdot_op*); + +struct _xdot_op { + xdot_kind kind; + union { + xdot_rect ellipse; /* xd_filled_ellipse, xd_unfilled_ellipse */ + xdot_polyline polygon; /* xd_filled_polygon, xd_unfilled_polygon */ + xdot_polyline polyline; /* xd_polyline */ + xdot_polyline bezier; /* xd_filled_bezier, xd_unfilled_bezier */ + xdot_text text; /* xd_text */ + xdot_image image; /* xd_image */ + char* color; /* xd_fill_color, xd_pen_color */ + xdot_color grad_color; /* xd_grad_fill_color, xd_grad_pen_color */ + xdot_font font; /* xd_font */ + char* style; /* xd_style */ + unsigned int fontchar; /* xd_fontchar */ + } u; + drawfunc_t drawfunc; +}; + +#define XDOT_PARSE_ERROR 1 + +typedef struct { + size_t cnt; /* no. of xdot ops */ + size_t sz; /* sizeof structure containing xdot_op as first field */ + xdot_op* ops; + freefunc_t freefunc; + int flags; +} xdot; + +typedef struct { + size_t cnt; /* no. of xdot ops */ + size_t n_ellipse; + size_t n_polygon; + size_t n_polygon_pts; + size_t n_polyline; + size_t n_polyline_pts; + size_t n_bezier; + size_t n_bezier_pts; + size_t n_text; + size_t n_font; + size_t n_style; + size_t n_color; + size_t n_image; + size_t n_gradcolor; + size_t n_fontchar; +} xdot_stats; + +/* ops are indexed by xop_kind */ +XDOT_API xdot *parseXDotF(char*, drawfunc_t opfns[], size_t sz); +XDOT_API xdot *parseXDotFOn(char*, drawfunc_t opfns[], size_t sz, xdot*); +XDOT_API xdot* parseXDot (char*); +XDOT_API char* sprintXDot (xdot*); +XDOT_API void fprintXDot (FILE*, xdot*); +XDOT_API void jsonXDot (FILE*, xdot*); +XDOT_API void freeXDot (xdot*); +XDOT_API int statXDot (xdot*, xdot_stats*); +XDOT_API xdot_grad_type colorTypeXDot (char*); +XDOT_API char* parseXDotColor (char* cp, xdot_color* clr); +XDOT_API void freeXDotColor (xdot_color*); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/gtest/gtest-death-test.h b/data/miniconda3/include/gtest/gtest-death-test.h new file mode 100644 index 0000000000000000000000000000000000000000..9b4d4d1337481ee11e1c484b8a38ddad9a2259e7 --- /dev/null +++ b/data/miniconda3/include/gtest/gtest-death-test.h @@ -0,0 +1,346 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +// The Google C++ Testing and Mocking Framework (Google Test) +// +// This header file defines the public API for death tests. It is +// #included by gtest.h so a user doesn't need to include this +// directly. +// GOOGLETEST_CM0001 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ + +#include "gtest/internal/gtest-death-test-internal.h" + +namespace testing { + +// This flag controls the style of death tests. Valid values are "threadsafe", +// meaning that the death test child process will re-execute the test binary +// from the start, running only a single death test, or "fast", +// meaning that the child process will execute the test logic immediately +// after forking. +GTEST_DECLARE_string_(death_test_style); + +#if GTEST_HAS_DEATH_TEST + +namespace internal { + +// Returns a Boolean value indicating whether the caller is currently +// executing in the context of the death test child process. Tools such as +// Valgrind heap checkers may need this to modify their behavior in death +// tests. IMPORTANT: This is an internal utility. Using it may break the +// implementation of death tests. User code MUST NOT use it. +GTEST_API_ bool InDeathTestChild(); + +} // namespace internal + +// The following macros are useful for writing death tests. + +// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is +// executed: +// +// 1. It generates a warning if there is more than one active +// thread. This is because it's safe to fork() or clone() only +// when there is a single thread. +// +// 2. The parent process clone()s a sub-process and runs the death +// test in it; the sub-process exits with code 0 at the end of the +// death test, if it hasn't exited already. +// +// 3. The parent process waits for the sub-process to terminate. +// +// 4. The parent process checks the exit code and error message of +// the sub-process. +// +// Examples: +// +// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); +// for (int i = 0; i < 5; i++) { +// EXPECT_DEATH(server.ProcessRequest(i), +// "Invalid request .* in ProcessRequest()") +// << "Failed to die on request " << i; +// } +// +// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); +// +// bool KilledBySIGHUP(int exit_code) { +// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; +// } +// +// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); +// +// The final parameter to each of these macros is a matcher applied to any data +// the sub-process wrote to stderr. For compatibility with existing tests, a +// bare string is interpreted as a regular expression matcher. +// +// On the regular expressions used in death tests: +// +// GOOGLETEST_CM0005 DO NOT DELETE +// On POSIX-compliant systems (*nix), we use the library, +// which uses the POSIX extended regex syntax. +// +// On other platforms (e.g. Windows or Mac), we only support a simple regex +// syntax implemented as part of Google Test. This limited +// implementation should be enough most of the time when writing +// death tests; though it lacks many features you can find in PCRE +// or POSIX extended regex syntax. For example, we don't support +// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and +// repetition count ("x{5,7}"), among others. +// +// Below is the syntax that we do support. We chose it to be a +// subset of both PCRE and POSIX extended regex, so it's easy to +// learn wherever you come from. In the following: 'A' denotes a +// literal character, period (.), or a single \\ escape sequence; +// 'x' and 'y' denote regular expressions; 'm' and 'n' are for +// natural numbers. +// +// c matches any literal character c +// \\d matches any decimal digit +// \\D matches any character that's not a decimal digit +// \\f matches \f +// \\n matches \n +// \\r matches \r +// \\s matches any ASCII whitespace, including \n +// \\S matches any character that's not a whitespace +// \\t matches \t +// \\v matches \v +// \\w matches any letter, _, or decimal digit +// \\W matches any character that \\w doesn't match +// \\c matches any literal character c, which must be a punctuation +// . matches any single character except \n +// A? matches 0 or 1 occurrences of A +// A* matches 0 or many occurrences of A +// A+ matches 1 or many occurrences of A +// ^ matches the beginning of a string (not that of each line) +// $ matches the end of a string (not that of each line) +// xy matches x followed by y +// +// If you accidentally use PCRE or POSIX extended regex features +// not implemented by us, you will get a run-time failure. In that +// case, please try to rewrite your regular expression within the +// above syntax. +// +// This implementation is *not* meant to be as highly tuned or robust +// as a compiled regex library, but should perform well enough for a +// death test, which already incurs significant overhead by launching +// a child process. +// +// Known caveats: +// +// A "threadsafe" style death test obtains the path to the test +// program from argv[0] and re-executes it in the sub-process. For +// simplicity, the current implementation doesn't search the PATH +// when launching the sub-process. This means that the user must +// invoke the test program via a path that contains at least one +// path separator (e.g. path/to/foo_test and +// /absolute/path/to/bar_test are fine, but foo_test is not). This +// is rarely a problem as people usually don't put the test binary +// directory in PATH. +// + +// Asserts that a given `statement` causes the program to exit, with an +// integer exit status that satisfies `predicate`, and emitting error output +// that matches `matcher`. +# define ASSERT_EXIT(statement, predicate, matcher) \ + GTEST_DEATH_TEST_(statement, predicate, matcher, GTEST_FATAL_FAILURE_) + +// Like `ASSERT_EXIT`, but continues on to successive tests in the +// test suite, if any: +# define EXPECT_EXIT(statement, predicate, matcher) \ + GTEST_DEATH_TEST_(statement, predicate, matcher, GTEST_NONFATAL_FAILURE_) + +// Asserts that a given `statement` causes the program to exit, either by +// explicitly exiting with a nonzero exit code or being killed by a +// signal, and emitting error output that matches `matcher`. +# define ASSERT_DEATH(statement, matcher) \ + ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, matcher) + +// Like `ASSERT_DEATH`, but continues on to successive tests in the +// test suite, if any: +# define EXPECT_DEATH(statement, matcher) \ + EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, matcher) + +// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: + +// Tests that an exit code describes a normal exit with a given exit code. +class GTEST_API_ ExitedWithCode { + public: + explicit ExitedWithCode(int exit_code); + ExitedWithCode(const ExitedWithCode&) = default; + void operator=(const ExitedWithCode& other) = delete; + bool operator()(int exit_status) const; + private: + const int exit_code_; +}; + +# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA +// Tests that an exit code describes an exit due to termination by a +// given signal. +// GOOGLETEST_CM0006 DO NOT DELETE +class GTEST_API_ KilledBySignal { + public: + explicit KilledBySignal(int signum); + bool operator()(int exit_status) const; + private: + const int signum_; +}; +# endif // !GTEST_OS_WINDOWS + +// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. +// The death testing framework causes this to have interesting semantics, +// since the sideeffects of the call are only visible in opt mode, and not +// in debug mode. +// +// In practice, this can be used to test functions that utilize the +// LOG(DFATAL) macro using the following style: +// +// int DieInDebugOr12(int* sideeffect) { +// if (sideeffect) { +// *sideeffect = 12; +// } +// LOG(DFATAL) << "death"; +// return 12; +// } +// +// TEST(TestSuite, TestDieOr12WorksInDgbAndOpt) { +// int sideeffect = 0; +// // Only asserts in dbg. +// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); +// +// #ifdef NDEBUG +// // opt-mode has sideeffect visible. +// EXPECT_EQ(12, sideeffect); +// #else +// // dbg-mode no visible sideeffect. +// EXPECT_EQ(0, sideeffect); +// #endif +// } +// +// This will assert that DieInDebugReturn12InOpt() crashes in debug +// mode, usually due to a DCHECK or LOG(DFATAL), but returns the +// appropriate fallback value (12 in this case) in opt mode. If you +// need to test that a function has appropriate side-effects in opt +// mode, include assertions against the side-effects. A general +// pattern for this is: +// +// EXPECT_DEBUG_DEATH({ +// // Side-effects here will have an effect after this statement in +// // opt mode, but none in debug mode. +// EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); +// }, "death"); +// +# ifdef NDEBUG + +# define EXPECT_DEBUG_DEATH(statement, regex) \ + GTEST_EXECUTE_STATEMENT_(statement, regex) + +# define ASSERT_DEBUG_DEATH(statement, regex) \ + GTEST_EXECUTE_STATEMENT_(statement, regex) + +# else + +# define EXPECT_DEBUG_DEATH(statement, regex) \ + EXPECT_DEATH(statement, regex) + +# define ASSERT_DEBUG_DEATH(statement, regex) \ + ASSERT_DEATH(statement, regex) + +# endif // NDEBUG for EXPECT_DEBUG_DEATH +#endif // GTEST_HAS_DEATH_TEST + +// This macro is used for implementing macros such as +// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where +// death tests are not supported. Those macros must compile on such systems +// if and only if EXPECT_DEATH and ASSERT_DEATH compile with the same parameters +// on systems that support death tests. This allows one to write such a macro on +// a system that does not support death tests and be sure that it will compile +// on a death-test supporting system. It is exposed publicly so that systems +// that have death-tests with stricter requirements than GTEST_HAS_DEATH_TEST +// can write their own equivalent of EXPECT_DEATH_IF_SUPPORTED and +// ASSERT_DEATH_IF_SUPPORTED. +// +// Parameters: +// statement - A statement that a macro such as EXPECT_DEATH would test +// for program termination. This macro has to make sure this +// statement is compiled but not executed, to ensure that +// EXPECT_DEATH_IF_SUPPORTED compiles with a certain +// parameter if and only if EXPECT_DEATH compiles with it. +// regex - A regex that a macro such as EXPECT_DEATH would use to test +// the output of statement. This parameter has to be +// compiled but not evaluated by this macro, to ensure that +// this macro only accepts expressions that a macro such as +// EXPECT_DEATH would accept. +// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED +// and a return statement for ASSERT_DEATH_IF_SUPPORTED. +// This ensures that ASSERT_DEATH_IF_SUPPORTED will not +// compile inside functions where ASSERT_DEATH doesn't +// compile. +// +// The branch that has an always false condition is used to ensure that +// statement and regex are compiled (and thus syntactically correct) but +// never executed. The unreachable code macro protects the terminator +// statement from generating an 'unreachable code' warning in case +// statement unconditionally returns or throws. The Message constructor at +// the end allows the syntax of streaming additional messages into the +// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. +# define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + GTEST_LOG_(WARNING) \ + << "Death tests are not supported on this platform.\n" \ + << "Statement '" #statement "' cannot be verified."; \ + } else if (::testing::internal::AlwaysFalse()) { \ + ::testing::internal::RE::PartialMatch(".*", (regex)); \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + terminator; \ + } else \ + ::testing::Message() + +// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and +// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if +// death tests are supported; otherwise they just issue a warning. This is +// useful when you are combining death test assertions with normal test +// assertions in one test. +#if GTEST_HAS_DEATH_TEST +# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ + EXPECT_DEATH(statement, regex) +# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ + ASSERT_DEATH(statement, regex) +#else +# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ + GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, ) +# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ + GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, return) +#endif + +} // namespace testing + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ diff --git a/data/miniconda3/include/gtest/gtest-matchers.h b/data/miniconda3/include/gtest/gtest-matchers.h new file mode 100644 index 0000000000000000000000000000000000000000..9fa34a05ba418ee8450d7d57b3ca88757e621492 --- /dev/null +++ b/data/miniconda3/include/gtest/gtest-matchers.h @@ -0,0 +1,930 @@ +// Copyright 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// The Google C++ Testing and Mocking Framework (Google Test) +// +// This file implements just enough of the matcher interface to allow +// EXPECT_DEATH and friends to accept a matcher argument. + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_ + +#include +#include +#include +#include +#include + +#include "gtest/gtest-printers.h" +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-port.h" + +// MSVC warning C5046 is new as of VS2017 version 15.8. +#if defined(_MSC_VER) && _MSC_VER >= 1915 +#define GTEST_MAYBE_5046_ 5046 +#else +#define GTEST_MAYBE_5046_ +#endif + +GTEST_DISABLE_MSC_WARNINGS_PUSH_( + 4251 GTEST_MAYBE_5046_ /* class A needs to have dll-interface to be used by + clients of class B */ + /* Symbol involving type with internal linkage not defined */) + +namespace testing { + +// To implement a matcher Foo for type T, define: +// 1. a class FooMatcherMatcher that implements the matcher interface: +// using is_gtest_matcher = void; +// bool MatchAndExplain(const T&, std::ostream*); +// (MatchResultListener* can also be used instead of std::ostream*) +// void DescribeTo(std::ostream*); +// void DescribeNegationTo(std::ostream*); +// +// 2. a factory function that creates a Matcher object from a +// FooMatcherMatcher. + +class MatchResultListener { + public: + // Creates a listener object with the given underlying ostream. The + // listener does not own the ostream, and does not dereference it + // in the constructor or destructor. + explicit MatchResultListener(::std::ostream* os) : stream_(os) {} + virtual ~MatchResultListener() = 0; // Makes this class abstract. + + // Streams x to the underlying ostream; does nothing if the ostream + // is NULL. + template + MatchResultListener& operator<<(const T& x) { + if (stream_ != nullptr) *stream_ << x; + return *this; + } + + // Returns the underlying ostream. + ::std::ostream* stream() { return stream_; } + + // Returns true if and only if the listener is interested in an explanation + // of the match result. A matcher's MatchAndExplain() method can use + // this information to avoid generating the explanation when no one + // intends to hear it. + bool IsInterested() const { return stream_ != nullptr; } + + private: + ::std::ostream* const stream_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener); +}; + +inline MatchResultListener::~MatchResultListener() { +} + +// An instance of a subclass of this knows how to describe itself as a +// matcher. +class GTEST_API_ MatcherDescriberInterface { + public: + virtual ~MatcherDescriberInterface() {} + + // Describes this matcher to an ostream. The function should print + // a verb phrase that describes the property a value matching this + // matcher should have. The subject of the verb phrase is the value + // being matched. For example, the DescribeTo() method of the Gt(7) + // matcher prints "is greater than 7". + virtual void DescribeTo(::std::ostream* os) const = 0; + + // Describes the negation of this matcher to an ostream. For + // example, if the description of this matcher is "is greater than + // 7", the negated description could be "is not greater than 7". + // You are not required to override this when implementing + // MatcherInterface, but it is highly advised so that your matcher + // can produce good error messages. + virtual void DescribeNegationTo(::std::ostream* os) const { + *os << "not ("; + DescribeTo(os); + *os << ")"; + } +}; + +// The implementation of a matcher. +template +class MatcherInterface : public MatcherDescriberInterface { + public: + // Returns true if and only if the matcher matches x; also explains the + // match result to 'listener' if necessary (see the next paragraph), in + // the form of a non-restrictive relative clause ("which ...", + // "whose ...", etc) that describes x. For example, the + // MatchAndExplain() method of the Pointee(...) matcher should + // generate an explanation like "which points to ...". + // + // Implementations of MatchAndExplain() should add an explanation of + // the match result *if and only if* they can provide additional + // information that's not already present (or not obvious) in the + // print-out of x and the matcher's description. Whether the match + // succeeds is not a factor in deciding whether an explanation is + // needed, as sometimes the caller needs to print a failure message + // when the match succeeds (e.g. when the matcher is used inside + // Not()). + // + // For example, a "has at least 10 elements" matcher should explain + // what the actual element count is, regardless of the match result, + // as it is useful information to the reader; on the other hand, an + // "is empty" matcher probably only needs to explain what the actual + // size is when the match fails, as it's redundant to say that the + // size is 0 when the value is already known to be empty. + // + // You should override this method when defining a new matcher. + // + // It's the responsibility of the caller (Google Test) to guarantee + // that 'listener' is not NULL. This helps to simplify a matcher's + // implementation when it doesn't care about the performance, as it + // can talk to 'listener' without checking its validity first. + // However, in order to implement dummy listeners efficiently, + // listener->stream() may be NULL. + virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0; + + // Inherits these methods from MatcherDescriberInterface: + // virtual void DescribeTo(::std::ostream* os) const = 0; + // virtual void DescribeNegationTo(::std::ostream* os) const; +}; + +namespace internal { + +struct AnyEq { + template + bool operator()(const A& a, const B& b) const { return a == b; } +}; +struct AnyNe { + template + bool operator()(const A& a, const B& b) const { return a != b; } +}; +struct AnyLt { + template + bool operator()(const A& a, const B& b) const { return a < b; } +}; +struct AnyGt { + template + bool operator()(const A& a, const B& b) const { return a > b; } +}; +struct AnyLe { + template + bool operator()(const A& a, const B& b) const { return a <= b; } +}; +struct AnyGe { + template + bool operator()(const A& a, const B& b) const { return a >= b; } +}; + +// A match result listener that ignores the explanation. +class DummyMatchResultListener : public MatchResultListener { + public: + DummyMatchResultListener() : MatchResultListener(nullptr) {} + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener); +}; + +// A match result listener that forwards the explanation to a given +// ostream. The difference between this and MatchResultListener is +// that the former is concrete. +class StreamMatchResultListener : public MatchResultListener { + public: + explicit StreamMatchResultListener(::std::ostream* os) + : MatchResultListener(os) {} + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener); +}; + +struct SharedPayloadBase { + std::atomic ref{1}; + void Ref() { ref.fetch_add(1, std::memory_order_relaxed); } + bool Unref() { return ref.fetch_sub(1, std::memory_order_acq_rel) == 1; } +}; + +template +struct SharedPayload : SharedPayloadBase { + explicit SharedPayload(const T& v) : value(v) {} + explicit SharedPayload(T&& v) : value(std::move(v)) {} + + static void Destroy(SharedPayloadBase* shared) { + delete static_cast(shared); + } + + T value; +}; + +// An internal class for implementing Matcher, which will derive +// from it. We put functionalities common to all Matcher +// specializations here to avoid code duplication. +template +class MatcherBase : private MatcherDescriberInterface { + public: + // Returns true if and only if the matcher matches x; also explains the + // match result to 'listener'. + bool MatchAndExplain(const T& x, MatchResultListener* listener) const { + GTEST_CHECK_(vtable_ != nullptr); + return vtable_->match_and_explain(*this, x, listener); + } + + // Returns true if and only if this matcher matches x. + bool Matches(const T& x) const { + DummyMatchResultListener dummy; + return MatchAndExplain(x, &dummy); + } + + // Describes this matcher to an ostream. + void DescribeTo(::std::ostream* os) const final { + GTEST_CHECK_(vtable_ != nullptr); + vtable_->describe(*this, os, false); + } + + // Describes the negation of this matcher to an ostream. + void DescribeNegationTo(::std::ostream* os) const final { + GTEST_CHECK_(vtable_ != nullptr); + vtable_->describe(*this, os, true); + } + + // Explains why x matches, or doesn't match, the matcher. + void ExplainMatchResultTo(const T& x, ::std::ostream* os) const { + StreamMatchResultListener listener(os); + MatchAndExplain(x, &listener); + } + + // Returns the describer for this matcher object; retains ownership + // of the describer, which is only guaranteed to be alive when + // this matcher object is alive. + const MatcherDescriberInterface* GetDescriber() const { + if (vtable_ == nullptr) return nullptr; + return vtable_->get_describer(*this); + } + + protected: + MatcherBase() : vtable_(nullptr) {} + + // Constructs a matcher from its implementation. + template + explicit MatcherBase(const MatcherInterface* impl) { + Init(impl); + } + + template ::type::is_gtest_matcher> + MatcherBase(M&& m) { // NOLINT + Init(std::forward(m)); + } + + MatcherBase(const MatcherBase& other) + : vtable_(other.vtable_), buffer_(other.buffer_) { + if (IsShared()) buffer_.shared->Ref(); + } + + MatcherBase& operator=(const MatcherBase& other) { + if (this == &other) return *this; + Destroy(); + vtable_ = other.vtable_; + buffer_ = other.buffer_; + if (IsShared()) buffer_.shared->Ref(); + return *this; + } + + MatcherBase(MatcherBase&& other) + : vtable_(other.vtable_), buffer_(other.buffer_) { + other.vtable_ = nullptr; + } + + MatcherBase& operator=(MatcherBase&& other) { + if (this == &other) return *this; + Destroy(); + vtable_ = other.vtable_; + buffer_ = other.buffer_; + other.vtable_ = nullptr; + return *this; + } + + ~MatcherBase() override { Destroy(); } + + private: + struct VTable { + bool (*match_and_explain)(const MatcherBase&, const T&, + MatchResultListener*); + void (*describe)(const MatcherBase&, std::ostream*, bool negation); + // Returns the captured object if it implements the interface, otherwise + // returns the MatcherBase itself. + const MatcherDescriberInterface* (*get_describer)(const MatcherBase&); + // Called on shared instances when the reference count reaches 0. + void (*shared_destroy)(SharedPayloadBase*); + }; + + bool IsShared() const { + return vtable_ != nullptr && vtable_->shared_destroy != nullptr; + } + + // If the implementation uses a listener, call that. + template + static auto MatchAndExplainImpl(const MatcherBase& m, const T& value, + MatchResultListener* listener) + -> decltype(P::Get(m).MatchAndExplain(value, listener->stream())) { + return P::Get(m).MatchAndExplain(value, listener->stream()); + } + + template + static auto MatchAndExplainImpl(const MatcherBase& m, const T& value, + MatchResultListener* listener) + -> decltype(P::Get(m).MatchAndExplain(value, listener)) { + return P::Get(m).MatchAndExplain(value, listener); + } + + template + static void DescribeImpl(const MatcherBase& m, std::ostream* os, + bool negation) { + if (negation) { + P::Get(m).DescribeNegationTo(os); + } else { + P::Get(m).DescribeTo(os); + } + } + + template + static const MatcherDescriberInterface* GetDescriberImpl( + const MatcherBase& m) { + // If the impl is a MatcherDescriberInterface, then return it. + // Otherwise use MatcherBase itself. + // This allows us to implement the GetDescriber() function without support + // from the impl, but some users really want to get their impl back when + // they call GetDescriber(). + // We use std::get on a tuple as a workaround of not having `if constexpr`. + return std::get<( + std::is_convertible::value + ? 1 + : 0)>(std::make_tuple(&m, &P::Get(m))); + } + + template + const VTable* GetVTable() { + static constexpr VTable kVTable = {&MatchAndExplainImpl

, + &DescribeImpl

, &GetDescriberImpl

, + P::shared_destroy}; + return &kVTable; + } + + union Buffer { + // Add some types to give Buffer some common alignment/size use cases. + void* ptr; + double d; + int64_t i; + // And add one for the out-of-line cases. + SharedPayloadBase* shared; + }; + + void Destroy() { + if (IsShared() && buffer_.shared->Unref()) { + vtable_->shared_destroy(buffer_.shared); + } + } + + template + static constexpr bool IsInlined() { + return sizeof(M) <= sizeof(Buffer) && alignof(M) <= alignof(Buffer) && + std::is_trivially_copy_constructible::value && + std::is_trivially_destructible::value; + } + + template ()> + struct ValuePolicy { + static const M& Get(const MatcherBase& m) { + // When inlined along with Init, need to be explicit to avoid violating + // strict aliasing rules. + const M *ptr = static_cast( + static_cast(&m.buffer_)); + return *ptr; + } + static void Init(MatcherBase& m, M impl) { + ::new (static_cast(&m.buffer_)) M(impl); + } + static constexpr auto shared_destroy = nullptr; + }; + + template + struct ValuePolicy { + using Shared = SharedPayload; + static const M& Get(const MatcherBase& m) { + return static_cast(m.buffer_.shared)->value; + } + template + static void Init(MatcherBase& m, Arg&& arg) { + m.buffer_.shared = new Shared(std::forward(arg)); + } + static constexpr auto shared_destroy = &Shared::Destroy; + }; + + template + struct ValuePolicy*, B> { + using M = const MatcherInterface; + using Shared = SharedPayload>; + static const M& Get(const MatcherBase& m) { + return *static_cast(m.buffer_.shared)->value; + } + static void Init(MatcherBase& m, M* impl) { + m.buffer_.shared = new Shared(std::unique_ptr(impl)); + } + + static constexpr auto shared_destroy = &Shared::Destroy; + }; + + template + void Init(M&& m) { + using MM = typename std::decay::type; + using Policy = ValuePolicy; + vtable_ = GetVTable(); + Policy::Init(*this, std::forward(m)); + } + + const VTable* vtable_; + Buffer buffer_; +}; + +} // namespace internal + +// A Matcher is a copyable and IMMUTABLE (except by assignment) +// object that can check whether a value of type T matches. The +// implementation of Matcher is just a std::shared_ptr to const +// MatcherInterface. Don't inherit from Matcher! +template +class Matcher : public internal::MatcherBase { + public: + // Constructs a null matcher. Needed for storing Matcher objects in STL + // containers. A default-constructed matcher is not yet initialized. You + // cannot use it until a valid value has been assigned to it. + explicit Matcher() {} // NOLINT + + // Constructs a matcher from its implementation. + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + template + explicit Matcher( + const MatcherInterface* impl, + typename std::enable_if::value>::type* = + nullptr) + : internal::MatcherBase(impl) {} + + template ::type::is_gtest_matcher> + Matcher(M&& m) : internal::MatcherBase(std::forward(m)) {} // NOLINT + + // Implicit constructor here allows people to write + // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes + Matcher(T value); // NOLINT +}; + +// The following two specializations allow the user to write str +// instead of Eq(str) and "foo" instead of Eq("foo") when a std::string +// matcher is expected. +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + template ::type::is_gtest_matcher> + Matcher(M&& m) // NOLINT + : internal::MatcherBase(std::forward(m)) {} + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a std::string object. + Matcher(const std::string& s); // NOLINT + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT +}; + +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + template ::type::is_gtest_matcher> + Matcher(M&& m) // NOLINT + : internal::MatcherBase(std::forward(m)) {} + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a string object. + Matcher(const std::string& s); // NOLINT + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT +}; + +#if GTEST_INTERNAL_HAS_STRING_VIEW +// The following two specializations allow the user to write str +// instead of Eq(str) and "foo" instead of Eq("foo") when a absl::string_view +// matcher is expected. +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + template ::type::is_gtest_matcher> + Matcher(M&& m) // NOLINT + : internal::MatcherBase(std::forward(m)) { + } + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a std::string object. + Matcher(const std::string& s); // NOLINT + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT + + // Allows the user to pass absl::string_views or std::string_views directly. + Matcher(internal::StringView s); // NOLINT +}; + +template <> +class GTEST_API_ Matcher + : public internal::MatcherBase { + public: + Matcher() {} + + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + explicit Matcher(const MatcherInterface* impl) + : internal::MatcherBase(impl) {} + + template ::type::is_gtest_matcher> + Matcher(M&& m) // NOLINT + : internal::MatcherBase(std::forward(m)) {} + + // Allows the user to write str instead of Eq(str) sometimes, where + // str is a std::string object. + Matcher(const std::string& s); // NOLINT + + // Allows the user to write "foo" instead of Eq("foo") sometimes. + Matcher(const char* s); // NOLINT + + // Allows the user to pass absl::string_views or std::string_views directly. + Matcher(internal::StringView s); // NOLINT +}; +#endif // GTEST_INTERNAL_HAS_STRING_VIEW + +// Prints a matcher in a human-readable format. +template +std::ostream& operator<<(std::ostream& os, const Matcher& matcher) { + matcher.DescribeTo(&os); + return os; +} + +// The PolymorphicMatcher class template makes it easy to implement a +// polymorphic matcher (i.e. a matcher that can match values of more +// than one type, e.g. Eq(n) and NotNull()). +// +// To define a polymorphic matcher, a user should provide an Impl +// class that has a DescribeTo() method and a DescribeNegationTo() +// method, and define a member function (or member function template) +// +// bool MatchAndExplain(const Value& value, +// MatchResultListener* listener) const; +// +// See the definition of NotNull() for a complete example. +template +class PolymorphicMatcher { + public: + explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {} + + // Returns a mutable reference to the underlying matcher + // implementation object. + Impl& mutable_impl() { return impl_; } + + // Returns an immutable reference to the underlying matcher + // implementation object. + const Impl& impl() const { return impl_; } + + template + operator Matcher() const { + return Matcher(new MonomorphicImpl(impl_)); + } + + private: + template + class MonomorphicImpl : public MatcherInterface { + public: + explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {} + + void DescribeTo(::std::ostream* os) const override { impl_.DescribeTo(os); } + + void DescribeNegationTo(::std::ostream* os) const override { + impl_.DescribeNegationTo(os); + } + + bool MatchAndExplain(T x, MatchResultListener* listener) const override { + return impl_.MatchAndExplain(x, listener); + } + + private: + const Impl impl_; + }; + + Impl impl_; +}; + +// Creates a matcher from its implementation. +// DEPRECATED: Especially in the generic code, prefer: +// Matcher(new MyMatcherImpl(...)); +// +// MakeMatcher may create a Matcher that accepts its argument by value, which +// leads to unnecessary copies & lack of support for non-copyable types. +template +inline Matcher MakeMatcher(const MatcherInterface* impl) { + return Matcher(impl); +} + +// Creates a polymorphic matcher from its implementation. This is +// easier to use than the PolymorphicMatcher constructor as it +// doesn't require you to explicitly write the template argument, e.g. +// +// MakePolymorphicMatcher(foo); +// vs +// PolymorphicMatcher(foo); +template +inline PolymorphicMatcher MakePolymorphicMatcher(const Impl& impl) { + return PolymorphicMatcher(impl); +} + +namespace internal { +// Implements a matcher that compares a given value with a +// pre-supplied value using one of the ==, <=, <, etc, operators. The +// two values being compared don't have to have the same type. +// +// The matcher defined here is polymorphic (for example, Eq(5) can be +// used to match an int, a short, a double, etc). Therefore we use +// a template type conversion operator in the implementation. +// +// The following template definition assumes that the Rhs parameter is +// a "bare" type (i.e. neither 'const T' nor 'T&'). +template +class ComparisonBase { + public: + explicit ComparisonBase(const Rhs& rhs) : rhs_(rhs) {} + + using is_gtest_matcher = void; + + template + bool MatchAndExplain(const Lhs& lhs, std::ostream*) const { + return Op()(lhs, Unwrap(rhs_)); + } + void DescribeTo(std::ostream* os) const { + *os << D::Desc() << " "; + UniversalPrint(Unwrap(rhs_), os); + } + void DescribeNegationTo(std::ostream* os) const { + *os << D::NegatedDesc() << " "; + UniversalPrint(Unwrap(rhs_), os); + } + + private: + template + static const T& Unwrap(const T& v) { + return v; + } + template + static const T& Unwrap(std::reference_wrapper v) { + return v; + } + + Rhs rhs_; +}; + +template +class EqMatcher : public ComparisonBase, Rhs, AnyEq> { + public: + explicit EqMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyEq>(rhs) { } + static const char* Desc() { return "is equal to"; } + static const char* NegatedDesc() { return "isn't equal to"; } +}; +template +class NeMatcher : public ComparisonBase, Rhs, AnyNe> { + public: + explicit NeMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyNe>(rhs) { } + static const char* Desc() { return "isn't equal to"; } + static const char* NegatedDesc() { return "is equal to"; } +}; +template +class LtMatcher : public ComparisonBase, Rhs, AnyLt> { + public: + explicit LtMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyLt>(rhs) { } + static const char* Desc() { return "is <"; } + static const char* NegatedDesc() { return "isn't <"; } +}; +template +class GtMatcher : public ComparisonBase, Rhs, AnyGt> { + public: + explicit GtMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyGt>(rhs) { } + static const char* Desc() { return "is >"; } + static const char* NegatedDesc() { return "isn't >"; } +}; +template +class LeMatcher : public ComparisonBase, Rhs, AnyLe> { + public: + explicit LeMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyLe>(rhs) { } + static const char* Desc() { return "is <="; } + static const char* NegatedDesc() { return "isn't <="; } +}; +template +class GeMatcher : public ComparisonBase, Rhs, AnyGe> { + public: + explicit GeMatcher(const Rhs& rhs) + : ComparisonBase, Rhs, AnyGe>(rhs) { } + static const char* Desc() { return "is >="; } + static const char* NegatedDesc() { return "isn't >="; } +}; + +template ::value>::type> +using StringLike = T; + +// Implements polymorphic matchers MatchesRegex(regex) and +// ContainsRegex(regex), which can be used as a Matcher as long as +// T can be converted to a string. +class MatchesRegexMatcher { + public: + MatchesRegexMatcher(const RE* regex, bool full_match) + : regex_(regex), full_match_(full_match) {} + +#if GTEST_INTERNAL_HAS_STRING_VIEW + bool MatchAndExplain(const internal::StringView& s, + MatchResultListener* listener) const { + return MatchAndExplain(std::string(s), listener); + } +#endif // GTEST_INTERNAL_HAS_STRING_VIEW + + // Accepts pointer types, particularly: + // const char* + // char* + // const wchar_t* + // wchar_t* + template + bool MatchAndExplain(CharType* s, MatchResultListener* listener) const { + return s != nullptr && MatchAndExplain(std::string(s), listener); + } + + // Matches anything that can convert to std::string. + // + // This is a template, not just a plain function with const std::string&, + // because absl::string_view has some interfering non-explicit constructors. + template + bool MatchAndExplain(const MatcheeStringType& s, + MatchResultListener* /* listener */) const { + const std::string& s2(s); + return full_match_ ? RE::FullMatch(s2, *regex_) + : RE::PartialMatch(s2, *regex_); + } + + void DescribeTo(::std::ostream* os) const { + *os << (full_match_ ? "matches" : "contains") << " regular expression "; + UniversalPrinter::Print(regex_->pattern(), os); + } + + void DescribeNegationTo(::std::ostream* os) const { + *os << "doesn't " << (full_match_ ? "match" : "contain") + << " regular expression "; + UniversalPrinter::Print(regex_->pattern(), os); + } + + private: + const std::shared_ptr regex_; + const bool full_match_; +}; +} // namespace internal + +// Matches a string that fully matches regular expression 'regex'. +// The matcher takes ownership of 'regex'. +inline PolymorphicMatcher MatchesRegex( + const internal::RE* regex) { + return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true)); +} +template +PolymorphicMatcher MatchesRegex( + const internal::StringLike& regex) { + return MatchesRegex(new internal::RE(std::string(regex))); +} + +// Matches a string that contains regular expression 'regex'. +// The matcher takes ownership of 'regex'. +inline PolymorphicMatcher ContainsRegex( + const internal::RE* regex) { + return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false)); +} +template +PolymorphicMatcher ContainsRegex( + const internal::StringLike& regex) { + return ContainsRegex(new internal::RE(std::string(regex))); +} + +// Creates a polymorphic matcher that matches anything equal to x. +// Note: if the parameter of Eq() were declared as const T&, Eq("foo") +// wouldn't compile. +template +inline internal::EqMatcher Eq(T x) { return internal::EqMatcher(x); } + +// Constructs a Matcher from a 'value' of type T. The constructed +// matcher matches any value that's equal to 'value'. +template +Matcher::Matcher(T value) { *this = Eq(value); } + +// Creates a monomorphic matcher that matches anything with type Lhs +// and equal to rhs. A user may need to use this instead of Eq(...) +// in order to resolve an overloading ambiguity. +// +// TypedEq(x) is just a convenient short-hand for Matcher(Eq(x)) +// or Matcher(x), but more readable than the latter. +// +// We could define similar monomorphic matchers for other comparison +// operations (e.g. TypedLt, TypedGe, and etc), but decided not to do +// it yet as those are used much less than Eq() in practice. A user +// can always write Matcher(Lt(5)) to be explicit about the type, +// for example. +template +inline Matcher TypedEq(const Rhs& rhs) { return Eq(rhs); } + +// Creates a polymorphic matcher that matches anything >= x. +template +inline internal::GeMatcher Ge(Rhs x) { + return internal::GeMatcher(x); +} + +// Creates a polymorphic matcher that matches anything > x. +template +inline internal::GtMatcher Gt(Rhs x) { + return internal::GtMatcher(x); +} + +// Creates a polymorphic matcher that matches anything <= x. +template +inline internal::LeMatcher Le(Rhs x) { + return internal::LeMatcher(x); +} + +// Creates a polymorphic matcher that matches anything < x. +template +inline internal::LtMatcher Lt(Rhs x) { + return internal::LtMatcher(x); +} + +// Creates a polymorphic matcher that matches anything != x. +template +inline internal::NeMatcher Ne(Rhs x) { + return internal::NeMatcher(x); +} +} // namespace testing + +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046 + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_ diff --git a/data/miniconda3/include/gtest/gtest-message.h b/data/miniconda3/include/gtest/gtest-message.h new file mode 100644 index 0000000000000000000000000000000000000000..becfd49fcba9c5ab986e4b4396bc8143a3c587a1 --- /dev/null +++ b/data/miniconda3/include/gtest/gtest-message.h @@ -0,0 +1,219 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +// The Google C++ Testing and Mocking Framework (Google Test) +// +// This header file defines the Message class. +// +// IMPORTANT NOTE: Due to limitation of the C++ language, we have to +// leave some internal implementation details in this header file. +// They are clearly marked by comments like this: +// +// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +// +// Such code is NOT meant to be used by a user directly, and is subject +// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user +// program! + +// GOOGLETEST_CM0001 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ + +#include +#include +#include + +#include "gtest/internal/gtest-port.h" + +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ +/* class A needs to have dll-interface to be used by clients of class B */) + +// Ensures that there is at least one operator<< in the global namespace. +// See Message& operator<<(...) below for why. +void operator<<(const testing::internal::Secret&, int); + +namespace testing { + +// The Message class works like an ostream repeater. +// +// Typical usage: +// +// 1. You stream a bunch of values to a Message object. +// It will remember the text in a stringstream. +// 2. Then you stream the Message object to an ostream. +// This causes the text in the Message to be streamed +// to the ostream. +// +// For example; +// +// testing::Message foo; +// foo << 1 << " != " << 2; +// std::cout << foo; +// +// will print "1 != 2". +// +// Message is not intended to be inherited from. In particular, its +// destructor is not virtual. +// +// Note that stringstream behaves differently in gcc and in MSVC. You +// can stream a NULL char pointer to it in the former, but not in the +// latter (it causes an access violation if you do). The Message +// class hides this difference by treating a NULL char pointer as +// "(null)". +class GTEST_API_ Message { + private: + // The type of basic IO manipulators (endl, ends, and flush) for + // narrow streams. + typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); + + public: + // Constructs an empty Message. + Message(); + + // Copy constructor. + Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT + *ss_ << msg.GetString(); + } + + // Constructs a Message from a C-string. + explicit Message(const char* str) : ss_(new ::std::stringstream) { + *ss_ << str; + } + + // Streams a non-pointer value to this object. + template + inline Message& operator <<(const T& val) { + // Some libraries overload << for STL containers. These + // overloads are defined in the global namespace instead of ::std. + // + // C++'s symbol lookup rule (i.e. Koenig lookup) says that these + // overloads are visible in either the std namespace or the global + // namespace, but not other namespaces, including the testing + // namespace which Google Test's Message class is in. + // + // To allow STL containers (and other types that has a << operator + // defined in the global namespace) to be used in Google Test + // assertions, testing::Message must access the custom << operator + // from the global namespace. With this using declaration, + // overloads of << defined in the global namespace and those + // visible via Koenig lookup are both exposed in this function. + using ::operator <<; + *ss_ << val; + return *this; + } + + // Streams a pointer value to this object. + // + // This function is an overload of the previous one. When you + // stream a pointer to a Message, this definition will be used as it + // is more specialized. (The C++ Standard, section + // [temp.func.order].) If you stream a non-pointer, then the + // previous definition will be used. + // + // The reason for this overload is that streaming a NULL pointer to + // ostream is undefined behavior. Depending on the compiler, you + // may get "0", "(nil)", "(null)", or an access violation. To + // ensure consistent result across compilers, we always treat NULL + // as "(null)". + template + inline Message& operator <<(T* const& pointer) { // NOLINT + if (pointer == nullptr) { + *ss_ << "(null)"; + } else { + *ss_ << pointer; + } + return *this; + } + + // Since the basic IO manipulators are overloaded for both narrow + // and wide streams, we have to provide this specialized definition + // of operator <<, even though its body is the same as the + // templatized version above. Without this definition, streaming + // endl or other basic IO manipulators to Message will confuse the + // compiler. + Message& operator <<(BasicNarrowIoManip val) { + *ss_ << val; + return *this; + } + + // Instead of 1/0, we want to see true/false for bool values. + Message& operator <<(bool b) { + return *this << (b ? "true" : "false"); + } + + // These two overloads allow streaming a wide C string to a Message + // using the UTF-8 encoding. + Message& operator <<(const wchar_t* wide_c_str); + Message& operator <<(wchar_t* wide_c_str); + +#if GTEST_HAS_STD_WSTRING + // Converts the given wide string to a narrow string using the UTF-8 + // encoding, and streams the result to this Message object. + Message& operator <<(const ::std::wstring& wstr); +#endif // GTEST_HAS_STD_WSTRING + + // Gets the text streamed to this object so far as an std::string. + // Each '\0' character in the buffer is replaced with "\\0". + // + // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + std::string GetString() const; + + private: + // We'll hold the text streamed to this object here. + const std::unique_ptr< ::std::stringstream> ss_; + + // We declare (but don't implement) this to prevent the compiler + // from implementing the assignment operator. + void operator=(const Message&); +}; + +// Streams a Message to an ostream. +inline std::ostream& operator <<(std::ostream& os, const Message& sb) { + return os << sb.GetString(); +} + +namespace internal { + +// Converts a streamable value to an std::string. A NULL pointer is +// converted to "(null)". When the input value is a ::string, +// ::std::string, ::wstring, or ::std::wstring object, each NUL +// character in it is replaced with "\\0". +template +std::string StreamableToString(const T& streamable) { + return (Message() << streamable).GetString(); +} + +} // namespace internal +} // namespace testing + +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ diff --git a/data/miniconda3/include/gtest/gtest-param-test.h b/data/miniconda3/include/gtest/gtest-param-test.h new file mode 100644 index 0000000000000000000000000000000000000000..804e702817b03b90a3e77fd8bdc8a037e72f5e7d --- /dev/null +++ b/data/miniconda3/include/gtest/gtest-param-test.h @@ -0,0 +1,507 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Macros and functions for implementing parameterized tests +// in Google C++ Testing and Mocking Framework (Google Test) +// +// GOOGLETEST_CM0001 DO NOT DELETE +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ + +// Value-parameterized tests allow you to test your code with different +// parameters without writing multiple copies of the same test. +// +// Here is how you use value-parameterized tests: + +#if 0 + +// To write value-parameterized tests, first you should define a fixture +// class. It is usually derived from testing::TestWithParam (see below for +// another inheritance scheme that's sometimes useful in more complicated +// class hierarchies), where the type of your parameter values. +// TestWithParam is itself derived from testing::Test. T can be any +// copyable type. If it's a raw pointer, you are responsible for managing the +// lifespan of the pointed values. + +class FooTest : public ::testing::TestWithParam { + // You can implement all the usual class fixture members here. +}; + +// Then, use the TEST_P macro to define as many parameterized tests +// for this fixture as you want. The _P suffix is for "parameterized" +// or "pattern", whichever you prefer to think. + +TEST_P(FooTest, DoesBlah) { + // Inside a test, access the test parameter with the GetParam() method + // of the TestWithParam class: + EXPECT_TRUE(foo.Blah(GetParam())); + ... +} + +TEST_P(FooTest, HasBlahBlah) { + ... +} + +// Finally, you can use INSTANTIATE_TEST_SUITE_P to instantiate the test +// case with any set of parameters you want. Google Test defines a number +// of functions for generating test parameters. They return what we call +// (surprise!) parameter generators. Here is a summary of them, which +// are all in the testing namespace: +// +// +// Range(begin, end [, step]) - Yields values {begin, begin+step, +// begin+step+step, ...}. The values do not +// include end. step defaults to 1. +// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. +// ValuesIn(container) - Yields values from a C-style array, an STL +// ValuesIn(begin,end) container, or an iterator range [begin, end). +// Bool() - Yields sequence {false, true}. +// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product +// for the math savvy) of the values generated +// by the N generators. +// +// For more details, see comments at the definitions of these functions below +// in this file. +// +// The following statement will instantiate tests from the FooTest test suite +// each with parameter values "meeny", "miny", and "moe". + +INSTANTIATE_TEST_SUITE_P(InstantiationName, + FooTest, + Values("meeny", "miny", "moe")); + +// To distinguish different instances of the pattern, (yes, you +// can instantiate it more than once) the first argument to the +// INSTANTIATE_TEST_SUITE_P macro is a prefix that will be added to the +// actual test suite name. Remember to pick unique prefixes for different +// instantiations. The tests from the instantiation above will have +// these names: +// +// * InstantiationName/FooTest.DoesBlah/0 for "meeny" +// * InstantiationName/FooTest.DoesBlah/1 for "miny" +// * InstantiationName/FooTest.DoesBlah/2 for "moe" +// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" +// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" +// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" +// +// You can use these names in --gtest_filter. +// +// This statement will instantiate all tests from FooTest again, each +// with parameter values "cat" and "dog": + +const char* pets[] = {"cat", "dog"}; +INSTANTIATE_TEST_SUITE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); + +// The tests from the instantiation above will have these names: +// +// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" +// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" +// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" +// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" +// +// Please note that INSTANTIATE_TEST_SUITE_P will instantiate all tests +// in the given test suite, whether their definitions come before or +// AFTER the INSTANTIATE_TEST_SUITE_P statement. +// +// Please also note that generator expressions (including parameters to the +// generators) are evaluated in InitGoogleTest(), after main() has started. +// This allows the user on one hand, to adjust generator parameters in order +// to dynamically determine a set of tests to run and on the other hand, +// give the user a chance to inspect the generated tests with Google Test +// reflection API before RUN_ALL_TESTS() is executed. +// +// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc +// for more examples. +// +// In the future, we plan to publish the API for defining new parameter +// generators. But for now this interface remains part of the internal +// implementation and is subject to change. +// +// +// A parameterized test fixture must be derived from testing::Test and from +// testing::WithParamInterface, where T is the type of the parameter +// values. Inheriting from TestWithParam satisfies that requirement because +// TestWithParam inherits from both Test and WithParamInterface. In more +// complicated hierarchies, however, it is occasionally useful to inherit +// separately from Test and WithParamInterface. For example: + +class BaseTest : public ::testing::Test { + // You can inherit all the usual members for a non-parameterized test + // fixture here. +}; + +class DerivedTest : public BaseTest, public ::testing::WithParamInterface { + // The usual test fixture members go here too. +}; + +TEST_F(BaseTest, HasFoo) { + // This is an ordinary non-parameterized test. +} + +TEST_P(DerivedTest, DoesBlah) { + // GetParam works just the same here as if you inherit from TestWithParam. + EXPECT_TRUE(foo.Blah(GetParam())); +} + +#endif // 0 + +#include +#include + +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-param-util.h" +#include "gtest/internal/gtest-port.h" + +namespace testing { + +// Functions producing parameter generators. +// +// Google Test uses these generators to produce parameters for value- +// parameterized tests. When a parameterized test suite is instantiated +// with a particular generator, Google Test creates and runs tests +// for each element in the sequence produced by the generator. +// +// In the following sample, tests from test suite FooTest are instantiated +// each three times with parameter values 3, 5, and 8: +// +// class FooTest : public TestWithParam { ... }; +// +// TEST_P(FooTest, TestThis) { +// } +// TEST_P(FooTest, TestThat) { +// } +// INSTANTIATE_TEST_SUITE_P(TestSequence, FooTest, Values(3, 5, 8)); +// + +// Range() returns generators providing sequences of values in a range. +// +// Synopsis: +// Range(start, end) +// - returns a generator producing a sequence of values {start, start+1, +// start+2, ..., }. +// Range(start, end, step) +// - returns a generator producing a sequence of values {start, start+step, +// start+step+step, ..., }. +// Notes: +// * The generated sequences never include end. For example, Range(1, 5) +// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) +// returns a generator producing {1, 3, 5, 7}. +// * start and end must have the same type. That type may be any integral or +// floating-point type or a user defined type satisfying these conditions: +// * It must be assignable (have operator=() defined). +// * It must have operator+() (operator+(int-compatible type) for +// two-operand version). +// * It must have operator<() defined. +// Elements in the resulting sequences will also have that type. +// * Condition start < end must be satisfied in order for resulting sequences +// to contain any elements. +// +template +internal::ParamGenerator Range(T start, T end, IncrementT step) { + return internal::ParamGenerator( + new internal::RangeGenerator(start, end, step)); +} + +template +internal::ParamGenerator Range(T start, T end) { + return Range(start, end, 1); +} + +// ValuesIn() function allows generation of tests with parameters coming from +// a container. +// +// Synopsis: +// ValuesIn(const T (&array)[N]) +// - returns a generator producing sequences with elements from +// a C-style array. +// ValuesIn(const Container& container) +// - returns a generator producing sequences with elements from +// an STL-style container. +// ValuesIn(Iterator begin, Iterator end) +// - returns a generator producing sequences with elements from +// a range [begin, end) defined by a pair of STL-style iterators. These +// iterators can also be plain C pointers. +// +// Please note that ValuesIn copies the values from the containers +// passed in and keeps them to generate tests in RUN_ALL_TESTS(). +// +// Examples: +// +// This instantiates tests from test suite StringTest +// each with C-string values of "foo", "bar", and "baz": +// +// const char* strings[] = {"foo", "bar", "baz"}; +// INSTANTIATE_TEST_SUITE_P(StringSequence, StringTest, ValuesIn(strings)); +// +// This instantiates tests from test suite StlStringTest +// each with STL strings with values "a" and "b": +// +// ::std::vector< ::std::string> GetParameterStrings() { +// ::std::vector< ::std::string> v; +// v.push_back("a"); +// v.push_back("b"); +// return v; +// } +// +// INSTANTIATE_TEST_SUITE_P(CharSequence, +// StlStringTest, +// ValuesIn(GetParameterStrings())); +// +// +// This will also instantiate tests from CharTest +// each with parameter values 'a' and 'b': +// +// ::std::list GetParameterChars() { +// ::std::list list; +// list.push_back('a'); +// list.push_back('b'); +// return list; +// } +// ::std::list l = GetParameterChars(); +// INSTANTIATE_TEST_SUITE_P(CharSequence2, +// CharTest, +// ValuesIn(l.begin(), l.end())); +// +template +internal::ParamGenerator< + typename std::iterator_traits::value_type> +ValuesIn(ForwardIterator begin, ForwardIterator end) { + typedef typename std::iterator_traits::value_type ParamType; + return internal::ParamGenerator( + new internal::ValuesInIteratorRangeGenerator(begin, end)); +} + +template +internal::ParamGenerator ValuesIn(const T (&array)[N]) { + return ValuesIn(array, array + N); +} + +template +internal::ParamGenerator ValuesIn( + const Container& container) { + return ValuesIn(container.begin(), container.end()); +} + +// Values() allows generating tests from explicitly specified list of +// parameters. +// +// Synopsis: +// Values(T v1, T v2, ..., T vN) +// - returns a generator producing sequences with elements v1, v2, ..., vN. +// +// For example, this instantiates tests from test suite BarTest each +// with values "one", "two", and "three": +// +// INSTANTIATE_TEST_SUITE_P(NumSequence, +// BarTest, +// Values("one", "two", "three")); +// +// This instantiates tests from test suite BazTest each with values 1, 2, 3.5. +// The exact type of values will depend on the type of parameter in BazTest. +// +// INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); +// +// +template +internal::ValueArray Values(T... v) { + return internal::ValueArray(std::move(v)...); +} + +// Bool() allows generating tests with parameters in a set of (false, true). +// +// Synopsis: +// Bool() +// - returns a generator producing sequences with elements {false, true}. +// +// It is useful when testing code that depends on Boolean flags. Combinations +// of multiple flags can be tested when several Bool()'s are combined using +// Combine() function. +// +// In the following example all tests in the test suite FlagDependentTest +// will be instantiated twice with parameters false and true. +// +// class FlagDependentTest : public testing::TestWithParam { +// virtual void SetUp() { +// external_flag = GetParam(); +// } +// } +// INSTANTIATE_TEST_SUITE_P(BoolSequence, FlagDependentTest, Bool()); +// +inline internal::ParamGenerator Bool() { + return Values(false, true); +} + +// Combine() allows the user to combine two or more sequences to produce +// values of a Cartesian product of those sequences' elements. +// +// Synopsis: +// Combine(gen1, gen2, ..., genN) +// - returns a generator producing sequences with elements coming from +// the Cartesian product of elements from the sequences generated by +// gen1, gen2, ..., genN. The sequence elements will have a type of +// std::tuple where T1, T2, ..., TN are the types +// of elements from sequences produces by gen1, gen2, ..., genN. +// +// Example: +// +// This will instantiate tests in test suite AnimalTest each one with +// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), +// tuple("dog", BLACK), and tuple("dog", WHITE): +// +// enum Color { BLACK, GRAY, WHITE }; +// class AnimalTest +// : public testing::TestWithParam > {...}; +// +// TEST_P(AnimalTest, AnimalLooksNice) {...} +// +// INSTANTIATE_TEST_SUITE_P(AnimalVariations, AnimalTest, +// Combine(Values("cat", "dog"), +// Values(BLACK, WHITE))); +// +// This will instantiate tests in FlagDependentTest with all variations of two +// Boolean flags: +// +// class FlagDependentTest +// : public testing::TestWithParam > { +// virtual void SetUp() { +// // Assigns external_flag_1 and external_flag_2 values from the tuple. +// std::tie(external_flag_1, external_flag_2) = GetParam(); +// } +// }; +// +// TEST_P(FlagDependentTest, TestFeature1) { +// // Test your code using external_flag_1 and external_flag_2 here. +// } +// INSTANTIATE_TEST_SUITE_P(TwoBoolSequence, FlagDependentTest, +// Combine(Bool(), Bool())); +// +template +internal::CartesianProductHolder Combine(const Generator&... g) { + return internal::CartesianProductHolder(g...); +} + +#define TEST_P(test_suite_name, test_name) \ + class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \ + : public test_suite_name { \ + public: \ + GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \ + void TestBody() override; \ + \ + private: \ + static int AddToRegistry() { \ + ::testing::UnitTest::GetInstance() \ + ->parameterized_test_registry() \ + .GetTestSuitePatternHolder( \ + GTEST_STRINGIFY_(test_suite_name), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__)) \ + ->AddTestPattern( \ + GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \ + new ::testing::internal::TestMetaFactory(), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__)); \ + return 0; \ + } \ + static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \ + GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \ + test_name)); \ + }; \ + int GTEST_TEST_CLASS_NAME_(test_suite_name, \ + test_name)::gtest_registering_dummy_ = \ + GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::AddToRegistry(); \ + void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody() + +// The last argument to INSTANTIATE_TEST_SUITE_P allows the user to specify +// generator and an optional function or functor that generates custom test name +// suffixes based on the test parameters. Such a function or functor should +// accept one argument of type testing::TestParamInfo, and +// return std::string. +// +// testing::PrintToStringParamName is a builtin test suffix generator that +// returns the value of testing::PrintToString(GetParam()). +// +// Note: test names must be non-empty, unique, and may only contain ASCII +// alphanumeric characters or underscore. Because PrintToString adds quotes +// to std::string and C strings, it won't work for these types. + +#define GTEST_EXPAND_(arg) arg +#define GTEST_GET_FIRST_(first, ...) first +#define GTEST_GET_SECOND_(first, second, ...) second + +#define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...) \ + static ::testing::internal::ParamGenerator \ + gtest_##prefix##test_suite_name##_EvalGenerator_() { \ + return GTEST_EXPAND_(GTEST_GET_FIRST_(__VA_ARGS__, DUMMY_PARAM_)); \ + } \ + static ::std::string gtest_##prefix##test_suite_name##_EvalGenerateName_( \ + const ::testing::TestParamInfo& info) { \ + if (::testing::internal::AlwaysFalse()) { \ + ::testing::internal::TestNotEmpty(GTEST_EXPAND_(GTEST_GET_SECOND_( \ + __VA_ARGS__, \ + ::testing::internal::DefaultParamName, \ + DUMMY_PARAM_))); \ + auto t = std::make_tuple(__VA_ARGS__); \ + static_assert(std::tuple_size::value <= 2, \ + "Too Many Args!"); \ + } \ + return ((GTEST_EXPAND_(GTEST_GET_SECOND_( \ + __VA_ARGS__, \ + ::testing::internal::DefaultParamName, \ + DUMMY_PARAM_))))(info); \ + } \ + static int gtest_##prefix##test_suite_name##_dummy_ \ + GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::UnitTest::GetInstance() \ + ->parameterized_test_registry() \ + .GetTestSuitePatternHolder( \ + GTEST_STRINGIFY_(test_suite_name), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__)) \ + ->AddTestSuiteInstantiation( \ + GTEST_STRINGIFY_(prefix), \ + >est_##prefix##test_suite_name##_EvalGenerator_, \ + >est_##prefix##test_suite_name##_EvalGenerateName_, \ + __FILE__, __LINE__) + + +// Allow Marking a Parameterized test class as not needing to be instantiated. +#define GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(T) \ + namespace gtest_do_not_use_outside_namespace_scope {} \ + static const ::testing::internal::MarkAsIgnored gtest_allow_ignore_##T( \ + GTEST_STRINGIFY_(T)) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define INSTANTIATE_TEST_CASE_P \ + static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \ + ""); \ + INSTANTIATE_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + +} // namespace testing + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ diff --git a/data/miniconda3/include/gtest/gtest-spi.h b/data/miniconda3/include/gtest/gtest-spi.h new file mode 100644 index 0000000000000000000000000000000000000000..eacef44669e8104a3d28daa054edadcdeb23c548 --- /dev/null +++ b/data/miniconda3/include/gtest/gtest-spi.h @@ -0,0 +1,238 @@ +// Copyright 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +// Utilities for testing Google Test itself and code that uses Google Test +// (e.g. frameworks built on top of Google Test). + +// GOOGLETEST_CM0004 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_ + +#include "gtest/gtest.h" + +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ +/* class A needs to have dll-interface to be used by clients of class B */) + +namespace testing { + +// This helper class can be used to mock out Google Test failure reporting +// so that we can test Google Test or code that builds on Google Test. +// +// An object of this class appends a TestPartResult object to the +// TestPartResultArray object given in the constructor whenever a Google Test +// failure is reported. It can either intercept only failures that are +// generated in the same thread that created this object or it can intercept +// all generated failures. The scope of this mock object can be controlled with +// the second argument to the two arguments constructor. +class GTEST_API_ ScopedFakeTestPartResultReporter + : public TestPartResultReporterInterface { + public: + // The two possible mocking modes of this object. + enum InterceptMode { + INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures. + INTERCEPT_ALL_THREADS // Intercepts all failures. + }; + + // The c'tor sets this object as the test part result reporter used + // by Google Test. The 'result' parameter specifies where to report the + // results. This reporter will only catch failures generated in the current + // thread. DEPRECATED + explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result); + + // Same as above, but you can choose the interception scope of this object. + ScopedFakeTestPartResultReporter(InterceptMode intercept_mode, + TestPartResultArray* result); + + // The d'tor restores the previous test part result reporter. + ~ScopedFakeTestPartResultReporter() override; + + // Appends the TestPartResult object to the TestPartResultArray + // received in the constructor. + // + // This method is from the TestPartResultReporterInterface + // interface. + void ReportTestPartResult(const TestPartResult& result) override; + + private: + void Init(); + + const InterceptMode intercept_mode_; + TestPartResultReporterInterface* old_reporter_; + TestPartResultArray* const result_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter); +}; + +namespace internal { + +// A helper class for implementing EXPECT_FATAL_FAILURE() and +// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given +// TestPartResultArray contains exactly one failure that has the given +// type and contains the given substring. If that's not the case, a +// non-fatal failure will be generated. +class GTEST_API_ SingleFailureChecker { + public: + // The constructor remembers the arguments. + SingleFailureChecker(const TestPartResultArray* results, + TestPartResult::Type type, const std::string& substr); + ~SingleFailureChecker(); + private: + const TestPartResultArray* const results_; + const TestPartResult::Type type_; + const std::string substr_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker); +}; + +} // namespace internal + +} // namespace testing + +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 + +// A set of macros for testing Google Test assertions or code that's expected +// to generate Google Test fatal failures. It verifies that the given +// statement will cause exactly one fatal Google Test failure with 'substr' +// being part of the failure message. +// +// There are two different versions of this macro. EXPECT_FATAL_FAILURE only +// affects and considers failures generated in the current thread and +// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. +// +// The verification of the assertion is done correctly even when the statement +// throws an exception or aborts the current function. +// +// Known restrictions: +// - 'statement' cannot reference local non-static variables or +// non-static members of the current object. +// - 'statement' cannot return a value. +// - You cannot stream a failure message to this macro. +// +// Note that even though the implementations of the following two +// macros are much alike, we cannot refactor them to use a common +// helper macro, due to some peculiarity in how the preprocessor +// works. The AcceptsMacroThatExpandsToUnprotectedComma test in +// gtest_unittest.cc will fail to compile if we do that. +#define EXPECT_FATAL_FAILURE(statement, substr) \ + do { \ + class GTestExpectFatalFailureHelper {\ + public:\ + static void Execute() { statement; }\ + };\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter:: \ + INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ + GTestExpectFatalFailureHelper::Execute();\ + }\ + } while (::testing::internal::AlwaysFalse()) + +#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ + do { \ + class GTestExpectFatalFailureHelper {\ + public:\ + static void Execute() { statement; }\ + };\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter:: \ + INTERCEPT_ALL_THREADS, >est_failures);\ + GTestExpectFatalFailureHelper::Execute();\ + }\ + } while (::testing::internal::AlwaysFalse()) + +// A macro for testing Google Test assertions or code that's expected to +// generate Google Test non-fatal failures. It asserts that the given +// statement will cause exactly one non-fatal Google Test failure with 'substr' +// being part of the failure message. +// +// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only +// affects and considers failures generated in the current thread and +// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. +// +// 'statement' is allowed to reference local variables and members of +// the current object. +// +// The verification of the assertion is done correctly even when the statement +// throws an exception or aborts the current function. +// +// Known restrictions: +// - You cannot stream a failure message to this macro. +// +// Note that even though the implementations of the following two +// macros are much alike, we cannot refactor them to use a common +// helper macro, due to some peculiarity in how the preprocessor +// works. If we do that, the code won't compile when the user gives +// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that +// expands to code containing an unprotected comma. The +// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc +// catches that. +// +// For the same reason, we have to write +// if (::testing::internal::AlwaysTrue()) { statement; } +// instead of +// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) +// to avoid an MSVC warning on unreachable code. +#define EXPECT_NONFATAL_FAILURE(statement, substr) \ + do {\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ + (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter:: \ + INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ + if (::testing::internal::AlwaysTrue()) { statement; }\ + }\ + } while (::testing::internal::AlwaysFalse()) + +#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ + do {\ + ::testing::TestPartResultArray gtest_failures;\ + ::testing::internal::SingleFailureChecker gtest_checker(\ + >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ + (substr));\ + {\ + ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ + ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \ + >est_failures);\ + if (::testing::internal::AlwaysTrue()) { statement; }\ + }\ + } while (::testing::internal::AlwaysFalse()) + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_ diff --git a/data/miniconda3/include/gtest/gtest-test-part.h b/data/miniconda3/include/gtest/gtest-test-part.h new file mode 100644 index 0000000000000000000000000000000000000000..203fdf98c69fcdf9647437cdc8e6cc70ae18e609 --- /dev/null +++ b/data/miniconda3/include/gtest/gtest-test-part.h @@ -0,0 +1,184 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// GOOGLETEST_CM0001 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ + +#include +#include +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-string.h" + +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ +/* class A needs to have dll-interface to be used by clients of class B */) + +namespace testing { + +// A copyable object representing the result of a test part (i.e. an +// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). +// +// Don't inherit from TestPartResult as its destructor is not virtual. +class GTEST_API_ TestPartResult { + public: + // The possible outcomes of a test part (i.e. an assertion or an + // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). + enum Type { + kSuccess, // Succeeded. + kNonFatalFailure, // Failed but the test can continue. + kFatalFailure, // Failed and the test should be terminated. + kSkip // Skipped. + }; + + // C'tor. TestPartResult does NOT have a default constructor. + // Always use this constructor (with parameters) to create a + // TestPartResult object. + TestPartResult(Type a_type, const char* a_file_name, int a_line_number, + const char* a_message) + : type_(a_type), + file_name_(a_file_name == nullptr ? "" : a_file_name), + line_number_(a_line_number), + summary_(ExtractSummary(a_message)), + message_(a_message) {} + + // Gets the outcome of the test part. + Type type() const { return type_; } + + // Gets the name of the source file where the test part took place, or + // NULL if it's unknown. + const char* file_name() const { + return file_name_.empty() ? nullptr : file_name_.c_str(); + } + + // Gets the line in the source file where the test part took place, + // or -1 if it's unknown. + int line_number() const { return line_number_; } + + // Gets the summary of the failure message. + const char* summary() const { return summary_.c_str(); } + + // Gets the message associated with the test part. + const char* message() const { return message_.c_str(); } + + // Returns true if and only if the test part was skipped. + bool skipped() const { return type_ == kSkip; } + + // Returns true if and only if the test part passed. + bool passed() const { return type_ == kSuccess; } + + // Returns true if and only if the test part non-fatally failed. + bool nonfatally_failed() const { return type_ == kNonFatalFailure; } + + // Returns true if and only if the test part fatally failed. + bool fatally_failed() const { return type_ == kFatalFailure; } + + // Returns true if and only if the test part failed. + bool failed() const { return fatally_failed() || nonfatally_failed(); } + + private: + Type type_; + + // Gets the summary of the failure message by omitting the stack + // trace in it. + static std::string ExtractSummary(const char* message); + + // The name of the source file where the test part took place, or + // "" if the source file is unknown. + std::string file_name_; + // The line in the source file where the test part took place, or -1 + // if the line number is unknown. + int line_number_; + std::string summary_; // The test failure summary. + std::string message_; // The test failure message. +}; + +// Prints a TestPartResult object. +std::ostream& operator<<(std::ostream& os, const TestPartResult& result); + +// An array of TestPartResult objects. +// +// Don't inherit from TestPartResultArray as its destructor is not +// virtual. +class GTEST_API_ TestPartResultArray { + public: + TestPartResultArray() {} + + // Appends the given TestPartResult to the array. + void Append(const TestPartResult& result); + + // Returns the TestPartResult at the given index (0-based). + const TestPartResult& GetTestPartResult(int index) const; + + // Returns the number of TestPartResult objects in the array. + int size() const; + + private: + std::vector array_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); +}; + +// This interface knows how to report a test part result. +class GTEST_API_ TestPartResultReporterInterface { + public: + virtual ~TestPartResultReporterInterface() {} + + virtual void ReportTestPartResult(const TestPartResult& result) = 0; +}; + +namespace internal { + +// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a +// statement generates new fatal failures. To do so it registers itself as the +// current test part result reporter. Besides checking if fatal failures were +// reported, it only delegates the reporting to the former result reporter. +// The original result reporter is restored in the destructor. +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +class GTEST_API_ HasNewFatalFailureHelper + : public TestPartResultReporterInterface { + public: + HasNewFatalFailureHelper(); + ~HasNewFatalFailureHelper() override; + void ReportTestPartResult(const TestPartResult& result) override; + bool has_new_fatal_failure() const { return has_new_fatal_failure_; } + private: + bool has_new_fatal_failure_; + TestPartResultReporterInterface* original_reporter_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper); +}; + +} // namespace internal + +} // namespace testing + +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ diff --git a/data/miniconda3/include/gtest/gtest-typed-test.h b/data/miniconda3/include/gtest/gtest-typed-test.h new file mode 100644 index 0000000000000000000000000000000000000000..9fdc6be10dc26b8033e1aa5a0f5af05f82547915 --- /dev/null +++ b/data/miniconda3/include/gtest/gtest-typed-test.h @@ -0,0 +1,329 @@ +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// GOOGLETEST_CM0001 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ + +// This header implements typed tests and type-parameterized tests. + +// Typed (aka type-driven) tests repeat the same test for types in a +// list. You must know which types you want to test with when writing +// typed tests. Here's how you do it: + +#if 0 + +// First, define a fixture class template. It should be parameterized +// by a type. Remember to derive it from testing::Test. +template +class FooTest : public testing::Test { + public: + ... + typedef std::list List; + static T shared_; + T value_; +}; + +// Next, associate a list of types with the test suite, which will be +// repeated for each type in the list. The typedef is necessary for +// the macro to parse correctly. +typedef testing::Types MyTypes; +TYPED_TEST_SUITE(FooTest, MyTypes); + +// If the type list contains only one type, you can write that type +// directly without Types<...>: +// TYPED_TEST_SUITE(FooTest, int); + +// Then, use TYPED_TEST() instead of TEST_F() to define as many typed +// tests for this test suite as you want. +TYPED_TEST(FooTest, DoesBlah) { + // Inside a test, refer to the special name TypeParam to get the type + // parameter. Since we are inside a derived class template, C++ requires + // us to visit the members of FooTest via 'this'. + TypeParam n = this->value_; + + // To visit static members of the fixture, add the TestFixture:: + // prefix. + n += TestFixture::shared_; + + // To refer to typedefs in the fixture, add the "typename + // TestFixture::" prefix. + typename TestFixture::List values; + values.push_back(n); + ... +} + +TYPED_TEST(FooTest, HasPropertyA) { ... } + +// TYPED_TEST_SUITE takes an optional third argument which allows to specify a +// class that generates custom test name suffixes based on the type. This should +// be a class which has a static template function GetName(int index) returning +// a string for each type. The provided integer index equals the index of the +// type in the provided type list. In many cases the index can be ignored. +// +// For example: +// class MyTypeNames { +// public: +// template +// static std::string GetName(int) { +// if (std::is_same()) return "char"; +// if (std::is_same()) return "int"; +// if (std::is_same()) return "unsignedInt"; +// } +// }; +// TYPED_TEST_SUITE(FooTest, MyTypes, MyTypeNames); + +#endif // 0 + +// Type-parameterized tests are abstract test patterns parameterized +// by a type. Compared with typed tests, type-parameterized tests +// allow you to define the test pattern without knowing what the type +// parameters are. The defined pattern can be instantiated with +// different types any number of times, in any number of translation +// units. +// +// If you are designing an interface or concept, you can define a +// suite of type-parameterized tests to verify properties that any +// valid implementation of the interface/concept should have. Then, +// each implementation can easily instantiate the test suite to verify +// that it conforms to the requirements, without having to write +// similar tests repeatedly. Here's an example: + +#if 0 + +// First, define a fixture class template. It should be parameterized +// by a type. Remember to derive it from testing::Test. +template +class FooTest : public testing::Test { + ... +}; + +// Next, declare that you will define a type-parameterized test suite +// (the _P suffix is for "parameterized" or "pattern", whichever you +// prefer): +TYPED_TEST_SUITE_P(FooTest); + +// Then, use TYPED_TEST_P() to define as many type-parameterized tests +// for this type-parameterized test suite as you want. +TYPED_TEST_P(FooTest, DoesBlah) { + // Inside a test, refer to TypeParam to get the type parameter. + TypeParam n = 0; + ... +} + +TYPED_TEST_P(FooTest, HasPropertyA) { ... } + +// Now the tricky part: you need to register all test patterns before +// you can instantiate them. The first argument of the macro is the +// test suite name; the rest are the names of the tests in this test +// case. +REGISTER_TYPED_TEST_SUITE_P(FooTest, + DoesBlah, HasPropertyA); + +// Finally, you are free to instantiate the pattern with the types you +// want. If you put the above code in a header file, you can #include +// it in multiple C++ source files and instantiate it multiple times. +// +// To distinguish different instances of the pattern, the first +// argument to the INSTANTIATE_* macro is a prefix that will be added +// to the actual test suite name. Remember to pick unique prefixes for +// different instances. +typedef testing::Types MyTypes; +INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes); + +// If the type list contains only one type, you can write that type +// directly without Types<...>: +// INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, int); +// +// Similar to the optional argument of TYPED_TEST_SUITE above, +// INSTANTIATE_TEST_SUITE_P takes an optional fourth argument which allows to +// generate custom names. +// INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes, MyTypeNames); + +#endif // 0 + +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-port.h" +#include "gtest/internal/gtest-type-util.h" + +// Implements typed tests. + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Expands to the name of the typedef for the type parameters of the +// given test suite. +#define GTEST_TYPE_PARAMS_(TestSuiteName) gtest_type_params_##TestSuiteName##_ + +// Expands to the name of the typedef for the NameGenerator, responsible for +// creating the suffixes of the name. +#define GTEST_NAME_GENERATOR_(TestSuiteName) \ + gtest_type_params_##TestSuiteName##_NameGenerator + +#define TYPED_TEST_SUITE(CaseName, Types, ...) \ + typedef ::testing::internal::GenerateTypeList::type \ + GTEST_TYPE_PARAMS_(CaseName); \ + typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \ + GTEST_NAME_GENERATOR_(CaseName) + +#define TYPED_TEST(CaseName, TestName) \ + static_assert(sizeof(GTEST_STRINGIFY_(TestName)) > 1, \ + "test-name must not be empty"); \ + template \ + class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ + : public CaseName { \ + private: \ + typedef CaseName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + void TestBody() override; \ + }; \ + static bool gtest_##CaseName##_##TestName##_registered_ \ + GTEST_ATTRIBUTE_UNUSED_ = ::testing::internal::TypeParameterizedTest< \ + CaseName, \ + ::testing::internal::TemplateSel, \ + GTEST_TYPE_PARAMS_( \ + CaseName)>::Register("", \ + ::testing::internal::CodeLocation( \ + __FILE__, __LINE__), \ + GTEST_STRINGIFY_(CaseName), \ + GTEST_STRINGIFY_(TestName), 0, \ + ::testing::internal::GenerateNames< \ + GTEST_NAME_GENERATOR_(CaseName), \ + GTEST_TYPE_PARAMS_(CaseName)>()); \ + template \ + void GTEST_TEST_CLASS_NAME_(CaseName, \ + TestName)::TestBody() + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define TYPED_TEST_CASE \ + static_assert(::testing::internal::TypedTestCaseIsDeprecated(), ""); \ + TYPED_TEST_SUITE +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + +// Implements type-parameterized tests. + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Expands to the namespace name that the type-parameterized tests for +// the given type-parameterized test suite are defined in. The exact +// name of the namespace is subject to change without notice. +#define GTEST_SUITE_NAMESPACE_(TestSuiteName) gtest_suite_##TestSuiteName##_ + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Expands to the name of the variable used to remember the names of +// the defined tests in the given test suite. +#define GTEST_TYPED_TEST_SUITE_P_STATE_(TestSuiteName) \ + gtest_typed_test_suite_p_state_##TestSuiteName##_ + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. +// +// Expands to the name of the variable used to remember the names of +// the registered tests in the given test suite. +#define GTEST_REGISTERED_TEST_NAMES_(TestSuiteName) \ + gtest_registered_test_names_##TestSuiteName##_ + +// The variables defined in the type-parameterized test macros are +// static as typically these macros are used in a .h file that can be +// #included in multiple translation units linked together. +#define TYPED_TEST_SUITE_P(SuiteName) \ + static ::testing::internal::TypedTestSuitePState \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define TYPED_TEST_CASE_P \ + static_assert(::testing::internal::TypedTestCase_P_IsDeprecated(), ""); \ + TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + +#define TYPED_TEST_P(SuiteName, TestName) \ + namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ + template \ + class TestName : public SuiteName { \ + private: \ + typedef SuiteName TestFixture; \ + typedef gtest_TypeParam_ TypeParam; \ + void TestBody() override; \ + }; \ + static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \ + __FILE__, __LINE__, GTEST_STRINGIFY_(SuiteName), \ + GTEST_STRINGIFY_(TestName)); \ + } \ + template \ + void GTEST_SUITE_NAMESPACE_( \ + SuiteName)::TestName::TestBody() + +// Note: this won't work correctly if the trailing arguments are macros. +#define REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...) \ + namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \ + typedef ::testing::internal::Templates<__VA_ARGS__> gtest_AllTests_; \ + } \ + static const char* const GTEST_REGISTERED_TEST_NAMES_( \ + SuiteName) GTEST_ATTRIBUTE_UNUSED_ = \ + GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).VerifyRegisteredTestNames( \ + GTEST_STRINGIFY_(SuiteName), __FILE__, __LINE__, #__VA_ARGS__) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define REGISTER_TYPED_TEST_CASE_P \ + static_assert(::testing::internal::RegisterTypedTestCase_P_IsDeprecated(), \ + ""); \ + REGISTER_TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + +#define INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...) \ + static_assert(sizeof(GTEST_STRINGIFY_(Prefix)) > 1, \ + "test-suit-prefix must not be empty"); \ + static bool gtest_##Prefix##_##SuiteName GTEST_ATTRIBUTE_UNUSED_ = \ + ::testing::internal::TypeParameterizedTestSuite< \ + SuiteName, GTEST_SUITE_NAMESPACE_(SuiteName)::gtest_AllTests_, \ + ::testing::internal::GenerateTypeList::type>:: \ + Register(GTEST_STRINGIFY_(Prefix), \ + ::testing::internal::CodeLocation(__FILE__, __LINE__), \ + >EST_TYPED_TEST_SUITE_P_STATE_(SuiteName), \ + GTEST_STRINGIFY_(SuiteName), \ + GTEST_REGISTERED_TEST_NAMES_(SuiteName), \ + ::testing::internal::GenerateNames< \ + ::testing::internal::NameGeneratorSelector< \ + __VA_ARGS__>::type, \ + ::testing::internal::GenerateTypeList::type>()) + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +#define INSTANTIATE_TYPED_TEST_CASE_P \ + static_assert( \ + ::testing::internal::InstantiateTypedTestCase_P_IsDeprecated(), ""); \ + INSTANTIATE_TYPED_TEST_SUITE_P +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ diff --git a/data/miniconda3/include/gtest/gtest.h b/data/miniconda3/include/gtest/gtest.h new file mode 100644 index 0000000000000000000000000000000000000000..7a5d057c4a7eccd5c05a5d01f00d405a281e8dd5 --- /dev/null +++ b/data/miniconda3/include/gtest/gtest.h @@ -0,0 +1,2495 @@ +// Copyright 2005, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +// The Google C++ Testing and Mocking Framework (Google Test) +// +// This header file defines the public API for Google Test. It should be +// included by any test program that uses Google Test. +// +// IMPORTANT NOTE: Due to limitation of the C++ language, we have to +// leave some internal implementation details in this header file. +// They are clearly marked by comments like this: +// +// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +// +// Such code is NOT meant to be used by a user directly, and is subject +// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user +// program! +// +// Acknowledgment: Google Test borrowed the idea of automatic test +// registration from Barthelemy Dagenais' (barthelemy@prologique.com) +// easyUnit framework. + +// GOOGLETEST_CM0001 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_H_ + +#include +#include +#include +#include +#include +#include + +#include "gtest/internal/gtest-internal.h" +#include "gtest/internal/gtest-string.h" +#include "gtest/gtest-death-test.h" +#include "gtest/gtest-matchers.h" +#include "gtest/gtest-message.h" +#include "gtest/gtest-param-test.h" +#include "gtest/gtest-printers.h" +#include "gtest/gtest_prod.h" +#include "gtest/gtest-test-part.h" +#include "gtest/gtest-typed-test.h" + +GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \ +/* class A needs to have dll-interface to be used by clients of class B */) + +namespace testing { + +// Silence C4100 (unreferenced formal parameter) and 4805 +// unsafe mix of type 'const int' and type 'const bool' +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4805) +# pragma warning(disable:4100) +#endif + + +// Declares the flags. + +// This flag temporary enables the disabled tests. +GTEST_DECLARE_bool_(also_run_disabled_tests); + +// This flag brings the debugger on an assertion failure. +GTEST_DECLARE_bool_(break_on_failure); + +// This flag controls whether Google Test catches all test-thrown exceptions +// and logs them as failures. +GTEST_DECLARE_bool_(catch_exceptions); + +// This flag enables using colors in terminal output. Available values are +// "yes" to enable colors, "no" (disable colors), or "auto" (the default) +// to let Google Test decide. +GTEST_DECLARE_string_(color); + +// This flag controls whether the test runner should continue execution past +// first failure. +GTEST_DECLARE_bool_(fail_fast); + +// This flag sets up the filter to select by name using a glob pattern +// the tests to run. If the filter is not given all tests are executed. +GTEST_DECLARE_string_(filter); + +// This flag controls whether Google Test installs a signal handler that dumps +// debugging information when fatal signals are raised. +GTEST_DECLARE_bool_(install_failure_signal_handler); + +// This flag causes the Google Test to list tests. None of the tests listed +// are actually run if the flag is provided. +GTEST_DECLARE_bool_(list_tests); + +// This flag controls whether Google Test emits a detailed XML report to a file +// in addition to its normal textual output. +GTEST_DECLARE_string_(output); + +// This flags control whether Google Test prints only test failures. +GTEST_DECLARE_bool_(brief); + +// This flags control whether Google Test prints the elapsed time for each +// test. +GTEST_DECLARE_bool_(print_time); + +// This flags control whether Google Test prints UTF8 characters as text. +GTEST_DECLARE_bool_(print_utf8); + +// This flag specifies the random number seed. +GTEST_DECLARE_int32_(random_seed); + +// This flag sets how many times the tests are repeated. The default value +// is 1. If the value is -1 the tests are repeating forever. +GTEST_DECLARE_int32_(repeat); + +// This flag controls whether Google Test includes Google Test internal +// stack frames in failure stack traces. +GTEST_DECLARE_bool_(show_internal_stack_frames); + +// When this flag is specified, tests' order is randomized on every iteration. +GTEST_DECLARE_bool_(shuffle); + +// This flag specifies the maximum number of stack frames to be +// printed in a failure message. +GTEST_DECLARE_int32_(stack_trace_depth); + +// When this flag is specified, a failed assertion will throw an +// exception if exceptions are enabled, or exit the program with a +// non-zero code otherwise. For use with an external test framework. +GTEST_DECLARE_bool_(throw_on_failure); + +// When this flag is set with a "host:port" string, on supported +// platforms test results are streamed to the specified port on +// the specified host machine. +GTEST_DECLARE_string_(stream_result_to); + +#if GTEST_USE_OWN_FLAGFILE_FLAG_ +GTEST_DECLARE_string_(flagfile); +#endif // GTEST_USE_OWN_FLAGFILE_FLAG_ + +// The upper limit for valid stack trace depths. +const int kMaxStackTraceDepth = 100; + +namespace internal { + +class AssertHelper; +class DefaultGlobalTestPartResultReporter; +class ExecDeathTest; +class NoExecDeathTest; +class FinalSuccessChecker; +class GTestFlagSaver; +class StreamingListenerTest; +class TestResultAccessor; +class TestEventListenersAccessor; +class TestEventRepeater; +class UnitTestRecordPropertyTestHelper; +class WindowsDeathTest; +class FuchsiaDeathTest; +class UnitTestImpl* GetUnitTestImpl(); +void ReportFailureInUnknownLocation(TestPartResult::Type result_type, + const std::string& message); +std::set* GetIgnoredParameterizedTestSuites(); + +} // namespace internal + +// The friend relationship of some of these classes is cyclic. +// If we don't forward declare them the compiler might confuse the classes +// in friendship clauses with same named classes on the scope. +class Test; +class TestSuite; + +// Old API is still available but deprecated +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ +using TestCase = TestSuite; +#endif +class TestInfo; +class UnitTest; + +// A class for indicating whether an assertion was successful. When +// the assertion wasn't successful, the AssertionResult object +// remembers a non-empty message that describes how it failed. +// +// To create an instance of this class, use one of the factory functions +// (AssertionSuccess() and AssertionFailure()). +// +// This class is useful for two purposes: +// 1. Defining predicate functions to be used with Boolean test assertions +// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts +// 2. Defining predicate-format functions to be +// used with predicate assertions (ASSERT_PRED_FORMAT*, etc). +// +// For example, if you define IsEven predicate: +// +// testing::AssertionResult IsEven(int n) { +// if ((n % 2) == 0) +// return testing::AssertionSuccess(); +// else +// return testing::AssertionFailure() << n << " is odd"; +// } +// +// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5))) +// will print the message +// +// Value of: IsEven(Fib(5)) +// Actual: false (5 is odd) +// Expected: true +// +// instead of a more opaque +// +// Value of: IsEven(Fib(5)) +// Actual: false +// Expected: true +// +// in case IsEven is a simple Boolean predicate. +// +// If you expect your predicate to be reused and want to support informative +// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up +// about half as often as positive ones in our tests), supply messages for +// both success and failure cases: +// +// testing::AssertionResult IsEven(int n) { +// if ((n % 2) == 0) +// return testing::AssertionSuccess() << n << " is even"; +// else +// return testing::AssertionFailure() << n << " is odd"; +// } +// +// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print +// +// Value of: IsEven(Fib(6)) +// Actual: true (8 is even) +// Expected: false +// +// NB: Predicates that support negative Boolean assertions have reduced +// performance in positive ones so be careful not to use them in tests +// that have lots (tens of thousands) of positive Boolean assertions. +// +// To use this class with EXPECT_PRED_FORMAT assertions such as: +// +// // Verifies that Foo() returns an even number. +// EXPECT_PRED_FORMAT1(IsEven, Foo()); +// +// you need to define: +// +// testing::AssertionResult IsEven(const char* expr, int n) { +// if ((n % 2) == 0) +// return testing::AssertionSuccess(); +// else +// return testing::AssertionFailure() +// << "Expected: " << expr << " is even\n Actual: it's " << n; +// } +// +// If Foo() returns 5, you will see the following message: +// +// Expected: Foo() is even +// Actual: it's 5 +// +class GTEST_API_ AssertionResult { + public: + // Copy constructor. + // Used in EXPECT_TRUE/FALSE(assertion_result). + AssertionResult(const AssertionResult& other); + +// C4800 is a level 3 warning in Visual Studio 2015 and earlier. +// This warning is not emitted in Visual Studio 2017. +// This warning is off by default starting in Visual Studio 2019 but can be +// enabled with command-line options. +#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920) + GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */) +#endif + + // Used in the EXPECT_TRUE/FALSE(bool_expression). + // + // T must be contextually convertible to bool. + // + // The second parameter prevents this overload from being considered if + // the argument is implicitly convertible to AssertionResult. In that case + // we want AssertionResult's copy constructor to be used. + template + explicit AssertionResult( + const T& success, + typename std::enable_if< + !std::is_convertible::value>::type* + /*enabler*/ + = nullptr) + : success_(success) {} + +#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920) + GTEST_DISABLE_MSC_WARNINGS_POP_() +#endif + + // Assignment operator. + AssertionResult& operator=(AssertionResult other) { + swap(other); + return *this; + } + + // Returns true if and only if the assertion succeeded. + operator bool() const { return success_; } // NOLINT + + // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. + AssertionResult operator!() const; + + // Returns the text streamed into this AssertionResult. Test assertions + // use it when they fail (i.e., the predicate's outcome doesn't match the + // assertion's expectation). When nothing has been streamed into the + // object, returns an empty string. + const char* message() const { + return message_.get() != nullptr ? message_->c_str() : ""; + } + // Deprecated; please use message() instead. + const char* failure_message() const { return message(); } + + // Streams a custom failure message into this object. + template AssertionResult& operator<<(const T& value) { + AppendMessage(Message() << value); + return *this; + } + + // Allows streaming basic output manipulators such as endl or flush into + // this object. + AssertionResult& operator<<( + ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) { + AppendMessage(Message() << basic_manipulator); + return *this; + } + + private: + // Appends the contents of message to message_. + void AppendMessage(const Message& a_message) { + if (message_.get() == nullptr) message_.reset(new ::std::string); + message_->append(a_message.GetString().c_str()); + } + + // Swap the contents of this AssertionResult with other. + void swap(AssertionResult& other); + + // Stores result of the assertion predicate. + bool success_; + // Stores the message describing the condition in case the expectation + // construct is not satisfied with the predicate's outcome. + // Referenced via a pointer to avoid taking too much stack frame space + // with test assertions. + std::unique_ptr< ::std::string> message_; +}; + +// Makes a successful assertion result. +GTEST_API_ AssertionResult AssertionSuccess(); + +// Makes a failed assertion result. +GTEST_API_ AssertionResult AssertionFailure(); + +// Makes a failed assertion result with the given failure message. +// Deprecated; use AssertionFailure() << msg. +GTEST_API_ AssertionResult AssertionFailure(const Message& msg); + +} // namespace testing + +// Includes the auto-generated header that implements a family of generic +// predicate assertion macros. This include comes late because it relies on +// APIs declared above. +#include "gtest/gtest_pred_impl.h" + +namespace testing { + +// The abstract class that all tests inherit from. +// +// In Google Test, a unit test program contains one or many TestSuites, and +// each TestSuite contains one or many Tests. +// +// When you define a test using the TEST macro, you don't need to +// explicitly derive from Test - the TEST macro automatically does +// this for you. +// +// The only time you derive from Test is when defining a test fixture +// to be used in a TEST_F. For example: +// +// class FooTest : public testing::Test { +// protected: +// void SetUp() override { ... } +// void TearDown() override { ... } +// ... +// }; +// +// TEST_F(FooTest, Bar) { ... } +// TEST_F(FooTest, Baz) { ... } +// +// Test is not copyable. +class GTEST_API_ Test { + public: + friend class TestInfo; + + // The d'tor is virtual as we intend to inherit from Test. + virtual ~Test(); + + // Sets up the stuff shared by all tests in this test suite. + // + // Google Test will call Foo::SetUpTestSuite() before running the first + // test in test suite Foo. Hence a sub-class can define its own + // SetUpTestSuite() method to shadow the one defined in the super + // class. + static void SetUpTestSuite() {} + + // Tears down the stuff shared by all tests in this test suite. + // + // Google Test will call Foo::TearDownTestSuite() after running the last + // test in test suite Foo. Hence a sub-class can define its own + // TearDownTestSuite() method to shadow the one defined in the super + // class. + static void TearDownTestSuite() {} + + // Legacy API is deprecated but still available. Use SetUpTestSuite and + // TearDownTestSuite instead. +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + static void TearDownTestCase() {} + static void SetUpTestCase() {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Returns true if and only if the current test has a fatal failure. + static bool HasFatalFailure(); + + // Returns true if and only if the current test has a non-fatal failure. + static bool HasNonfatalFailure(); + + // Returns true if and only if the current test was skipped. + static bool IsSkipped(); + + // Returns true if and only if the current test has a (either fatal or + // non-fatal) failure. + static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } + + // Logs a property for the current test, test suite, or for the entire + // invocation of the test program when used outside of the context of a + // test suite. Only the last value for a given key is remembered. These + // are public static so they can be called from utility functions that are + // not members of the test fixture. Calls to RecordProperty made during + // lifespan of the test (from the moment its constructor starts to the + // moment its destructor finishes) will be output in XML as attributes of + // the element. Properties recorded from fixture's + // SetUpTestSuite or TearDownTestSuite are logged as attributes of the + // corresponding element. Calls to RecordProperty made in the + // global context (before or after invocation of RUN_ALL_TESTS and from + // SetUp/TearDown method of Environment objects registered with Google + // Test) will be output as attributes of the element. + static void RecordProperty(const std::string& key, const std::string& value); + static void RecordProperty(const std::string& key, int value); + + protected: + // Creates a Test object. + Test(); + + // Sets up the test fixture. + virtual void SetUp(); + + // Tears down the test fixture. + virtual void TearDown(); + + private: + // Returns true if and only if the current test has the same fixture class + // as the first test in the current test suite. + static bool HasSameFixtureClass(); + + // Runs the test after the test fixture has been set up. + // + // A sub-class must implement this to define the test logic. + // + // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM. + // Instead, use the TEST or TEST_F macro. + virtual void TestBody() = 0; + + // Sets up, executes, and tears down the test. + void Run(); + + // Deletes self. We deliberately pick an unusual name for this + // internal method to avoid clashing with names used in user TESTs. + void DeleteSelf_() { delete this; } + + const std::unique_ptr gtest_flag_saver_; + + // Often a user misspells SetUp() as Setup() and spends a long time + // wondering why it is never called by Google Test. The declaration of + // the following method is solely for catching such an error at + // compile time: + // + // - The return type is deliberately chosen to be not void, so it + // will be a conflict if void Setup() is declared in the user's + // test fixture. + // + // - This method is private, so it will be another compiler error + // if the method is called from the user's test fixture. + // + // DO NOT OVERRIDE THIS FUNCTION. + // + // If you see an error about overriding the following function or + // about it being private, you have mis-spelled SetUp() as Setup(). + struct Setup_should_be_spelled_SetUp {}; + virtual Setup_should_be_spelled_SetUp* Setup() { return nullptr; } + + // We disallow copying Tests. + GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); +}; + +typedef internal::TimeInMillis TimeInMillis; + +// A copyable object representing a user specified test property which can be +// output as a key/value string pair. +// +// Don't inherit from TestProperty as its destructor is not virtual. +class TestProperty { + public: + // C'tor. TestProperty does NOT have a default constructor. + // Always use this constructor (with parameters) to create a + // TestProperty object. + TestProperty(const std::string& a_key, const std::string& a_value) : + key_(a_key), value_(a_value) { + } + + // Gets the user supplied key. + const char* key() const { + return key_.c_str(); + } + + // Gets the user supplied value. + const char* value() const { + return value_.c_str(); + } + + // Sets a new value, overriding the one supplied in the constructor. + void SetValue(const std::string& new_value) { + value_ = new_value; + } + + private: + // The key supplied by the user. + std::string key_; + // The value supplied by the user. + std::string value_; +}; + +// The result of a single Test. This includes a list of +// TestPartResults, a list of TestProperties, a count of how many +// death tests there are in the Test, and how much time it took to run +// the Test. +// +// TestResult is not copyable. +class GTEST_API_ TestResult { + public: + // Creates an empty TestResult. + TestResult(); + + // D'tor. Do not inherit from TestResult. + ~TestResult(); + + // Gets the number of all test parts. This is the sum of the number + // of successful test parts and the number of failed test parts. + int total_part_count() const; + + // Returns the number of the test properties. + int test_property_count() const; + + // Returns true if and only if the test passed (i.e. no test part failed). + bool Passed() const { return !Skipped() && !Failed(); } + + // Returns true if and only if the test was skipped. + bool Skipped() const; + + // Returns true if and only if the test failed. + bool Failed() const; + + // Returns true if and only if the test fatally failed. + bool HasFatalFailure() const; + + // Returns true if and only if the test has a non-fatal failure. + bool HasNonfatalFailure() const; + + // Returns the elapsed time, in milliseconds. + TimeInMillis elapsed_time() const { return elapsed_time_; } + + // Gets the time of the test case start, in ms from the start of the + // UNIX epoch. + TimeInMillis start_timestamp() const { return start_timestamp_; } + + // Returns the i-th test part result among all the results. i can range from 0 + // to total_part_count() - 1. If i is not in that range, aborts the program. + const TestPartResult& GetTestPartResult(int i) const; + + // Returns the i-th test property. i can range from 0 to + // test_property_count() - 1. If i is not in that range, aborts the + // program. + const TestProperty& GetTestProperty(int i) const; + + private: + friend class TestInfo; + friend class TestSuite; + friend class UnitTest; + friend class internal::DefaultGlobalTestPartResultReporter; + friend class internal::ExecDeathTest; + friend class internal::TestResultAccessor; + friend class internal::UnitTestImpl; + friend class internal::WindowsDeathTest; + friend class internal::FuchsiaDeathTest; + + // Gets the vector of TestPartResults. + const std::vector& test_part_results() const { + return test_part_results_; + } + + // Gets the vector of TestProperties. + const std::vector& test_properties() const { + return test_properties_; + } + + // Sets the start time. + void set_start_timestamp(TimeInMillis start) { start_timestamp_ = start; } + + // Sets the elapsed time. + void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } + + // Adds a test property to the list. The property is validated and may add + // a non-fatal failure if invalid (e.g., if it conflicts with reserved + // key names). If a property is already recorded for the same key, the + // value will be updated, rather than storing multiple values for the same + // key. xml_element specifies the element for which the property is being + // recorded and is used for validation. + void RecordProperty(const std::string& xml_element, + const TestProperty& test_property); + + // Adds a failure if the key is a reserved attribute of Google Test + // testsuite tags. Returns true if the property is valid. + // FIXME: Validate attribute names are legal and human readable. + static bool ValidateTestProperty(const std::string& xml_element, + const TestProperty& test_property); + + // Adds a test part result to the list. + void AddTestPartResult(const TestPartResult& test_part_result); + + // Returns the death test count. + int death_test_count() const { return death_test_count_; } + + // Increments the death test count, returning the new count. + int increment_death_test_count() { return ++death_test_count_; } + + // Clears the test part results. + void ClearTestPartResults(); + + // Clears the object. + void Clear(); + + // Protects mutable state of the property vector and of owned + // properties, whose values may be updated. + internal::Mutex test_properties_mutex_; + + // The vector of TestPartResults + std::vector test_part_results_; + // The vector of TestProperties + std::vector test_properties_; + // Running count of death tests. + int death_test_count_; + // The start time, in milliseconds since UNIX Epoch. + TimeInMillis start_timestamp_; + // The elapsed time, in milliseconds. + TimeInMillis elapsed_time_; + + // We disallow copying TestResult. + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult); +}; // class TestResult + +// A TestInfo object stores the following information about a test: +// +// Test suite name +// Test name +// Whether the test should be run +// A function pointer that creates the test object when invoked +// Test result +// +// The constructor of TestInfo registers itself with the UnitTest +// singleton such that the RUN_ALL_TESTS() macro knows which tests to +// run. +class GTEST_API_ TestInfo { + public: + // Destructs a TestInfo object. This function is not virtual, so + // don't inherit from TestInfo. + ~TestInfo(); + + // Returns the test suite name. + const char* test_suite_name() const { return test_suite_name_.c_str(); } + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + const char* test_case_name() const { return test_suite_name(); } +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Returns the test name. + const char* name() const { return name_.c_str(); } + + // Returns the name of the parameter type, or NULL if this is not a typed + // or a type-parameterized test. + const char* type_param() const { + if (type_param_.get() != nullptr) return type_param_->c_str(); + return nullptr; + } + + // Returns the text representation of the value parameter, or NULL if this + // is not a value-parameterized test. + const char* value_param() const { + if (value_param_.get() != nullptr) return value_param_->c_str(); + return nullptr; + } + + // Returns the file name where this test is defined. + const char* file() const { return location_.file.c_str(); } + + // Returns the line where this test is defined. + int line() const { return location_.line; } + + // Return true if this test should not be run because it's in another shard. + bool is_in_another_shard() const { return is_in_another_shard_; } + + // Returns true if this test should run, that is if the test is not + // disabled (or it is disabled but the also_run_disabled_tests flag has + // been specified) and its full name matches the user-specified filter. + // + // Google Test allows the user to filter the tests by their full names. + // The full name of a test Bar in test suite Foo is defined as + // "Foo.Bar". Only the tests that match the filter will run. + // + // A filter is a colon-separated list of glob (not regex) patterns, + // optionally followed by a '-' and a colon-separated list of + // negative patterns (tests to exclude). A test is run if it + // matches one of the positive patterns and does not match any of + // the negative patterns. + // + // For example, *A*:Foo.* is a filter that matches any string that + // contains the character 'A' or starts with "Foo.". + bool should_run() const { return should_run_; } + + // Returns true if and only if this test will appear in the XML report. + bool is_reportable() const { + // The XML report includes tests matching the filter, excluding those + // run in other shards. + return matches_filter_ && !is_in_another_shard_; + } + + // Returns the result of the test. + const TestResult* result() const { return &result_; } + + private: +#if GTEST_HAS_DEATH_TEST + friend class internal::DefaultDeathTestFactory; +#endif // GTEST_HAS_DEATH_TEST + friend class Test; + friend class TestSuite; + friend class internal::UnitTestImpl; + friend class internal::StreamingListenerTest; + friend TestInfo* internal::MakeAndRegisterTestInfo( + const char* test_suite_name, const char* name, const char* type_param, + const char* value_param, internal::CodeLocation code_location, + internal::TypeId fixture_class_id, internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc, + internal::TestFactoryBase* factory); + + // Constructs a TestInfo object. The newly constructed instance assumes + // ownership of the factory object. + TestInfo(const std::string& test_suite_name, const std::string& name, + const char* a_type_param, // NULL if not a type-parameterized test + const char* a_value_param, // NULL if not a value-parameterized test + internal::CodeLocation a_code_location, + internal::TypeId fixture_class_id, + internal::TestFactoryBase* factory); + + // Increments the number of death tests encountered in this test so + // far. + int increment_death_test_count() { + return result_.increment_death_test_count(); + } + + // Creates the test object, runs it, records its result, and then + // deletes it. + void Run(); + + // Skip and records the test result for this object. + void Skip(); + + static void ClearTestResult(TestInfo* test_info) { + test_info->result_.Clear(); + } + + // These fields are immutable properties of the test. + const std::string test_suite_name_; // test suite name + const std::string name_; // Test name + // Name of the parameter type, or NULL if this is not a typed or a + // type-parameterized test. + const std::unique_ptr type_param_; + // Text representation of the value parameter, or NULL if this is not a + // value-parameterized test. + const std::unique_ptr value_param_; + internal::CodeLocation location_; + const internal::TypeId fixture_class_id_; // ID of the test fixture class + bool should_run_; // True if and only if this test should run + bool is_disabled_; // True if and only if this test is disabled + bool matches_filter_; // True if this test matches the + // user-specified filter. + bool is_in_another_shard_; // Will be run in another shard. + internal::TestFactoryBase* const factory_; // The factory that creates + // the test object + + // This field is mutable and needs to be reset before running the + // test for the second time. + TestResult result_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo); +}; + +// A test suite, which consists of a vector of TestInfos. +// +// TestSuite is not copyable. +class GTEST_API_ TestSuite { + public: + // Creates a TestSuite with the given name. + // + // TestSuite does NOT have a default constructor. Always use this + // constructor to create a TestSuite object. + // + // Arguments: + // + // name: name of the test suite + // a_type_param: the name of the test's type parameter, or NULL if + // this is not a type-parameterized test. + // set_up_tc: pointer to the function that sets up the test suite + // tear_down_tc: pointer to the function that tears down the test suite + TestSuite(const char* name, const char* a_type_param, + internal::SetUpTestSuiteFunc set_up_tc, + internal::TearDownTestSuiteFunc tear_down_tc); + + // Destructor of TestSuite. + virtual ~TestSuite(); + + // Gets the name of the TestSuite. + const char* name() const { return name_.c_str(); } + + // Returns the name of the parameter type, or NULL if this is not a + // type-parameterized test suite. + const char* type_param() const { + if (type_param_.get() != nullptr) return type_param_->c_str(); + return nullptr; + } + + // Returns true if any test in this test suite should run. + bool should_run() const { return should_run_; } + + // Gets the number of successful tests in this test suite. + int successful_test_count() const; + + // Gets the number of skipped tests in this test suite. + int skipped_test_count() const; + + // Gets the number of failed tests in this test suite. + int failed_test_count() const; + + // Gets the number of disabled tests that will be reported in the XML report. + int reportable_disabled_test_count() const; + + // Gets the number of disabled tests in this test suite. + int disabled_test_count() const; + + // Gets the number of tests to be printed in the XML report. + int reportable_test_count() const; + + // Get the number of tests in this test suite that should run. + int test_to_run_count() const; + + // Gets the number of all tests in this test suite. + int total_test_count() const; + + // Returns true if and only if the test suite passed. + bool Passed() const { return !Failed(); } + + // Returns true if and only if the test suite failed. + bool Failed() const { + return failed_test_count() > 0 || ad_hoc_test_result().Failed(); + } + + // Returns the elapsed time, in milliseconds. + TimeInMillis elapsed_time() const { return elapsed_time_; } + + // Gets the time of the test suite start, in ms from the start of the + // UNIX epoch. + TimeInMillis start_timestamp() const { return start_timestamp_; } + + // Returns the i-th test among all the tests. i can range from 0 to + // total_test_count() - 1. If i is not in that range, returns NULL. + const TestInfo* GetTestInfo(int i) const; + + // Returns the TestResult that holds test properties recorded during + // execution of SetUpTestSuite and TearDownTestSuite. + const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; } + + private: + friend class Test; + friend class internal::UnitTestImpl; + + // Gets the (mutable) vector of TestInfos in this TestSuite. + std::vector& test_info_list() { return test_info_list_; } + + // Gets the (immutable) vector of TestInfos in this TestSuite. + const std::vector& test_info_list() const { + return test_info_list_; + } + + // Returns the i-th test among all the tests. i can range from 0 to + // total_test_count() - 1. If i is not in that range, returns NULL. + TestInfo* GetMutableTestInfo(int i); + + // Sets the should_run member. + void set_should_run(bool should) { should_run_ = should; } + + // Adds a TestInfo to this test suite. Will delete the TestInfo upon + // destruction of the TestSuite object. + void AddTestInfo(TestInfo * test_info); + + // Clears the results of all tests in this test suite. + void ClearResult(); + + // Clears the results of all tests in the given test suite. + static void ClearTestSuiteResult(TestSuite* test_suite) { + test_suite->ClearResult(); + } + + // Runs every test in this TestSuite. + void Run(); + + // Skips the execution of tests under this TestSuite + void Skip(); + + // Runs SetUpTestSuite() for this TestSuite. This wrapper is needed + // for catching exceptions thrown from SetUpTestSuite(). + void RunSetUpTestSuite() { + if (set_up_tc_ != nullptr) { + (*set_up_tc_)(); + } + } + + // Runs TearDownTestSuite() for this TestSuite. This wrapper is + // needed for catching exceptions thrown from TearDownTestSuite(). + void RunTearDownTestSuite() { + if (tear_down_tc_ != nullptr) { + (*tear_down_tc_)(); + } + } + + // Returns true if and only if test passed. + static bool TestPassed(const TestInfo* test_info) { + return test_info->should_run() && test_info->result()->Passed(); + } + + // Returns true if and only if test skipped. + static bool TestSkipped(const TestInfo* test_info) { + return test_info->should_run() && test_info->result()->Skipped(); + } + + // Returns true if and only if test failed. + static bool TestFailed(const TestInfo* test_info) { + return test_info->should_run() && test_info->result()->Failed(); + } + + // Returns true if and only if the test is disabled and will be reported in + // the XML report. + static bool TestReportableDisabled(const TestInfo* test_info) { + return test_info->is_reportable() && test_info->is_disabled_; + } + + // Returns true if and only if test is disabled. + static bool TestDisabled(const TestInfo* test_info) { + return test_info->is_disabled_; + } + + // Returns true if and only if this test will appear in the XML report. + static bool TestReportable(const TestInfo* test_info) { + return test_info->is_reportable(); + } + + // Returns true if the given test should run. + static bool ShouldRunTest(const TestInfo* test_info) { + return test_info->should_run(); + } + + // Shuffles the tests in this test suite. + void ShuffleTests(internal::Random* random); + + // Restores the test order to before the first shuffle. + void UnshuffleTests(); + + // Name of the test suite. + std::string name_; + // Name of the parameter type, or NULL if this is not a typed or a + // type-parameterized test. + const std::unique_ptr type_param_; + // The vector of TestInfos in their original order. It owns the + // elements in the vector. + std::vector test_info_list_; + // Provides a level of indirection for the test list to allow easy + // shuffling and restoring the test order. The i-th element in this + // vector is the index of the i-th test in the shuffled test list. + std::vector test_indices_; + // Pointer to the function that sets up the test suite. + internal::SetUpTestSuiteFunc set_up_tc_; + // Pointer to the function that tears down the test suite. + internal::TearDownTestSuiteFunc tear_down_tc_; + // True if and only if any test in this test suite should run. + bool should_run_; + // The start time, in milliseconds since UNIX Epoch. + TimeInMillis start_timestamp_; + // Elapsed time, in milliseconds. + TimeInMillis elapsed_time_; + // Holds test properties recorded during execution of SetUpTestSuite and + // TearDownTestSuite. + TestResult ad_hoc_test_result_; + + // We disallow copying TestSuites. + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestSuite); +}; + +// An Environment object is capable of setting up and tearing down an +// environment. You should subclass this to define your own +// environment(s). +// +// An Environment object does the set-up and tear-down in virtual +// methods SetUp() and TearDown() instead of the constructor and the +// destructor, as: +// +// 1. You cannot safely throw from a destructor. This is a problem +// as in some cases Google Test is used where exceptions are enabled, and +// we may want to implement ASSERT_* using exceptions where they are +// available. +// 2. You cannot use ASSERT_* directly in a constructor or +// destructor. +class Environment { + public: + // The d'tor is virtual as we need to subclass Environment. + virtual ~Environment() {} + + // Override this to define how to set up the environment. + virtual void SetUp() {} + + // Override this to define how to tear down the environment. + virtual void TearDown() {} + private: + // If you see an error about overriding the following function or + // about it being private, you have mis-spelled SetUp() as Setup(). + struct Setup_should_be_spelled_SetUp {}; + virtual Setup_should_be_spelled_SetUp* Setup() { return nullptr; } +}; + +#if GTEST_HAS_EXCEPTIONS + +// Exception which can be thrown from TestEventListener::OnTestPartResult. +class GTEST_API_ AssertionException + : public internal::GoogleTestFailureException { + public: + explicit AssertionException(const TestPartResult& result) + : GoogleTestFailureException(result) {} +}; + +#endif // GTEST_HAS_EXCEPTIONS + +// The interface for tracing execution of tests. The methods are organized in +// the order the corresponding events are fired. +class TestEventListener { + public: + virtual ~TestEventListener() {} + + // Fired before any test activity starts. + virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; + + // Fired before each iteration of tests starts. There may be more than + // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration + // index, starting from 0. + virtual void OnTestIterationStart(const UnitTest& unit_test, + int iteration) = 0; + + // Fired before environment set-up for each iteration of tests starts. + virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0; + + // Fired after environment set-up for each iteration of tests ends. + virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; + + // Fired before the test suite starts. + virtual void OnTestSuiteStart(const TestSuite& /*test_suite*/) {} + + // Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Fired before the test starts. + virtual void OnTestStart(const TestInfo& test_info) = 0; + + // Fired after a failed assertion or a SUCCEED() invocation. + // If you want to throw an exception from this function to skip to the next + // TEST, it must be AssertionException defined above, or inherited from it. + virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; + + // Fired after the test ends. + virtual void OnTestEnd(const TestInfo& test_info) = 0; + + // Fired after the test suite ends. + virtual void OnTestSuiteEnd(const TestSuite& /*test_suite*/) {} + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Fired before environment tear-down for each iteration of tests starts. + virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0; + + // Fired after environment tear-down for each iteration of tests ends. + virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0; + + // Fired after each iteration of tests finishes. + virtual void OnTestIterationEnd(const UnitTest& unit_test, + int iteration) = 0; + + // Fired after all test activities have ended. + virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; +}; + +// The convenience class for users who need to override just one or two +// methods and are not concerned that a possible change to a signature of +// the methods they override will not be caught during the build. For +// comments about each method please see the definition of TestEventListener +// above. +class EmptyTestEventListener : public TestEventListener { + public: + void OnTestProgramStart(const UnitTest& /*unit_test*/) override {} + void OnTestIterationStart(const UnitTest& /*unit_test*/, + int /*iteration*/) override {} + void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {} + void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {} + void OnTestSuiteStart(const TestSuite& /*test_suite*/) override {} +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + void OnTestCaseStart(const TestCase& /*test_case*/) override {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + void OnTestStart(const TestInfo& /*test_info*/) override {} + void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {} + void OnTestEnd(const TestInfo& /*test_info*/) override {} + void OnTestSuiteEnd(const TestSuite& /*test_suite*/) override {} +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + void OnTestCaseEnd(const TestCase& /*test_case*/) override {} +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {} + void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {} + void OnTestIterationEnd(const UnitTest& /*unit_test*/, + int /*iteration*/) override {} + void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {} +}; + +// TestEventListeners lets users add listeners to track events in Google Test. +class GTEST_API_ TestEventListeners { + public: + TestEventListeners(); + ~TestEventListeners(); + + // Appends an event listener to the end of the list. Google Test assumes + // the ownership of the listener (i.e. it will delete the listener when + // the test program finishes). + void Append(TestEventListener* listener); + + // Removes the given event listener from the list and returns it. It then + // becomes the caller's responsibility to delete the listener. Returns + // NULL if the listener is not found in the list. + TestEventListener* Release(TestEventListener* listener); + + // Returns the standard listener responsible for the default console + // output. Can be removed from the listeners list to shut down default + // console output. Note that removing this object from the listener list + // with Release transfers its ownership to the caller and makes this + // function return NULL the next time. + TestEventListener* default_result_printer() const { + return default_result_printer_; + } + + // Returns the standard listener responsible for the default XML output + // controlled by the --gtest_output=xml flag. Can be removed from the + // listeners list by users who want to shut down the default XML output + // controlled by this flag and substitute it with custom one. Note that + // removing this object from the listener list with Release transfers its + // ownership to the caller and makes this function return NULL the next + // time. + TestEventListener* default_xml_generator() const { + return default_xml_generator_; + } + + private: + friend class TestSuite; + friend class TestInfo; + friend class internal::DefaultGlobalTestPartResultReporter; + friend class internal::NoExecDeathTest; + friend class internal::TestEventListenersAccessor; + friend class internal::UnitTestImpl; + + // Returns repeater that broadcasts the TestEventListener events to all + // subscribers. + TestEventListener* repeater(); + + // Sets the default_result_printer attribute to the provided listener. + // The listener is also added to the listener list and previous + // default_result_printer is removed from it and deleted. The listener can + // also be NULL in which case it will not be added to the list. Does + // nothing if the previous and the current listener objects are the same. + void SetDefaultResultPrinter(TestEventListener* listener); + + // Sets the default_xml_generator attribute to the provided listener. The + // listener is also added to the listener list and previous + // default_xml_generator is removed from it and deleted. The listener can + // also be NULL in which case it will not be added to the list. Does + // nothing if the previous and the current listener objects are the same. + void SetDefaultXmlGenerator(TestEventListener* listener); + + // Controls whether events will be forwarded by the repeater to the + // listeners in the list. + bool EventForwardingEnabled() const; + void SuppressEventForwarding(); + + // The actual list of listeners. + internal::TestEventRepeater* repeater_; + // Listener responsible for the standard result output. + TestEventListener* default_result_printer_; + // Listener responsible for the creation of the XML output file. + TestEventListener* default_xml_generator_; + + // We disallow copying TestEventListeners. + GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners); +}; + +// A UnitTest consists of a vector of TestSuites. +// +// This is a singleton class. The only instance of UnitTest is +// created when UnitTest::GetInstance() is first called. This +// instance is never deleted. +// +// UnitTest is not copyable. +// +// This class is thread-safe as long as the methods are called +// according to their specification. +class GTEST_API_ UnitTest { + public: + // Gets the singleton UnitTest object. The first time this method + // is called, a UnitTest object is constructed and returned. + // Consecutive calls will return the same object. + static UnitTest* GetInstance(); + + // Runs all tests in this UnitTest object and prints the result. + // Returns 0 if successful, or 1 otherwise. + // + // This method can only be called from the main thread. + // + // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + int Run() GTEST_MUST_USE_RESULT_; + + // Returns the working directory when the first TEST() or TEST_F() + // was executed. The UnitTest object owns the string. + const char* original_working_dir() const; + + // Returns the TestSuite object for the test that's currently running, + // or NULL if no test is running. + const TestSuite* current_test_suite() const GTEST_LOCK_EXCLUDED_(mutex_); + +// Legacy API is still available but deprecated +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + const TestCase* current_test_case() const GTEST_LOCK_EXCLUDED_(mutex_); +#endif + + // Returns the TestInfo object for the test that's currently running, + // or NULL if no test is running. + const TestInfo* current_test_info() const + GTEST_LOCK_EXCLUDED_(mutex_); + + // Returns the random seed used at the start of the current test run. + int random_seed() const; + + // Returns the ParameterizedTestSuiteRegistry object used to keep track of + // value-parameterized tests and instantiate and register them. + // + // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + internal::ParameterizedTestSuiteRegistry& parameterized_test_registry() + GTEST_LOCK_EXCLUDED_(mutex_); + + // Gets the number of successful test suites. + int successful_test_suite_count() const; + + // Gets the number of failed test suites. + int failed_test_suite_count() const; + + // Gets the number of all test suites. + int total_test_suite_count() const; + + // Gets the number of all test suites that contain at least one test + // that should run. + int test_suite_to_run_count() const; + + // Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + int successful_test_case_count() const; + int failed_test_case_count() const; + int total_test_case_count() const; + int test_case_to_run_count() const; +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Gets the number of successful tests. + int successful_test_count() const; + + // Gets the number of skipped tests. + int skipped_test_count() const; + + // Gets the number of failed tests. + int failed_test_count() const; + + // Gets the number of disabled tests that will be reported in the XML report. + int reportable_disabled_test_count() const; + + // Gets the number of disabled tests. + int disabled_test_count() const; + + // Gets the number of tests to be printed in the XML report. + int reportable_test_count() const; + + // Gets the number of all tests. + int total_test_count() const; + + // Gets the number of tests that should run. + int test_to_run_count() const; + + // Gets the time of the test program start, in ms from the start of the + // UNIX epoch. + TimeInMillis start_timestamp() const; + + // Gets the elapsed time, in milliseconds. + TimeInMillis elapsed_time() const; + + // Returns true if and only if the unit test passed (i.e. all test suites + // passed). + bool Passed() const; + + // Returns true if and only if the unit test failed (i.e. some test suite + // failed or something outside of all tests failed). + bool Failed() const; + + // Gets the i-th test suite among all the test suites. i can range from 0 to + // total_test_suite_count() - 1. If i is not in that range, returns NULL. + const TestSuite* GetTestSuite(int i) const; + +// Legacy API is deprecated but still available +#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + const TestCase* GetTestCase(int i) const; +#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_ + + // Returns the TestResult containing information on test failures and + // properties logged outside of individual test suites. + const TestResult& ad_hoc_test_result() const; + + // Returns the list of event listeners that can be used to track events + // inside Google Test. + TestEventListeners& listeners(); + + private: + // Registers and returns a global test environment. When a test + // program is run, all global test environments will be set-up in + // the order they were registered. After all tests in the program + // have finished, all global test environments will be torn-down in + // the *reverse* order they were registered. + // + // The UnitTest object takes ownership of the given environment. + // + // This method can only be called from the main thread. + Environment* AddEnvironment(Environment* env); + + // Adds a TestPartResult to the current TestResult object. All + // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) + // eventually call this to report their results. The user code + // should use the assertion macros instead of calling this directly. + void AddTestPartResult(TestPartResult::Type result_type, + const char* file_name, + int line_number, + const std::string& message, + const std::string& os_stack_trace) + GTEST_LOCK_EXCLUDED_(mutex_); + + // Adds a TestProperty to the current TestResult object when invoked from + // inside a test, to current TestSuite's ad_hoc_test_result_ when invoked + // from SetUpTestSuite or TearDownTestSuite, or to the global property set + // when invoked elsewhere. If the result already contains a property with + // the same key, the value will be updated. + void RecordProperty(const std::string& key, const std::string& value); + + // Gets the i-th test suite among all the test suites. i can range from 0 to + // total_test_suite_count() - 1. If i is not in that range, returns NULL. + TestSuite* GetMutableTestSuite(int i); + + // Accessors for the implementation object. + internal::UnitTestImpl* impl() { return impl_; } + const internal::UnitTestImpl* impl() const { return impl_; } + + // These classes and functions are friends as they need to access private + // members of UnitTest. + friend class ScopedTrace; + friend class Test; + friend class internal::AssertHelper; + friend class internal::StreamingListenerTest; + friend class internal::UnitTestRecordPropertyTestHelper; + friend Environment* AddGlobalTestEnvironment(Environment* env); + friend std::set* internal::GetIgnoredParameterizedTestSuites(); + friend internal::UnitTestImpl* internal::GetUnitTestImpl(); + friend void internal::ReportFailureInUnknownLocation( + TestPartResult::Type result_type, + const std::string& message); + + // Creates an empty UnitTest. + UnitTest(); + + // D'tor + virtual ~UnitTest(); + + // Pushes a trace defined by SCOPED_TRACE() on to the per-thread + // Google Test trace stack. + void PushGTestTrace(const internal::TraceInfo& trace) + GTEST_LOCK_EXCLUDED_(mutex_); + + // Pops a trace from the per-thread Google Test trace stack. + void PopGTestTrace() + GTEST_LOCK_EXCLUDED_(mutex_); + + // Protects mutable state in *impl_. This is mutable as some const + // methods need to lock it too. + mutable internal::Mutex mutex_; + + // Opaque implementation object. This field is never changed once + // the object is constructed. We don't mark it as const here, as + // doing so will cause a warning in the constructor of UnitTest. + // Mutable state in *impl_ is protected by mutex_. + internal::UnitTestImpl* impl_; + + // We disallow copying UnitTest. + GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest); +}; + +// A convenient wrapper for adding an environment for the test +// program. +// +// You should call this before RUN_ALL_TESTS() is called, probably in +// main(). If you use gtest_main, you need to call this before main() +// starts for it to take effect. For example, you can define a global +// variable like this: +// +// testing::Environment* const foo_env = +// testing::AddGlobalTestEnvironment(new FooEnvironment); +// +// However, we strongly recommend you to write your own main() and +// call AddGlobalTestEnvironment() there, as relying on initialization +// of global variables makes the code harder to read and may cause +// problems when you register multiple environments from different +// translation units and the environments have dependencies among them +// (remember that the compiler doesn't guarantee the order in which +// global variables from different translation units are initialized). +inline Environment* AddGlobalTestEnvironment(Environment* env) { + return UnitTest::GetInstance()->AddEnvironment(env); +} + +// Initializes Google Test. This must be called before calling +// RUN_ALL_TESTS(). In particular, it parses a command line for the +// flags that Google Test recognizes. Whenever a Google Test flag is +// seen, it is removed from argv, and *argc is decremented. +// +// No value is returned. Instead, the Google Test flag variables are +// updated. +// +// Calling the function for the second time has no user-visible effect. +GTEST_API_ void InitGoogleTest(int* argc, char** argv); + +// This overloaded version can be used in Windows programs compiled in +// UNICODE mode. +GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv); + +// This overloaded version can be used on Arduino/embedded platforms where +// there is no argc/argv. +GTEST_API_ void InitGoogleTest(); + +namespace internal { + +// Separate the error generating code from the code path to reduce the stack +// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers +// when calling EXPECT_* in a tight loop. +template +AssertionResult CmpHelperEQFailure(const char* lhs_expression, + const char* rhs_expression, + const T1& lhs, const T2& rhs) { + return EqFailure(lhs_expression, + rhs_expression, + FormatForComparisonFailureMessage(lhs, rhs), + FormatForComparisonFailureMessage(rhs, lhs), + false); +} + +// This block of code defines operator==/!= +// to block lexical scope lookup. +// It prevents using invalid operator==/!= defined at namespace scope. +struct faketype {}; +inline bool operator==(faketype, faketype) { return true; } +inline bool operator!=(faketype, faketype) { return false; } + +// The helper function for {ASSERT|EXPECT}_EQ. +template +AssertionResult CmpHelperEQ(const char* lhs_expression, + const char* rhs_expression, + const T1& lhs, + const T2& rhs) { + if (lhs == rhs) { + return AssertionSuccess(); + } + + return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs); +} + +class EqHelper { + public: + // This templatized version is for the general case. + template < + typename T1, typename T2, + // Disable this overload for cases where one argument is a pointer + // and the other is the null pointer constant. + typename std::enable_if::value || + !std::is_pointer::value>::type* = nullptr> + static AssertionResult Compare(const char* lhs_expression, + const char* rhs_expression, const T1& lhs, + const T2& rhs) { + return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); + } + + // With this overloaded version, we allow anonymous enums to be used + // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous + // enums can be implicitly cast to BiggestInt. + // + // Even though its body looks the same as the above version, we + // cannot merge the two, as it will make anonymous enums unhappy. + static AssertionResult Compare(const char* lhs_expression, + const char* rhs_expression, + BiggestInt lhs, + BiggestInt rhs) { + return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs); + } + + template + static AssertionResult Compare( + const char* lhs_expression, const char* rhs_expression, + // Handle cases where '0' is used as a null pointer literal. + std::nullptr_t /* lhs */, T* rhs) { + // We already know that 'lhs' is a null pointer. + return CmpHelperEQ(lhs_expression, rhs_expression, static_cast(nullptr), + rhs); + } +}; + +// Separate the error generating code from the code path to reduce the stack +// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers +// when calling EXPECT_OP in a tight loop. +template +AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2, + const T1& val1, const T2& val2, + const char* op) { + return AssertionFailure() + << "Expected: (" << expr1 << ") " << op << " (" << expr2 + << "), actual: " << FormatForComparisonFailureMessage(val1, val2) + << " vs " << FormatForComparisonFailureMessage(val2, val1); +} + +// A macro for implementing the helper functions needed to implement +// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste +// of similar code. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + +#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ +template \ +AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ + const T1& val1, const T2& val2) {\ + if (val1 op val2) {\ + return AssertionSuccess();\ + } else {\ + return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ + }\ +} + +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. + +// Implements the helper function for {ASSERT|EXPECT}_NE +GTEST_IMPL_CMP_HELPER_(NE, !=) +// Implements the helper function for {ASSERT|EXPECT}_LE +GTEST_IMPL_CMP_HELPER_(LE, <=) +// Implements the helper function for {ASSERT|EXPECT}_LT +GTEST_IMPL_CMP_HELPER_(LT, <) +// Implements the helper function for {ASSERT|EXPECT}_GE +GTEST_IMPL_CMP_HELPER_(GE, >=) +// Implements the helper function for {ASSERT|EXPECT}_GT +GTEST_IMPL_CMP_HELPER_(GT, >) + +#undef GTEST_IMPL_CMP_HELPER_ + +// The helper function for {ASSERT|EXPECT}_STREQ. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, + const char* s2_expression, + const char* s1, + const char* s2); + +// The helper function for {ASSERT|EXPECT}_STRCASEEQ. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression, + const char* s2_expression, + const char* s1, + const char* s2); + +// The helper function for {ASSERT|EXPECT}_STRNE. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, + const char* s2_expression, + const char* s1, + const char* s2); + +// The helper function for {ASSERT|EXPECT}_STRCASENE. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, + const char* s2_expression, + const char* s1, + const char* s2); + + +// Helper function for *_STREQ on wide strings. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression, + const char* s2_expression, + const wchar_t* s1, + const wchar_t* s2); + +// Helper function for *_STRNE on wide strings. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, + const char* s2_expression, + const wchar_t* s1, + const wchar_t* s2); + +} // namespace internal + +// IsSubstring() and IsNotSubstring() are intended to be used as the +// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by +// themselves. They check whether needle is a substring of haystack +// (NULL is considered a substring of itself only), and return an +// appropriate error message when they fail. +// +// The {needle,haystack}_expr arguments are the stringified +// expressions that generated the two real arguments. +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const char* needle, const char* haystack); +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const wchar_t* needle, const wchar_t* haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const char* needle, const char* haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const wchar_t* needle, const wchar_t* haystack); +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::string& needle, const ::std::string& haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::string& needle, const ::std::string& haystack); + +#if GTEST_HAS_STD_WSTRING +GTEST_API_ AssertionResult IsSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::wstring& needle, const ::std::wstring& haystack); +GTEST_API_ AssertionResult IsNotSubstring( + const char* needle_expr, const char* haystack_expr, + const ::std::wstring& needle, const ::std::wstring& haystack); +#endif // GTEST_HAS_STD_WSTRING + +namespace internal { + +// Helper template function for comparing floating-points. +// +// Template parameter: +// +// RawType: the raw floating-point type (either float or double) +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +template +AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression, + const char* rhs_expression, + RawType lhs_value, + RawType rhs_value) { + const FloatingPoint lhs(lhs_value), rhs(rhs_value); + + if (lhs.AlmostEquals(rhs)) { + return AssertionSuccess(); + } + + ::std::stringstream lhs_ss; + lhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) + << lhs_value; + + ::std::stringstream rhs_ss; + rhs_ss << std::setprecision(std::numeric_limits::digits10 + 2) + << rhs_value; + + return EqFailure(lhs_expression, + rhs_expression, + StringStreamToString(&lhs_ss), + StringStreamToString(&rhs_ss), + false); +} + +// Helper function for implementing ASSERT_NEAR. +// +// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. +GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, + const char* expr2, + const char* abs_error_expr, + double val1, + double val2, + double abs_error); + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// A class that enables one to stream messages to assertion macros +class GTEST_API_ AssertHelper { + public: + // Constructor. + AssertHelper(TestPartResult::Type type, + const char* file, + int line, + const char* message); + ~AssertHelper(); + + // Message assignment is a semantic trick to enable assertion + // streaming; see the GTEST_MESSAGE_ macro below. + void operator=(const Message& message) const; + + private: + // We put our data in a struct so that the size of the AssertHelper class can + // be as small as possible. This is important because gcc is incapable of + // re-using stack space even for temporary variables, so every EXPECT_EQ + // reserves stack space for another AssertHelper. + struct AssertHelperData { + AssertHelperData(TestPartResult::Type t, + const char* srcfile, + int line_num, + const char* msg) + : type(t), file(srcfile), line(line_num), message(msg) { } + + TestPartResult::Type const type; + const char* const file; + int const line; + std::string const message; + + private: + GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); + }; + + AssertHelperData* const data_; + + GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); +}; + +} // namespace internal + +// The pure interface class that all value-parameterized tests inherit from. +// A value-parameterized class must inherit from both ::testing::Test and +// ::testing::WithParamInterface. In most cases that just means inheriting +// from ::testing::TestWithParam, but more complicated test hierarchies +// may need to inherit from Test and WithParamInterface at different levels. +// +// This interface has support for accessing the test parameter value via +// the GetParam() method. +// +// Use it with one of the parameter generator defining functions, like Range(), +// Values(), ValuesIn(), Bool(), and Combine(). +// +// class FooTest : public ::testing::TestWithParam { +// protected: +// FooTest() { +// // Can use GetParam() here. +// } +// ~FooTest() override { +// // Can use GetParam() here. +// } +// void SetUp() override { +// // Can use GetParam() here. +// } +// void TearDown override { +// // Can use GetParam() here. +// } +// }; +// TEST_P(FooTest, DoesBar) { +// // Can use GetParam() method here. +// Foo foo; +// ASSERT_TRUE(foo.DoesBar(GetParam())); +// } +// INSTANTIATE_TEST_SUITE_P(OneToTenRange, FooTest, ::testing::Range(1, 10)); + +template +class WithParamInterface { + public: + typedef T ParamType; + virtual ~WithParamInterface() {} + + // The current parameter value. Is also available in the test fixture's + // constructor. + static const ParamType& GetParam() { + GTEST_CHECK_(parameter_ != nullptr) + << "GetParam() can only be called inside a value-parameterized test " + << "-- did you intend to write TEST_P instead of TEST_F?"; + return *parameter_; + } + + private: + // Sets parameter value. The caller is responsible for making sure the value + // remains alive and unchanged throughout the current test. + static void SetParam(const ParamType* parameter) { + parameter_ = parameter; + } + + // Static value used for accessing parameter during a test lifetime. + static const ParamType* parameter_; + + // TestClass must be a subclass of WithParamInterface and Test. + template friend class internal::ParameterizedTestFactory; +}; + +template +const T* WithParamInterface::parameter_ = nullptr; + +// Most value-parameterized classes can ignore the existence of +// WithParamInterface, and can just inherit from ::testing::TestWithParam. + +template +class TestWithParam : public Test, public WithParamInterface { +}; + +// Macros for indicating success/failure in test code. + +// Skips test in runtime. +// Skipping test aborts current function. +// Skipped tests are neither successful nor failed. +#define GTEST_SKIP() GTEST_SKIP_("") + +// ADD_FAILURE unconditionally adds a failure to the current test. +// SUCCEED generates a success - it doesn't automatically make the +// current test successful, as a test is only successful when it has +// no failure. +// +// EXPECT_* verifies that a certain condition is satisfied. If not, +// it behaves like ADD_FAILURE. In particular: +// +// EXPECT_TRUE verifies that a Boolean condition is true. +// EXPECT_FALSE verifies that a Boolean condition is false. +// +// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except +// that they will also abort the current function on failure. People +// usually want the fail-fast behavior of FAIL and ASSERT_*, but those +// writing data-driven tests often find themselves using ADD_FAILURE +// and EXPECT_* more. + +// Generates a nonfatal failure with a generic message. +#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") + +// Generates a nonfatal failure at the given source file location with +// a generic message. +#define ADD_FAILURE_AT(file, line) \ + GTEST_MESSAGE_AT_(file, line, "Failed", \ + ::testing::TestPartResult::kNonFatalFailure) + +// Generates a fatal failure with a generic message. +#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") + +// Like GTEST_FAIL(), but at the given source file location. +#define GTEST_FAIL_AT(file, line) \ + GTEST_MESSAGE_AT_(file, line, "Failed", \ + ::testing::TestPartResult::kFatalFailure) + +// Define this macro to 1 to omit the definition of FAIL(), which is a +// generic name and clashes with some other libraries. +#if !GTEST_DONT_DEFINE_FAIL +# define FAIL() GTEST_FAIL() +#endif + +// Generates a success with a generic message. +#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") + +// Define this macro to 1 to omit the definition of SUCCEED(), which +// is a generic name and clashes with some other libraries. +#if !GTEST_DONT_DEFINE_SUCCEED +# define SUCCEED() GTEST_SUCCEED() +#endif + +// Macros for testing exceptions. +// +// * {ASSERT|EXPECT}_THROW(statement, expected_exception): +// Tests that the statement throws the expected exception. +// * {ASSERT|EXPECT}_NO_THROW(statement): +// Tests that the statement doesn't throw any exception. +// * {ASSERT|EXPECT}_ANY_THROW(statement): +// Tests that the statement throws an exception. + +#define EXPECT_THROW(statement, expected_exception) \ + GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) +#define EXPECT_NO_THROW(statement) \ + GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) +#define EXPECT_ANY_THROW(statement) \ + GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) +#define ASSERT_THROW(statement, expected_exception) \ + GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) +#define ASSERT_NO_THROW(statement) \ + GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) +#define ASSERT_ANY_THROW(statement) \ + GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) + +// Boolean assertions. Condition can be either a Boolean expression or an +// AssertionResult. For more information on how to use AssertionResult with +// these macros see comments on that class. +#define GTEST_EXPECT_TRUE(condition) \ + GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ + GTEST_NONFATAL_FAILURE_) +#define GTEST_EXPECT_FALSE(condition) \ + GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ + GTEST_NONFATAL_FAILURE_) +#define GTEST_ASSERT_TRUE(condition) \ + GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ + GTEST_FATAL_FAILURE_) +#define GTEST_ASSERT_FALSE(condition) \ + GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ + GTEST_FATAL_FAILURE_) + +// Define these macros to 1 to omit the definition of the corresponding +// EXPECT or ASSERT, which clashes with some users' own code. + +#if !GTEST_DONT_DEFINE_EXPECT_TRUE +#define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition) +#endif + +#if !GTEST_DONT_DEFINE_EXPECT_FALSE +#define EXPECT_FALSE(condition) GTEST_EXPECT_FALSE(condition) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_TRUE +#define ASSERT_TRUE(condition) GTEST_ASSERT_TRUE(condition) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_FALSE +#define ASSERT_FALSE(condition) GTEST_ASSERT_FALSE(condition) +#endif + +// Macros for testing equalities and inequalities. +// +// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2 +// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 +// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 +// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 +// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 +// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 +// +// When they are not, Google Test prints both the tested expressions and +// their actual values. The values must be compatible built-in types, +// or you will get a compiler error. By "compatible" we mean that the +// values can be compared by the respective operator. +// +// Note: +// +// 1. It is possible to make a user-defined type work with +// {ASSERT|EXPECT}_??(), but that requires overloading the +// comparison operators and is thus discouraged by the Google C++ +// Usage Guide. Therefore, you are advised to use the +// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are +// equal. +// +// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on +// pointers (in particular, C strings). Therefore, if you use it +// with two C strings, you are testing how their locations in memory +// are related, not how their content is related. To compare two C +// strings by content, use {ASSERT|EXPECT}_STR*(). +// +// 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to +// {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you +// what the actual value is when it fails, and similarly for the +// other comparisons. +// +// 4. Do not depend on the order in which {ASSERT|EXPECT}_??() +// evaluate their arguments, which is undefined. +// +// 5. These macros evaluate their arguments exactly once. +// +// Examples: +// +// EXPECT_NE(Foo(), 5); +// EXPECT_EQ(a_pointer, NULL); +// ASSERT_LT(i, array_size); +// ASSERT_GT(records.size(), 0) << "There is no record left."; + +#define EXPECT_EQ(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2) +#define EXPECT_NE(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) +#define EXPECT_LE(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) +#define EXPECT_LT(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) +#define EXPECT_GE(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) +#define EXPECT_GT(val1, val2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) + +#define GTEST_ASSERT_EQ(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2) +#define GTEST_ASSERT_NE(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) +#define GTEST_ASSERT_LE(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) +#define GTEST_ASSERT_LT(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) +#define GTEST_ASSERT_GE(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) +#define GTEST_ASSERT_GT(val1, val2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) + +// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of +// ASSERT_XY(), which clashes with some users' own code. + +#if !GTEST_DONT_DEFINE_ASSERT_EQ +# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_NE +# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_LE +# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_LT +# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_GE +# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) +#endif + +#if !GTEST_DONT_DEFINE_ASSERT_GT +# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) +#endif + +// C-string Comparisons. All tests treat NULL and any non-NULL string +// as different. Two NULLs are equal. +// +// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 +// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 +// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case +// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case +// +// For wide or narrow string objects, you can use the +// {ASSERT|EXPECT}_??() macros. +// +// Don't depend on the order in which the arguments are evaluated, +// which is undefined. +// +// These macros evaluate their arguments exactly once. + +#define EXPECT_STREQ(s1, s2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2) +#define EXPECT_STRNE(s1, s2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) +#define EXPECT_STRCASEEQ(s1, s2) \ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2) +#define EXPECT_STRCASENE(s1, s2)\ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) + +#define ASSERT_STREQ(s1, s2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2) +#define ASSERT_STRNE(s1, s2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) +#define ASSERT_STRCASEEQ(s1, s2) \ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2) +#define ASSERT_STRCASENE(s1, s2)\ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) + +// Macros for comparing floating-point numbers. +// +// * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2): +// Tests that two float values are almost equal. +// * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2): +// Tests that two double values are almost equal. +// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): +// Tests that v1 and v2 are within the given distance to each other. +// +// Google Test uses ULP-based comparison to automatically pick a default +// error bound that is appropriate for the operands. See the +// FloatingPoint template class in gtest-internal.h if you are +// interested in the implementation details. + +#define EXPECT_FLOAT_EQ(val1, val2)\ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + val1, val2) + +#define EXPECT_DOUBLE_EQ(val1, val2)\ + EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + val1, val2) + +#define ASSERT_FLOAT_EQ(val1, val2)\ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + val1, val2) + +#define ASSERT_DOUBLE_EQ(val1, val2)\ + ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ + val1, val2) + +#define EXPECT_NEAR(val1, val2, abs_error)\ + EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ + val1, val2, abs_error) + +#define ASSERT_NEAR(val1, val2, abs_error)\ + ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ + val1, val2, abs_error) + +// These predicate format functions work on floating-point values, and +// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. +// +// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); + +// Asserts that val1 is less than, or almost equal to, val2. Fails +// otherwise. In particular, it fails if either val1 or val2 is NaN. +GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2, + float val1, float val2); +GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2, + double val1, double val2); + + +#if GTEST_OS_WINDOWS + +// Macros that test for HRESULT failure and success, these are only useful +// on Windows, and rely on Windows SDK macros and APIs to compile. +// +// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) +// +// When expr unexpectedly fails or succeeds, Google Test prints the +// expected result and the actual result with both a human-readable +// string representation of the error, if available, as well as the +// hex result code. +# define EXPECT_HRESULT_SUCCEEDED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) + +# define ASSERT_HRESULT_SUCCEEDED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) + +# define EXPECT_HRESULT_FAILED(expr) \ + EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) + +# define ASSERT_HRESULT_FAILED(expr) \ + ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) + +#endif // GTEST_OS_WINDOWS + +// Macros that execute statement and check that it doesn't generate new fatal +// failures in the current thread. +// +// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); +// +// Examples: +// +// EXPECT_NO_FATAL_FAILURE(Process()); +// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed"; +// +#define ASSERT_NO_FATAL_FAILURE(statement) \ + GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) +#define EXPECT_NO_FATAL_FAILURE(statement) \ + GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) + +// Causes a trace (including the given source file path and line number, +// and the given message) to be included in every test failure message generated +// by code in the scope of the lifetime of an instance of this class. The effect +// is undone with the destruction of the instance. +// +// The message argument can be anything streamable to std::ostream. +// +// Example: +// testing::ScopedTrace trace("file.cc", 123, "message"); +// +class GTEST_API_ ScopedTrace { + public: + // The c'tor pushes the given source file location and message onto + // a trace stack maintained by Google Test. + + // Template version. Uses Message() to convert the values into strings. + // Slow, but flexible. + template + ScopedTrace(const char* file, int line, const T& message) { + PushTrace(file, line, (Message() << message).GetString()); + } + + // Optimize for some known types. + ScopedTrace(const char* file, int line, const char* message) { + PushTrace(file, line, message ? message : "(null)"); + } + + ScopedTrace(const char* file, int line, const std::string& message) { + PushTrace(file, line, message); + } + + // The d'tor pops the info pushed by the c'tor. + // + // Note that the d'tor is not virtual in order to be efficient. + // Don't inherit from ScopedTrace! + ~ScopedTrace(); + + private: + void PushTrace(const char* file, int line, std::string message); + + GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); +} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its + // c'tor and d'tor. Therefore it doesn't + // need to be used otherwise. + +// Causes a trace (including the source file path, the current line +// number, and the given message) to be included in every test failure +// message generated by code in the current scope. The effect is +// undone when the control leaves the current scope. +// +// The message argument can be anything streamable to std::ostream. +// +// In the implementation, we include the current line number as part +// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s +// to appear in the same block - as long as they are on different +// lines. +// +// Assuming that each thread maintains its own stack of traces. +// Therefore, a SCOPED_TRACE() would (correctly) only affect the +// assertions in its own thread. +#define SCOPED_TRACE(message) \ + ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ + __FILE__, __LINE__, (message)) + +// Compile-time assertion for type equality. +// StaticAssertTypeEq() compiles if and only if type1 and type2 +// are the same type. The value it returns is not interesting. +// +// Instead of making StaticAssertTypeEq a class template, we make it a +// function template that invokes a helper class template. This +// prevents a user from misusing StaticAssertTypeEq by +// defining objects of that type. +// +// CAVEAT: +// +// When used inside a method of a class template, +// StaticAssertTypeEq() is effective ONLY IF the method is +// instantiated. For example, given: +// +// template class Foo { +// public: +// void Bar() { testing::StaticAssertTypeEq(); } +// }; +// +// the code: +// +// void Test1() { Foo foo; } +// +// will NOT generate a compiler error, as Foo::Bar() is never +// actually instantiated. Instead, you need: +// +// void Test2() { Foo foo; foo.Bar(); } +// +// to cause a compiler error. +template +constexpr bool StaticAssertTypeEq() noexcept { + static_assert(std::is_same::value, "T1 and T2 are not the same type"); + return true; +} + +// Defines a test. +// +// The first parameter is the name of the test suite, and the second +// parameter is the name of the test within the test suite. +// +// The convention is to end the test suite name with "Test". For +// example, a test suite for the Foo class can be named FooTest. +// +// Test code should appear between braces after an invocation of +// this macro. Example: +// +// TEST(FooTest, InitializesCorrectly) { +// Foo foo; +// EXPECT_TRUE(foo.StatusIsOK()); +// } + +// Note that we call GetTestTypeId() instead of GetTypeId< +// ::testing::Test>() here to get the type ID of testing::Test. This +// is to work around a suspected linker bug when using Google Test as +// a framework on Mac OS X. The bug causes GetTypeId< +// ::testing::Test>() to return different values depending on whether +// the call is from the Google Test framework itself or from user test +// code. GetTestTypeId() is guaranteed to always return the same +// value, as it always calls GetTypeId<>() from the Google Test +// framework. +#define GTEST_TEST(test_suite_name, test_name) \ + GTEST_TEST_(test_suite_name, test_name, ::testing::Test, \ + ::testing::internal::GetTestTypeId()) + +// Define this macro to 1 to omit the definition of TEST(), which +// is a generic name and clashes with some other libraries. +#if !GTEST_DONT_DEFINE_TEST +#define TEST(test_suite_name, test_name) GTEST_TEST(test_suite_name, test_name) +#endif + +// Defines a test that uses a test fixture. +// +// The first parameter is the name of the test fixture class, which +// also doubles as the test suite name. The second parameter is the +// name of the test within the test suite. +// +// A test fixture class must be declared earlier. The user should put +// the test code between braces after using this macro. Example: +// +// class FooTest : public testing::Test { +// protected: +// void SetUp() override { b_.AddElement(3); } +// +// Foo a_; +// Foo b_; +// }; +// +// TEST_F(FooTest, InitializesCorrectly) { +// EXPECT_TRUE(a_.StatusIsOK()); +// } +// +// TEST_F(FooTest, ReturnsElementCountCorrectly) { +// EXPECT_EQ(a_.size(), 0); +// EXPECT_EQ(b_.size(), 1); +// } +// +// GOOGLETEST_CM0011 DO NOT DELETE +#if !GTEST_DONT_DEFINE_TEST +#define TEST_F(test_fixture, test_name)\ + GTEST_TEST_(test_fixture, test_name, test_fixture, \ + ::testing::internal::GetTypeId()) +#endif // !GTEST_DONT_DEFINE_TEST + +// Returns a path to temporary directory. +// Tries to determine an appropriate directory for the platform. +GTEST_API_ std::string TempDir(); + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +// Dynamically registers a test with the framework. +// +// This is an advanced API only to be used when the `TEST` macros are +// insufficient. The macros should be preferred when possible, as they avoid +// most of the complexity of calling this function. +// +// The `factory` argument is a factory callable (move-constructible) object or +// function pointer that creates a new instance of the Test object. It +// handles ownership to the caller. The signature of the callable is +// `Fixture*()`, where `Fixture` is the test fixture class for the test. All +// tests registered with the same `test_suite_name` must return the same +// fixture type. This is checked at runtime. +// +// The framework will infer the fixture class from the factory and will call +// the `SetUpTestSuite` and `TearDownTestSuite` for it. +// +// Must be called before `RUN_ALL_TESTS()` is invoked, otherwise behavior is +// undefined. +// +// Use case example: +// +// class MyFixture : public ::testing::Test { +// public: +// // All of these optional, just like in regular macro usage. +// static void SetUpTestSuite() { ... } +// static void TearDownTestSuite() { ... } +// void SetUp() override { ... } +// void TearDown() override { ... } +// }; +// +// class MyTest : public MyFixture { +// public: +// explicit MyTest(int data) : data_(data) {} +// void TestBody() override { ... } +// +// private: +// int data_; +// }; +// +// void RegisterMyTests(const std::vector& values) { +// for (int v : values) { +// ::testing::RegisterTest( +// "MyFixture", ("Test" + std::to_string(v)).c_str(), nullptr, +// std::to_string(v).c_str(), +// __FILE__, __LINE__, +// // Important to use the fixture type as the return type here. +// [=]() -> MyFixture* { return new MyTest(v); }); +// } +// } +// ... +// int main(int argc, char** argv) { +// std::vector values_to_test = LoadValuesFromConfig(); +// RegisterMyTests(values_to_test); +// ... +// return RUN_ALL_TESTS(); +// } +// +template +TestInfo* RegisterTest(const char* test_suite_name, const char* test_name, + const char* type_param, const char* value_param, + const char* file, int line, Factory factory) { + using TestT = typename std::remove_pointer::type; + + class FactoryImpl : public internal::TestFactoryBase { + public: + explicit FactoryImpl(Factory f) : factory_(std::move(f)) {} + Test* CreateTest() override { return factory_(); } + + private: + Factory factory_; + }; + + return internal::MakeAndRegisterTestInfo( + test_suite_name, test_name, type_param, value_param, + internal::CodeLocation(file, line), internal::GetTypeId(), + internal::SuiteApiResolver::GetSetUpCaseOrSuite(file, line), + internal::SuiteApiResolver::GetTearDownCaseOrSuite(file, line), + new FactoryImpl{std::move(factory)}); +} + +} // namespace testing + +// Use this function in main() to run all tests. It returns 0 if all +// tests are successful, or 1 otherwise. +// +// RUN_ALL_TESTS() should be invoked after the command line has been +// parsed by InitGoogleTest(). +// +// This function was formerly a macro; thus, it is in the global +// namespace and has an all-caps name. +int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_; + +inline int RUN_ALL_TESTS() { + return ::testing::UnitTest::GetInstance()->Run(); +} + +GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_H_ diff --git a/data/miniconda3/include/gtest/gtest_pred_impl.h b/data/miniconda3/include/gtest/gtest_pred_impl.h new file mode 100644 index 0000000000000000000000000000000000000000..5029a9bb02ada740f9ee3eee6a5281d6e9593aed --- /dev/null +++ b/data/miniconda3/include/gtest/gtest_pred_impl.h @@ -0,0 +1,359 @@ +// Copyright 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This file is AUTOMATICALLY GENERATED on 01/02/2019 by command +// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! +// +// Implements a family of generic predicate assertion macros. +// GOOGLETEST_CM0001 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ + +#include "gtest/gtest.h" + +namespace testing { + +// This header implements a family of generic predicate assertion +// macros: +// +// ASSERT_PRED_FORMAT1(pred_format, v1) +// ASSERT_PRED_FORMAT2(pred_format, v1, v2) +// ... +// +// where pred_format is a function or functor that takes n (in the +// case of ASSERT_PRED_FORMATn) values and their source expression +// text, and returns a testing::AssertionResult. See the definition +// of ASSERT_EQ in gtest.h for an example. +// +// If you don't care about formatting, you can use the more +// restrictive version: +// +// ASSERT_PRED1(pred, v1) +// ASSERT_PRED2(pred, v1, v2) +// ... +// +// where pred is an n-ary function or functor that returns bool, +// and the values v1, v2, ..., must support the << operator for +// streaming to std::ostream. +// +// We also define the EXPECT_* variations. +// +// For now we only support predicates whose arity is at most 5. +// Please email googletestframework@googlegroups.com if you need +// support for higher arities. + +// GTEST_ASSERT_ is the basic statement to which all of the assertions +// in this file reduce. Don't use this in your code. + +#define GTEST_ASSERT_(expression, on_failure) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (const ::testing::AssertionResult gtest_ar = (expression)) \ + ; \ + else \ + on_failure(gtest_ar.failure_message()) + + +// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use +// this in your code. +template +AssertionResult AssertPred1Helper(const char* pred_text, + const char* e1, + Pred pred, + const T1& v1) { + if (pred(v1)) return AssertionSuccess(); + + return AssertionFailure() + << pred_text << "(" << e1 << ") evaluates to false, where" + << "\n" + << e1 << " evaluates to " << ::testing::PrintToString(v1); +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. +// Don't use this in your code. +#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, v1), \ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use +// this in your code. +#define GTEST_PRED1_(pred, v1, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \ + #v1, \ + pred, \ + v1), on_failure) + +// Unary predicate assertion macros. +#define EXPECT_PRED_FORMAT1(pred_format, v1) \ + GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED1(pred, v1) \ + GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT1(pred_format, v1) \ + GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED1(pred, v1) \ + GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use +// this in your code. +template +AssertionResult AssertPred2Helper(const char* pred_text, + const char* e1, + const char* e2, + Pred pred, + const T1& v1, + const T2& v2) { + if (pred(v1, v2)) return AssertionSuccess(); + + return AssertionFailure() + << pred_text << "(" << e1 << ", " << e2 + << ") evaluates to false, where" + << "\n" + << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" + << e2 << " evaluates to " << ::testing::PrintToString(v2); +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. +// Don't use this in your code. +#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use +// this in your code. +#define GTEST_PRED2_(pred, v1, v2, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \ + #v1, \ + #v2, \ + pred, \ + v1, \ + v2), on_failure) + +// Binary predicate assertion macros. +#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ + GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED2(pred, v1, v2) \ + GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ + GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED2(pred, v1, v2) \ + GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use +// this in your code. +template +AssertionResult AssertPred3Helper(const char* pred_text, + const char* e1, + const char* e2, + const char* e3, + Pred pred, + const T1& v1, + const T2& v2, + const T3& v3) { + if (pred(v1, v2, v3)) return AssertionSuccess(); + + return AssertionFailure() + << pred_text << "(" << e1 << ", " << e2 << ", " << e3 + << ") evaluates to false, where" + << "\n" + << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" + << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n" + << e3 << " evaluates to " << ::testing::PrintToString(v3); +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. +// Don't use this in your code. +#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use +// this in your code. +#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \ + #v1, \ + #v2, \ + #v3, \ + pred, \ + v1, \ + v2, \ + v3), on_failure) + +// Ternary predicate assertion macros. +#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ + GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED3(pred, v1, v2, v3) \ + GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ + GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED3(pred, v1, v2, v3) \ + GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use +// this in your code. +template +AssertionResult AssertPred4Helper(const char* pred_text, + const char* e1, + const char* e2, + const char* e3, + const char* e4, + Pred pred, + const T1& v1, + const T2& v2, + const T3& v3, + const T4& v4) { + if (pred(v1, v2, v3, v4)) return AssertionSuccess(); + + return AssertionFailure() + << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4 + << ") evaluates to false, where" + << "\n" + << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" + << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n" + << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n" + << e4 << " evaluates to " << ::testing::PrintToString(v4); +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. +// Don't use this in your code. +#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use +// this in your code. +#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \ + #v1, \ + #v2, \ + #v3, \ + #v4, \ + pred, \ + v1, \ + v2, \ + v3, \ + v4), on_failure) + +// 4-ary predicate assertion macros. +#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ + GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED4(pred, v1, v2, v3, v4) \ + GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ + GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED4(pred, v1, v2, v3, v4) \ + GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) + + + +// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use +// this in your code. +template +AssertionResult AssertPred5Helper(const char* pred_text, + const char* e1, + const char* e2, + const char* e3, + const char* e4, + const char* e5, + Pred pred, + const T1& v1, + const T2& v2, + const T3& v3, + const T4& v4, + const T5& v5) { + if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); + + return AssertionFailure() + << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4 + << ", " << e5 << ") evaluates to false, where" + << "\n" + << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n" + << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n" + << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n" + << e4 << " evaluates to " << ::testing::PrintToString(v4) << "\n" + << e5 << " evaluates to " << ::testing::PrintToString(v5); +} + +// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. +// Don't use this in your code. +#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\ + GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \ + on_failure) + +// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use +// this in your code. +#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\ + GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \ + #v1, \ + #v2, \ + #v3, \ + #v4, \ + #v5, \ + pred, \ + v1, \ + v2, \ + v3, \ + v4, \ + v5), on_failure) + +// 5-ary predicate assertion macros. +#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ + GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) +#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ + GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) +#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ + GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) +#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ + GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) + + + +} // namespace testing + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ diff --git a/data/miniconda3/include/gtest/gtest_prod.h b/data/miniconda3/include/gtest/gtest_prod.h new file mode 100644 index 0000000000000000000000000000000000000000..38b9d85a51efb747feb969a5cdcadb1c27b2f87e --- /dev/null +++ b/data/miniconda3/include/gtest/gtest_prod.h @@ -0,0 +1,61 @@ +// Copyright 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +// Google C++ Testing and Mocking Framework definitions useful in production code. +// GOOGLETEST_CM0003 DO NOT DELETE + +#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ +#define GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ + +// When you need to test the private or protected members of a class, +// use the FRIEND_TEST macro to declare your tests as friends of the +// class. For example: +// +// class MyClass { +// private: +// void PrivateMethod(); +// FRIEND_TEST(MyClassTest, PrivateMethodWorks); +// }; +// +// class MyClassTest : public testing::Test { +// // ... +// }; +// +// TEST_F(MyClassTest, PrivateMethodWorks) { +// // Can call MyClass::PrivateMethod() here. +// } +// +// Note: The test class must be in the same namespace as the class being tested. +// For example, putting MyClassTest in an anonymous namespace will not work. + +#define FRIEND_TEST(test_case_name, test_name)\ +friend class test_case_name##_##test_name##_Test + +#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ diff --git a/data/miniconda3/include/nghttp2/nghttp2.h b/data/miniconda3/include/nghttp2/nghttp2.h new file mode 100644 index 0000000000000000000000000000000000000000..19c1874f23a3cafe81e677e8306d0d321a316ca5 --- /dev/null +++ b/data/miniconda3/include/nghttp2/nghttp2.h @@ -0,0 +1,6878 @@ +/* + * nghttp2 - HTTP/2 C Library + * + * Copyright (c) 2013, 2014 Tatsuhiro Tsujikawa + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef NGHTTP2_H +#define NGHTTP2_H + +/* Define WIN32 when build target is Win32 API (borrowed from + libcurl) */ +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) +# define WIN32 +#endif + +/* Compatibility for non-Clang compilers */ +#ifndef __has_declspec_attribute +# define __has_declspec_attribute(x) 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#if defined(_MSC_VER) && (_MSC_VER < 1800) +/* MSVC < 2013 does not have inttypes.h because it is not C99 + compliant. See compiler macros and version number in + https://sourceforge.net/p/predef/wiki/Compilers/ */ +# include +#else /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */ +# include +#endif /* !defined(_MSC_VER) || (_MSC_VER >= 1800) */ +#include +#include +#include + +#include + +#ifdef NGHTTP2_STATICLIB +# define NGHTTP2_EXTERN +#elif defined(WIN32) || \ + (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)) +# ifdef BUILDING_NGHTTP2 +# define NGHTTP2_EXTERN __declspec(dllexport) +# else /* !BUILDING_NGHTTP2 */ +# define NGHTTP2_EXTERN __declspec(dllimport) +# endif /* !BUILDING_NGHTTP2 */ +#else /* !defined(WIN32) */ +# ifdef BUILDING_NGHTTP2 +# define NGHTTP2_EXTERN __attribute__((visibility("default"))) +# else /* !BUILDING_NGHTTP2 */ +# define NGHTTP2_EXTERN +# endif /* !BUILDING_NGHTTP2 */ +#endif /* !defined(WIN32) */ + +#ifdef BUILDING_NGHTTP2 +# undef NGHTTP2_NO_SSIZE_T +#endif /* BUILDING_NGHTTP2 */ + +/** + * @typedef + * + * :type:`nghttp2_ssize` is a signed counterpart of size_t. + */ +typedef ptrdiff_t nghttp2_ssize; + +/** + * @macro + * + * The protocol version identification string of this library + * supports. This identifier is used if HTTP/2 is used over TLS. + */ +#define NGHTTP2_PROTO_VERSION_ID "h2" +/** + * @macro + * + * The length of :macro:`NGHTTP2_PROTO_VERSION_ID`. + */ +#define NGHTTP2_PROTO_VERSION_ID_LEN 2 + +/** + * @macro + * + * The serialized form of ALPN protocol identifier this library + * supports. Notice that first byte is the length of following + * protocol identifier. This is the same wire format of `TLS ALPN + * extension `_. This is useful + * to process incoming ALPN tokens in wire format. + */ +#define NGHTTP2_PROTO_ALPN "\x2h2" + +/** + * @macro + * + * The length of :macro:`NGHTTP2_PROTO_ALPN`. + */ +#define NGHTTP2_PROTO_ALPN_LEN (sizeof(NGHTTP2_PROTO_ALPN) - 1) + +/** + * @macro + * + * The protocol version identification string of this library + * supports. This identifier is used if HTTP/2 is used over cleartext + * TCP. + */ +#define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID "h2c" + +/** + * @macro + * + * The length of :macro:`NGHTTP2_CLEARTEXT_PROTO_VERSION_ID`. + */ +#define NGHTTP2_CLEARTEXT_PROTO_VERSION_ID_LEN 3 + +struct nghttp2_session; +/** + * @struct + * + * The primary structure to hold the resources needed for a HTTP/2 + * session. The details of this structure are intentionally hidden + * from the public API. + */ +typedef struct nghttp2_session nghttp2_session; + +/** + * @macro + * + * The age of :type:`nghttp2_info` + */ +#define NGHTTP2_VERSION_AGE 1 + +/** + * @struct + * + * This struct is what `nghttp2_version()` returns. It holds + * information about the particular nghttp2 version. + */ +typedef struct { + /** + * Age of this struct. This instance of nghttp2 sets it to + * :macro:`NGHTTP2_VERSION_AGE` but a future version may bump it and + * add more struct fields at the bottom + */ + int age; + /** + * the :macro:`NGHTTP2_VERSION_NUM` number (since age ==1) + */ + int version_num; + /** + * points to the :macro:`NGHTTP2_VERSION` string (since age ==1) + */ + const char *version_str; + /** + * points to the :macro:`NGHTTP2_PROTO_VERSION_ID` string this + * instance implements (since age ==1) + */ + const char *proto_str; + /* -------- the above fields all exist when age == 1 */ +} nghttp2_info; + +/** + * @macro + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * The default weight of stream dependency. + */ +#define NGHTTP2_DEFAULT_WEIGHT 16 + +/** + * @macro + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * The maximum weight of stream dependency. + */ +#define NGHTTP2_MAX_WEIGHT 256 + +/** + * @macro + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * The minimum weight of stream dependency. + */ +#define NGHTTP2_MIN_WEIGHT 1 + +/** + * @macro + * + * The maximum window size + */ +#define NGHTTP2_MAX_WINDOW_SIZE ((int32_t)((1U << 31) - 1)) + +/** + * @macro + * + * The initial window size for stream level flow control. + */ +#define NGHTTP2_INITIAL_WINDOW_SIZE ((1 << 16) - 1) +/** + * @macro + * + * The initial window size for connection level flow control. + */ +#define NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE ((1 << 16) - 1) + +/** + * @macro + * + * The default header table size. + */ +#define NGHTTP2_DEFAULT_HEADER_TABLE_SIZE (1 << 12) + +/** + * @macro + * + * The client magic string, which is the first 24 bytes byte string of + * client connection preface. + */ +#define NGHTTP2_CLIENT_MAGIC "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" + +/** + * @macro + * + * The length of :macro:`NGHTTP2_CLIENT_MAGIC`. + */ +#define NGHTTP2_CLIENT_MAGIC_LEN 24 + +/** + * @macro + * + * The default max number of settings per SETTINGS frame + */ +#define NGHTTP2_DEFAULT_MAX_SETTINGS 32 + +/** + * @enum + * + * Error codes used in this library. The code range is [-999, -500], + * inclusive. The following values are defined: + */ +typedef enum { + /** + * Invalid argument passed. + */ + NGHTTP2_ERR_INVALID_ARGUMENT = -501, + /** + * Out of buffer space. + */ + NGHTTP2_ERR_BUFFER_ERROR = -502, + /** + * The specified protocol version is not supported. + */ + NGHTTP2_ERR_UNSUPPORTED_VERSION = -503, + /** + * Used as a return value from :type:`nghttp2_send_callback2`, + * :type:`nghttp2_recv_callback` and + * :type:`nghttp2_send_data_callback` to indicate that the operation + * would block. + */ + NGHTTP2_ERR_WOULDBLOCK = -504, + /** + * General protocol error + */ + NGHTTP2_ERR_PROTO = -505, + /** + * The frame is invalid. + */ + NGHTTP2_ERR_INVALID_FRAME = -506, + /** + * The peer performed a shutdown on the connection. + */ + NGHTTP2_ERR_EOF = -507, + /** + * Used as a return value from + * :func:`nghttp2_data_source_read_callback2` to indicate that data + * transfer is postponed. See + * :func:`nghttp2_data_source_read_callback2` for details. + */ + NGHTTP2_ERR_DEFERRED = -508, + /** + * Stream ID has reached the maximum value. Therefore no stream ID + * is available. + */ + NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE = -509, + /** + * The stream is already closed; or the stream ID is invalid. + */ + NGHTTP2_ERR_STREAM_CLOSED = -510, + /** + * RST_STREAM has been added to the outbound queue. The stream is + * in closing state. + */ + NGHTTP2_ERR_STREAM_CLOSING = -511, + /** + * The transmission is not allowed for this stream (e.g., a frame + * with END_STREAM flag set has already sent). + */ + NGHTTP2_ERR_STREAM_SHUT_WR = -512, + /** + * The stream ID is invalid. + */ + NGHTTP2_ERR_INVALID_STREAM_ID = -513, + /** + * The state of the stream is not valid (e.g., DATA cannot be sent + * to the stream if response HEADERS has not been sent). + */ + NGHTTP2_ERR_INVALID_STREAM_STATE = -514, + /** + * Another DATA frame has already been deferred. + */ + NGHTTP2_ERR_DEFERRED_DATA_EXIST = -515, + /** + * Starting new stream is not allowed (e.g., GOAWAY has been sent + * and/or received). + */ + NGHTTP2_ERR_START_STREAM_NOT_ALLOWED = -516, + /** + * GOAWAY has already been sent. + */ + NGHTTP2_ERR_GOAWAY_ALREADY_SENT = -517, + /** + * The received frame contains the invalid header block (e.g., There + * are duplicate header names; or the header names are not encoded + * in US-ASCII character set and not lower cased; or the header name + * is zero-length string; or the header value contains multiple + * in-sequence NUL bytes). + */ + NGHTTP2_ERR_INVALID_HEADER_BLOCK = -518, + /** + * Indicates that the context is not suitable to perform the + * requested operation. + */ + NGHTTP2_ERR_INVALID_STATE = -519, + /** + * The user callback function failed due to the temporal error. + */ + NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE = -521, + /** + * The length of the frame is invalid, either too large or too small. + */ + NGHTTP2_ERR_FRAME_SIZE_ERROR = -522, + /** + * Header block inflate/deflate error. + */ + NGHTTP2_ERR_HEADER_COMP = -523, + /** + * Flow control error + */ + NGHTTP2_ERR_FLOW_CONTROL = -524, + /** + * Insufficient buffer size given to function. + */ + NGHTTP2_ERR_INSUFF_BUFSIZE = -525, + /** + * Callback was paused by the application + */ + NGHTTP2_ERR_PAUSE = -526, + /** + * There are too many in-flight SETTING frame and no more + * transmission of SETTINGS is allowed. + */ + NGHTTP2_ERR_TOO_MANY_INFLIGHT_SETTINGS = -527, + /** + * The server push is disabled. + */ + NGHTTP2_ERR_PUSH_DISABLED = -528, + /** + * DATA or HEADERS frame for a given stream has been already + * submitted and has not been fully processed yet. Application + * should wait for the transmission of the previously submitted + * frame before submitting another. + */ + NGHTTP2_ERR_DATA_EXIST = -529, + /** + * The current session is closing due to a connection error or + * `nghttp2_session_terminate_session()` is called. + */ + NGHTTP2_ERR_SESSION_CLOSING = -530, + /** + * Invalid HTTP header field was received and stream is going to be + * closed. + */ + NGHTTP2_ERR_HTTP_HEADER = -531, + /** + * Violation in HTTP messaging rule. + */ + NGHTTP2_ERR_HTTP_MESSAGING = -532, + /** + * Stream was refused. + */ + NGHTTP2_ERR_REFUSED_STREAM = -533, + /** + * Unexpected internal error, but recovered. + */ + NGHTTP2_ERR_INTERNAL = -534, + /** + * Indicates that a processing was canceled. + */ + NGHTTP2_ERR_CANCEL = -535, + /** + * When a local endpoint expects to receive SETTINGS frame, it + * receives an other type of frame. + */ + NGHTTP2_ERR_SETTINGS_EXPECTED = -536, + /** + * When a local endpoint receives too many settings entries + * in a single SETTINGS frame. + */ + NGHTTP2_ERR_TOO_MANY_SETTINGS = -537, + /** + * The errors < :enum:`nghttp2_error.NGHTTP2_ERR_FATAL` mean that + * the library is under unexpected condition and processing was + * terminated (e.g., out of memory). If application receives this + * error code, it must stop using that :type:`nghttp2_session` + * object and only allowed operation for that object is deallocate + * it using `nghttp2_session_del()`. + */ + NGHTTP2_ERR_FATAL = -900, + /** + * Out of memory. This is a fatal error. + */ + NGHTTP2_ERR_NOMEM = -901, + /** + * The user callback function failed. This is a fatal error. + */ + NGHTTP2_ERR_CALLBACK_FAILURE = -902, + /** + * Invalid client magic (see :macro:`NGHTTP2_CLIENT_MAGIC`) was + * received and further processing is not possible. + */ + NGHTTP2_ERR_BAD_CLIENT_MAGIC = -903, + /** + * Possible flooding by peer was detected in this HTTP/2 session. + * Flooding is measured by how many PING and SETTINGS frames with + * ACK flag set are queued for transmission. These frames are + * response for the peer initiated frames, and peer can cause memory + * exhaustion on server side to send these frames forever and does + * not read network. + */ + NGHTTP2_ERR_FLOODED = -904, + /** + * When a local endpoint receives too many CONTINUATION frames + * following a HEADER frame. + */ + NGHTTP2_ERR_TOO_MANY_CONTINUATIONS = -905, +} nghttp2_error; + +/** + * @struct + * + * The object representing single contiguous buffer. + */ +typedef struct { + /** + * The pointer to the buffer. + */ + uint8_t *base; + /** + * The length of the buffer. + */ + size_t len; +} nghttp2_vec; + +struct nghttp2_rcbuf; + +/** + * @struct + * + * The object representing reference counted buffer. The details of + * this structure are intentionally hidden from the public API. + */ +typedef struct nghttp2_rcbuf nghttp2_rcbuf; + +/** + * @function + * + * Increments the reference count of |rcbuf| by 1. + */ +NGHTTP2_EXTERN void nghttp2_rcbuf_incref(nghttp2_rcbuf *rcbuf); + +/** + * @function + * + * Decrements the reference count of |rcbuf| by 1. If the reference + * count becomes zero, the object pointed by |rcbuf| will be freed. + * In this case, application must not use |rcbuf| again. + */ +NGHTTP2_EXTERN void nghttp2_rcbuf_decref(nghttp2_rcbuf *rcbuf); + +/** + * @function + * + * Returns the underlying buffer managed by |rcbuf|. + */ +NGHTTP2_EXTERN nghttp2_vec nghttp2_rcbuf_get_buf(nghttp2_rcbuf *rcbuf); + +/** + * @function + * + * Returns nonzero if the underlying buffer is statically allocated, + * and 0 otherwise. This can be useful for language bindings that wish + * to avoid creating duplicate strings for these buffers. + */ +NGHTTP2_EXTERN int nghttp2_rcbuf_is_static(const nghttp2_rcbuf *rcbuf); + +/** + * @enum + * + * The flags for header field name/value pair. + */ +typedef enum { + /** + * No flag set. + */ + NGHTTP2_NV_FLAG_NONE = 0, + /** + * Indicates that this name/value pair must not be indexed ("Literal + * Header Field never Indexed" representation must be used in HPACK + * encoding). Other implementation calls this bit as "sensitive". + */ + NGHTTP2_NV_FLAG_NO_INDEX = 0x01, + /** + * This flag is set solely by application. If this flag is set, the + * library does not make a copy of header field name. This could + * improve performance. + */ + NGHTTP2_NV_FLAG_NO_COPY_NAME = 0x02, + /** + * This flag is set solely by application. If this flag is set, the + * library does not make a copy of header field value. This could + * improve performance. + */ + NGHTTP2_NV_FLAG_NO_COPY_VALUE = 0x04 +} nghttp2_nv_flag; + +/** + * @struct + * + * The name/value pair, which mainly used to represent header fields. + */ +typedef struct { + /** + * The |name| byte string. If this struct is presented from library + * (e.g., :type:`nghttp2_on_frame_recv_callback`), |name| is + * guaranteed to be NULL-terminated. For some callbacks + * (:type:`nghttp2_before_frame_send_callback`, + * :type:`nghttp2_on_frame_send_callback`, and + * :type:`nghttp2_on_frame_not_send_callback`), it may not be + * NULL-terminated if header field is passed from application with + * the flag :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`). + * When application is constructing this struct, |name| is not + * required to be NULL-terminated. + */ + uint8_t *name; + /** + * The |value| byte string. If this struct is presented from + * library (e.g., :type:`nghttp2_on_frame_recv_callback`), |value| + * is guaranteed to be NULL-terminated. For some callbacks + * (:type:`nghttp2_before_frame_send_callback`, + * :type:`nghttp2_on_frame_send_callback`, and + * :type:`nghttp2_on_frame_not_send_callback`), it may not be + * NULL-terminated if header field is passed from application with + * the flag :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE`). + * When application is constructing this struct, |value| is not + * required to be NULL-terminated. + */ + uint8_t *value; + /** + * The length of the |name|, excluding terminating NULL. + */ + size_t namelen; + /** + * The length of the |value|, excluding terminating NULL. + */ + size_t valuelen; + /** + * Bitwise OR of one or more of :type:`nghttp2_nv_flag`. + */ + uint8_t flags; +} nghttp2_nv; + +/** + * @enum + * + * The frame types in HTTP/2 specification. + */ +typedef enum { + /** + * The DATA frame. + */ + NGHTTP2_DATA = 0, + /** + * The HEADERS frame. + */ + NGHTTP2_HEADERS = 0x01, + /** + * The PRIORITY frame. + */ + NGHTTP2_PRIORITY = 0x02, + /** + * The RST_STREAM frame. + */ + NGHTTP2_RST_STREAM = 0x03, + /** + * The SETTINGS frame. + */ + NGHTTP2_SETTINGS = 0x04, + /** + * The PUSH_PROMISE frame. + */ + NGHTTP2_PUSH_PROMISE = 0x05, + /** + * The PING frame. + */ + NGHTTP2_PING = 0x06, + /** + * The GOAWAY frame. + */ + NGHTTP2_GOAWAY = 0x07, + /** + * The WINDOW_UPDATE frame. + */ + NGHTTP2_WINDOW_UPDATE = 0x08, + /** + * The CONTINUATION frame. This frame type won't be passed to any + * callbacks because the library processes this frame type and its + * preceding HEADERS/PUSH_PROMISE as a single frame. + */ + NGHTTP2_CONTINUATION = 0x09, + /** + * The ALTSVC frame, which is defined in `RFC 7383 + * `_. + */ + NGHTTP2_ALTSVC = 0x0a, + /** + * The ORIGIN frame, which is defined by `RFC 8336 + * `_. + */ + NGHTTP2_ORIGIN = 0x0c, + /** + * The PRIORITY_UPDATE frame, which is defined by :rfc:`9218`. + */ + NGHTTP2_PRIORITY_UPDATE = 0x10 +} nghttp2_frame_type; + +/** + * @enum + * + * The flags for HTTP/2 frames. This enum defines all flags for all + * frames. + */ +typedef enum { + /** + * No flag set. + */ + NGHTTP2_FLAG_NONE = 0, + /** + * The END_STREAM flag. + */ + NGHTTP2_FLAG_END_STREAM = 0x01, + /** + * The END_HEADERS flag. + */ + NGHTTP2_FLAG_END_HEADERS = 0x04, + /** + * The ACK flag. + */ + NGHTTP2_FLAG_ACK = 0x01, + /** + * The PADDED flag. + */ + NGHTTP2_FLAG_PADDED = 0x08, + /** + * The PRIORITY flag. + */ + NGHTTP2_FLAG_PRIORITY = 0x20 +} nghttp2_flag; + +/** + * @enum + * The SETTINGS ID. + */ +typedef enum { + /** + * SETTINGS_HEADER_TABLE_SIZE + */ + NGHTTP2_SETTINGS_HEADER_TABLE_SIZE = 0x01, + /** + * SETTINGS_ENABLE_PUSH + */ + NGHTTP2_SETTINGS_ENABLE_PUSH = 0x02, + /** + * SETTINGS_MAX_CONCURRENT_STREAMS + */ + NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 0x03, + /** + * SETTINGS_INITIAL_WINDOW_SIZE + */ + NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 0x04, + /** + * SETTINGS_MAX_FRAME_SIZE + */ + NGHTTP2_SETTINGS_MAX_FRAME_SIZE = 0x05, + /** + * SETTINGS_MAX_HEADER_LIST_SIZE + */ + NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 0x06, + /** + * SETTINGS_ENABLE_CONNECT_PROTOCOL + * (`RFC 8441 `_) + */ + NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL = 0x08, + /** + * SETTINGS_NO_RFC7540_PRIORITIES (:rfc:`9218`) + */ + NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES = 0x09 +} nghttp2_settings_id; +/* Note: If we add SETTINGS, update the capacity of + NGHTTP2_INBOUND_NUM_IV as well */ + +/** + * @macro + * + * .. warning:: + * + * Deprecated. The initial max concurrent streams is 0xffffffffu. + * + * Default maximum number of incoming concurrent streams. Use + * `nghttp2_submit_settings()` with + * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS` + * to change the maximum number of incoming concurrent streams. + * + * .. note:: + * + * The maximum number of outgoing concurrent streams is 100 by + * default. + */ +#define NGHTTP2_INITIAL_MAX_CONCURRENT_STREAMS ((1U << 31) - 1) + +/** + * @enum + * The status codes for the RST_STREAM and GOAWAY frames. + */ +typedef enum { + /** + * No errors. + */ + NGHTTP2_NO_ERROR = 0x00, + /** + * PROTOCOL_ERROR + */ + NGHTTP2_PROTOCOL_ERROR = 0x01, + /** + * INTERNAL_ERROR + */ + NGHTTP2_INTERNAL_ERROR = 0x02, + /** + * FLOW_CONTROL_ERROR + */ + NGHTTP2_FLOW_CONTROL_ERROR = 0x03, + /** + * SETTINGS_TIMEOUT + */ + NGHTTP2_SETTINGS_TIMEOUT = 0x04, + /** + * STREAM_CLOSED + */ + NGHTTP2_STREAM_CLOSED = 0x05, + /** + * FRAME_SIZE_ERROR + */ + NGHTTP2_FRAME_SIZE_ERROR = 0x06, + /** + * REFUSED_STREAM + */ + NGHTTP2_REFUSED_STREAM = 0x07, + /** + * CANCEL + */ + NGHTTP2_CANCEL = 0x08, + /** + * COMPRESSION_ERROR + */ + NGHTTP2_COMPRESSION_ERROR = 0x09, + /** + * CONNECT_ERROR + */ + NGHTTP2_CONNECT_ERROR = 0x0a, + /** + * ENHANCE_YOUR_CALM + */ + NGHTTP2_ENHANCE_YOUR_CALM = 0x0b, + /** + * INADEQUATE_SECURITY + */ + NGHTTP2_INADEQUATE_SECURITY = 0x0c, + /** + * HTTP_1_1_REQUIRED + */ + NGHTTP2_HTTP_1_1_REQUIRED = 0x0d +} nghttp2_error_code; + +/** + * @struct + * The frame header. + */ +typedef struct { + /** + * The length field of this frame, excluding frame header. + */ + size_t length; + /** + * The stream identifier (aka, stream ID) + */ + int32_t stream_id; + /** + * The type of this frame. See `nghttp2_frame_type`. + */ + uint8_t type; + /** + * The flags. + */ + uint8_t flags; + /** + * Reserved bit in frame header. Currently, this is always set to 0 + * and application should not expect something useful in here. + */ + uint8_t reserved; +} nghttp2_frame_hd; + +/** + * @union + * + * This union represents the some kind of data source passed to + * :type:`nghttp2_data_source_read_callback2`. + */ +typedef union { + /** + * The integer field, suitable for a file descriptor. + */ + int fd; + /** + * The pointer to an arbitrary object. + */ + void *ptr; +} nghttp2_data_source; + +/** + * @enum + * + * The flags used to set in |data_flags| output parameter in + * :type:`nghttp2_data_source_read_callback2`. + */ +typedef enum { + /** + * No flag set. + */ + NGHTTP2_DATA_FLAG_NONE = 0, + /** + * Indicates EOF was sensed. + */ + NGHTTP2_DATA_FLAG_EOF = 0x01, + /** + * Indicates that END_STREAM flag must not be set even if + * NGHTTP2_DATA_FLAG_EOF is set. Usually this flag is used to send + * trailer fields with `nghttp2_submit_request2()` or + * `nghttp2_submit_response2()`. + */ + NGHTTP2_DATA_FLAG_NO_END_STREAM = 0x02, + /** + * Indicates that application will send complete DATA frame in + * :type:`nghttp2_send_data_callback`. + */ + NGHTTP2_DATA_FLAG_NO_COPY = 0x04 +} nghttp2_data_flag; + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @functypedef + * + * .. warning:: + * + * Deprecated. Use :type:`nghttp2_data_source_read_callback2` + * instead. + * + * Callback function invoked when the library wants to read data from + * the |source|. The read data is sent in the stream |stream_id|. + * The implementation of this function must read at most |length| + * bytes of data from |source| (or possibly other places) and store + * them in |buf| and return number of data stored in |buf|. If EOF is + * reached, set :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag + * in |*data_flags|. + * + * Sometime it is desirable to avoid copying data into |buf| and let + * application to send data directly. To achieve this, set + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` to + * |*data_flags| (and possibly other flags, just like when we do + * copy), and return the number of bytes to send without copying data + * into |buf|. The library, seeing + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY`, will invoke + * :type:`nghttp2_send_data_callback`. The application must send + * complete DATA frame in that callback. + * + * If this callback is set by `nghttp2_submit_request()`, + * `nghttp2_submit_response()` or `nghttp2_submit_headers()` and + * `nghttp2_submit_data()` with flag parameter + * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` set, and + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag is set to + * |*data_flags|, DATA frame will have END_STREAM flag set. Usually, + * this is expected behaviour and all are fine. One exception is send + * trailer fields. You cannot send trailer fields after sending frame + * with END_STREAM set. To avoid this problem, one can set + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_END_STREAM` along + * with :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` to signal the + * library not to set END_STREAM in DATA frame. Then application can + * use `nghttp2_submit_trailer()` to send trailer fields. + * `nghttp2_submit_trailer()` can be called inside this callback. + * + * If the application wants to postpone DATA frames (e.g., + * asynchronous I/O, or reading data blocks for long time), it is + * achieved by returning :enum:`nghttp2_error.NGHTTP2_ERR_DEFERRED` + * without reading any data in this invocation. The library removes + * DATA frame from the outgoing queue temporarily. To move back + * deferred DATA frame to outgoing queue, call + * `nghttp2_session_resume_data()`. + * + * By default, |length| is limited to 16KiB at maximum. If peer + * allows larger frames, application can enlarge transmission buffer + * size. See :type:`nghttp2_data_source_read_length_callback` for + * more details. + * + * If the application just wants to return from + * `nghttp2_session_send()` or `nghttp2_session_mem_send()` without + * sending anything, return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE`. + * + * In case of error, there are 2 choices. Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will + * close the stream by issuing RST_STREAM with + * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. If a different + * error code is desirable, use `nghttp2_submit_rst_stream()` with a + * desired error code and then return + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. + * Returning :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will + * signal the entire session failure. + */ +typedef ssize_t (*nghttp2_data_source_read_callback)( + nghttp2_session *session, int32_t stream_id, uint8_t *buf, size_t length, + uint32_t *data_flags, nghttp2_data_source *source, void *user_data); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @functypedef + * + * Callback function invoked when the library wants to read data from + * the |source|. The read data is sent in the stream |stream_id|. + * The implementation of this function must read at most |length| + * bytes of data from |source| (or possibly other places) and store + * them in |buf| and return number of data stored in |buf|. If EOF is + * reached, set :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag + * in |*data_flags|. + * + * Sometime it is desirable to avoid copying data into |buf| and let + * application to send data directly. To achieve this, set + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` to + * |*data_flags| (and possibly other flags, just like when we do + * copy), and return the number of bytes to send without copying data + * into |buf|. The library, seeing + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY`, will invoke + * :type:`nghttp2_send_data_callback`. The application must send + * complete DATA frame in that callback. + * + * If this callback is set by `nghttp2_submit_request2()`, + * `nghttp2_submit_response2()` or `nghttp2_submit_headers()` and + * `nghttp2_submit_data2()` with flag parameter + * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` set, and + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` flag is set to + * |*data_flags|, DATA frame will have END_STREAM flag set. Usually, + * this is expected behaviour and all are fine. One exception is send + * trailer fields. You cannot send trailer fields after sending frame + * with END_STREAM set. To avoid this problem, one can set + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_END_STREAM` along + * with :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF` to signal the + * library not to set END_STREAM in DATA frame. Then application can + * use `nghttp2_submit_trailer()` to send trailer fields. + * `nghttp2_submit_trailer()` can be called inside this callback. + * + * If the application wants to postpone DATA frames (e.g., + * asynchronous I/O, or reading data blocks for long time), it is + * achieved by returning :enum:`nghttp2_error.NGHTTP2_ERR_DEFERRED` + * without reading any data in this invocation. The library removes + * DATA frame from the outgoing queue temporarily. To move back + * deferred DATA frame to outgoing queue, call + * `nghttp2_session_resume_data()`. + * + * By default, |length| is limited to 16KiB at maximum. If peer + * allows larger frames, application can enlarge transmission buffer + * size. See :type:`nghttp2_data_source_read_length_callback` for + * more details. + * + * If the application just wants to return from + * `nghttp2_session_send()` or `nghttp2_session_mem_send2()` without + * sending anything, return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE`. + * + * In case of error, there are 2 choices. Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will + * close the stream by issuing RST_STREAM with + * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. If a different + * error code is desirable, use `nghttp2_submit_rst_stream()` with a + * desired error code and then return + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. + * Returning :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will + * signal the entire session failure. + */ +typedef nghttp2_ssize (*nghttp2_data_source_read_callback2)( + nghttp2_session *session, int32_t stream_id, uint8_t *buf, size_t length, + uint32_t *data_flags, nghttp2_data_source *source, void *user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @struct + * + * .. warning:: + * + * Deprecated. Use :type:`nghttp2_data_provider2` instead. + * + * This struct represents the data source and the way to read a chunk + * of data from it. + */ +typedef struct { + /** + * The data source. + */ + nghttp2_data_source source; + /** + * The callback function to read a chunk of data from the |source|. + */ + nghttp2_data_source_read_callback read_callback; +} nghttp2_data_provider; + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @struct + * + * This struct represents the data source and the way to read a chunk + * of data from it. + */ +typedef struct { + /** + * The data source. + */ + nghttp2_data_source source; + /** + * The callback function to read a chunk of data from the |source|. + */ + nghttp2_data_source_read_callback2 read_callback; +} nghttp2_data_provider2; + +/** + * @struct + * + * The DATA frame. The received data is delivered via + * :type:`nghttp2_on_data_chunk_recv_callback`. + */ +typedef struct { + nghttp2_frame_hd hd; + /** + * The length of the padding in this frame. This includes PAD_HIGH + * and PAD_LOW. + */ + size_t padlen; +} nghttp2_data; + +/** + * @enum + * + * The category of HEADERS, which indicates the role of the frame. In + * HTTP/2 spec, request, response, push response and other arbitrary + * headers (e.g., trailer fields) are all called just HEADERS. To + * give the application the role of incoming HEADERS frame, we define + * several categories. + */ +typedef enum { + /** + * The HEADERS frame is opening new stream, which is analogous to + * SYN_STREAM in SPDY. + */ + NGHTTP2_HCAT_REQUEST = 0, + /** + * The HEADERS frame is the first response headers, which is + * analogous to SYN_REPLY in SPDY. + */ + NGHTTP2_HCAT_RESPONSE = 1, + /** + * The HEADERS frame is the first headers sent against reserved + * stream. + */ + NGHTTP2_HCAT_PUSH_RESPONSE = 2, + /** + * The HEADERS frame which does not apply for the above categories, + * which is analogous to HEADERS in SPDY. If non-final response + * (e.g., status 1xx) is used, final response HEADERS frame will be + * categorized here. + */ + NGHTTP2_HCAT_HEADERS = 3 +} nghttp2_headers_category; + +/** + * @struct + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * The structure to specify stream dependency. + */ +typedef struct { + /** + * The stream ID of the stream to depend on. Specifying 0 makes + * stream not depend any other stream. + */ + int32_t stream_id; + /** + * The weight of this dependency. + */ + int32_t weight; + /** + * nonzero means exclusive dependency + */ + uint8_t exclusive; +} nghttp2_priority_spec; + +/** + * @struct + * + * The HEADERS frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The length of the padding in this frame. This includes PAD_HIGH + * and PAD_LOW. + */ + size_t padlen; + /** + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * The priority specification + */ + nghttp2_priority_spec pri_spec; + /** + * The name/value pairs. + */ + nghttp2_nv *nva; + /** + * The number of name/value pairs in |nva|. + */ + size_t nvlen; + /** + * The category of this HEADERS frame. + */ + nghttp2_headers_category cat; +} nghttp2_headers; + +/** + * @struct + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * The PRIORITY frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The priority specification. + */ + nghttp2_priority_spec pri_spec; +} nghttp2_priority; + +/** + * @struct + * + * The RST_STREAM frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The error code. See :type:`nghttp2_error_code`. + */ + uint32_t error_code; +} nghttp2_rst_stream; + +/** + * @struct + * + * The SETTINGS ID/Value pair. It has the following members: + */ +typedef struct { + /** + * The SETTINGS ID. See :type:`nghttp2_settings_id`. + */ + int32_t settings_id; + /** + * The value of this entry. + */ + uint32_t value; +} nghttp2_settings_entry; + +/** + * @struct + * + * The SETTINGS frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The number of SETTINGS ID/Value pairs in |iv|. + */ + size_t niv; + /** + * The pointer to the array of SETTINGS ID/Value pair. + */ + nghttp2_settings_entry *iv; +} nghttp2_settings; + +/** + * @struct + * + * The PUSH_PROMISE frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The length of the padding in this frame. This includes PAD_HIGH + * and PAD_LOW. + */ + size_t padlen; + /** + * The name/value pairs. + */ + nghttp2_nv *nva; + /** + * The number of name/value pairs in |nva|. + */ + size_t nvlen; + /** + * The promised stream ID + */ + int32_t promised_stream_id; + /** + * Reserved bit. Currently this is always set to 0 and application + * should not expect something useful in here. + */ + uint8_t reserved; +} nghttp2_push_promise; + +/** + * @struct + * + * The PING frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The opaque data + */ + uint8_t opaque_data[8]; +} nghttp2_ping; + +/** + * @struct + * + * The GOAWAY frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The last stream stream ID. + */ + int32_t last_stream_id; + /** + * The error code. See :type:`nghttp2_error_code`. + */ + uint32_t error_code; + /** + * The additional debug data + */ + uint8_t *opaque_data; + /** + * The length of |opaque_data| member. + */ + size_t opaque_data_len; + /** + * Reserved bit. Currently this is always set to 0 and application + * should not expect something useful in here. + */ + uint8_t reserved; +} nghttp2_goaway; + +/** + * @struct + * + * The WINDOW_UPDATE frame. It has the following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The window size increment. + */ + int32_t window_size_increment; + /** + * Reserved bit. Currently this is always set to 0 and application + * should not expect something useful in here. + */ + uint8_t reserved; +} nghttp2_window_update; + +/** + * @struct + * + * The extension frame. It has following members: + */ +typedef struct { + /** + * The frame header. + */ + nghttp2_frame_hd hd; + /** + * The pointer to extension payload. The exact pointer type is + * determined by hd.type. + * + * Currently, no extension is supported. This is a place holder for + * the future extensions. + */ + void *payload; +} nghttp2_extension; + +/** + * @union + * + * This union includes all frames to pass them to various function + * calls as nghttp2_frame type. The CONTINUATION frame is omitted + * from here because the library deals with it internally. + */ +typedef union { + /** + * The frame header, which is convenient to inspect frame header. + */ + nghttp2_frame_hd hd; + /** + * The DATA frame. + */ + nghttp2_data data; + /** + * The HEADERS frame. + */ + nghttp2_headers headers; + /** + * The PRIORITY frame. + */ + nghttp2_priority priority; + /** + * The RST_STREAM frame. + */ + nghttp2_rst_stream rst_stream; + /** + * The SETTINGS frame. + */ + nghttp2_settings settings; + /** + * The PUSH_PROMISE frame. + */ + nghttp2_push_promise push_promise; + /** + * The PING frame. + */ + nghttp2_ping ping; + /** + * The GOAWAY frame. + */ + nghttp2_goaway goaway; + /** + * The WINDOW_UPDATE frame. + */ + nghttp2_window_update window_update; + /** + * The extension frame. + */ + nghttp2_extension ext; +} nghttp2_frame; + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @functypedef + * + * .. warning:: + * + * Deprecated. Use :type:`nghttp2_send_callback2` instead. + * + * Callback function invoked when |session| wants to send data to the + * remote peer. The implementation of this function must send at most + * |length| bytes of data stored in |data|. The |flags| is currently + * not used and always 0. It must return the number of bytes sent if + * it succeeds. If it cannot send any single byte without blocking, + * it must return :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. For + * other errors, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The + * |user_data| pointer is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. + * + * This callback is required if the application uses + * `nghttp2_session_send()` to send data to the remote endpoint. If + * the application uses solely `nghttp2_session_mem_send()` instead, + * this callback function is unnecessary. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_send_callback()`. + * + * .. note:: + * + * The |length| may be very small. If that is the case, and + * application disables Nagle algorithm (``TCP_NODELAY``), then just + * writing |data| to the network stack leads to very small packet, + * and it is very inefficient. An application should be responsible + * to buffer up small chunks of data as necessary to avoid this + * situation. + */ +typedef ssize_t (*nghttp2_send_callback)(nghttp2_session *session, + const uint8_t *data, size_t length, + int flags, void *user_data); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @functypedef + * + * Callback function invoked when |session| wants to send data to the + * remote peer. The implementation of this function must send at most + * |length| bytes of data stored in |data|. The |flags| is currently + * not used and always 0. It must return the number of bytes sent if + * it succeeds. If it cannot send any single byte without blocking, + * it must return :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. For + * other errors, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The + * |user_data| pointer is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. + * + * This callback is required if the application uses + * `nghttp2_session_send()` to send data to the remote endpoint. If + * the application uses solely `nghttp2_session_mem_send2()` instead, + * this callback function is unnecessary. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_send_callback2()`. + * + * .. note:: + * + * The |length| may be very small. If that is the case, and + * application disables Nagle algorithm (``TCP_NODELAY``), then just + * writing |data| to the network stack leads to very small packet, + * and it is very inefficient. An application should be responsible + * to buffer up small chunks of data as necessary to avoid this + * situation. + */ +typedef nghttp2_ssize (*nghttp2_send_callback2)(nghttp2_session *session, + const uint8_t *data, + size_t length, int flags, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` is used in + * :type:`nghttp2_data_source_read_callback` to send complete DATA + * frame. + * + * The |frame| is a DATA frame to send. The |framehd| is the + * serialized frame header (9 bytes). The |length| is the length of + * application data to send (this does not include padding). The + * |source| is the same pointer passed to + * :type:`nghttp2_data_source_read_callback`. + * + * The application first must send frame header |framehd| of length 9 + * bytes. If ``frame->data.padlen > 0``, send 1 byte of value + * ``frame->data.padlen - 1``. Then send exactly |length| bytes of + * application data. Finally, if ``frame->data.padlen > 1``, send + * ``frame->data.padlen - 1`` bytes of zero as padding. + * + * The application has to send complete DATA frame in this callback. + * If all data were written successfully, return 0. + * + * If it cannot send any data at all, just return + * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`; the library will call + * this callback with the same parameters later (It is recommended to + * send complete DATA frame at once in this function to deal with + * error; if partial frame data has already sent, it is impossible to + * send another data in that state, and all we can do is tear down + * connection). When data is fully processed, but application wants + * to make `nghttp2_session_mem_send2()` or `nghttp2_session_send()` + * return immediately without processing next frames, return + * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE`. If application decided to + * reset this stream, return + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`, then + * the library will send RST_STREAM with INTERNAL_ERROR as error code. + * The application can also return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, which will + * result in connection closure. Returning any other value is treated + * as :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned. + */ +typedef int (*nghttp2_send_data_callback)(nghttp2_session *session, + nghttp2_frame *frame, + const uint8_t *framehd, size_t length, + nghttp2_data_source *source, + void *user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @functypedef + * + * .. warning:: + * + * Deprecated. Use :type:`nghttp2_recv_callback2` instead. + * + * Callback function invoked when |session| wants to receive data from + * the remote peer. The implementation of this function must read at + * most |length| bytes of data and store it in |buf|. The |flags| is + * currently not used and always 0. It must return the number of + * bytes written in |buf| if it succeeds. If it cannot read any + * single byte without blocking, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. If it gets EOF + * before it reads any single byte, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_EOF`. For other errors, it must + * return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * Returning 0 is treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. The |user_data| + * pointer is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. + * + * This callback is required if the application uses + * `nghttp2_session_recv()` to receive data from the remote endpoint. + * If the application uses solely `nghttp2_session_mem_recv()` + * instead, this callback function is unnecessary. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_recv_callback()`. + */ +typedef ssize_t (*nghttp2_recv_callback)(nghttp2_session *session, uint8_t *buf, + size_t length, int flags, + void *user_data); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @functypedef + * + * Callback function invoked when |session| wants to receive data from + * the remote peer. The implementation of this function must read at + * most |length| bytes of data and store it in |buf|. The |flags| is + * currently not used and always 0. It must return the number of + * bytes written in |buf| if it succeeds. If it cannot read any + * single byte without blocking, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. If it gets EOF + * before it reads any single byte, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_EOF`. For other errors, it must + * return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * Returning 0 is treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. The |user_data| + * pointer is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. + * + * This callback is required if the application uses + * `nghttp2_session_recv()` to receive data from the remote endpoint. + * If the application uses solely `nghttp2_session_mem_recv2()` + * instead, this callback function is unnecessary. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_recv_callback2()`. + */ +typedef nghttp2_ssize (*nghttp2_recv_callback2)(nghttp2_session *session, + uint8_t *buf, size_t length, + int flags, void *user_data); + +/** + * @functypedef + * + * Callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv2()` when a frame is received. The + * |user_data| pointer is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. + * + * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` + * member of their data structure are always ``NULL`` and 0 + * respectively. The header name/value pairs are emitted via + * :type:`nghttp2_on_header_callback`. + * + * Only HEADERS and DATA frame can signal the end of incoming data. + * If ``frame->hd.flags & NGHTTP2_FLAG_END_STREAM`` is nonzero, the + * |frame| is the last frame from the remote peer in this stream. + * + * This callback won't be called for CONTINUATION frames. + * HEADERS/PUSH_PROMISE + CONTINUATIONs are treated as single frame. + * + * The implementation of this function must return 0 if it succeeds. + * If nonzero value is returned, it is treated as fatal error and + * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_frame_recv_callback()`. + */ +typedef int (*nghttp2_on_frame_recv_callback)(nghttp2_session *session, + const nghttp2_frame *frame, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv2()` when an invalid non-DATA frame is + * received. The error is indicated by the |lib_error_code|, which is + * one of the values defined in :type:`nghttp2_error`. When this + * callback function is invoked, the library automatically submits + * either RST_STREAM or GOAWAY frame. The |user_data| pointer is the + * third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. + * + * If frame is HEADERS or PUSH_PROMISE, the ``nva`` and ``nvlen`` + * member of their data structure are always ``NULL`` and 0 + * respectively. + * + * The implementation of this function must return 0 if it succeeds. + * If nonzero is returned, it is treated as fatal error and + * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_invalid_frame_recv_callback()`. + */ +typedef int (*nghttp2_on_invalid_frame_recv_callback)( + nghttp2_session *session, const nghttp2_frame *frame, int lib_error_code, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when a chunk of data in DATA frame is + * received. The |stream_id| is the stream ID this DATA frame belongs + * to. The |flags| is the flags of DATA frame which this data chunk + * is contained. ``(flags & NGHTTP2_FLAG_END_STREAM) != 0`` does not + * necessarily mean this chunk of data is the last one in the stream. + * You should use :type:`nghttp2_on_frame_recv_callback` to know all + * data frames are received. The |user_data| pointer is the third + * argument passed in to the call to `nghttp2_session_client_new()` or + * `nghttp2_session_server_new()`. + * + * If the application uses `nghttp2_session_mem_recv2()`, it can + * return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` to make + * `nghttp2_session_mem_recv2()` return without processing further + * input bytes. The memory by pointed by the |data| is retained until + * `nghttp2_session_mem_recv2()` or `nghttp2_session_recv()` is + * called. The application must retain the input bytes which was used + * to produce the |data| parameter, because it may refer to the memory + * region included in the input bytes. + * + * The implementation of this function must return 0 if it succeeds. + * If nonzero is returned, it is treated as fatal error, and + * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_data_chunk_recv_callback()`. + */ +typedef int (*nghttp2_on_data_chunk_recv_callback)(nghttp2_session *session, + uint8_t flags, + int32_t stream_id, + const uint8_t *data, + size_t len, void *user_data); + +/** + * @functypedef + * + * Callback function invoked just before the non-DATA frame |frame| is + * sent. The |user_data| pointer is the third argument passed in to + * the call to `nghttp2_session_client_new()` or + * `nghttp2_session_server_new()`. + * + * The implementation of this function must return 0 if it succeeds. + * It can also return :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL` to + * cancel the transmission of the given frame. + * + * If there is a fatal error while executing this callback, the + * implementation should return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, which makes + * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * If the other value is returned, it is treated as if + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned. + * But the implementation should not rely on this since the library + * may define new return value to extend its capability. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_before_frame_send_callback()`. + */ +typedef int (*nghttp2_before_frame_send_callback)(nghttp2_session *session, + const nghttp2_frame *frame, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked after the frame |frame| is sent. The + * |user_data| pointer is the third argument passed in to the call to + * `nghttp2_session_client_new()` or `nghttp2_session_server_new()`. + * + * The implementation of this function must return 0 if it succeeds. + * If nonzero is returned, it is treated as fatal error and + * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_frame_send_callback()`. + */ +typedef int (*nghttp2_on_frame_send_callback)(nghttp2_session *session, + const nghttp2_frame *frame, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked after the non-DATA frame |frame| is not + * sent because of the error. The error is indicated by the + * |lib_error_code|, which is one of the values defined in + * :type:`nghttp2_error`. The |user_data| pointer is the third + * argument passed in to the call to `nghttp2_session_client_new()` or + * `nghttp2_session_server_new()`. + * + * The implementation of this function must return 0 if it succeeds. + * If nonzero is returned, it is treated as fatal error and + * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * `nghttp2_session_get_stream_user_data()` can be used to get + * associated data. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_frame_not_send_callback()`. + */ +typedef int (*nghttp2_on_frame_not_send_callback)(nghttp2_session *session, + const nghttp2_frame *frame, + int lib_error_code, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when the stream |stream_id| is closed. + * The reason of closure is indicated by the |error_code|. The + * |error_code| is usually one of :enum:`nghttp2_error_code`, but that + * is not guaranteed. The stream_user_data, which was specified in + * `nghttp2_submit_request2()` or `nghttp2_submit_headers()`, is still + * available in this function. The |user_data| pointer is the third + * argument passed in to the call to `nghttp2_session_client_new()` or + * `nghttp2_session_server_new()`. + * + * This function is also called for a stream in reserved state. + * + * The implementation of this function must return 0 if it succeeds. + * If nonzero is returned, it is treated as fatal error and + * `nghttp2_session_recv()`, `nghttp2_session_mem_recv2()`, + * `nghttp2_session_send()`, and `nghttp2_session_mem_send2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_stream_close_callback()`. + */ +typedef int (*nghttp2_on_stream_close_callback)(nghttp2_session *session, + int32_t stream_id, + uint32_t error_code, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when the reception of header block in + * HEADERS or PUSH_PROMISE is started. Each header name/value pair + * will be emitted by :type:`nghttp2_on_header_callback`. + * + * The ``frame->hd.flags`` may not have + * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_HEADERS` flag set, which + * indicates that one or more CONTINUATION frames are involved. But + * the application does not need to care about that because the header + * name/value pairs are emitted transparently regardless of + * CONTINUATION frames. + * + * The server applications probably create an object to store + * information about new stream if ``frame->hd.type == + * NGHTTP2_HEADERS`` and ``frame->headers.cat == + * NGHTTP2_HCAT_REQUEST``. If |session| is configured as server side, + * ``frame->headers.cat`` is either ``NGHTTP2_HCAT_REQUEST`` + * containing request headers or ``NGHTTP2_HCAT_HEADERS`` containing + * trailer fields and never get PUSH_PROMISE in this callback. + * + * For the client applications, ``frame->hd.type`` is either + * ``NGHTTP2_HEADERS`` or ``NGHTTP2_PUSH_PROMISE``. In case of + * ``NGHTTP2_HEADERS``, ``frame->headers.cat == + * NGHTTP2_HCAT_RESPONSE`` means that it is the first response + * headers, but it may be non-final response which is indicated by 1xx + * status code. In this case, there may be zero or more HEADERS frame + * with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS`` which has + * non-final response code and finally client gets exactly one HEADERS + * frame with ``frame->headers.cat == NGHTTP2_HCAT_HEADERS`` + * containing final response headers (non-1xx status code). The + * trailer fields also has ``frame->headers.cat == + * NGHTTP2_HCAT_HEADERS`` which does not contain any status code. + * + * Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will + * close the stream (promised stream if frame is PUSH_PROMISE) by + * issuing RST_STREAM with + * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. In this case, + * :type:`nghttp2_on_header_callback` and + * :type:`nghttp2_on_frame_recv_callback` will not be invoked. If a + * different error code is desirable, use + * `nghttp2_submit_rst_stream()` with a desired error code and then + * return :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. + * Again, use ``frame->push_promise.promised_stream_id`` as stream_id + * parameter in `nghttp2_submit_rst_stream()` if frame is + * PUSH_PROMISE. + * + * The implementation of this function must return 0 if it succeeds. + * It can return + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` to + * reset the stream (promised stream if frame is PUSH_PROMISE). For + * critical errors, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other + * value is returned, it is treated as if + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned. If + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned, + * `nghttp2_session_mem_recv2()` function will immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_begin_headers_callback()`. + */ +typedef int (*nghttp2_on_begin_headers_callback)(nghttp2_session *session, + const nghttp2_frame *frame, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when a header name/value pair is received + * for the |frame|. The |name| of length |namelen| is header name. + * The |value| of length |valuelen| is header value. The |flags| is + * bitwise OR of one or more of :type:`nghttp2_nv_flag`. + * + * If :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_INDEX` is set in + * |flags|, the receiver must not index this name/value pair when + * forwarding it to the next hop. More specifically, "Literal Header + * Field never Indexed" representation must be used in HPACK encoding. + * + * When this callback is invoked, ``frame->hd.type`` is either + * :enum:`nghttp2_frame_type.NGHTTP2_HEADERS` or + * :enum:`nghttp2_frame_type.NGHTTP2_PUSH_PROMISE`. After all header + * name/value pairs are processed with this callback, and no error has + * been detected, :type:`nghttp2_on_frame_recv_callback` will be + * invoked. If there is an error in decompression, + * :type:`nghttp2_on_frame_recv_callback` for the |frame| will not be + * invoked. + * + * Both |name| and |value| are guaranteed to be NULL-terminated. The + * |namelen| and |valuelen| do not include terminal NULL. If + * `nghttp2_option_set_no_http_messaging()` is used with nonzero + * value, NULL character may be included in |name| or |value| before + * terminating NULL. + * + * Please note that unless `nghttp2_option_set_no_http_messaging()` is + * used, nghttp2 library does perform validation against the |name| + * and the |value| using `nghttp2_check_header_name()` and + * `nghttp2_check_header_value()`. In addition to this, nghttp2 + * performs validation based on HTTP Messaging rule, which is briefly + * explained in :ref:`http-messaging` section. + * + * If the application uses `nghttp2_session_mem_recv2()`, it can + * return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` to make + * `nghttp2_session_mem_recv2()` return without processing further + * input bytes. The memory pointed by |frame|, |name| and |value| + * parameters are retained until `nghttp2_session_mem_recv2()` or + * `nghttp2_session_recv()` is called. The application must retain + * the input bytes which was used to produce these parameters, because + * it may refer to the memory region included in the input bytes. + * + * Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` will + * close the stream (promised stream if frame is PUSH_PROMISE) by + * issuing RST_STREAM with + * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. In this case, + * :type:`nghttp2_on_header_callback` and + * :type:`nghttp2_on_frame_recv_callback` will not be invoked. If a + * different error code is desirable, use + * `nghttp2_submit_rst_stream()` with a desired error code and then + * return :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. + * Again, use ``frame->push_promise.promised_stream_id`` as stream_id + * parameter in `nghttp2_submit_rst_stream()` if frame is + * PUSH_PROMISE. + * + * The implementation of this function must return 0 if it succeeds. + * It may return :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` or + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. For + * other critical failures, it must return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other + * nonzero value is returned, it is treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` is returned, + * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_header_callback()`. + * + * .. warning:: + * + * Application should properly limit the total buffer size to store + * incoming header fields. Without it, peer may send large number + * of header fields or large header fields to cause out of memory in + * local endpoint. Due to how HPACK works, peer can do this + * effectively without using much memory on their own. + */ +typedef int (*nghttp2_on_header_callback)(nghttp2_session *session, + const nghttp2_frame *frame, + const uint8_t *name, size_t namelen, + const uint8_t *value, size_t valuelen, + uint8_t flags, void *user_data); + +/** + * @functypedef + * + * Callback function invoked when a header name/value pair is received + * for the |frame|. The |name| is header name. The |value| is header + * value. The |flags| is bitwise OR of one or more of + * :type:`nghttp2_nv_flag`. + * + * This callback behaves like :type:`nghttp2_on_header_callback`, + * except that |name| and |value| are stored in reference counted + * buffer. If application wishes to keep these references without + * copying them, use `nghttp2_rcbuf_incref()` to increment their + * reference count. It is the application's responsibility to call + * `nghttp2_rcbuf_decref()` if they called `nghttp2_rcbuf_incref()` so + * as not to leak memory. If the |session| is created by + * `nghttp2_session_server_new3()` or `nghttp2_session_client_new3()`, + * the function to free memory is the one belongs to the mem + * parameter. As long as this free function alives, |name| and + * |value| can live after |session| was destroyed. + */ +typedef int (*nghttp2_on_header_callback2)(nghttp2_session *session, + const nghttp2_frame *frame, + nghttp2_rcbuf *name, + nghttp2_rcbuf *value, uint8_t flags, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when an invalid header name/value pair is + * received for the |frame|. + * + * The parameter and behaviour are similar to + * :type:`nghttp2_on_header_callback`. The difference is that this + * callback is only invoked when an invalid header name/value pair is + * received which is treated as stream error if this callback returns + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE` and + * :type:`nghttp2_on_invalid_header_callback2` is not set. Only + * invalid regular header field are passed to this callback. In other + * words, invalid pseudo header field is not passed to this callback. + * Also header fields which includes upper cased latter are also + * treated as error without passing them to this callback. + * + * This callback is only considered if HTTP messaging validation is + * turned on (which is on by default, see + * `nghttp2_option_set_no_http_messaging()`). + * + * With this callback, application inspects the incoming invalid + * field, and it also can reset stream from this callback by returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. By + * default, the error code is + * :enum:`nghttp2_error_code.NGHTTP2_PROTOCOL_ERROR`. To change the + * error code, call `nghttp2_submit_rst_stream()` with the error code + * of choice in addition to returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. + * + * If 0 is returned, the header field is ignored, and the stream is + * not reset. + */ +typedef int (*nghttp2_on_invalid_header_callback)( + nghttp2_session *session, const nghttp2_frame *frame, const uint8_t *name, + size_t namelen, const uint8_t *value, size_t valuelen, uint8_t flags, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when an invalid header name/value pair is + * received for the |frame|. + * + * The parameter and behaviour are similar to + * :type:`nghttp2_on_header_callback2`. The difference is that this + * callback is only invoked when an invalid header name/value pair is + * received which is silently ignored if neither this callback nor + * :type:`nghttp2_on_invalid_header_callback` is set. Only invalid + * regular header field are passed to this callback. In other words, + * invalid pseudo header field is not passed to this callback. Also + * header fields which includes upper cased latter are also treated as + * error without passing them to this callback. + * + * This callback is only considered if HTTP messaging validation is + * turned on (which is on by default, see + * `nghttp2_option_set_no_http_messaging()`). + * + * With this callback, application inspects the incoming invalid + * field, and it also can reset stream from this callback by returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. By + * default, the error code is + * :enum:`nghttp2_error_code.NGHTTP2_INTERNAL_ERROR`. To change the + * error code, call `nghttp2_submit_rst_stream()` with the error code + * of choice in addition to returning + * :enum:`nghttp2_error.NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. + */ +typedef int (*nghttp2_on_invalid_header_callback2)( + nghttp2_session *session, const nghttp2_frame *frame, nghttp2_rcbuf *name, + nghttp2_rcbuf *value, uint8_t flags, void *user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @functypedef + * + * .. warning:: + * + * Deprecated. Use :type:`nghttp2_select_padding_callback2` + * instead. + * + * Callback function invoked when the library asks application how + * many padding bytes are required for the transmission of the + * |frame|. The application must choose the total length of payload + * including padded bytes in range [frame->hd.length, max_payloadlen], + * inclusive. Choosing number not in this range will be treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Returning + * ``frame->hd.length`` means no padding is added. Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will make + * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions + * immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_select_padding_callback()`. + */ +typedef ssize_t (*nghttp2_select_padding_callback)(nghttp2_session *session, + const nghttp2_frame *frame, + size_t max_payloadlen, + void *user_data); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @functypedef + * + * Callback function invoked when the library asks application how + * many padding bytes are required for the transmission of the + * |frame|. The application must choose the total length of payload + * including padded bytes in range [frame->hd.length, max_payloadlen], + * inclusive. Choosing number not in this range will be treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Returning + * ``frame->hd.length`` means no padding is added. Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will make + * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_select_padding_callback2()`. + */ +typedef nghttp2_ssize (*nghttp2_select_padding_callback2)( + nghttp2_session *session, const nghttp2_frame *frame, size_t max_payloadlen, + void *user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @functypedef + * + * .. warning:: + * + * Deprecated. Use + * :type:`nghttp2_data_source_read_length_callback2` instead. + * + * Callback function invoked when library wants to get max length of + * data to send data to the remote peer. The implementation of this + * function should return a value in the following range. [1, + * min(|session_remote_window_size|, |stream_remote_window_size|, + * |remote_max_frame_size|)]. If a value greater than this range is + * returned than the max allow value will be used. Returning a value + * smaller than this range is treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The + * |frame_type| is provided for future extensibility and identifies + * the type of frame (see :type:`nghttp2_frame_type`) for which to get + * the length for. Currently supported frame types are: + * :enum:`nghttp2_frame_type.NGHTTP2_DATA`. + * + * This callback can be used to control the length in bytes for which + * :type:`nghttp2_data_source_read_callback` is allowed to send to the + * remote endpoint. This callback is optional. Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will signal the + * entire session failure. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_data_source_read_length_callback()`. + */ +typedef ssize_t (*nghttp2_data_source_read_length_callback)( + nghttp2_session *session, uint8_t frame_type, int32_t stream_id, + int32_t session_remote_window_size, int32_t stream_remote_window_size, + uint32_t remote_max_frame_size, void *user_data); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @functypedef + * + * Callback function invoked when library wants to get max length of + * data to send data to the remote peer. The implementation of this + * function should return a value in the following range. [1, + * min(|session_remote_window_size|, |stream_remote_window_size|, + * |remote_max_frame_size|)]. If a value greater than this range is + * returned than the max allow value will be used. Returning a value + * smaller than this range is treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. The + * |frame_type| is provided for future extensibility and identifies + * the type of frame (see :type:`nghttp2_frame_type`) for which to get + * the length for. Currently supported frame types are: + * :enum:`nghttp2_frame_type.NGHTTP2_DATA`. + * + * This callback can be used to control the length in bytes for which + * :type:`nghttp2_data_source_read_callback` is allowed to send to the + * remote endpoint. This callback is optional. Returning + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` will signal the + * entire session failure. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_data_source_read_length_callback2()`. + */ +typedef nghttp2_ssize (*nghttp2_data_source_read_length_callback2)( + nghttp2_session *session, uint8_t frame_type, int32_t stream_id, + int32_t session_remote_window_size, int32_t stream_remote_window_size, + uint32_t remote_max_frame_size, void *user_data); + +/** + * @functypedef + * + * Callback function invoked when a frame header is received. The + * |hd| points to received frame header. + * + * Unlike :type:`nghttp2_on_frame_recv_callback`, this callback will + * also be called when frame header of CONTINUATION frame is received. + * + * If both :type:`nghttp2_on_begin_frame_callback` and + * :type:`nghttp2_on_begin_headers_callback` are set and HEADERS or + * PUSH_PROMISE is received, :type:`nghttp2_on_begin_frame_callback` + * will be called first. + * + * The implementation of this function must return 0 if it succeeds. + * If nonzero value is returned, it is treated as fatal error and + * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * + * To set this callback to :type:`nghttp2_session_callbacks`, use + * `nghttp2_session_callbacks_set_on_begin_frame_callback()`. + */ +typedef int (*nghttp2_on_begin_frame_callback)(nghttp2_session *session, + const nghttp2_frame_hd *hd, + void *user_data); + +/** + * @functypedef + * + * Callback function invoked when chunk of extension frame payload is + * received. The |hd| points to frame header. The received + * chunk is |data| of length |len|. + * + * The implementation of this function must return 0 if it succeeds. + * + * To abort processing this extension frame, return + * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`. + * + * If fatal error occurred, application should return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, + * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other + * values are returned, currently they are treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + */ +typedef int (*nghttp2_on_extension_chunk_recv_callback)( + nghttp2_session *session, const nghttp2_frame_hd *hd, const uint8_t *data, + size_t len, void *user_data); + +/** + * @functypedef + * + * Callback function invoked when library asks the application to + * unpack extension payload from its wire format. The extension + * payload has been passed to the application using + * :type:`nghttp2_on_extension_chunk_recv_callback`. The frame header + * is already unpacked by the library and provided as |hd|. + * + * To receive extension frames, the application must tell desired + * extension frame type to the library using + * `nghttp2_option_set_user_recv_extension_type()`. + * + * The implementation of this function may store the pointer to the + * created object as a result of unpacking in |*payload|, and returns + * 0. The pointer stored in |*payload| is opaque to the library, and + * the library does not own its pointer. |*payload| is initialized as + * ``NULL``. The |*payload| is available as ``frame->ext.payload`` in + * :type:`nghttp2_on_frame_recv_callback`. Therefore if application + * can free that memory inside :type:`nghttp2_on_frame_recv_callback` + * callback. Of course, application has a liberty not to use + * |*payload|, and do its own mechanism to process extension frames. + * + * To abort processing this extension frame, return + * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`. + * + * If fatal error occurred, application should return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, + * `nghttp2_session_recv()` and `nghttp2_session_mem_recv2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other + * values are returned, currently they are treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + */ +typedef int (*nghttp2_unpack_extension_callback)(nghttp2_session *session, + void **payload, + const nghttp2_frame_hd *hd, + void *user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @functypedef + * + * .. warning:: + * + * Deprecated. Use :type:`nghttp2_pack_extension_callback2` + * instead. + * + * Callback function invoked when library asks the application to pack + * extension payload in its wire format. The frame header will be + * packed by library. Application must pack payload only. + * ``frame->ext.payload`` is the object passed to + * `nghttp2_submit_extension()` as payload parameter. Application + * must pack extension payload to the |buf| of its capacity |len| + * bytes. The |len| is at least 16KiB. + * + * The implementation of this function should return the number of + * bytes written into |buf| when it succeeds. + * + * To abort processing this extension frame, return + * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`, and + * :type:`nghttp2_on_frame_not_send_callback` will be invoked. + * + * If fatal error occurred, application should return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, + * `nghttp2_session_send()` and `nghttp2_session_mem_send()` functions + * immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other + * values are returned, currently they are treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the return + * value is strictly larger than |len|, it is treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + */ +typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session, + uint8_t *buf, size_t len, + const nghttp2_frame *frame, + void *user_data); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @functypedef + * + * Callback function invoked when library asks the application to pack + * extension payload in its wire format. The frame header will be + * packed by library. Application must pack payload only. + * ``frame->ext.payload`` is the object passed to + * `nghttp2_submit_extension()` as payload parameter. Application + * must pack extension payload to the |buf| of its capacity |len| + * bytes. The |len| is at least 16KiB. + * + * The implementation of this function should return the number of + * bytes written into |buf| when it succeeds. + * + * To abort processing this extension frame, return + * :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL`, and + * :type:`nghttp2_on_frame_not_send_callback` will be invoked. + * + * If fatal error occurred, application should return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, + * `nghttp2_session_send()` and `nghttp2_session_mem_send2()` + * functions immediately return + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the other + * values are returned, currently they are treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. If the return + * value is strictly larger than |len|, it is treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + */ +typedef nghttp2_ssize (*nghttp2_pack_extension_callback2)( + nghttp2_session *session, uint8_t *buf, size_t len, + const nghttp2_frame *frame, void *user_data); + +/** + * @functypedef + * + * .. warning:: + * + * Deprecated. Use :type:`nghttp2_error_callback2` instead. + * + * Callback function invoked when library provides the error message + * intended for human consumption. This callback is solely for + * debugging purpose. The |msg| is typically NULL-terminated string + * of length |len|. |len| does not include the sentinel NULL + * character. + * + * The format of error message may change between nghttp2 library + * versions. The application should not depend on the particular + * format. + * + * Normally, application should return 0 from this callback. If fatal + * error occurred while doing something in this callback, application + * should return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * In this case, library will return immediately with return value + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Currently, if + * nonzero value is returned from this callback, they are treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, but application + * should not rely on this details. + */ +typedef int (*nghttp2_error_callback)(nghttp2_session *session, const char *msg, + size_t len, void *user_data); + +/** + * @functypedef + * + * Callback function invoked when library provides the error code, and + * message. This callback is solely for debugging purpose. + * |lib_error_code| is one of error code defined in + * :enum:`nghttp2_error`. The |msg| is typically NULL-terminated + * string of length |len|, and intended for human consumption. |len| + * does not include the sentinel NULL character. + * + * The format of error message may change between nghttp2 library + * versions. The application should not depend on the particular + * format. + * + * Normally, application should return 0 from this callback. If fatal + * error occurred while doing something in this callback, application + * should return :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. + * In this case, library will return immediately with return value + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`. Currently, if + * nonzero value is returned from this callback, they are treated as + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE`, but application + * should not rely on this details. + */ +typedef int (*nghttp2_error_callback2)(nghttp2_session *session, + int lib_error_code, const char *msg, + size_t len, void *user_data); + +/** + * @functypedef + * + * Callback function invoked when unpredictable data of |destlen| + * bytes are needed. The implementation must write unpredictable data + * of |destlen| bytes into the buffer pointed by |dest|. + */ +typedef void (*nghttp2_rand_callback)(uint8_t *dest, size_t destlen); + +struct nghttp2_session_callbacks; + +/** + * @struct + * + * Callback functions for :type:`nghttp2_session`. The details of + * this structure are intentionally hidden from the public API. + */ +typedef struct nghttp2_session_callbacks nghttp2_session_callbacks; + +/** + * @function + * + * Initializes |*callbacks_ptr| with NULL values. + * + * The initialized object can be used when initializing multiple + * :type:`nghttp2_session` objects. + * + * When the application finished using this object, it can use + * `nghttp2_session_callbacks_del()` to free its memory. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_session_callbacks_new(nghttp2_session_callbacks **callbacks_ptr); + +/** + * @function + * + * Frees any resources allocated for |callbacks|. If |callbacks| is + * ``NULL``, this function does nothing. + */ +NGHTTP2_EXTERN void +nghttp2_session_callbacks_del(nghttp2_session_callbacks *callbacks); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_session_callbacks_set_send_callback2()` + * with :type:`nghttp2_send_callback2` instead. + * + * Sets callback function invoked when a session wants to send data to + * the remote peer. This callback is not necessary if the application + * uses solely `nghttp2_session_mem_send()` to serialize data to + * transmit. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_callback( + nghttp2_session_callbacks *cbs, nghttp2_send_callback send_callback); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Sets callback function invoked when a session wants to send data to + * the remote peer. This callback is not necessary if the application + * uses solely `nghttp2_session_mem_send2()` to serialize data to + * transmit. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_callback2( + nghttp2_session_callbacks *cbs, nghttp2_send_callback2 send_callback); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_session_callbacks_set_recv_callback2()` + * with :type:`nghttp2_recv_callback2` instead. + * + * Sets callback function invoked when the a session wants to receive + * data from the remote peer. This callback is not necessary if the + * application uses solely `nghttp2_session_mem_recv()` to process + * received data. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_recv_callback( + nghttp2_session_callbacks *cbs, nghttp2_recv_callback recv_callback); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Sets callback function invoked when the a session wants to receive + * data from the remote peer. This callback is not necessary if the + * application uses solely `nghttp2_session_mem_recv2()` to process + * received data. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_recv_callback2( + nghttp2_session_callbacks *cbs, nghttp2_recv_callback2 recv_callback); + +/** + * @function + * + * Sets callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv2()` when a frame is received. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_recv_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_frame_recv_callback on_frame_recv_callback); + +/** + * @function + * + * Sets callback function invoked by `nghttp2_session_recv()` and + * `nghttp2_session_mem_recv2()` when an invalid non-DATA frame is + * received. + */ +NGHTTP2_EXTERN void +nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_invalid_frame_recv_callback on_invalid_frame_recv_callback); + +/** + * @function + * + * Sets callback function invoked when a chunk of data in DATA frame + * is received. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_data_chunk_recv_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_data_chunk_recv_callback on_data_chunk_recv_callback); + +/** + * @function + * + * Sets callback function invoked before a non-DATA frame is sent. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_before_frame_send_callback( + nghttp2_session_callbacks *cbs, + nghttp2_before_frame_send_callback before_frame_send_callback); + +/** + * @function + * + * Sets callback function invoked after a frame is sent. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_send_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_frame_send_callback on_frame_send_callback); + +/** + * @function + * + * Sets callback function invoked when a non-DATA frame is not sent + * because of an error. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_frame_not_send_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_frame_not_send_callback on_frame_not_send_callback); + +/** + * @function + * + * Sets callback function invoked when the stream is closed. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_stream_close_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_stream_close_callback on_stream_close_callback); + +/** + * @function + * + * Sets callback function invoked when the reception of header block + * in HEADERS or PUSH_PROMISE is started. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_begin_headers_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_begin_headers_callback on_begin_headers_callback); + +/** + * @function + * + * Sets callback function invoked when a header name/value pair is + * received. If both + * `nghttp2_session_callbacks_set_on_header_callback()` and + * `nghttp2_session_callbacks_set_on_header_callback2()` are used to + * set callbacks, the latter has the precedence. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_header_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_header_callback on_header_callback); + +/** + * @function + * + * Sets callback function invoked when a header name/value pair is + * received. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_header_callback2( + nghttp2_session_callbacks *cbs, + nghttp2_on_header_callback2 on_header_callback2); + +/** + * @function + * + * Sets callback function invoked when an invalid header name/value + * pair is received. If both + * `nghttp2_session_callbacks_set_on_invalid_header_callback()` and + * `nghttp2_session_callbacks_set_on_invalid_header_callback2()` are + * used to set callbacks, the latter takes the precedence. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_invalid_header_callback on_invalid_header_callback); + +/** + * @function + * + * Sets callback function invoked when an invalid header name/value + * pair is received. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_invalid_header_callback2( + nghttp2_session_callbacks *cbs, + nghttp2_on_invalid_header_callback2 on_invalid_header_callback2); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use + * `nghttp2_session_callbacks_set_select_padding_callback2()` with + * :type:`nghttp2_select_padding_callback2` instead. + * + * Sets callback function invoked when the library asks application + * how many padding bytes are required for the transmission of the + * given frame. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_select_padding_callback( + nghttp2_session_callbacks *cbs, + nghttp2_select_padding_callback select_padding_callback); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Sets callback function invoked when the library asks application + * how many padding bytes are required for the transmission of the + * given frame. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_select_padding_callback2( + nghttp2_session_callbacks *cbs, + nghttp2_select_padding_callback2 select_padding_callback); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use + * `nghttp2_session_callbacks_set_data_source_read_length_callback2()` + * with :type:`nghttp2_data_source_read_length_callback2` instead. + * + * Sets callback function determine the length allowed in + * :type:`nghttp2_data_source_read_callback`. + */ +NGHTTP2_EXTERN void +nghttp2_session_callbacks_set_data_source_read_length_callback( + nghttp2_session_callbacks *cbs, + nghttp2_data_source_read_length_callback data_source_read_length_callback); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Sets callback function determine the length allowed in + * :type:`nghttp2_data_source_read_callback2`. + */ +NGHTTP2_EXTERN void +nghttp2_session_callbacks_set_data_source_read_length_callback2( + nghttp2_session_callbacks *cbs, + nghttp2_data_source_read_length_callback2 data_source_read_length_callback); + +/** + * @function + * + * Sets callback function invoked when a frame header is received. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_on_begin_frame_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_begin_frame_callback on_begin_frame_callback); + +/** + * @function + * + * Sets callback function invoked when + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_COPY` is used in + * :type:`nghttp2_data_source_read_callback2` to avoid data copy. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_send_data_callback( + nghttp2_session_callbacks *cbs, + nghttp2_send_data_callback send_data_callback); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use + * `nghttp2_session_callbacks_set_pack_extension_callback2()` with + * :type:`nghttp2_pack_extension_callback2` instead. + * + * Sets callback function invoked when the library asks the + * application to pack extension frame payload in wire format. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_pack_extension_callback( + nghttp2_session_callbacks *cbs, + nghttp2_pack_extension_callback pack_extension_callback); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Sets callback function invoked when the library asks the + * application to pack extension frame payload in wire format. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_pack_extension_callback2( + nghttp2_session_callbacks *cbs, + nghttp2_pack_extension_callback2 pack_extension_callback); + +/** + * @function + * + * Sets callback function invoked when the library asks the + * application to unpack extension frame payload from wire format. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_unpack_extension_callback( + nghttp2_session_callbacks *cbs, + nghttp2_unpack_extension_callback unpack_extension_callback); + +/** + * @function + * + * Sets callback function invoked when chunk of extension frame + * payload is received. + */ +NGHTTP2_EXTERN void +nghttp2_session_callbacks_set_on_extension_chunk_recv_callback( + nghttp2_session_callbacks *cbs, + nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback); + +/** + * @function + * + * .. warning:: + * + * Deprecated. Use + * `nghttp2_session_callbacks_set_error_callback2()` with + * :type:`nghttp2_error_callback2` instead. + * + * Sets callback function invoked when library tells error message to + * the application. + * + * If both :type:`nghttp2_error_callback` and + * :type:`nghttp2_error_callback2` are set, the latter takes + * precedence. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback( + nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback); + +/** + * @function + * + * Sets callback function invoked when library tells error code, and + * message to the application. + * + * If both :type:`nghttp2_error_callback` and + * :type:`nghttp2_error_callback2` are set, the latter takes + * precedence. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback2( + nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2); + +/** + * @function + * + * Sets callback function invoked when unpredictable data is needed. + * Although this callback is optional due to the backward + * compatibility, it is recommended to specify it to harden the + * runtime behavior against suspicious activities of a remote + * endpoint. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_rand_callback( + nghttp2_session_callbacks *cbs, nghttp2_rand_callback rand_callback); + +/** + * @functypedef + * + * Custom memory allocator to replace malloc(). The |mem_user_data| + * is the mem_user_data member of :type:`nghttp2_mem` structure. + */ +typedef void *(*nghttp2_malloc)(size_t size, void *mem_user_data); + +/** + * @functypedef + * + * Custom memory allocator to replace free(). The |mem_user_data| is + * the mem_user_data member of :type:`nghttp2_mem` structure. + */ +typedef void (*nghttp2_free)(void *ptr, void *mem_user_data); + +/** + * @functypedef + * + * Custom memory allocator to replace calloc(). The |mem_user_data| + * is the mem_user_data member of :type:`nghttp2_mem` structure. + */ +typedef void *(*nghttp2_calloc)(size_t nmemb, size_t size, void *mem_user_data); + +/** + * @functypedef + * + * Custom memory allocator to replace realloc(). The |mem_user_data| + * is the mem_user_data member of :type:`nghttp2_mem` structure. + */ +typedef void *(*nghttp2_realloc)(void *ptr, size_t size, void *mem_user_data); + +/** + * @struct + * + * Custom memory allocator functions and user defined pointer. The + * |mem_user_data| member is passed to each allocator function. This + * can be used, for example, to achieve per-session memory pool. + * + * In the following example code, ``my_malloc``, ``my_free``, + * ``my_calloc`` and ``my_realloc`` are the replacement of the + * standard allocators ``malloc``, ``free``, ``calloc`` and + * ``realloc`` respectively:: + * + * void *my_malloc_cb(size_t size, void *mem_user_data) { + * return my_malloc(size); + * } + * + * void my_free_cb(void *ptr, void *mem_user_data) { my_free(ptr); } + * + * void *my_calloc_cb(size_t nmemb, size_t size, void *mem_user_data) { + * return my_calloc(nmemb, size); + * } + * + * void *my_realloc_cb(void *ptr, size_t size, void *mem_user_data) { + * return my_realloc(ptr, size); + * } + * + * void session_new() { + * nghttp2_session *session; + * nghttp2_session_callbacks *callbacks; + * nghttp2_mem mem = {NULL, my_malloc_cb, my_free_cb, my_calloc_cb, + * my_realloc_cb}; + * + * ... + * + * nghttp2_session_client_new3(&session, callbacks, NULL, NULL, &mem); + * + * ... + * } + */ +typedef struct { + /** + * An arbitrary user supplied data. This is passed to each + * allocator function. + */ + void *mem_user_data; + /** + * Custom allocator function to replace malloc(). + */ + nghttp2_malloc malloc; + /** + * Custom allocator function to replace free(). + */ + nghttp2_free free; + /** + * Custom allocator function to replace calloc(). + */ + nghttp2_calloc calloc; + /** + * Custom allocator function to replace realloc(). + */ + nghttp2_realloc realloc; +} nghttp2_mem; + +struct nghttp2_option; + +/** + * @struct + * + * Configuration options for :type:`nghttp2_session`. The details of + * this structure are intentionally hidden from the public API. + */ +typedef struct nghttp2_option nghttp2_option; + +/** + * @function + * + * Initializes |*option_ptr| with default values. + * + * When the application finished using this object, it can use + * `nghttp2_option_del()` to free its memory. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_option_new(nghttp2_option **option_ptr); + +/** + * @function + * + * Frees any resources allocated for |option|. If |option| is + * ``NULL``, this function does nothing. + */ +NGHTTP2_EXTERN void nghttp2_option_del(nghttp2_option *option); + +/** + * @function + * + * This option prevents the library from sending WINDOW_UPDATE for a + * connection automatically. If this option is set to nonzero, the + * library won't send WINDOW_UPDATE for DATA until application calls + * `nghttp2_session_consume()` to indicate the consumed amount of + * data. Don't use `nghttp2_submit_window_update()` for this purpose. + * By default, this option is set to zero. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_no_auto_window_update(nghttp2_option *option, int val); + +/** + * @function + * + * This option sets the SETTINGS_MAX_CONCURRENT_STREAMS value of + * remote endpoint as if it is received in SETTINGS frame. Without + * specifying this option, the maximum number of outgoing concurrent + * streams is initially limited to 100 to avoid issues when the local + * endpoint submits lots of requests before receiving initial SETTINGS + * frame from the remote endpoint, since sending them at once to the + * remote endpoint could lead to rejection of some of the requests. + * This value will be overwritten when the local endpoint receives + * initial SETTINGS frame from the remote endpoint, either to the + * value advertised in SETTINGS_MAX_CONCURRENT_STREAMS or to the + * default value (unlimited) if none was advertised. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_peer_max_concurrent_streams(nghttp2_option *option, + uint32_t val); + +/** + * @function + * + * By default, nghttp2 library, if configured as server, requires + * first 24 bytes of client magic byte string (MAGIC). In most cases, + * this will simplify the implementation of server. But sometimes + * server may want to detect the application protocol based on first + * few bytes on clear text communication. + * + * If this option is used with nonzero |val|, nghttp2 library does not + * handle MAGIC. It still checks following SETTINGS frame. This + * means that applications should deal with MAGIC by themselves. + * + * If this option is not used or used with zero value, if MAGIC does + * not match :macro:`NGHTTP2_CLIENT_MAGIC`, `nghttp2_session_recv()` + * and `nghttp2_session_mem_recv2()` will return error + * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC`, which is fatal + * error. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_no_recv_client_magic(nghttp2_option *option, int val); + +/** + * @function + * + * By default, nghttp2 library enforces subset of HTTP Messaging rules + * described in `HTTP/2 specification, section 8 + * `_. See + * :ref:`http-messaging` section for details. For those applications + * who use nghttp2 library as non-HTTP use, give nonzero to |val| to + * disable this enforcement. Please note that disabling this feature + * does not change the fundamental client and server model of HTTP. + * That is, even if the validation is disabled, only client can send + * requests. + */ +NGHTTP2_EXTERN void nghttp2_option_set_no_http_messaging(nghttp2_option *option, + int val); + +/** + * @function + * + * RFC 7540 does not enforce any limit on the number of incoming + * reserved streams (in RFC 7540 terms, streams in reserved (remote) + * state). This only affects client side, since only server can push + * streams. Malicious server can push arbitrary number of streams, + * and make client's memory exhausted. This option can set the + * maximum number of such incoming streams to avoid possible memory + * exhaustion. If this option is set, and pushed streams are + * automatically closed on reception, without calling user provided + * callback, if they exceed the given limit. The default value is + * 200. If session is configured as server side, this option has no + * effect. Server can control the number of streams to push. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_max_reserved_remote_streams(nghttp2_option *option, + uint32_t val); + +/** + * @function + * + * Sets extension frame type the application is willing to handle with + * user defined callbacks (see + * :type:`nghttp2_on_extension_chunk_recv_callback` and + * :type:`nghttp2_unpack_extension_callback`). The |type| is + * extension frame type, and must be strictly greater than 0x9. + * Otherwise, this function does nothing. The application can call + * this function multiple times to set more than one frame type to + * receive. The application does not have to call this function if it + * just sends extension frames. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_user_recv_extension_type(nghttp2_option *option, + uint8_t type); + +/** + * @function + * + * Sets extension frame type the application is willing to receive + * using builtin handler. The |type| is the extension frame type to + * receive, and must be strictly greater than 0x9. Otherwise, this + * function does nothing. The application can call this function + * multiple times to set more than one frame type to receive. The + * application does not have to call this function if it just sends + * extension frames. + * + * If same frame type is passed to both + * `nghttp2_option_set_builtin_recv_extension_type()` and + * `nghttp2_option_set_user_recv_extension_type()`, the latter takes + * precedence. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_builtin_recv_extension_type(nghttp2_option *option, + uint8_t type); + +/** + * @function + * + * This option prevents the library from sending PING frame with ACK + * flag set automatically when PING frame without ACK flag set is + * received. If this option is set to nonzero, the library won't send + * PING frame with ACK flag set in the response for incoming PING + * frame. The application can send PING frame with ACK flag set using + * `nghttp2_submit_ping()` with :enum:`nghttp2_flag.NGHTTP2_FLAG_ACK` + * as flags parameter. + */ +NGHTTP2_EXTERN void nghttp2_option_set_no_auto_ping_ack(nghttp2_option *option, + int val); + +/** + * @function + * + * This option sets the maximum length of header block (a set of + * header fields per one HEADERS frame) to send. The length of a + * given set of header fields is calculated using + * `nghttp2_hd_deflate_bound()`. The default value is 64KiB. If + * application attempts to send header fields larger than this limit, + * the transmission of the frame fails with error code + * :enum:`nghttp2_error.NGHTTP2_ERR_FRAME_SIZE_ERROR`. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_max_send_header_block_length(nghttp2_option *option, + size_t val); + +/** + * @function + * + * This option sets the maximum dynamic table size for deflating + * header fields. The default value is 4KiB. In HTTP/2, receiver of + * deflated header block can specify maximum dynamic table size. The + * actual maximum size is the minimum of the size receiver specified + * and this option value. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_max_deflate_dynamic_table_size(nghttp2_option *option, + size_t val); + +/** + * @function + * + * .. warning:: + * + * Deprecated. Closed streams are not retained anymore. + * + * This function works as before, but it does not take any effect + * against :type:`nghttp2_session`. + */ +NGHTTP2_EXTERN void nghttp2_option_set_no_closed_streams(nghttp2_option *option, + int val); + +/** + * @function + * + * This function sets the maximum number of outgoing SETTINGS ACK and + * PING ACK frames retained in :type:`nghttp2_session` object. If + * more than those frames are retained, the peer is considered to be + * misbehaving and session will be closed. The default value is 1000. + */ +NGHTTP2_EXTERN void nghttp2_option_set_max_outbound_ack(nghttp2_option *option, + size_t val); + +/** + * @function + * + * This function sets the maximum number of SETTINGS entries per + * SETTINGS frame that will be accepted. If more than those entries + * are received, the peer is considered to be misbehaving and session + * will be closed. The default value is 32. + */ +NGHTTP2_EXTERN void nghttp2_option_set_max_settings(nghttp2_option *option, + size_t val); + +/** + * @function + * + * .. warning:: + * Deprecated. :rfc:`7540` priorities have been removed. + * + * This function works as before, but it does not take any effect + * against :type:`nghttp2_session`. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_server_fallback_rfc7540_priorities(nghttp2_option *option, + int val); + +/** + * @function + * + * This option, if set to nonzero, turns off RFC 9113 leading and + * trailing white spaces validation against HTTP field value. Some + * important fields, such as HTTP/2 pseudo header fields, are + * validated more strictly and this option does not apply to them. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation( + nghttp2_option *option, int val); + +/** + * @function + * + * This function sets the rate limit for the incoming stream reset + * (RST_STREAM frame). It is server use only. It is a token-bucket + * based rate limiter. |burst| specifies the number of tokens that is + * initially available. The maximum number of tokens is capped to + * this value. |rate| specifies the number of tokens that are + * regenerated per second. An incoming RST_STREAM consumes one token. + * If there is no token available, GOAWAY is sent to tear down the + * connection. |burst| and |rate| default to 1000 and 33 + * respectively. + */ +NGHTTP2_EXTERN void +nghttp2_option_set_stream_reset_rate_limit(nghttp2_option *option, + uint64_t burst, uint64_t rate); + +/** + * @function + * + * This function sets the maximum number of CONTINUATION frames + * following an incoming HEADER frame. If more than those frames are + * received, the remote endpoint is considered to be misbehaving and + * session will be closed. The default value is 8. + */ +NGHTTP2_EXTERN void nghttp2_option_set_max_continuations(nghttp2_option *option, + size_t val); + +/** + * @function + * + * This function sets the rate limit for the "glitches", the + * suspicious activities from a remote endpoint. It is a token-bucket + * based rate limiter. |burst| specifies the number of tokens that is + * initially available. The maximum number of tokens is capped to + * this value. |rate| specifies the number of tokens that are + * regenerated per second. When a suspicious activity is detected, + * some amount of tokens are consumed. If there is no token + * available, GOAWAY is sent to tear down the connection. |burst| and + * |rate| default to 1000 and 33 respectively. + */ +NGHTTP2_EXTERN void nghttp2_option_set_glitch_rate_limit(nghttp2_option *option, + uint64_t burst, + uint64_t rate); + +/** + * @function + * + * Initializes |*session_ptr| for client use. The all members of + * |callbacks| are copied to |*session_ptr|. Therefore |*session_ptr| + * does not store |callbacks|. The |user_data| is an arbitrary user + * supplied data, which will be passed to the callback functions. + * + * The :type:`nghttp2_send_callback2` must be specified. If the + * application code uses `nghttp2_session_recv()`, the + * :type:`nghttp2_recv_callback` must be specified. The other members + * of |callbacks| can be ``NULL``. + * + * If this function fails, |*session_ptr| is left untouched. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_session_client_new(nghttp2_session **session_ptr, + const nghttp2_session_callbacks *callbacks, + void *user_data); + +/** + * @function + * + * Initializes |*session_ptr| for server use. The all members of + * |callbacks| are copied to |*session_ptr|. Therefore |*session_ptr| + * does not store |callbacks|. The |user_data| is an arbitrary user + * supplied data, which will be passed to the callback functions. + * + * The :type:`nghttp2_send_callback2` must be specified. If the + * application code uses `nghttp2_session_recv()`, the + * :type:`nghttp2_recv_callback` must be specified. The other members + * of |callbacks| can be ``NULL``. + * + * If this function fails, |*session_ptr| is left untouched. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_session_server_new(nghttp2_session **session_ptr, + const nghttp2_session_callbacks *callbacks, + void *user_data); + +/** + * @function + * + * Like `nghttp2_session_client_new()`, but with additional options + * specified in the |option|. + * + * The |option| can be ``NULL`` and the call is equivalent to + * `nghttp2_session_client_new()`. + * + * This function does not take ownership |option|. The application is + * responsible for freeing |option| if it finishes using the object. + * + * The library code does not refer to |option| after this function + * returns. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_session_client_new2(nghttp2_session **session_ptr, + const nghttp2_session_callbacks *callbacks, + void *user_data, const nghttp2_option *option); + +/** + * @function + * + * Like `nghttp2_session_server_new()`, but with additional options + * specified in the |option|. + * + * The |option| can be ``NULL`` and the call is equivalent to + * `nghttp2_session_server_new()`. + * + * This function does not take ownership |option|. The application is + * responsible for freeing |option| if it finishes using the object. + * + * The library code does not refer to |option| after this function + * returns. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_session_server_new2(nghttp2_session **session_ptr, + const nghttp2_session_callbacks *callbacks, + void *user_data, const nghttp2_option *option); + +/** + * @function + * + * Like `nghttp2_session_client_new2()`, but with additional custom + * memory allocator specified in the |mem|. + * + * The |mem| can be ``NULL`` and the call is equivalent to + * `nghttp2_session_client_new2()`. + * + * This function does not take ownership |mem|. The application is + * responsible for freeing |mem|. + * + * The library code does not refer to |mem| pointer after this + * function returns, so the application can safely free it. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_session_client_new3( + nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, + void *user_data, const nghttp2_option *option, nghttp2_mem *mem); + +/** + * @function + * + * Like `nghttp2_session_server_new2()`, but with additional custom + * memory allocator specified in the |mem|. + * + * The |mem| can be ``NULL`` and the call is equivalent to + * `nghttp2_session_server_new2()`. + * + * This function does not take ownership |mem|. The application is + * responsible for freeing |mem|. + * + * The library code does not refer to |mem| pointer after this + * function returns, so the application can safely free it. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_session_server_new3( + nghttp2_session **session_ptr, const nghttp2_session_callbacks *callbacks, + void *user_data, const nghttp2_option *option, nghttp2_mem *mem); + +/** + * @function + * + * Frees any resources allocated for |session|. If |session| is + * ``NULL``, this function does nothing. + */ +NGHTTP2_EXTERN void nghttp2_session_del(nghttp2_session *session); + +/** + * @function + * + * Sends pending frames to the remote peer. + * + * This function retrieves the highest prioritized frame from the + * outbound queue and sends it to the remote peer. It does this as + * many times as possible until the user callback + * :type:`nghttp2_send_callback2` returns + * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`, the outbound queue + * becomes empty or flow control is triggered (remote window size + * becomes depleted or maximum number of concurrent streams is + * reached). This function calls several callback functions which are + * passed when initializing the |session|. Here is the simple time + * chart which tells when each callback is invoked: + * + * 1. Get the next frame to send from outbound queue. + * + * 2. Prepare transmission of the frame. + * + * 3. If the control frame cannot be sent because some preconditions + * are not met (e.g., request HEADERS cannot be sent after GOAWAY), + * :type:`nghttp2_on_frame_not_send_callback` is invoked. Abort + * the following steps. + * + * 4. If the frame is HEADERS, PUSH_PROMISE or DATA, + * :type:`nghttp2_select_padding_callback` is invoked. + * + * 5. If the frame is request HEADERS, the stream is opened here. + * + * 6. :type:`nghttp2_before_frame_send_callback` is invoked. + * + * 7. If :enum:`nghttp2_error.NGHTTP2_ERR_CANCEL` is returned from + * :type:`nghttp2_before_frame_send_callback`, the current frame + * transmission is canceled, and + * :type:`nghttp2_on_frame_not_send_callback` is invoked. Abort + * the following steps. + * + * 8. :type:`nghttp2_send_callback2` is invoked one or more times to + * send the frame. + * + * 9. :type:`nghttp2_on_frame_send_callback` is invoked. + * + * 10. If the transmission of the frame triggers closure of the + * stream, the stream is closed and + * :type:`nghttp2_on_stream_close_callback` is invoked. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` + * The callback function failed. + */ +NGHTTP2_EXTERN int nghttp2_session_send(nghttp2_session *session); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_session_mem_send2()` instead. + * + * Returns the serialized data to send. + * + * This function behaves like `nghttp2_session_send()` except that it + * does not use :type:`nghttp2_send_callback` to transmit data. + * Instead, it assigns the pointer to the serialized data to the + * |*data_ptr| and returns its length. The other callbacks are called + * in the same way as they are in `nghttp2_session_send()`. + * + * If no data is available to send, this function returns 0. + * + * This function may not return all serialized data in one invocation. + * To get all data, call this function repeatedly until it returns 0 + * or one of negative error codes. + * + * The assigned |*data_ptr| is valid until the next call of + * `nghttp2_session_mem_send()` or `nghttp2_session_send()`. + * + * The caller must send all data before sending the next chunk of + * data. + * + * This function returns the length of the data pointed by the + * |*data_ptr| if it succeeds, or one of the following negative error + * codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * + * .. note:: + * + * This function may produce very small byte string. If that is the + * case, and application disables Nagle algorithm (``TCP_NODELAY``), + * then writing this small chunk leads to very small packet, and it + * is very inefficient. An application should be responsible to + * buffer up small chunks of data as necessary to avoid this + * situation. + */ +NGHTTP2_EXTERN ssize_t nghttp2_session_mem_send(nghttp2_session *session, + const uint8_t **data_ptr); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Returns the serialized data to send. + * + * This function behaves like `nghttp2_session_send()` except that it + * does not use :type:`nghttp2_send_callback2` to transmit data. + * Instead, it assigns the pointer to the serialized data to the + * |*data_ptr| and returns its length. The other callbacks are called + * in the same way as they are in `nghttp2_session_send()`. + * + * If no data is available to send, this function returns 0. + * + * This function may not return all serialized data in one invocation. + * To get all data, call this function repeatedly until it returns 0 + * or one of negative error codes. + * + * The assigned |*data_ptr| is valid until the next call of + * `nghttp2_session_mem_send2()` or `nghttp2_session_send()`. + * + * The caller must send all data before sending the next chunk of + * data. + * + * This function returns the length of the data pointed by the + * |*data_ptr| if it succeeds, or one of the following negative error + * codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * + * .. note:: + * + * This function may produce very small byte string. If that is the + * case, and application disables Nagle algorithm (``TCP_NODELAY``), + * then writing this small chunk leads to very small packet, and it + * is very inefficient. An application should be responsible to + * buffer up small chunks of data as necessary to avoid this + * situation. + */ +NGHTTP2_EXTERN nghttp2_ssize +nghttp2_session_mem_send2(nghttp2_session *session, const uint8_t **data_ptr); + +/** + * @function + * + * Receives frames from the remote peer. + * + * This function receives as many frames as possible until the user + * callback :type:`nghttp2_recv_callback` returns + * :enum:`nghttp2_error.NGHTTP2_ERR_WOULDBLOCK`. This function calls + * several callback functions which are passed when initializing the + * |session|. Here is the simple time chart which tells when each + * callback is invoked: + * + * 1. :type:`nghttp2_recv_callback` is invoked one or more times to + * receive frame header. + * + * 2. When frame header is received, + * :type:`nghttp2_on_begin_frame_callback` is invoked. + * + * 3. If the frame is DATA frame: + * + * 1. :type:`nghttp2_recv_callback` is invoked to receive DATA + * payload. For each chunk of data, + * :type:`nghttp2_on_data_chunk_recv_callback` is invoked. + * + * 2. If one DATA frame is completely received, + * :type:`nghttp2_on_frame_recv_callback` is invoked. If the + * reception of the frame triggers the closure of the stream, + * :type:`nghttp2_on_stream_close_callback` is invoked. + * + * 4. If the frame is the control frame: + * + * 1. :type:`nghttp2_recv_callback` is invoked one or more times to + * receive whole frame. + * + * 2. If the received frame is valid, then following actions are + * taken. If the frame is either HEADERS or PUSH_PROMISE, + * :type:`nghttp2_on_begin_headers_callback` is invoked. Then + * :type:`nghttp2_on_header_callback` is invoked for each header + * name/value pair. For invalid header field, + * :type:`nghttp2_on_invalid_header_callback` is called. After + * all name/value pairs are emitted successfully, + * :type:`nghttp2_on_frame_recv_callback` is invoked. For other + * frames, :type:`nghttp2_on_frame_recv_callback` is invoked. + * If the reception of the frame triggers the closure of the + * stream, :type:`nghttp2_on_stream_close_callback` is invoked. + * + * 3. If the received frame is unpacked but is interpreted as + * invalid, :type:`nghttp2_on_invalid_frame_recv_callback` is + * invoked. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_EOF` + * The remote peer did shutdown on the connection. + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` + * The callback function failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC` + * Invalid client magic was detected. This error only returns + * when |session| was configured as server and + * `nghttp2_option_set_no_recv_client_magic()` is not used with + * nonzero value. + * :enum:`nghttp2_error.NGHTTP2_ERR_FLOODED` + * Flooding was detected in this HTTP/2 session, and it must be + * closed. This is most likely caused by misbehaviour of peer. + */ +NGHTTP2_EXTERN int nghttp2_session_recv(nghttp2_session *session); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_session_mem_recv2()` instead. + * + * Processes data |in| as an input from the remote endpoint. The + * |inlen| indicates the number of bytes to receive in the |in|. + * + * This function behaves like `nghttp2_session_recv()` except that it + * does not use :type:`nghttp2_recv_callback` to receive data; the + * |in| is the only data for the invocation of this function. If all + * bytes are processed, this function returns. The other callbacks + * are called in the same way as they are in `nghttp2_session_recv()`. + * + * In the current implementation, this function always tries to + * processes |inlen| bytes of input data unless either an error occurs or + * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is returned from + * :type:`nghttp2_on_header_callback` or + * :type:`nghttp2_on_data_chunk_recv_callback`. If + * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is used, the return value + * includes the number of bytes which was used to produce the data or + * frame for the callback. + * + * This function returns the number of processed bytes, or one of the + * following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` + * The callback function failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC` + * Invalid client magic was detected. This error only returns + * when |session| was configured as server and + * `nghttp2_option_set_no_recv_client_magic()` is not used with + * nonzero value. + * :enum:`nghttp2_error.NGHTTP2_ERR_FLOODED` + * Flooding was detected in this HTTP/2 session, and it must be + * closed. This is most likely caused by misbehaviour of peer. + */ +NGHTTP2_EXTERN ssize_t nghttp2_session_mem_recv(nghttp2_session *session, + const uint8_t *in, + size_t inlen); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Processes data |in| as an input from the remote endpoint. The + * |inlen| indicates the number of bytes to receive in the |in|. + * + * This function behaves like `nghttp2_session_recv()` except that it + * does not use :type:`nghttp2_recv_callback` to receive data; the + * |in| is the only data for the invocation of this function. If all + * bytes are processed, this function returns. The other callbacks + * are called in the same way as they are in `nghttp2_session_recv()`. + * + * In the current implementation, this function always tries to + * processes |inlen| bytes of input data unless either an error occurs or + * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is returned from + * :type:`nghttp2_on_header_callback` or + * :type:`nghttp2_on_data_chunk_recv_callback`. If + * :enum:`nghttp2_error.NGHTTP2_ERR_PAUSE` is used, the return value + * includes the number of bytes which was used to produce the data or + * frame for the callback. + * + * This function returns the number of processed bytes, or one of the + * following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_CALLBACK_FAILURE` + * The callback function failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_BAD_CLIENT_MAGIC` + * Invalid client magic was detected. This error only returns + * when |session| was configured as server and + * `nghttp2_option_set_no_recv_client_magic()` is not used with + * nonzero value. + * :enum:`nghttp2_error.NGHTTP2_ERR_FLOODED` + * Flooding was detected in this HTTP/2 session, and it must be + * closed. This is most likely caused by misbehaviour of peer. + */ +NGHTTP2_EXTERN nghttp2_ssize nghttp2_session_mem_recv2(nghttp2_session *session, + const uint8_t *in, + size_t inlen); + +/** + * @function + * + * Puts back previously deferred DATA frame in the stream |stream_id| + * to the outbound queue. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The stream does not exist; or no deferred data exist. + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_session_resume_data(nghttp2_session *session, + int32_t stream_id); + +/** + * @function + * + * Returns nonzero value if |session| wants to receive data from the + * remote peer. + * + * If both `nghttp2_session_want_read()` and + * `nghttp2_session_want_write()` return 0, the application should + * drop the connection. + */ +NGHTTP2_EXTERN int nghttp2_session_want_read(nghttp2_session *session); + +/** + * @function + * + * Returns nonzero value if |session| wants to send data to the remote + * peer. + * + * If both `nghttp2_session_want_read()` and + * `nghttp2_session_want_write()` return 0, the application should + * drop the connection. + */ +NGHTTP2_EXTERN int nghttp2_session_want_write(nghttp2_session *session); + +/** + * @function + * + * Returns stream_user_data for the stream |stream_id|. The + * stream_user_data is provided by `nghttp2_submit_request2()`, + * `nghttp2_submit_headers()` or + * `nghttp2_session_set_stream_user_data()`. Unless it is set using + * `nghttp2_session_set_stream_user_data()`, if the stream is + * initiated by the remote endpoint, stream_user_data is always + * ``NULL``. If the stream does not exist, this function returns + * ``NULL``. + */ +NGHTTP2_EXTERN void * +nghttp2_session_get_stream_user_data(nghttp2_session *session, + int32_t stream_id); + +/** + * @function + * + * Sets the |stream_user_data| to the stream denoted by the + * |stream_id|. If a stream user data is already set to the stream, + * it is replaced with the |stream_user_data|. It is valid to specify + * ``NULL`` in the |stream_user_data|, which nullifies the associated + * data pointer. + * + * It is valid to set the |stream_user_data| to the stream reserved by + * PUSH_PROMISE frame. + * + * This function returns 0 if it succeeds, or one of following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The stream does not exist + */ +NGHTTP2_EXTERN int +nghttp2_session_set_stream_user_data(nghttp2_session *session, + int32_t stream_id, void *stream_user_data); + +/** + * @function + * + * Sets |user_data| to |session|, overwriting the existing user data + * specified in `nghttp2_session_client_new()`, or + * `nghttp2_session_server_new()`. + */ +NGHTTP2_EXTERN void nghttp2_session_set_user_data(nghttp2_session *session, + void *user_data); + +/** + * @function + * + * Returns the number of frames in the outbound queue. This does not + * include the deferred DATA frames. + */ +NGHTTP2_EXTERN size_t +nghttp2_session_get_outbound_queue_size(nghttp2_session *session); + +/** + * @function + * + * Returns the number of DATA payload in bytes received without + * WINDOW_UPDATE transmission for the stream |stream_id|. The local + * (receive) window size can be adjusted by + * `nghttp2_submit_window_update()`. This function takes into account + * that and returns effective data length. In particular, if the + * local window size is reduced by submitting negative + * window_size_increment with `nghttp2_submit_window_update()`, this + * function returns the number of bytes less than actually received. + * + * This function returns -1 if it fails. + */ +NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_recv_data_length( + nghttp2_session *session, int32_t stream_id); + +/** + * @function + * + * Returns the local (receive) window size for the stream |stream_id|. + * The local window size can be adjusted by + * `nghttp2_submit_window_update()`. This function takes into account + * that and returns effective window size. + * + * This function does not take into account the amount of received + * data from the remote endpoint. Use + * `nghttp2_session_get_stream_local_window_size()` to know the amount + * of data the remote endpoint can send without receiving stream level + * WINDOW_UPDATE frame. Note that each stream is still subject to the + * connection level flow control. + * + * This function returns -1 if it fails. + */ +NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_effective_local_window_size( + nghttp2_session *session, int32_t stream_id); + +/** + * @function + * + * Returns the amount of flow-controlled payload (e.g., DATA) that the + * remote endpoint can send without receiving stream level + * WINDOW_UPDATE frame. It is also subject to the connection level + * flow control. So the actual amount of data to send is + * min(`nghttp2_session_get_stream_local_window_size()`, + * `nghttp2_session_get_local_window_size()`). + * + * This function returns -1 if it fails. + */ +NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_local_window_size( + nghttp2_session *session, int32_t stream_id); + +/** + * @function + * + * Returns the number of DATA payload in bytes received without + * WINDOW_UPDATE transmission for a connection. The local (receive) + * window size can be adjusted by `nghttp2_submit_window_update()`. + * This function takes into account that and returns effective data + * length. In particular, if the local window size is reduced by + * submitting negative window_size_increment with + * `nghttp2_submit_window_update()`, this function returns the number + * of bytes less than actually received. + * + * This function returns -1 if it fails. + */ +NGHTTP2_EXTERN int32_t +nghttp2_session_get_effective_recv_data_length(nghttp2_session *session); + +/** + * @function + * + * Returns the local (receive) window size for a connection. The + * local window size can be adjusted by + * `nghttp2_submit_window_update()`. This function takes into account + * that and returns effective window size. + * + * This function does not take into account the amount of received + * data from the remote endpoint. Use + * `nghttp2_session_get_local_window_size()` to know the amount of + * data the remote endpoint can send without receiving + * connection-level WINDOW_UPDATE frame. Note that each stream is + * still subject to the stream level flow control. + * + * This function returns -1 if it fails. + */ +NGHTTP2_EXTERN int32_t +nghttp2_session_get_effective_local_window_size(nghttp2_session *session); + +/** + * @function + * + * Returns the amount of flow-controlled payload (e.g., DATA) that the + * remote endpoint can send without receiving connection level + * WINDOW_UPDATE frame. Note that each stream is still subject to the + * stream level flow control (see + * `nghttp2_session_get_stream_local_window_size()`). + * + * This function returns -1 if it fails. + */ +NGHTTP2_EXTERN int32_t +nghttp2_session_get_local_window_size(nghttp2_session *session); + +/** + * @function + * + * Returns the remote window size for a given stream |stream_id|. + * + * This is the amount of flow-controlled payload (e.g., DATA) that the + * local endpoint can send without stream level WINDOW_UPDATE. There + * is also connection level flow control, so the effective size of + * payload that the local endpoint can actually send is + * min(`nghttp2_session_get_stream_remote_window_size()`, + * `nghttp2_session_get_remote_window_size()`). + * + * This function returns -1 if it fails. + */ +NGHTTP2_EXTERN int32_t nghttp2_session_get_stream_remote_window_size( + nghttp2_session *session, int32_t stream_id); + +/** + * @function + * + * Returns the remote window size for a connection. + * + * This function always succeeds. + */ +NGHTTP2_EXTERN int32_t +nghttp2_session_get_remote_window_size(nghttp2_session *session); + +/** + * @function + * + * Returns 1 if local peer half closed the given stream |stream_id|. + * Returns 0 if it did not. Returns -1 if no such stream exists. + */ +NGHTTP2_EXTERN int +nghttp2_session_get_stream_local_close(nghttp2_session *session, + int32_t stream_id); + +/** + * @function + * + * Returns 1 if remote peer half closed the given stream |stream_id|. + * Returns 0 if it did not. Returns -1 if no such stream exists. + */ +NGHTTP2_EXTERN int +nghttp2_session_get_stream_remote_close(nghttp2_session *session, + int32_t stream_id); + +/** + * @function + * + * Returns the current dynamic table size of HPACK inflater, including + * the overhead 32 bytes per entry described in RFC 7541. + */ +NGHTTP2_EXTERN size_t +nghttp2_session_get_hd_inflate_dynamic_table_size(nghttp2_session *session); + +/** + * @function + * + * Returns the current dynamic table size of HPACK deflater including + * the overhead 32 bytes per entry described in RFC 7541. + */ +NGHTTP2_EXTERN size_t +nghttp2_session_get_hd_deflate_dynamic_table_size(nghttp2_session *session); + +/** + * @function + * + * Signals the session so that the connection should be terminated. + * + * The last stream ID is the minimum value between the stream ID of a + * stream for which :type:`nghttp2_on_frame_recv_callback` was called + * most recently and the last stream ID we have sent to the peer + * previously. + * + * The |error_code| is the error code of this GOAWAY frame. The + * pre-defined error code is one of :enum:`nghttp2_error_code`. + * + * After the transmission, both `nghttp2_session_want_read()` and + * `nghttp2_session_want_write()` return 0. + * + * This function should be called when the connection should be + * terminated after sending GOAWAY. If the remaining streams should + * be processed after GOAWAY, use `nghttp2_submit_goaway()` instead. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_session_terminate_session(nghttp2_session *session, + uint32_t error_code); + +/** + * @function + * + * Signals the session so that the connection should be terminated. + * + * This function behaves like `nghttp2_session_terminate_session()`, + * but the last stream ID can be specified by the application for fine + * grained control of stream. The HTTP/2 specification does not allow + * last_stream_id to be increased. So the actual value sent as + * last_stream_id is the minimum value between the given + * |last_stream_id| and the last_stream_id we have previously sent to + * the peer. + * + * The |last_stream_id| is peer's stream ID or 0. So if |session| is + * initialized as client, |last_stream_id| must be even or 0. If + * |session| is initialized as server, |last_stream_id| must be odd or + * 0. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |last_stream_id| is invalid. + */ +NGHTTP2_EXTERN int nghttp2_session_terminate_session2(nghttp2_session *session, + int32_t last_stream_id, + uint32_t error_code); + +/** + * @function + * + * Signals to the client that the server started graceful shutdown + * procedure. + * + * This function is only usable for server. If this function is + * called with client side session, this function returns + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. + * + * To gracefully shutdown HTTP/2 session, server should call this + * function to send GOAWAY with last_stream_id (1u << 31) - 1. And + * after some delay (e.g., 1 RTT), send another GOAWAY with the stream + * ID that the server has some processing using + * `nghttp2_submit_goaway()`. See also + * `nghttp2_session_get_last_proc_stream_id()`. + * + * Unlike `nghttp2_submit_goaway()`, this function just sends GOAWAY + * and does nothing more. This is a mere indication to the client + * that session shutdown is imminent. The application should call + * `nghttp2_submit_goaway()` with appropriate last_stream_id after + * this call. + * + * If one or more GOAWAY frame have been already sent by either + * `nghttp2_submit_goaway()` or `nghttp2_session_terminate_session()`, + * this function has no effect. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * The |session| is initialized as client. + */ +NGHTTP2_EXTERN int nghttp2_submit_shutdown_notice(nghttp2_session *session); + +/** + * @function + * + * Returns the value of SETTINGS |id| notified by a remote endpoint. + * The |id| must be one of values defined in + * :enum:`nghttp2_settings_id`. + */ +NGHTTP2_EXTERN uint32_t nghttp2_session_get_remote_settings( + nghttp2_session *session, nghttp2_settings_id id); + +/** + * @function + * + * Returns the value of SETTINGS |id| of local endpoint acknowledged + * by the remote endpoint. The |id| must be one of the values defined + * in :enum:`nghttp2_settings_id`. + */ +NGHTTP2_EXTERN uint32_t nghttp2_session_get_local_settings( + nghttp2_session *session, nghttp2_settings_id id); + +/** + * @function + * + * Tells the |session| that next stream ID is |next_stream_id|. The + * |next_stream_id| must be equal or greater than the value returned + * by `nghttp2_session_get_next_stream_id()`. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |next_stream_id| is strictly less than the value + * `nghttp2_session_get_next_stream_id()` returns; or + * |next_stream_id| is invalid (e.g., even integer for client, or + * odd integer for server). + */ +NGHTTP2_EXTERN int nghttp2_session_set_next_stream_id(nghttp2_session *session, + int32_t next_stream_id); + +/** + * @function + * + * Returns the next outgoing stream ID. Notice that return type is + * uint32_t. If we run out of stream ID for this session, this + * function returns 1 << 31. + */ +NGHTTP2_EXTERN uint32_t +nghttp2_session_get_next_stream_id(nghttp2_session *session); + +/** + * @function + * + * Tells the |session| that |size| bytes for a stream denoted by + * |stream_id| were consumed by application and are ready to + * WINDOW_UPDATE. The consumed bytes are counted towards both + * connection and stream level WINDOW_UPDATE (see + * `nghttp2_session_consume_connection()` and + * `nghttp2_session_consume_stream()` to update consumption + * independently). This function is intended to be used without + * automatic window update (see + * `nghttp2_option_set_no_auto_window_update()`). + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * Automatic WINDOW_UPDATE is not disabled. + */ +NGHTTP2_EXTERN int nghttp2_session_consume(nghttp2_session *session, + int32_t stream_id, size_t size); + +/** + * @function + * + * Like `nghttp2_session_consume()`, but this only tells library that + * |size| bytes were consumed only for connection level. Note that + * HTTP/2 maintains connection and stream level flow control windows + * independently. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * Automatic WINDOW_UPDATE is not disabled. + */ +NGHTTP2_EXTERN int nghttp2_session_consume_connection(nghttp2_session *session, + size_t size); + +/** + * @function + * + * Like `nghttp2_session_consume()`, but this only tells library that + * |size| bytes were consumed only for stream denoted by |stream_id|. + * Note that HTTP/2 maintains connection and stream level flow control + * windows independently. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * Automatic WINDOW_UPDATE is not disabled. + */ +NGHTTP2_EXTERN int nghttp2_session_consume_stream(nghttp2_session *session, + int32_t stream_id, + size_t size); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function is noop. It always returns 0. + */ +NGHTTP2_EXTERN int +nghttp2_session_change_stream_priority(nghttp2_session *session, + int32_t stream_id, + const nghttp2_priority_spec *pri_spec); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function is noop. It always returns 0. + */ +NGHTTP2_EXTERN int +nghttp2_session_create_idle_stream(nghttp2_session *session, int32_t stream_id, + const nghttp2_priority_spec *pri_spec); + +/** + * @function + * + * .. warning:: + * + * This function is deprecated in favor of + * `nghttp2_session_upgrade2()`, because this function lacks the + * parameter to tell the library the request method used in the + * original HTTP request. This information is required for client + * to validate actual response body length against content-length + * header field (see `nghttp2_option_set_no_http_messaging()`). If + * HEAD is used in request, the length of response body must be 0 + * regardless of value included in content-length header field. + * + * Performs post-process of HTTP Upgrade request. This function can + * be called from both client and server, but the behavior is very + * different in each other. + * + * If called from client side, the |settings_payload| must be the + * value sent in ``HTTP2-Settings`` header field and must be decoded + * by base64url decoder. The |settings_payloadlen| is the length of + * |settings_payload|. The |settings_payload| is unpacked and its + * setting values will be submitted using `nghttp2_submit_settings()`. + * This means that the client application code does not need to submit + * SETTINGS by itself. The stream with stream ID=1 is opened and the + * |stream_user_data| is used for its stream_user_data. The opened + * stream becomes half-closed (local) state. + * + * If called from server side, the |settings_payload| must be the + * value received in ``HTTP2-Settings`` header field and must be + * decoded by base64url decoder. The |settings_payloadlen| is the + * length of |settings_payload|. It is treated as if the SETTINGS + * frame with that payload is received. Thus, callback functions for + * the reception of SETTINGS frame will be invoked. The stream with + * stream ID=1 is opened. The |stream_user_data| is ignored. The + * opened stream becomes half-closed (remote). + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |settings_payload| is badly formed. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * The stream ID 1 is already used or closed; or is not available. + */ +NGHTTP2_EXTERN int nghttp2_session_upgrade(nghttp2_session *session, + const uint8_t *settings_payload, + size_t settings_payloadlen, + void *stream_user_data); + +/** + * @function + * + * Performs post-process of HTTP Upgrade request. This function can + * be called from both client and server, but the behavior is very + * different in each other. + * + * If called from client side, the |settings_payload| must be the + * value sent in ``HTTP2-Settings`` header field and must be decoded + * by base64url decoder. The |settings_payloadlen| is the length of + * |settings_payload|. The |settings_payload| is unpacked and its + * setting values will be submitted using `nghttp2_submit_settings()`. + * This means that the client application code does not need to submit + * SETTINGS by itself. The stream with stream ID=1 is opened and the + * |stream_user_data| is used for its stream_user_data. The opened + * stream becomes half-closed (local) state. + * + * If called from server side, the |settings_payload| must be the + * value received in ``HTTP2-Settings`` header field and must be + * decoded by base64url decoder. The |settings_payloadlen| is the + * length of |settings_payload|. It is treated as if the SETTINGS + * frame with that payload is received. Thus, callback functions for + * the reception of SETTINGS frame will be invoked. The stream with + * stream ID=1 is opened. The |stream_user_data| is ignored. The + * opened stream becomes half-closed (remote). + * + * If the request method is HEAD, pass nonzero value to + * |head_request|. Otherwise, pass 0. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |settings_payload| is badly formed. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * The stream ID 1 is already used or closed; or is not available. + */ +NGHTTP2_EXTERN int nghttp2_session_upgrade2(nghttp2_session *session, + const uint8_t *settings_payload, + size_t settings_payloadlen, + int head_request, + void *stream_user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_pack_settings_payload2()` instead. + * + * Serializes the SETTINGS values |iv| in the |buf|. The size of the + * |buf| is specified by |buflen|. The number of entries in the |iv| + * array is given by |niv|. The required space in |buf| for the |niv| + * entries is ``6*niv`` bytes and if the given buffer is too small, an + * error is returned. This function is used mainly for creating a + * SETTINGS payload to be sent with the ``HTTP2-Settings`` header + * field in an HTTP Upgrade request. The data written in |buf| is NOT + * base64url encoded and the application is responsible for encoding. + * + * This function returns the number of bytes written in |buf|, or one + * of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |iv| contains duplicate settings ID or invalid value. + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` + * The provided |buflen| size is too small to hold the output. + */ +NGHTTP2_EXTERN ssize_t nghttp2_pack_settings_payload( + uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Serializes the SETTINGS values |iv| in the |buf|. The size of the + * |buf| is specified by |buflen|. The number of entries in the |iv| + * array is given by |niv|. The required space in |buf| for the |niv| + * entries is ``6*niv`` bytes and if the given buffer is too small, an + * error is returned. This function is used mainly for creating a + * SETTINGS payload to be sent with the ``HTTP2-Settings`` header + * field in an HTTP Upgrade request. The data written in |buf| is NOT + * base64url encoded and the application is responsible for encoding. + * + * This function returns the number of bytes written in |buf|, or one + * of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |iv| contains duplicate settings ID or invalid value. + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` + * The provided |buflen| size is too small to hold the output. + */ +NGHTTP2_EXTERN nghttp2_ssize nghttp2_pack_settings_payload2( + uint8_t *buf, size_t buflen, const nghttp2_settings_entry *iv, size_t niv); + +/** + * @function + * + * Returns string describing the |lib_error_code|. The + * |lib_error_code| must be one of the :enum:`nghttp2_error`. + */ +NGHTTP2_EXTERN const char *nghttp2_strerror(int lib_error_code); + +/** + * @function + * + * Returns string representation of HTTP/2 error code |error_code| + * (e.g., ``PROTOCOL_ERROR`` is returned if ``error_code == + * NGHTTP2_PROTOCOL_ERROR``). If string representation is unknown for + * given |error_code|, this function returns string ``unknown``. + */ +NGHTTP2_EXTERN const char *nghttp2_http2_strerror(uint32_t error_code); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * Initializes |pri_spec| with the |stream_id| of the stream to depend + * on with |weight| and its exclusive flag. If |exclusive| is + * nonzero, exclusive flag is set. + * + * The |weight| must be in [:macro:`NGHTTP2_MIN_WEIGHT`, + * :macro:`NGHTTP2_MAX_WEIGHT`], inclusive. + */ +NGHTTP2_EXTERN void nghttp2_priority_spec_init(nghttp2_priority_spec *pri_spec, + int32_t stream_id, + int32_t weight, int exclusive); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * Initializes |pri_spec| with the default values. The default values + * are: stream_id = 0, weight = :macro:`NGHTTP2_DEFAULT_WEIGHT` and + * exclusive = 0. + */ +NGHTTP2_EXTERN void +nghttp2_priority_spec_default_init(nghttp2_priority_spec *pri_spec); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * Returns nonzero if the |pri_spec| is filled with default values. + */ +NGHTTP2_EXTERN int +nghttp2_priority_spec_check_default(const nghttp2_priority_spec *pri_spec); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_submit_request2()` instead. + * + * Submits HEADERS frame and optionally one or more DATA frames. + * + * The |pri_spec| is ignored. + * + * The |nva| is an array of name/value pair :type:`nghttp2_nv` with + * |nvlen| elements. The application is responsible to include + * required pseudo-header fields (header field whose name starts with + * ":") in |nva| and must place pseudo-headers before regular header + * fields. + * + * This function creates copies of all name/value pairs in |nva|. It + * also lower-cases all names in |nva|. The order of elements in + * |nva| is preserved. For header fields with + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, + * header field name and value are not copied respectively. With + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application + * is responsible to pass header field name in lowercase. The + * application should maintain the references to them until + * :type:`nghttp2_on_frame_send_callback` or + * :type:`nghttp2_on_frame_not_send_callback` is called. + * + * HTTP/2 specification has requirement about header fields in the + * request HEADERS. See the specification for more details. + * + * If |data_prd| is not ``NULL``, it provides data which will be sent + * in subsequent DATA frames. In this case, a method that allows + * request message bodies + * (https://tools.ietf.org/html/rfc7231#section-4) must be specified + * with ``:method`` key in |nva| (e.g. ``POST``). This function does + * not take ownership of the |data_prd|. The function copies the + * members of the |data_prd|. If |data_prd| is ``NULL``, HEADERS have + * END_STREAM set. The |stream_user_data| is data associated to the + * stream opened by this request and can be an arbitrary pointer, + * which can be retrieved later by + * `nghttp2_session_get_stream_user_data()`. + * + * This function returns assigned stream ID if it succeeds, or one of + * the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` + * No stream ID is available because maximum stream ID was + * reached. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * The |session| is server session. + * + * .. warning:: + * + * This function returns assigned stream ID if it succeeds. But + * that stream is not created yet. The application must not submit + * frame to that stream ID before + * :type:`nghttp2_before_frame_send_callback` is called for this + * frame. This means `nghttp2_session_get_stream_user_data()` does + * not work before the callback. But + * `nghttp2_session_set_stream_user_data()` handles this situation + * specially, and it can set data to a stream during this period. + * + */ +NGHTTP2_EXTERN int32_t nghttp2_submit_request( + nghttp2_session *session, const nghttp2_priority_spec *pri_spec, + const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider *data_prd, + void *stream_user_data); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Submits HEADERS frame and optionally one or more DATA frames. + * + * The |pri_spec| is ignored. + * + * The |nva| is an array of name/value pair :type:`nghttp2_nv` with + * |nvlen| elements. The application is responsible to include + * required pseudo-header fields (header field whose name starts with + * ":") in |nva| and must place pseudo-headers before regular header + * fields. + * + * This function creates copies of all name/value pairs in |nva|. It + * also lower-cases all names in |nva|. The order of elements in + * |nva| is preserved. For header fields with + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, + * header field name and value are not copied respectively. With + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application + * is responsible to pass header field name in lowercase. The + * application should maintain the references to them until + * :type:`nghttp2_on_frame_send_callback` or + * :type:`nghttp2_on_frame_not_send_callback` is called. + * + * HTTP/2 specification has requirement about header fields in the + * request HEADERS. See the specification for more details. + * + * If |data_prd| is not ``NULL``, it provides data which will be sent + * in subsequent DATA frames. In this case, a method that allows + * request message bodies + * (https://tools.ietf.org/html/rfc7231#section-4) must be specified + * with ``:method`` key in |nva| (e.g. ``POST``). This function does + * not take ownership of the |data_prd|. The function copies the + * members of the |data_prd|. If |data_prd| is ``NULL``, HEADERS have + * END_STREAM set. The |stream_user_data| is data associated to the + * stream opened by this request and can be an arbitrary pointer, + * which can be retrieved later by + * `nghttp2_session_get_stream_user_data()`. + * + * This function returns assigned stream ID if it succeeds, or one of + * the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` + * No stream ID is available because maximum stream ID was + * reached. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * The |session| is server session. + * + * .. warning:: + * + * This function returns assigned stream ID if it succeeds. But + * that stream is not created yet. The application must not submit + * frame to that stream ID before + * :type:`nghttp2_before_frame_send_callback` is called for this + * frame. This means `nghttp2_session_get_stream_user_data()` does + * not work before the callback. But + * `nghttp2_session_set_stream_user_data()` handles this situation + * specially, and it can set data to a stream during this period. + * + */ +NGHTTP2_EXTERN int32_t nghttp2_submit_request2( + nghttp2_session *session, const nghttp2_priority_spec *pri_spec, + const nghttp2_nv *nva, size_t nvlen, const nghttp2_data_provider2 *data_prd, + void *stream_user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_submit_response2()` instead. + * + * Submits response HEADERS frame and optionally one or more DATA + * frames against the stream |stream_id|. + * + * The |nva| is an array of name/value pair :type:`nghttp2_nv` with + * |nvlen| elements. The application is responsible to include + * required pseudo-header fields (header field whose name starts with + * ":") in |nva| and must place pseudo-headers before regular header + * fields. + * + * This function creates copies of all name/value pairs in |nva|. It + * also lower-cases all names in |nva|. The order of elements in + * |nva| is preserved. For header fields with + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, + * header field name and value are not copied respectively. With + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application + * is responsible to pass header field name in lowercase. The + * application should maintain the references to them until + * :type:`nghttp2_on_frame_send_callback` or + * :type:`nghttp2_on_frame_not_send_callback` is called. + * + * HTTP/2 specification has requirement about header fields in the + * response HEADERS. See the specification for more details. + * + * If |data_prd| is not ``NULL``, it provides data which will be sent + * in subsequent DATA frames. This function does not take ownership + * of the |data_prd|. The function copies the members of the + * |data_prd|. If |data_prd| is ``NULL``, HEADERS will have + * END_STREAM flag set. + * + * This method can be used as normal HTTP response and push response. + * When pushing a resource using this function, the |session| must be + * configured using `nghttp2_session_server_new()` or its variants and + * the target stream denoted by the |stream_id| must be reserved using + * `nghttp2_submit_push_promise()`. + * + * To send non-final response headers (e.g., HTTP status 101), don't + * use this function because this function half-closes the outbound + * stream. Instead, use `nghttp2_submit_headers()` for this purpose. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` + * DATA or HEADERS has been already submitted and not fully + * processed yet. Normally, this does not happen, but when + * application wrongly calls `nghttp2_submit_response()` twice, + * this may happen. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * The |session| is client session. + * + * .. warning:: + * + * Calling this function twice for the same stream ID may lead to + * program crash. It is generally considered to a programming error + * to commit response twice. + */ +NGHTTP2_EXTERN int +nghttp2_submit_response(nghttp2_session *session, int32_t stream_id, + const nghttp2_nv *nva, size_t nvlen, + const nghttp2_data_provider *data_prd); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Submits response HEADERS frame and optionally one or more DATA + * frames against the stream |stream_id|. + * + * The |nva| is an array of name/value pair :type:`nghttp2_nv` with + * |nvlen| elements. The application is responsible to include + * required pseudo-header fields (header field whose name starts with + * ":") in |nva| and must place pseudo-headers before regular header + * fields. + * + * This function creates copies of all name/value pairs in |nva|. It + * also lower-cases all names in |nva|. The order of elements in + * |nva| is preserved. For header fields with + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, + * header field name and value are not copied respectively. With + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application + * is responsible to pass header field name in lowercase. The + * application should maintain the references to them until + * :type:`nghttp2_on_frame_send_callback` or + * :type:`nghttp2_on_frame_not_send_callback` is called. + * + * HTTP/2 specification has requirement about header fields in the + * response HEADERS. See the specification for more details. + * + * If |data_prd| is not ``NULL``, it provides data which will be sent + * in subsequent DATA frames. This function does not take ownership + * of the |data_prd|. The function copies the members of the + * |data_prd|. If |data_prd| is ``NULL``, HEADERS will have + * END_STREAM flag set. + * + * This method can be used as normal HTTP response and push response. + * When pushing a resource using this function, the |session| must be + * configured using `nghttp2_session_server_new()` or its variants and + * the target stream denoted by the |stream_id| must be reserved using + * `nghttp2_submit_push_promise()`. + * + * To send non-final response headers (e.g., HTTP status 101), don't + * use this function because this function half-closes the outbound + * stream. Instead, use `nghttp2_submit_headers()` for this purpose. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` + * DATA or HEADERS has been already submitted and not fully + * processed yet. Normally, this does not happen, but when + * application wrongly calls `nghttp2_submit_response2()` twice, + * this may happen. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * The |session| is client session. + * + * .. warning:: + * + * Calling this function twice for the same stream ID may lead to + * program crash. It is generally considered to a programming error + * to commit response twice. + */ +NGHTTP2_EXTERN int +nghttp2_submit_response2(nghttp2_session *session, int32_t stream_id, + const nghttp2_nv *nva, size_t nvlen, + const nghttp2_data_provider2 *data_prd); + +/** + * @function + * + * Submits trailer fields HEADERS against the stream |stream_id|. + * + * The |nva| is an array of name/value pair :type:`nghttp2_nv` with + * |nvlen| elements. The application must not include pseudo-header + * fields (headers whose names starts with ":") in |nva|. + * + * This function creates copies of all name/value pairs in |nva|. It + * also lower-cases all names in |nva|. The order of elements in + * |nva| is preserved. For header fields with + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, + * header field name and value are not copied respectively. With + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application + * is responsible to pass header field name in lowercase. The + * application should maintain the references to them until + * :type:`nghttp2_on_frame_send_callback` or + * :type:`nghttp2_on_frame_not_send_callback` is called. + * + * For server, trailer fields must follow response HEADERS or response + * DATA without END_STREAM flat set. The library does not enforce + * this requirement, and applications should do this for themselves. + * If `nghttp2_submit_trailer()` is called before any response HEADERS + * submission (usually by `nghttp2_submit_response2()`), the content + * of |nva| will be sent as response headers, which will result in + * error. + * + * This function has the same effect with `nghttp2_submit_headers()`, + * with flags = :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` and both + * pri_spec and stream_user_data to NULL. + * + * To submit trailer fields after `nghttp2_submit_response2()` is + * called, the application has to specify + * :type:`nghttp2_data_provider2` to `nghttp2_submit_response2()`. + * Inside of :type:`nghttp2_data_source_read_callback2`, when setting + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_EOF`, also set + * :enum:`nghttp2_data_flag.NGHTTP2_DATA_FLAG_NO_END_STREAM`. After + * that, the application can send trailer fields using + * `nghttp2_submit_trailer()`. `nghttp2_submit_trailer()` can be used + * inside :type:`nghttp2_data_source_read_callback2`. + * + * This function returns 0 if it succeeds and |stream_id| is -1. + * Otherwise, this function returns 0 if it succeeds, or one of the + * following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + */ +NGHTTP2_EXTERN int nghttp2_submit_trailer(nghttp2_session *session, + int32_t stream_id, + const nghttp2_nv *nva, size_t nvlen); + +/** + * @function + * + * Submits HEADERS frame. The |flags| is bitwise OR of the + * following values: + * + * * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` + * + * If |flags| includes :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM`, + * this frame has END_STREAM flag set. + * + * The library handles the CONTINUATION frame internally and it + * correctly sets END_HEADERS to the last sequence of the PUSH_PROMISE + * or CONTINUATION frame. + * + * If the |stream_id| is -1, this frame is assumed as request (i.e., + * request HEADERS frame which opens new stream). In this case, the + * assigned stream ID will be returned. Otherwise, specify stream ID + * in |stream_id|. + * + * The |pri_spec| is ignored. + * + * The |nva| is an array of name/value pair :type:`nghttp2_nv` with + * |nvlen| elements. The application is responsible to include + * required pseudo-header fields (header field whose name starts with + * ":") in |nva| and must place pseudo-headers before regular header + * fields. + * + * This function creates copies of all name/value pairs in |nva|. It + * also lower-cases all names in |nva|. The order of elements in + * |nva| is preserved. For header fields with + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, + * header field name and value are not copied respectively. With + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application + * is responsible to pass header field name in lowercase. The + * application should maintain the references to them until + * :type:`nghttp2_on_frame_send_callback` or + * :type:`nghttp2_on_frame_not_send_callback` is called. + * + * The |stream_user_data| is a pointer to an arbitrary data which is + * associated to the stream this frame will open. Therefore it is + * only used if this frame opens streams, in other words, it changes + * stream state from idle or reserved to open. + * + * This function is low-level in a sense that the application code can + * specify flags directly. For usual HTTP request, + * `nghttp2_submit_request2()` is useful. Likewise, for HTTP + * response, prefer `nghttp2_submit_response2()`. + * + * This function returns newly assigned stream ID if it succeeds and + * |stream_id| is -1. Otherwise, this function returns 0 if it + * succeeds, or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` + * No stream ID is available because maximum stream ID was + * reached. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` + * DATA or HEADERS has been already submitted and not fully + * processed yet. This happens if stream denoted by |stream_id| + * is in reserved state. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * The |stream_id| is -1, and |session| is server session. + * + * .. warning:: + * + * This function returns assigned stream ID if it succeeds and + * |stream_id| is -1. But that stream is not opened yet. The + * application must not submit frame to that stream ID before + * :type:`nghttp2_before_frame_send_callback` is called for this + * frame. + * + */ +NGHTTP2_EXTERN int32_t nghttp2_submit_headers( + nghttp2_session *session, uint8_t flags, int32_t stream_id, + const nghttp2_priority_spec *pri_spec, const nghttp2_nv *nva, size_t nvlen, + void *stream_user_data); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_submit_data2()` instead. + * + * Submits one or more DATA frames to the stream |stream_id|. The + * data to be sent are provided by |data_prd|. If |flags| contains + * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM`, the last DATA frame + * has END_STREAM flag set. + * + * This function does not take ownership of the |data_prd|. The + * function copies the members of the |data_prd|. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` + * DATA or HEADERS has been already submitted and not fully + * processed yet. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_CLOSED` + * The stream was already closed; or the |stream_id| is invalid. + * + * .. note:: + * + * Currently, only one DATA or HEADERS is allowed for a stream at a + * time. Submitting these frames more than once before first DATA + * or HEADERS is finished results in + * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` error code. The + * earliest callback which tells that previous frame is done is + * :type:`nghttp2_on_frame_send_callback`. In side that callback, + * new data can be submitted using `nghttp2_submit_data()`. Of + * course, all data except for last one must not have + * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` flag set in |flags|. + * This sounds a bit complicated, and we recommend to use + * `nghttp2_submit_request()` and `nghttp2_submit_response()` to + * avoid this cascading issue. The experience shows that for HTTP + * use, these two functions are enough to implement both client and + * server. + */ +NGHTTP2_EXTERN int nghttp2_submit_data(nghttp2_session *session, uint8_t flags, + int32_t stream_id, + const nghttp2_data_provider *data_prd); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Submits one or more DATA frames to the stream |stream_id|. The + * data to be sent are provided by |data_prd|. If |flags| contains + * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM`, the last DATA frame + * has END_STREAM flag set. + * + * This function does not take ownership of the |data_prd|. The + * function copies the members of the |data_prd|. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` + * DATA or HEADERS has been already submitted and not fully + * processed yet. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_CLOSED` + * The stream was already closed; or the |stream_id| is invalid. + * + * .. note:: + * + * Currently, only one DATA or HEADERS is allowed for a stream at a + * time. Submitting these frames more than once before first DATA + * or HEADERS is finished results in + * :enum:`nghttp2_error.NGHTTP2_ERR_DATA_EXIST` error code. The + * earliest callback which tells that previous frame is done is + * :type:`nghttp2_on_frame_send_callback`. In side that callback, + * new data can be submitted using `nghttp2_submit_data2()`. Of + * course, all data except for last one must not have + * :enum:`nghttp2_flag.NGHTTP2_FLAG_END_STREAM` flag set in |flags|. + * This sounds a bit complicated, and we recommend to use + * `nghttp2_submit_request2()` and `nghttp2_submit_response2()` to + * avoid this cascading issue. The experience shows that for HTTP + * use, these two functions are enough to implement both client and + * server. + */ +NGHTTP2_EXTERN int nghttp2_submit_data2(nghttp2_session *session, uint8_t flags, + int32_t stream_id, + const nghttp2_data_provider2 *data_prd); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function is noop. It always returns 0. + */ +NGHTTP2_EXTERN int +nghttp2_submit_priority(nghttp2_session *session, uint8_t flags, + int32_t stream_id, + const nghttp2_priority_spec *pri_spec); + +/** + * @macro + * + * :macro:`NGHTTP2_EXTPRI_DEFAULT_URGENCY` is the default urgency + * level for :rfc:`9218` extensible priorities. + */ +#define NGHTTP2_EXTPRI_DEFAULT_URGENCY 3 + +/** + * @macro + * + * :macro:`NGHTTP2_EXTPRI_URGENCY_HIGH` is the highest urgency level + * for :rfc:`9218` extensible priorities. + */ +#define NGHTTP2_EXTPRI_URGENCY_HIGH 0 + +/** + * @macro + * + * :macro:`NGHTTP2_EXTPRI_URGENCY_LOW` is the lowest urgency level for + * :rfc:`9218` extensible priorities. + */ +#define NGHTTP2_EXTPRI_URGENCY_LOW 7 + +/** + * @macro + * + * :macro:`NGHTTP2_EXTPRI_URGENCY_LEVELS` is the number of urgency + * levels for :rfc:`9218` extensible priorities. + */ +#define NGHTTP2_EXTPRI_URGENCY_LEVELS (NGHTTP2_EXTPRI_URGENCY_LOW + 1) + +/** + * @struct + * + * :type:`nghttp2_extpri` is :rfc:`9218` extensible priorities + * specification for a stream. + */ +typedef struct nghttp2_extpri { + /** + * :member:`urgency` is the urgency of a stream, it must be in + * [:macro:`NGHTTP2_EXTPRI_URGENCY_HIGH`, + * :macro:`NGHTTP2_EXTPRI_URGENCY_LOW`], inclusive, and 0 is the + * highest urgency. + */ + uint32_t urgency; + /** + * :member:`inc` indicates that a content can be processed + * incrementally or not. If inc is 0, it cannot be processed + * incrementally. If inc is 1, it can be processed incrementally. + * Other value is not permitted. + */ + int inc; +} nghttp2_extpri; + +/** + * @function + * + * Submits RST_STREAM frame to cancel/reject the stream |stream_id| + * with the error code |error_code|. + * + * The pre-defined error code is one of :enum:`nghttp2_error_code`. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0. + */ +NGHTTP2_EXTERN int nghttp2_submit_rst_stream(nghttp2_session *session, + uint8_t flags, int32_t stream_id, + uint32_t error_code); + +/** + * @function + * + * Stores local settings and submits SETTINGS frame. The |iv| is the + * pointer to the array of :type:`nghttp2_settings_entry`. The |niv| + * indicates the number of :type:`nghttp2_settings_entry`. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * This function does not take ownership of the |iv|. This function + * copies all the elements in the |iv|. + * + * While updating individual stream's local window size, if the window + * size becomes strictly larger than NGHTTP2_MAX_WINDOW_SIZE, + * RST_STREAM is issued against such a stream. + * + * SETTINGS with :enum:`nghttp2_flag.NGHTTP2_FLAG_ACK` is + * automatically submitted by the library and application could not + * send it at its will. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |iv| contains invalid value (e.g., initial window size + * strictly greater than (1 << 31) - 1. + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_submit_settings(nghttp2_session *session, + uint8_t flags, + const nghttp2_settings_entry *iv, + size_t niv); + +/** + * @function + * + * Submits PUSH_PROMISE frame. + * + * The |flags| is currently ignored. The library handles the + * CONTINUATION frame internally and it correctly sets END_HEADERS to + * the last sequence of the PUSH_PROMISE or CONTINUATION frame. + * + * The |stream_id| must be client initiated stream ID. + * + * The |nva| is an array of name/value pair :type:`nghttp2_nv` with + * |nvlen| elements. The application is responsible to include + * required pseudo-header fields (header field whose name starts with + * ":") in |nva| and must place pseudo-headers before regular header + * fields. + * + * This function creates copies of all name/value pairs in |nva|. It + * also lower-cases all names in |nva|. The order of elements in + * |nva| is preserved. For header fields with + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME` and + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE` are set, + * header field name and value are not copied respectively. With + * :enum:`nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME`, application + * is responsible to pass header field name in lowercase. The + * application should maintain the references to them until + * :type:`nghttp2_on_frame_send_callback` or + * :type:`nghttp2_on_frame_not_send_callback` is called. + * + * The |promised_stream_user_data| is a pointer to an arbitrary data + * which is associated to the promised stream this frame will open and + * make it in reserved state. It is available using + * `nghttp2_session_get_stream_user_data()`. The application can + * access it in :type:`nghttp2_before_frame_send_callback` and + * :type:`nghttp2_on_frame_send_callback` of this frame. + * + * The client side is not allowed to use this function. + * + * To submit response headers and data, use + * `nghttp2_submit_response2()`. + * + * This function returns assigned promised stream ID if it succeeds, + * or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_PROTO` + * This function was invoked when |session| is initialized as + * client. + * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE` + * No stream ID is available because maximum stream ID was + * reached. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is 0; The |stream_id| does not designate stream + * that peer initiated. + * :enum:`nghttp2_error.NGHTTP2_ERR_STREAM_CLOSED` + * The stream was already closed; or the |stream_id| is invalid. + * + * .. warning:: + * + * This function returns assigned promised stream ID if it succeeds. + * As of 1.16.0, stream object for pushed resource is created when + * this function succeeds. In that case, the application can submit + * push response for the promised frame. + * + * In 1.15.0 or prior versions, pushed stream is not opened yet when + * this function succeeds. The application must not submit frame to + * that stream ID before :type:`nghttp2_before_frame_send_callback` + * is called for this frame. + * + */ +NGHTTP2_EXTERN int32_t nghttp2_submit_push_promise( + nghttp2_session *session, uint8_t flags, int32_t stream_id, + const nghttp2_nv *nva, size_t nvlen, void *promised_stream_user_data); + +/** + * @function + * + * Submits PING frame. You don't have to send PING back when you + * received PING frame. The library automatically submits PING frame + * in this case. + * + * The |flags| is bitwise OR of 0 or more of the following value. + * + * * :enum:`nghttp2_flag.NGHTTP2_FLAG_ACK` + * + * Unless `nghttp2_option_set_no_auto_ping_ack()` is used, the |flags| + * should be :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * If the |opaque_data| is non ``NULL``, then it should point to the 8 + * bytes array of memory to specify opaque data to send with PING + * frame. If the |opaque_data| is ``NULL``, zero-cleared 8 bytes will + * be sent as opaque data. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_submit_ping(nghttp2_session *session, uint8_t flags, + const uint8_t *opaque_data); + +/** + * @function + * + * Submits GOAWAY frame with the last stream ID |last_stream_id| and + * the error code |error_code|. + * + * The pre-defined error code is one of :enum:`nghttp2_error_code`. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * The |last_stream_id| is peer's stream ID or 0. So if |session| is + * initialized as client, |last_stream_id| must be even or 0. If + * |session| is initialized as server, |last_stream_id| must be odd or + * 0. + * + * The HTTP/2 specification says last_stream_id must not be increased + * from the value previously sent. So the actual value sent as + * last_stream_id is the minimum value between the given + * |last_stream_id| and the last_stream_id previously sent to the + * peer. + * + * If the |opaque_data| is not ``NULL`` and |opaque_data_len| is not + * zero, those data will be sent as additional debug data. The + * library makes a copy of the memory region pointed by |opaque_data| + * with the length |opaque_data_len|, so the caller does not need to + * keep this memory after the return of this function. If the + * |opaque_data_len| is 0, the |opaque_data| could be ``NULL``. + * + * After successful transmission of GOAWAY, following things happen. + * All incoming streams having strictly more than |last_stream_id| are + * closed. All incoming HEADERS which starts new stream are simply + * ignored. After all active streams are handled, both + * `nghttp2_session_want_read()` and `nghttp2_session_want_write()` + * return 0 and the application can close session. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |opaque_data_len| is too large; the |last_stream_id| is + * invalid. + */ +NGHTTP2_EXTERN int nghttp2_submit_goaway(nghttp2_session *session, + uint8_t flags, int32_t last_stream_id, + uint32_t error_code, + const uint8_t *opaque_data, + size_t opaque_data_len); + +/** + * @function + * + * Returns the last stream ID of a stream for which + * :type:`nghttp2_on_frame_recv_callback` was invoked most recently. + * The returned value can be used as last_stream_id parameter for + * `nghttp2_submit_goaway()` and + * `nghttp2_session_terminate_session2()`. + * + * This function always succeeds. + */ +NGHTTP2_EXTERN int32_t +nghttp2_session_get_last_proc_stream_id(nghttp2_session *session); + +/** + * @function + * + * Returns nonzero if new request can be sent from local endpoint. + * + * This function return 0 if request is not allowed for this session. + * There are several reasons why request is not allowed. Some of the + * reasons are: session is server; stream ID has been spent; GOAWAY + * has been sent or received. + * + * The application can call `nghttp2_submit_request2()` without + * consulting this function. In that case, + * `nghttp2_submit_request2()` may return error. Or, request is + * failed to sent, and :type:`nghttp2_on_stream_close_callback` is + * called. + */ +NGHTTP2_EXTERN int +nghttp2_session_check_request_allowed(nghttp2_session *session); + +/** + * @function + * + * Returns nonzero if |session| is initialized as server side session. + */ +NGHTTP2_EXTERN int +nghttp2_session_check_server_session(nghttp2_session *session); + +/** + * @function + * + * Submits WINDOW_UPDATE frame. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * The |stream_id| is the stream ID to send this WINDOW_UPDATE. To + * send connection level WINDOW_UPDATE, specify 0 to |stream_id|. + * + * If the |window_size_increment| is positive, the WINDOW_UPDATE with + * that value as window_size_increment is queued. If the + * |window_size_increment| is larger than the received bytes from the + * remote endpoint, the local window size is increased by that + * difference. If the sole purpose is to increase the local window + * size, consider to use `nghttp2_session_set_local_window_size()`. + * + * If the |window_size_increment| is negative, the local window size + * is decreased by -|window_size_increment|. If automatic + * WINDOW_UPDATE is enabled + * (`nghttp2_option_set_no_auto_window_update()`), and the library + * decided that the WINDOW_UPDATE should be submitted, then + * WINDOW_UPDATE is queued with the current received bytes count. If + * the sole purpose is to decrease the local window size, consider to + * use `nghttp2_session_set_local_window_size()`. + * + * If the |window_size_increment| is 0, the function does nothing and + * returns 0. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_FLOW_CONTROL` + * The local window size overflow or gets negative. + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_submit_window_update(nghttp2_session *session, + uint8_t flags, + int32_t stream_id, + int32_t window_size_increment); + +/** + * @function + * + * Set local window size (local endpoints's window size) to the given + * |window_size| for the given stream denoted by |stream_id|. To + * change connection level window size, specify 0 to |stream_id|. To + * increase window size, this function may submit WINDOW_UPDATE frame + * to transmission queue. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * This sounds similar to `nghttp2_submit_window_update()`, but there + * are 2 differences. The first difference is that this function + * takes the absolute value of window size to set, rather than the + * delta. To change the window size, this may be easier to use since + * the application just declares the intended window size, rather than + * calculating delta. The second difference is that + * `nghttp2_submit_window_update()` affects the received bytes count + * which has not acked yet. By the specification of + * `nghttp2_submit_window_update()`, to strictly increase the local + * window size, we have to submit delta including all received bytes + * count, which might not be desirable in some cases. On the other + * hand, this function does not affect the received bytes count. It + * just sets the local window size to the given value. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |stream_id| is negative. + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_session_set_local_window_size(nghttp2_session *session, uint8_t flags, + int32_t stream_id, int32_t window_size); + +/** + * @function + * + * Submits extension frame. + * + * Application can pass arbitrary frame flags and stream ID in |flags| + * and |stream_id| respectively. The |payload| is opaque pointer, and + * it can be accessible though ``frame->ext.payload`` in + * :type:`nghttp2_pack_extension_callback2`. The library will not own + * passed |payload| pointer. + * + * The application must set :type:`nghttp2_pack_extension_callback2` + * using `nghttp2_session_callbacks_set_pack_extension_callback2()`. + * + * The application should retain the memory pointed by |payload| until + * the transmission of extension frame is done (which is indicated by + * :type:`nghttp2_on_frame_send_callback`), or transmission fails + * (which is indicated by :type:`nghttp2_on_frame_not_send_callback`). + * If application does not touch this memory region after packing it + * into a wire format, application can free it inside + * :type:`nghttp2_pack_extension_callback2`. + * + * The standard HTTP/2 frame cannot be sent with this function, so + * |type| must be strictly grater than 0x9. Otherwise, this function + * will fail with error code + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT`. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * If :type:`nghttp2_pack_extension_callback2` is not set. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * If |type| specifies standard HTTP/2 frame type. The frame + * types in the rage [0x0, 0x9], both inclusive, are standard + * HTTP/2 frame type, and cannot be sent using this function. + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory + */ +NGHTTP2_EXTERN int nghttp2_submit_extension(nghttp2_session *session, + uint8_t type, uint8_t flags, + int32_t stream_id, void *payload); + +/** + * @struct + * + * The payload of ALTSVC frame. ALTSVC frame is a non-critical + * extension to HTTP/2. If this frame is received, and + * `nghttp2_option_set_user_recv_extension_type()` is not set, and + * `nghttp2_option_set_builtin_recv_extension_type()` is set for + * :enum:`nghttp2_frame_type.NGHTTP2_ALTSVC`, + * ``nghttp2_extension.payload`` will point to this struct. + * + * It has the following members: + */ +typedef struct { + /** + * The pointer to origin which this alternative service is + * associated with. This is not necessarily NULL-terminated. + */ + uint8_t *origin; + /** + * The length of the |origin|. + */ + size_t origin_len; + /** + * The pointer to Alt-Svc field value contained in ALTSVC frame. + * This is not necessarily NULL-terminated. + */ + uint8_t *field_value; + /** + * The length of the |field_value|. + */ + size_t field_value_len; +} nghttp2_ext_altsvc; + +/** + * @function + * + * Submits ALTSVC frame. + * + * ALTSVC frame is a non-critical extension to HTTP/2, and defined in + * `RFC 7383 `_. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * The |origin| points to the origin this alternative service is + * associated with. The |origin_len| is the length of the origin. If + * |stream_id| is 0, the origin must be specified. If |stream_id| is + * not zero, the origin must be empty (in other words, |origin_len| + * must be 0). + * + * The ALTSVC frame is only usable from server side. If this function + * is invoked with client side session, this function returns + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * The function is called from client side session + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The sum of |origin_len| and |field_value_len| is larger than + * 16382; or |origin_len| is 0 while |stream_id| is 0; or + * |origin_len| is not 0 while |stream_id| is not 0. + */ +NGHTTP2_EXTERN int nghttp2_submit_altsvc(nghttp2_session *session, + uint8_t flags, int32_t stream_id, + const uint8_t *origin, + size_t origin_len, + const uint8_t *field_value, + size_t field_value_len); + +/** + * @struct + * + * The single entry of an origin. + */ +typedef struct { + /** + * The pointer to origin. No validation is made against this field + * by the library. This is not necessarily NULL-terminated. + */ + uint8_t *origin; + /** + * The length of the |origin|. + */ + size_t origin_len; +} nghttp2_origin_entry; + +/** + * @struct + * + * The payload of ORIGIN frame. ORIGIN frame is a non-critical + * extension to HTTP/2 and defined by `RFC 8336 + * `_. + * + * If this frame is received, and + * `nghttp2_option_set_user_recv_extension_type()` is not set, and + * `nghttp2_option_set_builtin_recv_extension_type()` is set for + * :enum:`nghttp2_frame_type.NGHTTP2_ORIGIN`, + * ``nghttp2_extension.payload`` will point to this struct. + * + * It has the following members: + */ +typedef struct { + /** + * The number of origins contained in |ov|. + */ + size_t nov; + /** + * The pointer to the array of origins contained in ORIGIN frame. + */ + nghttp2_origin_entry *ov; +} nghttp2_ext_origin; + +/** + * @function + * + * Submits ORIGIN frame. + * + * ORIGIN frame is a non-critical extension to HTTP/2 and defined by + * `RFC 8336 `_. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * The |ov| points to the array of origins. The |nov| specifies the + * number of origins included in |ov|. This function creates copies + * of all elements in |ov|. + * + * The ORIGIN frame is only usable by a server. If this function is + * invoked with client side session, this function returns + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * The function is called from client side session. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * There are too many origins, or an origin is too large to fit + * into a default frame payload. + */ +NGHTTP2_EXTERN int nghttp2_submit_origin(nghttp2_session *session, + uint8_t flags, + const nghttp2_origin_entry *ov, + size_t nov); + +/** + * @struct + * + * The payload of PRIORITY_UPDATE frame. PRIORITY_UPDATE frame is a + * non-critical extension to HTTP/2. If this frame is received, and + * `nghttp2_option_set_user_recv_extension_type()` is not set, and + * `nghttp2_option_set_builtin_recv_extension_type()` is set for + * :enum:`nghttp2_frame_type.NGHTTP2_PRIORITY_UPDATE`, + * ``nghttp2_extension.payload`` will point to this struct. + * + * It has the following members: + */ +typedef struct { + /** + * The stream ID of the stream whose priority is updated. + */ + int32_t stream_id; + /** + * The pointer to Priority field value. It is not necessarily + * NULL-terminated. + */ + uint8_t *field_value; + /** + * The length of the :member:`field_value`. + */ + size_t field_value_len; +} nghttp2_ext_priority_update; + +/** + * @function + * + * Submits PRIORITY_UPDATE frame. + * + * PRIORITY_UPDATE frame is a non-critical extension to HTTP/2, and + * defined in :rfc:`9218#section-7.1`. + * + * The |flags| is currently ignored and should be + * :enum:`nghttp2_flag.NGHTTP2_FLAG_NONE`. + * + * The |stream_id| is the ID of stream which is prioritized. The + * |field_value| points to the Priority field value. The + * |field_value_len| is the length of the Priority field value. + * + * If this function is called by server, + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` is returned. + * + * If + * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES` + * of value of 0 is received by a remote endpoint (or it is omitted), + * this function does nothing and returns 0. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * The function is called from server side session + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * The |field_value_len| is larger than 16380; or |stream_id| is + * 0. + */ +NGHTTP2_EXTERN int nghttp2_submit_priority_update(nghttp2_session *session, + uint8_t flags, + int32_t stream_id, + const uint8_t *field_value, + size_t field_value_len); + +/** + * @function + * + * Changes the priority of the existing stream denoted by |stream_id|. + * The new priority is |extpri|. This function is meant to be used by + * server for :rfc:`9218` extensible prioritization scheme. + * + * If |session| is initialized as client, this function returns + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. For client, use + * `nghttp2_submit_priority_update()` instead. + * + * If :member:`extpri->urgency ` is out of + * bound, it is set to :macro:`NGHTTP2_EXTPRI_URGENCY_LOW`. + * + * If |ignore_client_signal| is nonzero, server starts to ignore + * client priority signals for this stream. + * + * If + * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES` + * of value of 1 is not submitted via `nghttp2_submit_settings()`, + * this function does nothing and returns 0. + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * The |session| is initialized as client. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * |stream_id| is zero; or a stream denoted by |stream_id| is not + * found. + */ +NGHTTP2_EXTERN int nghttp2_session_change_extpri_stream_priority( + nghttp2_session *session, int32_t stream_id, const nghttp2_extpri *extpri, + int ignore_client_signal); + +/** + * @function + * + * Stores the stream priority of the existing stream denoted by + * |stream_id| in the object pointed by |extpri|. This function is + * meant to be used by server for :rfc:`9218` extensible + * prioritization scheme. + * + * If |session| is initialized as client, this function returns + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE`. + * + * If + * :enum:`nghttp2_settings_id.NGHTTP2_SETTINGS_NO_RFC7540_PRIORITIES` + * of value of 1 is not submitted via `nghttp2_submit_settings()`, + * this function does nothing and returns 0. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * The |session| is initialized as client. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * |stream_id| is zero; or a stream denoted by |stream_id| is not + * found. + */ +NGHTTP2_EXTERN int nghttp2_session_get_extpri_stream_priority( + nghttp2_session *session, nghttp2_extpri *extpri, int32_t stream_id); + +/** + * @function + * + * Parses Priority header field value pointed by |value| of length + * |len|, and stores the result in the object pointed by |extpri|. + * Priority header field is defined in :rfc:`9218`. + * + * This function does not initialize the object pointed by |extpri| + * before storing the result. It only assigns the values that the + * parser correctly extracted to fields. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT` + * Failed to parse the header field value. + */ +NGHTTP2_EXTERN int nghttp2_extpri_parse_priority(nghttp2_extpri *extpri, + const uint8_t *value, + size_t len); + +/** + * @function + * + * Compares ``lhs->name`` of length ``lhs->namelen`` bytes and + * ``rhs->name`` of length ``rhs->namelen`` bytes. Returns negative + * integer if ``lhs->name`` is found to be less than ``rhs->name``; or + * returns positive integer if ``lhs->name`` is found to be greater + * than ``rhs->name``; or returns 0 otherwise. + */ +NGHTTP2_EXTERN int nghttp2_nv_compare_name(const nghttp2_nv *lhs, + const nghttp2_nv *rhs); + +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_select_alpn` instead. + * + * A helper function for dealing with ALPN in server side. The |in| + * contains peer's protocol list in preferable order. The format of + * |in| is length-prefixed and not null-terminated. For example, + * ``h2`` and ``http/1.1`` stored in |in| like this:: + * + * in[0] = 2 + * in[1..2] = "h2" + * in[3] = 8 + * in[4..11] = "http/1.1" + * inlen = 12 + * + * The selection algorithm is as follows: + * + * 1. If peer's list contains HTTP/2 protocol the library supports, + * it is selected and returns 1. The following step is not taken. + * + * 2. If peer's list contains ``http/1.1``, this function selects + * ``http/1.1`` and returns 0. The following step is not taken. + * + * 3. This function selects nothing and returns -1 (So called + * non-overlap case). In this case, |out| and |outlen| are left + * untouched. + * + * Selecting ``h2`` means that ``h2`` is written into |*out| and its + * length (which is 2) is assigned to |*outlen|. + * + * For ALPN, refer to https://tools.ietf.org/html/rfc7301 + * + * To use this method you should do something like:: + * + * static int alpn_select_proto_cb(SSL* ssl, + * const unsigned char **out, + * unsigned char *outlen, + * const unsigned char *in, + * unsigned int inlen, + * void *arg) + * { + * int rv; + * rv = nghttp2_select_next_protocol((unsigned char**)out, outlen, + * in, inlen); + * if (rv == -1) { + * return SSL_TLSEXT_ERR_NOACK; + * } + * if (rv == 1) { + * ((MyType*)arg)->http2_selected = 1; + * } + * return SSL_TLSEXT_ERR_OK; + * } + * ... + * SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, my_obj); + * + */ +NGHTTP2_EXTERN int nghttp2_select_next_protocol(unsigned char **out, + unsigned char *outlen, + const unsigned char *in, + unsigned int inlen); + +/** + * @function + * + * A helper function for dealing with ALPN in server side. The |in| + * contains peer's protocol list in preferable order. The format of + * |in| is length-prefixed and not null-terminated. For example, + * ``h2`` and ``http/1.1`` stored in |in| like this:: + * + * in[0] = 2 + * in[1..2] = "h2" + * in[3] = 8 + * in[4..11] = "http/1.1" + * inlen = 12 + * + * The selection algorithm is as follows: + * + * 1. If peer's list contains HTTP/2 protocol the library supports, + * it is selected and returns 1. The following step is not taken. + * + * 2. If peer's list contains ``http/1.1``, this function selects + * ``http/1.1`` and returns 0. The following step is not taken. + * + * 3. This function selects nothing and returns -1 (So called + * non-overlap case). In this case, |out| and |outlen| are left + * untouched. + * + * Selecting ``h2`` means that ``h2`` is written into |*out| and its + * length (which is 2) is assigned to |*outlen|. + * + * For ALPN, refer to https://tools.ietf.org/html/rfc7301 + * + * To use this method you should do something like:: + * + * static int alpn_select_proto_cb(SSL* ssl, + * const unsigned char **out, + * unsigned char *outlen, + * const unsigned char *in, + * unsigned int inlen, + * void *arg) + * { + * int rv; + * rv = nghttp2_select_alpn(out, outlen, in, inlen); + * if (rv == -1) { + * return SSL_TLSEXT_ERR_NOACK; + * } + * if (rv == 1) { + * ((MyType*)arg)->http2_selected = 1; + * } + * return SSL_TLSEXT_ERR_OK; + * } + * ... + * SSL_CTX_set_alpn_select_cb(ssl_ctx, alpn_select_proto_cb, my_obj); + * + */ +NGHTTP2_EXTERN int nghttp2_select_alpn(const unsigned char **out, + unsigned char *outlen, + const unsigned char *in, + unsigned int inlen); + +/** + * @function + * + * Returns a pointer to a nghttp2_info struct with version information + * about the run-time library in use. The |least_version| argument + * can be set to a 24 bit numerical value for the least accepted + * version number and if the condition is not met, this function will + * return a ``NULL``. Pass in 0 to skip the version checking. + */ +NGHTTP2_EXTERN nghttp2_info *nghttp2_version(int least_version); + +/** + * @function + * + * Returns nonzero if the :type:`nghttp2_error` library error code + * |lib_error| is fatal. + */ +NGHTTP2_EXTERN int nghttp2_is_fatal(int lib_error_code); + +/** + * @function + * + * Returns nonzero if HTTP header field name |name| of length |len| is + * valid according to http://tools.ietf.org/html/rfc7230#section-3.2 + * + * Because this is a header field name in HTTP2, the upper cased alphabet + * is treated as error. + */ +NGHTTP2_EXTERN int nghttp2_check_header_name(const uint8_t *name, size_t len); + +/** + * @function + * + * Returns nonzero if HTTP header field value |value| of length |len| + * is valid according to + * http://tools.ietf.org/html/rfc7230#section-3.2 + * + * This function is considered obsolete, and application should + * consider to use `nghttp2_check_header_value_rfc9113()` instead. + */ +NGHTTP2_EXTERN int nghttp2_check_header_value(const uint8_t *value, size_t len); + +/** + * @function + * + * Returns nonzero if HTTP header field value |value| of length |len| + * is valid according to + * http://tools.ietf.org/html/rfc7230#section-3.2, plus + * https://datatracker.ietf.org/doc/html/rfc9113#section-8.2.1 + */ +NGHTTP2_EXTERN int nghttp2_check_header_value_rfc9113(const uint8_t *value, + size_t len); + +/** + * @function + * + * Returns nonzero if the |value| which is supposed to be the value of + * the :method header field is valid according to + * https://datatracker.ietf.org/doc/html/rfc7231#section-4 and + * https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6 + */ +NGHTTP2_EXTERN int nghttp2_check_method(const uint8_t *value, size_t len); + +/** + * @function + * + * Returns nonzero if the |value| which is supposed to be the value of + * the :path header field is valid according to + * https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2.3 + * + * |value| is valid if it merely consists of the allowed characters. + * In particular, it does not check whether |value| follows the syntax + * of path. The allowed characters are all characters valid by + * `nghttp2_check_header_value` minus SPC and HT. + */ +NGHTTP2_EXTERN int nghttp2_check_path(const uint8_t *value, size_t len); + +/** + * @function + * + * Returns nonzero if the |value| which is supposed to be the value of the + * :authority or host header field is valid according to + * https://tools.ietf.org/html/rfc3986#section-3.2 + * + * Note that :authority and host field values are not authority. They + * do not include userinfo in RFC 3986, see + * https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2, that + * is, it does not include '@'. This function treats '@' as a valid + * character. + * + * |value| is valid if it merely consists of the allowed characters. + * In particular, it does not check whether |value| follows the syntax + * of authority. + */ +NGHTTP2_EXTERN int nghttp2_check_authority(const uint8_t *value, size_t len); + +/* HPACK API */ + +struct nghttp2_hd_deflater; + +/** + * @struct + * + * HPACK deflater object. + */ +typedef struct nghttp2_hd_deflater nghttp2_hd_deflater; + +/** + * @function + * + * Initializes |*deflater_ptr| for deflating name/values pairs. + * + * The |max_deflate_dynamic_table_size| is the upper bound of header + * table size the deflater will use. + * + * If this function fails, |*deflater_ptr| is left untouched. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_hd_deflate_new(nghttp2_hd_deflater **deflater_ptr, + size_t max_deflate_dynamic_table_size); + +/** + * @function + * + * Like `nghttp2_hd_deflate_new()`, but with additional custom memory + * allocator specified in the |mem|. + * + * The |mem| can be ``NULL`` and the call is equivalent to + * `nghttp2_hd_deflate_new()`. + * + * This function does not take ownership |mem|. The application is + * responsible for freeing |mem|. + * + * The library code does not refer to |mem| pointer after this + * function returns, so the application can safely free it. + */ +NGHTTP2_EXTERN int +nghttp2_hd_deflate_new2(nghttp2_hd_deflater **deflater_ptr, + size_t max_deflate_dynamic_table_size, + nghttp2_mem *mem); + +/** + * @function + * + * Deallocates any resources allocated for |deflater|. + */ +NGHTTP2_EXTERN void nghttp2_hd_deflate_del(nghttp2_hd_deflater *deflater); + +/** + * @function + * + * Changes header table size of the |deflater| to + * |settings_max_dynamic_table_size| bytes. This may trigger eviction + * in the dynamic table. + * + * The |settings_max_dynamic_table_size| should be the value received + * in SETTINGS_HEADER_TABLE_SIZE. + * + * The deflater never uses more memory than + * ``max_deflate_dynamic_table_size`` bytes specified in + * `nghttp2_hd_deflate_new()`. Therefore, if + * |settings_max_dynamic_table_size| > + * ``max_deflate_dynamic_table_size``, resulting maximum table size + * becomes ``max_deflate_dynamic_table_size``. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int +nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater, + size_t settings_max_dynamic_table_size); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_hd_deflate_hd2()` instead. + * + * Deflates the |nva|, which has the |nvlen| name/value pairs, into + * the |buf| of length |buflen|. + * + * If |buf| is not large enough to store the deflated header block, + * this function fails with + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller + * should use `nghttp2_hd_deflate_bound()` to know the upper bound of + * buffer size required to deflate given header name/value pairs. + * + * Once this function fails, subsequent call of this function always + * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. + * + * After this function returns, it is safe to delete the |nva|. + * + * This function returns the number of bytes written to |buf| if it + * succeeds, or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` + * Deflation process has failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` + * The provided |buflen| size is too small to hold the output. + */ +NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, + uint8_t *buf, size_t buflen, + const nghttp2_nv *nva, + size_t nvlen); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Deflates the |nva|, which has the |nvlen| name/value pairs, into + * the |buf| of length |buflen|. + * + * If |buf| is not large enough to store the deflated header block, + * this function fails with + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller + * should use `nghttp2_hd_deflate_bound()` to know the upper bound of + * buffer size required to deflate given header name/value pairs. + * + * Once this function fails, subsequent call of this function always + * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. + * + * After this function returns, it is safe to delete the |nva|. + * + * This function returns the number of bytes written to |buf| if it + * succeeds, or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` + * Deflation process has failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` + * The provided |buflen| size is too small to hold the output. + */ +NGHTTP2_EXTERN nghttp2_ssize +nghttp2_hd_deflate_hd2(nghttp2_hd_deflater *deflater, uint8_t *buf, + size_t buflen, const nghttp2_nv *nva, size_t nvlen); + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_hd_deflate_hd_vec2()` instead. + * + * Deflates the |nva|, which has the |nvlen| name/value pairs, into + * the |veclen| size of buf vector |vec|. The each size of buffer + * must be set in len field of :type:`nghttp2_vec`. If and only if + * one chunk is filled up completely, next chunk will be used. If + * |vec| is not large enough to store the deflated header block, this + * function fails with + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller + * should use `nghttp2_hd_deflate_bound()` to know the upper bound of + * buffer size required to deflate given header name/value pairs. + * + * Once this function fails, subsequent call of this function always + * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. + * + * After this function returns, it is safe to delete the |nva|. + * + * This function returns the number of bytes written to |vec| if it + * succeeds, or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` + * Deflation process has failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` + * The provided |buflen| size is too small to hold the output. + */ +NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, + const nghttp2_vec *vec, + size_t veclen, + const nghttp2_nv *nva, + size_t nvlen); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Deflates the |nva|, which has the |nvlen| name/value pairs, into + * the |veclen| size of buf vector |vec|. The each size of buffer + * must be set in len field of :type:`nghttp2_vec`. If and only if + * one chunk is filled up completely, next chunk will be used. If + * |vec| is not large enough to store the deflated header block, this + * function fails with + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller + * should use `nghttp2_hd_deflate_bound()` to know the upper bound of + * buffer size required to deflate given header name/value pairs. + * + * Once this function fails, subsequent call of this function always + * returns :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`. + * + * After this function returns, it is safe to delete the |nva|. + * + * This function returns the number of bytes written to |vec| if it + * succeeds, or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` + * Deflation process has failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE` + * The provided |buflen| size is too small to hold the output. + */ +NGHTTP2_EXTERN nghttp2_ssize nghttp2_hd_deflate_hd_vec2( + nghttp2_hd_deflater *deflater, const nghttp2_vec *vec, size_t veclen, + const nghttp2_nv *nva, size_t nvlen); + +/** + * @function + * + * Returns an upper bound on the compressed size after deflation of + * |nva| of length |nvlen|. + */ +NGHTTP2_EXTERN size_t nghttp2_hd_deflate_bound(nghttp2_hd_deflater *deflater, + const nghttp2_nv *nva, + size_t nvlen); + +/** + * @function + * + * Returns the number of entries that header table of |deflater| + * contains. This is the sum of the number of static table and + * dynamic table, so the return value is at least 61. + */ +NGHTTP2_EXTERN +size_t nghttp2_hd_deflate_get_num_table_entries(nghttp2_hd_deflater *deflater); + +/** + * @function + * + * Returns the table entry denoted by |idx| from header table of + * |deflater|. The |idx| is 1-based, and idx=1 returns first entry of + * static table. idx=62 returns first entry of dynamic table if it + * exists. Specifying idx=0 is error, and this function returns NULL. + * If |idx| is strictly greater than the number of entries the tables + * contain, this function returns NULL. + */ +NGHTTP2_EXTERN +const nghttp2_nv * +nghttp2_hd_deflate_get_table_entry(nghttp2_hd_deflater *deflater, size_t idx); + +/** + * @function + * + * Returns the used dynamic table size, including the overhead 32 + * bytes per entry described in RFC 7541. + */ +NGHTTP2_EXTERN +size_t nghttp2_hd_deflate_get_dynamic_table_size(nghttp2_hd_deflater *deflater); + +/** + * @function + * + * Returns the maximum dynamic table size. + */ +NGHTTP2_EXTERN +size_t +nghttp2_hd_deflate_get_max_dynamic_table_size(nghttp2_hd_deflater *deflater); + +struct nghttp2_hd_inflater; + +/** + * @struct + * + * HPACK inflater object. + */ +typedef struct nghttp2_hd_inflater nghttp2_hd_inflater; + +/** + * @function + * + * Initializes |*inflater_ptr| for inflating name/values pairs. + * + * If this function fails, |*inflater_ptr| is left untouched. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + */ +NGHTTP2_EXTERN int nghttp2_hd_inflate_new(nghttp2_hd_inflater **inflater_ptr); + +/** + * @function + * + * Like `nghttp2_hd_inflate_new()`, but with additional custom memory + * allocator specified in the |mem|. + * + * The |mem| can be ``NULL`` and the call is equivalent to + * `nghttp2_hd_inflate_new()`. + * + * This function does not take ownership |mem|. The application is + * responsible for freeing |mem|. + * + * The library code does not refer to |mem| pointer after this + * function returns, so the application can safely free it. + */ +NGHTTP2_EXTERN int nghttp2_hd_inflate_new2(nghttp2_hd_inflater **inflater_ptr, + nghttp2_mem *mem); + +/** + * @function + * + * Deallocates any resources allocated for |inflater|. + */ +NGHTTP2_EXTERN void nghttp2_hd_inflate_del(nghttp2_hd_inflater *inflater); + +/** + * @function + * + * Changes header table size in the |inflater|. This may trigger + * eviction in the dynamic table. + * + * The |settings_max_dynamic_table_size| should be the value + * transmitted in SETTINGS_HEADER_TABLE_SIZE. + * + * This function must not be called while header block is being + * inflated. In other words, this function must be called after + * initialization of |inflater|, but before calling + * `nghttp2_hd_inflate_hd3()`, or after + * `nghttp2_hd_inflate_end_headers()`. Otherwise, + * `NGHTTP2_ERR_INVALID_STATE` was returned. + * + * This function returns 0 if it succeeds, or one of the following + * negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_INVALID_STATE` + * The function is called while header block is being inflated. + * Probably, application missed to call + * `nghttp2_hd_inflate_end_headers()`. + */ +NGHTTP2_EXTERN int +nghttp2_hd_inflate_change_table_size(nghttp2_hd_inflater *inflater, + size_t settings_max_dynamic_table_size); + +/** + * @enum + * + * The flags for header inflation. + */ +typedef enum { + /** + * No flag set. + */ + NGHTTP2_HD_INFLATE_NONE = 0, + /** + * Indicates all headers were inflated. + */ + NGHTTP2_HD_INFLATE_FINAL = 0x01, + /** + * Indicates a header was emitted. + */ + NGHTTP2_HD_INFLATE_EMIT = 0x02 +} nghttp2_hd_inflate_flag; + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_hd_inflate_hd2()` instead. + * + * Inflates name/value block stored in |in| with length |inlen|. This + * function performs decompression. For each successful emission of + * header name/value pair, + * :enum:`nghttp2_hd_inflate_flag.NGHTTP2_HD_INFLATE_EMIT` is set in + * |*inflate_flags| and name/value pair is assigned to the |nv_out| + * and the function returns. The caller must not free the members of + * |nv_out|. + * + * The |nv_out| may include pointers to the memory region in the |in|. + * The caller must retain the |in| while the |nv_out| is used. + * + * The application should call this function repeatedly until the + * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and + * return value is non-negative. This means the all input values are + * processed successfully. Then the application must call + * `nghttp2_hd_inflate_end_headers()` to prepare for the next header + * block input. + * + * The caller can feed complete compressed header block. It also can + * feed it in several chunks. The caller must set |in_final| to + * nonzero if the given input is the last block of the compressed + * header. + * + * This function returns the number of bytes processed if it succeeds, + * or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` + * Inflation process has failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_BUFFER_ERROR` + * The header field name or value is too large. + * + * Example follows:: + * + * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, + * uint8_t *in, size_t inlen, int final) + * { + * ssize_t rv; + * + * for(;;) { + * nghttp2_nv nv; + * int inflate_flags = 0; + * + * rv = nghttp2_hd_inflate_hd(hd_inflater, &nv, &inflate_flags, + * in, inlen, final); + * + * if(rv < 0) { + * fprintf(stderr, "inflate failed with error code %zd", rv); + * return -1; + * } + * + * in += rv; + * inlen -= rv; + * + * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { + * fwrite(nv.name, nv.namelen, 1, stderr); + * fprintf(stderr, ": "); + * fwrite(nv.value, nv.valuelen, 1, stderr); + * fprintf(stderr, "\n"); + * } + * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { + * nghttp2_hd_inflate_end_headers(hd_inflater); + * break; + * } + * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && + * inlen == 0) { + * break; + * } + * } + * + * return 0; + * } + * + */ +NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater, + nghttp2_nv *nv_out, + int *inflate_flags, uint8_t *in, + size_t inlen, int in_final); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +#ifndef NGHTTP2_NO_SSIZE_T +/** + * @function + * + * .. warning:: + * + * Deprecated. Use `nghttp2_hd_inflate_hd3()` instead. + * + * Inflates name/value block stored in |in| with length |inlen|. This + * function performs decompression. For each successful emission of + * header name/value pair, + * :enum:`nghttp2_hd_inflate_flag.NGHTTP2_HD_INFLATE_EMIT` is set in + * |*inflate_flags| and name/value pair is assigned to the |nv_out| + * and the function returns. The caller must not free the members of + * |nv_out|. + * + * The |nv_out| may include pointers to the memory region in the |in|. + * The caller must retain the |in| while the |nv_out| is used. + * + * The application should call this function repeatedly until the + * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and + * return value is non-negative. If that happens, all given input + * data (|inlen| bytes) are processed successfully. Then the + * application must call `nghttp2_hd_inflate_end_headers()` to prepare + * for the next header block input. + * + * In other words, if |in_final| is nonzero, and this function returns + * |inlen|, you can assert that + * :enum:`nghttp2_hd_inflate_final.NGHTTP2_HD_INFLATE_FINAL` is set in + * |*inflate_flags|. + * + * The caller can feed complete compressed header block. It also can + * feed it in several chunks. The caller must set |in_final| to + * nonzero if the given input is the last block of the compressed + * header. + * + * This function returns the number of bytes processed if it succeeds, + * or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` + * Inflation process has failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_BUFFER_ERROR` + * The header field name or value is too large. + * + * Example follows:: + * + * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, + * uint8_t *in, size_t inlen, int final) + * { + * ssize_t rv; + * + * for(;;) { + * nghttp2_nv nv; + * int inflate_flags = 0; + * + * rv = nghttp2_hd_inflate_hd2(hd_inflater, &nv, &inflate_flags, + * in, inlen, final); + * + * if(rv < 0) { + * fprintf(stderr, "inflate failed with error code %zd", rv); + * return -1; + * } + * + * in += rv; + * inlen -= rv; + * + * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { + * fwrite(nv.name, nv.namelen, 1, stderr); + * fprintf(stderr, ": "); + * fwrite(nv.value, nv.valuelen, 1, stderr); + * fprintf(stderr, "\n"); + * } + * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { + * nghttp2_hd_inflate_end_headers(hd_inflater); + * break; + * } + * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && + * inlen == 0) { + * break; + * } + * } + * + * return 0; + * } + * + */ +NGHTTP2_EXTERN ssize_t nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater, + nghttp2_nv *nv_out, + int *inflate_flags, + const uint8_t *in, size_t inlen, + int in_final); + +#endif /* NGHTTP2_NO_SSIZE_T */ + +/** + * @function + * + * Inflates name/value block stored in |in| with length |inlen|. This + * function performs decompression. For each successful emission of + * header name/value pair, + * :enum:`nghttp2_hd_inflate_flag.NGHTTP2_HD_INFLATE_EMIT` is set in + * |*inflate_flags| and name/value pair is assigned to the |nv_out| + * and the function returns. The caller must not free the members of + * |nv_out|. + * + * The |nv_out| may include pointers to the memory region in the |in|. + * The caller must retain the |in| while the |nv_out| is used. + * + * The application should call this function repeatedly until the + * ``(*inflate_flags) & NGHTTP2_HD_INFLATE_FINAL`` is nonzero and + * return value is non-negative. If that happens, all given input + * data (|inlen| bytes) are processed successfully. Then the + * application must call `nghttp2_hd_inflate_end_headers()` to prepare + * for the next header block input. + * + * In other words, if |in_final| is nonzero, and this function returns + * |inlen|, you can assert that + * :enum:`nghttp2_hd_inflate_final.NGHTTP2_HD_INFLATE_FINAL` is set in + * |*inflate_flags|. + * + * The caller can feed complete compressed header block. It also can + * feed it in several chunks. The caller must set |in_final| to + * nonzero if the given input is the last block of the compressed + * header. + * + * This function returns the number of bytes processed if it succeeds, + * or one of the following negative error codes: + * + * :enum:`nghttp2_error.NGHTTP2_ERR_NOMEM` + * Out of memory. + * :enum:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP` + * Inflation process has failed. + * :enum:`nghttp2_error.NGHTTP2_ERR_BUFFER_ERROR` + * The header field name or value is too large. + * + * Example follows:: + * + * int inflate_header_block(nghttp2_hd_inflater *hd_inflater, + * uint8_t *in, size_t inlen, int final) + * { + * nghttp2_ssize rv; + * + * for(;;) { + * nghttp2_nv nv; + * int inflate_flags = 0; + * + * rv = nghttp2_hd_inflate_hd3(hd_inflater, &nv, &inflate_flags, + * in, inlen, final); + * + * if(rv < 0) { + * fprintf(stderr, "inflate failed with error code %td", rv); + * return -1; + * } + * + * in += rv; + * inlen -= rv; + * + * if(inflate_flags & NGHTTP2_HD_INFLATE_EMIT) { + * fwrite(nv.name, nv.namelen, 1, stderr); + * fprintf(stderr, ": "); + * fwrite(nv.value, nv.valuelen, 1, stderr); + * fprintf(stderr, "\n"); + * } + * if(inflate_flags & NGHTTP2_HD_INFLATE_FINAL) { + * nghttp2_hd_inflate_end_headers(hd_inflater); + * break; + * } + * if((inflate_flags & NGHTTP2_HD_INFLATE_EMIT) == 0 && + * inlen == 0) { + * break; + * } + * } + * + * return 0; + * } + * + */ +NGHTTP2_EXTERN nghttp2_ssize nghttp2_hd_inflate_hd3( + nghttp2_hd_inflater *inflater, nghttp2_nv *nv_out, int *inflate_flags, + const uint8_t *in, size_t inlen, int in_final); + +/** + * @function + * + * Signals the end of decompression for one header block. + * + * This function returns 0 if it succeeds. Currently this function + * always succeeds. + */ +NGHTTP2_EXTERN int +nghttp2_hd_inflate_end_headers(nghttp2_hd_inflater *inflater); + +/** + * @function + * + * Returns the number of entries that header table of |inflater| + * contains. This is the sum of the number of static table and + * dynamic table, so the return value is at least 61. + */ +NGHTTP2_EXTERN +size_t nghttp2_hd_inflate_get_num_table_entries(nghttp2_hd_inflater *inflater); + +/** + * @function + * + * Returns the table entry denoted by |idx| from header table of + * |inflater|. The |idx| is 1-based, and idx=1 returns first entry of + * static table. idx=62 returns first entry of dynamic table if it + * exists. Specifying idx=0 is error, and this function returns NULL. + * If |idx| is strictly greater than the number of entries the tables + * contain, this function returns NULL. + */ +NGHTTP2_EXTERN +const nghttp2_nv * +nghttp2_hd_inflate_get_table_entry(nghttp2_hd_inflater *inflater, size_t idx); + +/** + * @function + * + * Returns the used dynamic table size, including the overhead 32 + * bytes per entry described in RFC 7541. + */ +NGHTTP2_EXTERN +size_t nghttp2_hd_inflate_get_dynamic_table_size(nghttp2_hd_inflater *inflater); + +/** + * @function + * + * Returns the maximum dynamic table size. + */ +NGHTTP2_EXTERN +size_t +nghttp2_hd_inflate_get_max_dynamic_table_size(nghttp2_hd_inflater *inflater); + +struct nghttp2_stream; + +/** + * @struct + * + * The structure to represent HTTP/2 stream. The details of this + * structure are intentionally hidden from the public API. + */ +typedef struct nghttp2_stream nghttp2_stream; + +/** + * @function + * + * Returns pointer to :type:`nghttp2_stream` object denoted by + * |stream_id|. If stream was not found, returns NULL. + * + * Returns imaginary root stream (see + * `nghttp2_session_get_root_stream()`) if 0 is given in |stream_id|. + * + * Unless |stream_id| == 0, the returned pointer is valid until next + * call of `nghttp2_session_send()`, `nghttp2_session_mem_send2()`, + * `nghttp2_session_recv()`, and `nghttp2_session_mem_recv2()`. + */ +NGHTTP2_EXTERN nghttp2_stream * +nghttp2_session_find_stream(nghttp2_session *session, int32_t stream_id); + +/** + * @enum + * + * State of stream as described in RFC 7540. + */ +typedef enum { + /** + * idle state. + */ + NGHTTP2_STREAM_STATE_IDLE = 1, + /** + * open state. + */ + NGHTTP2_STREAM_STATE_OPEN, + /** + * reserved (local) state. + */ + NGHTTP2_STREAM_STATE_RESERVED_LOCAL, + /** + * reserved (remote) state. + */ + NGHTTP2_STREAM_STATE_RESERVED_REMOTE, + /** + * half closed (local) state. + */ + NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL, + /** + * half closed (remote) state. + */ + NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE, + /** + * closed state. + */ + NGHTTP2_STREAM_STATE_CLOSED +} nghttp2_stream_proto_state; + +/** + * @function + * + * Returns state of |stream|. The root stream retrieved by + * `nghttp2_session_get_root_stream()` will have stream state + * :enum:`nghttp2_stream_proto_state.NGHTTP2_STREAM_STATE_IDLE`. + */ +NGHTTP2_EXTERN nghttp2_stream_proto_state +nghttp2_stream_get_state(nghttp2_stream *stream); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * Returns root of dependency tree, which is imaginary stream with + * stream ID 0. The returned pointer is valid until |session| is + * freed by `nghttp2_session_del()`. + */ +NGHTTP2_EXTERN nghttp2_stream * +nghttp2_session_get_root_stream(nghttp2_session *session); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function always returns NULL. + */ +NGHTTP2_EXTERN nghttp2_stream * +nghttp2_stream_get_parent(nghttp2_stream *stream); + +NGHTTP2_EXTERN int32_t nghttp2_stream_get_stream_id(nghttp2_stream *stream); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function always returns NULL. + */ +NGHTTP2_EXTERN nghttp2_stream * +nghttp2_stream_get_next_sibling(nghttp2_stream *stream); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function always returns NULL. + */ +NGHTTP2_EXTERN nghttp2_stream * +nghttp2_stream_get_previous_sibling(nghttp2_stream *stream); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function always returns NULL. + */ +NGHTTP2_EXTERN nghttp2_stream * +nghttp2_stream_get_first_child(nghttp2_stream *stream); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function always returns :macro:`NGHTTP2_DEFAULT_WEIGHT`. + */ +NGHTTP2_EXTERN int32_t nghttp2_stream_get_weight(nghttp2_stream *stream); + +/** + * @function + * + * .. warning:: + * + * Deprecated. :rfc:`7540` priorities are deprecated by + * :rfc:`9113`. Consider migrating to :rfc:`9218` extensible + * prioritization scheme. + * + * This function always returns 0. + */ +NGHTTP2_EXTERN int32_t +nghttp2_stream_get_sum_dependency_weight(nghttp2_stream *stream); + +/** + * @functypedef + * + * Callback function invoked when the library outputs debug logging. + * The function is called with arguments suitable for ``vfprintf(3)`` + * + * The debug output is only enabled if the library is built with + * ``DEBUGBUILD`` macro defined. + */ +typedef void (*nghttp2_debug_vprintf_callback)(const char *format, + va_list args); + +/** + * @function + * + * Sets a debug output callback called by the library when built with + * ``DEBUGBUILD`` macro defined. If this option is not used, debug + * log is written into standard error output. + * + * For builds without ``DEBUGBUILD`` macro defined, this function is + * noop. + * + * Note that building with ``DEBUGBUILD`` may cause significant + * performance penalty to libnghttp2 because of extra processing. It + * should be used for debugging purpose only. + * + * .. Warning:: + * + * Building with ``DEBUGBUILD`` may cause significant performance + * penalty to libnghttp2 because of extra processing. It should be + * used for debugging purpose only. We write this two times because + * this is important. + */ +NGHTTP2_EXTERN void nghttp2_set_debug_vprintf_callback( + nghttp2_debug_vprintf_callback debug_vprintf_callback); + +#ifdef __cplusplus +} +#endif + +#endif /* NGHTTP2_H */ diff --git a/data/miniconda3/include/nghttp2/nghttp2ver.h b/data/miniconda3/include/nghttp2/nghttp2ver.h new file mode 100644 index 0000000000000000000000000000000000000000..bd5e6c2872323216a93b8704671ee741a97ba818 --- /dev/null +++ b/data/miniconda3/include/nghttp2/nghttp2ver.h @@ -0,0 +1,42 @@ +/* + * nghttp2 - HTTP/2 C Library + * + * Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef NGHTTP2VER_H +#define NGHTTP2VER_H + +/** + * @macro + * Version number of the nghttp2 library release + */ +#define NGHTTP2_VERSION "1.67.1" + +/** + * @macro + * Numerical representation of the version number of the nghttp2 library + * release. This is a 24 bit number with 8 bits for major number, 8 bits + * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. + */ +#define NGHTTP2_VERSION_NUM 0x014301 + +#endif /* NGHTTP2VER_H */ diff --git a/data/miniconda3/include/reproc++/arguments.hpp b/data/miniconda3/include/reproc++/arguments.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c542fafc0ddf8b0c9d11dcb16f14a2781b05383a --- /dev/null +++ b/data/miniconda3/include/reproc++/arguments.hpp @@ -0,0 +1,59 @@ +#pragma once + +#include +#include + +namespace reproc { + +class arguments : public detail::array { +public: + arguments(const char *const *argv) // NOLINT + : detail::array(argv, false) + {} + + /*! + `Arguments` must be iterable as a sequence of strings. Examples of types that + satisfy this requirement are `std::vector` and + `std::array`. + + `arguments` has the same restrictions as `argv` in `reproc_start` except + that it should not end with `NULL` (`start` allocates a new array which + includes the missing `NULL` value). + */ + template > + arguments(const Arguments &arguments) // NOLINT + : detail::array(from(arguments), true) + {} + +private: + template + static const char *const *from(const Arguments &arguments); +}; + +template +const char *const *arguments::from(const Arguments &arguments) +{ + using size_type = typename Arguments::value_type::size_type; + + const char **argv = new const char *[arguments.size() + 1]; + std::size_t current = 0; + + for (const auto &argument : arguments) { + char *string = new char[argument.size() + 1]; + + argv[current++] = string; + + for (size_type i = 0; i < argument.size(); i++) { + *string++ = argument[i]; + } + + *string = '\0'; + } + + argv[current] = nullptr; + + return argv; +} + +} diff --git a/data/miniconda3/include/reproc++/drain.hpp b/data/miniconda3/include/reproc++/drain.hpp new file mode 100644 index 0000000000000000000000000000000000000000..90ad2efa914a93ee6ab378fc5a1f5efc4e66fe77 --- /dev/null +++ b/data/miniconda3/include/reproc++/drain.hpp @@ -0,0 +1,152 @@ +#pragma once + +#include +#include +#include + +#include + +namespace reproc { + +/*! +`reproc_drain` but takes lambdas as sinks. Return an error code from a sink to +break out of `drain` early. `out` and `err` expect the following signature: + +```c++ +std::error_code sink(stream stream, const uint8_t *buffer, size_t size); +``` +*/ +template +std::error_code drain(process &process, Out &&out, Err &&err) +{ + static constexpr uint8_t initial = 0; + std::error_code ec; + + // A single call to `read` might contain multiple messages. By always calling + // both sinks once with no data before reading, we give them the chance to + // process all previous output before reading from the child process again. + + ec = out(stream::in, &initial, 0); + if (ec) { + return ec; + } + + ec = err(stream::in, &initial, 0); + if (ec) { + return ec; + } + + static constexpr size_t BUFFER_SIZE = 4096; + uint8_t buffer[BUFFER_SIZE] = {}; + + for (;;) { + int events = 0; + std::tie(events, ec) = process.poll(event::out | event::err, infinite); + if (ec) { + ec = ec == error::broken_pipe ? std::error_code() : ec; + break; + } + + if (events & event::deadline) { + ec = std::make_error_code(std::errc::timed_out); + break; + } + + stream stream = events & event::out ? stream::out : stream::err; + + size_t bytes_read = 0; + std::tie(bytes_read, ec) = process.read(stream, buffer, BUFFER_SIZE); + if (ec && ec != error::broken_pipe) { + break; + } + + bytes_read = ec == error::broken_pipe ? 0 : bytes_read; + + // This used to be `auto &sink = stream == stream::out ? out : err;` but + // that doesn't actually work if `out` and `err` are not the same type. + if (stream == stream::out) { + ec = out(stream, buffer, bytes_read); + } else { + ec = err(stream, buffer, bytes_read); + } + + if (ec) { + break; + } + } + + return ec; +} + +namespace sink { + +/*! Reads all output into `string`. */ +class string { + std::string &string_; + +public: + explicit string(std::string &string) noexcept : string_(string) {} + + std::error_code operator()(stream stream, const uint8_t *buffer, size_t size) + { + (void) stream; + string_.append(reinterpret_cast(buffer), size); + return {}; + } +}; + +/*! Forwards all output to `ostream`. */ +class ostream { + std::ostream &ostream_; + +public: + explicit ostream(std::ostream &ostream) noexcept : ostream_(ostream) {} + + std::error_code operator()(stream stream, const uint8_t *buffer, size_t size) + { + (void) stream; + ostream_.write(reinterpret_cast(buffer), + static_cast(size)); + return {}; + } +}; + +/*! Discards all output. */ +class discard { +public: + std::error_code + operator()(stream stream, const uint8_t *buffer, size_t size) const noexcept + { + (void) stream; + (void) buffer; + (void) size; + + return {}; + } +}; + +constexpr discard null = discard(); + +namespace thread_safe { + +/*! `sink::string` but locks the given mutex before invoking the sink. */ +class string { + sink::string sink_; + std::mutex &mutex_; + +public: + string(std::string &string, std::mutex &mutex) noexcept + : sink_(string), mutex_(mutex) + {} + + std::error_code operator()(stream stream, const uint8_t *buffer, size_t size) + { + std::lock_guard lock(mutex_); + return sink_(stream, buffer, size); + } +}; + +} + +} +} diff --git a/data/miniconda3/include/reproc++/env.hpp b/data/miniconda3/include/reproc++/env.hpp new file mode 100644 index 0000000000000000000000000000000000000000..144f41dc9654d45cd303d6782911601672538056 --- /dev/null +++ b/data/miniconda3/include/reproc++/env.hpp @@ -0,0 +1,76 @@ +#pragma once + +#include +#include + +namespace reproc { + +class env : public detail::array { +public: + enum type { + extend, + empty, + }; + + env(const char *const *envp = nullptr) // NOLINT + : detail::array(envp, false) + {} + + /*! + `Env` must be iterable as a sequence of string pairs. Examples of + types that satisfy this requirement are `std::vector>` and `std::map`. + + The pairs in `env` represent the extra environment variables of the child + process and are converted to the right format before being passed as the + environment to `reproc_start` via the `env.extra` field of `reproc_options`. + */ + template > + env(const Env &env) // NOLINT + : detail::array(from(env), true) + {} + +private: + template + static const char *const *from(const Env &env); +}; + +template +const char *const *env::from(const Env &env) +{ + using name_size_type = typename Env::value_type::first_type::size_type; + using value_size_type = typename Env::value_type::second_type::size_type; + + const char **envp = new const char *[env.size() + 1]; + std::size_t current = 0; + + for (const auto &entry : env) { + const auto &name = entry.first; + const auto &value = entry.second; + + // We add 2 to the size to reserve space for the '=' sign and the NUL + // terminator at the end of the string. + char *string = new char[name.size() + value.size() + 2]; + + envp[current++] = string; + + for (name_size_type i = 0; i < name.size(); i++) { + *string++ = name[i]; + } + + *string++ = '='; + + for (value_size_type i = 0; i < value.size(); i++) { + *string++ = value[i]; + } + + *string = '\0'; + } + + envp[current] = nullptr; + + return envp; +} + +} diff --git a/data/miniconda3/include/reproc++/export.hpp b/data/miniconda3/include/reproc++/export.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3eb0af0e6beb6b0ff311145410cffadaf7c5f69e --- /dev/null +++ b/data/miniconda3/include/reproc++/export.hpp @@ -0,0 +1,21 @@ +#pragma once + +#ifndef REPROCXX_EXPORT + #ifdef _WIN32 + #ifdef REPROCXX_SHARED + #ifdef REPROCXX_BUILDING + #define REPROCXX_EXPORT __declspec(dllexport) + #else + #define REPROCXX_EXPORT __declspec(dllimport) + #endif + #else + #define REPROCXX_EXPORT + #endif + #else + #ifdef REPROCXX_BUILDING + #define REPROCXX_EXPORT __attribute__((visibility("default"))) + #else + #define REPROCXX_EXPORT + #endif + #endif +#endif diff --git a/data/miniconda3/include/reproc++/input.hpp b/data/miniconda3/include/reproc++/input.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e69049d26601ff32d44a95e10b5ab34ed97c36e4 --- /dev/null +++ b/data/miniconda3/include/reproc++/input.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include +#include + +namespace reproc { + +class input { + const uint8_t *data_ = nullptr; + size_t size_ = 0; + +public: + input() = default; + + input(const uint8_t *data, size_t size) : data_(data), size_(size) {} + + /*! Implicitly convert from string literals. */ + template + input(const char (&data)[N]) // NOLINT + : data_(reinterpret_cast(data)), size_(N) + {} + + input(const input &other) = default; + input &operator=(const input &) = default; + + const uint8_t *data() const noexcept + { + return data_; + } + + size_t size() const noexcept + { + return size_; + } +}; + +} diff --git a/data/miniconda3/include/reproc++/reproc.hpp b/data/miniconda3/include/reproc++/reproc.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ab6f1394acac04ae8f51d263b0948c3d025b219a --- /dev/null +++ b/data/miniconda3/include/reproc++/reproc.hpp @@ -0,0 +1,223 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +// Forward declare `reproc_t` so we don't have to include reproc.h in the +// header. +struct reproc_t; + +/*! The `reproc` namespace wraps all reproc++ declarations. `process` wraps +reproc's API inside a C++ class. To avoid exposing reproc's API when using +reproc++ all structs, enums and constants of reproc have a replacement in +reproc++. Only differences in behaviour compared to reproc are documented. Refer +to reproc.h and the examples for general information on how to use reproc. */ +namespace reproc { + +/*! Conversion from reproc `errno` constants to `std::errc` constants: +https://en.cppreference.com/w/cpp/error/errc */ +using error = std::errc; + +namespace signal { + +REPROCXX_EXPORT extern const int kill; +REPROCXX_EXPORT extern const int terminate; + +} + +/*! Timeout values are passed as `reproc::milliseconds` instead of `int` in +reproc++. */ +using milliseconds = std::chrono::duration; + +REPROCXX_EXPORT extern const milliseconds infinite; +REPROCXX_EXPORT extern const milliseconds deadline; + +enum class stop { + noop, + wait, + terminate, + kill, +}; + +struct stop_action { + stop action; + milliseconds timeout; +}; + +struct stop_actions { + stop_action first; + stop_action second; + stop_action third; +}; + +#if defined(_WIN32) +using handle = void *; +#else +using handle = int; +#endif + +struct redirect { + enum type { + default_, // Unfortunately, both `default` and `auto` are keywords. + pipe, + parent, + discard, + // stdout would conflict with a macro on Windows. + stdout_, + // Unfortunately, class members and nested enum members can't have the same + // name. + handle_, + file_, + path_, + }; + + enum type type; + reproc::handle handle; + FILE *file; + const char *path; +}; + +struct options { + struct { + env::type behavior; + /*! Implicitly converts from any STL container of string pairs to the + environment format expected by `reproc_start`. */ + class env extra; + } env = {}; + + const char *working_directory = nullptr; + + struct { + redirect in; + redirect out; + redirect err; + bool parent; + bool discard; + FILE *file; + const char *path; + } redirect = {}; + + struct stop_actions stop = {}; + reproc::milliseconds timeout = reproc::milliseconds(0); + reproc::milliseconds deadline = reproc::milliseconds(0); + /*! Implicitly converts from string literals to the pointer size pair expected + by `reproc_start`. */ + class input input; + bool nonblocking = false; + + /*! Make a shallow copy of `options`. */ + static options clone(const options &other) + { + struct options clone; + clone.env.behavior = other.env.behavior; + // Make sure we make a shallow copy of `environment`. + clone.env.extra = other.env.extra.data(); + clone.working_directory = other.working_directory; + clone.redirect = other.redirect; + clone.stop = other.stop; + clone.timeout = other.timeout; + clone.deadline = other.deadline; + clone.input = other.input; + + return clone; + } +}; + +enum class stream { + in, + out, + err, +}; + +class process; + +namespace event { + +enum { + in = 1 << 0, + out = 1 << 1, + err = 1 << 2, + exit = 1 << 3, + deadline = 1 << 4, +}; + +struct source { + class process &process; + int interests; + int events; +}; + +} + +REPROCXX_EXPORT std::error_code poll(event::source *sources, + size_t num_sources, + milliseconds timeout = infinite); + +/*! Improves on reproc's API by adding RAII and changing the API of some +functions to be more idiomatic C++. */ +class process { + +public: + REPROCXX_EXPORT process(); + REPROCXX_EXPORT ~process() noexcept; + + // Enforce unique ownership of child processes. + REPROCXX_EXPORT process(process &&other) noexcept; + REPROCXX_EXPORT process &operator=(process &&other) noexcept; + + /*! `reproc_start` but implicitly converts from STL containers to the + arguments format expected by `reproc_start`. */ + REPROCXX_EXPORT std::error_code start(const arguments &arguments, + const options &options = {}) noexcept; + + REPROCXX_EXPORT std::pair pid() noexcept; + + /*! Sets the `fork` option in `reproc_options` and calls `start`. Returns + `true` in the child process and `false` in the parent process. */ + REPROCXX_EXPORT std::pair + fork(const options &options = {}) noexcept; + + /*! Shorthand for `reproc::poll` that only polls this process. Returns a pair + of (events, error). */ + REPROCXX_EXPORT std::pair + poll(int interests, milliseconds timeout = infinite); + + /*! `reproc_read` but returns a pair of (bytes read, error). */ + REPROCXX_EXPORT std::pair + read(stream stream, uint8_t *buffer, size_t size) noexcept; + + /*! reproc_write` but returns a pair of (bytes_written, error). */ + REPROCXX_EXPORT std::pair + write(const uint8_t *buffer, size_t size) noexcept; + + REPROCXX_EXPORT std::error_code close(stream stream) noexcept; + + /*! `reproc_wait` but returns a pair of (status, error). */ + REPROCXX_EXPORT std::pair + wait(milliseconds timeout) noexcept; + + REPROCXX_EXPORT std::error_code terminate() noexcept; + + REPROCXX_EXPORT std::error_code kill() noexcept; + + /*! `reproc_stop` but returns a pair of (status, error). */ + REPROCXX_EXPORT std::pair + stop(stop_actions stop) noexcept; + +private: + REPROCXX_EXPORT friend std::error_code + poll(event::source *sources, size_t num_sources, milliseconds timeout); + + std::unique_ptr impl_; +}; + +} diff --git a/data/miniconda3/include/reproc++/run.hpp b/data/miniconda3/include/reproc++/run.hpp new file mode 100644 index 0000000000000000000000000000000000000000..196121f725526bd59f8232db5185b193b99754bb --- /dev/null +++ b/data/miniconda3/include/reproc++/run.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include +#include + +namespace reproc { + +template +std::pair +run(const arguments &arguments, const options &options, Out &&out, Err &&err) +{ + process process; + std::error_code ec; + + ec = process.start(arguments, options); + if (ec) { + return { -1, ec }; + } + + ec = drain(process, std::forward(out), std::forward(err)); + if (ec) { + return { -1, ec }; + } + + return process.stop(options.stop); +} + +inline std::pair run(const arguments &arguments, + const options &options = {}) +{ + struct options modified = options::clone(options); + + if (!options.redirect.discard && options.redirect.file == nullptr && + options.redirect.path == nullptr) { + modified.redirect.parent = true; + } + + return run(arguments, modified, sink::null, sink::null); +} + +} diff --git a/data/miniconda3/include/reproc/drain.h b/data/miniconda3/include/reproc/drain.h new file mode 100644 index 0000000000000000000000000000000000000000..355208e68e4827e417454e4991877dc3784fbbdb --- /dev/null +++ b/data/miniconda3/include/reproc/drain.h @@ -0,0 +1,79 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! Used by `reproc_drain` to provide data to the caller. Each time data is +read, `function` is called with `context`. If a sink returns a non-zero value, +`reproc_drain` will return immediately with the same value. */ +typedef struct reproc_sink { + int (*function)(REPROC_STREAM stream, + const uint8_t *buffer, + size_t size, + void *context); + void *context; +} reproc_sink; + +/*! Pass `REPROC_SINK_NULL` as the sink for output streams that have not been +redirected to a pipe. */ +REPROC_EXPORT extern const reproc_sink REPROC_SINK_NULL; + +/*! +Reads from the child process stdout and stderr until an error occurs or both +streams are closed. The `out` and `err` sinks receive the output from stdout and +stderr respectively. The same sink may be passed to both `out` and `err`. + +`reproc_drain` always starts by calling both sinks once with an empty buffer and +`stream` set to `REPROC_STREAM_IN` to give each sink the chance to process all +output from the previous call to `reproc_drain` one by one. + +When a stream is closed, its corresponding `sink` is called once with `size` set +to zero. + +Note that his function returns 0 instead of `REPROC_EPIPE` when both output +streams of the child process are closed. + +Actionable errors: +- `REPROC_ETIMEDOUT` +*/ +REPROC_EXPORT int +reproc_drain(reproc_t *process, reproc_sink out, reproc_sink err); + +/*! +Appends the output of a process (stdout and stderr) to the value of `output`. +`output` must point to either `NULL` or a NUL-terminated string. + +Calls `realloc` as necessary to make space in `output` to store the output of +the child process. Make sure to always call `reproc_free` on the value of +`output` after calling `reproc_drain` (even if it fails). + +Because the resulting sink does not store the output size, `strlen` is called +each time data is read to calculate the current size of the output. This might +cause performance problems when draining processes that produce a lot of output. + +Similarly, this sink will not work on processes that have NUL terminators in +their output because `strlen` is used to calculate the current output size. + +Returns `REPROC_ENOMEM` if a call to `realloc` fails. `output` will contain any +output read from the child process, preceeded by whatever was stored in it at +the moment its corresponding sink was passed to `reproc_drain`. + +The `drain` example shows how to use `reproc_sink_string`. +``` +*/ +REPROC_EXPORT reproc_sink reproc_sink_string(char **output); + +/*! Discards the output of a process. */ +REPROC_EXPORT reproc_sink reproc_sink_discard(void); + +/*! Calls `free` on `ptr` and returns `NULL`. Use this function to free memory +allocated by `reproc_sink_string`. This avoids issues with allocating across +module (DLL) boundaries on Windows. */ +REPROC_EXPORT void *reproc_free(void *ptr); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/reproc/export.h b/data/miniconda3/include/reproc/export.h new file mode 100644 index 0000000000000000000000000000000000000000..8f558c25f6000955295adaf3c6429b2f373a6af3 --- /dev/null +++ b/data/miniconda3/include/reproc/export.h @@ -0,0 +1,21 @@ +#pragma once + +#ifndef REPROC_EXPORT + #ifdef _WIN32 + #ifdef REPROC_SHARED + #ifdef REPROC_BUILDING + #define REPROC_EXPORT __declspec(dllexport) + #else + #define REPROC_EXPORT __declspec(dllimport) + #endif + #else + #define REPROC_EXPORT + #endif + #else + #ifdef REPROC_BUILDING + #define REPROC_EXPORT __attribute__((visibility("default"))) + #else + #define REPROC_EXPORT + #endif + #endif +#endif diff --git a/data/miniconda3/include/reproc/reproc.h b/data/miniconda3/include/reproc/reproc.h new file mode 100644 index 0000000000000000000000000000000000000000..9c45c0923b35a8e4db80177329774b61663cc9fa --- /dev/null +++ b/data/miniconda3/include/reproc/reproc.h @@ -0,0 +1,530 @@ +#pragma once + +#include +#include +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! Used to store information about a child process. `reproc_t` is an opaque +type and can be allocated and released via `reproc_new` and `reproc_destroy` +respectively. */ +typedef struct reproc_t reproc_t; + +/*! reproc error naming follows POSIX errno naming prefixed with `REPROC`. */ + +/*! An invalid argument was passed to an API function */ +REPROC_EXPORT extern const int REPROC_EINVAL; +/*! A timeout value passed to an API function expired. */ +REPROC_EXPORT extern const int REPROC_ETIMEDOUT; +/*! The child process closed one of its streams (and in the case of +stdout/stderr all of the data remaining in that stream has been read). */ +REPROC_EXPORT extern const int REPROC_EPIPE; +/*! A memory allocation failed. */ +REPROC_EXPORT extern const int REPROC_ENOMEM; +/*! A call to `reproc_read` or `reproc_write` would have blocked. */ +REPROC_EXPORT extern const int REPROC_EWOULDBLOCK; + +/*! Signal exit status constants. */ + +REPROC_EXPORT extern const int REPROC_SIGKILL; +REPROC_EXPORT extern const int REPROC_SIGTERM; + +/*! Tells a function that takes a timeout value to wait indefinitely. */ +REPROC_EXPORT extern const int REPROC_INFINITE; +/*! Tells `reproc_wait` to wait until the deadline passed to `reproc_start` +expires. */ +REPROC_EXPORT extern const int REPROC_DEADLINE; + +/*! Stream identifiers used to indicate which stream to act on. */ +typedef enum { + /*! stdin */ + REPROC_STREAM_IN, + /*! stdout */ + REPROC_STREAM_OUT, + /*! stderr */ + REPROC_STREAM_ERR, +} REPROC_STREAM; + +/*! Used to tell reproc where to redirect the streams of the child process. */ +typedef enum { + /*! Use the default redirect behavior, see the documentation for `redirect` in + `reproc_options`. */ + REPROC_REDIRECT_DEFAULT, + /*! Redirect to a pipe. */ + REPROC_REDIRECT_PIPE, + /*! Redirect to the corresponding stream from the parent process. */ + REPROC_REDIRECT_PARENT, + /*! Redirect to /dev/null (or NUL on Windows). */ + REPROC_REDIRECT_DISCARD, + /*! Redirect to child process stdout. Only valid for stderr. */ + REPROC_REDIRECT_STDOUT, + /*! Redirect to a handle (fd on Linux, HANDLE/SOCKET on Windows). */ + REPROC_REDIRECT_HANDLE, + /*! Redirect to a `FILE *`. */ + REPROC_REDIRECT_FILE, + /*! Redirect to a specific path. */ + REPROC_REDIRECT_PATH, +} REPROC_REDIRECT; + +/*! Used to tell `reproc_stop` how to stop a child process. */ +typedef enum { + /*! noop (no operation) */ + REPROC_STOP_NOOP, + /*! `reproc_wait` */ + REPROC_STOP_WAIT, + /*! `reproc_terminate` */ + REPROC_STOP_TERMINATE, + /*! `reproc_kill` */ + REPROC_STOP_KILL, +} REPROC_STOP; + +typedef struct reproc_stop_action { + REPROC_STOP action; + int timeout; +} reproc_stop_action; + +typedef struct reproc_stop_actions { + reproc_stop_action first; + reproc_stop_action second; + reproc_stop_action third; +} reproc_stop_actions; + +// clang-format off + +#define REPROC_STOP_ACTIONS_NULL (reproc_stop_actions) { \ + { REPROC_STOP_NOOP, 0 }, \ + { REPROC_STOP_NOOP, 0 }, \ + { REPROC_STOP_NOOP, 0 }, \ +} + +// clang-format on + +#if defined(_WIN32) +typedef void *reproc_handle; // `HANDLE` +#else +typedef int reproc_handle; // fd +#endif + +typedef struct reproc_redirect { + /*! Type of redirection. */ + REPROC_REDIRECT type; + /*! + Redirect a stream to an operating system handle. The given handle must be in + blocking mode ( `O_NONBLOCK` and `OVERLAPPED` handles are not supported). + + Note that reproc does not take ownership of the handle. The user is + responsible for closing the handle after passing it to `reproc_start`. Since + the operating system will copy the handle to the child process, the handle + can be closed immediately after calling `reproc_start` if the handle is not + needed in the parent process anymore. + + If `handle` is set, `type` must be unset or set to `REPROC_REDIRECT_HANDLE` + and `file`, `path` must be unset. + */ + reproc_handle handle; + /*! + Redirect a stream to a file stream. + + Note that reproc does not take ownership of the file. The user is + responsible for closing the file after passing it to `reproc_start`. Just + like with `handles`, the operating system will copy the file handle to the + child process so the file can be closed immediately after calling + `reproc_start` if it isn't needed anymore by the parent process. + + Any file passed to `file.in` must have been opened in read mode. Likewise, + any files passed to `file.out` or `file.err` must have been opened in write + mode. + + If `file` is set, `type` must be unset or set to `REPROC_REDIRECT_FILE` and + `handle`, `path` must be unset. + */ + FILE *file; + /*! + Redirect a stream to a given path. + + reproc will create or open the file at the given path. Depending on the + stream, the file is opened in read or write mode. + + If `path` is set, `type` must be unset or set to `REPROC_REDIRECT_PATH` and + `handle`, `file` must be unset. + */ + const char *path; +} reproc_redirect; + +typedef enum { + REPROC_ENV_EXTEND, + REPROC_ENV_EMPTY, +} REPROC_ENV; + +typedef struct reproc_options { + /*! + `working_directory` specifies the working directory for the child process. If + `working_directory` is `NULL`, the child process runs in the working directory + of the parent process. + */ + const char *working_directory; + + struct { + /*! + `behavior` specifies whether the child process should start with a copy of + the parent process environment variables or an empty environment. By + default, the child process starts with a copy of the parent's environment + variables (`REPROC_ENV_EXTEND`). If `behavior` is set to `REPROC_ENV_EMPTY`, + the child process starts with an empty environment. + */ + REPROC_ENV behavior; + /*! + `extra` is an array of UTF-8 encoded, NUL-terminated strings that specifies + extra environment variables for the child process. It has the following + layout: + + - All elements except the final element must be of the format `NAME=VALUE`. + - The final element must be `NULL`. + + Example: ["IP=127.0.0.1", "PORT=8080", `NULL`] + + If `env` is `NULL`, no extra environment variables are added to the + environment of the child process. + */ + const char *const *extra; + } env; + /*! + `redirect` specifies where to redirect the streams from the child process. + + By default each stream is redirected to a pipe which can be written to (stdin) + or read from (stdout/stderr) using `reproc_write` and `reproc_read` + respectively. + */ + struct { + /*! + `in`, `out` and `err` specify where to redirect the standard I/O streams of + the child process. When not set, `in` and `out` default to + `REPROC_REDIRECT_PIPE` while `err` defaults to `REPROC_REDIRECT_PARENT`. + */ + reproc_redirect in; + reproc_redirect out; + reproc_redirect err; + /*! + Use `REPROC_REDIRECT_PARENT` instead of `REPROC_REDIRECT_PIPE` when `type` + is unset. + + When this option is set, `discard`, `file` and `path` must be unset. + */ + bool parent; + /*! + Use `REPROC_REDIRECT_DISCARD` instead of `REPROC_REDIRECT_PIPE` when `type` + is unset. + + When this option is set, `parent`, `file` and `path` must be unset. + */ + bool discard; + /*! + Shorthand for redirecting stdout and stderr to the same file. + + If this option is set, `out`, `err`, `parent`, `discard` and `path` must be + unset. + */ + FILE *file; + /*! + Shorthand for redirecting stdout and stderr to the same path. + + If this option is set, `out`, `err`, `parent`, `discard` and `file` must be + unset. + */ + const char *path; + } redirect; + /*! + Stop actions that are passed to `reproc_stop` in `reproc_destroy` to stop the + child process. See `reproc_stop` for more information on how `stop` is + interpreted. + */ + reproc_stop_actions stop; + /*! + Maximum allowed duration in milliseconds the process is allowed to run in + milliseconds. If the deadline is exceeded, Any ongoing and future calls to + `reproc_poll` return `REPROC_ETIMEDOUT`. + + Note that only `reproc_poll` takes the deadline into account. More + specifically, if the `nonblocking` option is not enabled, `reproc_read` and + `reproc_write` can deadlock waiting on the child process to perform I/O. If + this is a problem, enable the `nonblocking` option and use `reproc_poll` + together with a deadline/timeout to avoid any deadlocks. + + If `REPROC_DEADLINE` is passed as the timeout to `reproc_wait`, it waits until + the deadline expires. + + When `deadline` is zero, no deadline is set for the process. + */ + int deadline; + /*! + `input` is written to the stdin pipe before the child process is started. + + Because `input` is written to the stdin pipe before the process starts, + `input.size` must be smaller than the system's default pipe size (64KB). + + If `input` is set, the stdin pipe is closed after `input` is written to it. + + If `redirect.in` is set, this option may not be set. + */ + struct { + const uint8_t *data; + size_t size; + } input; + /*! + This option can only be used on POSIX systems. If enabled on Windows, an error + will be returned. + + If `fork` is enabled, `reproc_start` forks a child process and returns 0 in + the child process and > 0 in the parent process. In the child process, only + `reproc_destroy` may be called on the `reproc_t` instance to free its + associated memory. + + When `fork` is enabled. `argv` must be `NULL` when calling `reproc_start`. + */ + bool fork; + /*! + Put pipes created by reproc in nonblocking mode. This makes `reproc_read` and + `reproc_write` nonblocking operations. If needed, use `reproc_poll` to wait + until streams becomes readable/writable. + */ + bool nonblocking; +} reproc_options; + +enum { + /*! Data can be written to stdin. */ + REPROC_EVENT_IN = 1 << 0, + /*! Data can be read from stdout. */ + REPROC_EVENT_OUT = 1 << 1, + /*! Data can be read from stderr. */ + REPROC_EVENT_ERR = 1 << 2, + /*! The process finished running. */ + REPROC_EVENT_EXIT = 1 << 3, + /*! The deadline of the process expired. This event is added by default to the + list of interested events. */ + REPROC_EVENT_DEADLINE = 1 << 4, +}; + +typedef struct reproc_event_source { + /*! Process to poll for events. */ + reproc_t *process; + /*! Events of the process that we're interested in. Takes a combo of + `REPROC_EVENT` flags. */ + int interests; + /*! Combo of `REPROC_EVENT` flags that indicate the events that occurred. This + field is filled in by `reproc_poll`. */ + int events; +} reproc_event_source; + +/*! Allocate a new `reproc_t` instance on the heap. */ +REPROC_EXPORT reproc_t *reproc_new(void); + +/*! +Starts the process specified by `argv` in the given working directory and +redirects its input, output and error streams. + +If this function does not return an error the child process will have started +running and can be inspected using the operating system's tools for process +inspection (e.g. ps on Linux). + +Every successful call to this function should be followed by a successful call +to `reproc_wait` or `reproc_stop` and a call to `reproc_destroy`. If an error +occurs during `reproc_start` all allocated resources are cleaned up before +`reproc_start` returns and no further action is required. + +`argv` is an array of UTF-8 encoded, NUL-terminated strings that specifies the +program to execute along with its arguments. It has the following layout: + +- The first element indicates the executable to run as a child process. This can +be an absolute path, a path relative to the working directory of the parent +process or the name of an executable located in the PATH. It cannot be `NULL`. +- The following elements indicate the whitespace delimited arguments passed to +the executable. None of these elements can be `NULL`. +- The final element must be `NULL`. + +Example: ["cmake", "-G", "Ninja", "-DCMAKE_BUILD_TYPE=Release", `NULL`] +*/ +REPROC_EXPORT int reproc_start(reproc_t *process, + const char *const *argv, + reproc_options options); + +/*! +Returns the process ID of the child or `REPROC_EINVAL` on error. + +Note that if `reproc_wait` has been called successfully on this process already, +the returned pid will be that of the just ended child process. The operating +system will have cleaned up the resources allocated to the process +and the operating system is free to reuse the same pid for another process. + +Generally, only pass the result of this function to system calls that need a +valid pid if `reproc_wait` hasn't been called successfully on the process yet. +*/ +REPROC_EXPORT int reproc_pid(reproc_t *process); + +/*! +Polls each process in `sources` for its corresponding events in `interests` and +stores events that occurred for each process in `events`. If an event source +process member is `NULL`, the event source is ignored. + +Pass `REPROC_INFINITE` to `timeout` to have `reproc_poll` wait forever for an +event to occur. + +If one or more events occur, returns the number of processes with events. If the +timeout expires, returns zero. Returns `REPROC_EPIPE` if none of the sources +have valid pipes remaining that can be polled. + +Actionable errors: +- `REPROC_EPIPE` +*/ +REPROC_EXPORT int +reproc_poll(reproc_event_source *sources, size_t num_sources, int timeout); + +/*! +Reads up to `size` bytes into `buffer` from the child process output stream +indicated by `stream`. + +Actionable errors: +- `REPROC_EPIPE` +- `REPROC_EWOULDBLOCK` +*/ +REPROC_EXPORT int reproc_read(reproc_t *process, + REPROC_STREAM stream, + uint8_t *buffer, + size_t size); + +/*! +Writes up to `size` bytes from `buffer` to the standard input (stdin) of the +child process. + +(POSIX) By default, writing to a closed stdin pipe terminates the parent process +with the `SIGPIPE` signal. `reproc_write` will only return `REPROC_EPIPE` if +this signal is ignored by the parent process. + +Returns the amount of bytes written. If `buffer` is `NULL` and `size` is zero, +this function returns 0. + +If the standard input of the child process wasn't opened with +`REPROC_REDIRECT_PIPE`, this function returns `REPROC_EPIPE` unless `buffer` is +`NULL` and `size` is zero. + +Actionable errors: +- `REPROC_EPIPE` +- `REPROC_EWOULDBLOCK` +*/ +REPROC_EXPORT int +reproc_write(reproc_t *process, const uint8_t *buffer, size_t size); + +/*! +Closes the child process standard stream indicated by `stream`. + +This function is necessary when a child process reads from stdin until it is +closed. After writing all the input to the child process using `reproc_write`, +the standard input stream can be closed using this function. +*/ +REPROC_EXPORT int reproc_close(reproc_t *process, REPROC_STREAM stream); + +/*! +Waits `timeout` milliseconds for the child process to exit. If the child process +has already exited or exits within the given timeout, its exit status is +returned. + +If `timeout` is 0, the function will only check if the child process is still +running without waiting. If `timeout` is `REPROC_INFINITE`, this function will +wait indefinitely for the child process to exit. If `timeout` is +`REPROC_DEADLINE`, this function waits until the deadline passed to +`reproc_start` expires. + +Actionable errors: +- `REPROC_ETIMEDOUT` +*/ +REPROC_EXPORT int reproc_wait(reproc_t *process, int timeout); + +/*! +Sends the `SIGTERM` signal (POSIX) or the `CTRL-BREAK` signal (Windows) to the +child process. Remember that successful calls to `reproc_wait` and +`reproc_destroy` are required to make sure the child process is completely +cleaned up. +*/ +REPROC_EXPORT int reproc_terminate(reproc_t *process); + +/*! +Sends the `SIGKILL` signal to the child process (POSIX) or calls +`TerminateProcess` (Windows) on the child process. Remember that successful +calls to `reproc_wait` and `reproc_destroy` are required to make sure the child +process is completely cleaned up. +*/ +REPROC_EXPORT int reproc_kill(reproc_t *process); + +/*! +Simplifies calling combinations of `reproc_wait`, `reproc_terminate` and +`reproc_kill`. The function executes each specified step and waits (using +`reproc_wait`) until the corresponding timeout expires before continuing with +the next step. + +Example: + +Wait 10 seconds for the child process to exit on its own before sending +`SIGTERM` (POSIX) or `CTRL-BREAK` (Windows) and waiting five more seconds for +the child process to exit. + +```c +REPROC_ERROR error = reproc_stop(process, + REPROC_STOP_WAIT, 10000, + REPROC_STOP_TERMINATE, 5000, + REPROC_STOP_NOOP, 0); +``` + +Call `reproc_wait`, `reproc_terminate` and `reproc_kill` directly if you need +extra logic such as logging between calls. + +`stop` can contain up to three stop actions that instruct this function how the +child process should be stopped. The first element of each stop action specifies +which action should be called on the child process. The second element of each +stop actions specifies how long to wait after executing the operation indicated +by the first element. + +When `stop` is 3x `REPROC_STOP_NOOP`, `reproc_destroy` will wait until the +deadline expires (or forever if there is no deadline). If the process is still +running after the deadline expires, `reproc_stop` then calls `reproc_terminate` +and waits forever for the process to exit. + +Note that when a stop action specifies `REPROC_STOP_WAIT`, the function will +just wait for the specified timeout instead of performing an action to stop the +child process. + +If the child process has already exited or exits during the execution of this +function, its exit status is returned. + +Actionable errors: +- `REPROC_ETIMEDOUT` +*/ +REPROC_EXPORT int reproc_stop(reproc_t *process, reproc_stop_actions stop); + +/*! +Release all resources associated with `process` including the memory allocated +by `reproc_new`. Calling this function before a succesfull call to `reproc_wait` +can result in resource leaks. + +Does nothing if `process` is an invalid `reproc_t` instance and always returns +an invalid `reproc_t` instance (`NULL`). By assigning the result of +`reproc_destroy` to the instance being destroyed, it can be safely called +multiple times on the same instance. + +Example: `process = reproc_destroy(process)`. +*/ +REPROC_EXPORT reproc_t *reproc_destroy(reproc_t *process); + +/*! +Returns a string describing `error`. This string must not be modified by the +caller. +*/ +REPROC_EXPORT const char *reproc_strerror(int error); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/reproc/run.h b/data/miniconda3/include/reproc/run.h new file mode 100644 index 0000000000000000000000000000000000000000..5d8deffb5d2ede5e89ca8438428f68d0fb8723ab --- /dev/null +++ b/data/miniconda3/include/reproc/run.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/*! Sets `options.redirect.parent = true` unless `discard` is set and calls +`reproc_run_ex` with `REPROC_SINK_NULL` for the `out` and `err` sinks. */ +REPROC_EXPORT int reproc_run(const char *const *argv, reproc_options options); + +/*! +Wrapper function that starts a process with the given arguments, drain its +output and waits until it exits. Have a look at its (trivial) implementation and +the documentation of the functions it calls to see exactly what it does: +https://github.com/DaanDeMeyer/reproc/blob/master/reproc/src/run.c +*/ +REPROC_EXPORT int reproc_run_ex(const char *const *argv, + reproc_options options, + reproc_sink out, + reproc_sink err); + +#ifdef __cplusplus +} +#endif diff --git a/data/miniconda3/include/solv/bitmap.h b/data/miniconda3/include/solv/bitmap.h new file mode 100644 index 0000000000000000000000000000000000000000..6609678f7a3d6575c0364c2b9af70f9283de1b4d --- /dev/null +++ b/data/miniconda3/include/solv/bitmap.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2007-2011, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * bitmap.h + * + */ + +#ifndef LIBSOLV_BITMAP_H +#define LIBSOLV_BITMAP_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct s_Map { + unsigned char *map; + int size; +} Map; + +#define MAPZERO(m) (memset((m)->map, 0, (m)->size)) +/* set all bits */ +#define MAPSETALL(m) (memset((m)->map, 0xff, (m)->size)) +/* set bit */ +#define MAPSET(m, n) ((m)->map[(n) >> 3] |= 1 << ((n) & 7)) +/* clear bit */ +#define MAPCLR(m, n) ((m)->map[(n) >> 3] &= ~(1 << ((n) & 7))) +/* test bit */ +#define MAPTST(m, n) ((m)->map[(n) >> 3] & (1 << ((n) & 7))) +/* clear some bits at a position */ +#define MAPCLR_AT(m, n) ((m)->map[(n) >> 3] = 0) + +extern void map_init(Map *m, int n); +extern void map_init_clone(Map *target, const Map *source); +extern void map_grow(Map *m, int n); +extern void map_free(Map *m); +extern void map_and(Map *t, const Map *s); +extern void map_or(Map *t, const Map *s); +extern void map_subtract(Map *t, const Map *s); +extern void map_invertall(Map *m); + +static inline void map_empty(Map *m) +{ + MAPZERO(m); +} +static inline void map_set(Map *m, int n) +{ + MAPSET(m, n); +} +static inline void map_setall(Map *m) +{ + MAPSETALL(m); +} +static inline void map_clr(Map *m, int n) +{ + MAPCLR(m, n); +} +static inline int map_tst(Map *m, int n) +{ + return MAPTST(m, n); +} +static inline void map_clr_at(Map *m, int n) +{ + MAPCLR_AT(m, n); +} + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_BITMAP_H */ diff --git a/data/miniconda3/include/solv/dataiterator.h b/data/miniconda3/include/solv/dataiterator.h new file mode 100644 index 0000000000000000000000000000000000000000..357ae5989f68e636d1c32f20282a286d6a749313 --- /dev/null +++ b/data/miniconda3/include/solv/dataiterator.h @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2007-2012, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * dataiterator.h + * + */ + +#ifndef LIBSOLV_DATAITERATOR_H +#define LIBSOLV_DATAITERATOR_H + +#include "pooltypes.h" +#include "pool.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct s_KeyValue { + Id id; + const char *str; + unsigned int num; + unsigned int num2; + + int entry; /* array entry, starts with 0 */ + int eof; /* last entry reached */ + + struct s_KeyValue *parent; +} KeyValue; + +#define SOLV_KV_NUM64(kv) (((unsigned long long)((kv)->num2)) << 32 | (kv)->num) + +/* search matcher flags */ +#define SEARCH_STRINGMASK 15 +#define SEARCH_STRING 1 +#define SEARCH_STRINGSTART 2 +#define SEARCH_STRINGEND 3 +#define SEARCH_SUBSTRING 4 +#define SEARCH_GLOB 5 +#define SEARCH_REGEX 6 +#define SEARCH_ERROR 15 +#define SEARCH_NOCASE (1<<7) + +/* iterator control */ +#define SEARCH_NO_STORAGE_SOLVABLE (1<<8) +#define SEARCH_SUB (1<<9) +#define SEARCH_ARRAYSENTINEL (1<<10) +#define SEARCH_DISABLED_REPOS (1<<11) +#define SEARCH_KEEP_TYPE_DELETED (1<<12) /* only has effect if no keyname is given */ + +/* stringification flags */ +#define SEARCH_SKIP_KIND (1<<16) +/* By default we stringify just to the basename of a file because + the construction of the full filename is costly. Specify this + flag if you want to match full filenames */ +#define SEARCH_FILES (1<<17) +#define SEARCH_CHECKSUMS (1<<18) + +/* internal */ +#define SEARCH_SUBSCHEMA (1<<30) +#define SEARCH_THISSOLVID (1<<31) + +/* obsolete */ +#define SEARCH_COMPLETE_FILELIST 0 /* ignored, this is the default */ + +/* + * Datamatcher: match a string against a query + */ +typedef struct s_Datamatcher { + int flags; /* see matcher flags above */ + const char *match; /* the query string */ + void *matchdata; /* e.g. compiled regexp */ + int error; +} Datamatcher; + +int datamatcher_init(Datamatcher *ma, const char *match, int flags); +void datamatcher_free(Datamatcher *ma); +int datamatcher_match(Datamatcher *ma, const char *str); +int datamatcher_checkbasename(Datamatcher *ma, const char *str); + + +/* + * Dataiterator + * + * Iterator like interface to 'search' functionality + * + * Dataiterator is per-pool, additional filters can be applied + * to limit the search domain. See dataiterator_init below. + * + * Use these like: + * Dataiterator di; + * dataiterator_init(&di, repo->pool, repo, 0, 0, "bla", SEARCH_SUBSTRING); + * while (dataiterator_step(&di)) + * dosomething(di.solvid, di.key, di.kv); + * dataiterator_free(&di); + */ +typedef struct s_Dataiterator +{ + int state; + int flags; + + Pool *pool; + Repo *repo; + Repodata *data; + + /* data pointers */ + unsigned char *dp; + unsigned char *ddp; + Id *idp; + Id *keyp; + + /* the result */ + struct s_Repokey *key; + KeyValue kv; + + /* our matcher */ + Datamatcher matcher; + + /* iterators/filters */ + Id keyname; + Id repodataid; + Id solvid; + Id repoid; + + Id keynames[3 + 1]; + int nkeynames; + int rootlevel; + + /* recursion data */ + struct di_parent { + KeyValue kv; + unsigned char *dp; + Id *keyp; + } parents[3]; + int nparents; + + /* vertical data */ + unsigned char *vert_ddp; + Id vert_off; + Id vert_len; + Id vert_storestate; + + /* strdup data */ + char *dupstr; + int dupstrn; + + Id *keyskip; + Id *oldkeyskip; +} Dataiterator; + + +/* + * Initialize dataiterator + * + * di: Pointer to Dataiterator to be initialized + * pool: Search domain for the iterator + * repo: if non-null, limit search to this repo + * solvid: if non-null, limit search to this solvable + * keyname: if non-null, limit search to this keyname + * match: if non-null, limit search to this match + */ +int dataiterator_init(Dataiterator *di, Pool *pool, Repo *repo, Id p, Id keyname, const char *match, int flags); +void dataiterator_init_clone(Dataiterator *di, Dataiterator *from); +void dataiterator_set_search(Dataiterator *di, Repo *repo, Id p); +void dataiterator_set_keyname(Dataiterator *di, Id keyname); +int dataiterator_set_match(Dataiterator *di, const char *match, int flags); + +void dataiterator_prepend_keyname(Dataiterator *di, Id keyname); +void dataiterator_free(Dataiterator *di); +int dataiterator_step(Dataiterator *di); +void dataiterator_setpos(Dataiterator *di); +void dataiterator_setpos_parent(Dataiterator *di); +int dataiterator_match(Dataiterator *di, Datamatcher *ma); +void dataiterator_skip_attribute(Dataiterator *di); +void dataiterator_skip_solvable(Dataiterator *di); +void dataiterator_skip_repo(Dataiterator *di); +void dataiterator_jump_to_solvid(Dataiterator *di, Id solvid); +void dataiterator_jump_to_repo(Dataiterator *di, Repo *repo); +void dataiterator_entersub(Dataiterator *di); +void dataiterator_clonepos(Dataiterator *di, Dataiterator *from); +void dataiterator_seek(Dataiterator *di, int whence); +void dataiterator_strdup(Dataiterator *di); + +#define DI_SEEK_STAY (1 << 16) +#define DI_SEEK_CHILD 1 +#define DI_SEEK_PARENT 2 +#define DI_SEEK_REWIND 3 + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_DATAITERATOR_H */ diff --git a/data/miniconda3/include/solv/dirpool.h b/data/miniconda3/include/solv/dirpool.h new file mode 100644 index 0000000000000000000000000000000000000000..ca929548829cfe0b4caecee3be82636b139004a6 --- /dev/null +++ b/data/miniconda3/include/solv/dirpool.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ +#ifndef LIBSOLV_DIRPOOL_H +#define LIBSOLV_DIRPOOL_H + + +#include "pooltypes.h" +#include "util.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct s_Dirpool { + Id *dirs; + int ndirs; + Id *dirtraverse; +} Dirpool; + +void dirpool_init(Dirpool *dp); +void dirpool_free(Dirpool *dp); + +void dirpool_make_dirtraverse(Dirpool *dp); +Id dirpool_add_dir(Dirpool *dp, Id parent, Id comp, int create); + +/* return the parent directory of child did */ +static inline Id dirpool_parent(Dirpool *dp, Id did) +{ + if (!did) + return 0; + while (dp->dirs[--did] > 0) + ; + return -dp->dirs[did]; +} + +/* return the next child entry of child did */ +static inline Id +dirpool_sibling(Dirpool *dp, Id did) +{ + /* if this block contains another entry, simply return it */ + if (did + 1 < dp->ndirs && dp->dirs[did + 1] > 0) + return did + 1; + /* end of block reached, rewind to get to the block's + * dirtraverse entry */ + while (dp->dirs[--did] > 0) + ; + /* need to special case did == 0 to prevent looping */ + if (!did) + return 0; + if (!dp->dirtraverse) + dirpool_make_dirtraverse(dp); + return dp->dirtraverse[did]; +} + +/* return the first child entry of directory did */ +static inline Id +dirpool_child(Dirpool *dp, Id did) +{ + if (!dp->dirtraverse) + dirpool_make_dirtraverse(dp); + return dp->dirtraverse[did]; +} + +static inline void +dirpool_free_dirtraverse(Dirpool *dp) +{ + solv_free(dp->dirtraverse); + dp->dirtraverse = 0; +} + +static inline Id +dirpool_compid(Dirpool *dp, Id did) +{ + return dp->dirs[did]; +} + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_DIRPOOL_H */ diff --git a/data/miniconda3/include/solv/evr.h b/data/miniconda3/include/solv/evr.h new file mode 100644 index 0000000000000000000000000000000000000000..d18cc52a68a30f749ba1ac9acc4b8d5396eae3a8 --- /dev/null +++ b/data/miniconda3/include/solv/evr.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * evr.h + * + */ + +#ifndef LIBSOLV_EVR_H +#define LIBSOLV_EVR_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "pooltypes.h" + +#define EVRCMP_COMPARE 0 +#define EVRCMP_MATCH_RELEASE 1 +#define EVRCMP_MATCH 2 +#define EVRCMP_COMPARE_EVONLY 3 + +extern int solv_vercmp(const char *s1, const char *q1, const char *s2, const char *q2); + +extern int pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode); +extern int pool_evrcmp(const Pool *pool, Id evr1id, Id evr2id, int mode); +extern int pool_evrmatch(const Pool *pool, Id evrid, const char *epoch, const char *version, const char *release); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_EVR_H */ diff --git a/data/miniconda3/include/solv/hash.h b/data/miniconda3/include/solv/hash.h new file mode 100644 index 0000000000000000000000000000000000000000..4f595bbb17e9417142c4e2e97be271e7767d16f3 --- /dev/null +++ b/data/miniconda3/include/solv/hash.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * hash.h + * generic hash functions + */ + +#ifndef LIBSOLV_HASH_H +#define LIBSOLV_HASH_H + +#include "pooltypes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* value of a hash */ +typedef unsigned int Hashval; + +/* inside the hash table, Ids are stored. Hash maps: string -> hash -> Id */ +typedef Id *Hashtable; + +/* hash chain */ +#define HASHCHAIN_START 7 +#define HASHCHAIN_NEXT(h, hh, mask) (((h) + (hh)++) & (mask)) + +/* very simple hash function + * string -> hash + */ +static inline Hashval +strhash(const char *str) +{ + Hashval r = 0; + unsigned int c; + while ((c = *(const unsigned char *)str++) != 0) + r += (r << 3) + c; + return r; +} + +static inline Hashval +strnhash(const char *str, unsigned len) +{ + Hashval r = 0; + unsigned int c; + while (len-- && (c = *(const unsigned char *)str++) != 0) + r += (r << 3) + c; + return r; +} + +static inline Hashval +strhash_cont(const char *str, Hashval r) +{ + unsigned int c; + while ((c = *(const unsigned char *)str++) != 0) + r += (r << 3) + c; + return r; +} + + +/* hash for rel + * rel -> hash + */ +static inline Hashval +relhash(Id name, Id evr, int flags) +{ + return name + 7 * evr + 13 * flags; +} + + +/* compute bitmask for value + * returns smallest (2^n-1) > 2 * num + 3 + * + * used for Hashtable 'modulo' operation + */ +static inline Hashval +mkmask(unsigned int num) +{ + num = num * 2 + 3; + while (num & (num - 1)) + num &= num - 1; + return num * 2 - 1; +} + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_HASH_H */ diff --git a/data/miniconda3/include/solv/knownid.h b/data/miniconda3/include/solv/knownid.h new file mode 100644 index 0000000000000000000000000000000000000000..19f67aef273b714318330599612d1ad1919564a5 --- /dev/null +++ b/data/miniconda3/include/solv/knownid.h @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2007-2014, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * knownid.h + * + */ + +/* + * Warning: you're free to append new entries, but insert/delete breaks + * the ABI! + */ + +#ifndef LIBSOLV_KNOWNID_H +#define LIBSOLV_KNOWNID_H + +#undef KNOWNID +#ifdef KNOWNID_INITIALIZE +# define KNOWNID(a, b) b +static const char *initpool_data[] = { +#else +# define KNOWNID(a, b) a +enum solv_knownid { +#endif + +KNOWNID(ID_NULL, ""), +KNOWNID(ID_EMPTY, ""), + +/* The following Ids are stored in the solvable and must + * come in one block */ +KNOWNID(SOLVABLE_NAME, "solvable:name"), +KNOWNID(SOLVABLE_ARCH, "solvable:arch"), +KNOWNID(SOLVABLE_EVR, "solvable:evr"), +KNOWNID(SOLVABLE_VENDOR, "solvable:vendor"), +KNOWNID(SOLVABLE_PROVIDES, "solvable:provides"), +KNOWNID(SOLVABLE_OBSOLETES, "solvable:obsoletes"), +KNOWNID(SOLVABLE_CONFLICTS, "solvable:conflicts"), +KNOWNID(SOLVABLE_REQUIRES, "solvable:requires"), +KNOWNID(SOLVABLE_RECOMMENDS, "solvable:recommends"), +KNOWNID(SOLVABLE_SUGGESTS, "solvable:suggests"), +KNOWNID(SOLVABLE_SUPPLEMENTS, "solvable:supplements"), +KNOWNID(SOLVABLE_ENHANCES, "solvable:enhances"), +KNOWNID(RPM_RPMDBID, "rpm:dbid"), + +/* normal requires before this, prereqs after this */ +KNOWNID(SOLVABLE_PREREQMARKER, "solvable:prereqmarker"), +/* normal provides before this, generated file provides after this */ +KNOWNID(SOLVABLE_FILEMARKER, "solvable:filemarker"), + +KNOWNID(NAMESPACE_INSTALLED, "namespace:installed"), +KNOWNID(NAMESPACE_MODALIAS, "namespace:modalias"), +KNOWNID(NAMESPACE_SPLITPROVIDES, "namespace:splitprovides"), +KNOWNID(NAMESPACE_LANGUAGE, "namespace:language"), +KNOWNID(NAMESPACE_FILESYSTEM, "namespace:filesystem"), +KNOWNID(NAMESPACE_OTHERPROVIDERS, "namespace:otherproviders"), + +KNOWNID(SYSTEM_SYSTEM, "system:system"), + +/* special solvable architectures */ +KNOWNID(ARCH_SRC, "src"), +KNOWNID(ARCH_NOSRC, "nosrc"), +KNOWNID(ARCH_NOARCH, "noarch"), +KNOWNID(ARCH_ALL, "all"), +KNOWNID(ARCH_ANY, "any"), + +/* the meta tags used in solv file storage */ +KNOWNID(REPOSITORY_SOLVABLES, "repository:solvables"), +KNOWNID(REPOSITORY_DELTAINFO, "repository:deltainfo"), + +/* sub-repository information, they will get loaded on demand */ +KNOWNID(REPOSITORY_EXTERNAL, "repository:external"), +KNOWNID(REPOSITORY_KEYS, "repository:keys"), +KNOWNID(REPOSITORY_LOCATION, "repository:location"), + +/* the known data types */ +KNOWNID(REPOKEY_TYPE_VOID, "repokey:type:void"), +KNOWNID(REPOKEY_TYPE_CONSTANT, "repokey:type:constant"), +KNOWNID(REPOKEY_TYPE_CONSTANTID, "repokey:type:constantid"), +KNOWNID(REPOKEY_TYPE_ID, "repokey:type:id"), +KNOWNID(REPOKEY_TYPE_NUM, "repokey:type:num"), +KNOWNID(REPOKEY_TYPE_DIR, "repokey:type:dir"), +KNOWNID(REPOKEY_TYPE_STR, "repokey:type:str"), +KNOWNID(REPOKEY_TYPE_BINARY, "repokey:type:binary"), +KNOWNID(REPOKEY_TYPE_IDARRAY, "repokey:type:idarray"), +KNOWNID(REPOKEY_TYPE_REL_IDARRAY, "repokey:type:relidarray"), +KNOWNID(REPOKEY_TYPE_DIRSTRARRAY, "repokey:type:dirstrarray"), +KNOWNID(REPOKEY_TYPE_DIRNUMNUMARRAY, "repokey:type:dirnumnumarray"), +KNOWNID(REPOKEY_TYPE_MD5, "repokey:type:md5"), +KNOWNID(REPOKEY_TYPE_SHA1, "repokey:type:sha1"), +KNOWNID(REPOKEY_TYPE_SHA224, "repokey:type:sha224"), +KNOWNID(REPOKEY_TYPE_SHA256, "repokey:type:sha256"), +KNOWNID(REPOKEY_TYPE_SHA384, "repokey:type:sha384"), +KNOWNID(REPOKEY_TYPE_SHA512, "repokey:type:sha512"), +KNOWNID(REPOKEY_TYPE_FIXARRAY, "repokey:type:fixarray"), +KNOWNID(REPOKEY_TYPE_FLEXARRAY, "repokey:type:flexarray"), +KNOWNID(REPOKEY_TYPE_DELETED, "repokey:type:deleted"), /* internal only */ + +KNOWNID(SOLVABLE_SUMMARY, "solvable:summary"), +KNOWNID(SOLVABLE_DESCRIPTION, "solvable:description"), +KNOWNID(SOLVABLE_DISTRIBUTION, "solvable:distribution"), +KNOWNID(SOLVABLE_AUTHORS, "solvable:authors"), +KNOWNID(SOLVABLE_PACKAGER, "solvable:packager"), +KNOWNID(SOLVABLE_GROUP, "solvable:group"), +KNOWNID(SOLVABLE_URL, "solvable:url"), +KNOWNID(SOLVABLE_KEYWORDS, "solvable:keywords"), +KNOWNID(SOLVABLE_LICENSE, "solvable:license"), +KNOWNID(SOLVABLE_BUILDTIME, "solvable:buildtime"), +KNOWNID(SOLVABLE_BUILDHOST, "solvable:buildhost"), +KNOWNID(SOLVABLE_EULA, "solvable:eula"), +KNOWNID(SOLVABLE_CPEID, "solvable:cpeid"), +KNOWNID(SOLVABLE_MESSAGEINS, "solvable:messageins"), +KNOWNID(SOLVABLE_MESSAGEDEL, "solvable:messagedel"), +KNOWNID(SOLVABLE_INSTALLSIZE, "solvable:installsize"), +KNOWNID(SOLVABLE_DISKUSAGE, "solvable:diskusage"), +KNOWNID(SOLVABLE_FILELIST, "solvable:filelist"), +KNOWNID(SOLVABLE_INSTALLTIME, "solvable:installtime"), +KNOWNID(SOLVABLE_MEDIADIR, "solvable:mediadir"), +KNOWNID(SOLVABLE_MEDIAFILE, "solvable:mediafile"), +KNOWNID(SOLVABLE_MEDIANR, "solvable:medianr"), +KNOWNID(SOLVABLE_MEDIABASE, "solvable:mediabase"), /* */ +KNOWNID(SOLVABLE_DOWNLOADSIZE, "solvable:downloadsize"), +KNOWNID(SOLVABLE_SOURCEARCH, "solvable:sourcearch"), +KNOWNID(SOLVABLE_SOURCENAME, "solvable:sourcename"), +KNOWNID(SOLVABLE_SOURCEEVR, "solvable:sourceevr"), +KNOWNID(SOLVABLE_ISVISIBLE, "solvable:isvisible"), +KNOWNID(SOLVABLE_TRIGGERS, "solvable:triggers"), +KNOWNID(SOLVABLE_CHECKSUM, "solvable:checksum"), +KNOWNID(SOLVABLE_PKGID, "solvable:pkgid"), /* pkgid: md5sum over header + payload */ +KNOWNID(SOLVABLE_HDRID, "solvable:hdrid"), /* hdrid: sha1sum over header only */ +KNOWNID(SOLVABLE_LEADSIGID, "solvable:leadsigid"), /* leadsigid: md5sum over lead + sigheader */ + +KNOWNID(SOLVABLE_PATCHCATEGORY, "solvable:patchcategory"), +KNOWNID(SOLVABLE_HEADEREND, "solvable:headerend"), +KNOWNID(SOLVABLE_CHANGELOG, "solvable:changelog"), +KNOWNID(SOLVABLE_CHANGELOG_AUTHOR, "solvable:changelog:author"), +KNOWNID(SOLVABLE_CHANGELOG_TIME, "solvable:changelog:time"), +KNOWNID(SOLVABLE_CHANGELOG_TEXT, "solvable:changelog:text"), +KNOWNID(SOLVABLE_INSTALLSTATUS, "solvable:installstatus"), /* debian install status */ +KNOWNID(SOLVABLE_PREREQ_IGNOREINST, "solvable:prereq_ignoreinst"), /* ignore these pre-requires for installed packages */ + +/* stuff for solvables of type pattern */ +KNOWNID(SOLVABLE_CATEGORY, "solvable:category"), +KNOWNID(SOLVABLE_INCLUDES, "solvable:includes"), +KNOWNID(SOLVABLE_EXTENDS, "solvable:extends"), +KNOWNID(SOLVABLE_ICON, "solvable:icon"), +KNOWNID(SOLVABLE_ORDER, "solvable:order"), + +/* extra definitions for updates (i.e. patch: solvables) */ +KNOWNID(UPDATE_REBOOT, "update:reboot"), /* reboot suggested (kernel update) */ +KNOWNID(UPDATE_RESTART, "update:restart"), /* restart suggested (update stack update) */ +KNOWNID(UPDATE_RELOGIN, "update:relogin"), /* relogin suggested */ + +KNOWNID(UPDATE_MESSAGE, "update:message"), /* informative message */ +KNOWNID(UPDATE_SEVERITY, "update:severity"), /* "Important", ...*/ +KNOWNID(UPDATE_RIGHTS, "update:rights"), /* copyright */ + +/* 'content' of patch, usually list of packages */ +KNOWNID(UPDATE_COLLECTION, "update:collection"), /* "name evr arch" */ +KNOWNID(UPDATE_COLLECTION_NAME, "update:collection:name"), /* name */ +KNOWNID(UPDATE_COLLECTION_EVR, "update:collection:evr"), /* epoch:version-release */ +KNOWNID(UPDATE_COLLECTION_ARCH, "update:collection:arch"), /* architecture */ +KNOWNID(UPDATE_COLLECTION_FILENAME, "update:collection:filename"), /* filename (of rpm) */ +KNOWNID(UPDATE_COLLECTION_FLAGS, "update:collection:flags"), /* reboot(1)/restart(2) suggested if this rpm gets updated */ + +KNOWNID(UPDATE_REFERENCE, "update:reference"), /* external references for the update */ +KNOWNID(UPDATE_REFERENCE_TYPE, "update:reference:type"), /* type, e.g. 'bugzilla' or 'cve' */ +KNOWNID(UPDATE_REFERENCE_HREF, "update:reference:href"), /* href, e.g. 'http://bugzilla...' */ +KNOWNID(UPDATE_REFERENCE_ID, "update:reference:id"), /* id, e.g. bug number */ +KNOWNID(UPDATE_REFERENCE_TITLE, "update:reference:title"), /* title, e.g. "the bla forz scribs on fuggle" */ + +/* extra definitions for products */ +KNOWNID(PRODUCT_REFERENCEFILE, "product:referencefile"), /* installed product only */ +KNOWNID(PRODUCT_SHORTLABEL, "product:shortlabel"), /* not in repomd? */ +KNOWNID(PRODUCT_DISTPRODUCT, "product:distproduct"), /* obsolete */ +KNOWNID(PRODUCT_DISTVERSION, "product:distversion"), /* obsolete */ +KNOWNID(PRODUCT_TYPE, "product:type"), /* e.g. 'base' */ +KNOWNID(PRODUCT_URL, "product:url"), +KNOWNID(PRODUCT_URL_TYPE, "product:url:type"), +KNOWNID(PRODUCT_FLAGS, "product:flags"), /* e.g. 'update', 'no_you' */ +KNOWNID(PRODUCT_PRODUCTLINE, "product:productline"), /* installed product only */ +KNOWNID(PRODUCT_REGISTER_TARGET, "product:regtarget"), /* installed and available product */ +KNOWNID(PRODUCT_REGISTER_FLAVOR, "product:regflavor"), /* installed and available product */ +KNOWNID(PRODUCT_REGISTER_RELEASE, "product:regrelease"), /* installed product only */ +KNOWNID(PRODUCT_UPDATES_REPOID, "product:updates:repoid"), +KNOWNID(PRODUCT_UPDATES, "product:updates"), +KNOWNID(PRODUCT_ENDOFLIFE, "product:endoflife"), + +/* argh, should rename to repository and unify with REPOMD */ +KNOWNID(SUSETAGS_DATADIR, "susetags:datadir"), +KNOWNID(SUSETAGS_DESCRDIR, "susetags:descrdir"), +KNOWNID(SUSETAGS_DEFAULTVENDOR, "susetags:defaultvendor"), +KNOWNID(SUSETAGS_FILE, "susetags:file"), +KNOWNID(SUSETAGS_FILE_NAME, "susetags:file:name"), +KNOWNID(SUSETAGS_FILE_TYPE, "susetags:file:type"), +KNOWNID(SUSETAGS_FILE_CHECKSUM, "susetags:file:checksum"), +KNOWNID(SUSETAGS_SHARE_NAME, "susetags:share:name"), +KNOWNID(SUSETAGS_SHARE_EVR, "susetags:share:evr"), +KNOWNID(SUSETAGS_SHARE_ARCH, "susetags:share:arch"), + +KNOWNID(REPOSITORY_ADDEDFILEPROVIDES, "repository:addedfileprovides"), /* file provides already added to our solvables */ +KNOWNID(REPOSITORY_RPMDBCOOKIE, "repository:rpmdbcookie"), /* inode of the rpm database for rpm --rebuilddb detection */ +KNOWNID(REPOSITORY_FILTEREDFILELIST, "repository:filteredfilelist"), /* filelist in repository is filtered */ +KNOWNID(REPOSITORY_TIMESTAMP, "repository:timestamp"), /* timestamp then the repository was generated */ +KNOWNID(REPOSITORY_EXPIRE, "repository:expire"), /* hint when the metadata could be outdated w/respect to generated timestamp */ +KNOWNID(REPOSITORY_UPDATES, "repository:updates"), /* which things does this repo provides updates for, if it does (array) (obsolete?) */ +KNOWNID(REPOSITORY_DISTROS, "repository:distros"), /* which products this repository is supposed to be for (array) */ +KNOWNID(REPOSITORY_PRODUCT_LABEL, "repository:product:label"), +KNOWNID(REPOSITORY_PRODUCT_CPEID, "repository:product:cpeid"), +KNOWNID(REPOSITORY_REPOID, "repository:repoid"), /* obsolete? */ +KNOWNID(REPOSITORY_KEYWORDS, "repository:keywords"), /* keyword (tags) for this repository */ +KNOWNID(REPOSITORY_REVISION, "repository:revision"), /* revision of the repository. arbitrary string */ +KNOWNID(REPOSITORY_TOOLVERSION, "repository:toolversion"), + +KNOWNID(DELTA_PACKAGE_NAME, "delta:pkgname"), +KNOWNID(DELTA_PACKAGE_EVR, "delta:pkgevr"), +KNOWNID(DELTA_PACKAGE_ARCH, "delta:pkgarch"), +KNOWNID(DELTA_LOCATION_DIR, "delta:locdir"), +KNOWNID(DELTA_LOCATION_NAME, "delta:locname"), +KNOWNID(DELTA_LOCATION_EVR, "delta:locevr"), +KNOWNID(DELTA_LOCATION_SUFFIX, "delta:locsuffix"), +KNOWNID(DELTA_DOWNLOADSIZE, "delta:downloadsize"), +KNOWNID(DELTA_CHECKSUM, "delta:checksum"), +KNOWNID(DELTA_BASE_EVR, "delta:baseevr"), +KNOWNID(DELTA_SEQ_NAME, "delta:seqname"), +KNOWNID(DELTA_SEQ_EVR, "delta:seqevr"), +KNOWNID(DELTA_SEQ_NUM, "delta:seqnum"), +KNOWNID(DELTA_LOCATION_BASE, "delta:locbase"), /* */ + +KNOWNID(REPOSITORY_REPOMD, "repository:repomd"), +KNOWNID(REPOSITORY_REPOMD_TYPE, "repository:repomd:type"), +KNOWNID(REPOSITORY_REPOMD_LOCATION, "repository:repomd:location"), +KNOWNID(REPOSITORY_REPOMD_TIMESTAMP, "repository:repomd:timestamp"), +KNOWNID(REPOSITORY_REPOMD_CHECKSUM, "repository:repomd:checksum"), +KNOWNID(REPOSITORY_REPOMD_OPENCHECKSUM, "repository:repomd:openchecksum"), +KNOWNID(REPOSITORY_REPOMD_SIZE, "repository:repomd:size"), + +KNOWNID(PUBKEY_KEYID, "pubkey:keyid"), +KNOWNID(PUBKEY_FINGERPRINT, "pubkey:fingerprint"), +KNOWNID(PUBKEY_EXPIRES, "pubkey:expires"), +KNOWNID(PUBKEY_SIGNATURES, "pubkey:signatures"), +KNOWNID(PUBKEY_DATA, "pubkey:data"), +KNOWNID(PUBKEY_SUBKEYOF, "pubkey:subkeyof"), + +KNOWNID(SIGNATURE_ISSUER, "signature:issuer"), +KNOWNID(SIGNATURE_TIME, "signature:time"), +KNOWNID(SIGNATURE_EXPIRES, "signature:expires"), +KNOWNID(SIGNATURE_DATA, "signature:data"), + +/* 'content' of patch, usually list of modules */ +KNOWNID(UPDATE_MODULE, "update:module"), /* "name stream version context arch" */ +KNOWNID(UPDATE_MODULE_NAME, "update:module:name"), /* name */ +KNOWNID(UPDATE_MODULE_STREAM, "update:module:stream"), /* stream */ +KNOWNID(UPDATE_MODULE_VERSION, "update:module:version"), /* version */ +KNOWNID(UPDATE_MODULE_CONTEXT, "update:module:context"), /* context */ +KNOWNID(UPDATE_MODULE_ARCH, "update:module:arch"), /* architecture */ + +KNOWNID(SOLVABLE_BUILDVERSION, "solvable:buildversion"), /* conda */ +KNOWNID(SOLVABLE_BUILDFLAVOR, "solvable:buildflavor"), /* conda */ + +KNOWNID(UPDATE_STATUS, "update:status"), /* "stable", "testing", ...*/ + +KNOWNID(LIBSOLV_SELF_DESTRUCT_PKG, "libsolv-self-destruct-pkg()"), /* this package will self-destruct on installation */ + +KNOWNID(SOLVABLE_CONSTRAINS, "solvable:constrains"), /* conda */ +KNOWNID(SOLVABLE_TRACK_FEATURES, "solvable:track_features"), /* conda */ +KNOWNID(SOLVABLE_ISDEFAULT, "solvable:isdefault"), +KNOWNID(SOLVABLE_LANGONLY, "solvable:langonly"), + +KNOWNID(UPDATE_COLLECTIONLIST, "update:collectionlist"), /* list of UPDATE_COLLECTION (actually packages) and UPDATE_MODULE */ +KNOWNID(SOLVABLE_MULTIARCH, "solvable:multiarch"), /* debian multi-arch field */ +KNOWNID(SOLVABLE_SIGNATUREDATA, "solvable:signaturedata"), /* conda */ + +KNOWNID(ID_NUM_INTERNAL, 0) + +#ifdef KNOWNID_INITIALIZE +}; +#else +}; +#endif + +#undef KNOWNID + +#endif + + diff --git a/data/miniconda3/include/solv/pool.h b/data/miniconda3/include/solv/pool.h new file mode 100644 index 0000000000000000000000000000000000000000..08cf1d06a813d83a6ddf7a7c173e00e3d97ea704 --- /dev/null +++ b/data/miniconda3/include/solv/pool.h @@ -0,0 +1,426 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * pool.h + * + */ + +#ifndef LIBSOLV_POOL_H +#define LIBSOLV_POOL_H + +#include + +#include "solvversion.h" +#include "pooltypes.h" +#include "poolid.h" +#include "solvable.h" +#include "bitmap.h" +#include "queue.h" +#include "strpool.h" + +/* well known ids */ +#include "knownid.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* well known solvable */ +#define SYSTEMSOLVABLE 1 + + +/*----------------------------------------------- */ + +struct s_Repokey; +struct s_KeyValue; + +typedef struct s_Datapos { + Repo *repo; + Id solvid; + Id repodataid; + Id schema; + Id dp; +} Datapos; + + +#ifdef LIBSOLV_INTERNAL + +/* how many strings to maintain (round robin) */ +#define POOL_TMPSPACEBUF 16 + +struct s_Pool_tmpspace { + char *buf[POOL_TMPSPACEBUF]; + int len[POOL_TMPSPACEBUF]; + int n; +}; + +#endif + +struct s_Pool { + void *appdata; /* application private pointer */ + + Stringpool ss; + + Reldep *rels; /* table of rels: Id -> Reldep */ + int nrels; /* number of unique rels */ + + Repo **repos; + int nrepos; /* repos allocated */ + int urepos; /* repos in use */ + + Repo *installed; /* packages considered installed */ + + Solvable *solvables; + int nsolvables; /* solvables allocated */ + + const char **languages; + int nlanguages; + + /* package manager type, deb/rpm */ + int disttype; + + Id *id2arch; /* map arch ids to scores */ + unsigned char *id2color; /* map arch ids to colors */ + Id lastarch; /* size of the id2arch/id2color arrays */ + + Queue vendormap; /* map vendor to vendorclasses mask */ + const char **vendorclasses; /* vendor equivalence classes */ + + /* providers data, as two-step indirect list + * whatprovides[Id] -> Offset into whatprovidesdata for name + * whatprovidesdata[Offset] -> 0-terminated list of solvables providing Id + */ + Offset *whatprovides; /* Offset to providers of a specific name, Id -> Offset */ + Offset *whatprovides_rel; /* Offset to providers of a specific relation, Id -> Offset */ + + Id *whatprovidesdata; /* Ids of solvable providing Id */ + Offset whatprovidesdataoff; /* next free slot within whatprovidesdata */ + int whatprovidesdataleft; /* number of 'free slots' within whatprovidesdata */ + + /* If nonzero, then consider only the solvables with Ids set in this + bitmap for solving. If zero, consider all solvables. */ + Map *considered; + + /* callback for REL_NAMESPACE dependencies handled by the application */ + Id (*nscallback)(Pool *, void *data, Id name, Id evr); + void *nscallbackdata; + + /* debug mask and callback */ + int debugmask; + void (*debugcallback)(Pool *, void *data, int type, const char *str); + void *debugcallbackdata; + + /* load callback */ + int (*loadcallback)(Pool *, Repodata *, void *); + void *loadcallbackdata; + + /* search position */ + Datapos pos; + + Queue pooljobs; /* fixed jobs, like USERINSTALLED/MULTIVERSION */ + +#ifdef LIBSOLV_INTERNAL + /* flags to tell the library how the installed package manager works */ + int promoteepoch; /* true: missing epoch is replaced by epoch of dependency */ + int havedistepoch; /* true: thr release part in the evr may contain a distepoch suffix */ + int obsoleteusesprovides; /* true: obsoletes are matched against provides, not names */ + int implicitobsoleteusesprovides; /* true: implicit obsoletes due to same name are matched against provides, not names */ + int obsoleteusescolors; /* true: obsoletes check arch color */ + int implicitobsoleteusescolors; /* true: implicit obsoletes check arch color */ + int noinstalledobsoletes; /* true: ignore obsoletes of installed packages */ + int forbidselfconflicts; /* true: packages which conflict with itself are not installable */ + int noobsoletesmultiversion; /* true: obsoletes are ignored for multiversion installs */ + + Id noarchid; /* ARCH_NOARCH, ARCH_ALL, ARCH_ANY, ... */ + + /* hash for rel unification */ + Hashtable relhashtbl; /* hashtable: (name,evr,op)Hash -> Id */ + Hashval relhashmask; + + Id *languagecache; + int languagecacheother; + + /* our tmp space string space */ + struct s_Pool_tmpspace tmpspace; + + char *errstr; /* last error string */ + int errstra; /* allocated space for errstr */ + + char *rootdir; + + int (*custom_vendorcheck)(Pool *, Solvable *, Solvable *); + + int addfileprovidesfiltered; /* 1: only use filtered file list for addfileprovides */ + int addedfileprovides; /* true: application called addfileprovides */ + Queue lazywhatprovidesq; /* queue to store old whatprovides offsets */ + int nowhatprovidesaux; /* don't allocate and use the whatprovides aux helper */ + Offset *whatprovidesaux; + Offset whatprovidesauxoff; + Id *whatprovidesauxdata; + Offset whatprovidesauxdataoff; + + int whatprovideswithdisabled; +#endif +}; + +#define DISTTYPE_RPM 0 +#define DISTTYPE_DEB 1 +#define DISTTYPE_ARCH 2 +#define DISTTYPE_HAIKU 3 +#define DISTTYPE_CONDA 4 + +#define SOLV_FATAL (1<<0) +#define SOLV_ERROR (1<<1) +#define SOLV_WARN (1<<2) +#define SOLV_DEBUG_STATS (1<<3) +#define SOLV_DEBUG_RULE_CREATION (1<<4) +#define SOLV_DEBUG_PROPAGATE (1<<5) +#define SOLV_DEBUG_ANALYZE (1<<6) +#define SOLV_DEBUG_UNSOLVABLE (1<<7) +#define SOLV_DEBUG_SOLUTIONS (1<<8) +#define SOLV_DEBUG_POLICY (1<<9) +#define SOLV_DEBUG_RESULT (1<<10) +#define SOLV_DEBUG_JOB (1<<11) +#define SOLV_DEBUG_SOLVER (1<<12) +#define SOLV_DEBUG_TRANSACTION (1<<13) +#define SOLV_DEBUG_WATCHES (1<<14) + +#define SOLV_DEBUG_TO_STDERR (1<<30) + +#define POOL_FLAG_PROMOTEEPOCH 1 +#define POOL_FLAG_FORBIDSELFCONFLICTS 2 +#define POOL_FLAG_OBSOLETEUSESPROVIDES 3 +#define POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES 4 +#define POOL_FLAG_OBSOLETEUSESCOLORS 5 +#define POOL_FLAG_NOINSTALLEDOBSOLETES 6 +#define POOL_FLAG_HAVEDISTEPOCH 7 +#define POOL_FLAG_NOOBSOLETESMULTIVERSION 8 +#define POOL_FLAG_ADDFILEPROVIDESFILTERED 9 +#define POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS 10 +#define POOL_FLAG_NOWHATPROVIDESAUX 11 +#define POOL_FLAG_WHATPROVIDESWITHDISABLED 12 + +/* ----------------------------------------------- */ + + +/* mark dependencies with relation by setting bit31 */ + +#define MAKERELDEP(id) ((id) | 0x80000000) +#define ISRELDEP(id) (((id) & 0x80000000) != 0) +#define GETRELID(id) ((id) ^ 0x80000000) /* returns Id */ +#define GETRELDEP(pool, id) ((pool)->rels + ((id) ^ 0x80000000)) /* returns Reldep* */ + +#define REL_GT 1 +#define REL_EQ 2 +#define REL_LT 4 + +#define REL_AND 16 +#define REL_OR 17 +#define REL_WITH 18 +#define REL_NAMESPACE 19 +#define REL_ARCH 20 +#define REL_FILECONFLICT 21 +#define REL_COND 22 /* OR_NOT */ +#define REL_COMPAT 23 +#define REL_KIND 24 /* for filters only */ +#define REL_MULTIARCH 25 /* debian multiarch annotation */ +#define REL_ELSE 26 /* only as evr part of REL_COND/REL_UNLESS */ +#define REL_ERROR 27 /* parse errors and the like */ +#define REL_WITHOUT 28 +#define REL_UNLESS 29 /* AND_NOT */ +#define REL_CONDA 30 + +#if !defined(__GNUC__) && !defined(__attribute__) +# define __attribute__(x) +#endif + +extern Pool *pool_create(void); +extern void pool_free(Pool *pool); +extern void pool_freeallrepos(Pool *pool, int reuseids); + +extern void pool_setdebuglevel(Pool *pool, int level); +extern int pool_setdisttype(Pool *pool, int disttype); +extern int pool_set_flag(Pool *pool, int flag, int value); +extern int pool_get_flag(Pool *pool, int flag); + +extern void pool_debug(Pool *pool, int type, const char *format, ...) __attribute__((format(printf, 3, 4))); +extern void pool_setdebugcallback(Pool *pool, void (*debugcallback)(Pool *pool, void *data, int type, const char *str), void *debugcallbackdata); +extern void pool_setdebugmask(Pool *pool, int mask); +extern void pool_setloadcallback(Pool *pool, int (*cb)(Pool *, Repodata *, void *), void *loadcbdata); +extern void pool_setnamespacecallback(Pool *pool, Id (*cb)(Pool *, void *, Id, Id), void *nscbdata); +extern void pool_flush_namespaceproviders(Pool *pool, Id ns, Id evr); + +extern void pool_set_custom_vendorcheck(Pool *pool, int (*vendorcheck)(Pool *, Solvable *, Solvable *)); +extern int (*pool_get_custom_vendorcheck(Pool *pool))(Pool *, Solvable *, Solvable *); + +extern char *pool_alloctmpspace(Pool *pool, int len); +extern void pool_freetmpspace(Pool *pool, const char *space); +extern char *pool_tmpjoin(Pool *pool, const char *str1, const char *str2, const char *str3); +extern char *pool_tmpappend(Pool *pool, const char *str1, const char *str2, const char *str3); +extern const char *pool_bin2hex(Pool *pool, const unsigned char *buf, int len); + +extern void pool_set_installed(Pool *pool, Repo *repo); + +extern int pool_error(Pool *pool, int ret, const char *format, ...) __attribute__((format(printf, 3, 4))); +extern char *pool_errstr(Pool *pool); + +extern void pool_set_rootdir(Pool *pool, const char *rootdir); +extern const char *pool_get_rootdir(Pool *pool); +extern char *pool_prepend_rootdir(Pool *pool, const char *dir); +extern const char *pool_prepend_rootdir_tmp(Pool *pool, const char *dir); + +/** + * Solvable management + */ +extern Id pool_add_solvable(Pool *pool); +extern Id pool_add_solvable_block(Pool *pool, int count); + +extern void pool_free_solvable_block(Pool *pool, Id start, int count, int reuseids); +static inline Solvable *pool_id2solvable(const Pool *pool, Id p) +{ + return pool->solvables + p; +} +static inline Id pool_solvable2id(const Pool *pool, Solvable *s) +{ + return s - pool->solvables; +} + +extern const char *pool_solvable2str(Pool *pool, Solvable *s); +static inline const char *pool_solvid2str(Pool *pool, Id p) +{ + return pool_solvable2str(pool, pool->solvables + p); +} +extern const char *pool_solvidset2str(Pool *pool, Queue *q); + +void pool_set_languages(Pool *pool, const char **languages, int nlanguages); +Id pool_id2langid(Pool *pool, Id id, const char *lang, int create); + +int pool_intersect_evrs(Pool *pool, int pflags, Id pevr, int flags, Id evr); +int pool_match_dep(Pool *pool, Id d1, Id d2); + +/* semi private, used in pool_match_nevr */ +int pool_match_nevr_rel(Pool *pool, Solvable *s, Id d); + +static inline int pool_match_nevr(Pool *pool, Solvable *s, Id d) +{ + if (!ISRELDEP(d)) + return d == s->name; + else + return pool_match_nevr_rel(pool, s, d); +} + + +/** + * Prepares a pool for solving + */ +extern void pool_createwhatprovides(Pool *pool); +extern void pool_addfileprovides(Pool *pool); +extern void pool_addfileprovides_queue(Pool *pool, Queue *idq, Queue *idqinst); +extern void pool_freewhatprovides(Pool *pool); +extern Id pool_queuetowhatprovides(Pool *pool, Queue *q); +extern Id pool_ids2whatprovides(Pool *pool, Id *ids, int count); +extern Id pool_searchlazywhatprovidesq(Pool *pool, Id d); + +extern Id pool_addrelproviders(Pool *pool, Id d); + +static inline Id pool_whatprovides(Pool *pool, Id d) +{ + if (!ISRELDEP(d)) + { + if (pool->whatprovides[d]) + return pool->whatprovides[d]; + } + else + { + Id v = GETRELID(d); + if (pool->whatprovides_rel[v]) + return pool->whatprovides_rel[v]; + } + return pool_addrelproviders(pool, d); +} + +static inline Id *pool_whatprovides_ptr(Pool *pool, Id d) +{ + Id off = pool_whatprovides(pool, d); + return pool->whatprovidesdata + off; +} + +void pool_whatmatchesdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker); +void pool_whatcontainsdep(Pool *pool, Id keyname, Id dep, Queue *q, int marker); +void pool_whatmatchessolvable(Pool *pool, Id keyname, Id solvid, Queue *q, int marker); +void pool_set_whatprovides(Pool *pool, Id id, Id providers); + + +/* search the pool. the following filters are available: + * p - search just this solvable + * key - search only this key + * match - key must match this string + */ +void pool_search(Pool *pool, Id p, Id key, const char *match, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, struct s_Repokey *key, struct s_KeyValue *kv), void *cbdata); + +void pool_clear_pos(Pool *pool); + +/* lookup functions */ +const char *pool_lookup_str(Pool *pool, Id entry, Id keyname); +Id pool_lookup_id(Pool *pool, Id entry, Id keyname); +unsigned long long pool_lookup_num(Pool *pool, Id entry, Id keyname, unsigned long long notfound); +int pool_lookup_void(Pool *pool, Id entry, Id keyname); +const unsigned char *pool_lookup_bin_checksum(Pool *pool, Id entry, Id keyname, Id *typep); +int pool_lookup_idarray(Pool *pool, Id entry, Id keyname, Queue *q); +const char *pool_lookup_checksum(Pool *pool, Id entry, Id keyname, Id *typep); +const char *pool_lookup_deltalocation(Pool *pool, Id entry, unsigned int *medianrp); + + +#define DUCHANGES_ONLYADD 1 + +typedef struct s_DUChanges { + const char *path; + long long kbytes; + long long files; + int flags; +} DUChanges; + + +void pool_create_state_maps(Pool *pool, Queue *installed, Map *installedmap, Map *conflictsmap); +void pool_calc_duchanges(Pool *pool, Map *installedmap, DUChanges *mps, int nmps); +long long pool_calc_installsizechange(Pool *pool, Map *installedmap); + +void pool_add_fileconflicts_deps(Pool *pool, Queue *conflicts); + + + +/* loop over all providers of d */ +#define FOR_PROVIDES(v, vp, d) \ + for (vp = pool_whatprovides(pool, d) ; (v = pool->whatprovidesdata[vp++]) != 0; ) + +/* loop over all repositories */ +#define FOR_REPOS(repoid, r) \ + for (repoid = 1; repoid < pool->nrepos; repoid++) \ + if ((r = pool->repos[repoid]) == 0) \ + continue; \ + else + +#define FOR_POOL_SOLVABLES(p) \ + for (p = 2; p < pool->nsolvables; p++) \ + if (pool->solvables[p].repo == 0) \ + continue; \ + else + +#define POOL_DEBUG(type, ...) do {if ((pool->debugmask & (type)) != 0) pool_debug(pool, (type), __VA_ARGS__);} while (0) +#define IF_POOLDEBUG(type) if ((pool->debugmask & (type)) != 0) + +/* weird suse stuff */ +void pool_trivial_installable_multiversionmap(Pool *pool, Map *installedmap, Queue *pkgs, Queue *res, Map *multiversionmap); +void pool_trivial_installable(Pool *pool, Map *installedmap, Queue *pkgs, Queue *res); + +#ifdef __cplusplus +} +#endif + + +#endif /* LIBSOLV_POOL_H */ diff --git a/data/miniconda3/include/solv/poolid.h b/data/miniconda3/include/solv/poolid.h new file mode 100644 index 0000000000000000000000000000000000000000..f832ff4b3002a17b37e01acc8c6346b299799257 --- /dev/null +++ b/data/miniconda3/include/solv/poolid.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * poolid.h + * + */ + +#ifndef LIBSOLV_POOLID_H +#define LIBSOLV_POOLID_H + +#include "pooltypes.h" +#include "hash.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*----------------------------------------------- + * Ids with relation + */ + +typedef struct s_Reldep { + Id name; /* "package" */ + Id evr; /* "0:42-3" */ + int flags; /* operation/relation, see REL_x in pool.h */ +} Reldep; + +extern Id pool_str2id(Pool *pool, const char *, int); +extern Id pool_strn2id(Pool *pool, const char *, unsigned int, int); +extern Id pool_rel2id(Pool *pool, Id, Id, int, int); +extern const char *pool_id2str(const Pool *pool, Id); +extern const char *pool_id2rel(const Pool *pool, Id); +extern const char *pool_id2evr(const Pool *pool, Id); +extern const char *pool_dep2str(Pool *pool, Id); /* might alloc tmpspace */ + +extern void pool_shrink_strings(Pool *pool); +extern void pool_shrink_rels(Pool *pool); +extern void pool_freeidhashes(Pool *pool); +extern void pool_resize_rels_hash(Pool *pool, int numnew); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_POOLID_H */ diff --git a/data/miniconda3/include/solv/problems.h b/data/miniconda3/include/solv/problems.h new file mode 100644 index 0000000000000000000000000000000000000000..9e4ad1ffead8054c774ac72756fc1d512fd68eca --- /dev/null +++ b/data/miniconda3/include/solv/problems.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2007-2009, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * problems.h + * + */ + +#ifndef LIBSOLV_PROBLEMS_H +#define LIBSOLV_PROBLEMS_H + +#include "rules.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +struct s_Solver; + +#define SOLVER_SOLUTION_JOB (0) +#define SOLVER_SOLUTION_DISTUPGRADE (-1) +#define SOLVER_SOLUTION_INFARCH (-2) +#define SOLVER_SOLUTION_BEST (-3) +#define SOLVER_SOLUTION_POOLJOB (-4) +#define SOLVER_SOLUTION_BLACK (-5) +#define SOLVER_SOLUTION_STRICTREPOPRIORITY (-6) +/* replace solution types */ +#define SOLVER_SOLUTION_ERASE (-100) +#define SOLVER_SOLUTION_REPLACE (-101) +#define SOLVER_SOLUTION_REPLACE_DOWNGRADE (-102) +#define SOLVER_SOLUTION_REPLACE_ARCHCHANGE (-103) +#define SOLVER_SOLUTION_REPLACE_VENDORCHANGE (-104) +#define SOLVER_SOLUTION_REPLACE_NAMECHANGE (-105) + +void solver_recordproblem(struct s_Solver *solv, Id rid); +void solver_fixproblem(struct s_Solver *solv, Id rid); +Id solver_autouninstall(struct s_Solver *solv, int start); +void solver_disableproblemset(struct s_Solver *solv, int start); + +int solver_prepare_solutions(struct s_Solver *solv); + +unsigned int solver_problem_count(struct s_Solver *solv); +Id solver_next_problem(struct s_Solver *solv, Id problem); +unsigned int solver_solution_count(struct s_Solver *solv, Id problem); +Id solver_next_solution(struct s_Solver *solv, Id problem, Id solution); +unsigned int solver_solutionelement_count(struct s_Solver *solv, Id problem, Id solution); +Id solver_solutionelement_internalid(struct s_Solver *solv, Id problem, Id solution); +Id solver_solutionelement_extrajobflags(struct s_Solver *solv, Id problem, Id solution); +Id solver_next_solutionelement(struct s_Solver *solv, Id problem, Id solution, Id element, Id *p, Id *rp); +void solver_all_solutionelements(struct s_Solver *solv, Id problem, Id solution, int expandreplaces, Queue *q); + +void solver_take_solutionelement(struct s_Solver *solv, Id p, Id rp, Id extrajobflags, Queue *job); +void solver_take_solution(struct s_Solver *solv, Id problem, Id solution, Queue *job); + +Id solver_findproblemrule(struct s_Solver *solv, Id problem); +void solver_findallproblemrules(struct s_Solver *solv, Id problem, Queue *rules); + +extern const char *solver_problemruleinfo2str(struct s_Solver *solv, SolverRuleinfo type, Id source, Id target, Id dep); +extern const char *solver_problem2str(struct s_Solver *solv, Id problem); +extern const char *solver_solutionelement2str(struct s_Solver *solv, Id p, Id rp); +extern const char *solver_solutionelementtype2str(struct s_Solver *solv, int type, Id p, Id rp); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/data/miniconda3/include/solv/repo_solv.h b/data/miniconda3/include/solv/repo_solv.h new file mode 100644 index 0000000000000000000000000000000000000000..57bf177262221c03a51e56d1655b28525f8c5f44 --- /dev/null +++ b/data/miniconda3/include/solv/repo_solv.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * repo_solv.h + * + */ + +#ifndef LIBSOLV_REPO_SOLVE_H +#define LIBSOLV_REPO_SOLVE_H + +#include + +#include "pool.h" +#include "repo.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern int repo_add_solv(Repo *repo, FILE *fp, int flags); +extern int solv_read_userdata(FILE *fp, unsigned char **datap, int *lenp); + +#define SOLV_ADD_NO_STUBS (1 << 8) + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_REPO_SOLVE_H */ diff --git a/data/miniconda3/include/solv/repo_write.h b/data/miniconda3/include/solv/repo_write.h new file mode 100644 index 0000000000000000000000000000000000000000..7734b0130c47c6f17771e600e8059f4006614ff4 --- /dev/null +++ b/data/miniconda3/include/solv/repo_write.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * repo_write.h + * + */ + +#ifndef REPO_WRITE_H +#define REPO_WRITE_H + +#include + +#include "repo.h" +#include "queue.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct s_Repowriter { + Repo *repo; + int flags; + int repodatastart; + int repodataend; + int solvablestart; + int solvableend; + int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata); + void *kfdata; + Queue *keyq; + void *userdata; + int userdatalen; +} Repowriter; + +/* repowriter flags */ +#define REPOWRITER_NO_STORAGE_SOLVABLE (1 << 0) +#define REPOWRITER_KEEP_TYPE_DELETED (1 << 1) +#define REPOWRITER_LEGACY (1 << 30) + +Repowriter *repowriter_create(Repo *repo); +Repowriter *repowriter_free(Repowriter *writer); +void repowriter_set_flags(Repowriter *writer, int flags); +void repowriter_set_keyfilter(Repowriter *writer, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata); +void repowriter_set_keyqueue(Repowriter *writer, Queue *keyq); +void repowriter_set_repodatarange(Repowriter *writer, int repodatastart, int repodataend); +void repowriter_set_solvablerange(Repowriter *writer, int solvablestart, int solvableend); +void repowriter_set_userdata(Repowriter *writer, const void *data, int len); +int repowriter_write(Repowriter *writer, FILE *fp); + +/* convenience functions */ +extern int repo_write(Repo *repo, FILE *fp); +extern int repodata_write(Repodata *data , FILE *fp); + +extern int repo_write_stdkeyfilter(Repo *repo, Repokey *key, void *kfdata); + +/* deprecated functions, do not use in new code! */ +extern int repo_write_filtered(Repo *repo, FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq); +extern int repodata_write_filtered(Repodata *data , FILE *fp, int (*keyfilter)(Repo *repo, Repokey *key, void *kfdata), void *kfdata, Queue *keyq); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/data/miniconda3/include/solv/repodata.h b/data/miniconda3/include/solv/repodata.h new file mode 100644 index 0000000000000000000000000000000000000000..fda463e7fb386c2d2d665ab5e6062c5b20236c0e --- /dev/null +++ b/data/miniconda3/include/solv/repodata.h @@ -0,0 +1,359 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * repodata.h + * + */ + +#ifndef LIBSOLV_REPODATA_H +#define LIBSOLV_REPODATA_H + +#include + +#include "pooltypes.h" +#include "pool.h" +#include "dirpool.h" + +#ifdef LIBSOLV_INTERNAL +#include "repopage.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define SIZEOF_MD5 16 +#define SIZEOF_SHA1 20 +#define SIZEOF_SHA224 28 +#define SIZEOF_SHA256 32 +#define SIZEOF_SHA384 48 +#define SIZEOF_SHA512 64 + +struct s_KeyValue; + +typedef struct s_Repokey { + Id name; + Id type; /* REPOKEY_TYPE_xxx */ + unsigned int size; + unsigned int storage; /* KEY_STORAGE_xxx */ +} Repokey; + +#define KEY_STORAGE_DROPPED 0 +#define KEY_STORAGE_SOLVABLE 1 +#define KEY_STORAGE_INCORE 2 +#define KEY_STORAGE_VERTICAL_OFFSET 3 +#define KEY_STORAGE_IDARRAYBLOCK 4 + +#ifdef LIBSOLV_INTERNAL +struct dircache; +#endif + +/* repodata states */ +#define REPODATA_AVAILABLE 0 +#define REPODATA_STUB 1 +#define REPODATA_ERROR 2 +#define REPODATA_STORE 3 +#define REPODATA_LOADING 4 + +/* repodata filelist types */ +/* note that FILELIST_FILTERED means that the data contains a filtered + * filelist *AND* that it is authoritative for all included solvables. */ +#define REPODATA_FILELIST_FILTERED 1 +#define REPODATA_FILELIST_EXTENSION 2 + +struct s_Repodata { + Id repodataid; /* our id */ + Repo *repo; /* back pointer to repo */ + + int state; /* available, stub or error */ + + void (*loadcallback)(Repodata *); + + int start; /* start of solvables this repodata is valid for */ + int end; /* last solvable + 1 of this repodata */ + + Repokey *keys; /* keys, first entry is always zero */ + int nkeys; /* length of keys array */ + unsigned char keybits[32]; /* keyname hash */ + + Id *schemata; /* schema -> offset into schemadata */ + int nschemata; /* number of schemata */ + Id *schemadata; /* schema storage */ + + Stringpool spool; /* local string pool */ + int localpool; /* is local string pool used */ + + Dirpool dirpool; /* local dir pool */ + +#ifdef LIBSOLV_INTERNAL + FILE *fp; /* file pointer of solv file */ + int error; /* corrupt solv file */ + + int filelisttype; /* type of filelist */ + Id *filelistfilter; /* filelist filter used */ + char *filelistfilterdata; /* filelist filter string space */ + + unsigned int schemadatalen; /* schema storage size */ + Id *schematahash; /* unification helper */ + + unsigned char *incoredata; /* in-core data */ + unsigned int incoredatalen; /* in-core data used */ + unsigned int incoredatafree; /* free data len */ + + Id mainschema; /* SOLVID_META schema */ + Id *mainschemaoffsets; /* SOLVID_META offsets into incoredata */ + + Id *incoreoffset; /* offset for all entries */ + + Id *verticaloffset; /* offset for all verticals, nkeys elements */ + Id lastverticaloffset; /* end of verticals */ + + Repopagestore store; /* our page store */ + Id storestate; /* incremented every time the store might change */ + + unsigned char *vincore; /* internal vertical data */ + unsigned int vincorelen; /* data size */ + + Id **attrs; /* un-internalized attributes */ + Id **xattrs; /* anonymous handles */ + int nxattrs; /* number of handles */ + + unsigned char *attrdata; /* their string data space */ + unsigned int attrdatalen; /* its len */ + Id *attriddata; /* their id space */ + unsigned int attriddatalen; /* its len */ + unsigned long long *attrnum64data; /* their 64bit num data space */ + unsigned int attrnum64datalen; /* its len */ + + /* array cache to speed up repodata_add functions*/ + Id lasthandle; + Id lastkey; + Id lastdatalen; + + /* directory cache to speed up repodata_str2dir */ + struct dircache *dircache; +#endif + +}; + +#define SOLVID_META -1 +#define SOLVID_POS -2 + + +/*----- + * management functions + */ +void repodata_initdata(Repodata *data, Repo *repo, int localpool); +void repodata_freedata(Repodata *data); + +void repodata_free(Repodata *data); +void repodata_empty(Repodata *data, int localpool); + +void repodata_load(Repodata *data); + +/* + * key management functions + */ +Id repodata_key2id(Repodata *data, Repokey *key, int create); + +static inline Repokey * +repodata_id2key(Repodata *data, Id keyid) +{ + return data->keys + keyid; +} + +/* + * schema management functions + */ +Id repodata_schema2id(Repodata *data, Id *schema, int create); +void repodata_free_schemahash(Repodata *data); + +static inline Id * +repodata_id2schema(Repodata *data, Id schemaid) +{ + return data->schemadata + data->schemata[schemaid]; +} + +/* + * data search and access + */ + +/* check if there is a chance that the repodata contains data for + * the specified keyname */ +static inline int +repodata_precheck_keyname(Repodata *data, Id keyname) +{ + unsigned char x = data->keybits[(keyname >> 3) & (sizeof(data->keybits) - 1)]; + return x && (x & (1 << (keyname & 7))) ? 1 : 0; +} + +/* check if the repodata contains data for the specified keyname */ +static inline int +repodata_has_keyname(Repodata *data, Id keyname) +{ + int i; + if (!repodata_precheck_keyname(data, keyname)) + return 0; + for (i = 1; i < data->nkeys; i++) + if (data->keys[i].name == keyname) + return 1; + return 0; +} + +/* search key (all keys, if keyname == 0) for Id + * Call for each match */ +void repodata_search(Repodata *data, Id solvid, Id keyname, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, struct s_KeyValue *kv), void *cbdata); +void repodata_search_keyskip(Repodata *data, Id solvid, Id keyname, int flags, Id *keyskip, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, struct s_KeyValue *kv), void *cbdata); +void repodata_search_arrayelement(Repodata *data, Id solvid, Id keyname, int flags, struct s_KeyValue *kv, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, struct s_KeyValue *kv), void *cbdata); + +/* Make sure the found KeyValue has the "str" field set. Return "str" + * if valid, NULL if not possible */ +const char *repodata_stringify(Pool *pool, Repodata *data, Repokey *key, struct s_KeyValue *kv, int flags); + +/* filelist filter support */ +void repodata_set_filelisttype(Repodata *data, int filelisttype); +int repodata_filelistfilter_matches(Repodata *data, const char *str); +void repodata_free_filelistfilter(Repodata *data); + +/* lookup functions */ +Id repodata_lookup_type(Repodata *data, Id solvid, Id keyname); +Id repodata_lookup_id(Repodata *data, Id solvid, Id keyname); +const char *repodata_lookup_str(Repodata *data, Id solvid, Id keyname); +unsigned long long repodata_lookup_num(Repodata *data, Id solvid, Id keyname, unsigned long long notfound); +int repodata_lookup_void(Repodata *data, Id solvid, Id keyname); +const unsigned char *repodata_lookup_bin_checksum(Repodata *data, Id solvid, Id keyname, Id *typep); +int repodata_lookup_idarray(Repodata *data, Id solvid, Id keyname, Queue *q); +const void *repodata_lookup_binary(Repodata *data, Id solvid, Id keyname, int *lenp); +unsigned int repodata_lookup_count(Repodata *data, Id solvid, Id keyname); /* internal */ + +/* internal, used in fileprovides code */ +const unsigned char *repodata_lookup_packed_dirstrarray(Repodata *data, Id solvid, Id keyname); + +/* internal, fill keyskip array with data */ +Id *repodata_fill_keyskip(Repodata *data, Id solvid, Id *keyskip); + +/*----- + * data assignment functions + */ + +/* + * extend the data so that it contains the specified solvables + * (no longer needed, as the repodata_set functions autoextend) + */ +void repodata_extend(Repodata *data, Id p); +void repodata_extend_block(Repodata *data, Id p, int num); +void repodata_shrink(Repodata *data, int end); + +/* internalize freshly set data, so that it is found by the search + * functions and written out */ +void repodata_internalize(Repodata *data); + +/* create an anonymous handle. useful for substructures like + * fixarray/flexarray */ +Id repodata_new_handle(Repodata *data); + +/* basic types: void, num, string, Id */ +void repodata_set_void(Repodata *data, Id solvid, Id keyname); +void repodata_set_num(Repodata *data, Id solvid, Id keyname, unsigned long long num); +void repodata_set_id(Repodata *data, Id solvid, Id keyname, Id id); +void repodata_set_str(Repodata *data, Id solvid, Id keyname, const char *str); +void repodata_set_binary(Repodata *data, Id solvid, Id keyname, void *buf, int len); +/* create id from string, then set_id */ +void repodata_set_poolstr(Repodata *data, Id solvid, Id keyname, const char *str); + +/* set numeric constant */ +void repodata_set_constant(Repodata *data, Id solvid, Id keyname, unsigned int constant); + +/* set Id constant */ +void repodata_set_constantid(Repodata *data, Id solvid, Id keyname, Id id); + +/* checksum */ +void repodata_set_bin_checksum(Repodata *data, Id solvid, Id keyname, Id type, + const unsigned char *buf); +void repodata_set_checksum(Repodata *data, Id solvid, Id keyname, Id type, + const char *str); +void repodata_set_idarray(Repodata *data, Id solvid, Id keyname, Queue *q); + +/* directory (for package file list) */ +void repodata_add_dirnumnum(Repodata *data, Id solvid, Id keyname, Id dir, Id num, Id num2); +void repodata_add_dirstr(Repodata *data, Id solvid, Id keyname, Id dir, const char *str); +void repodata_free_dircache(Repodata *data); + + +/* arrays */ +void repodata_add_idarray(Repodata *data, Id solvid, Id keyname, Id id); +void repodata_add_poolstr_array(Repodata *data, Id solvid, Id keyname, const char *str); +void repodata_add_fixarray(Repodata *data, Id solvid, Id keyname, Id ghandle); +void repodata_add_flexarray(Repodata *data, Id solvid, Id keyname, Id ghandle); + +/* generic */ +void repodata_set_kv(Repodata *data, Id solvid, Id keyname, Id keytype, struct s_KeyValue *kv); +void repodata_unset(Repodata *data, Id solvid, Id keyname); +void repodata_unset_uninternalized(Repodata *data, Id solvid, Id keyname); + +/* + merge/swap attributes from one solvable to another + works only if the data is not yet internalized +*/ +void repodata_merge_attrs(Repodata *data, Id dest, Id src); +void repodata_merge_some_attrs(Repodata *data, Id dest, Id src, Map *keyidmap, int overwrite); +void repodata_swap_attrs(Repodata *data, Id dest, Id src); + +Repodata *repodata_create_stubs(Repodata *data); + +/* + * load all paged data, used to speed up copying in repo_rpmdb + */ +void repodata_disable_paging(Repodata *data); + +/* helper functions */ +Id repodata_globalize_id(Repodata *data, Id id, int create); +Id repodata_localize_id(Repodata *data, Id id, int create); +Id repodata_translate_id(Repodata *data, Repodata *fromdata, Id id, int create); +Id repodata_translate_dir_slow(Repodata *data, Repodata *fromdata, Id dir, int create, Id *cache); + +Id repodata_str2dir(Repodata *data, const char *dir, int create); +const char *repodata_dir2str(Repodata *data, Id did, const char *suf); +const char *repodata_chk2str(Repodata *data, Id type, const unsigned char *buf); +void repodata_set_location(Repodata *data, Id solvid, int medianr, const char *dir, const char *file); +void repodata_set_deltalocation(Repodata *data, Id handle, int medianr, const char *dir, const char *file); +void repodata_set_sourcepkg(Repodata *data, Id solvid, const char *sourcepkg); + +/* uninternalized data lookup / search */ +Repokey *repodata_lookup_kv_uninternalized(Repodata *data, Id solvid, Id keyname, struct s_KeyValue *kv); +void repodata_search_uninternalized(Repodata *data, Id solvid, Id keyname, int flags, int (*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, struct s_KeyValue *kv), void *cbdata); + +/* stats */ +unsigned int repodata_memused(Repodata *data); + +static inline Id +repodata_translate_dir(Repodata *data, Repodata *fromdata, Id dir, int create, Id *cache) +{ + if (cache && dir && cache[(dir & 255) * 2] == dir) + return cache[(dir & 255) * 2 + 1]; + return repodata_translate_dir_slow(data, fromdata, dir, create, cache); +} + +static inline Id * +repodata_create_dirtranscache(Repodata *data) +{ + return (Id *)solv_calloc(256, sizeof(Id) * 2); +} + +static inline Id * +repodata_free_dirtranscache(Id *cache) +{ + return (Id *)solv_free(cache); +} + + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_REPODATA_H */ diff --git a/data/miniconda3/include/solv/selection.h b/data/miniconda3/include/solv/selection.h new file mode 100644 index 0000000000000000000000000000000000000000..8e60a27b0651838b0b159140565d62b1e97dbe24 --- /dev/null +++ b/data/miniconda3/include/solv/selection.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2012, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * selection.h + * + */ + +#ifndef LIBSOLV_SELECTION_H +#define LIBSOLV_SELECTION_H + +#include "pool.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* what to match */ +#define SELECTION_NAME (1 << 0) +#define SELECTION_PROVIDES (1 << 1) +#define SELECTION_FILELIST (1 << 2) +#define SELECTION_CANON (1 << 3) + +/* match extensions */ +#define SELECTION_DOTARCH (1 << 4) /* allow ".arch" suffix */ +#define SELECTION_REL (1 << 5) /* allow "<=> rel" suffix */ + +/* string comparison modifiers */ +#define SELECTION_GLOB (1 << 9) +#define SELECTION_NOCASE (1 << 11) + +/* extra flags */ +#define SELECTION_FLAT (1 << 10) /* flatten the resulting selection */ +#define SELECTION_SKIP_KIND (1 << 14) /* remove kind: name prefix in SELECTION_NAME matches */ +#define SELECTION_MATCH_DEPSTR (1 << 15) /* match dep2str result */ + +/* package selection */ +#define SELECTION_INSTALLED_ONLY (1 << 8) +#define SELECTION_SOURCE_ONLY (1 << 12) +#define SELECTION_WITH_SOURCE (1 << 13) +#define SELECTION_WITH_DISABLED (1 << 16) +#define SELECTION_WITH_BADARCH (1 << 17) +#define SELECTION_WITH_ALL (SELECTION_WITH_SOURCE | SELECTION_WITH_DISABLED | SELECTION_WITH_BADARCH) + +/* result operator */ +#define SELECTION_REPLACE (0 << 28) +#define SELECTION_ADD (1 << 28) +#define SELECTION_SUBTRACT (2 << 28) +#define SELECTION_FILTER (3 << 28) + + +/* extra SELECTION_FILTER bits */ +#define SELECTION_FILTER_KEEP_IFEMPTY (1 << 30) +#define SELECTION_FILTER_SWAPPED (1 << 31) + +/* internal */ +#define SELECTION_MODEBITS (3 << 28) + +extern int selection_make(Pool *pool, Queue *selection, const char *name, int flags); +extern int selection_make_matchdeps(Pool *pool, Queue *selection, const char *name, int flags, int keyname, int marker); +extern int selection_make_matchdepid(Pool *pool, Queue *selection, Id dep, int flags, int keyname, int marker); +extern int selection_make_matchsolvable(Pool *pool, Queue *selection, Id solvid, int flags, int keyname, int marker); +extern int selection_make_matchsolvablelist(Pool *pool, Queue *selection, Queue *solvidq, int flags, int keyname, int marker); + +extern void selection_filter(Pool *pool, Queue *sel1, Queue *sel2); +extern void selection_add(Pool *pool, Queue *sel1, Queue *sel2); +extern void selection_subtract(Pool *pool, Queue *sel1, Queue *sel2); + +extern void selection_solvables(Pool *pool, Queue *selection, Queue *pkgs); + +extern const char *pool_selection2str(Pool *pool, Queue *selection, Id flagmask); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/data/miniconda3/include/solv/solvable.h b/data/miniconda3/include/solv/solvable.h new file mode 100644 index 0000000000000000000000000000000000000000..4b26661acea507649743c460a75b22259052b741 --- /dev/null +++ b/data/miniconda3/include/solv/solvable.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2007-2012, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * solvable.h + * + * A solvable represents an object with name-epoch:version-release.arch + * and dependencies + */ + +#ifndef LIBSOLV_SOLVABLE_H +#define LIBSOLV_SOLVABLE_H + +#include "pooltypes.h" +#include "queue.h" +#include "bitmap.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct s_Repo; + +typedef struct s_Solvable { + Id name; + Id arch; + Id evr; /* epoch:version-release */ + Id vendor; + + struct s_Repo *repo; /* repo we belong to */ + + /* dependencies are offsets into repo->idarraydata */ + /* the ifdef resolves "requires" conflicting with a C++20 keyword */ +#ifdef LIBSOLV_SOLVABLE_PREPEND_DEP + Offset dep_provides; /* terminated with Id 0 */ + Offset dep_obsoletes; + Offset dep_conflicts; + + Offset dep_requires; + Offset dep_recommends; + Offset dep_suggests; + + Offset dep_supplements; + Offset dep_enhances; +#else + Offset provides; /* terminated with Id 0 */ + Offset obsoletes; + Offset conflicts; + + Offset requires; + Offset recommends; + Offset suggests; + + Offset supplements; + Offset enhances; +#endif +} Solvable; + +/* lookup functions */ +Id solvable_lookup_type(Solvable *s, Id keyname); +Id solvable_lookup_id(Solvable *s, Id keyname); +unsigned long long solvable_lookup_num(Solvable *s, Id keyname, unsigned long long notfound); +unsigned long long solvable_lookup_sizek(Solvable *s, Id keyname, unsigned long long notfound); +const char *solvable_lookup_str(Solvable *s, Id keyname); +const char *solvable_lookup_str_poollang(Solvable *s, Id keyname); +const char *solvable_lookup_str_lang(Solvable *s, Id keyname, const char *lang, int usebase); +int solvable_lookup_bool(Solvable *s, Id keyname); +int solvable_lookup_void(Solvable *s, Id keyname); +const char *solvable_get_location(Solvable *s, unsigned int *medianrp); /* old name */ +const char *solvable_lookup_location(Solvable *s, unsigned int *medianrp); +const char *solvable_lookup_sourcepkg(Solvable *s); +const unsigned char *solvable_lookup_bin_checksum(Solvable *s, Id keyname, Id *typep); +const char *solvable_lookup_checksum(Solvable *s, Id keyname, Id *typep); +int solvable_lookup_idarray(Solvable *s, Id keyname, Queue *q); +int solvable_lookup_deparray(Solvable *s, Id keyname, Queue *q, Id marker); +unsigned int solvable_lookup_count(Solvable *s, Id keyname); /* internal */ + +/* setter functions */ +void solvable_set_id(Solvable *s, Id keyname, Id id); +void solvable_set_num(Solvable *s, Id keyname, unsigned long long num); +void solvable_set_str(Solvable *s, Id keyname, const char *str); +void solvable_set_poolstr(Solvable *s, Id keyname, const char *str); +void solvable_add_poolstr_array(Solvable *s, Id keyname, const char *str); +void solvable_add_idarray(Solvable *s, Id keyname, Id id); +void solvable_add_deparray(Solvable *s, Id keyname, Id dep, Id marker); +void solvable_set_idarray(Solvable *s, Id keyname, Queue *q); +void solvable_set_deparray(Solvable *s, Id keyname, Queue *q, Id marker); +void solvable_unset(Solvable *s, Id keyname); + +int solvable_identical(Solvable *s1, Solvable *s2); +Id solvable_selfprovidedep(Solvable *s); + +int solvable_matchesdep(Solvable *s, Id keyname, Id dep, int marker); +int solvable_matchessolvable(Solvable *s, Id keyname, Id solvid, Queue *depq, int marker); + +/* internal */ +int solvable_matchessolvable_int(Solvable *s, Id keyname, int marker, Id solvid, Map *solvidmap, Queue *depq, Map *missc, int reloff, Queue *outdepq); + + +/* weird suse stuff */ +int solvable_is_irrelevant_patch(Solvable *s, Map *installedmap); +int solvable_trivial_installable_map(Solvable *s, Map *installedmap, Map *conflictsmap, Map *multiversionmap); +int solvable_trivial_installable_queue(Solvable *s, Queue *installed, Map *multiversionmap); +int solvable_trivial_installable_repo(Solvable *s, struct s_Repo *installed, Map *multiversionmap); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_SOLVABLE_H */ diff --git a/data/miniconda3/include/solv/solverdebug.h b/data/miniconda3/include/solv/solverdebug.h new file mode 100644 index 0000000000000000000000000000000000000000..b6923b46d471649b58219e26f526192767536ae9 --- /dev/null +++ b/data/miniconda3/include/solv/solverdebug.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2008, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * solverdebug.h + * + */ + +#ifndef LIBSOLV_SOLVERDEBUG_H +#define LIBSOLV_SOLVERDEBUG_H + +#include "pooltypes.h" +#include "pool.h" +#include "solver.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern void solver_printruleelement(Solver *solv, int type, Rule *r, Id v); +extern void solver_printrule(Solver *solv, int type, Rule *r); +extern void solver_printruleclass(Solver *solv, int type, Rule *r); +extern void solver_printproblem(Solver *solv, Id v); +extern void solver_printwatches(Solver *solv, int type); +extern void solver_printdecisionq(Solver *solv, int type); +extern void solver_printdecisions(Solver *solv); +extern void solver_printproblemruleinfo(Solver *solv, Id rule); +extern void solver_printprobleminfo(Solver *solv, Id problem); +extern void solver_printcompleteprobleminfo(Solver *solv, Id problem); +extern void solver_printsolution(Solver *solv, Id problem, Id solution); +extern void solver_printallsolutions(Solver *solv); + +extern void transaction_print(Transaction *trans); + +/* weird suse stuff */ +extern void solver_printtrivial(Solver *solv); + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_SOLVERDEBUG_H */ + diff --git a/data/miniconda3/include/solv/solvversion.h b/data/miniconda3/include/solv/solvversion.h new file mode 100644 index 0000000000000000000000000000000000000000..f7041fa1cbee65994c4140da423902a082efdf2a --- /dev/null +++ b/data/miniconda3/include/solv/solvversion.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, SUSE LLC + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * solvversion.h + * + */ + +#ifndef LIBSOLV_SOLVVERSION_H +#define LIBSOLV_SOLVVERSION_H + +#define LIBSOLV_VERSION_STRING "0.7.30" +#define LIBSOLV_VERSION_MAJOR 0 +#define LIBSOLV_VERSION_MINOR 7 +#define LIBSOLV_VERSION_PATCH 30 +#define LIBSOLV_VERSION (LIBSOLV_VERSION_MAJOR * 10000 + LIBSOLV_VERSION_MINOR * 100 + LIBSOLV_VERSION_PATCH) + +extern const char solv_version[]; +extern int solv_version_major; +extern int solv_version_minor; +extern int solv_version_patch; +extern const char solv_toolversion[]; + +/* #undef LIBSOLV_FEATURE_LINKED_PKGS */ +/* #undef LIBSOLV_FEATURE_COMPLEX_DEPS */ +#define LIBSOLV_FEATURE_MULTI_SEMANTICS +#define LIBSOLV_FEATURE_CONDA + +#define LIBSOLVEXT_FEATURE_PCRE2 +/* #undef LIBSOLVEXT_FEATURE_RPMPKG */ +/* #undef LIBSOLVEXT_FEATURE_RPMDB */ +/* #undef LIBSOLVEXT_FEATURE_RPMDB_BYRPMHEADER */ +/* #undef LIBSOLVEXT_FEATURE_PUBKEY */ +/* #undef LIBSOLVEXT_FEATURE_RPMMD */ +/* #undef LIBSOLVEXT_FEATURE_SUSEREPO */ +/* #undef LIBSOLVEXT_FEATURE_COMPS */ +/* #undef LIBSOLVEXT_FEATURE_HELIXREPO */ +/* #undef LIBSOLVEXT_FEATURE_DEBIAN */ +/* #undef LIBSOLVEXT_FEATURE_ARCHREPO */ +/* #undef LIBSOLVEXT_FEATURE_HAIKU */ +/* #undef LIBSOLVEXT_FEATURE_APPDATA */ +#define LIBSOLVEXT_FEATURE_ZLIB_COMPRESSION +/* #undef LIBSOLVEXT_FEATURE_LZMA_COMPRESSION */ +/* #undef LIBSOLVEXT_FEATURE_BZIP2_COMPRESSION */ +/* #undef LIBSOLVEXT_FEATURE_ZSTD_COMPRESSION */ +/* #undef LIBSOLVEXT_FEATURE_ZCHUNK_COMPRESSION */ + +/* see tools/common_write.c for toolversion history */ +#define LIBSOLV_TOOLVERSION "1.2" + +#endif diff --git a/data/miniconda3/include/solv/strpool.h b/data/miniconda3/include/solv/strpool.h new file mode 100644 index 0000000000000000000000000000000000000000..fd13bdb71bc0cd98cce86073f94297e0605f57b0 --- /dev/null +++ b/data/miniconda3/include/solv/strpool.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ +#ifndef LIBSOLV_STRINGPOOL_H +#define LIBSOLV_STRINGPOOL_H + +#include "pooltypes.h" +#include "hash.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define STRID_NULL 0 +#define STRID_EMPTY 1 + +struct s_Stringpool +{ + Offset *strings; /* table of offsets into stringspace, indexed by Id: Id -> Offset */ + int nstrings; /* number of ids in strings table */ + char *stringspace; /* space for all unique strings: stringspace + Offset = string */ + Offset sstrings; /* size of used stringspace */ + + Hashtable stringhashtbl; /* hash table: (string ->) Hash -> Id */ + Hashval stringhashmask; /* modulo value for hash table (size of table - 1) */ +}; + +void stringpool_init(Stringpool *ss, const char *strs[]); +void stringpool_init_empty(Stringpool *ss); +void stringpool_clone(Stringpool *ss, Stringpool *from); +void stringpool_free(Stringpool *ss); +void stringpool_freehash(Stringpool *ss); +void stringpool_resize_hash(Stringpool *ss, int numnew); + +Id stringpool_str2id(Stringpool *ss, const char *str, int create); +Id stringpool_strn2id(Stringpool *ss, const char *str, unsigned int len, int create); + +void stringpool_shrink(Stringpool *ss); + + +static inline const char * +stringpool_id2str(Stringpool *ss, Id id) +{ + return ss->stringspace + ss->strings[id]; +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/data/miniconda3/include/solv/tools_util.h b/data/miniconda3/include/solv/tools_util.h new file mode 100644 index 0000000000000000000000000000000000000000..cc6489289e9cf630310eb28579bea7a80b4cfd03 --- /dev/null +++ b/data/miniconda3/include/solv/tools_util.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * util.h + * + */ + +#ifndef LIBSOLV_TOOLS_UTIL_H +#define LIBSOLV_TOOLS_UTIL_H + +static inline Id +makeevr(Pool *pool, const char *s) +{ + if (!strncmp(s, "0:", 2) && s[2]) + s += 2; + return pool_str2id(pool, s, 1); +} + +/** + * split a string + */ +#ifndef DISABLE_SPLIT +static int +split(char *l, char **sp, int m) +{ + int i; + for (i = 0; i < m;) + { + while (*l == ' ') + l++; + if (!*l) + break; + sp[i++] = l; + while (*l && *l != ' ') + l++; + if (!*l) + break; + *l++ = 0; + } + return i; +} +#endif + +#ifndef DISABLE_JOIN2 + +struct joindata { + char *tmp; + int tmpl; +}; + +/* this join does not depend on parsedata */ +static char * +join2(struct joindata *jd, const char *s1, const char *s2, const char *s3) +{ + int l = 1; + char *p; + + if (s1) + l += strlen(s1); + if (s2) + l += strlen(s2); + if (s3) + l += strlen(s3); + if (l > jd->tmpl) + { + jd->tmpl = l + 256; + jd->tmp = solv_realloc(jd->tmp, jd->tmpl); + } + p = jd->tmp; + if (s1) + { + strcpy(p, s1); + p += strlen(s1); + } + if (s2) + { + strcpy(p, s2); + p += strlen(s2); + } + if (s3) + { + strcpy(p, s3); + p += strlen(s3); + } + *p = 0; + return jd->tmp; +} + +static inline char * +join_dup(struct joindata *jd, const char *s) +{ + return s ? join2(jd, s, 0, 0) : 0; +} + +static inline void +join_freemem(struct joindata *jd) +{ + if (jd->tmp) + free(jd->tmp); + jd->tmp = 0; + jd->tmpl = 0; +} + +#endif + +#endif /* LIBSOLV_TOOLS_UTIL_H */ diff --git a/data/miniconda3/include/solv/util.h b/data/miniconda3/include/solv/util.h new file mode 100644 index 0000000000000000000000000000000000000000..9c2b8249755b9ec4bfbb2911d0fc0e41a4c052ab --- /dev/null +++ b/data/miniconda3/include/solv/util.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2007, Novell Inc. + * + * This program is licensed under the BSD license, read LICENSE.BSD + * for further information + */ + +/* + * util.h + * + */ + +#ifndef LIBSOLV_UTIL_H +#define LIBSOLV_UTIL_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * malloc + * exits with error message on error + */ +extern void *solv_malloc(size_t); +extern void *solv_malloc2(size_t, size_t); +extern void *solv_calloc(size_t, size_t); +extern void *solv_realloc(void *, size_t); +extern void *solv_realloc2(void *, size_t, size_t); +extern void *solv_extend_realloc(void *, size_t, size_t, size_t); +extern void *solv_free(void *); +extern char *solv_strdup(const char *); +extern void solv_oom(size_t, size_t); +extern unsigned int solv_timems(unsigned int subtract); +extern int solv_setcloexec(int fd, int state); +extern void solv_sort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *compard); +extern char *solv_dupjoin(const char *str1, const char *str2, const char *str3); +extern char *solv_dupappend(const char *str1, const char *str2, const char *str3); +extern int solv_hex2bin(const char **strp, unsigned char *buf, int bufl); +extern char *solv_bin2hex(const unsigned char *buf, int l, char *str); +extern size_t solv_validutf8(const char *buf); +extern char *solv_latin1toutf8(const char *buf); +extern char *solv_replacebadutf8(const char *buf, int replchar); + + +static inline void *solv_extend(void *buf, size_t len, size_t nmemb, size_t size, size_t block) +{ + if (nmemb == 1) + { + if ((len & block) == 0) + buf = solv_extend_realloc(buf, len + 1, size, block); + } + else + { + if (((len - 1) | block) != ((len + nmemb - 1) | block)) + buf = solv_extend_realloc(buf, len + nmemb, size, block); + } + return buf; +} + +/** + * extend an array by reallocation and zero's the new section + * buf old pointer + * len current size + * nmbemb number of elements to add + * size size of each element + * block block size used to allocate the elements + */ +static inline void *solv_zextend(void *buf, size_t len, size_t nmemb, size_t size, size_t block) +{ + buf = solv_extend(buf, len, nmemb, size, block); + memset((char *)buf + len * size, 0, nmemb * size); + return buf; +} + +static inline void *solv_extend_resize(void *buf, size_t len, size_t size, size_t block) +{ + if (len) + buf = solv_extend_realloc(buf, len, size, block); + return buf; +} + +static inline void *solv_calloc_block(size_t len, size_t size, size_t block) +{ + void *buf; + if (!len) + return 0; + buf = solv_extend_realloc((void *)0, len, size, block); + memset(buf, 0, ((len + block) & ~block) * size); + return buf; +} + +static inline void *solv_memdup(const void *buf, size_t len) +{ + void *newbuf; + if (!buf) + return 0; + newbuf = solv_malloc(len); + if (len) + memcpy(newbuf, buf, len); + return newbuf; +} + +static inline void *solv_memdup2(const void *buf, size_t num, size_t len) +{ + void *newbuf; + if (!buf) + return 0; + newbuf = solv_malloc2(num, len); + if (num) + memcpy(newbuf, buf, num * len); + return newbuf; +} + +#ifdef __cplusplus +} +#endif + +#endif /* LIBSOLV_UTIL_H */ diff --git a/data/miniconda3/include/xkbcommon/xkbcommon-compat.h b/data/miniconda3/include/xkbcommon/xkbcommon-compat.h new file mode 100644 index 0000000000000000000000000000000000000000..907d0301b0fa86d0c5a101dbca0a28d63edf9f80 --- /dev/null +++ b/data/miniconda3/include/xkbcommon/xkbcommon-compat.h @@ -0,0 +1,80 @@ +/* + * Copyright © 2012 Daniel Stone + * SPDX-License-Identifier: MIT + * + * Author: Daniel Stone + */ + +#ifndef _XKBCOMMON_COMPAT_H +#define _XKBCOMMON_COMPAT_H + +/** + * Renamed keymap API. + */ +#define xkb_group_index_t xkb_layout_index_t +#define xkb_group_mask_t xkb_layout_mask_t +#define xkb_map_compile_flags xkb_keymap_compile_flags +#define XKB_GROUP_INVALID XKB_LAYOUT_INVALID + +#define XKB_STATE_DEPRESSED \ + (XKB_STATE_MODS_DEPRESSED | XKB_STATE_LAYOUT_DEPRESSED) +#define XKB_STATE_LATCHED \ + (XKB_STATE_MODS_LATCHED | XKB_STATE_LAYOUT_LATCHED) +#define XKB_STATE_LOCKED \ + (XKB_STATE_MODS_LOCKED | XKB_STATE_LAYOUT_LOCKED) +#define XKB_STATE_EFFECTIVE \ + (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED | XKB_STATE_LOCKED | \ + XKB_STATE_MODS_EFFECTIVE | XKB_STATE_LAYOUT_EFFECTIVE) + +#define xkb_map_new_from_names(context, names, flags) \ + xkb_keymap_new_from_names(context, names, flags) +#define xkb_map_new_from_file(context, file, format, flags) \ + xkb_keymap_new_from_file(context, file, format, flags) +#define xkb_map_new_from_string(context, string, format, flags) \ + xkb_keymap_new_from_string(context, string, format, flags) +#define xkb_map_get_as_string(keymap) \ + xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1) +#define xkb_map_ref(keymap) xkb_keymap_ref(keymap) +#define xkb_map_unref(keymap) xkb_keymap_unref(keymap) + +#define xkb_map_num_mods(keymap) xkb_keymap_num_mods(keymap) +#define xkb_map_mod_get_name(keymap, idx) xkb_keymap_mod_get_name(keymap, idx) +#define xkb_map_mod_get_index(keymap, str) xkb_keymap_mod_get_index(keymap, str) +#define xkb_key_mod_index_is_consumed(state, key, mod) \ + xkb_state_mod_index_is_consumed(state, key, mod) +#define xkb_key_mod_mask_remove_consumed(state, key, modmask) \ + xkb_state_mod_mask_remove_consumed(state, key, modmask) + +#define xkb_map_num_groups(keymap) xkb_keymap_num_layouts(keymap) +#define xkb_key_num_groups(keymap, key) \ + xkb_keymap_num_layouts_for_key(keymap, key) +#define xkb_map_group_get_name(keymap, idx) \ + xkb_keymap_layout_get_name(keymap, idx) +#define xkb_map_group_get_index(keymap, str) \ + xkb_keymap_layout_get_index(keymap, str) + +#define xkb_map_num_leds(keymap) xkb_keymap_num_leds(keymap) +#define xkb_map_led_get_name(keymap, idx) xkb_keymap_led_get_name(keymap, idx) +#define xkb_map_led_get_index(keymap, str) \ + xkb_keymap_led_get_index(keymap, str) + +#define xkb_key_repeats(keymap, key) xkb_keymap_key_repeats(keymap, key) + +#define xkb_key_get_syms(state, key, syms_out) \ + xkb_state_key_get_syms(state, key, syms_out) + +#define xkb_state_group_name_is_active(state, name, type) \ + xkb_state_layout_name_is_active(state, name, type) +#define xkb_state_group_index_is_active(state, idx, type) \ + xkb_state_layout_index_is_active(state, idx, type) + +#define xkb_state_serialize_group(state, component) \ + xkb_state_serialize_layout(state, component) + +#define xkb_state_get_map(state) xkb_state_get_keymap(state) + +/* Not needed anymore, since there's NO_FLAGS. */ +#define XKB_MAP_COMPILE_PLACEHOLDER XKB_KEYMAP_COMPILE_NO_FLAGS +#define XKB_MAP_COMPILE_NO_FLAGS XKB_KEYMAP_COMPILE_NO_FLAGS + +#endif diff --git a/data/miniconda3/include/xkbcommon/xkbcommon-compose.h b/data/miniconda3/include/xkbcommon/xkbcommon-compose.h new file mode 100644 index 0000000000000000000000000000000000000000..a65a1e51453b225a458949e57a4487258d138b7d --- /dev/null +++ b/data/miniconda3/include/xkbcommon/xkbcommon-compose.h @@ -0,0 +1,617 @@ +/* + * Copyright © 2013 Ran Benita + * SPDX-License-Identifier: MIT + */ + +#ifndef _XKBCOMMON_COMPOSE_H +#define _XKBCOMMON_COMPOSE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file + * libxkbcommon Compose API - support for Compose and dead-keys. + */ + +/** + * @defgroup compose Compose and dead-keys support + * Support for Compose and dead-keys. + * @since 0.5.0 + * + * @{ + */ + +/** + * @page compose-overview Overview + * @parblock + * + * Compose and dead-keys are a common feature of many keyboard input + * systems. They extend the range of the keysyms that can be produced + * directly from a keyboard by using a sequence of key strokes, instead + * of just one. + * + * Here are some example sequences, in the libX11 Compose file format: + * + * : "á" aacute # LATIN SMALL LETTER A WITH ACUTE + * : "@" at # COMMERCIAL AT + * + * When the user presses a key which produces the `` keysym, + * nothing initially happens (thus the key is dubbed a *dead-key*). But + * when the user enters ``, “á” is *composed*, in place of “a”. If + * instead the user had entered a keysym which does not follow + * `` in any compose sequence, the sequence is said to be + * *cancelled*. + * + * Compose files define many such sequences. For a description of the + * common file format for Compose files, see the `Compose(5)` man page. + * + * A successfully-composed sequence has two results: a keysym and a UTF-8 + * string. At least one of the two is defined for each sequence. If only + * a keysym is given, the keysym’s string representation is used for the + * result string (using xkb_keysym_to_utf8()). + * + * This library provides low-level support for Compose file parsing and + * processing. Higher-level APIs (such as libX11’s `Xutf8LookupString(3)`) + * may be built upon it, or it can be used directly. + * + * @endparblock + */ + +/** + * @page compose-conflicting Conflicting Sequences + * @parblock + * + * To avoid ambiguity, a sequence is not allowed to be a prefix of another. + * When such a conflict occurs, the sequence defined last is the one retained. + * + * Sequences of length 1 are allowed. + * + * @endparblock + */ + +/** + * @page compose-cancellation Cancellation Behavior + * @parblock + * + * What should happen when a sequence is cancelled? For example, consider + * there are only the above sequences, and the input keysyms are + * ` `. There are a few approaches: + * + * 1. Swallow the cancelling keysym; that is, no keysym is produced. + * This is the approach taken by libX11. + * 2. Let the cancelling keysym through; that is, `` is produced. + * 3. Replay the entire sequence; that is, ` ` is produced. + * This is the approach taken by Microsoft Windows (approximately; + * instead of ``, the underlying key is used. This is + * difficult to simulate with XKB keymaps). + * + * You can program whichever approach best fits users' expectations. + * + * @endparblock + */ + +/** + * @struct xkb_compose_table + * Opaque Compose table object. + * + * The compose table holds the definitions of the Compose sequences, as + * gathered from Compose files. It is immutable. + */ +struct xkb_compose_table; + +/** + * @struct xkb_compose_state + * Opaque Compose state object. + * + * The compose state maintains state for compose sequence matching, such + * as which possible sequences are being matched, and the position within + * these sequences. It acts as a simple state machine wherein keysyms are + * the input, and composed keysyms and strings are the output. + * + * The compose state is usually associated with a keyboard device. + */ +struct xkb_compose_state; + +/** Flags affecting Compose file compilation. */ +enum xkb_compose_compile_flags { + /** Do not apply any flags. */ + XKB_COMPOSE_COMPILE_NO_FLAGS = 0 +}; + +/** The recognized Compose file formats. */ +enum xkb_compose_format { + /** The classic libX11 Compose text format, described in Compose(5). */ + XKB_COMPOSE_FORMAT_TEXT_V1 = 1 +}; + +/** + * @page compose-locale Compose Locale + * @parblock + * + * Compose files are locale dependent: + * - Compose files are written for a locale, and the locale is used when + * searching for the appropriate file to use. + * - Compose files may reference the locale internally, with directives + * such as `%%L`. + * + * As such, functions like `xkb_compose_table::xkb_compose_table_new_from_locale()` + * require a `locale` parameter. This will usually be the current locale (see + * `locale(7)` for more details). You may also want to allow the user to + * explicitly configure it, so he can use the Compose file of a given + * locale, but not use that locale for other things. + * + * You may query the current locale as follows: + * + * ```c + * const char *locale; + * locale = setlocale(LC_CTYPE, NULL); + * ``` + * + * This will only give useful results if the program had previously set + * the current locale using setlocale(3), with `LC_CTYPE` or `LC_ALL` + * and a non-`NULL` argument. + * + * If you prefer not to use the locale system of the C runtime library, + * you may nevertheless obtain the user’s locale directly using + * environment variables, as described in `locale(7)`. For example, + * + * ```c + * const char *locale; + * locale = getenv("LC_ALL"); + * if (!locale || !*locale) + * locale = getenv("LC_CTYPE"); + * if (!locale || !*locale) + * locale = getenv("LANG"); + * if (!locale || !*locale) + * locale = "C"; + * ``` + * + * Note that some locales supported by the C standard library may not + * have a Compose file assigned. + * + * @endparblock + */ + +/** + * Create a compose table for a given locale. + * + * The locale is used for searching the file-system for an appropriate + * Compose file. The search order is described in Compose(5). It is + * affected by the following environment variables: + * + * 1. `XCOMPOSEFILE` - see Compose(5). + * 2. `XDG_CONFIG_HOME` - before `$HOME/.XCompose` is checked, + * `$XDG_CONFIG_HOME/XCompose` is checked (with a fall back to + * `$HOME/.config/XCompose` if `XDG_CONFIG_HOME` is not defined). + * This is a libxkbcommon extension to the search procedure in + * Compose(5) (since libxkbcommon 1.0.0). Note that other + * implementations, such as libX11, might not find a Compose file in + * this path. + * 3. `HOME` - see Compose(5). + * 4. `XLOCALEDIR` - if set, used as the base directory for the system’s + * X locale files, e.g. `/usr/share/X11/locale`, instead of the + * preconfigured directory. + * + * @param context + * The library context in which to create the compose table. + * @param locale + * The current locale. See @ref compose-locale. + * \n + * The value is copied, so it is safe to pass the result of `getenv(3)` + * (or similar) without fear of it being invalidated by a subsequent + * `setenv(3)` (or similar). + * @param flags + * Optional flags for the compose table, or 0. + * + * @returns A compose table for the given locale, or `NULL` if the + * compilation failed or a Compose file was not found. + * + * @memberof xkb_compose_table + */ +XKB_EXPORT struct xkb_compose_table * +xkb_compose_table_new_from_locale(struct xkb_context *context, + const char *locale, + enum xkb_compose_compile_flags flags); + +/** + * Create a new compose table from a Compose file. + * + * @param context + * The library context in which to create the compose table. + * @param file + * The Compose file to compile. + * @param locale + * The current locale. See @ref compose-locale. + * @param format + * The text format of the Compose file to compile. + * @param flags + * Optional flags for the compose table, or 0. + * + * @returns A compose table compiled from the given file, or `NULL` if + * the compilation failed. + * + * @memberof xkb_compose_table + */ +XKB_EXPORT struct xkb_compose_table * +xkb_compose_table_new_from_file(struct xkb_context *context, + FILE *file, + const char *locale, + enum xkb_compose_format format, + enum xkb_compose_compile_flags flags); + +/** + * Create a new compose table from a memory buffer. + * + * This is just like xkb_compose_table_new_from_file(), but instead of + * a file, gets the table as one enormous string. + * + * @see xkb_compose_table_new_from_file() + * @memberof xkb_compose_table + */ +XKB_EXPORT struct xkb_compose_table * +xkb_compose_table_new_from_buffer(struct xkb_context *context, + const char *buffer, size_t length, + const char *locale, + enum xkb_compose_format format, + enum xkb_compose_compile_flags flags); + +/** + * Take a new reference on a compose table. + * + * @returns The passed in object. + * + * @memberof xkb_compose_table + */ +XKB_EXPORT struct xkb_compose_table * +xkb_compose_table_ref(struct xkb_compose_table *table); + +/** + * Release a reference on a compose table, and possibly free it. + * + * @param table The object. If it is `NULL`, this function does nothing. + * + * @memberof xkb_compose_table + */ +XKB_EXPORT void +xkb_compose_table_unref(struct xkb_compose_table *table); + +/** + * @struct xkb_compose_table_entry + * Opaque Compose table entry object. + * + * Represents a single entry in a Compose file in the iteration API. + * It is immutable. + * + * @sa xkb_compose_table_iterator_new + * @since 1.6.0 + */ +struct xkb_compose_table_entry; + +/** + * Get the left-hand keysym sequence of a Compose table entry. + * + * For example, given the following entry: + * + * ``` + * : "~" asciitilde # TILDE + * ``` + * + * it will return `{XKB_KEY_dead_tilde, XKB_KEY_space}`. + * + * @param[in] entry The compose table entry object to process. + * + * @param[out] sequence_length Number of keysyms in the sequence. + * + * @returns The array of left-hand side keysyms. The number of keysyms + * is returned in the @p sequence_length out-parameter. + * + * @memberof xkb_compose_table_entry + * @since 1.6.0 + */ +XKB_EXPORT const xkb_keysym_t * +xkb_compose_table_entry_sequence(struct xkb_compose_table_entry *entry, + size_t *sequence_length); + +/** + * Get the right-hand result keysym of a Compose table entry. + * + * For example, given the following entry: + * + * ``` + * : "~" asciitilde # TILDE + * ``` + * + * it will return `XKB_KEY_asciitilde`. + * + * The keysym is optional; if the entry does not specify a keysym, + * returns `XKB_KEY_NoSymbol`. + * + * @memberof xkb_compose_table_entry + * @since 1.6.0 + */ +XKB_EXPORT xkb_keysym_t +xkb_compose_table_entry_keysym(struct xkb_compose_table_entry *entry); + +/** + * Get the right-hand result string of a Compose table entry. + * + * The string is UTF-8 encoded and `NULL`-terminated. + * + * For example, given the following entry: + * + * ``` + * : "~" asciitilde # TILDE + * ``` + * + * it will return `"~"`. + * + * The string is optional; if the entry does not specify a string, + * returns the empty string. + * + * @memberof xkb_compose_table_entry + * @since 1.6.0 + */ +XKB_EXPORT const char * +xkb_compose_table_entry_utf8(struct xkb_compose_table_entry *entry); + +/** + * @struct xkb_compose_table_iterator + * Iterator over a compose table’s entries. + * + * @sa xkb_compose_table_iterator_new() + * @since 1.6.0 + */ +struct xkb_compose_table_iterator; + +/** + * Create a new iterator for a compose table. + * + * Intended use: + * + * ```c + * struct xkb_compose_table_iterator *iter = xkb_compose_table_iterator_new(compose_table); + * struct xkb_compose_table_entry *entry; + * while ((entry = xkb_compose_table_iterator_next(iter))) { + * // ... + * } + * xkb_compose_table_iterator_free(iter); + * ``` + * + * @returns A new compose table iterator, or `NULL` on failure. + * + * @memberof xkb_compose_table_iterator + * @sa xkb_compose_table_iterator_free() + * @since 1.6.0 + */ +XKB_EXPORT struct xkb_compose_table_iterator * +xkb_compose_table_iterator_new(struct xkb_compose_table *table); + +/** + * Free a compose iterator. + * + * @memberof xkb_compose_table_iterator + * @since 1.6.0 + */ +XKB_EXPORT void +xkb_compose_table_iterator_free(struct xkb_compose_table_iterator *iter); + +/** + * Get the next compose entry from a compose table iterator. + * + * The entries are returned in lexicographic order of the left-hand + * side of entries. This does not correspond to the order in which + * the entries appear in the Compose file. + * + * @attention The return value is valid until the next call to this function. + * + * Returns `NULL` in case there is no more entries. + * + * @memberof xkb_compose_table_iterator + * @since 1.6.0 + */ +XKB_EXPORT struct xkb_compose_table_entry * +xkb_compose_table_iterator_next(struct xkb_compose_table_iterator *iter); + +/** Flags for compose state creation. */ +enum xkb_compose_state_flags { + /** Do not apply any flags. */ + XKB_COMPOSE_STATE_NO_FLAGS = 0 +}; + +/** + * Create a new compose state object. + * + * @param table + * The compose table the state will use. + * @param flags + * Optional flags for the compose state, or 0. + * + * @returns A new compose state, or `NULL` on failure. + * + * @memberof xkb_compose_state + */ +XKB_EXPORT struct xkb_compose_state * +xkb_compose_state_new(struct xkb_compose_table *table, + enum xkb_compose_state_flags flags); + +/** + * Take a new reference on a compose state object. + * + * @returns The passed in object. + * + * @memberof xkb_compose_state + */ +XKB_EXPORT struct xkb_compose_state * +xkb_compose_state_ref(struct xkb_compose_state *state); + +/** + * Release a reference on a compose state object, and possibly free it. + * + * @param state The object. If `NULL`, do nothing. + * + * @memberof xkb_compose_state + */ +XKB_EXPORT void +xkb_compose_state_unref(struct xkb_compose_state *state); + +/** + * Get the compose table which a compose state object is using. + * + * @returns The compose table which was passed to xkb_compose_state_new() + * when creating this state object. + * + * This function does not take a new reference on the compose table; you + * must explicitly reference it yourself if you plan to use it beyond the + * lifetime of the state. + * + * @memberof xkb_compose_state + */ +XKB_EXPORT struct xkb_compose_table * +xkb_compose_state_get_compose_table(struct xkb_compose_state *state); + +/** Status of the Compose sequence state machine. */ +enum xkb_compose_status { + /** The initial state; no sequence has started yet. */ + XKB_COMPOSE_NOTHING, + /** In the middle of a sequence. */ + XKB_COMPOSE_COMPOSING, + /** A complete sequence has been matched. */ + XKB_COMPOSE_COMPOSED, + /** The last sequence was cancelled due to an unmatched keysym. */ + XKB_COMPOSE_CANCELLED +}; + +/** The effect of a keysym fed to xkb_compose_state_feed(). */ +enum xkb_compose_feed_result { + /** The keysym had no effect - it did not affect the status. */ + XKB_COMPOSE_FEED_IGNORED, + /** The keysym started, advanced or cancelled a sequence. */ + XKB_COMPOSE_FEED_ACCEPTED +}; + +/** + * Feed one keysym to the Compose sequence state machine. + * + * This function can advance into a compose sequence, cancel a sequence, + * start a new sequence, or do nothing in particular. The resulting + * status may be observed with `xkb_compose_state_get_status()`. + * + * Some keysyms, such as keysyms for modifier keys, are ignored - they + * have no effect on the status or otherwise. + * + * The following is a description of the possible status transitions, in + * the format CURRENT STATUS => NEXT STATUS, given a non-ignored input + * keysym `keysym`: + * + @verbatim + NOTHING or CANCELLED or COMPOSED => + NOTHING if keysym does not start a sequence. + COMPOSING if keysym starts a sequence. + COMPOSED if keysym starts and terminates a single-keysym sequence. + + COMPOSING => + COMPOSING if keysym advances any of the currently possible + sequences but does not terminate any of them. + COMPOSED if keysym terminates one of the currently possible + sequences. + CANCELLED if keysym does not advance any of the currently + possible sequences. + @endverbatim + * + * The current Compose formats do not support multiple-keysyms. Therefore, if + * you are using a function such as `xkb_state::xkb_state_key_get_syms()` + * and it returns more than one keysym, consider feeding `XKB_KEY_NoSymbol` + * instead. + * + * @param state + * The compose state object. + * @param keysym + * A keysym, usually obtained after a key-press event, with a + * function such as `xkb_state::xkb_state_key_get_one_sym()`. + * + * @returns Whether the keysym was ignored. This is useful, for example, + * if you want to keep a record of the sequence matched thus far. + * + * @memberof xkb_compose_state + */ +XKB_EXPORT enum xkb_compose_feed_result +xkb_compose_state_feed(struct xkb_compose_state *state, + xkb_keysym_t keysym); + +/** + * Reset the Compose sequence state machine. + * + * The status is set to `::XKB_COMPOSE_NOTHING`, and the current sequence + * is discarded. + * + * @memberof xkb_compose_state + */ +XKB_EXPORT void +xkb_compose_state_reset(struct xkb_compose_state *state); + +/** + * Get the current status of the compose state machine. + * + * @see xkb_compose_status + * @memberof xkb_compose_state + **/ +XKB_EXPORT enum xkb_compose_status +xkb_compose_state_get_status(struct xkb_compose_state *state); + +/** + * Get the result Unicode/UTF-8 string for a composed sequence. + * + * See @ref compose-overview for more details. This function is only + * useful when the status is `::XKB_COMPOSE_COMPOSED`. + * + * @param[in] state + * The compose state. + * @param[out] buffer + * A buffer to write the string into. + * @param[in] size + * Size of the buffer. + * + * @warning If the buffer passed is too small, the string is truncated + * (though still `NULL`-terminated). + * + * @returns + * The number of bytes required for the string, excluding the `NULL` byte. + * If the sequence is not complete, or does not have a viable result + * string, returns 0, and sets `buffer` to the empty string (if possible). + * @returns + * You may check if truncation has occurred by comparing the return value + * with the size of `buffer`, similarly to the `snprintf(3)` function. + * You may safely pass `NULL` and 0 to `buffer` and `size` to find the + * required size (without the `NULL`-byte). + * + * @memberof xkb_compose_state + **/ +XKB_EXPORT int +xkb_compose_state_get_utf8(struct xkb_compose_state *state, + char *buffer, size_t size); + +/** + * Get the result keysym for a composed sequence. + * + * See @ref compose-overview for more details. This function is only + * useful when the status is `::XKB_COMPOSE_COMPOSED`. + * + * @returns The result keysym. If the sequence is not complete, or does + * not specify a result keysym, returns `XKB_KEY_NoSymbol`. + * + * @memberof xkb_compose_state + **/ +XKB_EXPORT xkb_keysym_t +xkb_compose_state_get_one_sym(struct xkb_compose_state *state); + +/** @} */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _XKBCOMMON_COMPOSE_H */ diff --git a/data/miniconda3/include/xkbcommon/xkbcommon-keysyms.h b/data/miniconda3/include/xkbcommon/xkbcommon-keysyms.h new file mode 100644 index 0000000000000000000000000000000000000000..258feb792bfd9840b625833ea4d0c8ae918ee7b2 --- /dev/null +++ b/data/miniconda3/include/xkbcommon/xkbcommon-keysyms.h @@ -0,0 +1,3434 @@ +#ifndef _XKBCOMMON_KEYSYMS_H +#define _XKBCOMMON_KEYSYMS_H + +/* This file is autogenerated; please do not commit directly. */ + +/** + * @file + * Key symbols (keysyms) definitions. + */ + +#define XKB_KEY_NoSymbol 0x000000 /* Special KeySym */ + +/*********************************************************** +Copyright 1987, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +/* + * The "X11 Window System Protocol" standard defines in Appendix A the + * keysym codes. These 29-bit integer values identify characters or + * functions associated with each key (e.g., via the visible + * engraving) of a keyboard layout. This file assigns mnemonic macro + * names for these keysyms. + * + * This file is also compiled (by src/util/makekeys.c in libX11) into + * hash tables that can be accessed with X11 library functions such as + * XStringToKeysym() and XKeysymToString(). + * + * Where a keysym corresponds one-to-one to an ISO 10646 / Unicode + * character, this is noted in a comment that provides both the U+xxxx + * Unicode position, as well as the official Unicode name of the + * character. + * + * Some keysyms map to a character already mapped by another keysym, + * with compatible but more precise semantics, such as the keypad- + * related keysyms. In this case, none of the keysym are deprecated. + * The most generic keysym is annotated as previously and more specific + * keysyms have the same annotation between angle brackets: + * + * #define XKB_KEY_space 0x0020 // U+0020 SPACE + * #define XKB_KEY_KP_Space 0xff80 // + * + * Where the correspondence is either not one-to-one or semantically + * unclear, the Unicode position and name are enclosed in + * parentheses. Such legacy keysyms should be considered deprecated + * and are not recommended for use in future keyboard mappings. + * + * For any future extension of the keysyms with characters already + * found in ISO 10646 / Unicode, the following algorithm shall be + * used. The new keysym code position will simply be the character's + * Unicode number plus 0x01000000. The keysym values in the range + * 0x01000100 to 0x0110ffff are reserved to represent Unicode + * characters in the range U+0100 to U+10FFFF. + * + * While most newer Unicode-based X11 clients do already accept + * Unicode-mapped keysyms in the range 0x01000100 to 0x0110ffff, it + * will remain necessary for clients -- in the interest of + * compatibility with existing servers -- to also understand the + * existing legacy keysym values in the range 0x0100 to 0x20ff. + * + * Where several mnemonic names are defined for the same keysym in this + * file, the first one listed is considered the "canonical" name. This + * is the name that should be used when retrieving a keysym name from + * its code. The next names are considered "aliases" to the canonical + * name. + * + * Aliases are made explicit by writing in their comment "alias for", + * followed by the corresponding canonical name. Example: + * + * #define XKB_KEY_dead_tilde 0xfe53 + * #define XKB_KEY_dead_perispomeni 0xfe53 // alias for dead_tilde + * + * The rules to consider a keysym mnemonic name deprecated are: + * + * 1. A legacy keysym with its Unicode mapping in parentheses is + * deprecated (see above). + * + * 2. A keysym name is *explicitly* deprecated by starting its comment + * with "deprecated". Examples: + * + * #define XKB_KEY_L1 0xffc8 // deprecated alias for F11 + * #define XKB_KEY_quoteleft 0x0060 // deprecated + * + * 3. A keysym name is *explicitly* *not* deprecated by starting its + * comment with "non-deprecated alias". Examples: + * + * #define XKB_KEY_dead_tilde 0xfe53 + * #define XKB_KEY_dead_perispomeni 0xfe53 // non-deprecated alias for dead_tilde + * + * 4. If none of the previous rules apply, an alias is *implicitly* + * deprecated if there is at least one previous name for the + * corresponding keysym that is *not* explicitly deprecated. + * + * Examples: + * + * // SingleCandidate is the canonical name + * #define XKB_KEY_SingleCandidate 0xff3c + * // Hangul_SingleCandidate is deprecated because it is an alias + * // and it does not start with "non-deprecated alias" + * #define XKB_KEY_Hangul_SingleCandidate 0xff3c // Single candidate + * + * // guillemotleft is the canonical name, but it is deprecated + * #define XKB_KEY_guillemotleft 0x00ab // deprecated alias for guillemetleft (misspelling) + * // guillemetleft is not deprecated, because the keysym has no endorsed name before it. + * #define XKB_KEY_guillemetleft 0x00ab // U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + * // The following hypothetical name is deprecated because guillemetleft come before. + * #define XKB_KEY_guillemetleft2 0x00ab + * + * Mnemonic names for keysyms are defined in this file with lines + * that match one of these Perl regular expressions: + * + * /^\#define XKB_KEY_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\* U\+([0-9A-F]{4,6}) (.*) \*\/\s*$/ + * /^\#define XKB_KEY_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\*\*\/\s*$/ + * /^\#define XKB_KEY_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\*\(U\+([0-9A-F]{4,6}) (.*)\)\*\/\s*$/ + * /^\#define XKB_KEY_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/ + * + * Before adding new keysyms, please do consider the following: In + * addition to the keysym names defined in this file, the + * XStringToKeysym() and XKeysymToString() functions will also handle + * any keysym string of the form "U0020" to "U007E" and "U00A0" to + * "U10FFFF" for all possible Unicode characters. In other words, + * every possible Unicode character has already a keysym string + * defined algorithmically, even if it is not listed here. Therefore, + * defining an additional keysym macro is only necessary where a + * non-hexadecimal mnemonic name is needed, or where the new keysym + * does not represent any existing Unicode character. + * + * When adding new keysyms to this file, do not forget to also update the + * following as needed: + * + * - the mappings in src/KeyBind.c in the libX11 repo + * https://gitlab.freedesktop.org/xorg/lib/libx11 + * + * - the protocol specification in specs/keysyms.xml in this repo + * https://gitlab.freedesktop.org/xorg/proto/xorgproto + * + * Before removing or changing the order of the keysyms, please consider + * the following: it is very difficult to know what keysyms are used and + * how. + * + * - A sandboxed application may have incompatibilities with the host + * system. For example, if new keysym name is introduced and is made + * the canonical name, then an application with an older keysym parser + * will not be able to parse the new name. + * - Customization of keyboard layout and Compose files are two popular + * use cases. Checking the standard keyboard layout database xkeyboard-config + * https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config + * and the standard Compose files in libx11 + * https://gitlab.freedesktop.org/xorg/lib/libx11 is a mandatory + * step, but may *not* be enough for a proper impact assessment for + * e.g. keysyms removals. + * + * Therefore, it is advised to proceed to no removal and to make a new + * name canonical only 10 years after its introduction. This means that + * some keysyms may have their first listed name deprecated during the + * period of transition. Once this period is over, the deprecated name + * should be moved after the new canonical name. + */ + +#define XKB_KEY_VoidSymbol 0xffffff /* Void symbol */ + +/* + * TTY function keys, cleverly chosen to map to ASCII, for convenience of + * programming, but could have been arbitrary (at the cost of lookup + * tables in client code). + */ + +#define XKB_KEY_BackSpace 0xff08 /* U+0008 BACKSPACE */ +#define XKB_KEY_Tab 0xff09 /* U+0009 CHARACTER TABULATION */ +#define XKB_KEY_Linefeed 0xff0a /* U+000A LINE FEED */ +#define XKB_KEY_Clear 0xff0b /* U+000B LINE TABULATION */ +#define XKB_KEY_Return 0xff0d /* U+000D CARRIAGE RETURN */ +#define XKB_KEY_Pause 0xff13 /* Pause, hold */ +#define XKB_KEY_Scroll_Lock 0xff14 +#define XKB_KEY_Sys_Req 0xff15 +#define XKB_KEY_Escape 0xff1b /* U+001B ESCAPE */ +#define XKB_KEY_Delete 0xffff /* U+007F DELETE */ + + + +/* International & multi-key character composition */ + +#define XKB_KEY_Multi_key 0xff20 /* Multi-key character compose */ +#define XKB_KEY_Codeinput 0xff37 +#define XKB_KEY_SingleCandidate 0xff3c +#define XKB_KEY_MultipleCandidate 0xff3d +#define XKB_KEY_PreviousCandidate 0xff3e + +/* Japanese keyboard support */ + +#define XKB_KEY_Kanji 0xff21 /* Kanji, Kanji convert */ +#define XKB_KEY_Muhenkan 0xff22 /* Cancel Conversion */ +#define XKB_KEY_Henkan_Mode 0xff23 /* Start/Stop Conversion */ +#define XKB_KEY_Henkan 0xff23 /* non-deprecated alias for Henkan_Mode */ +#define XKB_KEY_Romaji 0xff24 /* to Romaji */ +#define XKB_KEY_Hiragana 0xff25 /* to Hiragana */ +#define XKB_KEY_Katakana 0xff26 /* to Katakana */ +#define XKB_KEY_Hiragana_Katakana 0xff27 /* Hiragana/Katakana toggle */ +#define XKB_KEY_Zenkaku 0xff28 /* to Zenkaku */ +#define XKB_KEY_Hankaku 0xff29 /* to Hankaku */ +#define XKB_KEY_Zenkaku_Hankaku 0xff2a /* Zenkaku/Hankaku toggle */ +#define XKB_KEY_Touroku 0xff2b /* Add to Dictionary */ +#define XKB_KEY_Massyo 0xff2c /* Delete from Dictionary */ +#define XKB_KEY_Kana_Lock 0xff2d /* Kana Lock */ +#define XKB_KEY_Kana_Shift 0xff2e /* Kana Shift */ +#define XKB_KEY_Eisu_Shift 0xff2f /* Alphanumeric Shift */ +#define XKB_KEY_Eisu_toggle 0xff30 /* Alphanumeric toggle */ +#define XKB_KEY_Kanji_Bangou 0xff37 /* Codeinput */ +#define XKB_KEY_Zen_Koho 0xff3d /* Multiple/All Candidate(s) */ +#define XKB_KEY_Mae_Koho 0xff3e /* Previous Candidate */ + +/* 0xff31 thru 0xff3f are under XK_KOREAN */ + +/* Cursor control & motion */ + +#define XKB_KEY_Home 0xff50 +#define XKB_KEY_Left 0xff51 /* Move left, left arrow */ +#define XKB_KEY_Up 0xff52 /* Move up, up arrow */ +#define XKB_KEY_Right 0xff53 /* Move right, right arrow */ +#define XKB_KEY_Down 0xff54 /* Move down, down arrow */ +#define XKB_KEY_Prior 0xff55 /* Prior, previous */ +#define XKB_KEY_Page_Up 0xff55 /* deprecated alias for Prior */ +#define XKB_KEY_Next 0xff56 /* Next */ +#define XKB_KEY_Page_Down 0xff56 /* deprecated alias for Next */ +#define XKB_KEY_End 0xff57 /* EOL */ +#define XKB_KEY_Begin 0xff58 /* BOL */ + + +/* Misc functions */ + +#define XKB_KEY_Select 0xff60 /* Select, mark */ +#define XKB_KEY_Print 0xff61 +#define XKB_KEY_Execute 0xff62 /* Execute, run, do */ +#define XKB_KEY_Insert 0xff63 /* Insert, insert here */ +#define XKB_KEY_Undo 0xff65 +#define XKB_KEY_Redo 0xff66 /* Redo, again */ +#define XKB_KEY_Menu 0xff67 +#define XKB_KEY_Find 0xff68 /* Find, search */ +#define XKB_KEY_Cancel 0xff69 /* Cancel, stop, abort, exit */ +#define XKB_KEY_Help 0xff6a /* Help */ +#define XKB_KEY_Break 0xff6b +#define XKB_KEY_Mode_switch 0xff7e /* Character set switch */ +#define XKB_KEY_script_switch 0xff7e /* non-deprecated alias for Mode_switch */ +#define XKB_KEY_Num_Lock 0xff7f + +/* Keypad functions, keypad numbers cleverly chosen to map to ASCII */ + +#define XKB_KEY_KP_Space 0xff80 /**/ +#define XKB_KEY_KP_Tab 0xff89 /**/ +#define XKB_KEY_KP_Enter 0xff8d /**/ +#define XKB_KEY_KP_F1 0xff91 /* PF1, KP_A, ... */ +#define XKB_KEY_KP_F2 0xff92 +#define XKB_KEY_KP_F3 0xff93 +#define XKB_KEY_KP_F4 0xff94 +#define XKB_KEY_KP_Home 0xff95 +#define XKB_KEY_KP_Left 0xff96 +#define XKB_KEY_KP_Up 0xff97 +#define XKB_KEY_KP_Right 0xff98 +#define XKB_KEY_KP_Down 0xff99 +#define XKB_KEY_KP_Prior 0xff9a +#define XKB_KEY_KP_Page_Up 0xff9a /* deprecated alias for KP_Prior */ +#define XKB_KEY_KP_Next 0xff9b +#define XKB_KEY_KP_Page_Down 0xff9b /* deprecated alias for KP_Next */ +#define XKB_KEY_KP_End 0xff9c +#define XKB_KEY_KP_Begin 0xff9d +#define XKB_KEY_KP_Insert 0xff9e +#define XKB_KEY_KP_Delete 0xff9f +#define XKB_KEY_KP_Equal 0xffbd /**/ +#define XKB_KEY_KP_Multiply 0xffaa /**/ +#define XKB_KEY_KP_Add 0xffab /**/ +#define XKB_KEY_KP_Separator 0xffac /**/ +#define XKB_KEY_KP_Subtract 0xffad /**/ +#define XKB_KEY_KP_Decimal 0xffae /**/ +#define XKB_KEY_KP_Divide 0xffaf /**/ + +#define XKB_KEY_KP_0 0xffb0 /**/ +#define XKB_KEY_KP_1 0xffb1 /**/ +#define XKB_KEY_KP_2 0xffb2 /**/ +#define XKB_KEY_KP_3 0xffb3 /**/ +#define XKB_KEY_KP_4 0xffb4 /**/ +#define XKB_KEY_KP_5 0xffb5 /**/ +#define XKB_KEY_KP_6 0xffb6 /**/ +#define XKB_KEY_KP_7 0xffb7 /**/ +#define XKB_KEY_KP_8 0xffb8 /**/ +#define XKB_KEY_KP_9 0xffb9 /**/ + + + +/* + * Auxiliary functions; note the duplicate definitions for left and right + * function keys; Sun keyboards and a few other manufacturers have such + * function key groups on the left and/or right sides of the keyboard. + * We've not found a keyboard with more than 35 function keys total. + */ + +#define XKB_KEY_F1 0xffbe +#define XKB_KEY_F2 0xffbf +#define XKB_KEY_F3 0xffc0 +#define XKB_KEY_F4 0xffc1 +#define XKB_KEY_F5 0xffc2 +#define XKB_KEY_F6 0xffc3 +#define XKB_KEY_F7 0xffc4 +#define XKB_KEY_F8 0xffc5 +#define XKB_KEY_F9 0xffc6 +#define XKB_KEY_F10 0xffc7 +#define XKB_KEY_F11 0xffc8 +#define XKB_KEY_L1 0xffc8 /* deprecated alias for F11 */ +#define XKB_KEY_F12 0xffc9 +#define XKB_KEY_L2 0xffc9 /* deprecated alias for F12 */ +#define XKB_KEY_F13 0xffca +#define XKB_KEY_L3 0xffca /* deprecated alias for F13 */ +#define XKB_KEY_F14 0xffcb +#define XKB_KEY_L4 0xffcb /* deprecated alias for F14 */ +#define XKB_KEY_F15 0xffcc +#define XKB_KEY_L5 0xffcc /* deprecated alias for F15 */ +#define XKB_KEY_F16 0xffcd +#define XKB_KEY_L6 0xffcd /* deprecated alias for F16 */ +#define XKB_KEY_F17 0xffce +#define XKB_KEY_L7 0xffce /* deprecated alias for F17 */ +#define XKB_KEY_F18 0xffcf +#define XKB_KEY_L8 0xffcf /* deprecated alias for F18 */ +#define XKB_KEY_F19 0xffd0 +#define XKB_KEY_L9 0xffd0 /* deprecated alias for F19 */ +#define XKB_KEY_F20 0xffd1 +#define XKB_KEY_L10 0xffd1 /* deprecated alias for F20 */ +#define XKB_KEY_F21 0xffd2 +#define XKB_KEY_R1 0xffd2 /* deprecated alias for F21 */ +#define XKB_KEY_F22 0xffd3 +#define XKB_KEY_R2 0xffd3 /* deprecated alias for F22 */ +#define XKB_KEY_F23 0xffd4 +#define XKB_KEY_R3 0xffd4 /* deprecated alias for F23 */ +#define XKB_KEY_F24 0xffd5 +#define XKB_KEY_R4 0xffd5 /* deprecated alias for F24 */ +#define XKB_KEY_F25 0xffd6 +#define XKB_KEY_R5 0xffd6 /* deprecated alias for F25 */ +#define XKB_KEY_F26 0xffd7 +#define XKB_KEY_R6 0xffd7 /* deprecated alias for F26 */ +#define XKB_KEY_F27 0xffd8 +#define XKB_KEY_R7 0xffd8 /* deprecated alias for F27 */ +#define XKB_KEY_F28 0xffd9 +#define XKB_KEY_R8 0xffd9 /* deprecated alias for F28 */ +#define XKB_KEY_F29 0xffda +#define XKB_KEY_R9 0xffda /* deprecated alias for F29 */ +#define XKB_KEY_F30 0xffdb +#define XKB_KEY_R10 0xffdb /* deprecated alias for F30 */ +#define XKB_KEY_F31 0xffdc +#define XKB_KEY_R11 0xffdc /* deprecated alias for F31 */ +#define XKB_KEY_F32 0xffdd +#define XKB_KEY_R12 0xffdd /* deprecated alias for F32 */ +#define XKB_KEY_F33 0xffde +#define XKB_KEY_R13 0xffde /* deprecated alias for F33 */ +#define XKB_KEY_F34 0xffdf +#define XKB_KEY_R14 0xffdf /* deprecated alias for F34 */ +#define XKB_KEY_F35 0xffe0 +#define XKB_KEY_R15 0xffe0 /* deprecated alias for F35 */ + +/* Modifiers */ + +#define XKB_KEY_Shift_L 0xffe1 /* Left shift */ +#define XKB_KEY_Shift_R 0xffe2 /* Right shift */ +#define XKB_KEY_Control_L 0xffe3 /* Left control */ +#define XKB_KEY_Control_R 0xffe4 /* Right control */ +#define XKB_KEY_Caps_Lock 0xffe5 /* Caps lock */ +#define XKB_KEY_Shift_Lock 0xffe6 /* Shift lock */ + +#define XKB_KEY_Meta_L 0xffe7 /* Left meta */ +#define XKB_KEY_Meta_R 0xffe8 /* Right meta */ +#define XKB_KEY_Alt_L 0xffe9 /* Left alt */ +#define XKB_KEY_Alt_R 0xffea /* Right alt */ +#define XKB_KEY_Super_L 0xffeb /* Left super */ +#define XKB_KEY_Super_R 0xffec /* Right super */ +#define XKB_KEY_Hyper_L 0xffed /* Left hyper */ +#define XKB_KEY_Hyper_R 0xffee /* Right hyper */ + +/* + * Keyboard (XKB) Extension function and modifier keys + * (from Appendix C of "The X Keyboard Extension: Protocol Specification") + * Byte 3 = 0xfe + */ + +#define XKB_KEY_ISO_Lock 0xfe01 +#define XKB_KEY_ISO_Level2_Latch 0xfe02 +#define XKB_KEY_ISO_Level3_Shift 0xfe03 +#define XKB_KEY_ISO_Level3_Latch 0xfe04 +#define XKB_KEY_ISO_Level3_Lock 0xfe05 +#define XKB_KEY_ISO_Level5_Shift 0xfe11 +#define XKB_KEY_ISO_Level5_Latch 0xfe12 +#define XKB_KEY_ISO_Level5_Lock 0xfe13 +#define XKB_KEY_ISO_Group_Shift 0xff7e /* non-deprecated alias for Mode_switch */ +#define XKB_KEY_ISO_Group_Latch 0xfe06 +#define XKB_KEY_ISO_Group_Lock 0xfe07 +#define XKB_KEY_ISO_Next_Group 0xfe08 +#define XKB_KEY_ISO_Next_Group_Lock 0xfe09 +#define XKB_KEY_ISO_Prev_Group 0xfe0a +#define XKB_KEY_ISO_Prev_Group_Lock 0xfe0b +#define XKB_KEY_ISO_First_Group 0xfe0c +#define XKB_KEY_ISO_First_Group_Lock 0xfe0d +#define XKB_KEY_ISO_Last_Group 0xfe0e +#define XKB_KEY_ISO_Last_Group_Lock 0xfe0f + +#define XKB_KEY_ISO_Left_Tab 0xfe20 +#define XKB_KEY_ISO_Move_Line_Up 0xfe21 +#define XKB_KEY_ISO_Move_Line_Down 0xfe22 +#define XKB_KEY_ISO_Partial_Line_Up 0xfe23 +#define XKB_KEY_ISO_Partial_Line_Down 0xfe24 +#define XKB_KEY_ISO_Partial_Space_Left 0xfe25 +#define XKB_KEY_ISO_Partial_Space_Right 0xfe26 +#define XKB_KEY_ISO_Set_Margin_Left 0xfe27 +#define XKB_KEY_ISO_Set_Margin_Right 0xfe28 +#define XKB_KEY_ISO_Release_Margin_Left 0xfe29 +#define XKB_KEY_ISO_Release_Margin_Right 0xfe2a +#define XKB_KEY_ISO_Release_Both_Margins 0xfe2b +#define XKB_KEY_ISO_Fast_Cursor_Left 0xfe2c +#define XKB_KEY_ISO_Fast_Cursor_Right 0xfe2d +#define XKB_KEY_ISO_Fast_Cursor_Up 0xfe2e +#define XKB_KEY_ISO_Fast_Cursor_Down 0xfe2f +#define XKB_KEY_ISO_Continuous_Underline 0xfe30 +#define XKB_KEY_ISO_Discontinuous_Underline 0xfe31 +#define XKB_KEY_ISO_Emphasize 0xfe32 +#define XKB_KEY_ISO_Center_Object 0xfe33 +#define XKB_KEY_ISO_Enter 0xfe34 + +#define XKB_KEY_dead_grave 0xfe50 +#define XKB_KEY_dead_acute 0xfe51 +#define XKB_KEY_dead_circumflex 0xfe52 +#define XKB_KEY_dead_tilde 0xfe53 +#define XKB_KEY_dead_perispomeni 0xfe53 /* non-deprecated alias for dead_tilde */ +#define XKB_KEY_dead_macron 0xfe54 +#define XKB_KEY_dead_breve 0xfe55 +#define XKB_KEY_dead_abovedot 0xfe56 +#define XKB_KEY_dead_diaeresis 0xfe57 +#define XKB_KEY_dead_abovering 0xfe58 +#define XKB_KEY_dead_doubleacute 0xfe59 +#define XKB_KEY_dead_caron 0xfe5a +#define XKB_KEY_dead_cedilla 0xfe5b +#define XKB_KEY_dead_ogonek 0xfe5c +#define XKB_KEY_dead_iota 0xfe5d +#define XKB_KEY_dead_voiced_sound 0xfe5e +#define XKB_KEY_dead_semivoiced_sound 0xfe5f +#define XKB_KEY_dead_belowdot 0xfe60 +#define XKB_KEY_dead_hook 0xfe61 +#define XKB_KEY_dead_horn 0xfe62 +#define XKB_KEY_dead_stroke 0xfe63 +#define XKB_KEY_dead_abovecomma 0xfe64 +#define XKB_KEY_dead_psili 0xfe64 /* non-deprecated alias for dead_abovecomma */ +#define XKB_KEY_dead_abovereversedcomma 0xfe65 +#define XKB_KEY_dead_dasia 0xfe65 /* non-deprecated alias for dead_abovereversedcomma */ +#define XKB_KEY_dead_doublegrave 0xfe66 +#define XKB_KEY_dead_belowring 0xfe67 +#define XKB_KEY_dead_belowmacron 0xfe68 +#define XKB_KEY_dead_belowcircumflex 0xfe69 +#define XKB_KEY_dead_belowtilde 0xfe6a +#define XKB_KEY_dead_belowbreve 0xfe6b +#define XKB_KEY_dead_belowdiaeresis 0xfe6c +#define XKB_KEY_dead_invertedbreve 0xfe6d +#define XKB_KEY_dead_belowcomma 0xfe6e +#define XKB_KEY_dead_currency 0xfe6f + +/* extra dead elements for German T3 layout */ +#define XKB_KEY_dead_lowline 0xfe90 +#define XKB_KEY_dead_aboveverticalline 0xfe91 +#define XKB_KEY_dead_belowverticalline 0xfe92 +#define XKB_KEY_dead_longsolidusoverlay 0xfe93 + +/* dead vowels for universal syllable entry */ +#define XKB_KEY_dead_a 0xfe80 +#define XKB_KEY_dead_A 0xfe81 +#define XKB_KEY_dead_e 0xfe82 +#define XKB_KEY_dead_E 0xfe83 +#define XKB_KEY_dead_i 0xfe84 +#define XKB_KEY_dead_I 0xfe85 +#define XKB_KEY_dead_o 0xfe86 +#define XKB_KEY_dead_O 0xfe87 +#define XKB_KEY_dead_u 0xfe88 +#define XKB_KEY_dead_U 0xfe89 +#define XKB_KEY_dead_small_schwa 0xfe8a /* deprecated alias for dead_schwa */ +#define XKB_KEY_dead_schwa 0xfe8a +#define XKB_KEY_dead_capital_schwa 0xfe8b /* deprecated alias for dead_SCHWA */ +#define XKB_KEY_dead_SCHWA 0xfe8b + +#define XKB_KEY_dead_greek 0xfe8c +#define XKB_KEY_dead_hamza 0xfe8d + +#define XKB_KEY_First_Virtual_Screen 0xfed0 +#define XKB_KEY_Prev_Virtual_Screen 0xfed1 +#define XKB_KEY_Next_Virtual_Screen 0xfed2 +#define XKB_KEY_Last_Virtual_Screen 0xfed4 +#define XKB_KEY_Terminate_Server 0xfed5 + +#define XKB_KEY_AccessX_Enable 0xfe70 +#define XKB_KEY_AccessX_Feedback_Enable 0xfe71 +#define XKB_KEY_RepeatKeys_Enable 0xfe72 +#define XKB_KEY_SlowKeys_Enable 0xfe73 +#define XKB_KEY_BounceKeys_Enable 0xfe74 +#define XKB_KEY_StickyKeys_Enable 0xfe75 +#define XKB_KEY_MouseKeys_Enable 0xfe76 +#define XKB_KEY_MouseKeys_Accel_Enable 0xfe77 +#define XKB_KEY_Overlay1_Enable 0xfe78 +#define XKB_KEY_Overlay2_Enable 0xfe79 +#define XKB_KEY_AudibleBell_Enable 0xfe7a + +#define XKB_KEY_Pointer_Left 0xfee0 +#define XKB_KEY_Pointer_Right 0xfee1 +#define XKB_KEY_Pointer_Up 0xfee2 +#define XKB_KEY_Pointer_Down 0xfee3 +#define XKB_KEY_Pointer_UpLeft 0xfee4 +#define XKB_KEY_Pointer_UpRight 0xfee5 +#define XKB_KEY_Pointer_DownLeft 0xfee6 +#define XKB_KEY_Pointer_DownRight 0xfee7 +#define XKB_KEY_Pointer_Button_Dflt 0xfee8 +#define XKB_KEY_Pointer_Button1 0xfee9 +#define XKB_KEY_Pointer_Button2 0xfeea +#define XKB_KEY_Pointer_Button3 0xfeeb +#define XKB_KEY_Pointer_Button4 0xfeec +#define XKB_KEY_Pointer_Button5 0xfeed +#define XKB_KEY_Pointer_DblClick_Dflt 0xfeee +#define XKB_KEY_Pointer_DblClick1 0xfeef +#define XKB_KEY_Pointer_DblClick2 0xfef0 +#define XKB_KEY_Pointer_DblClick3 0xfef1 +#define XKB_KEY_Pointer_DblClick4 0xfef2 +#define XKB_KEY_Pointer_DblClick5 0xfef3 +#define XKB_KEY_Pointer_Drag_Dflt 0xfef4 +#define XKB_KEY_Pointer_Drag1 0xfef5 +#define XKB_KEY_Pointer_Drag2 0xfef6 +#define XKB_KEY_Pointer_Drag3 0xfef7 +#define XKB_KEY_Pointer_Drag4 0xfef8 +#define XKB_KEY_Pointer_Drag5 0xfefd + +#define XKB_KEY_Pointer_EnableKeys 0xfef9 +#define XKB_KEY_Pointer_Accelerate 0xfefa +#define XKB_KEY_Pointer_DfltBtnNext 0xfefb +#define XKB_KEY_Pointer_DfltBtnPrev 0xfefc + +/* Single-Stroke Multiple-Character N-Graph Keysyms For The X Input Method */ + +#define XKB_KEY_ch 0xfea0 +#define XKB_KEY_Ch 0xfea1 +#define XKB_KEY_CH 0xfea2 +#define XKB_KEY_c_h 0xfea3 +#define XKB_KEY_C_h 0xfea4 +#define XKB_KEY_C_H 0xfea5 + + +/* + * 3270 Terminal Keys + * Byte 3 = 0xfd + */ + +#define XKB_KEY_3270_Duplicate 0xfd01 +#define XKB_KEY_3270_FieldMark 0xfd02 +#define XKB_KEY_3270_Right2 0xfd03 +#define XKB_KEY_3270_Left2 0xfd04 +#define XKB_KEY_3270_BackTab 0xfd05 +#define XKB_KEY_3270_EraseEOF 0xfd06 +#define XKB_KEY_3270_EraseInput 0xfd07 +#define XKB_KEY_3270_Reset 0xfd08 +#define XKB_KEY_3270_Quit 0xfd09 +#define XKB_KEY_3270_PA1 0xfd0a +#define XKB_KEY_3270_PA2 0xfd0b +#define XKB_KEY_3270_PA3 0xfd0c +#define XKB_KEY_3270_Test 0xfd0d +#define XKB_KEY_3270_Attn 0xfd0e +#define XKB_KEY_3270_CursorBlink 0xfd0f +#define XKB_KEY_3270_AltCursor 0xfd10 +#define XKB_KEY_3270_KeyClick 0xfd11 +#define XKB_KEY_3270_Jump 0xfd12 +#define XKB_KEY_3270_Ident 0xfd13 +#define XKB_KEY_3270_Rule 0xfd14 +#define XKB_KEY_3270_Copy 0xfd15 +#define XKB_KEY_3270_Play 0xfd16 +#define XKB_KEY_3270_Setup 0xfd17 +#define XKB_KEY_3270_Record 0xfd18 +#define XKB_KEY_3270_ChangeScreen 0xfd19 +#define XKB_KEY_3270_DeleteWord 0xfd1a +#define XKB_KEY_3270_ExSelect 0xfd1b +#define XKB_KEY_3270_CursorSelect 0xfd1c +#define XKB_KEY_3270_PrintScreen 0xfd1d +#define XKB_KEY_3270_Enter 0xfd1e + +/* + * Latin 1 + * (ISO/IEC 8859-1 = Unicode U+0020..U+00FF) + * Byte 3 = 0 + */ +#define XKB_KEY_space 0x0020 /* U+0020 SPACE */ +#define XKB_KEY_exclam 0x0021 /* U+0021 EXCLAMATION MARK */ +#define XKB_KEY_quotedbl 0x0022 /* U+0022 QUOTATION MARK */ +#define XKB_KEY_numbersign 0x0023 /* U+0023 NUMBER SIGN */ +#define XKB_KEY_dollar 0x0024 /* U+0024 DOLLAR SIGN */ +#define XKB_KEY_percent 0x0025 /* U+0025 PERCENT SIGN */ +#define XKB_KEY_ampersand 0x0026 /* U+0026 AMPERSAND */ +#define XKB_KEY_apostrophe 0x0027 /* U+0027 APOSTROPHE */ +#define XKB_KEY_quoteright 0x0027 /* deprecated */ +#define XKB_KEY_parenleft 0x0028 /* U+0028 LEFT PARENTHESIS */ +#define XKB_KEY_parenright 0x0029 /* U+0029 RIGHT PARENTHESIS */ +#define XKB_KEY_asterisk 0x002a /* U+002A ASTERISK */ +#define XKB_KEY_plus 0x002b /* U+002B PLUS SIGN */ +#define XKB_KEY_comma 0x002c /* U+002C COMMA */ +#define XKB_KEY_minus 0x002d /* U+002D HYPHEN-MINUS */ +#define XKB_KEY_period 0x002e /* U+002E FULL STOP */ +#define XKB_KEY_slash 0x002f /* U+002F SOLIDUS */ +#define XKB_KEY_0 0x0030 /* U+0030 DIGIT ZERO */ +#define XKB_KEY_1 0x0031 /* U+0031 DIGIT ONE */ +#define XKB_KEY_2 0x0032 /* U+0032 DIGIT TWO */ +#define XKB_KEY_3 0x0033 /* U+0033 DIGIT THREE */ +#define XKB_KEY_4 0x0034 /* U+0034 DIGIT FOUR */ +#define XKB_KEY_5 0x0035 /* U+0035 DIGIT FIVE */ +#define XKB_KEY_6 0x0036 /* U+0036 DIGIT SIX */ +#define XKB_KEY_7 0x0037 /* U+0037 DIGIT SEVEN */ +#define XKB_KEY_8 0x0038 /* U+0038 DIGIT EIGHT */ +#define XKB_KEY_9 0x0039 /* U+0039 DIGIT NINE */ +#define XKB_KEY_colon 0x003a /* U+003A COLON */ +#define XKB_KEY_semicolon 0x003b /* U+003B SEMICOLON */ +#define XKB_KEY_less 0x003c /* U+003C LESS-THAN SIGN */ +#define XKB_KEY_equal 0x003d /* U+003D EQUALS SIGN */ +#define XKB_KEY_greater 0x003e /* U+003E GREATER-THAN SIGN */ +#define XKB_KEY_question 0x003f /* U+003F QUESTION MARK */ +#define XKB_KEY_at 0x0040 /* U+0040 COMMERCIAL AT */ +#define XKB_KEY_A 0x0041 /* U+0041 LATIN CAPITAL LETTER A */ +#define XKB_KEY_B 0x0042 /* U+0042 LATIN CAPITAL LETTER B */ +#define XKB_KEY_C 0x0043 /* U+0043 LATIN CAPITAL LETTER C */ +#define XKB_KEY_D 0x0044 /* U+0044 LATIN CAPITAL LETTER D */ +#define XKB_KEY_E 0x0045 /* U+0045 LATIN CAPITAL LETTER E */ +#define XKB_KEY_F 0x0046 /* U+0046 LATIN CAPITAL LETTER F */ +#define XKB_KEY_G 0x0047 /* U+0047 LATIN CAPITAL LETTER G */ +#define XKB_KEY_H 0x0048 /* U+0048 LATIN CAPITAL LETTER H */ +#define XKB_KEY_I 0x0049 /* U+0049 LATIN CAPITAL LETTER I */ +#define XKB_KEY_J 0x004a /* U+004A LATIN CAPITAL LETTER J */ +#define XKB_KEY_K 0x004b /* U+004B LATIN CAPITAL LETTER K */ +#define XKB_KEY_L 0x004c /* U+004C LATIN CAPITAL LETTER L */ +#define XKB_KEY_M 0x004d /* U+004D LATIN CAPITAL LETTER M */ +#define XKB_KEY_N 0x004e /* U+004E LATIN CAPITAL LETTER N */ +#define XKB_KEY_O 0x004f /* U+004F LATIN CAPITAL LETTER O */ +#define XKB_KEY_P 0x0050 /* U+0050 LATIN CAPITAL LETTER P */ +#define XKB_KEY_Q 0x0051 /* U+0051 LATIN CAPITAL LETTER Q */ +#define XKB_KEY_R 0x0052 /* U+0052 LATIN CAPITAL LETTER R */ +#define XKB_KEY_S 0x0053 /* U+0053 LATIN CAPITAL LETTER S */ +#define XKB_KEY_T 0x0054 /* U+0054 LATIN CAPITAL LETTER T */ +#define XKB_KEY_U 0x0055 /* U+0055 LATIN CAPITAL LETTER U */ +#define XKB_KEY_V 0x0056 /* U+0056 LATIN CAPITAL LETTER V */ +#define XKB_KEY_W 0x0057 /* U+0057 LATIN CAPITAL LETTER W */ +#define XKB_KEY_X 0x0058 /* U+0058 LATIN CAPITAL LETTER X */ +#define XKB_KEY_Y 0x0059 /* U+0059 LATIN CAPITAL LETTER Y */ +#define XKB_KEY_Z 0x005a /* U+005A LATIN CAPITAL LETTER Z */ +#define XKB_KEY_bracketleft 0x005b /* U+005B LEFT SQUARE BRACKET */ +#define XKB_KEY_backslash 0x005c /* U+005C REVERSE SOLIDUS */ +#define XKB_KEY_bracketright 0x005d /* U+005D RIGHT SQUARE BRACKET */ +#define XKB_KEY_asciicircum 0x005e /* U+005E CIRCUMFLEX ACCENT */ +#define XKB_KEY_underscore 0x005f /* U+005F LOW LINE */ +#define XKB_KEY_grave 0x0060 /* U+0060 GRAVE ACCENT */ +#define XKB_KEY_quoteleft 0x0060 /* deprecated */ +#define XKB_KEY_a 0x0061 /* U+0061 LATIN SMALL LETTER A */ +#define XKB_KEY_b 0x0062 /* U+0062 LATIN SMALL LETTER B */ +#define XKB_KEY_c 0x0063 /* U+0063 LATIN SMALL LETTER C */ +#define XKB_KEY_d 0x0064 /* U+0064 LATIN SMALL LETTER D */ +#define XKB_KEY_e 0x0065 /* U+0065 LATIN SMALL LETTER E */ +#define XKB_KEY_f 0x0066 /* U+0066 LATIN SMALL LETTER F */ +#define XKB_KEY_g 0x0067 /* U+0067 LATIN SMALL LETTER G */ +#define XKB_KEY_h 0x0068 /* U+0068 LATIN SMALL LETTER H */ +#define XKB_KEY_i 0x0069 /* U+0069 LATIN SMALL LETTER I */ +#define XKB_KEY_j 0x006a /* U+006A LATIN SMALL LETTER J */ +#define XKB_KEY_k 0x006b /* U+006B LATIN SMALL LETTER K */ +#define XKB_KEY_l 0x006c /* U+006C LATIN SMALL LETTER L */ +#define XKB_KEY_m 0x006d /* U+006D LATIN SMALL LETTER M */ +#define XKB_KEY_n 0x006e /* U+006E LATIN SMALL LETTER N */ +#define XKB_KEY_o 0x006f /* U+006F LATIN SMALL LETTER O */ +#define XKB_KEY_p 0x0070 /* U+0070 LATIN SMALL LETTER P */ +#define XKB_KEY_q 0x0071 /* U+0071 LATIN SMALL LETTER Q */ +#define XKB_KEY_r 0x0072 /* U+0072 LATIN SMALL LETTER R */ +#define XKB_KEY_s 0x0073 /* U+0073 LATIN SMALL LETTER S */ +#define XKB_KEY_t 0x0074 /* U+0074 LATIN SMALL LETTER T */ +#define XKB_KEY_u 0x0075 /* U+0075 LATIN SMALL LETTER U */ +#define XKB_KEY_v 0x0076 /* U+0076 LATIN SMALL LETTER V */ +#define XKB_KEY_w 0x0077 /* U+0077 LATIN SMALL LETTER W */ +#define XKB_KEY_x 0x0078 /* U+0078 LATIN SMALL LETTER X */ +#define XKB_KEY_y 0x0079 /* U+0079 LATIN SMALL LETTER Y */ +#define XKB_KEY_z 0x007a /* U+007A LATIN SMALL LETTER Z */ +#define XKB_KEY_braceleft 0x007b /* U+007B LEFT CURLY BRACKET */ +#define XKB_KEY_bar 0x007c /* U+007C VERTICAL LINE */ +#define XKB_KEY_braceright 0x007d /* U+007D RIGHT CURLY BRACKET */ +#define XKB_KEY_asciitilde 0x007e /* U+007E TILDE */ + +#define XKB_KEY_nobreakspace 0x00a0 /* U+00A0 NO-BREAK SPACE */ +#define XKB_KEY_exclamdown 0x00a1 /* U+00A1 INVERTED EXCLAMATION MARK */ +#define XKB_KEY_cent 0x00a2 /* U+00A2 CENT SIGN */ +#define XKB_KEY_sterling 0x00a3 /* U+00A3 POUND SIGN */ +#define XKB_KEY_currency 0x00a4 /* U+00A4 CURRENCY SIGN */ +#define XKB_KEY_yen 0x00a5 /* U+00A5 YEN SIGN */ +#define XKB_KEY_brokenbar 0x00a6 /* U+00A6 BROKEN BAR */ +#define XKB_KEY_section 0x00a7 /* U+00A7 SECTION SIGN */ +#define XKB_KEY_diaeresis 0x00a8 /* U+00A8 DIAERESIS */ +#define XKB_KEY_copyright 0x00a9 /* U+00A9 COPYRIGHT SIGN */ +#define XKB_KEY_ordfeminine 0x00aa /* U+00AA FEMININE ORDINAL INDICATOR */ +#define XKB_KEY_guillemotleft 0x00ab /* deprecated alias for guillemetleft (misspelling) */ +#define XKB_KEY_guillemetleft 0x00ab /* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ +#define XKB_KEY_notsign 0x00ac /* U+00AC NOT SIGN */ +#define XKB_KEY_hyphen 0x00ad /* U+00AD SOFT HYPHEN */ +#define XKB_KEY_registered 0x00ae /* U+00AE REGISTERED SIGN */ +#define XKB_KEY_macron 0x00af /* U+00AF MACRON */ +#define XKB_KEY_degree 0x00b0 /* U+00B0 DEGREE SIGN */ +#define XKB_KEY_plusminus 0x00b1 /* U+00B1 PLUS-MINUS SIGN */ +#define XKB_KEY_twosuperior 0x00b2 /* U+00B2 SUPERSCRIPT TWO */ +#define XKB_KEY_threesuperior 0x00b3 /* U+00B3 SUPERSCRIPT THREE */ +#define XKB_KEY_acute 0x00b4 /* U+00B4 ACUTE ACCENT */ +#define XKB_KEY_mu 0x00b5 /* U+00B5 MICRO SIGN */ +#define XKB_KEY_paragraph 0x00b6 /* U+00B6 PILCROW SIGN */ +#define XKB_KEY_periodcentered 0x00b7 /* U+00B7 MIDDLE DOT */ +#define XKB_KEY_cedilla 0x00b8 /* U+00B8 CEDILLA */ +#define XKB_KEY_onesuperior 0x00b9 /* U+00B9 SUPERSCRIPT ONE */ +#define XKB_KEY_masculine 0x00ba /* deprecated alias for ordmasculine (inconsistent name) */ +#define XKB_KEY_ordmasculine 0x00ba /* U+00BA MASCULINE ORDINAL INDICATOR */ +#define XKB_KEY_guillemotright 0x00bb /* deprecated alias for guillemetright (misspelling) */ +#define XKB_KEY_guillemetright 0x00bb /* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ +#define XKB_KEY_onequarter 0x00bc /* U+00BC VULGAR FRACTION ONE QUARTER */ +#define XKB_KEY_onehalf 0x00bd /* U+00BD VULGAR FRACTION ONE HALF */ +#define XKB_KEY_threequarters 0x00be /* U+00BE VULGAR FRACTION THREE QUARTERS */ +#define XKB_KEY_questiondown 0x00bf /* U+00BF INVERTED QUESTION MARK */ +#define XKB_KEY_Agrave 0x00c0 /* U+00C0 LATIN CAPITAL LETTER A WITH GRAVE */ +#define XKB_KEY_Aacute 0x00c1 /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */ +#define XKB_KEY_Acircumflex 0x00c2 /* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ +#define XKB_KEY_Atilde 0x00c3 /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */ +#define XKB_KEY_Adiaeresis 0x00c4 /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */ +#define XKB_KEY_Aring 0x00c5 /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */ +#define XKB_KEY_AE 0x00c6 /* U+00C6 LATIN CAPITAL LETTER AE */ +#define XKB_KEY_Ccedilla 0x00c7 /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */ +#define XKB_KEY_Egrave 0x00c8 /* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */ +#define XKB_KEY_Eacute 0x00c9 /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */ +#define XKB_KEY_Ecircumflex 0x00ca /* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ +#define XKB_KEY_Ediaeresis 0x00cb /* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */ +#define XKB_KEY_Igrave 0x00cc /* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */ +#define XKB_KEY_Iacute 0x00cd /* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */ +#define XKB_KEY_Icircumflex 0x00ce /* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ +#define XKB_KEY_Idiaeresis 0x00cf /* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */ +#define XKB_KEY_ETH 0x00d0 /* U+00D0 LATIN CAPITAL LETTER ETH */ +#define XKB_KEY_Eth 0x00d0 /* deprecated */ +#define XKB_KEY_Ntilde 0x00d1 /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */ +#define XKB_KEY_Ograve 0x00d2 /* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */ +#define XKB_KEY_Oacute 0x00d3 /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */ +#define XKB_KEY_Ocircumflex 0x00d4 /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ +#define XKB_KEY_Otilde 0x00d5 /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */ +#define XKB_KEY_Odiaeresis 0x00d6 /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */ +#define XKB_KEY_multiply 0x00d7 /* U+00D7 MULTIPLICATION SIGN */ +#define XKB_KEY_Oslash 0x00d8 /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */ +#define XKB_KEY_Ooblique 0x00d8 /* deprecated alias for Oslash */ +#define XKB_KEY_Ugrave 0x00d9 /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */ +#define XKB_KEY_Uacute 0x00da /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */ +#define XKB_KEY_Ucircumflex 0x00db /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ +#define XKB_KEY_Udiaeresis 0x00dc /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */ +#define XKB_KEY_Yacute 0x00dd /* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */ +#define XKB_KEY_THORN 0x00de /* U+00DE LATIN CAPITAL LETTER THORN */ +#define XKB_KEY_Thorn 0x00de /* deprecated */ +#define XKB_KEY_ssharp 0x00df /* U+00DF LATIN SMALL LETTER SHARP S */ +#define XKB_KEY_agrave 0x00e0 /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */ +#define XKB_KEY_aacute 0x00e1 /* U+00E1 LATIN SMALL LETTER A WITH ACUTE */ +#define XKB_KEY_acircumflex 0x00e2 /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */ +#define XKB_KEY_atilde 0x00e3 /* U+00E3 LATIN SMALL LETTER A WITH TILDE */ +#define XKB_KEY_adiaeresis 0x00e4 /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */ +#define XKB_KEY_aring 0x00e5 /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */ +#define XKB_KEY_ae 0x00e6 /* U+00E6 LATIN SMALL LETTER AE */ +#define XKB_KEY_ccedilla 0x00e7 /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ +#define XKB_KEY_egrave 0x00e8 /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */ +#define XKB_KEY_eacute 0x00e9 /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ +#define XKB_KEY_ecircumflex 0x00ea /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */ +#define XKB_KEY_ediaeresis 0x00eb /* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */ +#define XKB_KEY_igrave 0x00ec /* U+00EC LATIN SMALL LETTER I WITH GRAVE */ +#define XKB_KEY_iacute 0x00ed /* U+00ED LATIN SMALL LETTER I WITH ACUTE */ +#define XKB_KEY_icircumflex 0x00ee /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */ +#define XKB_KEY_idiaeresis 0x00ef /* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */ +#define XKB_KEY_eth 0x00f0 /* U+00F0 LATIN SMALL LETTER ETH */ +#define XKB_KEY_ntilde 0x00f1 /* U+00F1 LATIN SMALL LETTER N WITH TILDE */ +#define XKB_KEY_ograve 0x00f2 /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */ +#define XKB_KEY_oacute 0x00f3 /* U+00F3 LATIN SMALL LETTER O WITH ACUTE */ +#define XKB_KEY_ocircumflex 0x00f4 /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */ +#define XKB_KEY_otilde 0x00f5 /* U+00F5 LATIN SMALL LETTER O WITH TILDE */ +#define XKB_KEY_odiaeresis 0x00f6 /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */ +#define XKB_KEY_division 0x00f7 /* U+00F7 DIVISION SIGN */ +#define XKB_KEY_oslash 0x00f8 /* U+00F8 LATIN SMALL LETTER O WITH STROKE */ +#define XKB_KEY_ooblique 0x00f8 /* deprecated alias for oslash */ +#define XKB_KEY_ugrave 0x00f9 /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */ +#define XKB_KEY_uacute 0x00fa /* U+00FA LATIN SMALL LETTER U WITH ACUTE */ +#define XKB_KEY_ucircumflex 0x00fb /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */ +#define XKB_KEY_udiaeresis 0x00fc /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */ +#define XKB_KEY_yacute 0x00fd /* U+00FD LATIN SMALL LETTER Y WITH ACUTE */ +#define XKB_KEY_thorn 0x00fe /* U+00FE LATIN SMALL LETTER THORN */ +#define XKB_KEY_ydiaeresis 0x00ff /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */ + +/* + * Latin 2 + * Byte 3 = 1 + */ + +#define XKB_KEY_Aogonek 0x01a1 /* U+0104 LATIN CAPITAL LETTER A WITH OGONEK */ +#define XKB_KEY_breve 0x01a2 /* U+02D8 BREVE */ +#define XKB_KEY_Lstroke 0x01a3 /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */ +#define XKB_KEY_Lcaron 0x01a5 /* U+013D LATIN CAPITAL LETTER L WITH CARON */ +#define XKB_KEY_Sacute 0x01a6 /* U+015A LATIN CAPITAL LETTER S WITH ACUTE */ +#define XKB_KEY_Scaron 0x01a9 /* U+0160 LATIN CAPITAL LETTER S WITH CARON */ +#define XKB_KEY_Scedilla 0x01aa /* U+015E LATIN CAPITAL LETTER S WITH CEDILLA */ +#define XKB_KEY_Tcaron 0x01ab /* U+0164 LATIN CAPITAL LETTER T WITH CARON */ +#define XKB_KEY_Zacute 0x01ac /* U+0179 LATIN CAPITAL LETTER Z WITH ACUTE */ +#define XKB_KEY_Zcaron 0x01ae /* U+017D LATIN CAPITAL LETTER Z WITH CARON */ +#define XKB_KEY_Zabovedot 0x01af /* U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE */ +#define XKB_KEY_aogonek 0x01b1 /* U+0105 LATIN SMALL LETTER A WITH OGONEK */ +#define XKB_KEY_ogonek 0x01b2 /* U+02DB OGONEK */ +#define XKB_KEY_lstroke 0x01b3 /* U+0142 LATIN SMALL LETTER L WITH STROKE */ +#define XKB_KEY_lcaron 0x01b5 /* U+013E LATIN SMALL LETTER L WITH CARON */ +#define XKB_KEY_sacute 0x01b6 /* U+015B LATIN SMALL LETTER S WITH ACUTE */ +#define XKB_KEY_caron 0x01b7 /* U+02C7 CARON */ +#define XKB_KEY_scaron 0x01b9 /* U+0161 LATIN SMALL LETTER S WITH CARON */ +#define XKB_KEY_scedilla 0x01ba /* U+015F LATIN SMALL LETTER S WITH CEDILLA */ +#define XKB_KEY_tcaron 0x01bb /* U+0165 LATIN SMALL LETTER T WITH CARON */ +#define XKB_KEY_zacute 0x01bc /* U+017A LATIN SMALL LETTER Z WITH ACUTE */ +#define XKB_KEY_doubleacute 0x01bd /* U+02DD DOUBLE ACUTE ACCENT */ +#define XKB_KEY_zcaron 0x01be /* U+017E LATIN SMALL LETTER Z WITH CARON */ +#define XKB_KEY_zabovedot 0x01bf /* U+017C LATIN SMALL LETTER Z WITH DOT ABOVE */ +#define XKB_KEY_Racute 0x01c0 /* U+0154 LATIN CAPITAL LETTER R WITH ACUTE */ +#define XKB_KEY_Abreve 0x01c3 /* U+0102 LATIN CAPITAL LETTER A WITH BREVE */ +#define XKB_KEY_Lacute 0x01c5 /* U+0139 LATIN CAPITAL LETTER L WITH ACUTE */ +#define XKB_KEY_Cacute 0x01c6 /* U+0106 LATIN CAPITAL LETTER C WITH ACUTE */ +#define XKB_KEY_Ccaron 0x01c8 /* U+010C LATIN CAPITAL LETTER C WITH CARON */ +#define XKB_KEY_Eogonek 0x01ca /* U+0118 LATIN CAPITAL LETTER E WITH OGONEK */ +#define XKB_KEY_Ecaron 0x01cc /* U+011A LATIN CAPITAL LETTER E WITH CARON */ +#define XKB_KEY_Dcaron 0x01cf /* U+010E LATIN CAPITAL LETTER D WITH CARON */ +#define XKB_KEY_Dstroke 0x01d0 /* U+0110 LATIN CAPITAL LETTER D WITH STROKE */ +#define XKB_KEY_Nacute 0x01d1 /* U+0143 LATIN CAPITAL LETTER N WITH ACUTE */ +#define XKB_KEY_Ncaron 0x01d2 /* U+0147 LATIN CAPITAL LETTER N WITH CARON */ +#define XKB_KEY_Odoubleacute 0x01d5 /* U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ +#define XKB_KEY_Rcaron 0x01d8 /* U+0158 LATIN CAPITAL LETTER R WITH CARON */ +#define XKB_KEY_Uring 0x01d9 /* U+016E LATIN CAPITAL LETTER U WITH RING ABOVE */ +#define XKB_KEY_Udoubleacute 0x01db /* U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ +#define XKB_KEY_Tcedilla 0x01de /* U+0162 LATIN CAPITAL LETTER T WITH CEDILLA */ +#define XKB_KEY_racute 0x01e0 /* U+0155 LATIN SMALL LETTER R WITH ACUTE */ +#define XKB_KEY_abreve 0x01e3 /* U+0103 LATIN SMALL LETTER A WITH BREVE */ +#define XKB_KEY_lacute 0x01e5 /* U+013A LATIN SMALL LETTER L WITH ACUTE */ +#define XKB_KEY_cacute 0x01e6 /* U+0107 LATIN SMALL LETTER C WITH ACUTE */ +#define XKB_KEY_ccaron 0x01e8 /* U+010D LATIN SMALL LETTER C WITH CARON */ +#define XKB_KEY_eogonek 0x01ea /* U+0119 LATIN SMALL LETTER E WITH OGONEK */ +#define XKB_KEY_ecaron 0x01ec /* U+011B LATIN SMALL LETTER E WITH CARON */ +#define XKB_KEY_dcaron 0x01ef /* U+010F LATIN SMALL LETTER D WITH CARON */ +#define XKB_KEY_dstroke 0x01f0 /* U+0111 LATIN SMALL LETTER D WITH STROKE */ +#define XKB_KEY_nacute 0x01f1 /* U+0144 LATIN SMALL LETTER N WITH ACUTE */ +#define XKB_KEY_ncaron 0x01f2 /* U+0148 LATIN SMALL LETTER N WITH CARON */ +#define XKB_KEY_odoubleacute 0x01f5 /* U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE */ +#define XKB_KEY_rcaron 0x01f8 /* U+0159 LATIN SMALL LETTER R WITH CARON */ +#define XKB_KEY_uring 0x01f9 /* U+016F LATIN SMALL LETTER U WITH RING ABOVE */ +#define XKB_KEY_udoubleacute 0x01fb /* U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE */ +#define XKB_KEY_tcedilla 0x01fe /* U+0163 LATIN SMALL LETTER T WITH CEDILLA */ +#define XKB_KEY_abovedot 0x01ff /* U+02D9 DOT ABOVE */ + +/* + * Latin 3 + * Byte 3 = 2 + */ + +#define XKB_KEY_Hstroke 0x02a1 /* U+0126 LATIN CAPITAL LETTER H WITH STROKE */ +#define XKB_KEY_Hcircumflex 0x02a6 /* U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ +#define XKB_KEY_Iabovedot 0x02a9 /* U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE */ +#define XKB_KEY_Gbreve 0x02ab /* U+011E LATIN CAPITAL LETTER G WITH BREVE */ +#define XKB_KEY_Jcircumflex 0x02ac /* U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ +#define XKB_KEY_hstroke 0x02b1 /* U+0127 LATIN SMALL LETTER H WITH STROKE */ +#define XKB_KEY_hcircumflex 0x02b6 /* U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX */ +#define XKB_KEY_idotless 0x02b9 /* U+0131 LATIN SMALL LETTER DOTLESS I */ +#define XKB_KEY_gbreve 0x02bb /* U+011F LATIN SMALL LETTER G WITH BREVE */ +#define XKB_KEY_jcircumflex 0x02bc /* U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX */ +#define XKB_KEY_Cabovedot 0x02c5 /* U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE */ +#define XKB_KEY_Ccircumflex 0x02c6 /* U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ +#define XKB_KEY_Gabovedot 0x02d5 /* U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE */ +#define XKB_KEY_Gcircumflex 0x02d8 /* U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ +#define XKB_KEY_Ubreve 0x02dd /* U+016C LATIN CAPITAL LETTER U WITH BREVE */ +#define XKB_KEY_Scircumflex 0x02de /* U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ +#define XKB_KEY_cabovedot 0x02e5 /* U+010B LATIN SMALL LETTER C WITH DOT ABOVE */ +#define XKB_KEY_ccircumflex 0x02e6 /* U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX */ +#define XKB_KEY_gabovedot 0x02f5 /* U+0121 LATIN SMALL LETTER G WITH DOT ABOVE */ +#define XKB_KEY_gcircumflex 0x02f8 /* U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX */ +#define XKB_KEY_ubreve 0x02fd /* U+016D LATIN SMALL LETTER U WITH BREVE */ +#define XKB_KEY_scircumflex 0x02fe /* U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX */ + + +/* + * Latin 4 + * Byte 3 = 3 + */ + +#define XKB_KEY_kra 0x03a2 /* U+0138 LATIN SMALL LETTER KRA */ +#define XKB_KEY_kappa 0x03a2 /* deprecated */ +#define XKB_KEY_Rcedilla 0x03a3 /* U+0156 LATIN CAPITAL LETTER R WITH CEDILLA */ +#define XKB_KEY_Itilde 0x03a5 /* U+0128 LATIN CAPITAL LETTER I WITH TILDE */ +#define XKB_KEY_Lcedilla 0x03a6 /* U+013B LATIN CAPITAL LETTER L WITH CEDILLA */ +#define XKB_KEY_Emacron 0x03aa /* U+0112 LATIN CAPITAL LETTER E WITH MACRON */ +#define XKB_KEY_Gcedilla 0x03ab /* U+0122 LATIN CAPITAL LETTER G WITH CEDILLA */ +#define XKB_KEY_Tslash 0x03ac /* U+0166 LATIN CAPITAL LETTER T WITH STROKE */ +#define XKB_KEY_rcedilla 0x03b3 /* U+0157 LATIN SMALL LETTER R WITH CEDILLA */ +#define XKB_KEY_itilde 0x03b5 /* U+0129 LATIN SMALL LETTER I WITH TILDE */ +#define XKB_KEY_lcedilla 0x03b6 /* U+013C LATIN SMALL LETTER L WITH CEDILLA */ +#define XKB_KEY_emacron 0x03ba /* U+0113 LATIN SMALL LETTER E WITH MACRON */ +#define XKB_KEY_gcedilla 0x03bb /* U+0123 LATIN SMALL LETTER G WITH CEDILLA */ +#define XKB_KEY_tslash 0x03bc /* U+0167 LATIN SMALL LETTER T WITH STROKE */ +#define XKB_KEY_ENG 0x03bd /* U+014A LATIN CAPITAL LETTER ENG */ +#define XKB_KEY_eng 0x03bf /* U+014B LATIN SMALL LETTER ENG */ +#define XKB_KEY_Amacron 0x03c0 /* U+0100 LATIN CAPITAL LETTER A WITH MACRON */ +#define XKB_KEY_Iogonek 0x03c7 /* U+012E LATIN CAPITAL LETTER I WITH OGONEK */ +#define XKB_KEY_Eabovedot 0x03cc /* U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE */ +#define XKB_KEY_Imacron 0x03cf /* U+012A LATIN CAPITAL LETTER I WITH MACRON */ +#define XKB_KEY_Ncedilla 0x03d1 /* U+0145 LATIN CAPITAL LETTER N WITH CEDILLA */ +#define XKB_KEY_Omacron 0x03d2 /* U+014C LATIN CAPITAL LETTER O WITH MACRON */ +#define XKB_KEY_Kcedilla 0x03d3 /* U+0136 LATIN CAPITAL LETTER K WITH CEDILLA */ +#define XKB_KEY_Uogonek 0x03d9 /* U+0172 LATIN CAPITAL LETTER U WITH OGONEK */ +#define XKB_KEY_Utilde 0x03dd /* U+0168 LATIN CAPITAL LETTER U WITH TILDE */ +#define XKB_KEY_Umacron 0x03de /* U+016A LATIN CAPITAL LETTER U WITH MACRON */ +#define XKB_KEY_amacron 0x03e0 /* U+0101 LATIN SMALL LETTER A WITH MACRON */ +#define XKB_KEY_iogonek 0x03e7 /* U+012F LATIN SMALL LETTER I WITH OGONEK */ +#define XKB_KEY_eabovedot 0x03ec /* U+0117 LATIN SMALL LETTER E WITH DOT ABOVE */ +#define XKB_KEY_imacron 0x03ef /* U+012B LATIN SMALL LETTER I WITH MACRON */ +#define XKB_KEY_ncedilla 0x03f1 /* U+0146 LATIN SMALL LETTER N WITH CEDILLA */ +#define XKB_KEY_omacron 0x03f2 /* U+014D LATIN SMALL LETTER O WITH MACRON */ +#define XKB_KEY_kcedilla 0x03f3 /* U+0137 LATIN SMALL LETTER K WITH CEDILLA */ +#define XKB_KEY_uogonek 0x03f9 /* U+0173 LATIN SMALL LETTER U WITH OGONEK */ +#define XKB_KEY_utilde 0x03fd /* U+0169 LATIN SMALL LETTER U WITH TILDE */ +#define XKB_KEY_umacron 0x03fe /* U+016B LATIN SMALL LETTER U WITH MACRON */ + +/* + * Latin 8 + */ +#define XKB_KEY_Wcircumflex 0x1000174 /* U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX */ +#define XKB_KEY_wcircumflex 0x1000175 /* U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX */ +#define XKB_KEY_Ycircumflex 0x1000176 /* U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */ +#define XKB_KEY_ycircumflex 0x1000177 /* U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX */ +#define XKB_KEY_Babovedot 0x1001e02 /* U+1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE */ +#define XKB_KEY_babovedot 0x1001e03 /* U+1E03 LATIN SMALL LETTER B WITH DOT ABOVE */ +#define XKB_KEY_Dabovedot 0x1001e0a /* U+1E0A LATIN CAPITAL LETTER D WITH DOT ABOVE */ +#define XKB_KEY_dabovedot 0x1001e0b /* U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE */ +#define XKB_KEY_Fabovedot 0x1001e1e /* U+1E1E LATIN CAPITAL LETTER F WITH DOT ABOVE */ +#define XKB_KEY_fabovedot 0x1001e1f /* U+1E1F LATIN SMALL LETTER F WITH DOT ABOVE */ +#define XKB_KEY_Mabovedot 0x1001e40 /* U+1E40 LATIN CAPITAL LETTER M WITH DOT ABOVE */ +#define XKB_KEY_mabovedot 0x1001e41 /* U+1E41 LATIN SMALL LETTER M WITH DOT ABOVE */ +#define XKB_KEY_Pabovedot 0x1001e56 /* U+1E56 LATIN CAPITAL LETTER P WITH DOT ABOVE */ +#define XKB_KEY_pabovedot 0x1001e57 /* U+1E57 LATIN SMALL LETTER P WITH DOT ABOVE */ +#define XKB_KEY_Sabovedot 0x1001e60 /* U+1E60 LATIN CAPITAL LETTER S WITH DOT ABOVE */ +#define XKB_KEY_sabovedot 0x1001e61 /* U+1E61 LATIN SMALL LETTER S WITH DOT ABOVE */ +#define XKB_KEY_Tabovedot 0x1001e6a /* U+1E6A LATIN CAPITAL LETTER T WITH DOT ABOVE */ +#define XKB_KEY_tabovedot 0x1001e6b /* U+1E6B LATIN SMALL LETTER T WITH DOT ABOVE */ +#define XKB_KEY_Wgrave 0x1001e80 /* U+1E80 LATIN CAPITAL LETTER W WITH GRAVE */ +#define XKB_KEY_wgrave 0x1001e81 /* U+1E81 LATIN SMALL LETTER W WITH GRAVE */ +#define XKB_KEY_Wacute 0x1001e82 /* U+1E82 LATIN CAPITAL LETTER W WITH ACUTE */ +#define XKB_KEY_wacute 0x1001e83 /* U+1E83 LATIN SMALL LETTER W WITH ACUTE */ +#define XKB_KEY_Wdiaeresis 0x1001e84 /* U+1E84 LATIN CAPITAL LETTER W WITH DIAERESIS */ +#define XKB_KEY_wdiaeresis 0x1001e85 /* U+1E85 LATIN SMALL LETTER W WITH DIAERESIS */ +#define XKB_KEY_Ygrave 0x1001ef2 /* U+1EF2 LATIN CAPITAL LETTER Y WITH GRAVE */ +#define XKB_KEY_ygrave 0x1001ef3 /* U+1EF3 LATIN SMALL LETTER Y WITH GRAVE */ + +/* + * Latin 9 + * Byte 3 = 0x13 + */ + +#define XKB_KEY_OE 0x13bc /* U+0152 LATIN CAPITAL LIGATURE OE */ +#define XKB_KEY_oe 0x13bd /* U+0153 LATIN SMALL LIGATURE OE */ +#define XKB_KEY_Ydiaeresis 0x13be /* U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS */ + +/* + * Katakana + * Byte 3 = 4 + */ + +#define XKB_KEY_overline 0x047e /* U+203E OVERLINE */ +#define XKB_KEY_kana_fullstop 0x04a1 /* U+3002 IDEOGRAPHIC FULL STOP */ +#define XKB_KEY_kana_openingbracket 0x04a2 /* U+300C LEFT CORNER BRACKET */ +#define XKB_KEY_kana_closingbracket 0x04a3 /* U+300D RIGHT CORNER BRACKET */ +#define XKB_KEY_kana_comma 0x04a4 /* U+3001 IDEOGRAPHIC COMMA */ +#define XKB_KEY_kana_conjunctive 0x04a5 /* U+30FB KATAKANA MIDDLE DOT */ +#define XKB_KEY_kana_middledot 0x04a5 /* deprecated */ +#define XKB_KEY_kana_WO 0x04a6 /* U+30F2 KATAKANA LETTER WO */ +#define XKB_KEY_kana_a 0x04a7 /* U+30A1 KATAKANA LETTER SMALL A */ +#define XKB_KEY_kana_i 0x04a8 /* U+30A3 KATAKANA LETTER SMALL I */ +#define XKB_KEY_kana_u 0x04a9 /* U+30A5 KATAKANA LETTER SMALL U */ +#define XKB_KEY_kana_e 0x04aa /* U+30A7 KATAKANA LETTER SMALL E */ +#define XKB_KEY_kana_o 0x04ab /* U+30A9 KATAKANA LETTER SMALL O */ +#define XKB_KEY_kana_ya 0x04ac /* U+30E3 KATAKANA LETTER SMALL YA */ +#define XKB_KEY_kana_yu 0x04ad /* U+30E5 KATAKANA LETTER SMALL YU */ +#define XKB_KEY_kana_yo 0x04ae /* U+30E7 KATAKANA LETTER SMALL YO */ +#define XKB_KEY_kana_tsu 0x04af /* U+30C3 KATAKANA LETTER SMALL TU */ +#define XKB_KEY_kana_tu 0x04af /* deprecated */ +#define XKB_KEY_prolongedsound 0x04b0 /* U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK */ +#define XKB_KEY_kana_A 0x04b1 /* U+30A2 KATAKANA LETTER A */ +#define XKB_KEY_kana_I 0x04b2 /* U+30A4 KATAKANA LETTER I */ +#define XKB_KEY_kana_U 0x04b3 /* U+30A6 KATAKANA LETTER U */ +#define XKB_KEY_kana_E 0x04b4 /* U+30A8 KATAKANA LETTER E */ +#define XKB_KEY_kana_O 0x04b5 /* U+30AA KATAKANA LETTER O */ +#define XKB_KEY_kana_KA 0x04b6 /* U+30AB KATAKANA LETTER KA */ +#define XKB_KEY_kana_KI 0x04b7 /* U+30AD KATAKANA LETTER KI */ +#define XKB_KEY_kana_KU 0x04b8 /* U+30AF KATAKANA LETTER KU */ +#define XKB_KEY_kana_KE 0x04b9 /* U+30B1 KATAKANA LETTER KE */ +#define XKB_KEY_kana_KO 0x04ba /* U+30B3 KATAKANA LETTER KO */ +#define XKB_KEY_kana_SA 0x04bb /* U+30B5 KATAKANA LETTER SA */ +#define XKB_KEY_kana_SHI 0x04bc /* U+30B7 KATAKANA LETTER SI */ +#define XKB_KEY_kana_SU 0x04bd /* U+30B9 KATAKANA LETTER SU */ +#define XKB_KEY_kana_SE 0x04be /* U+30BB KATAKANA LETTER SE */ +#define XKB_KEY_kana_SO 0x04bf /* U+30BD KATAKANA LETTER SO */ +#define XKB_KEY_kana_TA 0x04c0 /* U+30BF KATAKANA LETTER TA */ +#define XKB_KEY_kana_CHI 0x04c1 /* U+30C1 KATAKANA LETTER TI */ +#define XKB_KEY_kana_TI 0x04c1 /* deprecated */ +#define XKB_KEY_kana_TSU 0x04c2 /* U+30C4 KATAKANA LETTER TU */ +#define XKB_KEY_kana_TU 0x04c2 /* deprecated */ +#define XKB_KEY_kana_TE 0x04c3 /* U+30C6 KATAKANA LETTER TE */ +#define XKB_KEY_kana_TO 0x04c4 /* U+30C8 KATAKANA LETTER TO */ +#define XKB_KEY_kana_NA 0x04c5 /* U+30CA KATAKANA LETTER NA */ +#define XKB_KEY_kana_NI 0x04c6 /* U+30CB KATAKANA LETTER NI */ +#define XKB_KEY_kana_NU 0x04c7 /* U+30CC KATAKANA LETTER NU */ +#define XKB_KEY_kana_NE 0x04c8 /* U+30CD KATAKANA LETTER NE */ +#define XKB_KEY_kana_NO 0x04c9 /* U+30CE KATAKANA LETTER NO */ +#define XKB_KEY_kana_HA 0x04ca /* U+30CF KATAKANA LETTER HA */ +#define XKB_KEY_kana_HI 0x04cb /* U+30D2 KATAKANA LETTER HI */ +#define XKB_KEY_kana_FU 0x04cc /* U+30D5 KATAKANA LETTER HU */ +#define XKB_KEY_kana_HU 0x04cc /* deprecated */ +#define XKB_KEY_kana_HE 0x04cd /* U+30D8 KATAKANA LETTER HE */ +#define XKB_KEY_kana_HO 0x04ce /* U+30DB KATAKANA LETTER HO */ +#define XKB_KEY_kana_MA 0x04cf /* U+30DE KATAKANA LETTER MA */ +#define XKB_KEY_kana_MI 0x04d0 /* U+30DF KATAKANA LETTER MI */ +#define XKB_KEY_kana_MU 0x04d1 /* U+30E0 KATAKANA LETTER MU */ +#define XKB_KEY_kana_ME 0x04d2 /* U+30E1 KATAKANA LETTER ME */ +#define XKB_KEY_kana_MO 0x04d3 /* U+30E2 KATAKANA LETTER MO */ +#define XKB_KEY_kana_YA 0x04d4 /* U+30E4 KATAKANA LETTER YA */ +#define XKB_KEY_kana_YU 0x04d5 /* U+30E6 KATAKANA LETTER YU */ +#define XKB_KEY_kana_YO 0x04d6 /* U+30E8 KATAKANA LETTER YO */ +#define XKB_KEY_kana_RA 0x04d7 /* U+30E9 KATAKANA LETTER RA */ +#define XKB_KEY_kana_RI 0x04d8 /* U+30EA KATAKANA LETTER RI */ +#define XKB_KEY_kana_RU 0x04d9 /* U+30EB KATAKANA LETTER RU */ +#define XKB_KEY_kana_RE 0x04da /* U+30EC KATAKANA LETTER RE */ +#define XKB_KEY_kana_RO 0x04db /* U+30ED KATAKANA LETTER RO */ +#define XKB_KEY_kana_WA 0x04dc /* U+30EF KATAKANA LETTER WA */ +#define XKB_KEY_kana_N 0x04dd /* U+30F3 KATAKANA LETTER N */ +#define XKB_KEY_voicedsound 0x04de /* U+309B KATAKANA-HIRAGANA VOICED SOUND MARK */ +#define XKB_KEY_semivoicedsound 0x04df /* U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */ +#define XKB_KEY_kana_switch 0xff7e /* non-deprecated alias for Mode_switch */ + +/* + * Arabic + * Byte 3 = 5 + */ + +#define XKB_KEY_Farsi_0 0x10006f0 /* U+06F0 EXTENDED ARABIC-INDIC DIGIT ZERO */ +#define XKB_KEY_Farsi_1 0x10006f1 /* U+06F1 EXTENDED ARABIC-INDIC DIGIT ONE */ +#define XKB_KEY_Farsi_2 0x10006f2 /* U+06F2 EXTENDED ARABIC-INDIC DIGIT TWO */ +#define XKB_KEY_Farsi_3 0x10006f3 /* U+06F3 EXTENDED ARABIC-INDIC DIGIT THREE */ +#define XKB_KEY_Farsi_4 0x10006f4 /* U+06F4 EXTENDED ARABIC-INDIC DIGIT FOUR */ +#define XKB_KEY_Farsi_5 0x10006f5 /* U+06F5 EXTENDED ARABIC-INDIC DIGIT FIVE */ +#define XKB_KEY_Farsi_6 0x10006f6 /* U+06F6 EXTENDED ARABIC-INDIC DIGIT SIX */ +#define XKB_KEY_Farsi_7 0x10006f7 /* U+06F7 EXTENDED ARABIC-INDIC DIGIT SEVEN */ +#define XKB_KEY_Farsi_8 0x10006f8 /* U+06F8 EXTENDED ARABIC-INDIC DIGIT EIGHT */ +#define XKB_KEY_Farsi_9 0x10006f9 /* U+06F9 EXTENDED ARABIC-INDIC DIGIT NINE */ +#define XKB_KEY_Arabic_percent 0x100066a /* U+066A ARABIC PERCENT SIGN */ +#define XKB_KEY_Arabic_superscript_alef 0x1000670 /* U+0670 ARABIC LETTER SUPERSCRIPT ALEF */ +#define XKB_KEY_Arabic_tteh 0x1000679 /* U+0679 ARABIC LETTER TTEH */ +#define XKB_KEY_Arabic_peh 0x100067e /* U+067E ARABIC LETTER PEH */ +#define XKB_KEY_Arabic_tcheh 0x1000686 /* U+0686 ARABIC LETTER TCHEH */ +#define XKB_KEY_Arabic_ddal 0x1000688 /* U+0688 ARABIC LETTER DDAL */ +#define XKB_KEY_Arabic_rreh 0x1000691 /* U+0691 ARABIC LETTER RREH */ +#define XKB_KEY_Arabic_comma 0x05ac /* U+060C ARABIC COMMA */ +#define XKB_KEY_Arabic_fullstop 0x10006d4 /* U+06D4 ARABIC FULL STOP */ +#define XKB_KEY_Arabic_0 0x1000660 /* U+0660 ARABIC-INDIC DIGIT ZERO */ +#define XKB_KEY_Arabic_1 0x1000661 /* U+0661 ARABIC-INDIC DIGIT ONE */ +#define XKB_KEY_Arabic_2 0x1000662 /* U+0662 ARABIC-INDIC DIGIT TWO */ +#define XKB_KEY_Arabic_3 0x1000663 /* U+0663 ARABIC-INDIC DIGIT THREE */ +#define XKB_KEY_Arabic_4 0x1000664 /* U+0664 ARABIC-INDIC DIGIT FOUR */ +#define XKB_KEY_Arabic_5 0x1000665 /* U+0665 ARABIC-INDIC DIGIT FIVE */ +#define XKB_KEY_Arabic_6 0x1000666 /* U+0666 ARABIC-INDIC DIGIT SIX */ +#define XKB_KEY_Arabic_7 0x1000667 /* U+0667 ARABIC-INDIC DIGIT SEVEN */ +#define XKB_KEY_Arabic_8 0x1000668 /* U+0668 ARABIC-INDIC DIGIT EIGHT */ +#define XKB_KEY_Arabic_9 0x1000669 /* U+0669 ARABIC-INDIC DIGIT NINE */ +#define XKB_KEY_Arabic_semicolon 0x05bb /* U+061B ARABIC SEMICOLON */ +#define XKB_KEY_Arabic_question_mark 0x05bf /* U+061F ARABIC QUESTION MARK */ +#define XKB_KEY_Arabic_hamza 0x05c1 /* U+0621 ARABIC LETTER HAMZA */ +#define XKB_KEY_Arabic_maddaonalef 0x05c2 /* U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE */ +#define XKB_KEY_Arabic_hamzaonalef 0x05c3 /* U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE */ +#define XKB_KEY_Arabic_hamzaonwaw 0x05c4 /* U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE */ +#define XKB_KEY_Arabic_hamzaunderalef 0x05c5 /* U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW */ +#define XKB_KEY_Arabic_hamzaonyeh 0x05c6 /* U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE */ +#define XKB_KEY_Arabic_alef 0x05c7 /* U+0627 ARABIC LETTER ALEF */ +#define XKB_KEY_Arabic_beh 0x05c8 /* U+0628 ARABIC LETTER BEH */ +#define XKB_KEY_Arabic_tehmarbuta 0x05c9 /* U+0629 ARABIC LETTER TEH MARBUTA */ +#define XKB_KEY_Arabic_teh 0x05ca /* U+062A ARABIC LETTER TEH */ +#define XKB_KEY_Arabic_theh 0x05cb /* U+062B ARABIC LETTER THEH */ +#define XKB_KEY_Arabic_jeem 0x05cc /* U+062C ARABIC LETTER JEEM */ +#define XKB_KEY_Arabic_hah 0x05cd /* U+062D ARABIC LETTER HAH */ +#define XKB_KEY_Arabic_khah 0x05ce /* U+062E ARABIC LETTER KHAH */ +#define XKB_KEY_Arabic_dal 0x05cf /* U+062F ARABIC LETTER DAL */ +#define XKB_KEY_Arabic_thal 0x05d0 /* U+0630 ARABIC LETTER THAL */ +#define XKB_KEY_Arabic_ra 0x05d1 /* U+0631 ARABIC LETTER REH */ +#define XKB_KEY_Arabic_zain 0x05d2 /* U+0632 ARABIC LETTER ZAIN */ +#define XKB_KEY_Arabic_seen 0x05d3 /* U+0633 ARABIC LETTER SEEN */ +#define XKB_KEY_Arabic_sheen 0x05d4 /* U+0634 ARABIC LETTER SHEEN */ +#define XKB_KEY_Arabic_sad 0x05d5 /* U+0635 ARABIC LETTER SAD */ +#define XKB_KEY_Arabic_dad 0x05d6 /* U+0636 ARABIC LETTER DAD */ +#define XKB_KEY_Arabic_tah 0x05d7 /* U+0637 ARABIC LETTER TAH */ +#define XKB_KEY_Arabic_zah 0x05d8 /* U+0638 ARABIC LETTER ZAH */ +#define XKB_KEY_Arabic_ain 0x05d9 /* U+0639 ARABIC LETTER AIN */ +#define XKB_KEY_Arabic_ghain 0x05da /* U+063A ARABIC LETTER GHAIN */ +#define XKB_KEY_Arabic_tatweel 0x05e0 /* U+0640 ARABIC TATWEEL */ +#define XKB_KEY_Arabic_feh 0x05e1 /* U+0641 ARABIC LETTER FEH */ +#define XKB_KEY_Arabic_qaf 0x05e2 /* U+0642 ARABIC LETTER QAF */ +#define XKB_KEY_Arabic_kaf 0x05e3 /* U+0643 ARABIC LETTER KAF */ +#define XKB_KEY_Arabic_lam 0x05e4 /* U+0644 ARABIC LETTER LAM */ +#define XKB_KEY_Arabic_meem 0x05e5 /* U+0645 ARABIC LETTER MEEM */ +#define XKB_KEY_Arabic_noon 0x05e6 /* U+0646 ARABIC LETTER NOON */ +#define XKB_KEY_Arabic_ha 0x05e7 /* U+0647 ARABIC LETTER HEH */ +#define XKB_KEY_Arabic_heh 0x05e7 /* deprecated */ +#define XKB_KEY_Arabic_waw 0x05e8 /* U+0648 ARABIC LETTER WAW */ +#define XKB_KEY_Arabic_alefmaksura 0x05e9 /* U+0649 ARABIC LETTER ALEF MAKSURA */ +#define XKB_KEY_Arabic_yeh 0x05ea /* U+064A ARABIC LETTER YEH */ +#define XKB_KEY_Arabic_fathatan 0x05eb /* U+064B ARABIC FATHATAN */ +#define XKB_KEY_Arabic_dammatan 0x05ec /* U+064C ARABIC DAMMATAN */ +#define XKB_KEY_Arabic_kasratan 0x05ed /* U+064D ARABIC KASRATAN */ +#define XKB_KEY_Arabic_fatha 0x05ee /* U+064E ARABIC FATHA */ +#define XKB_KEY_Arabic_damma 0x05ef /* U+064F ARABIC DAMMA */ +#define XKB_KEY_Arabic_kasra 0x05f0 /* U+0650 ARABIC KASRA */ +#define XKB_KEY_Arabic_shadda 0x05f1 /* U+0651 ARABIC SHADDA */ +#define XKB_KEY_Arabic_sukun 0x05f2 /* U+0652 ARABIC SUKUN */ +#define XKB_KEY_Arabic_madda_above 0x1000653 /* U+0653 ARABIC MADDAH ABOVE */ +#define XKB_KEY_Arabic_hamza_above 0x1000654 /* U+0654 ARABIC HAMZA ABOVE */ +#define XKB_KEY_Arabic_hamza_below 0x1000655 /* U+0655 ARABIC HAMZA BELOW */ +#define XKB_KEY_Arabic_jeh 0x1000698 /* U+0698 ARABIC LETTER JEH */ +#define XKB_KEY_Arabic_veh 0x10006a4 /* U+06A4 ARABIC LETTER VEH */ +#define XKB_KEY_Arabic_keheh 0x10006a9 /* U+06A9 ARABIC LETTER KEHEH */ +#define XKB_KEY_Arabic_gaf 0x10006af /* U+06AF ARABIC LETTER GAF */ +#define XKB_KEY_Arabic_noon_ghunna 0x10006ba /* U+06BA ARABIC LETTER NOON GHUNNA */ +#define XKB_KEY_Arabic_heh_doachashmee 0x10006be /* U+06BE ARABIC LETTER HEH DOACHASHMEE */ +#define XKB_KEY_Farsi_yeh 0x10006cc /* U+06CC ARABIC LETTER FARSI YEH */ +#define XKB_KEY_Arabic_farsi_yeh 0x10006cc /* deprecated alias for Farsi_yeh */ +#define XKB_KEY_Arabic_yeh_baree 0x10006d2 /* U+06D2 ARABIC LETTER YEH BARREE */ +#define XKB_KEY_Arabic_heh_goal 0x10006c1 /* U+06C1 ARABIC LETTER HEH GOAL */ +#define XKB_KEY_Arabic_switch 0xff7e /* non-deprecated alias for Mode_switch */ + +/* + * Cyrillic + * Byte 3 = 6 + */ +#define XKB_KEY_Cyrillic_GHE_bar 0x1000492 /* U+0492 CYRILLIC CAPITAL LETTER GHE WITH STROKE */ +#define XKB_KEY_Cyrillic_ghe_bar 0x1000493 /* U+0493 CYRILLIC SMALL LETTER GHE WITH STROKE */ +#define XKB_KEY_Cyrillic_ZHE_descender 0x1000496 /* U+0496 CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER */ +#define XKB_KEY_Cyrillic_zhe_descender 0x1000497 /* U+0497 CYRILLIC SMALL LETTER ZHE WITH DESCENDER */ +#define XKB_KEY_Cyrillic_KA_descender 0x100049a /* U+049A CYRILLIC CAPITAL LETTER KA WITH DESCENDER */ +#define XKB_KEY_Cyrillic_ka_descender 0x100049b /* U+049B CYRILLIC SMALL LETTER KA WITH DESCENDER */ +#define XKB_KEY_Cyrillic_KA_vertstroke 0x100049c /* U+049C CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */ +#define XKB_KEY_Cyrillic_ka_vertstroke 0x100049d /* U+049D CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE */ +#define XKB_KEY_Cyrillic_EN_descender 0x10004a2 /* U+04A2 CYRILLIC CAPITAL LETTER EN WITH DESCENDER */ +#define XKB_KEY_Cyrillic_en_descender 0x10004a3 /* U+04A3 CYRILLIC SMALL LETTER EN WITH DESCENDER */ +#define XKB_KEY_Cyrillic_U_straight 0x10004ae /* U+04AE CYRILLIC CAPITAL LETTER STRAIGHT U */ +#define XKB_KEY_Cyrillic_u_straight 0x10004af /* U+04AF CYRILLIC SMALL LETTER STRAIGHT U */ +#define XKB_KEY_Cyrillic_U_straight_bar 0x10004b0 /* U+04B0 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */ +#define XKB_KEY_Cyrillic_u_straight_bar 0x10004b1 /* U+04B1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE */ +#define XKB_KEY_Cyrillic_HA_descender 0x10004b2 /* U+04B2 CYRILLIC CAPITAL LETTER HA WITH DESCENDER */ +#define XKB_KEY_Cyrillic_ha_descender 0x10004b3 /* U+04B3 CYRILLIC SMALL LETTER HA WITH DESCENDER */ +#define XKB_KEY_Cyrillic_CHE_descender 0x10004b6 /* U+04B6 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */ +#define XKB_KEY_Cyrillic_che_descender 0x10004b7 /* U+04B7 CYRILLIC SMALL LETTER CHE WITH DESCENDER */ +#define XKB_KEY_Cyrillic_CHE_vertstroke 0x10004b8 /* U+04B8 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */ +#define XKB_KEY_Cyrillic_che_vertstroke 0x10004b9 /* U+04B9 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE */ +#define XKB_KEY_Cyrillic_SHHA 0x10004ba /* U+04BA CYRILLIC CAPITAL LETTER SHHA */ +#define XKB_KEY_Cyrillic_shha 0x10004bb /* U+04BB CYRILLIC SMALL LETTER SHHA */ + +#define XKB_KEY_Cyrillic_SCHWA 0x10004d8 /* U+04D8 CYRILLIC CAPITAL LETTER SCHWA */ +#define XKB_KEY_Cyrillic_schwa 0x10004d9 /* U+04D9 CYRILLIC SMALL LETTER SCHWA */ +#define XKB_KEY_Cyrillic_I_macron 0x10004e2 /* U+04E2 CYRILLIC CAPITAL LETTER I WITH MACRON */ +#define XKB_KEY_Cyrillic_i_macron 0x10004e3 /* U+04E3 CYRILLIC SMALL LETTER I WITH MACRON */ +#define XKB_KEY_Cyrillic_O_bar 0x10004e8 /* U+04E8 CYRILLIC CAPITAL LETTER BARRED O */ +#define XKB_KEY_Cyrillic_o_bar 0x10004e9 /* U+04E9 CYRILLIC SMALL LETTER BARRED O */ +#define XKB_KEY_Cyrillic_U_macron 0x10004ee /* U+04EE CYRILLIC CAPITAL LETTER U WITH MACRON */ +#define XKB_KEY_Cyrillic_u_macron 0x10004ef /* U+04EF CYRILLIC SMALL LETTER U WITH MACRON */ + +#define XKB_KEY_Serbian_dje 0x06a1 /* U+0452 CYRILLIC SMALL LETTER DJE */ +#define XKB_KEY_Macedonia_gje 0x06a2 /* U+0453 CYRILLIC SMALL LETTER GJE */ +#define XKB_KEY_Cyrillic_io 0x06a3 /* U+0451 CYRILLIC SMALL LETTER IO */ +#define XKB_KEY_Ukrainian_ie 0x06a4 /* U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE */ +#define XKB_KEY_Ukranian_je 0x06a4 /* deprecated */ +#define XKB_KEY_Macedonia_dse 0x06a5 /* U+0455 CYRILLIC SMALL LETTER DZE */ +#define XKB_KEY_Ukrainian_i 0x06a6 /* U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ +#define XKB_KEY_Ukranian_i 0x06a6 /* deprecated */ +#define XKB_KEY_Ukrainian_yi 0x06a7 /* U+0457 CYRILLIC SMALL LETTER YI */ +#define XKB_KEY_Ukranian_yi 0x06a7 /* deprecated */ +#define XKB_KEY_Cyrillic_je 0x06a8 /* U+0458 CYRILLIC SMALL LETTER JE */ +#define XKB_KEY_Serbian_je 0x06a8 /* deprecated */ +#define XKB_KEY_Cyrillic_lje 0x06a9 /* U+0459 CYRILLIC SMALL LETTER LJE */ +#define XKB_KEY_Serbian_lje 0x06a9 /* deprecated */ +#define XKB_KEY_Cyrillic_nje 0x06aa /* U+045A CYRILLIC SMALL LETTER NJE */ +#define XKB_KEY_Serbian_nje 0x06aa /* deprecated */ +#define XKB_KEY_Serbian_tshe 0x06ab /* U+045B CYRILLIC SMALL LETTER TSHE */ +#define XKB_KEY_Macedonia_kje 0x06ac /* U+045C CYRILLIC SMALL LETTER KJE */ +#define XKB_KEY_Ukrainian_ghe_with_upturn 0x06ad /* U+0491 CYRILLIC SMALL LETTER GHE WITH UPTURN */ +#define XKB_KEY_Byelorussian_shortu 0x06ae /* U+045E CYRILLIC SMALL LETTER SHORT U */ +#define XKB_KEY_Cyrillic_dzhe 0x06af /* U+045F CYRILLIC SMALL LETTER DZHE */ +#define XKB_KEY_Serbian_dze 0x06af /* deprecated */ +#define XKB_KEY_numerosign 0x06b0 /* U+2116 NUMERO SIGN */ +#define XKB_KEY_Serbian_DJE 0x06b1 /* U+0402 CYRILLIC CAPITAL LETTER DJE */ +#define XKB_KEY_Macedonia_GJE 0x06b2 /* U+0403 CYRILLIC CAPITAL LETTER GJE */ +#define XKB_KEY_Cyrillic_IO 0x06b3 /* U+0401 CYRILLIC CAPITAL LETTER IO */ +#define XKB_KEY_Ukrainian_IE 0x06b4 /* U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE */ +#define XKB_KEY_Ukranian_JE 0x06b4 /* deprecated */ +#define XKB_KEY_Macedonia_DSE 0x06b5 /* U+0405 CYRILLIC CAPITAL LETTER DZE */ +#define XKB_KEY_Ukrainian_I 0x06b6 /* U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ +#define XKB_KEY_Ukranian_I 0x06b6 /* deprecated */ +#define XKB_KEY_Ukrainian_YI 0x06b7 /* U+0407 CYRILLIC CAPITAL LETTER YI */ +#define XKB_KEY_Ukranian_YI 0x06b7 /* deprecated */ +#define XKB_KEY_Cyrillic_JE 0x06b8 /* U+0408 CYRILLIC CAPITAL LETTER JE */ +#define XKB_KEY_Serbian_JE 0x06b8 /* deprecated */ +#define XKB_KEY_Cyrillic_LJE 0x06b9 /* U+0409 CYRILLIC CAPITAL LETTER LJE */ +#define XKB_KEY_Serbian_LJE 0x06b9 /* deprecated */ +#define XKB_KEY_Cyrillic_NJE 0x06ba /* U+040A CYRILLIC CAPITAL LETTER NJE */ +#define XKB_KEY_Serbian_NJE 0x06ba /* deprecated */ +#define XKB_KEY_Serbian_TSHE 0x06bb /* U+040B CYRILLIC CAPITAL LETTER TSHE */ +#define XKB_KEY_Macedonia_KJE 0x06bc /* U+040C CYRILLIC CAPITAL LETTER KJE */ +#define XKB_KEY_Ukrainian_GHE_WITH_UPTURN 0x06bd /* U+0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ +#define XKB_KEY_Byelorussian_SHORTU 0x06be /* U+040E CYRILLIC CAPITAL LETTER SHORT U */ +#define XKB_KEY_Cyrillic_DZHE 0x06bf /* U+040F CYRILLIC CAPITAL LETTER DZHE */ +#define XKB_KEY_Serbian_DZE 0x06bf /* deprecated */ +#define XKB_KEY_Cyrillic_yu 0x06c0 /* U+044E CYRILLIC SMALL LETTER YU */ +#define XKB_KEY_Cyrillic_a 0x06c1 /* U+0430 CYRILLIC SMALL LETTER A */ +#define XKB_KEY_Cyrillic_be 0x06c2 /* U+0431 CYRILLIC SMALL LETTER BE */ +#define XKB_KEY_Cyrillic_tse 0x06c3 /* U+0446 CYRILLIC SMALL LETTER TSE */ +#define XKB_KEY_Cyrillic_de 0x06c4 /* U+0434 CYRILLIC SMALL LETTER DE */ +#define XKB_KEY_Cyrillic_ie 0x06c5 /* U+0435 CYRILLIC SMALL LETTER IE */ +#define XKB_KEY_Cyrillic_ef 0x06c6 /* U+0444 CYRILLIC SMALL LETTER EF */ +#define XKB_KEY_Cyrillic_ghe 0x06c7 /* U+0433 CYRILLIC SMALL LETTER GHE */ +#define XKB_KEY_Cyrillic_ha 0x06c8 /* U+0445 CYRILLIC SMALL LETTER HA */ +#define XKB_KEY_Cyrillic_i 0x06c9 /* U+0438 CYRILLIC SMALL LETTER I */ +#define XKB_KEY_Cyrillic_shorti 0x06ca /* U+0439 CYRILLIC SMALL LETTER SHORT I */ +#define XKB_KEY_Cyrillic_ka 0x06cb /* U+043A CYRILLIC SMALL LETTER KA */ +#define XKB_KEY_Cyrillic_el 0x06cc /* U+043B CYRILLIC SMALL LETTER EL */ +#define XKB_KEY_Cyrillic_em 0x06cd /* U+043C CYRILLIC SMALL LETTER EM */ +#define XKB_KEY_Cyrillic_en 0x06ce /* U+043D CYRILLIC SMALL LETTER EN */ +#define XKB_KEY_Cyrillic_o 0x06cf /* U+043E CYRILLIC SMALL LETTER O */ +#define XKB_KEY_Cyrillic_pe 0x06d0 /* U+043F CYRILLIC SMALL LETTER PE */ +#define XKB_KEY_Cyrillic_ya 0x06d1 /* U+044F CYRILLIC SMALL LETTER YA */ +#define XKB_KEY_Cyrillic_er 0x06d2 /* U+0440 CYRILLIC SMALL LETTER ER */ +#define XKB_KEY_Cyrillic_es 0x06d3 /* U+0441 CYRILLIC SMALL LETTER ES */ +#define XKB_KEY_Cyrillic_te 0x06d4 /* U+0442 CYRILLIC SMALL LETTER TE */ +#define XKB_KEY_Cyrillic_u 0x06d5 /* U+0443 CYRILLIC SMALL LETTER U */ +#define XKB_KEY_Cyrillic_zhe 0x06d6 /* U+0436 CYRILLIC SMALL LETTER ZHE */ +#define XKB_KEY_Cyrillic_ve 0x06d7 /* U+0432 CYRILLIC SMALL LETTER VE */ +#define XKB_KEY_Cyrillic_softsign 0x06d8 /* U+044C CYRILLIC SMALL LETTER SOFT SIGN */ +#define XKB_KEY_Cyrillic_yeru 0x06d9 /* U+044B CYRILLIC SMALL LETTER YERU */ +#define XKB_KEY_Cyrillic_ze 0x06da /* U+0437 CYRILLIC SMALL LETTER ZE */ +#define XKB_KEY_Cyrillic_sha 0x06db /* U+0448 CYRILLIC SMALL LETTER SHA */ +#define XKB_KEY_Cyrillic_e 0x06dc /* U+044D CYRILLIC SMALL LETTER E */ +#define XKB_KEY_Cyrillic_shcha 0x06dd /* U+0449 CYRILLIC SMALL LETTER SHCHA */ +#define XKB_KEY_Cyrillic_che 0x06de /* U+0447 CYRILLIC SMALL LETTER CHE */ +#define XKB_KEY_Cyrillic_hardsign 0x06df /* U+044A CYRILLIC SMALL LETTER HARD SIGN */ +#define XKB_KEY_Cyrillic_YU 0x06e0 /* U+042E CYRILLIC CAPITAL LETTER YU */ +#define XKB_KEY_Cyrillic_A 0x06e1 /* U+0410 CYRILLIC CAPITAL LETTER A */ +#define XKB_KEY_Cyrillic_BE 0x06e2 /* U+0411 CYRILLIC CAPITAL LETTER BE */ +#define XKB_KEY_Cyrillic_TSE 0x06e3 /* U+0426 CYRILLIC CAPITAL LETTER TSE */ +#define XKB_KEY_Cyrillic_DE 0x06e4 /* U+0414 CYRILLIC CAPITAL LETTER DE */ +#define XKB_KEY_Cyrillic_IE 0x06e5 /* U+0415 CYRILLIC CAPITAL LETTER IE */ +#define XKB_KEY_Cyrillic_EF 0x06e6 /* U+0424 CYRILLIC CAPITAL LETTER EF */ +#define XKB_KEY_Cyrillic_GHE 0x06e7 /* U+0413 CYRILLIC CAPITAL LETTER GHE */ +#define XKB_KEY_Cyrillic_HA 0x06e8 /* U+0425 CYRILLIC CAPITAL LETTER HA */ +#define XKB_KEY_Cyrillic_I 0x06e9 /* U+0418 CYRILLIC CAPITAL LETTER I */ +#define XKB_KEY_Cyrillic_SHORTI 0x06ea /* U+0419 CYRILLIC CAPITAL LETTER SHORT I */ +#define XKB_KEY_Cyrillic_KA 0x06eb /* U+041A CYRILLIC CAPITAL LETTER KA */ +#define XKB_KEY_Cyrillic_EL 0x06ec /* U+041B CYRILLIC CAPITAL LETTER EL */ +#define XKB_KEY_Cyrillic_EM 0x06ed /* U+041C CYRILLIC CAPITAL LETTER EM */ +#define XKB_KEY_Cyrillic_EN 0x06ee /* U+041D CYRILLIC CAPITAL LETTER EN */ +#define XKB_KEY_Cyrillic_O 0x06ef /* U+041E CYRILLIC CAPITAL LETTER O */ +#define XKB_KEY_Cyrillic_PE 0x06f0 /* U+041F CYRILLIC CAPITAL LETTER PE */ +#define XKB_KEY_Cyrillic_YA 0x06f1 /* U+042F CYRILLIC CAPITAL LETTER YA */ +#define XKB_KEY_Cyrillic_ER 0x06f2 /* U+0420 CYRILLIC CAPITAL LETTER ER */ +#define XKB_KEY_Cyrillic_ES 0x06f3 /* U+0421 CYRILLIC CAPITAL LETTER ES */ +#define XKB_KEY_Cyrillic_TE 0x06f4 /* U+0422 CYRILLIC CAPITAL LETTER TE */ +#define XKB_KEY_Cyrillic_U 0x06f5 /* U+0423 CYRILLIC CAPITAL LETTER U */ +#define XKB_KEY_Cyrillic_ZHE 0x06f6 /* U+0416 CYRILLIC CAPITAL LETTER ZHE */ +#define XKB_KEY_Cyrillic_VE 0x06f7 /* U+0412 CYRILLIC CAPITAL LETTER VE */ +#define XKB_KEY_Cyrillic_SOFTSIGN 0x06f8 /* U+042C CYRILLIC CAPITAL LETTER SOFT SIGN */ +#define XKB_KEY_Cyrillic_YERU 0x06f9 /* U+042B CYRILLIC CAPITAL LETTER YERU */ +#define XKB_KEY_Cyrillic_ZE 0x06fa /* U+0417 CYRILLIC CAPITAL LETTER ZE */ +#define XKB_KEY_Cyrillic_SHA 0x06fb /* U+0428 CYRILLIC CAPITAL LETTER SHA */ +#define XKB_KEY_Cyrillic_E 0x06fc /* U+042D CYRILLIC CAPITAL LETTER E */ +#define XKB_KEY_Cyrillic_SHCHA 0x06fd /* U+0429 CYRILLIC CAPITAL LETTER SHCHA */ +#define XKB_KEY_Cyrillic_CHE 0x06fe /* U+0427 CYRILLIC CAPITAL LETTER CHE */ +#define XKB_KEY_Cyrillic_HARDSIGN 0x06ff /* U+042A CYRILLIC CAPITAL LETTER HARD SIGN */ + +/* + * Greek + * (based on an early draft of, and not quite identical to, ISO/IEC 8859-7) + * Byte 3 = 7 + */ + +#define XKB_KEY_Greek_ALPHAaccent 0x07a1 /* U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS */ +#define XKB_KEY_Greek_EPSILONaccent 0x07a2 /* U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS */ +#define XKB_KEY_Greek_ETAaccent 0x07a3 /* U+0389 GREEK CAPITAL LETTER ETA WITH TONOS */ +#define XKB_KEY_Greek_IOTAaccent 0x07a4 /* U+038A GREEK CAPITAL LETTER IOTA WITH TONOS */ +#define XKB_KEY_Greek_IOTAdieresis 0x07a5 /* U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ +#define XKB_KEY_Greek_IOTAdiaeresis 0x07a5 /* deprecated (old typo) */ +#define XKB_KEY_Greek_OMICRONaccent 0x07a7 /* U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS */ +#define XKB_KEY_Greek_UPSILONaccent 0x07a8 /* U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS */ +#define XKB_KEY_Greek_UPSILONdieresis 0x07a9 /* U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ +#define XKB_KEY_Greek_OMEGAaccent 0x07ab /* U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS */ +#define XKB_KEY_Greek_accentdieresis 0x07ae /* U+0385 GREEK DIALYTIKA TONOS */ +#define XKB_KEY_Greek_horizbar 0x07af /* U+2015 HORIZONTAL BAR */ +#define XKB_KEY_Greek_alphaaccent 0x07b1 /* U+03AC GREEK SMALL LETTER ALPHA WITH TONOS */ +#define XKB_KEY_Greek_epsilonaccent 0x07b2 /* U+03AD GREEK SMALL LETTER EPSILON WITH TONOS */ +#define XKB_KEY_Greek_etaaccent 0x07b3 /* U+03AE GREEK SMALL LETTER ETA WITH TONOS */ +#define XKB_KEY_Greek_iotaaccent 0x07b4 /* U+03AF GREEK SMALL LETTER IOTA WITH TONOS */ +#define XKB_KEY_Greek_iotadieresis 0x07b5 /* U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA */ +#define XKB_KEY_Greek_iotaaccentdieresis 0x07b6 /* U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ +#define XKB_KEY_Greek_omicronaccent 0x07b7 /* U+03CC GREEK SMALL LETTER OMICRON WITH TONOS */ +#define XKB_KEY_Greek_upsilonaccent 0x07b8 /* U+03CD GREEK SMALL LETTER UPSILON WITH TONOS */ +#define XKB_KEY_Greek_upsilondieresis 0x07b9 /* U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ +#define XKB_KEY_Greek_upsilonaccentdieresis 0x07ba /* U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ +#define XKB_KEY_Greek_omegaaccent 0x07bb /* U+03CE GREEK SMALL LETTER OMEGA WITH TONOS */ +#define XKB_KEY_Greek_ALPHA 0x07c1 /* U+0391 GREEK CAPITAL LETTER ALPHA */ +#define XKB_KEY_Greek_BETA 0x07c2 /* U+0392 GREEK CAPITAL LETTER BETA */ +#define XKB_KEY_Greek_GAMMA 0x07c3 /* U+0393 GREEK CAPITAL LETTER GAMMA */ +#define XKB_KEY_Greek_DELTA 0x07c4 /* U+0394 GREEK CAPITAL LETTER DELTA */ +#define XKB_KEY_Greek_EPSILON 0x07c5 /* U+0395 GREEK CAPITAL LETTER EPSILON */ +#define XKB_KEY_Greek_ZETA 0x07c6 /* U+0396 GREEK CAPITAL LETTER ZETA */ +#define XKB_KEY_Greek_ETA 0x07c7 /* U+0397 GREEK CAPITAL LETTER ETA */ +#define XKB_KEY_Greek_THETA 0x07c8 /* U+0398 GREEK CAPITAL LETTER THETA */ +#define XKB_KEY_Greek_IOTA 0x07c9 /* U+0399 GREEK CAPITAL LETTER IOTA */ +#define XKB_KEY_Greek_KAPPA 0x07ca /* U+039A GREEK CAPITAL LETTER KAPPA */ +#define XKB_KEY_Greek_LAMDA 0x07cb /* U+039B GREEK CAPITAL LETTER LAMDA */ +#define XKB_KEY_Greek_LAMBDA 0x07cb /* non-deprecated alias for Greek_LAMDA */ +#define XKB_KEY_Greek_MU 0x07cc /* U+039C GREEK CAPITAL LETTER MU */ +#define XKB_KEY_Greek_NU 0x07cd /* U+039D GREEK CAPITAL LETTER NU */ +#define XKB_KEY_Greek_XI 0x07ce /* U+039E GREEK CAPITAL LETTER XI */ +#define XKB_KEY_Greek_OMICRON 0x07cf /* U+039F GREEK CAPITAL LETTER OMICRON */ +#define XKB_KEY_Greek_PI 0x07d0 /* U+03A0 GREEK CAPITAL LETTER PI */ +#define XKB_KEY_Greek_RHO 0x07d1 /* U+03A1 GREEK CAPITAL LETTER RHO */ +#define XKB_KEY_Greek_SIGMA 0x07d2 /* U+03A3 GREEK CAPITAL LETTER SIGMA */ +#define XKB_KEY_Greek_TAU 0x07d4 /* U+03A4 GREEK CAPITAL LETTER TAU */ +#define XKB_KEY_Greek_UPSILON 0x07d5 /* U+03A5 GREEK CAPITAL LETTER UPSILON */ +#define XKB_KEY_Greek_PHI 0x07d6 /* U+03A6 GREEK CAPITAL LETTER PHI */ +#define XKB_KEY_Greek_CHI 0x07d7 /* U+03A7 GREEK CAPITAL LETTER CHI */ +#define XKB_KEY_Greek_PSI 0x07d8 /* U+03A8 GREEK CAPITAL LETTER PSI */ +#define XKB_KEY_Greek_OMEGA 0x07d9 /* U+03A9 GREEK CAPITAL LETTER OMEGA */ +#define XKB_KEY_Greek_alpha 0x07e1 /* U+03B1 GREEK SMALL LETTER ALPHA */ +#define XKB_KEY_Greek_beta 0x07e2 /* U+03B2 GREEK SMALL LETTER BETA */ +#define XKB_KEY_Greek_gamma 0x07e3 /* U+03B3 GREEK SMALL LETTER GAMMA */ +#define XKB_KEY_Greek_delta 0x07e4 /* U+03B4 GREEK SMALL LETTER DELTA */ +#define XKB_KEY_Greek_epsilon 0x07e5 /* U+03B5 GREEK SMALL LETTER EPSILON */ +#define XKB_KEY_Greek_zeta 0x07e6 /* U+03B6 GREEK SMALL LETTER ZETA */ +#define XKB_KEY_Greek_eta 0x07e7 /* U+03B7 GREEK SMALL LETTER ETA */ +#define XKB_KEY_Greek_theta 0x07e8 /* U+03B8 GREEK SMALL LETTER THETA */ +#define XKB_KEY_Greek_iota 0x07e9 /* U+03B9 GREEK SMALL LETTER IOTA */ +#define XKB_KEY_Greek_kappa 0x07ea /* U+03BA GREEK SMALL LETTER KAPPA */ +#define XKB_KEY_Greek_lamda 0x07eb /* U+03BB GREEK SMALL LETTER LAMDA */ +#define XKB_KEY_Greek_lambda 0x07eb /* non-deprecated alias for Greek_lamda */ +#define XKB_KEY_Greek_mu 0x07ec /* U+03BC GREEK SMALL LETTER MU */ +#define XKB_KEY_Greek_nu 0x07ed /* U+03BD GREEK SMALL LETTER NU */ +#define XKB_KEY_Greek_xi 0x07ee /* U+03BE GREEK SMALL LETTER XI */ +#define XKB_KEY_Greek_omicron 0x07ef /* U+03BF GREEK SMALL LETTER OMICRON */ +#define XKB_KEY_Greek_pi 0x07f0 /* U+03C0 GREEK SMALL LETTER PI */ +#define XKB_KEY_Greek_rho 0x07f1 /* U+03C1 GREEK SMALL LETTER RHO */ +#define XKB_KEY_Greek_sigma 0x07f2 /* U+03C3 GREEK SMALL LETTER SIGMA */ +#define XKB_KEY_Greek_finalsmallsigma 0x07f3 /* U+03C2 GREEK SMALL LETTER FINAL SIGMA */ +#define XKB_KEY_Greek_tau 0x07f4 /* U+03C4 GREEK SMALL LETTER TAU */ +#define XKB_KEY_Greek_upsilon 0x07f5 /* U+03C5 GREEK SMALL LETTER UPSILON */ +#define XKB_KEY_Greek_phi 0x07f6 /* U+03C6 GREEK SMALL LETTER PHI */ +#define XKB_KEY_Greek_chi 0x07f7 /* U+03C7 GREEK SMALL LETTER CHI */ +#define XKB_KEY_Greek_psi 0x07f8 /* U+03C8 GREEK SMALL LETTER PSI */ +#define XKB_KEY_Greek_omega 0x07f9 /* U+03C9 GREEK SMALL LETTER OMEGA */ +#define XKB_KEY_Greek_switch 0xff7e /* non-deprecated alias for Mode_switch */ + +/* + * Technical + * (from the DEC VT330/VT420 Technical Character Set, http://vt100.net/charsets/technical.html) + * Byte 3 = 8 + */ + +#define XKB_KEY_leftradical 0x08a1 /* U+23B7 RADICAL SYMBOL BOTTOM */ +#define XKB_KEY_topleftradical 0x08a2 /*(U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT)*/ +#define XKB_KEY_horizconnector 0x08a3 /*(U+2500 BOX DRAWINGS LIGHT HORIZONTAL)*/ +#define XKB_KEY_topintegral 0x08a4 /* U+2320 TOP HALF INTEGRAL */ +#define XKB_KEY_botintegral 0x08a5 /* U+2321 BOTTOM HALF INTEGRAL */ +#define XKB_KEY_vertconnector 0x08a6 /*(U+2502 BOX DRAWINGS LIGHT VERTICAL)*/ +#define XKB_KEY_topleftsqbracket 0x08a7 /* U+23A1 LEFT SQUARE BRACKET UPPER CORNER */ +#define XKB_KEY_botleftsqbracket 0x08a8 /* U+23A3 LEFT SQUARE BRACKET LOWER CORNER */ +#define XKB_KEY_toprightsqbracket 0x08a9 /* U+23A4 RIGHT SQUARE BRACKET UPPER CORNER */ +#define XKB_KEY_botrightsqbracket 0x08aa /* U+23A6 RIGHT SQUARE BRACKET LOWER CORNER */ +#define XKB_KEY_topleftparens 0x08ab /* U+239B LEFT PARENTHESIS UPPER HOOK */ +#define XKB_KEY_botleftparens 0x08ac /* U+239D LEFT PARENTHESIS LOWER HOOK */ +#define XKB_KEY_toprightparens 0x08ad /* U+239E RIGHT PARENTHESIS UPPER HOOK */ +#define XKB_KEY_botrightparens 0x08ae /* U+23A0 RIGHT PARENTHESIS LOWER HOOK */ +#define XKB_KEY_leftmiddlecurlybrace 0x08af /* U+23A8 LEFT CURLY BRACKET MIDDLE PIECE */ +#define XKB_KEY_rightmiddlecurlybrace 0x08b0 /* U+23AC RIGHT CURLY BRACKET MIDDLE PIECE */ +#define XKB_KEY_topleftsummation 0x08b1 +#define XKB_KEY_botleftsummation 0x08b2 +#define XKB_KEY_topvertsummationconnector 0x08b3 +#define XKB_KEY_botvertsummationconnector 0x08b4 +#define XKB_KEY_toprightsummation 0x08b5 +#define XKB_KEY_botrightsummation 0x08b6 +#define XKB_KEY_rightmiddlesummation 0x08b7 +#define XKB_KEY_lessthanequal 0x08bc /* U+2264 LESS-THAN OR EQUAL TO */ +#define XKB_KEY_notequal 0x08bd /* U+2260 NOT EQUAL TO */ +#define XKB_KEY_greaterthanequal 0x08be /* U+2265 GREATER-THAN OR EQUAL TO */ +#define XKB_KEY_integral 0x08bf /* U+222B INTEGRAL */ +#define XKB_KEY_therefore 0x08c0 /* U+2234 THEREFORE */ +#define XKB_KEY_variation 0x08c1 /* U+221D PROPORTIONAL TO */ +#define XKB_KEY_infinity 0x08c2 /* U+221E INFINITY */ +#define XKB_KEY_nabla 0x08c5 /* U+2207 NABLA */ +#define XKB_KEY_approximate 0x08c8 /* U+223C TILDE OPERATOR */ +#define XKB_KEY_similarequal 0x08c9 /* U+2243 ASYMPTOTICALLY EQUAL TO */ +#define XKB_KEY_ifonlyif 0x08cd /* U+21D4 LEFT RIGHT DOUBLE ARROW */ +#define XKB_KEY_implies 0x08ce /* U+21D2 RIGHTWARDS DOUBLE ARROW */ +#define XKB_KEY_identical 0x08cf /* U+2261 IDENTICAL TO */ +#define XKB_KEY_radical 0x08d6 /* U+221A SQUARE ROOT */ +#define XKB_KEY_includedin 0x08da /* U+2282 SUBSET OF */ +#define XKB_KEY_includes 0x08db /* U+2283 SUPERSET OF */ +#define XKB_KEY_intersection 0x08dc /* U+2229 INTERSECTION */ +#define XKB_KEY_union 0x08dd /* U+222A UNION */ +#define XKB_KEY_logicaland 0x08de /* U+2227 LOGICAL AND */ +#define XKB_KEY_logicalor 0x08df /* U+2228 LOGICAL OR */ +#define XKB_KEY_partialderivative 0x08ef /* U+2202 PARTIAL DIFFERENTIAL */ +#define XKB_KEY_function 0x08f6 /* U+0192 LATIN SMALL LETTER F WITH HOOK */ +#define XKB_KEY_leftarrow 0x08fb /* U+2190 LEFTWARDS ARROW */ +#define XKB_KEY_uparrow 0x08fc /* U+2191 UPWARDS ARROW */ +#define XKB_KEY_rightarrow 0x08fd /* U+2192 RIGHTWARDS ARROW */ +#define XKB_KEY_downarrow 0x08fe /* U+2193 DOWNWARDS ARROW */ + +/* + * Special + * (from the DEC VT100 Special Graphics Character Set) + * Byte 3 = 9 + */ + +#define XKB_KEY_blank 0x09df +#define XKB_KEY_soliddiamond 0x09e0 /* U+25C6 BLACK DIAMOND */ +#define XKB_KEY_checkerboard 0x09e1 /* U+2592 MEDIUM SHADE */ +#define XKB_KEY_ht 0x09e2 /* U+2409 SYMBOL FOR HORIZONTAL TABULATION */ +#define XKB_KEY_ff 0x09e3 /* U+240C SYMBOL FOR FORM FEED */ +#define XKB_KEY_cr 0x09e4 /* U+240D SYMBOL FOR CARRIAGE RETURN */ +#define XKB_KEY_lf 0x09e5 /* U+240A SYMBOL FOR LINE FEED */ +#define XKB_KEY_nl 0x09e8 /* U+2424 SYMBOL FOR NEWLINE */ +#define XKB_KEY_vt 0x09e9 /* U+240B SYMBOL FOR VERTICAL TABULATION */ +#define XKB_KEY_lowrightcorner 0x09ea /* U+2518 BOX DRAWINGS LIGHT UP AND LEFT */ +#define XKB_KEY_uprightcorner 0x09eb /* U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT */ +#define XKB_KEY_upleftcorner 0x09ec /* U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT */ +#define XKB_KEY_lowleftcorner 0x09ed /* U+2514 BOX DRAWINGS LIGHT UP AND RIGHT */ +#define XKB_KEY_crossinglines 0x09ee /* U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ +#define XKB_KEY_horizlinescan1 0x09ef /* U+23BA HORIZONTAL SCAN LINE-1 */ +#define XKB_KEY_horizlinescan3 0x09f0 /* U+23BB HORIZONTAL SCAN LINE-3 */ +#define XKB_KEY_horizlinescan5 0x09f1 /* U+2500 BOX DRAWINGS LIGHT HORIZONTAL */ +#define XKB_KEY_horizlinescan7 0x09f2 /* U+23BC HORIZONTAL SCAN LINE-7 */ +#define XKB_KEY_horizlinescan9 0x09f3 /* U+23BD HORIZONTAL SCAN LINE-9 */ +#define XKB_KEY_leftt 0x09f4 /* U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ +#define XKB_KEY_rightt 0x09f5 /* U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT */ +#define XKB_KEY_bott 0x09f6 /* U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL */ +#define XKB_KEY_topt 0x09f7 /* U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ +#define XKB_KEY_vertbar 0x09f8 /* U+2502 BOX DRAWINGS LIGHT VERTICAL */ + +/* + * Publishing + * (these are probably from a long forgotten DEC Publishing + * font that once shipped with DECwrite) + * Byte 3 = 0x0a + */ + +#define XKB_KEY_emspace 0x0aa1 /* U+2003 EM SPACE */ +#define XKB_KEY_enspace 0x0aa2 /* U+2002 EN SPACE */ +#define XKB_KEY_em3space 0x0aa3 /* U+2004 THREE-PER-EM SPACE */ +#define XKB_KEY_em4space 0x0aa4 /* U+2005 FOUR-PER-EM SPACE */ +#define XKB_KEY_digitspace 0x0aa5 /* U+2007 FIGURE SPACE */ +#define XKB_KEY_punctspace 0x0aa6 /* U+2008 PUNCTUATION SPACE */ +#define XKB_KEY_thinspace 0x0aa7 /* U+2009 THIN SPACE */ +#define XKB_KEY_hairspace 0x0aa8 /* U+200A HAIR SPACE */ +#define XKB_KEY_emdash 0x0aa9 /* U+2014 EM DASH */ +#define XKB_KEY_endash 0x0aaa /* U+2013 EN DASH */ +#define XKB_KEY_signifblank 0x0aac /*(U+2423 OPEN BOX)*/ +#define XKB_KEY_ellipsis 0x0aae /* U+2026 HORIZONTAL ELLIPSIS */ +#define XKB_KEY_doubbaselinedot 0x0aaf /* U+2025 TWO DOT LEADER */ +#define XKB_KEY_onethird 0x0ab0 /* U+2153 VULGAR FRACTION ONE THIRD */ +#define XKB_KEY_twothirds 0x0ab1 /* U+2154 VULGAR FRACTION TWO THIRDS */ +#define XKB_KEY_onefifth 0x0ab2 /* U+2155 VULGAR FRACTION ONE FIFTH */ +#define XKB_KEY_twofifths 0x0ab3 /* U+2156 VULGAR FRACTION TWO FIFTHS */ +#define XKB_KEY_threefifths 0x0ab4 /* U+2157 VULGAR FRACTION THREE FIFTHS */ +#define XKB_KEY_fourfifths 0x0ab5 /* U+2158 VULGAR FRACTION FOUR FIFTHS */ +#define XKB_KEY_onesixth 0x0ab6 /* U+2159 VULGAR FRACTION ONE SIXTH */ +#define XKB_KEY_fivesixths 0x0ab7 /* U+215A VULGAR FRACTION FIVE SIXTHS */ +#define XKB_KEY_careof 0x0ab8 /* U+2105 CARE OF */ +#define XKB_KEY_figdash 0x0abb /* U+2012 FIGURE DASH */ +#define XKB_KEY_leftanglebracket 0x0abc /*(U+2329 LEFT-POINTING ANGLE BRACKET)*/ +#define XKB_KEY_decimalpoint 0x0abd /*(U+002E FULL STOP)*/ +#define XKB_KEY_rightanglebracket 0x0abe /*(U+232A RIGHT-POINTING ANGLE BRACKET)*/ +#define XKB_KEY_marker 0x0abf +#define XKB_KEY_oneeighth 0x0ac3 /* U+215B VULGAR FRACTION ONE EIGHTH */ +#define XKB_KEY_threeeighths 0x0ac4 /* U+215C VULGAR FRACTION THREE EIGHTHS */ +#define XKB_KEY_fiveeighths 0x0ac5 /* U+215D VULGAR FRACTION FIVE EIGHTHS */ +#define XKB_KEY_seveneighths 0x0ac6 /* U+215E VULGAR FRACTION SEVEN EIGHTHS */ +#define XKB_KEY_trademark 0x0ac9 /* U+2122 TRADE MARK SIGN */ +#define XKB_KEY_signaturemark 0x0aca /*(U+2613 SALTIRE)*/ +#define XKB_KEY_trademarkincircle 0x0acb +#define XKB_KEY_leftopentriangle 0x0acc /*(U+25C1 WHITE LEFT-POINTING TRIANGLE)*/ +#define XKB_KEY_rightopentriangle 0x0acd /*(U+25B7 WHITE RIGHT-POINTING TRIANGLE)*/ +#define XKB_KEY_emopencircle 0x0ace /*(U+25CB WHITE CIRCLE)*/ +#define XKB_KEY_emopenrectangle 0x0acf /*(U+25AF WHITE VERTICAL RECTANGLE)*/ +#define XKB_KEY_leftsinglequotemark 0x0ad0 /* U+2018 LEFT SINGLE QUOTATION MARK */ +#define XKB_KEY_rightsinglequotemark 0x0ad1 /* U+2019 RIGHT SINGLE QUOTATION MARK */ +#define XKB_KEY_leftdoublequotemark 0x0ad2 /* U+201C LEFT DOUBLE QUOTATION MARK */ +#define XKB_KEY_rightdoublequotemark 0x0ad3 /* U+201D RIGHT DOUBLE QUOTATION MARK */ +#define XKB_KEY_prescription 0x0ad4 /* U+211E PRESCRIPTION TAKE */ +#define XKB_KEY_permille 0x0ad5 /* U+2030 PER MILLE SIGN */ +#define XKB_KEY_minutes 0x0ad6 /* U+2032 PRIME */ +#define XKB_KEY_seconds 0x0ad7 /* U+2033 DOUBLE PRIME */ +#define XKB_KEY_latincross 0x0ad9 /* U+271D LATIN CROSS */ +#define XKB_KEY_hexagram 0x0ada +#define XKB_KEY_filledrectbullet 0x0adb /*(U+25AC BLACK RECTANGLE)*/ +#define XKB_KEY_filledlefttribullet 0x0adc /*(U+25C0 BLACK LEFT-POINTING TRIANGLE)*/ +#define XKB_KEY_filledrighttribullet 0x0add /*(U+25B6 BLACK RIGHT-POINTING TRIANGLE)*/ +#define XKB_KEY_emfilledcircle 0x0ade /*(U+25CF BLACK CIRCLE)*/ +#define XKB_KEY_emfilledrect 0x0adf /*(U+25AE BLACK VERTICAL RECTANGLE)*/ +#define XKB_KEY_enopencircbullet 0x0ae0 /*(U+25E6 WHITE BULLET)*/ +#define XKB_KEY_enopensquarebullet 0x0ae1 /*(U+25AB WHITE SMALL SQUARE)*/ +#define XKB_KEY_openrectbullet 0x0ae2 /*(U+25AD WHITE RECTANGLE)*/ +#define XKB_KEY_opentribulletup 0x0ae3 /*(U+25B3 WHITE UP-POINTING TRIANGLE)*/ +#define XKB_KEY_opentribulletdown 0x0ae4 /*(U+25BD WHITE DOWN-POINTING TRIANGLE)*/ +#define XKB_KEY_openstar 0x0ae5 /*(U+2606 WHITE STAR)*/ +#define XKB_KEY_enfilledcircbullet 0x0ae6 /*(U+2022 BULLET)*/ +#define XKB_KEY_enfilledsqbullet 0x0ae7 /*(U+25AA BLACK SMALL SQUARE)*/ +#define XKB_KEY_filledtribulletup 0x0ae8 /*(U+25B2 BLACK UP-POINTING TRIANGLE)*/ +#define XKB_KEY_filledtribulletdown 0x0ae9 /*(U+25BC BLACK DOWN-POINTING TRIANGLE)*/ +#define XKB_KEY_leftpointer 0x0aea /*(U+261C WHITE LEFT POINTING INDEX)*/ +#define XKB_KEY_rightpointer 0x0aeb /*(U+261E WHITE RIGHT POINTING INDEX)*/ +#define XKB_KEY_club 0x0aec /* U+2663 BLACK CLUB SUIT */ +#define XKB_KEY_diamond 0x0aed /* U+2666 BLACK DIAMOND SUIT */ +#define XKB_KEY_heart 0x0aee /* U+2665 BLACK HEART SUIT */ +#define XKB_KEY_maltesecross 0x0af0 /* U+2720 MALTESE CROSS */ +#define XKB_KEY_dagger 0x0af1 /* U+2020 DAGGER */ +#define XKB_KEY_doubledagger 0x0af2 /* U+2021 DOUBLE DAGGER */ +#define XKB_KEY_checkmark 0x0af3 /* U+2713 CHECK MARK */ +#define XKB_KEY_ballotcross 0x0af4 /* U+2717 BALLOT X */ +#define XKB_KEY_musicalsharp 0x0af5 /* U+266F MUSIC SHARP SIGN */ +#define XKB_KEY_musicalflat 0x0af6 /* U+266D MUSIC FLAT SIGN */ +#define XKB_KEY_malesymbol 0x0af7 /* U+2642 MALE SIGN */ +#define XKB_KEY_femalesymbol 0x0af8 /* U+2640 FEMALE SIGN */ +#define XKB_KEY_telephone 0x0af9 /* U+260E BLACK TELEPHONE */ +#define XKB_KEY_telephonerecorder 0x0afa /* U+2315 TELEPHONE RECORDER */ +#define XKB_KEY_phonographcopyright 0x0afb /* U+2117 SOUND RECORDING COPYRIGHT */ +#define XKB_KEY_caret 0x0afc /* U+2038 CARET */ +#define XKB_KEY_singlelowquotemark 0x0afd /* U+201A SINGLE LOW-9 QUOTATION MARK */ +#define XKB_KEY_doublelowquotemark 0x0afe /* U+201E DOUBLE LOW-9 QUOTATION MARK */ +#define XKB_KEY_cursor 0x0aff + +/* + * APL + * Byte 3 = 0x0b + */ + +#define XKB_KEY_leftcaret 0x0ba3 /*(U+003C LESS-THAN SIGN)*/ +#define XKB_KEY_rightcaret 0x0ba6 /*(U+003E GREATER-THAN SIGN)*/ +#define XKB_KEY_downcaret 0x0ba8 /*(U+2228 LOGICAL OR)*/ +#define XKB_KEY_upcaret 0x0ba9 /*(U+2227 LOGICAL AND)*/ +#define XKB_KEY_overbar 0x0bc0 /*(U+00AF MACRON)*/ +#define XKB_KEY_downtack 0x0bc2 /* U+22A4 DOWN TACK */ +#define XKB_KEY_upshoe 0x0bc3 /*(U+2229 INTERSECTION)*/ +#define XKB_KEY_downstile 0x0bc4 /* U+230A LEFT FLOOR */ +#define XKB_KEY_underbar 0x0bc6 /*(U+005F LOW LINE)*/ +#define XKB_KEY_jot 0x0bca /* U+2218 RING OPERATOR */ +#define XKB_KEY_quad 0x0bcc /* U+2395 APL FUNCTIONAL SYMBOL QUAD */ +#define XKB_KEY_uptack 0x0bce /* U+22A5 UP TACK */ +#define XKB_KEY_circle 0x0bcf /* U+25CB WHITE CIRCLE */ +#define XKB_KEY_upstile 0x0bd3 /* U+2308 LEFT CEILING */ +#define XKB_KEY_downshoe 0x0bd6 /*(U+222A UNION)*/ +#define XKB_KEY_rightshoe 0x0bd8 /*(U+2283 SUPERSET OF)*/ +#define XKB_KEY_leftshoe 0x0bda /*(U+2282 SUBSET OF)*/ +#define XKB_KEY_lefttack 0x0bdc /* U+22A3 LEFT TACK */ +#define XKB_KEY_righttack 0x0bfc /* U+22A2 RIGHT TACK */ + +/* + * Hebrew + * Byte 3 = 0x0c + */ + +#define XKB_KEY_hebrew_doublelowline 0x0cdf /* U+2017 DOUBLE LOW LINE */ +#define XKB_KEY_hebrew_aleph 0x0ce0 /* U+05D0 HEBREW LETTER ALEF */ +#define XKB_KEY_hebrew_bet 0x0ce1 /* U+05D1 HEBREW LETTER BET */ +#define XKB_KEY_hebrew_beth 0x0ce1 /* deprecated */ +#define XKB_KEY_hebrew_gimel 0x0ce2 /* U+05D2 HEBREW LETTER GIMEL */ +#define XKB_KEY_hebrew_gimmel 0x0ce2 /* deprecated */ +#define XKB_KEY_hebrew_dalet 0x0ce3 /* U+05D3 HEBREW LETTER DALET */ +#define XKB_KEY_hebrew_daleth 0x0ce3 /* deprecated */ +#define XKB_KEY_hebrew_he 0x0ce4 /* U+05D4 HEBREW LETTER HE */ +#define XKB_KEY_hebrew_waw 0x0ce5 /* U+05D5 HEBREW LETTER VAV */ +#define XKB_KEY_hebrew_zain 0x0ce6 /* U+05D6 HEBREW LETTER ZAYIN */ +#define XKB_KEY_hebrew_zayin 0x0ce6 /* deprecated */ +#define XKB_KEY_hebrew_chet 0x0ce7 /* U+05D7 HEBREW LETTER HET */ +#define XKB_KEY_hebrew_het 0x0ce7 /* deprecated */ +#define XKB_KEY_hebrew_tet 0x0ce8 /* U+05D8 HEBREW LETTER TET */ +#define XKB_KEY_hebrew_teth 0x0ce8 /* deprecated */ +#define XKB_KEY_hebrew_yod 0x0ce9 /* U+05D9 HEBREW LETTER YOD */ +#define XKB_KEY_hebrew_finalkaph 0x0cea /* U+05DA HEBREW LETTER FINAL KAF */ +#define XKB_KEY_hebrew_kaph 0x0ceb /* U+05DB HEBREW LETTER KAF */ +#define XKB_KEY_hebrew_lamed 0x0cec /* U+05DC HEBREW LETTER LAMED */ +#define XKB_KEY_hebrew_finalmem 0x0ced /* U+05DD HEBREW LETTER FINAL MEM */ +#define XKB_KEY_hebrew_mem 0x0cee /* U+05DE HEBREW LETTER MEM */ +#define XKB_KEY_hebrew_finalnun 0x0cef /* U+05DF HEBREW LETTER FINAL NUN */ +#define XKB_KEY_hebrew_nun 0x0cf0 /* U+05E0 HEBREW LETTER NUN */ +#define XKB_KEY_hebrew_samech 0x0cf1 /* U+05E1 HEBREW LETTER SAMEKH */ +#define XKB_KEY_hebrew_samekh 0x0cf1 /* deprecated */ +#define XKB_KEY_hebrew_ayin 0x0cf2 /* U+05E2 HEBREW LETTER AYIN */ +#define XKB_KEY_hebrew_finalpe 0x0cf3 /* U+05E3 HEBREW LETTER FINAL PE */ +#define XKB_KEY_hebrew_pe 0x0cf4 /* U+05E4 HEBREW LETTER PE */ +#define XKB_KEY_hebrew_finalzade 0x0cf5 /* U+05E5 HEBREW LETTER FINAL TSADI */ +#define XKB_KEY_hebrew_finalzadi 0x0cf5 /* deprecated */ +#define XKB_KEY_hebrew_zade 0x0cf6 /* U+05E6 HEBREW LETTER TSADI */ +#define XKB_KEY_hebrew_zadi 0x0cf6 /* deprecated */ +#define XKB_KEY_hebrew_qoph 0x0cf7 /* U+05E7 HEBREW LETTER QOF */ +#define XKB_KEY_hebrew_kuf 0x0cf7 /* deprecated */ +#define XKB_KEY_hebrew_resh 0x0cf8 /* U+05E8 HEBREW LETTER RESH */ +#define XKB_KEY_hebrew_shin 0x0cf9 /* U+05E9 HEBREW LETTER SHIN */ +#define XKB_KEY_hebrew_taw 0x0cfa /* U+05EA HEBREW LETTER TAV */ +#define XKB_KEY_hebrew_taf 0x0cfa /* deprecated */ +#define XKB_KEY_Hebrew_switch 0xff7e /* non-deprecated alias for Mode_switch */ + +/* + * Thai + * Byte 3 = 0x0d + */ + +#define XKB_KEY_Thai_kokai 0x0da1 /* U+0E01 THAI CHARACTER KO KAI */ +#define XKB_KEY_Thai_khokhai 0x0da2 /* U+0E02 THAI CHARACTER KHO KHAI */ +#define XKB_KEY_Thai_khokhuat 0x0da3 /* U+0E03 THAI CHARACTER KHO KHUAT */ +#define XKB_KEY_Thai_khokhwai 0x0da4 /* U+0E04 THAI CHARACTER KHO KHWAI */ +#define XKB_KEY_Thai_khokhon 0x0da5 /* U+0E05 THAI CHARACTER KHO KHON */ +#define XKB_KEY_Thai_khorakhang 0x0da6 /* U+0E06 THAI CHARACTER KHO RAKHANG */ +#define XKB_KEY_Thai_ngongu 0x0da7 /* U+0E07 THAI CHARACTER NGO NGU */ +#define XKB_KEY_Thai_chochan 0x0da8 /* U+0E08 THAI CHARACTER CHO CHAN */ +#define XKB_KEY_Thai_choching 0x0da9 /* U+0E09 THAI CHARACTER CHO CHING */ +#define XKB_KEY_Thai_chochang 0x0daa /* U+0E0A THAI CHARACTER CHO CHANG */ +#define XKB_KEY_Thai_soso 0x0dab /* U+0E0B THAI CHARACTER SO SO */ +#define XKB_KEY_Thai_chochoe 0x0dac /* U+0E0C THAI CHARACTER CHO CHOE */ +#define XKB_KEY_Thai_yoying 0x0dad /* U+0E0D THAI CHARACTER YO YING */ +#define XKB_KEY_Thai_dochada 0x0dae /* U+0E0E THAI CHARACTER DO CHADA */ +#define XKB_KEY_Thai_topatak 0x0daf /* U+0E0F THAI CHARACTER TO PATAK */ +#define XKB_KEY_Thai_thothan 0x0db0 /* U+0E10 THAI CHARACTER THO THAN */ +#define XKB_KEY_Thai_thonangmontho 0x0db1 /* U+0E11 THAI CHARACTER THO NANGMONTHO */ +#define XKB_KEY_Thai_thophuthao 0x0db2 /* U+0E12 THAI CHARACTER THO PHUTHAO */ +#define XKB_KEY_Thai_nonen 0x0db3 /* U+0E13 THAI CHARACTER NO NEN */ +#define XKB_KEY_Thai_dodek 0x0db4 /* U+0E14 THAI CHARACTER DO DEK */ +#define XKB_KEY_Thai_totao 0x0db5 /* U+0E15 THAI CHARACTER TO TAO */ +#define XKB_KEY_Thai_thothung 0x0db6 /* U+0E16 THAI CHARACTER THO THUNG */ +#define XKB_KEY_Thai_thothahan 0x0db7 /* U+0E17 THAI CHARACTER THO THAHAN */ +#define XKB_KEY_Thai_thothong 0x0db8 /* U+0E18 THAI CHARACTER THO THONG */ +#define XKB_KEY_Thai_nonu 0x0db9 /* U+0E19 THAI CHARACTER NO NU */ +#define XKB_KEY_Thai_bobaimai 0x0dba /* U+0E1A THAI CHARACTER BO BAIMAI */ +#define XKB_KEY_Thai_popla 0x0dbb /* U+0E1B THAI CHARACTER PO PLA */ +#define XKB_KEY_Thai_phophung 0x0dbc /* U+0E1C THAI CHARACTER PHO PHUNG */ +#define XKB_KEY_Thai_fofa 0x0dbd /* U+0E1D THAI CHARACTER FO FA */ +#define XKB_KEY_Thai_phophan 0x0dbe /* U+0E1E THAI CHARACTER PHO PHAN */ +#define XKB_KEY_Thai_fofan 0x0dbf /* U+0E1F THAI CHARACTER FO FAN */ +#define XKB_KEY_Thai_phosamphao 0x0dc0 /* U+0E20 THAI CHARACTER PHO SAMPHAO */ +#define XKB_KEY_Thai_moma 0x0dc1 /* U+0E21 THAI CHARACTER MO MA */ +#define XKB_KEY_Thai_yoyak 0x0dc2 /* U+0E22 THAI CHARACTER YO YAK */ +#define XKB_KEY_Thai_rorua 0x0dc3 /* U+0E23 THAI CHARACTER RO RUA */ +#define XKB_KEY_Thai_ru 0x0dc4 /* U+0E24 THAI CHARACTER RU */ +#define XKB_KEY_Thai_loling 0x0dc5 /* U+0E25 THAI CHARACTER LO LING */ +#define XKB_KEY_Thai_lu 0x0dc6 /* U+0E26 THAI CHARACTER LU */ +#define XKB_KEY_Thai_wowaen 0x0dc7 /* U+0E27 THAI CHARACTER WO WAEN */ +#define XKB_KEY_Thai_sosala 0x0dc8 /* U+0E28 THAI CHARACTER SO SALA */ +#define XKB_KEY_Thai_sorusi 0x0dc9 /* U+0E29 THAI CHARACTER SO RUSI */ +#define XKB_KEY_Thai_sosua 0x0dca /* U+0E2A THAI CHARACTER SO SUA */ +#define XKB_KEY_Thai_hohip 0x0dcb /* U+0E2B THAI CHARACTER HO HIP */ +#define XKB_KEY_Thai_lochula 0x0dcc /* U+0E2C THAI CHARACTER LO CHULA */ +#define XKB_KEY_Thai_oang 0x0dcd /* U+0E2D THAI CHARACTER O ANG */ +#define XKB_KEY_Thai_honokhuk 0x0dce /* U+0E2E THAI CHARACTER HO NOKHUK */ +#define XKB_KEY_Thai_paiyannoi 0x0dcf /* U+0E2F THAI CHARACTER PAIYANNOI */ +#define XKB_KEY_Thai_saraa 0x0dd0 /* U+0E30 THAI CHARACTER SARA A */ +#define XKB_KEY_Thai_maihanakat 0x0dd1 /* U+0E31 THAI CHARACTER MAI HAN-AKAT */ +#define XKB_KEY_Thai_saraaa 0x0dd2 /* U+0E32 THAI CHARACTER SARA AA */ +#define XKB_KEY_Thai_saraam 0x0dd3 /* U+0E33 THAI CHARACTER SARA AM */ +#define XKB_KEY_Thai_sarai 0x0dd4 /* U+0E34 THAI CHARACTER SARA I */ +#define XKB_KEY_Thai_saraii 0x0dd5 /* U+0E35 THAI CHARACTER SARA II */ +#define XKB_KEY_Thai_saraue 0x0dd6 /* U+0E36 THAI CHARACTER SARA UE */ +#define XKB_KEY_Thai_sarauee 0x0dd7 /* U+0E37 THAI CHARACTER SARA UEE */ +#define XKB_KEY_Thai_sarau 0x0dd8 /* U+0E38 THAI CHARACTER SARA U */ +#define XKB_KEY_Thai_sarauu 0x0dd9 /* U+0E39 THAI CHARACTER SARA UU */ +#define XKB_KEY_Thai_phinthu 0x0dda /* U+0E3A THAI CHARACTER PHINTHU */ +#define XKB_KEY_Thai_maihanakat_maitho 0x0dde /*(U+0E3E Unassigned code point)*/ +#define XKB_KEY_Thai_baht 0x0ddf /* U+0E3F THAI CURRENCY SYMBOL BAHT */ +#define XKB_KEY_Thai_sarae 0x0de0 /* U+0E40 THAI CHARACTER SARA E */ +#define XKB_KEY_Thai_saraae 0x0de1 /* U+0E41 THAI CHARACTER SARA AE */ +#define XKB_KEY_Thai_sarao 0x0de2 /* U+0E42 THAI CHARACTER SARA O */ +#define XKB_KEY_Thai_saraaimaimuan 0x0de3 /* U+0E43 THAI CHARACTER SARA AI MAIMUAN */ +#define XKB_KEY_Thai_saraaimaimalai 0x0de4 /* U+0E44 THAI CHARACTER SARA AI MAIMALAI */ +#define XKB_KEY_Thai_lakkhangyao 0x0de5 /* U+0E45 THAI CHARACTER LAKKHANGYAO */ +#define XKB_KEY_Thai_maiyamok 0x0de6 /* U+0E46 THAI CHARACTER MAIYAMOK */ +#define XKB_KEY_Thai_maitaikhu 0x0de7 /* U+0E47 THAI CHARACTER MAITAIKHU */ +#define XKB_KEY_Thai_maiek 0x0de8 /* U+0E48 THAI CHARACTER MAI EK */ +#define XKB_KEY_Thai_maitho 0x0de9 /* U+0E49 THAI CHARACTER MAI THO */ +#define XKB_KEY_Thai_maitri 0x0dea /* U+0E4A THAI CHARACTER MAI TRI */ +#define XKB_KEY_Thai_maichattawa 0x0deb /* U+0E4B THAI CHARACTER MAI CHATTAWA */ +#define XKB_KEY_Thai_thanthakhat 0x0dec /* U+0E4C THAI CHARACTER THANTHAKHAT */ +#define XKB_KEY_Thai_nikhahit 0x0ded /* U+0E4D THAI CHARACTER NIKHAHIT */ +#define XKB_KEY_Thai_leksun 0x0df0 /* U+0E50 THAI DIGIT ZERO */ +#define XKB_KEY_Thai_leknung 0x0df1 /* U+0E51 THAI DIGIT ONE */ +#define XKB_KEY_Thai_leksong 0x0df2 /* U+0E52 THAI DIGIT TWO */ +#define XKB_KEY_Thai_leksam 0x0df3 /* U+0E53 THAI DIGIT THREE */ +#define XKB_KEY_Thai_leksi 0x0df4 /* U+0E54 THAI DIGIT FOUR */ +#define XKB_KEY_Thai_lekha 0x0df5 /* U+0E55 THAI DIGIT FIVE */ +#define XKB_KEY_Thai_lekhok 0x0df6 /* U+0E56 THAI DIGIT SIX */ +#define XKB_KEY_Thai_lekchet 0x0df7 /* U+0E57 THAI DIGIT SEVEN */ +#define XKB_KEY_Thai_lekpaet 0x0df8 /* U+0E58 THAI DIGIT EIGHT */ +#define XKB_KEY_Thai_lekkao 0x0df9 /* U+0E59 THAI DIGIT NINE */ + +/* + * Korean + * Byte 3 = 0x0e + */ + + +#define XKB_KEY_Hangul 0xff31 /* Hangul start/stop(toggle) */ +#define XKB_KEY_Hangul_Start 0xff32 /* Hangul start */ +#define XKB_KEY_Hangul_End 0xff33 /* Hangul end, English start */ +#define XKB_KEY_Hangul_Hanja 0xff34 /* Start Hangul->Hanja Conversion */ +#define XKB_KEY_Hangul_Jamo 0xff35 /* Hangul Jamo mode */ +#define XKB_KEY_Hangul_Romaja 0xff36 /* Hangul Romaja mode */ +#define XKB_KEY_Hangul_Codeinput 0xff37 /* Hangul code input mode */ +#define XKB_KEY_Hangul_Jeonja 0xff38 /* Jeonja mode */ +#define XKB_KEY_Hangul_Banja 0xff39 /* Banja mode */ +#define XKB_KEY_Hangul_PreHanja 0xff3a /* Pre Hanja conversion */ +#define XKB_KEY_Hangul_PostHanja 0xff3b /* Post Hanja conversion */ +#define XKB_KEY_Hangul_SingleCandidate 0xff3c /* Single candidate */ +#define XKB_KEY_Hangul_MultipleCandidate 0xff3d /* Multiple candidate */ +#define XKB_KEY_Hangul_PreviousCandidate 0xff3e /* Previous candidate */ +#define XKB_KEY_Hangul_Special 0xff3f /* Special symbols */ +#define XKB_KEY_Hangul_switch 0xff7e /* non-deprecated alias for Mode_switch */ + +/* Hangul Consonant Characters */ +#define XKB_KEY_Hangul_Kiyeog 0x0ea1 /* U+3131 HANGUL LETTER KIYEOK */ +#define XKB_KEY_Hangul_SsangKiyeog 0x0ea2 /* U+3132 HANGUL LETTER SSANGKIYEOK */ +#define XKB_KEY_Hangul_KiyeogSios 0x0ea3 /* U+3133 HANGUL LETTER KIYEOK-SIOS */ +#define XKB_KEY_Hangul_Nieun 0x0ea4 /* U+3134 HANGUL LETTER NIEUN */ +#define XKB_KEY_Hangul_NieunJieuj 0x0ea5 /* U+3135 HANGUL LETTER NIEUN-CIEUC */ +#define XKB_KEY_Hangul_NieunHieuh 0x0ea6 /* U+3136 HANGUL LETTER NIEUN-HIEUH */ +#define XKB_KEY_Hangul_Dikeud 0x0ea7 /* U+3137 HANGUL LETTER TIKEUT */ +#define XKB_KEY_Hangul_SsangDikeud 0x0ea8 /* U+3138 HANGUL LETTER SSANGTIKEUT */ +#define XKB_KEY_Hangul_Rieul 0x0ea9 /* U+3139 HANGUL LETTER RIEUL */ +#define XKB_KEY_Hangul_RieulKiyeog 0x0eaa /* U+313A HANGUL LETTER RIEUL-KIYEOK */ +#define XKB_KEY_Hangul_RieulMieum 0x0eab /* U+313B HANGUL LETTER RIEUL-MIEUM */ +#define XKB_KEY_Hangul_RieulPieub 0x0eac /* U+313C HANGUL LETTER RIEUL-PIEUP */ +#define XKB_KEY_Hangul_RieulSios 0x0ead /* U+313D HANGUL LETTER RIEUL-SIOS */ +#define XKB_KEY_Hangul_RieulTieut 0x0eae /* U+313E HANGUL LETTER RIEUL-THIEUTH */ +#define XKB_KEY_Hangul_RieulPhieuf 0x0eaf /* U+313F HANGUL LETTER RIEUL-PHIEUPH */ +#define XKB_KEY_Hangul_RieulHieuh 0x0eb0 /* U+3140 HANGUL LETTER RIEUL-HIEUH */ +#define XKB_KEY_Hangul_Mieum 0x0eb1 /* U+3141 HANGUL LETTER MIEUM */ +#define XKB_KEY_Hangul_Pieub 0x0eb2 /* U+3142 HANGUL LETTER PIEUP */ +#define XKB_KEY_Hangul_SsangPieub 0x0eb3 /* U+3143 HANGUL LETTER SSANGPIEUP */ +#define XKB_KEY_Hangul_PieubSios 0x0eb4 /* U+3144 HANGUL LETTER PIEUP-SIOS */ +#define XKB_KEY_Hangul_Sios 0x0eb5 /* U+3145 HANGUL LETTER SIOS */ +#define XKB_KEY_Hangul_SsangSios 0x0eb6 /* U+3146 HANGUL LETTER SSANGSIOS */ +#define XKB_KEY_Hangul_Ieung 0x0eb7 /* U+3147 HANGUL LETTER IEUNG */ +#define XKB_KEY_Hangul_Jieuj 0x0eb8 /* U+3148 HANGUL LETTER CIEUC */ +#define XKB_KEY_Hangul_SsangJieuj 0x0eb9 /* U+3149 HANGUL LETTER SSANGCIEUC */ +#define XKB_KEY_Hangul_Cieuc 0x0eba /* U+314A HANGUL LETTER CHIEUCH */ +#define XKB_KEY_Hangul_Khieuq 0x0ebb /* U+314B HANGUL LETTER KHIEUKH */ +#define XKB_KEY_Hangul_Tieut 0x0ebc /* U+314C HANGUL LETTER THIEUTH */ +#define XKB_KEY_Hangul_Phieuf 0x0ebd /* U+314D HANGUL LETTER PHIEUPH */ +#define XKB_KEY_Hangul_Hieuh 0x0ebe /* U+314E HANGUL LETTER HIEUH */ + +/* Hangul Vowel Characters */ +#define XKB_KEY_Hangul_A 0x0ebf /* U+314F HANGUL LETTER A */ +#define XKB_KEY_Hangul_AE 0x0ec0 /* U+3150 HANGUL LETTER AE */ +#define XKB_KEY_Hangul_YA 0x0ec1 /* U+3151 HANGUL LETTER YA */ +#define XKB_KEY_Hangul_YAE 0x0ec2 /* U+3152 HANGUL LETTER YAE */ +#define XKB_KEY_Hangul_EO 0x0ec3 /* U+3153 HANGUL LETTER EO */ +#define XKB_KEY_Hangul_E 0x0ec4 /* U+3154 HANGUL LETTER E */ +#define XKB_KEY_Hangul_YEO 0x0ec5 /* U+3155 HANGUL LETTER YEO */ +#define XKB_KEY_Hangul_YE 0x0ec6 /* U+3156 HANGUL LETTER YE */ +#define XKB_KEY_Hangul_O 0x0ec7 /* U+3157 HANGUL LETTER O */ +#define XKB_KEY_Hangul_WA 0x0ec8 /* U+3158 HANGUL LETTER WA */ +#define XKB_KEY_Hangul_WAE 0x0ec9 /* U+3159 HANGUL LETTER WAE */ +#define XKB_KEY_Hangul_OE 0x0eca /* U+315A HANGUL LETTER OE */ +#define XKB_KEY_Hangul_YO 0x0ecb /* U+315B HANGUL LETTER YO */ +#define XKB_KEY_Hangul_U 0x0ecc /* U+315C HANGUL LETTER U */ +#define XKB_KEY_Hangul_WEO 0x0ecd /* U+315D HANGUL LETTER WEO */ +#define XKB_KEY_Hangul_WE 0x0ece /* U+315E HANGUL LETTER WE */ +#define XKB_KEY_Hangul_WI 0x0ecf /* U+315F HANGUL LETTER WI */ +#define XKB_KEY_Hangul_YU 0x0ed0 /* U+3160 HANGUL LETTER YU */ +#define XKB_KEY_Hangul_EU 0x0ed1 /* U+3161 HANGUL LETTER EU */ +#define XKB_KEY_Hangul_YI 0x0ed2 /* U+3162 HANGUL LETTER YI */ +#define XKB_KEY_Hangul_I 0x0ed3 /* U+3163 HANGUL LETTER I */ + +/* Hangul syllable-final (JongSeong) Characters */ +#define XKB_KEY_Hangul_J_Kiyeog 0x0ed4 /* U+11A8 HANGUL JONGSEONG KIYEOK */ +#define XKB_KEY_Hangul_J_SsangKiyeog 0x0ed5 /* U+11A9 HANGUL JONGSEONG SSANGKIYEOK */ +#define XKB_KEY_Hangul_J_KiyeogSios 0x0ed6 /* U+11AA HANGUL JONGSEONG KIYEOK-SIOS */ +#define XKB_KEY_Hangul_J_Nieun 0x0ed7 /* U+11AB HANGUL JONGSEONG NIEUN */ +#define XKB_KEY_Hangul_J_NieunJieuj 0x0ed8 /* U+11AC HANGUL JONGSEONG NIEUN-CIEUC */ +#define XKB_KEY_Hangul_J_NieunHieuh 0x0ed9 /* U+11AD HANGUL JONGSEONG NIEUN-HIEUH */ +#define XKB_KEY_Hangul_J_Dikeud 0x0eda /* U+11AE HANGUL JONGSEONG TIKEUT */ +#define XKB_KEY_Hangul_J_Rieul 0x0edb /* U+11AF HANGUL JONGSEONG RIEUL */ +#define XKB_KEY_Hangul_J_RieulKiyeog 0x0edc /* U+11B0 HANGUL JONGSEONG RIEUL-KIYEOK */ +#define XKB_KEY_Hangul_J_RieulMieum 0x0edd /* U+11B1 HANGUL JONGSEONG RIEUL-MIEUM */ +#define XKB_KEY_Hangul_J_RieulPieub 0x0ede /* U+11B2 HANGUL JONGSEONG RIEUL-PIEUP */ +#define XKB_KEY_Hangul_J_RieulSios 0x0edf /* U+11B3 HANGUL JONGSEONG RIEUL-SIOS */ +#define XKB_KEY_Hangul_J_RieulTieut 0x0ee0 /* U+11B4 HANGUL JONGSEONG RIEUL-THIEUTH */ +#define XKB_KEY_Hangul_J_RieulPhieuf 0x0ee1 /* U+11B5 HANGUL JONGSEONG RIEUL-PHIEUPH */ +#define XKB_KEY_Hangul_J_RieulHieuh 0x0ee2 /* U+11B6 HANGUL JONGSEONG RIEUL-HIEUH */ +#define XKB_KEY_Hangul_J_Mieum 0x0ee3 /* U+11B7 HANGUL JONGSEONG MIEUM */ +#define XKB_KEY_Hangul_J_Pieub 0x0ee4 /* U+11B8 HANGUL JONGSEONG PIEUP */ +#define XKB_KEY_Hangul_J_PieubSios 0x0ee5 /* U+11B9 HANGUL JONGSEONG PIEUP-SIOS */ +#define XKB_KEY_Hangul_J_Sios 0x0ee6 /* U+11BA HANGUL JONGSEONG SIOS */ +#define XKB_KEY_Hangul_J_SsangSios 0x0ee7 /* U+11BB HANGUL JONGSEONG SSANGSIOS */ +#define XKB_KEY_Hangul_J_Ieung 0x0ee8 /* U+11BC HANGUL JONGSEONG IEUNG */ +#define XKB_KEY_Hangul_J_Jieuj 0x0ee9 /* U+11BD HANGUL JONGSEONG CIEUC */ +#define XKB_KEY_Hangul_J_Cieuc 0x0eea /* U+11BE HANGUL JONGSEONG CHIEUCH */ +#define XKB_KEY_Hangul_J_Khieuq 0x0eeb /* U+11BF HANGUL JONGSEONG KHIEUKH */ +#define XKB_KEY_Hangul_J_Tieut 0x0eec /* U+11C0 HANGUL JONGSEONG THIEUTH */ +#define XKB_KEY_Hangul_J_Phieuf 0x0eed /* U+11C1 HANGUL JONGSEONG PHIEUPH */ +#define XKB_KEY_Hangul_J_Hieuh 0x0eee /* U+11C2 HANGUL JONGSEONG HIEUH */ + +/* Ancient Hangul Consonant Characters */ +#define XKB_KEY_Hangul_RieulYeorinHieuh 0x0eef /* U+316D HANGUL LETTER RIEUL-YEORINHIEUH */ +#define XKB_KEY_Hangul_SunkyeongeumMieum 0x0ef0 /* U+3171 HANGUL LETTER KAPYEOUNMIEUM */ +#define XKB_KEY_Hangul_SunkyeongeumPieub 0x0ef1 /* U+3178 HANGUL LETTER KAPYEOUNPIEUP */ +#define XKB_KEY_Hangul_PanSios 0x0ef2 /* U+317F HANGUL LETTER PANSIOS */ +#define XKB_KEY_Hangul_KkogjiDalrinIeung 0x0ef3 /* U+3181 HANGUL LETTER YESIEUNG */ +#define XKB_KEY_Hangul_SunkyeongeumPhieuf 0x0ef4 /* U+3184 HANGUL LETTER KAPYEOUNPHIEUPH */ +#define XKB_KEY_Hangul_YeorinHieuh 0x0ef5 /* U+3186 HANGUL LETTER YEORINHIEUH */ + +/* Ancient Hangul Vowel Characters */ +#define XKB_KEY_Hangul_AraeA 0x0ef6 /* U+318D HANGUL LETTER ARAEA */ +#define XKB_KEY_Hangul_AraeAE 0x0ef7 /* U+318E HANGUL LETTER ARAEAE */ + +/* Ancient Hangul syllable-final (JongSeong) Characters */ +#define XKB_KEY_Hangul_J_PanSios 0x0ef8 /* U+11EB HANGUL JONGSEONG PANSIOS */ +#define XKB_KEY_Hangul_J_KkogjiDalrinIeung 0x0ef9 /* U+11F0 HANGUL JONGSEONG YESIEUNG */ +#define XKB_KEY_Hangul_J_YeorinHieuh 0x0efa /* U+11F9 HANGUL JONGSEONG YEORINHIEUH */ + +/* Korean currency symbol */ +#define XKB_KEY_Korean_Won 0x0eff /*(U+20A9 WON SIGN)*/ + + +/* + * Armenian + */ + +#define XKB_KEY_Armenian_ligature_ew 0x1000587 /* U+0587 ARMENIAN SMALL LIGATURE ECH YIWN */ +#define XKB_KEY_Armenian_full_stop 0x1000589 /* U+0589 ARMENIAN FULL STOP */ +#define XKB_KEY_Armenian_verjaket 0x1000589 /* deprecated alias for Armenian_full_stop */ +#define XKB_KEY_Armenian_separation_mark 0x100055d /* U+055D ARMENIAN COMMA */ +#define XKB_KEY_Armenian_but 0x100055d /* deprecated alias for Armenian_separation_mark */ +#define XKB_KEY_Armenian_hyphen 0x100058a /* U+058A ARMENIAN HYPHEN */ +#define XKB_KEY_Armenian_yentamna 0x100058a /* deprecated alias for Armenian_hyphen */ +#define XKB_KEY_Armenian_exclam 0x100055c /* U+055C ARMENIAN EXCLAMATION MARK */ +#define XKB_KEY_Armenian_amanak 0x100055c /* deprecated alias for Armenian_exclam */ +#define XKB_KEY_Armenian_accent 0x100055b /* U+055B ARMENIAN EMPHASIS MARK */ +#define XKB_KEY_Armenian_shesht 0x100055b /* deprecated alias for Armenian_accent */ +#define XKB_KEY_Armenian_question 0x100055e /* U+055E ARMENIAN QUESTION MARK */ +#define XKB_KEY_Armenian_paruyk 0x100055e /* deprecated alias for Armenian_question */ +#define XKB_KEY_Armenian_AYB 0x1000531 /* U+0531 ARMENIAN CAPITAL LETTER AYB */ +#define XKB_KEY_Armenian_ayb 0x1000561 /* U+0561 ARMENIAN SMALL LETTER AYB */ +#define XKB_KEY_Armenian_BEN 0x1000532 /* U+0532 ARMENIAN CAPITAL LETTER BEN */ +#define XKB_KEY_Armenian_ben 0x1000562 /* U+0562 ARMENIAN SMALL LETTER BEN */ +#define XKB_KEY_Armenian_GIM 0x1000533 /* U+0533 ARMENIAN CAPITAL LETTER GIM */ +#define XKB_KEY_Armenian_gim 0x1000563 /* U+0563 ARMENIAN SMALL LETTER GIM */ +#define XKB_KEY_Armenian_DA 0x1000534 /* U+0534 ARMENIAN CAPITAL LETTER DA */ +#define XKB_KEY_Armenian_da 0x1000564 /* U+0564 ARMENIAN SMALL LETTER DA */ +#define XKB_KEY_Armenian_YECH 0x1000535 /* U+0535 ARMENIAN CAPITAL LETTER ECH */ +#define XKB_KEY_Armenian_yech 0x1000565 /* U+0565 ARMENIAN SMALL LETTER ECH */ +#define XKB_KEY_Armenian_ZA 0x1000536 /* U+0536 ARMENIAN CAPITAL LETTER ZA */ +#define XKB_KEY_Armenian_za 0x1000566 /* U+0566 ARMENIAN SMALL LETTER ZA */ +#define XKB_KEY_Armenian_E 0x1000537 /* U+0537 ARMENIAN CAPITAL LETTER EH */ +#define XKB_KEY_Armenian_e 0x1000567 /* U+0567 ARMENIAN SMALL LETTER EH */ +#define XKB_KEY_Armenian_AT 0x1000538 /* U+0538 ARMENIAN CAPITAL LETTER ET */ +#define XKB_KEY_Armenian_at 0x1000568 /* U+0568 ARMENIAN SMALL LETTER ET */ +#define XKB_KEY_Armenian_TO 0x1000539 /* U+0539 ARMENIAN CAPITAL LETTER TO */ +#define XKB_KEY_Armenian_to 0x1000569 /* U+0569 ARMENIAN SMALL LETTER TO */ +#define XKB_KEY_Armenian_ZHE 0x100053a /* U+053A ARMENIAN CAPITAL LETTER ZHE */ +#define XKB_KEY_Armenian_zhe 0x100056a /* U+056A ARMENIAN SMALL LETTER ZHE */ +#define XKB_KEY_Armenian_INI 0x100053b /* U+053B ARMENIAN CAPITAL LETTER INI */ +#define XKB_KEY_Armenian_ini 0x100056b /* U+056B ARMENIAN SMALL LETTER INI */ +#define XKB_KEY_Armenian_LYUN 0x100053c /* U+053C ARMENIAN CAPITAL LETTER LIWN */ +#define XKB_KEY_Armenian_lyun 0x100056c /* U+056C ARMENIAN SMALL LETTER LIWN */ +#define XKB_KEY_Armenian_KHE 0x100053d /* U+053D ARMENIAN CAPITAL LETTER XEH */ +#define XKB_KEY_Armenian_khe 0x100056d /* U+056D ARMENIAN SMALL LETTER XEH */ +#define XKB_KEY_Armenian_TSA 0x100053e /* U+053E ARMENIAN CAPITAL LETTER CA */ +#define XKB_KEY_Armenian_tsa 0x100056e /* U+056E ARMENIAN SMALL LETTER CA */ +#define XKB_KEY_Armenian_KEN 0x100053f /* U+053F ARMENIAN CAPITAL LETTER KEN */ +#define XKB_KEY_Armenian_ken 0x100056f /* U+056F ARMENIAN SMALL LETTER KEN */ +#define XKB_KEY_Armenian_HO 0x1000540 /* U+0540 ARMENIAN CAPITAL LETTER HO */ +#define XKB_KEY_Armenian_ho 0x1000570 /* U+0570 ARMENIAN SMALL LETTER HO */ +#define XKB_KEY_Armenian_DZA 0x1000541 /* U+0541 ARMENIAN CAPITAL LETTER JA */ +#define XKB_KEY_Armenian_dza 0x1000571 /* U+0571 ARMENIAN SMALL LETTER JA */ +#define XKB_KEY_Armenian_GHAT 0x1000542 /* U+0542 ARMENIAN CAPITAL LETTER GHAD */ +#define XKB_KEY_Armenian_ghat 0x1000572 /* U+0572 ARMENIAN SMALL LETTER GHAD */ +#define XKB_KEY_Armenian_TCHE 0x1000543 /* U+0543 ARMENIAN CAPITAL LETTER CHEH */ +#define XKB_KEY_Armenian_tche 0x1000573 /* U+0573 ARMENIAN SMALL LETTER CHEH */ +#define XKB_KEY_Armenian_MEN 0x1000544 /* U+0544 ARMENIAN CAPITAL LETTER MEN */ +#define XKB_KEY_Armenian_men 0x1000574 /* U+0574 ARMENIAN SMALL LETTER MEN */ +#define XKB_KEY_Armenian_HI 0x1000545 /* U+0545 ARMENIAN CAPITAL LETTER YI */ +#define XKB_KEY_Armenian_hi 0x1000575 /* U+0575 ARMENIAN SMALL LETTER YI */ +#define XKB_KEY_Armenian_NU 0x1000546 /* U+0546 ARMENIAN CAPITAL LETTER NOW */ +#define XKB_KEY_Armenian_nu 0x1000576 /* U+0576 ARMENIAN SMALL LETTER NOW */ +#define XKB_KEY_Armenian_SHA 0x1000547 /* U+0547 ARMENIAN CAPITAL LETTER SHA */ +#define XKB_KEY_Armenian_sha 0x1000577 /* U+0577 ARMENIAN SMALL LETTER SHA */ +#define XKB_KEY_Armenian_VO 0x1000548 /* U+0548 ARMENIAN CAPITAL LETTER VO */ +#define XKB_KEY_Armenian_vo 0x1000578 /* U+0578 ARMENIAN SMALL LETTER VO */ +#define XKB_KEY_Armenian_CHA 0x1000549 /* U+0549 ARMENIAN CAPITAL LETTER CHA */ +#define XKB_KEY_Armenian_cha 0x1000579 /* U+0579 ARMENIAN SMALL LETTER CHA */ +#define XKB_KEY_Armenian_PE 0x100054a /* U+054A ARMENIAN CAPITAL LETTER PEH */ +#define XKB_KEY_Armenian_pe 0x100057a /* U+057A ARMENIAN SMALL LETTER PEH */ +#define XKB_KEY_Armenian_JE 0x100054b /* U+054B ARMENIAN CAPITAL LETTER JHEH */ +#define XKB_KEY_Armenian_je 0x100057b /* U+057B ARMENIAN SMALL LETTER JHEH */ +#define XKB_KEY_Armenian_RA 0x100054c /* U+054C ARMENIAN CAPITAL LETTER RA */ +#define XKB_KEY_Armenian_ra 0x100057c /* U+057C ARMENIAN SMALL LETTER RA */ +#define XKB_KEY_Armenian_SE 0x100054d /* U+054D ARMENIAN CAPITAL LETTER SEH */ +#define XKB_KEY_Armenian_se 0x100057d /* U+057D ARMENIAN SMALL LETTER SEH */ +#define XKB_KEY_Armenian_VEV 0x100054e /* U+054E ARMENIAN CAPITAL LETTER VEW */ +#define XKB_KEY_Armenian_vev 0x100057e /* U+057E ARMENIAN SMALL LETTER VEW */ +#define XKB_KEY_Armenian_TYUN 0x100054f /* U+054F ARMENIAN CAPITAL LETTER TIWN */ +#define XKB_KEY_Armenian_tyun 0x100057f /* U+057F ARMENIAN SMALL LETTER TIWN */ +#define XKB_KEY_Armenian_RE 0x1000550 /* U+0550 ARMENIAN CAPITAL LETTER REH */ +#define XKB_KEY_Armenian_re 0x1000580 /* U+0580 ARMENIAN SMALL LETTER REH */ +#define XKB_KEY_Armenian_TSO 0x1000551 /* U+0551 ARMENIAN CAPITAL LETTER CO */ +#define XKB_KEY_Armenian_tso 0x1000581 /* U+0581 ARMENIAN SMALL LETTER CO */ +#define XKB_KEY_Armenian_VYUN 0x1000552 /* U+0552 ARMENIAN CAPITAL LETTER YIWN */ +#define XKB_KEY_Armenian_vyun 0x1000582 /* U+0582 ARMENIAN SMALL LETTER YIWN */ +#define XKB_KEY_Armenian_PYUR 0x1000553 /* U+0553 ARMENIAN CAPITAL LETTER PIWR */ +#define XKB_KEY_Armenian_pyur 0x1000583 /* U+0583 ARMENIAN SMALL LETTER PIWR */ +#define XKB_KEY_Armenian_KE 0x1000554 /* U+0554 ARMENIAN CAPITAL LETTER KEH */ +#define XKB_KEY_Armenian_ke 0x1000584 /* U+0584 ARMENIAN SMALL LETTER KEH */ +#define XKB_KEY_Armenian_O 0x1000555 /* U+0555 ARMENIAN CAPITAL LETTER OH */ +#define XKB_KEY_Armenian_o 0x1000585 /* U+0585 ARMENIAN SMALL LETTER OH */ +#define XKB_KEY_Armenian_FE 0x1000556 /* U+0556 ARMENIAN CAPITAL LETTER FEH */ +#define XKB_KEY_Armenian_fe 0x1000586 /* U+0586 ARMENIAN SMALL LETTER FEH */ +#define XKB_KEY_Armenian_apostrophe 0x100055a /* U+055A ARMENIAN APOSTROPHE */ + +/* + * Georgian + */ + +#define XKB_KEY_Georgian_an 0x10010d0 /* U+10D0 GEORGIAN LETTER AN */ +#define XKB_KEY_Georgian_ban 0x10010d1 /* U+10D1 GEORGIAN LETTER BAN */ +#define XKB_KEY_Georgian_gan 0x10010d2 /* U+10D2 GEORGIAN LETTER GAN */ +#define XKB_KEY_Georgian_don 0x10010d3 /* U+10D3 GEORGIAN LETTER DON */ +#define XKB_KEY_Georgian_en 0x10010d4 /* U+10D4 GEORGIAN LETTER EN */ +#define XKB_KEY_Georgian_vin 0x10010d5 /* U+10D5 GEORGIAN LETTER VIN */ +#define XKB_KEY_Georgian_zen 0x10010d6 /* U+10D6 GEORGIAN LETTER ZEN */ +#define XKB_KEY_Georgian_tan 0x10010d7 /* U+10D7 GEORGIAN LETTER TAN */ +#define XKB_KEY_Georgian_in 0x10010d8 /* U+10D8 GEORGIAN LETTER IN */ +#define XKB_KEY_Georgian_kan 0x10010d9 /* U+10D9 GEORGIAN LETTER KAN */ +#define XKB_KEY_Georgian_las 0x10010da /* U+10DA GEORGIAN LETTER LAS */ +#define XKB_KEY_Georgian_man 0x10010db /* U+10DB GEORGIAN LETTER MAN */ +#define XKB_KEY_Georgian_nar 0x10010dc /* U+10DC GEORGIAN LETTER NAR */ +#define XKB_KEY_Georgian_on 0x10010dd /* U+10DD GEORGIAN LETTER ON */ +#define XKB_KEY_Georgian_par 0x10010de /* U+10DE GEORGIAN LETTER PAR */ +#define XKB_KEY_Georgian_zhar 0x10010df /* U+10DF GEORGIAN LETTER ZHAR */ +#define XKB_KEY_Georgian_rae 0x10010e0 /* U+10E0 GEORGIAN LETTER RAE */ +#define XKB_KEY_Georgian_san 0x10010e1 /* U+10E1 GEORGIAN LETTER SAN */ +#define XKB_KEY_Georgian_tar 0x10010e2 /* U+10E2 GEORGIAN LETTER TAR */ +#define XKB_KEY_Georgian_un 0x10010e3 /* U+10E3 GEORGIAN LETTER UN */ +#define XKB_KEY_Georgian_phar 0x10010e4 /* U+10E4 GEORGIAN LETTER PHAR */ +#define XKB_KEY_Georgian_khar 0x10010e5 /* U+10E5 GEORGIAN LETTER KHAR */ +#define XKB_KEY_Georgian_ghan 0x10010e6 /* U+10E6 GEORGIAN LETTER GHAN */ +#define XKB_KEY_Georgian_qar 0x10010e7 /* U+10E7 GEORGIAN LETTER QAR */ +#define XKB_KEY_Georgian_shin 0x10010e8 /* U+10E8 GEORGIAN LETTER SHIN */ +#define XKB_KEY_Georgian_chin 0x10010e9 /* U+10E9 GEORGIAN LETTER CHIN */ +#define XKB_KEY_Georgian_can 0x10010ea /* U+10EA GEORGIAN LETTER CAN */ +#define XKB_KEY_Georgian_jil 0x10010eb /* U+10EB GEORGIAN LETTER JIL */ +#define XKB_KEY_Georgian_cil 0x10010ec /* U+10EC GEORGIAN LETTER CIL */ +#define XKB_KEY_Georgian_char 0x10010ed /* U+10ED GEORGIAN LETTER CHAR */ +#define XKB_KEY_Georgian_xan 0x10010ee /* U+10EE GEORGIAN LETTER XAN */ +#define XKB_KEY_Georgian_jhan 0x10010ef /* U+10EF GEORGIAN LETTER JHAN */ +#define XKB_KEY_Georgian_hae 0x10010f0 /* U+10F0 GEORGIAN LETTER HAE */ +#define XKB_KEY_Georgian_he 0x10010f1 /* U+10F1 GEORGIAN LETTER HE */ +#define XKB_KEY_Georgian_hie 0x10010f2 /* U+10F2 GEORGIAN LETTER HIE */ +#define XKB_KEY_Georgian_we 0x10010f3 /* U+10F3 GEORGIAN LETTER WE */ +#define XKB_KEY_Georgian_har 0x10010f4 /* U+10F4 GEORGIAN LETTER HAR */ +#define XKB_KEY_Georgian_hoe 0x10010f5 /* U+10F5 GEORGIAN LETTER HOE */ +#define XKB_KEY_Georgian_fi 0x10010f6 /* U+10F6 GEORGIAN LETTER FI */ + +/* + * Azeri (and other Turkic or Caucasian languages) + */ + +/* latin */ +#define XKB_KEY_Xabovedot 0x1001e8a /* U+1E8A LATIN CAPITAL LETTER X WITH DOT ABOVE */ +#define XKB_KEY_Ibreve 0x100012c /* U+012C LATIN CAPITAL LETTER I WITH BREVE */ +#define XKB_KEY_Zstroke 0x10001b5 /* U+01B5 LATIN CAPITAL LETTER Z WITH STROKE */ +#define XKB_KEY_Gcaron 0x10001e6 /* U+01E6 LATIN CAPITAL LETTER G WITH CARON */ +#define XKB_KEY_Ocaron 0x10001d1 /* U+01D1 LATIN CAPITAL LETTER O WITH CARON */ +#define XKB_KEY_Obarred 0x100019f /* U+019F LATIN CAPITAL LETTER O WITH MIDDLE TILDE */ +#define XKB_KEY_xabovedot 0x1001e8b /* U+1E8B LATIN SMALL LETTER X WITH DOT ABOVE */ +#define XKB_KEY_ibreve 0x100012d /* U+012D LATIN SMALL LETTER I WITH BREVE */ +#define XKB_KEY_zstroke 0x10001b6 /* U+01B6 LATIN SMALL LETTER Z WITH STROKE */ +#define XKB_KEY_gcaron 0x10001e7 /* U+01E7 LATIN SMALL LETTER G WITH CARON */ +#define XKB_KEY_ocaron 0x10001d2 /* U+01D2 LATIN SMALL LETTER O WITH CARON */ +#define XKB_KEY_obarred 0x1000275 /* U+0275 LATIN SMALL LETTER BARRED O */ +#define XKB_KEY_SCHWA 0x100018f /* U+018F LATIN CAPITAL LETTER SCHWA */ +#define XKB_KEY_schwa 0x1000259 /* U+0259 LATIN SMALL LETTER SCHWA */ +#define XKB_KEY_EZH 0x10001b7 /* U+01B7 LATIN CAPITAL LETTER EZH */ +#define XKB_KEY_ezh 0x1000292 /* U+0292 LATIN SMALL LETTER EZH */ +/* those are not really Caucasus */ +/* For Inupiak */ +#define XKB_KEY_Lbelowdot 0x1001e36 /* U+1E36 LATIN CAPITAL LETTER L WITH DOT BELOW */ +#define XKB_KEY_lbelowdot 0x1001e37 /* U+1E37 LATIN SMALL LETTER L WITH DOT BELOW */ + +/* + * Vietnamese + */ + +#define XKB_KEY_Abelowdot 0x1001ea0 /* U+1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW */ +#define XKB_KEY_abelowdot 0x1001ea1 /* U+1EA1 LATIN SMALL LETTER A WITH DOT BELOW */ +#define XKB_KEY_Ahook 0x1001ea2 /* U+1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE */ +#define XKB_KEY_ahook 0x1001ea3 /* U+1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE */ +#define XKB_KEY_Acircumflexacute 0x1001ea4 /* U+1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */ +#define XKB_KEY_acircumflexacute 0x1001ea5 /* U+1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE */ +#define XKB_KEY_Acircumflexgrave 0x1001ea6 /* U+1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */ +#define XKB_KEY_acircumflexgrave 0x1001ea7 /* U+1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE */ +#define XKB_KEY_Acircumflexhook 0x1001ea8 /* U+1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XKB_KEY_acircumflexhook 0x1001ea9 /* U+1EA9 LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XKB_KEY_Acircumflextilde 0x1001eaa /* U+1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */ +#define XKB_KEY_acircumflextilde 0x1001eab /* U+1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE */ +#define XKB_KEY_Acircumflexbelowdot 0x1001eac /* U+1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ +#define XKB_KEY_acircumflexbelowdot 0x1001ead /* U+1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ +#define XKB_KEY_Abreveacute 0x1001eae /* U+1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */ +#define XKB_KEY_abreveacute 0x1001eaf /* U+1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE */ +#define XKB_KEY_Abrevegrave 0x1001eb0 /* U+1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */ +#define XKB_KEY_abrevegrave 0x1001eb1 /* U+1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE */ +#define XKB_KEY_Abrevehook 0x1001eb2 /* U+1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */ +#define XKB_KEY_abrevehook 0x1001eb3 /* U+1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE */ +#define XKB_KEY_Abrevetilde 0x1001eb4 /* U+1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE */ +#define XKB_KEY_abrevetilde 0x1001eb5 /* U+1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE */ +#define XKB_KEY_Abrevebelowdot 0x1001eb6 /* U+1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */ +#define XKB_KEY_abrevebelowdot 0x1001eb7 /* U+1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */ +#define XKB_KEY_Ebelowdot 0x1001eb8 /* U+1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW */ +#define XKB_KEY_ebelowdot 0x1001eb9 /* U+1EB9 LATIN SMALL LETTER E WITH DOT BELOW */ +#define XKB_KEY_Ehook 0x1001eba /* U+1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE */ +#define XKB_KEY_ehook 0x1001ebb /* U+1EBB LATIN SMALL LETTER E WITH HOOK ABOVE */ +#define XKB_KEY_Etilde 0x1001ebc /* U+1EBC LATIN CAPITAL LETTER E WITH TILDE */ +#define XKB_KEY_etilde 0x1001ebd /* U+1EBD LATIN SMALL LETTER E WITH TILDE */ +#define XKB_KEY_Ecircumflexacute 0x1001ebe /* U+1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */ +#define XKB_KEY_ecircumflexacute 0x1001ebf /* U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE */ +#define XKB_KEY_Ecircumflexgrave 0x1001ec0 /* U+1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */ +#define XKB_KEY_ecircumflexgrave 0x1001ec1 /* U+1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE */ +#define XKB_KEY_Ecircumflexhook 0x1001ec2 /* U+1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XKB_KEY_ecircumflexhook 0x1001ec3 /* U+1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XKB_KEY_Ecircumflextilde 0x1001ec4 /* U+1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */ +#define XKB_KEY_ecircumflextilde 0x1001ec5 /* U+1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE */ +#define XKB_KEY_Ecircumflexbelowdot 0x1001ec6 /* U+1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ +#define XKB_KEY_ecircumflexbelowdot 0x1001ec7 /* U+1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ +#define XKB_KEY_Ihook 0x1001ec8 /* U+1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE */ +#define XKB_KEY_ihook 0x1001ec9 /* U+1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE */ +#define XKB_KEY_Ibelowdot 0x1001eca /* U+1ECA LATIN CAPITAL LETTER I WITH DOT BELOW */ +#define XKB_KEY_ibelowdot 0x1001ecb /* U+1ECB LATIN SMALL LETTER I WITH DOT BELOW */ +#define XKB_KEY_Obelowdot 0x1001ecc /* U+1ECC LATIN CAPITAL LETTER O WITH DOT BELOW */ +#define XKB_KEY_obelowdot 0x1001ecd /* U+1ECD LATIN SMALL LETTER O WITH DOT BELOW */ +#define XKB_KEY_Ohook 0x1001ece /* U+1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE */ +#define XKB_KEY_ohook 0x1001ecf /* U+1ECF LATIN SMALL LETTER O WITH HOOK ABOVE */ +#define XKB_KEY_Ocircumflexacute 0x1001ed0 /* U+1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */ +#define XKB_KEY_ocircumflexacute 0x1001ed1 /* U+1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE */ +#define XKB_KEY_Ocircumflexgrave 0x1001ed2 /* U+1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */ +#define XKB_KEY_ocircumflexgrave 0x1001ed3 /* U+1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE */ +#define XKB_KEY_Ocircumflexhook 0x1001ed4 /* U+1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XKB_KEY_ocircumflexhook 0x1001ed5 /* U+1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XKB_KEY_Ocircumflextilde 0x1001ed6 /* U+1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */ +#define XKB_KEY_ocircumflextilde 0x1001ed7 /* U+1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE */ +#define XKB_KEY_Ocircumflexbelowdot 0x1001ed8 /* U+1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ +#define XKB_KEY_ocircumflexbelowdot 0x1001ed9 /* U+1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ +#define XKB_KEY_Ohornacute 0x1001eda /* U+1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE */ +#define XKB_KEY_ohornacute 0x1001edb /* U+1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE */ +#define XKB_KEY_Ohorngrave 0x1001edc /* U+1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE */ +#define XKB_KEY_ohorngrave 0x1001edd /* U+1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE */ +#define XKB_KEY_Ohornhook 0x1001ede /* U+1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */ +#define XKB_KEY_ohornhook 0x1001edf /* U+1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE */ +#define XKB_KEY_Ohorntilde 0x1001ee0 /* U+1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE */ +#define XKB_KEY_ohorntilde 0x1001ee1 /* U+1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE */ +#define XKB_KEY_Ohornbelowdot 0x1001ee2 /* U+1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */ +#define XKB_KEY_ohornbelowdot 0x1001ee3 /* U+1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW */ +#define XKB_KEY_Ubelowdot 0x1001ee4 /* U+1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW */ +#define XKB_KEY_ubelowdot 0x1001ee5 /* U+1EE5 LATIN SMALL LETTER U WITH DOT BELOW */ +#define XKB_KEY_Uhook 0x1001ee6 /* U+1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE */ +#define XKB_KEY_uhook 0x1001ee7 /* U+1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE */ +#define XKB_KEY_Uhornacute 0x1001ee8 /* U+1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE */ +#define XKB_KEY_uhornacute 0x1001ee9 /* U+1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE */ +#define XKB_KEY_Uhorngrave 0x1001eea /* U+1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE */ +#define XKB_KEY_uhorngrave 0x1001eeb /* U+1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE */ +#define XKB_KEY_Uhornhook 0x1001eec /* U+1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */ +#define XKB_KEY_uhornhook 0x1001eed /* U+1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE */ +#define XKB_KEY_Uhorntilde 0x1001eee /* U+1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE */ +#define XKB_KEY_uhorntilde 0x1001eef /* U+1EEF LATIN SMALL LETTER U WITH HORN AND TILDE */ +#define XKB_KEY_Uhornbelowdot 0x1001ef0 /* U+1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */ +#define XKB_KEY_uhornbelowdot 0x1001ef1 /* U+1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW */ +#define XKB_KEY_Ybelowdot 0x1001ef4 /* U+1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW */ +#define XKB_KEY_ybelowdot 0x1001ef5 /* U+1EF5 LATIN SMALL LETTER Y WITH DOT BELOW */ +#define XKB_KEY_Yhook 0x1001ef6 /* U+1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE */ +#define XKB_KEY_yhook 0x1001ef7 /* U+1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE */ +#define XKB_KEY_Ytilde 0x1001ef8 /* U+1EF8 LATIN CAPITAL LETTER Y WITH TILDE */ +#define XKB_KEY_ytilde 0x1001ef9 /* U+1EF9 LATIN SMALL LETTER Y WITH TILDE */ +#define XKB_KEY_Ohorn 0x10001a0 /* U+01A0 LATIN CAPITAL LETTER O WITH HORN */ +#define XKB_KEY_ohorn 0x10001a1 /* U+01A1 LATIN SMALL LETTER O WITH HORN */ +#define XKB_KEY_Uhorn 0x10001af /* U+01AF LATIN CAPITAL LETTER U WITH HORN */ +#define XKB_KEY_uhorn 0x10001b0 /* U+01B0 LATIN SMALL LETTER U WITH HORN */ +#define XKB_KEY_combining_tilde 0x1000303 /* U+0303 COMBINING TILDE */ +#define XKB_KEY_combining_grave 0x1000300 /* U+0300 COMBINING GRAVE ACCENT */ +#define XKB_KEY_combining_acute 0x1000301 /* U+0301 COMBINING ACUTE ACCENT */ +#define XKB_KEY_combining_hook 0x1000309 /* U+0309 COMBINING HOOK ABOVE */ +#define XKB_KEY_combining_belowdot 0x1000323 /* U+0323 COMBINING DOT BELOW */ + + +#define XKB_KEY_EcuSign 0x10020a0 /* U+20A0 EURO-CURRENCY SIGN */ +#define XKB_KEY_ColonSign 0x10020a1 /* U+20A1 COLON SIGN */ +#define XKB_KEY_CruzeiroSign 0x10020a2 /* U+20A2 CRUZEIRO SIGN */ +#define XKB_KEY_FFrancSign 0x10020a3 /* U+20A3 FRENCH FRANC SIGN */ +#define XKB_KEY_LiraSign 0x10020a4 /* U+20A4 LIRA SIGN */ +#define XKB_KEY_MillSign 0x10020a5 /* U+20A5 MILL SIGN */ +#define XKB_KEY_NairaSign 0x10020a6 /* U+20A6 NAIRA SIGN */ +#define XKB_KEY_PesetaSign 0x10020a7 /* U+20A7 PESETA SIGN */ +#define XKB_KEY_RupeeSign 0x10020a8 /* U+20A8 RUPEE SIGN */ +#define XKB_KEY_WonSign 0x10020a9 /* U+20A9 WON SIGN */ +#define XKB_KEY_NewSheqelSign 0x10020aa /* U+20AA NEW SHEQEL SIGN */ +#define XKB_KEY_DongSign 0x10020ab /* U+20AB DONG SIGN */ +#define XKB_KEY_EuroSign 0x20ac /* U+20AC EURO SIGN */ + +/* one, two and three are defined above. */ +#define XKB_KEY_zerosuperior 0x1002070 /* U+2070 SUPERSCRIPT ZERO */ +#define XKB_KEY_foursuperior 0x1002074 /* U+2074 SUPERSCRIPT FOUR */ +#define XKB_KEY_fivesuperior 0x1002075 /* U+2075 SUPERSCRIPT FIVE */ +#define XKB_KEY_sixsuperior 0x1002076 /* U+2076 SUPERSCRIPT SIX */ +#define XKB_KEY_sevensuperior 0x1002077 /* U+2077 SUPERSCRIPT SEVEN */ +#define XKB_KEY_eightsuperior 0x1002078 /* U+2078 SUPERSCRIPT EIGHT */ +#define XKB_KEY_ninesuperior 0x1002079 /* U+2079 SUPERSCRIPT NINE */ +#define XKB_KEY_zerosubscript 0x1002080 /* U+2080 SUBSCRIPT ZERO */ +#define XKB_KEY_onesubscript 0x1002081 /* U+2081 SUBSCRIPT ONE */ +#define XKB_KEY_twosubscript 0x1002082 /* U+2082 SUBSCRIPT TWO */ +#define XKB_KEY_threesubscript 0x1002083 /* U+2083 SUBSCRIPT THREE */ +#define XKB_KEY_foursubscript 0x1002084 /* U+2084 SUBSCRIPT FOUR */ +#define XKB_KEY_fivesubscript 0x1002085 /* U+2085 SUBSCRIPT FIVE */ +#define XKB_KEY_sixsubscript 0x1002086 /* U+2086 SUBSCRIPT SIX */ +#define XKB_KEY_sevensubscript 0x1002087 /* U+2087 SUBSCRIPT SEVEN */ +#define XKB_KEY_eightsubscript 0x1002088 /* U+2088 SUBSCRIPT EIGHT */ +#define XKB_KEY_ninesubscript 0x1002089 /* U+2089 SUBSCRIPT NINE */ +#define XKB_KEY_partdifferential 0x1002202 /* U+2202 PARTIAL DIFFERENTIAL */ +#define XKB_KEY_emptyset 0x1002205 /* U+2205 EMPTY SET */ +#define XKB_KEY_elementof 0x1002208 /* U+2208 ELEMENT OF */ +#define XKB_KEY_notelementof 0x1002209 /* U+2209 NOT AN ELEMENT OF */ +#define XKB_KEY_containsas 0x100220b /* U+220B CONTAINS AS MEMBER */ +#define XKB_KEY_squareroot 0x100221a /* U+221A SQUARE ROOT */ +#define XKB_KEY_cuberoot 0x100221b /* U+221B CUBE ROOT */ +#define XKB_KEY_fourthroot 0x100221c /* U+221C FOURTH ROOT */ +#define XKB_KEY_dintegral 0x100222c /* U+222C DOUBLE INTEGRAL */ +#define XKB_KEY_tintegral 0x100222d /* U+222D TRIPLE INTEGRAL */ +#define XKB_KEY_because 0x1002235 /* U+2235 BECAUSE */ +#define XKB_KEY_approxeq 0x1002248 /*(U+2248 ALMOST EQUAL TO)*/ +#define XKB_KEY_notapproxeq 0x1002247 /*(U+2247 NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO)*/ +#define XKB_KEY_notidentical 0x1002262 /* U+2262 NOT IDENTICAL TO */ +#define XKB_KEY_stricteq 0x1002263 /* U+2263 STRICTLY EQUIVALENT TO */ + +#define XKB_KEY_braille_dot_1 0xfff1 +#define XKB_KEY_braille_dot_2 0xfff2 +#define XKB_KEY_braille_dot_3 0xfff3 +#define XKB_KEY_braille_dot_4 0xfff4 +#define XKB_KEY_braille_dot_5 0xfff5 +#define XKB_KEY_braille_dot_6 0xfff6 +#define XKB_KEY_braille_dot_7 0xfff7 +#define XKB_KEY_braille_dot_8 0xfff8 +#define XKB_KEY_braille_dot_9 0xfff9 +#define XKB_KEY_braille_dot_10 0xfffa +#define XKB_KEY_braille_blank 0x1002800 /* U+2800 BRAILLE PATTERN BLANK */ +#define XKB_KEY_braille_dots_1 0x1002801 /* U+2801 BRAILLE PATTERN DOTS-1 */ +#define XKB_KEY_braille_dots_2 0x1002802 /* U+2802 BRAILLE PATTERN DOTS-2 */ +#define XKB_KEY_braille_dots_12 0x1002803 /* U+2803 BRAILLE PATTERN DOTS-12 */ +#define XKB_KEY_braille_dots_3 0x1002804 /* U+2804 BRAILLE PATTERN DOTS-3 */ +#define XKB_KEY_braille_dots_13 0x1002805 /* U+2805 BRAILLE PATTERN DOTS-13 */ +#define XKB_KEY_braille_dots_23 0x1002806 /* U+2806 BRAILLE PATTERN DOTS-23 */ +#define XKB_KEY_braille_dots_123 0x1002807 /* U+2807 BRAILLE PATTERN DOTS-123 */ +#define XKB_KEY_braille_dots_4 0x1002808 /* U+2808 BRAILLE PATTERN DOTS-4 */ +#define XKB_KEY_braille_dots_14 0x1002809 /* U+2809 BRAILLE PATTERN DOTS-14 */ +#define XKB_KEY_braille_dots_24 0x100280a /* U+280A BRAILLE PATTERN DOTS-24 */ +#define XKB_KEY_braille_dots_124 0x100280b /* U+280B BRAILLE PATTERN DOTS-124 */ +#define XKB_KEY_braille_dots_34 0x100280c /* U+280C BRAILLE PATTERN DOTS-34 */ +#define XKB_KEY_braille_dots_134 0x100280d /* U+280D BRAILLE PATTERN DOTS-134 */ +#define XKB_KEY_braille_dots_234 0x100280e /* U+280E BRAILLE PATTERN DOTS-234 */ +#define XKB_KEY_braille_dots_1234 0x100280f /* U+280F BRAILLE PATTERN DOTS-1234 */ +#define XKB_KEY_braille_dots_5 0x1002810 /* U+2810 BRAILLE PATTERN DOTS-5 */ +#define XKB_KEY_braille_dots_15 0x1002811 /* U+2811 BRAILLE PATTERN DOTS-15 */ +#define XKB_KEY_braille_dots_25 0x1002812 /* U+2812 BRAILLE PATTERN DOTS-25 */ +#define XKB_KEY_braille_dots_125 0x1002813 /* U+2813 BRAILLE PATTERN DOTS-125 */ +#define XKB_KEY_braille_dots_35 0x1002814 /* U+2814 BRAILLE PATTERN DOTS-35 */ +#define XKB_KEY_braille_dots_135 0x1002815 /* U+2815 BRAILLE PATTERN DOTS-135 */ +#define XKB_KEY_braille_dots_235 0x1002816 /* U+2816 BRAILLE PATTERN DOTS-235 */ +#define XKB_KEY_braille_dots_1235 0x1002817 /* U+2817 BRAILLE PATTERN DOTS-1235 */ +#define XKB_KEY_braille_dots_45 0x1002818 /* U+2818 BRAILLE PATTERN DOTS-45 */ +#define XKB_KEY_braille_dots_145 0x1002819 /* U+2819 BRAILLE PATTERN DOTS-145 */ +#define XKB_KEY_braille_dots_245 0x100281a /* U+281A BRAILLE PATTERN DOTS-245 */ +#define XKB_KEY_braille_dots_1245 0x100281b /* U+281B BRAILLE PATTERN DOTS-1245 */ +#define XKB_KEY_braille_dots_345 0x100281c /* U+281C BRAILLE PATTERN DOTS-345 */ +#define XKB_KEY_braille_dots_1345 0x100281d /* U+281D BRAILLE PATTERN DOTS-1345 */ +#define XKB_KEY_braille_dots_2345 0x100281e /* U+281E BRAILLE PATTERN DOTS-2345 */ +#define XKB_KEY_braille_dots_12345 0x100281f /* U+281F BRAILLE PATTERN DOTS-12345 */ +#define XKB_KEY_braille_dots_6 0x1002820 /* U+2820 BRAILLE PATTERN DOTS-6 */ +#define XKB_KEY_braille_dots_16 0x1002821 /* U+2821 BRAILLE PATTERN DOTS-16 */ +#define XKB_KEY_braille_dots_26 0x1002822 /* U+2822 BRAILLE PATTERN DOTS-26 */ +#define XKB_KEY_braille_dots_126 0x1002823 /* U+2823 BRAILLE PATTERN DOTS-126 */ +#define XKB_KEY_braille_dots_36 0x1002824 /* U+2824 BRAILLE PATTERN DOTS-36 */ +#define XKB_KEY_braille_dots_136 0x1002825 /* U+2825 BRAILLE PATTERN DOTS-136 */ +#define XKB_KEY_braille_dots_236 0x1002826 /* U+2826 BRAILLE PATTERN DOTS-236 */ +#define XKB_KEY_braille_dots_1236 0x1002827 /* U+2827 BRAILLE PATTERN DOTS-1236 */ +#define XKB_KEY_braille_dots_46 0x1002828 /* U+2828 BRAILLE PATTERN DOTS-46 */ +#define XKB_KEY_braille_dots_146 0x1002829 /* U+2829 BRAILLE PATTERN DOTS-146 */ +#define XKB_KEY_braille_dots_246 0x100282a /* U+282A BRAILLE PATTERN DOTS-246 */ +#define XKB_KEY_braille_dots_1246 0x100282b /* U+282B BRAILLE PATTERN DOTS-1246 */ +#define XKB_KEY_braille_dots_346 0x100282c /* U+282C BRAILLE PATTERN DOTS-346 */ +#define XKB_KEY_braille_dots_1346 0x100282d /* U+282D BRAILLE PATTERN DOTS-1346 */ +#define XKB_KEY_braille_dots_2346 0x100282e /* U+282E BRAILLE PATTERN DOTS-2346 */ +#define XKB_KEY_braille_dots_12346 0x100282f /* U+282F BRAILLE PATTERN DOTS-12346 */ +#define XKB_KEY_braille_dots_56 0x1002830 /* U+2830 BRAILLE PATTERN DOTS-56 */ +#define XKB_KEY_braille_dots_156 0x1002831 /* U+2831 BRAILLE PATTERN DOTS-156 */ +#define XKB_KEY_braille_dots_256 0x1002832 /* U+2832 BRAILLE PATTERN DOTS-256 */ +#define XKB_KEY_braille_dots_1256 0x1002833 /* U+2833 BRAILLE PATTERN DOTS-1256 */ +#define XKB_KEY_braille_dots_356 0x1002834 /* U+2834 BRAILLE PATTERN DOTS-356 */ +#define XKB_KEY_braille_dots_1356 0x1002835 /* U+2835 BRAILLE PATTERN DOTS-1356 */ +#define XKB_KEY_braille_dots_2356 0x1002836 /* U+2836 BRAILLE PATTERN DOTS-2356 */ +#define XKB_KEY_braille_dots_12356 0x1002837 /* U+2837 BRAILLE PATTERN DOTS-12356 */ +#define XKB_KEY_braille_dots_456 0x1002838 /* U+2838 BRAILLE PATTERN DOTS-456 */ +#define XKB_KEY_braille_dots_1456 0x1002839 /* U+2839 BRAILLE PATTERN DOTS-1456 */ +#define XKB_KEY_braille_dots_2456 0x100283a /* U+283A BRAILLE PATTERN DOTS-2456 */ +#define XKB_KEY_braille_dots_12456 0x100283b /* U+283B BRAILLE PATTERN DOTS-12456 */ +#define XKB_KEY_braille_dots_3456 0x100283c /* U+283C BRAILLE PATTERN DOTS-3456 */ +#define XKB_KEY_braille_dots_13456 0x100283d /* U+283D BRAILLE PATTERN DOTS-13456 */ +#define XKB_KEY_braille_dots_23456 0x100283e /* U+283E BRAILLE PATTERN DOTS-23456 */ +#define XKB_KEY_braille_dots_123456 0x100283f /* U+283F BRAILLE PATTERN DOTS-123456 */ +#define XKB_KEY_braille_dots_7 0x1002840 /* U+2840 BRAILLE PATTERN DOTS-7 */ +#define XKB_KEY_braille_dots_17 0x1002841 /* U+2841 BRAILLE PATTERN DOTS-17 */ +#define XKB_KEY_braille_dots_27 0x1002842 /* U+2842 BRAILLE PATTERN DOTS-27 */ +#define XKB_KEY_braille_dots_127 0x1002843 /* U+2843 BRAILLE PATTERN DOTS-127 */ +#define XKB_KEY_braille_dots_37 0x1002844 /* U+2844 BRAILLE PATTERN DOTS-37 */ +#define XKB_KEY_braille_dots_137 0x1002845 /* U+2845 BRAILLE PATTERN DOTS-137 */ +#define XKB_KEY_braille_dots_237 0x1002846 /* U+2846 BRAILLE PATTERN DOTS-237 */ +#define XKB_KEY_braille_dots_1237 0x1002847 /* U+2847 BRAILLE PATTERN DOTS-1237 */ +#define XKB_KEY_braille_dots_47 0x1002848 /* U+2848 BRAILLE PATTERN DOTS-47 */ +#define XKB_KEY_braille_dots_147 0x1002849 /* U+2849 BRAILLE PATTERN DOTS-147 */ +#define XKB_KEY_braille_dots_247 0x100284a /* U+284A BRAILLE PATTERN DOTS-247 */ +#define XKB_KEY_braille_dots_1247 0x100284b /* U+284B BRAILLE PATTERN DOTS-1247 */ +#define XKB_KEY_braille_dots_347 0x100284c /* U+284C BRAILLE PATTERN DOTS-347 */ +#define XKB_KEY_braille_dots_1347 0x100284d /* U+284D BRAILLE PATTERN DOTS-1347 */ +#define XKB_KEY_braille_dots_2347 0x100284e /* U+284E BRAILLE PATTERN DOTS-2347 */ +#define XKB_KEY_braille_dots_12347 0x100284f /* U+284F BRAILLE PATTERN DOTS-12347 */ +#define XKB_KEY_braille_dots_57 0x1002850 /* U+2850 BRAILLE PATTERN DOTS-57 */ +#define XKB_KEY_braille_dots_157 0x1002851 /* U+2851 BRAILLE PATTERN DOTS-157 */ +#define XKB_KEY_braille_dots_257 0x1002852 /* U+2852 BRAILLE PATTERN DOTS-257 */ +#define XKB_KEY_braille_dots_1257 0x1002853 /* U+2853 BRAILLE PATTERN DOTS-1257 */ +#define XKB_KEY_braille_dots_357 0x1002854 /* U+2854 BRAILLE PATTERN DOTS-357 */ +#define XKB_KEY_braille_dots_1357 0x1002855 /* U+2855 BRAILLE PATTERN DOTS-1357 */ +#define XKB_KEY_braille_dots_2357 0x1002856 /* U+2856 BRAILLE PATTERN DOTS-2357 */ +#define XKB_KEY_braille_dots_12357 0x1002857 /* U+2857 BRAILLE PATTERN DOTS-12357 */ +#define XKB_KEY_braille_dots_457 0x1002858 /* U+2858 BRAILLE PATTERN DOTS-457 */ +#define XKB_KEY_braille_dots_1457 0x1002859 /* U+2859 BRAILLE PATTERN DOTS-1457 */ +#define XKB_KEY_braille_dots_2457 0x100285a /* U+285A BRAILLE PATTERN DOTS-2457 */ +#define XKB_KEY_braille_dots_12457 0x100285b /* U+285B BRAILLE PATTERN DOTS-12457 */ +#define XKB_KEY_braille_dots_3457 0x100285c /* U+285C BRAILLE PATTERN DOTS-3457 */ +#define XKB_KEY_braille_dots_13457 0x100285d /* U+285D BRAILLE PATTERN DOTS-13457 */ +#define XKB_KEY_braille_dots_23457 0x100285e /* U+285E BRAILLE PATTERN DOTS-23457 */ +#define XKB_KEY_braille_dots_123457 0x100285f /* U+285F BRAILLE PATTERN DOTS-123457 */ +#define XKB_KEY_braille_dots_67 0x1002860 /* U+2860 BRAILLE PATTERN DOTS-67 */ +#define XKB_KEY_braille_dots_167 0x1002861 /* U+2861 BRAILLE PATTERN DOTS-167 */ +#define XKB_KEY_braille_dots_267 0x1002862 /* U+2862 BRAILLE PATTERN DOTS-267 */ +#define XKB_KEY_braille_dots_1267 0x1002863 /* U+2863 BRAILLE PATTERN DOTS-1267 */ +#define XKB_KEY_braille_dots_367 0x1002864 /* U+2864 BRAILLE PATTERN DOTS-367 */ +#define XKB_KEY_braille_dots_1367 0x1002865 /* U+2865 BRAILLE PATTERN DOTS-1367 */ +#define XKB_KEY_braille_dots_2367 0x1002866 /* U+2866 BRAILLE PATTERN DOTS-2367 */ +#define XKB_KEY_braille_dots_12367 0x1002867 /* U+2867 BRAILLE PATTERN DOTS-12367 */ +#define XKB_KEY_braille_dots_467 0x1002868 /* U+2868 BRAILLE PATTERN DOTS-467 */ +#define XKB_KEY_braille_dots_1467 0x1002869 /* U+2869 BRAILLE PATTERN DOTS-1467 */ +#define XKB_KEY_braille_dots_2467 0x100286a /* U+286A BRAILLE PATTERN DOTS-2467 */ +#define XKB_KEY_braille_dots_12467 0x100286b /* U+286B BRAILLE PATTERN DOTS-12467 */ +#define XKB_KEY_braille_dots_3467 0x100286c /* U+286C BRAILLE PATTERN DOTS-3467 */ +#define XKB_KEY_braille_dots_13467 0x100286d /* U+286D BRAILLE PATTERN DOTS-13467 */ +#define XKB_KEY_braille_dots_23467 0x100286e /* U+286E BRAILLE PATTERN DOTS-23467 */ +#define XKB_KEY_braille_dots_123467 0x100286f /* U+286F BRAILLE PATTERN DOTS-123467 */ +#define XKB_KEY_braille_dots_567 0x1002870 /* U+2870 BRAILLE PATTERN DOTS-567 */ +#define XKB_KEY_braille_dots_1567 0x1002871 /* U+2871 BRAILLE PATTERN DOTS-1567 */ +#define XKB_KEY_braille_dots_2567 0x1002872 /* U+2872 BRAILLE PATTERN DOTS-2567 */ +#define XKB_KEY_braille_dots_12567 0x1002873 /* U+2873 BRAILLE PATTERN DOTS-12567 */ +#define XKB_KEY_braille_dots_3567 0x1002874 /* U+2874 BRAILLE PATTERN DOTS-3567 */ +#define XKB_KEY_braille_dots_13567 0x1002875 /* U+2875 BRAILLE PATTERN DOTS-13567 */ +#define XKB_KEY_braille_dots_23567 0x1002876 /* U+2876 BRAILLE PATTERN DOTS-23567 */ +#define XKB_KEY_braille_dots_123567 0x1002877 /* U+2877 BRAILLE PATTERN DOTS-123567 */ +#define XKB_KEY_braille_dots_4567 0x1002878 /* U+2878 BRAILLE PATTERN DOTS-4567 */ +#define XKB_KEY_braille_dots_14567 0x1002879 /* U+2879 BRAILLE PATTERN DOTS-14567 */ +#define XKB_KEY_braille_dots_24567 0x100287a /* U+287A BRAILLE PATTERN DOTS-24567 */ +#define XKB_KEY_braille_dots_124567 0x100287b /* U+287B BRAILLE PATTERN DOTS-124567 */ +#define XKB_KEY_braille_dots_34567 0x100287c /* U+287C BRAILLE PATTERN DOTS-34567 */ +#define XKB_KEY_braille_dots_134567 0x100287d /* U+287D BRAILLE PATTERN DOTS-134567 */ +#define XKB_KEY_braille_dots_234567 0x100287e /* U+287E BRAILLE PATTERN DOTS-234567 */ +#define XKB_KEY_braille_dots_1234567 0x100287f /* U+287F BRAILLE PATTERN DOTS-1234567 */ +#define XKB_KEY_braille_dots_8 0x1002880 /* U+2880 BRAILLE PATTERN DOTS-8 */ +#define XKB_KEY_braille_dots_18 0x1002881 /* U+2881 BRAILLE PATTERN DOTS-18 */ +#define XKB_KEY_braille_dots_28 0x1002882 /* U+2882 BRAILLE PATTERN DOTS-28 */ +#define XKB_KEY_braille_dots_128 0x1002883 /* U+2883 BRAILLE PATTERN DOTS-128 */ +#define XKB_KEY_braille_dots_38 0x1002884 /* U+2884 BRAILLE PATTERN DOTS-38 */ +#define XKB_KEY_braille_dots_138 0x1002885 /* U+2885 BRAILLE PATTERN DOTS-138 */ +#define XKB_KEY_braille_dots_238 0x1002886 /* U+2886 BRAILLE PATTERN DOTS-238 */ +#define XKB_KEY_braille_dots_1238 0x1002887 /* U+2887 BRAILLE PATTERN DOTS-1238 */ +#define XKB_KEY_braille_dots_48 0x1002888 /* U+2888 BRAILLE PATTERN DOTS-48 */ +#define XKB_KEY_braille_dots_148 0x1002889 /* U+2889 BRAILLE PATTERN DOTS-148 */ +#define XKB_KEY_braille_dots_248 0x100288a /* U+288A BRAILLE PATTERN DOTS-248 */ +#define XKB_KEY_braille_dots_1248 0x100288b /* U+288B BRAILLE PATTERN DOTS-1248 */ +#define XKB_KEY_braille_dots_348 0x100288c /* U+288C BRAILLE PATTERN DOTS-348 */ +#define XKB_KEY_braille_dots_1348 0x100288d /* U+288D BRAILLE PATTERN DOTS-1348 */ +#define XKB_KEY_braille_dots_2348 0x100288e /* U+288E BRAILLE PATTERN DOTS-2348 */ +#define XKB_KEY_braille_dots_12348 0x100288f /* U+288F BRAILLE PATTERN DOTS-12348 */ +#define XKB_KEY_braille_dots_58 0x1002890 /* U+2890 BRAILLE PATTERN DOTS-58 */ +#define XKB_KEY_braille_dots_158 0x1002891 /* U+2891 BRAILLE PATTERN DOTS-158 */ +#define XKB_KEY_braille_dots_258 0x1002892 /* U+2892 BRAILLE PATTERN DOTS-258 */ +#define XKB_KEY_braille_dots_1258 0x1002893 /* U+2893 BRAILLE PATTERN DOTS-1258 */ +#define XKB_KEY_braille_dots_358 0x1002894 /* U+2894 BRAILLE PATTERN DOTS-358 */ +#define XKB_KEY_braille_dots_1358 0x1002895 /* U+2895 BRAILLE PATTERN DOTS-1358 */ +#define XKB_KEY_braille_dots_2358 0x1002896 /* U+2896 BRAILLE PATTERN DOTS-2358 */ +#define XKB_KEY_braille_dots_12358 0x1002897 /* U+2897 BRAILLE PATTERN DOTS-12358 */ +#define XKB_KEY_braille_dots_458 0x1002898 /* U+2898 BRAILLE PATTERN DOTS-458 */ +#define XKB_KEY_braille_dots_1458 0x1002899 /* U+2899 BRAILLE PATTERN DOTS-1458 */ +#define XKB_KEY_braille_dots_2458 0x100289a /* U+289A BRAILLE PATTERN DOTS-2458 */ +#define XKB_KEY_braille_dots_12458 0x100289b /* U+289B BRAILLE PATTERN DOTS-12458 */ +#define XKB_KEY_braille_dots_3458 0x100289c /* U+289C BRAILLE PATTERN DOTS-3458 */ +#define XKB_KEY_braille_dots_13458 0x100289d /* U+289D BRAILLE PATTERN DOTS-13458 */ +#define XKB_KEY_braille_dots_23458 0x100289e /* U+289E BRAILLE PATTERN DOTS-23458 */ +#define XKB_KEY_braille_dots_123458 0x100289f /* U+289F BRAILLE PATTERN DOTS-123458 */ +#define XKB_KEY_braille_dots_68 0x10028a0 /* U+28A0 BRAILLE PATTERN DOTS-68 */ +#define XKB_KEY_braille_dots_168 0x10028a1 /* U+28A1 BRAILLE PATTERN DOTS-168 */ +#define XKB_KEY_braille_dots_268 0x10028a2 /* U+28A2 BRAILLE PATTERN DOTS-268 */ +#define XKB_KEY_braille_dots_1268 0x10028a3 /* U+28A3 BRAILLE PATTERN DOTS-1268 */ +#define XKB_KEY_braille_dots_368 0x10028a4 /* U+28A4 BRAILLE PATTERN DOTS-368 */ +#define XKB_KEY_braille_dots_1368 0x10028a5 /* U+28A5 BRAILLE PATTERN DOTS-1368 */ +#define XKB_KEY_braille_dots_2368 0x10028a6 /* U+28A6 BRAILLE PATTERN DOTS-2368 */ +#define XKB_KEY_braille_dots_12368 0x10028a7 /* U+28A7 BRAILLE PATTERN DOTS-12368 */ +#define XKB_KEY_braille_dots_468 0x10028a8 /* U+28A8 BRAILLE PATTERN DOTS-468 */ +#define XKB_KEY_braille_dots_1468 0x10028a9 /* U+28A9 BRAILLE PATTERN DOTS-1468 */ +#define XKB_KEY_braille_dots_2468 0x10028aa /* U+28AA BRAILLE PATTERN DOTS-2468 */ +#define XKB_KEY_braille_dots_12468 0x10028ab /* U+28AB BRAILLE PATTERN DOTS-12468 */ +#define XKB_KEY_braille_dots_3468 0x10028ac /* U+28AC BRAILLE PATTERN DOTS-3468 */ +#define XKB_KEY_braille_dots_13468 0x10028ad /* U+28AD BRAILLE PATTERN DOTS-13468 */ +#define XKB_KEY_braille_dots_23468 0x10028ae /* U+28AE BRAILLE PATTERN DOTS-23468 */ +#define XKB_KEY_braille_dots_123468 0x10028af /* U+28AF BRAILLE PATTERN DOTS-123468 */ +#define XKB_KEY_braille_dots_568 0x10028b0 /* U+28B0 BRAILLE PATTERN DOTS-568 */ +#define XKB_KEY_braille_dots_1568 0x10028b1 /* U+28B1 BRAILLE PATTERN DOTS-1568 */ +#define XKB_KEY_braille_dots_2568 0x10028b2 /* U+28B2 BRAILLE PATTERN DOTS-2568 */ +#define XKB_KEY_braille_dots_12568 0x10028b3 /* U+28B3 BRAILLE PATTERN DOTS-12568 */ +#define XKB_KEY_braille_dots_3568 0x10028b4 /* U+28B4 BRAILLE PATTERN DOTS-3568 */ +#define XKB_KEY_braille_dots_13568 0x10028b5 /* U+28B5 BRAILLE PATTERN DOTS-13568 */ +#define XKB_KEY_braille_dots_23568 0x10028b6 /* U+28B6 BRAILLE PATTERN DOTS-23568 */ +#define XKB_KEY_braille_dots_123568 0x10028b7 /* U+28B7 BRAILLE PATTERN DOTS-123568 */ +#define XKB_KEY_braille_dots_4568 0x10028b8 /* U+28B8 BRAILLE PATTERN DOTS-4568 */ +#define XKB_KEY_braille_dots_14568 0x10028b9 /* U+28B9 BRAILLE PATTERN DOTS-14568 */ +#define XKB_KEY_braille_dots_24568 0x10028ba /* U+28BA BRAILLE PATTERN DOTS-24568 */ +#define XKB_KEY_braille_dots_124568 0x10028bb /* U+28BB BRAILLE PATTERN DOTS-124568 */ +#define XKB_KEY_braille_dots_34568 0x10028bc /* U+28BC BRAILLE PATTERN DOTS-34568 */ +#define XKB_KEY_braille_dots_134568 0x10028bd /* U+28BD BRAILLE PATTERN DOTS-134568 */ +#define XKB_KEY_braille_dots_234568 0x10028be /* U+28BE BRAILLE PATTERN DOTS-234568 */ +#define XKB_KEY_braille_dots_1234568 0x10028bf /* U+28BF BRAILLE PATTERN DOTS-1234568 */ +#define XKB_KEY_braille_dots_78 0x10028c0 /* U+28C0 BRAILLE PATTERN DOTS-78 */ +#define XKB_KEY_braille_dots_178 0x10028c1 /* U+28C1 BRAILLE PATTERN DOTS-178 */ +#define XKB_KEY_braille_dots_278 0x10028c2 /* U+28C2 BRAILLE PATTERN DOTS-278 */ +#define XKB_KEY_braille_dots_1278 0x10028c3 /* U+28C3 BRAILLE PATTERN DOTS-1278 */ +#define XKB_KEY_braille_dots_378 0x10028c4 /* U+28C4 BRAILLE PATTERN DOTS-378 */ +#define XKB_KEY_braille_dots_1378 0x10028c5 /* U+28C5 BRAILLE PATTERN DOTS-1378 */ +#define XKB_KEY_braille_dots_2378 0x10028c6 /* U+28C6 BRAILLE PATTERN DOTS-2378 */ +#define XKB_KEY_braille_dots_12378 0x10028c7 /* U+28C7 BRAILLE PATTERN DOTS-12378 */ +#define XKB_KEY_braille_dots_478 0x10028c8 /* U+28C8 BRAILLE PATTERN DOTS-478 */ +#define XKB_KEY_braille_dots_1478 0x10028c9 /* U+28C9 BRAILLE PATTERN DOTS-1478 */ +#define XKB_KEY_braille_dots_2478 0x10028ca /* U+28CA BRAILLE PATTERN DOTS-2478 */ +#define XKB_KEY_braille_dots_12478 0x10028cb /* U+28CB BRAILLE PATTERN DOTS-12478 */ +#define XKB_KEY_braille_dots_3478 0x10028cc /* U+28CC BRAILLE PATTERN DOTS-3478 */ +#define XKB_KEY_braille_dots_13478 0x10028cd /* U+28CD BRAILLE PATTERN DOTS-13478 */ +#define XKB_KEY_braille_dots_23478 0x10028ce /* U+28CE BRAILLE PATTERN DOTS-23478 */ +#define XKB_KEY_braille_dots_123478 0x10028cf /* U+28CF BRAILLE PATTERN DOTS-123478 */ +#define XKB_KEY_braille_dots_578 0x10028d0 /* U+28D0 BRAILLE PATTERN DOTS-578 */ +#define XKB_KEY_braille_dots_1578 0x10028d1 /* U+28D1 BRAILLE PATTERN DOTS-1578 */ +#define XKB_KEY_braille_dots_2578 0x10028d2 /* U+28D2 BRAILLE PATTERN DOTS-2578 */ +#define XKB_KEY_braille_dots_12578 0x10028d3 /* U+28D3 BRAILLE PATTERN DOTS-12578 */ +#define XKB_KEY_braille_dots_3578 0x10028d4 /* U+28D4 BRAILLE PATTERN DOTS-3578 */ +#define XKB_KEY_braille_dots_13578 0x10028d5 /* U+28D5 BRAILLE PATTERN DOTS-13578 */ +#define XKB_KEY_braille_dots_23578 0x10028d6 /* U+28D6 BRAILLE PATTERN DOTS-23578 */ +#define XKB_KEY_braille_dots_123578 0x10028d7 /* U+28D7 BRAILLE PATTERN DOTS-123578 */ +#define XKB_KEY_braille_dots_4578 0x10028d8 /* U+28D8 BRAILLE PATTERN DOTS-4578 */ +#define XKB_KEY_braille_dots_14578 0x10028d9 /* U+28D9 BRAILLE PATTERN DOTS-14578 */ +#define XKB_KEY_braille_dots_24578 0x10028da /* U+28DA BRAILLE PATTERN DOTS-24578 */ +#define XKB_KEY_braille_dots_124578 0x10028db /* U+28DB BRAILLE PATTERN DOTS-124578 */ +#define XKB_KEY_braille_dots_34578 0x10028dc /* U+28DC BRAILLE PATTERN DOTS-34578 */ +#define XKB_KEY_braille_dots_134578 0x10028dd /* U+28DD BRAILLE PATTERN DOTS-134578 */ +#define XKB_KEY_braille_dots_234578 0x10028de /* U+28DE BRAILLE PATTERN DOTS-234578 */ +#define XKB_KEY_braille_dots_1234578 0x10028df /* U+28DF BRAILLE PATTERN DOTS-1234578 */ +#define XKB_KEY_braille_dots_678 0x10028e0 /* U+28E0 BRAILLE PATTERN DOTS-678 */ +#define XKB_KEY_braille_dots_1678 0x10028e1 /* U+28E1 BRAILLE PATTERN DOTS-1678 */ +#define XKB_KEY_braille_dots_2678 0x10028e2 /* U+28E2 BRAILLE PATTERN DOTS-2678 */ +#define XKB_KEY_braille_dots_12678 0x10028e3 /* U+28E3 BRAILLE PATTERN DOTS-12678 */ +#define XKB_KEY_braille_dots_3678 0x10028e4 /* U+28E4 BRAILLE PATTERN DOTS-3678 */ +#define XKB_KEY_braille_dots_13678 0x10028e5 /* U+28E5 BRAILLE PATTERN DOTS-13678 */ +#define XKB_KEY_braille_dots_23678 0x10028e6 /* U+28E6 BRAILLE PATTERN DOTS-23678 */ +#define XKB_KEY_braille_dots_123678 0x10028e7 /* U+28E7 BRAILLE PATTERN DOTS-123678 */ +#define XKB_KEY_braille_dots_4678 0x10028e8 /* U+28E8 BRAILLE PATTERN DOTS-4678 */ +#define XKB_KEY_braille_dots_14678 0x10028e9 /* U+28E9 BRAILLE PATTERN DOTS-14678 */ +#define XKB_KEY_braille_dots_24678 0x10028ea /* U+28EA BRAILLE PATTERN DOTS-24678 */ +#define XKB_KEY_braille_dots_124678 0x10028eb /* U+28EB BRAILLE PATTERN DOTS-124678 */ +#define XKB_KEY_braille_dots_34678 0x10028ec /* U+28EC BRAILLE PATTERN DOTS-34678 */ +#define XKB_KEY_braille_dots_134678 0x10028ed /* U+28ED BRAILLE PATTERN DOTS-134678 */ +#define XKB_KEY_braille_dots_234678 0x10028ee /* U+28EE BRAILLE PATTERN DOTS-234678 */ +#define XKB_KEY_braille_dots_1234678 0x10028ef /* U+28EF BRAILLE PATTERN DOTS-1234678 */ +#define XKB_KEY_braille_dots_5678 0x10028f0 /* U+28F0 BRAILLE PATTERN DOTS-5678 */ +#define XKB_KEY_braille_dots_15678 0x10028f1 /* U+28F1 BRAILLE PATTERN DOTS-15678 */ +#define XKB_KEY_braille_dots_25678 0x10028f2 /* U+28F2 BRAILLE PATTERN DOTS-25678 */ +#define XKB_KEY_braille_dots_125678 0x10028f3 /* U+28F3 BRAILLE PATTERN DOTS-125678 */ +#define XKB_KEY_braille_dots_35678 0x10028f4 /* U+28F4 BRAILLE PATTERN DOTS-35678 */ +#define XKB_KEY_braille_dots_135678 0x10028f5 /* U+28F5 BRAILLE PATTERN DOTS-135678 */ +#define XKB_KEY_braille_dots_235678 0x10028f6 /* U+28F6 BRAILLE PATTERN DOTS-235678 */ +#define XKB_KEY_braille_dots_1235678 0x10028f7 /* U+28F7 BRAILLE PATTERN DOTS-1235678 */ +#define XKB_KEY_braille_dots_45678 0x10028f8 /* U+28F8 BRAILLE PATTERN DOTS-45678 */ +#define XKB_KEY_braille_dots_145678 0x10028f9 /* U+28F9 BRAILLE PATTERN DOTS-145678 */ +#define XKB_KEY_braille_dots_245678 0x10028fa /* U+28FA BRAILLE PATTERN DOTS-245678 */ +#define XKB_KEY_braille_dots_1245678 0x10028fb /* U+28FB BRAILLE PATTERN DOTS-1245678 */ +#define XKB_KEY_braille_dots_345678 0x10028fc /* U+28FC BRAILLE PATTERN DOTS-345678 */ +#define XKB_KEY_braille_dots_1345678 0x10028fd /* U+28FD BRAILLE PATTERN DOTS-1345678 */ +#define XKB_KEY_braille_dots_2345678 0x10028fe /* U+28FE BRAILLE PATTERN DOTS-2345678 */ +#define XKB_KEY_braille_dots_12345678 0x10028ff /* U+28FF BRAILLE PATTERN DOTS-12345678 */ + +/* + * Sinhala (http://unicode.org/charts/PDF/U0D80.pdf) + * http://www.nongnu.org/sinhala/doc/transliteration/sinhala-transliteration_6.html + */ + +#define XKB_KEY_Sinh_ng 0x1000d82 /* U+0D82 SINHALA SIGN ANUSVARAYA */ +#define XKB_KEY_Sinh_h2 0x1000d83 /* U+0D83 SINHALA SIGN VISARGAYA */ +#define XKB_KEY_Sinh_a 0x1000d85 /* U+0D85 SINHALA LETTER AYANNA */ +#define XKB_KEY_Sinh_aa 0x1000d86 /* U+0D86 SINHALA LETTER AAYANNA */ +#define XKB_KEY_Sinh_ae 0x1000d87 /* U+0D87 SINHALA LETTER AEYANNA */ +#define XKB_KEY_Sinh_aee 0x1000d88 /* U+0D88 SINHALA LETTER AEEYANNA */ +#define XKB_KEY_Sinh_i 0x1000d89 /* U+0D89 SINHALA LETTER IYANNA */ +#define XKB_KEY_Sinh_ii 0x1000d8a /* U+0D8A SINHALA LETTER IIYANNA */ +#define XKB_KEY_Sinh_u 0x1000d8b /* U+0D8B SINHALA LETTER UYANNA */ +#define XKB_KEY_Sinh_uu 0x1000d8c /* U+0D8C SINHALA LETTER UUYANNA */ +#define XKB_KEY_Sinh_ri 0x1000d8d /* U+0D8D SINHALA LETTER IRUYANNA */ +#define XKB_KEY_Sinh_rii 0x1000d8e /* U+0D8E SINHALA LETTER IRUUYANNA */ +#define XKB_KEY_Sinh_lu 0x1000d8f /* U+0D8F SINHALA LETTER ILUYANNA */ +#define XKB_KEY_Sinh_luu 0x1000d90 /* U+0D90 SINHALA LETTER ILUUYANNA */ +#define XKB_KEY_Sinh_e 0x1000d91 /* U+0D91 SINHALA LETTER EYANNA */ +#define XKB_KEY_Sinh_ee 0x1000d92 /* U+0D92 SINHALA LETTER EEYANNA */ +#define XKB_KEY_Sinh_ai 0x1000d93 /* U+0D93 SINHALA LETTER AIYANNA */ +#define XKB_KEY_Sinh_o 0x1000d94 /* U+0D94 SINHALA LETTER OYANNA */ +#define XKB_KEY_Sinh_oo 0x1000d95 /* U+0D95 SINHALA LETTER OOYANNA */ +#define XKB_KEY_Sinh_au 0x1000d96 /* U+0D96 SINHALA LETTER AUYANNA */ +#define XKB_KEY_Sinh_ka 0x1000d9a /* U+0D9A SINHALA LETTER ALPAPRAANA KAYANNA */ +#define XKB_KEY_Sinh_kha 0x1000d9b /* U+0D9B SINHALA LETTER MAHAAPRAANA KAYANNA */ +#define XKB_KEY_Sinh_ga 0x1000d9c /* U+0D9C SINHALA LETTER ALPAPRAANA GAYANNA */ +#define XKB_KEY_Sinh_gha 0x1000d9d /* U+0D9D SINHALA LETTER MAHAAPRAANA GAYANNA */ +#define XKB_KEY_Sinh_ng2 0x1000d9e /* U+0D9E SINHALA LETTER KANTAJA NAASIKYAYA */ +#define XKB_KEY_Sinh_nga 0x1000d9f /* U+0D9F SINHALA LETTER SANYAKA GAYANNA */ +#define XKB_KEY_Sinh_ca 0x1000da0 /* U+0DA0 SINHALA LETTER ALPAPRAANA CAYANNA */ +#define XKB_KEY_Sinh_cha 0x1000da1 /* U+0DA1 SINHALA LETTER MAHAAPRAANA CAYANNA */ +#define XKB_KEY_Sinh_ja 0x1000da2 /* U+0DA2 SINHALA LETTER ALPAPRAANA JAYANNA */ +#define XKB_KEY_Sinh_jha 0x1000da3 /* U+0DA3 SINHALA LETTER MAHAAPRAANA JAYANNA */ +#define XKB_KEY_Sinh_nya 0x1000da4 /* U+0DA4 SINHALA LETTER TAALUJA NAASIKYAYA */ +#define XKB_KEY_Sinh_jnya 0x1000da5 /* U+0DA5 SINHALA LETTER TAALUJA SANYOOGA NAAKSIKYAYA */ +#define XKB_KEY_Sinh_nja 0x1000da6 /* U+0DA6 SINHALA LETTER SANYAKA JAYANNA */ +#define XKB_KEY_Sinh_tta 0x1000da7 /* U+0DA7 SINHALA LETTER ALPAPRAANA TTAYANNA */ +#define XKB_KEY_Sinh_ttha 0x1000da8 /* U+0DA8 SINHALA LETTER MAHAAPRAANA TTAYANNA */ +#define XKB_KEY_Sinh_dda 0x1000da9 /* U+0DA9 SINHALA LETTER ALPAPRAANA DDAYANNA */ +#define XKB_KEY_Sinh_ddha 0x1000daa /* U+0DAA SINHALA LETTER MAHAAPRAANA DDAYANNA */ +#define XKB_KEY_Sinh_nna 0x1000dab /* U+0DAB SINHALA LETTER MUURDHAJA NAYANNA */ +#define XKB_KEY_Sinh_ndda 0x1000dac /* U+0DAC SINHALA LETTER SANYAKA DDAYANNA */ +#define XKB_KEY_Sinh_tha 0x1000dad /* U+0DAD SINHALA LETTER ALPAPRAANA TAYANNA */ +#define XKB_KEY_Sinh_thha 0x1000dae /* U+0DAE SINHALA LETTER MAHAAPRAANA TAYANNA */ +#define XKB_KEY_Sinh_dha 0x1000daf /* U+0DAF SINHALA LETTER ALPAPRAANA DAYANNA */ +#define XKB_KEY_Sinh_dhha 0x1000db0 /* U+0DB0 SINHALA LETTER MAHAAPRAANA DAYANNA */ +#define XKB_KEY_Sinh_na 0x1000db1 /* U+0DB1 SINHALA LETTER DANTAJA NAYANNA */ +#define XKB_KEY_Sinh_ndha 0x1000db3 /* U+0DB3 SINHALA LETTER SANYAKA DAYANNA */ +#define XKB_KEY_Sinh_pa 0x1000db4 /* U+0DB4 SINHALA LETTER ALPAPRAANA PAYANNA */ +#define XKB_KEY_Sinh_pha 0x1000db5 /* U+0DB5 SINHALA LETTER MAHAAPRAANA PAYANNA */ +#define XKB_KEY_Sinh_ba 0x1000db6 /* U+0DB6 SINHALA LETTER ALPAPRAANA BAYANNA */ +#define XKB_KEY_Sinh_bha 0x1000db7 /* U+0DB7 SINHALA LETTER MAHAAPRAANA BAYANNA */ +#define XKB_KEY_Sinh_ma 0x1000db8 /* U+0DB8 SINHALA LETTER MAYANNA */ +#define XKB_KEY_Sinh_mba 0x1000db9 /* U+0DB9 SINHALA LETTER AMBA BAYANNA */ +#define XKB_KEY_Sinh_ya 0x1000dba /* U+0DBA SINHALA LETTER YAYANNA */ +#define XKB_KEY_Sinh_ra 0x1000dbb /* U+0DBB SINHALA LETTER RAYANNA */ +#define XKB_KEY_Sinh_la 0x1000dbd /* U+0DBD SINHALA LETTER DANTAJA LAYANNA */ +#define XKB_KEY_Sinh_va 0x1000dc0 /* U+0DC0 SINHALA LETTER VAYANNA */ +#define XKB_KEY_Sinh_sha 0x1000dc1 /* U+0DC1 SINHALA LETTER TAALUJA SAYANNA */ +#define XKB_KEY_Sinh_ssha 0x1000dc2 /* U+0DC2 SINHALA LETTER MUURDHAJA SAYANNA */ +#define XKB_KEY_Sinh_sa 0x1000dc3 /* U+0DC3 SINHALA LETTER DANTAJA SAYANNA */ +#define XKB_KEY_Sinh_ha 0x1000dc4 /* U+0DC4 SINHALA LETTER HAYANNA */ +#define XKB_KEY_Sinh_lla 0x1000dc5 /* U+0DC5 SINHALA LETTER MUURDHAJA LAYANNA */ +#define XKB_KEY_Sinh_fa 0x1000dc6 /* U+0DC6 SINHALA LETTER FAYANNA */ +#define XKB_KEY_Sinh_al 0x1000dca /* U+0DCA SINHALA SIGN AL-LAKUNA */ +#define XKB_KEY_Sinh_aa2 0x1000dcf /* U+0DCF SINHALA VOWEL SIGN AELA-PILLA */ +#define XKB_KEY_Sinh_ae2 0x1000dd0 /* U+0DD0 SINHALA VOWEL SIGN KETTI AEDA-PILLA */ +#define XKB_KEY_Sinh_aee2 0x1000dd1 /* U+0DD1 SINHALA VOWEL SIGN DIGA AEDA-PILLA */ +#define XKB_KEY_Sinh_i2 0x1000dd2 /* U+0DD2 SINHALA VOWEL SIGN KETTI IS-PILLA */ +#define XKB_KEY_Sinh_ii2 0x1000dd3 /* U+0DD3 SINHALA VOWEL SIGN DIGA IS-PILLA */ +#define XKB_KEY_Sinh_u2 0x1000dd4 /* U+0DD4 SINHALA VOWEL SIGN KETTI PAA-PILLA */ +#define XKB_KEY_Sinh_uu2 0x1000dd6 /* U+0DD6 SINHALA VOWEL SIGN DIGA PAA-PILLA */ +#define XKB_KEY_Sinh_ru2 0x1000dd8 /* U+0DD8 SINHALA VOWEL SIGN GAETTA-PILLA */ +#define XKB_KEY_Sinh_e2 0x1000dd9 /* U+0DD9 SINHALA VOWEL SIGN KOMBUVA */ +#define XKB_KEY_Sinh_ee2 0x1000dda /* U+0DDA SINHALA VOWEL SIGN DIGA KOMBUVA */ +#define XKB_KEY_Sinh_ai2 0x1000ddb /* U+0DDB SINHALA VOWEL SIGN KOMBU DEKA */ +#define XKB_KEY_Sinh_o2 0x1000ddc /* U+0DDC SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA */ +#define XKB_KEY_Sinh_oo2 0x1000ddd /* U+0DDD SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */ +#define XKB_KEY_Sinh_au2 0x1000dde /* U+0DDE SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA */ +#define XKB_KEY_Sinh_lu2 0x1000ddf /* U+0DDF SINHALA VOWEL SIGN GAYANUKITTA */ +#define XKB_KEY_Sinh_ruu2 0x1000df2 /* U+0DF2 SINHALA VOWEL SIGN DIGA GAETTA-PILLA */ +#define XKB_KEY_Sinh_luu2 0x1000df3 /* U+0DF3 SINHALA VOWEL SIGN DIGA GAYANUKITTA */ +#define XKB_KEY_Sinh_kunddaliya 0x1000df4 /* U+0DF4 SINHALA PUNCTUATION KUNDDALIYA */ +/* + * XFree86 vendor specific keysyms. + * + * The XFree86 keysym range is 0x10080001 - 0x1008ffff. + * + * The XF86 set of keysyms is a catch-all set of defines for keysyms found + * on various multimedia keyboards. Originally specific to XFree86 they have + * been been adopted over time and are considered a "standard" part of X + * keysym definitions. + * XFree86 never properly commented these keysyms, so we have done our + * best to explain the semantic meaning of these keys. + * + * XFree86 has removed their mail archives of the period, that might have + * shed more light on some of these definitions. Until/unless we resurrect + * these archives, these are from memory and usage. + */ + +/* + * ModeLock + * + * This one is old, and not really used any more since XKB offers this + * functionality. + */ + +#define XKB_KEY_XF86ModeLock 0x1008ff01 /* Mode Switch Lock */ + +/* Backlight controls. */ +#define XKB_KEY_XF86MonBrightnessUp 0x1008ff02 /* Monitor/panel brightness */ +#define XKB_KEY_XF86MonBrightnessDown 0x1008ff03 /* Monitor/panel brightness */ +#define XKB_KEY_XF86KbdLightOnOff 0x1008ff04 /* Keyboards may be lit */ +#define XKB_KEY_XF86KbdBrightnessUp 0x1008ff05 /* Keyboards may be lit */ +#define XKB_KEY_XF86KbdBrightnessDown 0x1008ff06 /* Keyboards may be lit */ +#define XKB_KEY_XF86MonBrightnessCycle 0x1008ff07 /* Monitor/panel brightness */ + +/* + * Keys found on some "Internet" keyboards. + */ +#define XKB_KEY_XF86Standby 0x1008ff10 /* System into standby mode */ +#define XKB_KEY_XF86AudioLowerVolume 0x1008ff11 /* Volume control down */ +#define XKB_KEY_XF86AudioMute 0x1008ff12 /* Mute sound from the system */ +#define XKB_KEY_XF86AudioRaiseVolume 0x1008ff13 /* Volume control up */ +#define XKB_KEY_XF86AudioPlay 0x1008ff14 /* Start playing of audio > */ +#define XKB_KEY_XF86AudioStop 0x1008ff15 /* Stop playing audio */ +#define XKB_KEY_XF86AudioPrev 0x1008ff16 /* Previous track */ +#define XKB_KEY_XF86AudioNext 0x1008ff17 /* Next track */ +#define XKB_KEY_XF86HomePage 0x1008ff18 /* Display user's home page */ +#define XKB_KEY_XF86Mail 0x1008ff19 /* Invoke user's mail program */ +#define XKB_KEY_XF86Start 0x1008ff1a /* Start application */ +#define XKB_KEY_XF86Search 0x1008ff1b /* Search */ +#define XKB_KEY_XF86AudioRecord 0x1008ff1c /* Record audio application */ + +/* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */ +#define XKB_KEY_XF86Calculator 0x1008ff1d /* Invoke calculator program */ +#define XKB_KEY_XF86Memo 0x1008ff1e /* Invoke Memo taking program */ +#define XKB_KEY_XF86ToDoList 0x1008ff1f /* Invoke To Do List program */ +#define XKB_KEY_XF86Calendar 0x1008ff20 /* Invoke Calendar program */ +#define XKB_KEY_XF86PowerDown 0x1008ff21 /* Deep sleep the system */ +#define XKB_KEY_XF86ContrastAdjust 0x1008ff22 /* Adjust screen contrast */ +#define XKB_KEY_XF86RockerUp 0x1008ff23 /* Rocker switches exist up */ +#define XKB_KEY_XF86RockerDown 0x1008ff24 /* and down */ +#define XKB_KEY_XF86RockerEnter 0x1008ff25 /* and let you press them */ + +/* Some more "Internet" keyboard symbols */ +#define XKB_KEY_XF86Back 0x1008ff26 /* Like back on a browser */ +#define XKB_KEY_XF86Forward 0x1008ff27 /* Like forward on a browser */ +#define XKB_KEY_XF86Stop 0x1008ff28 /* Stop current operation */ +#define XKB_KEY_XF86Refresh 0x1008ff29 /* Refresh the page */ +#define XKB_KEY_XF86PowerOff 0x1008ff2a /* Power off system entirely */ +#define XKB_KEY_XF86WakeUp 0x1008ff2b /* Wake up system from sleep */ +#define XKB_KEY_XF86Eject 0x1008ff2c /* Eject device (e.g. DVD) */ +#define XKB_KEY_XF86ScreenSaver 0x1008ff2d /* Invoke screensaver */ +#define XKB_KEY_XF86WWW 0x1008ff2e /* Invoke web browser */ +#define XKB_KEY_XF86Sleep 0x1008ff2f /* Put system to sleep */ +#define XKB_KEY_XF86Favorites 0x1008ff30 /* Show favorite locations */ +#define XKB_KEY_XF86AudioPause 0x1008ff31 /* Pause audio playing */ +#define XKB_KEY_XF86AudioMedia 0x1008ff32 /* Launch media collection app */ +#define XKB_KEY_XF86MyComputer 0x1008ff33 /* Display "My Computer" window */ +#define XKB_KEY_XF86VendorHome 0x1008ff34 /* Display vendor home web site */ +#define XKB_KEY_XF86LightBulb 0x1008ff35 /* Light bulb keys exist */ +#define XKB_KEY_XF86Shop 0x1008ff36 /* Display shopping web site */ +#define XKB_KEY_XF86History 0x1008ff37 /* Show history of web surfing */ +#define XKB_KEY_XF86OpenURL 0x1008ff38 /* Open selected URL */ +#define XKB_KEY_XF86AddFavorite 0x1008ff39 /* Add URL to favorites list */ +#define XKB_KEY_XF86HotLinks 0x1008ff3a /* Show "hot" links */ +#define XKB_KEY_XF86BrightnessAdjust 0x1008ff3b /* Invoke brightness adj. UI */ +#define XKB_KEY_XF86Finance 0x1008ff3c /* Display financial site */ +#define XKB_KEY_XF86Community 0x1008ff3d /* Display user's community */ +#define XKB_KEY_XF86AudioRewind 0x1008ff3e /* "rewind" audio track */ +#define XKB_KEY_XF86BackForward 0x1008ff3f /* ??? */ +#define XKB_KEY_XF86Launch0 0x1008ff40 /* Launch Application */ +#define XKB_KEY_XF86Launch1 0x1008ff41 /* Launch Application */ +#define XKB_KEY_XF86Launch2 0x1008ff42 /* Launch Application */ +#define XKB_KEY_XF86Launch3 0x1008ff43 /* Launch Application */ +#define XKB_KEY_XF86Launch4 0x1008ff44 /* Launch Application */ +#define XKB_KEY_XF86Launch5 0x1008ff45 /* Launch Application */ +#define XKB_KEY_XF86Launch6 0x1008ff46 /* Launch Application */ +#define XKB_KEY_XF86Launch7 0x1008ff47 /* Launch Application */ +#define XKB_KEY_XF86Launch8 0x1008ff48 /* Launch Application */ +#define XKB_KEY_XF86Launch9 0x1008ff49 /* Launch Application */ +#define XKB_KEY_XF86LaunchA 0x1008ff4a /* Launch Application */ +#define XKB_KEY_XF86LaunchB 0x1008ff4b /* Launch Application */ +#define XKB_KEY_XF86LaunchC 0x1008ff4c /* Launch Application */ +#define XKB_KEY_XF86LaunchD 0x1008ff4d /* Launch Application */ +#define XKB_KEY_XF86LaunchE 0x1008ff4e /* Launch Application */ +#define XKB_KEY_XF86LaunchF 0x1008ff4f /* Launch Application */ + +#define XKB_KEY_XF86ApplicationLeft 0x1008ff50 /* switch to application, left */ +#define XKB_KEY_XF86ApplicationRight 0x1008ff51 /* switch to application, right*/ +#define XKB_KEY_XF86Book 0x1008ff52 /* Launch bookreader */ +#define XKB_KEY_XF86CD 0x1008ff53 /* Launch CD/DVD player */ +#define XKB_KEY_XF86MediaSelectCD 0x1008ff53 /* Alias for XF86CD */ +#define XKB_KEY_XF86Calculater 0x1008ff54 /* Launch Calculater */ +#define XKB_KEY_XF86Clear 0x1008ff55 /* Clear window, screen */ +#define XKB_KEY_XF86Close 0x1008ff56 /* Close window */ +#define XKB_KEY_XF86Copy 0x1008ff57 /* Copy selection */ +#define XKB_KEY_XF86Cut 0x1008ff58 /* Cut selection */ +#define XKB_KEY_XF86Display 0x1008ff59 /* Output switch key */ +#define XKB_KEY_XF86DOS 0x1008ff5a /* Launch DOS (emulation) */ +#define XKB_KEY_XF86Documents 0x1008ff5b /* Open documents window */ +#define XKB_KEY_XF86Excel 0x1008ff5c /* Launch spread sheet */ +#define XKB_KEY_XF86Explorer 0x1008ff5d /* Launch file explorer */ +#define XKB_KEY_XF86Game 0x1008ff5e /* Launch game */ +#define XKB_KEY_XF86Go 0x1008ff5f /* Go to URL */ +#define XKB_KEY_XF86iTouch 0x1008ff60 /* Logitech iTouch- don't use */ +#define XKB_KEY_XF86LogOff 0x1008ff61 /* Log off system */ +#define XKB_KEY_XF86Market 0x1008ff62 /* ?? */ +#define XKB_KEY_XF86Meeting 0x1008ff63 /* enter meeting in calendar */ +#define XKB_KEY_XF86MenuKB 0x1008ff65 /* distinguish keyboard from PB */ +#define XKB_KEY_XF86MenuPB 0x1008ff66 /* distinguish PB from keyboard */ +#define XKB_KEY_XF86MySites 0x1008ff67 /* Favourites */ +#define XKB_KEY_XF86New 0x1008ff68 /* New (folder, document... */ +#define XKB_KEY_XF86News 0x1008ff69 /* News */ +#define XKB_KEY_XF86OfficeHome 0x1008ff6a /* Office home (old Staroffice)*/ +#define XKB_KEY_XF86Open 0x1008ff6b /* Open */ +#define XKB_KEY_XF86Option 0x1008ff6c /* ?? */ +#define XKB_KEY_XF86Paste 0x1008ff6d /* Paste */ +#define XKB_KEY_XF86Phone 0x1008ff6e /* Launch phone; dial number */ +#define XKB_KEY_XF86Q 0x1008ff70 /* Compaq's Q - don't use */ +#define XKB_KEY_XF86Reply 0x1008ff72 /* Reply e.g., mail */ +#define XKB_KEY_XF86Reload 0x1008ff73 /* Reload web page, file, etc. */ +#define XKB_KEY_XF86RotateWindows 0x1008ff74 /* Rotate windows e.g. xrandr */ +#define XKB_KEY_XF86RotationPB 0x1008ff75 /* don't use */ +#define XKB_KEY_XF86RotationKB 0x1008ff76 /* don't use */ +#define XKB_KEY_XF86Save 0x1008ff77 /* Save (file, document, state */ +#define XKB_KEY_XF86ScrollUp 0x1008ff78 /* Scroll window/contents up */ +#define XKB_KEY_XF86ScrollDown 0x1008ff79 /* Scrool window/contentd down */ +#define XKB_KEY_XF86ScrollClick 0x1008ff7a /* Use XKB mousekeys instead */ +#define XKB_KEY_XF86Send 0x1008ff7b /* Send mail, file, object */ +#define XKB_KEY_XF86Spell 0x1008ff7c /* Spell checker */ +#define XKB_KEY_XF86SplitScreen 0x1008ff7d /* Split window or screen */ +#define XKB_KEY_XF86Support 0x1008ff7e /* Get support (??) */ +#define XKB_KEY_XF86TaskPane 0x1008ff7f /* Show tasks */ +#define XKB_KEY_XF86Terminal 0x1008ff80 /* Launch terminal emulator */ +#define XKB_KEY_XF86Tools 0x1008ff81 /* toolbox of desktop/app. */ +#define XKB_KEY_XF86Travel 0x1008ff82 /* ?? */ +#define XKB_KEY_XF86UserPB 0x1008ff84 /* ?? */ +#define XKB_KEY_XF86User1KB 0x1008ff85 /* ?? */ +#define XKB_KEY_XF86User2KB 0x1008ff86 /* ?? */ +#define XKB_KEY_XF86Video 0x1008ff87 /* Launch video player */ +#define XKB_KEY_XF86WheelButton 0x1008ff88 /* button from a mouse wheel */ +#define XKB_KEY_XF86Word 0x1008ff89 /* Launch word processor */ +#define XKB_KEY_XF86Xfer 0x1008ff8a +#define XKB_KEY_XF86ZoomIn 0x1008ff8b /* zoom in view, map, etc. */ +#define XKB_KEY_XF86ZoomOut 0x1008ff8c /* zoom out view, map, etc. */ + +#define XKB_KEY_XF86Away 0x1008ff8d /* mark yourself as away */ +#define XKB_KEY_XF86Messenger 0x1008ff8e /* as in instant messaging */ +#define XKB_KEY_XF86WebCam 0x1008ff8f /* Launch web camera app. */ +#define XKB_KEY_XF86MailForward 0x1008ff90 /* Forward in mail */ +#define XKB_KEY_XF86Pictures 0x1008ff91 /* Show pictures */ +#define XKB_KEY_XF86Music 0x1008ff92 /* Launch music application */ + +#define XKB_KEY_XF86Battery 0x1008ff93 /* Display battery information */ +#define XKB_KEY_XF86Bluetooth 0x1008ff94 /* Enable/disable Bluetooth */ +#define XKB_KEY_XF86WLAN 0x1008ff95 /* Enable/disable WLAN */ +#define XKB_KEY_XF86UWB 0x1008ff96 /* Enable/disable UWB */ + +#define XKB_KEY_XF86AudioForward 0x1008ff97 /* fast-forward audio track */ +#define XKB_KEY_XF86AudioRepeat 0x1008ff98 /* toggle repeat mode */ +#define XKB_KEY_XF86AudioRandomPlay 0x1008ff99 /* toggle shuffle mode */ +#define XKB_KEY_XF86Subtitle 0x1008ff9a /* cycle through subtitle */ +#define XKB_KEY_XF86AudioCycleTrack 0x1008ff9b /* cycle through audio tracks */ +#define XKB_KEY_XF86CycleAngle 0x1008ff9c /* cycle through angles */ +#define XKB_KEY_XF86FrameBack 0x1008ff9d /* video: go one frame back */ +#define XKB_KEY_XF86FrameForward 0x1008ff9e /* video: go one frame forward */ +#define XKB_KEY_XF86Time 0x1008ff9f /* display, or shows an entry for time seeking */ +#define XKB_KEY_XF86Select 0x1008ffa0 /* Select button on joypads and remotes */ +#define XKB_KEY_XF86View 0x1008ffa1 /* Show a view options/properties */ +#define XKB_KEY_XF86TopMenu 0x1008ffa2 /* Go to a top-level menu in a video */ + +#define XKB_KEY_XF86Red 0x1008ffa3 /* Red button */ +#define XKB_KEY_XF86Green 0x1008ffa4 /* Green button */ +#define XKB_KEY_XF86Yellow 0x1008ffa5 /* Yellow button */ +#define XKB_KEY_XF86Blue 0x1008ffa6 /* Blue button */ + +#define XKB_KEY_XF86Suspend 0x1008ffa7 /* Sleep to RAM */ +#define XKB_KEY_XF86Hibernate 0x1008ffa8 /* Sleep to disk */ +#define XKB_KEY_XF86TouchpadToggle 0x1008ffa9 /* Toggle between touchpad/trackstick */ +#define XKB_KEY_XF86TouchpadOn 0x1008ffb0 /* The touchpad got switched on */ +#define XKB_KEY_XF86TouchpadOff 0x1008ffb1 /* The touchpad got switched off */ + +#define XKB_KEY_XF86AudioMicMute 0x1008ffb2 /* Mute the Mic from the system */ + +#define XKB_KEY_XF86Keyboard 0x1008ffb3 /* User defined keyboard related action */ + +#define XKB_KEY_XF86WWAN 0x1008ffb4 /* Toggle WWAN (LTE, UMTS, etc.) radio */ +#define XKB_KEY_XF86RFKill 0x1008ffb5 /* Toggle radios on/off */ + +#define XKB_KEY_XF86AudioPreset 0x1008ffb6 /* Select equalizer preset, e.g. theatre-mode */ + +#define XKB_KEY_XF86RotationLockToggle 0x1008ffb7 /* Toggle screen rotation lock on/off */ + +#define XKB_KEY_XF86FullScreen 0x1008ffb8 /* Toggle fullscreen */ + +/* Keys for special action keys (hot keys) */ +/* Virtual terminals on some operating systems */ +#define XKB_KEY_XF86Switch_VT_1 0x1008fe01 +#define XKB_KEY_XF86Switch_VT_2 0x1008fe02 +#define XKB_KEY_XF86Switch_VT_3 0x1008fe03 +#define XKB_KEY_XF86Switch_VT_4 0x1008fe04 +#define XKB_KEY_XF86Switch_VT_5 0x1008fe05 +#define XKB_KEY_XF86Switch_VT_6 0x1008fe06 +#define XKB_KEY_XF86Switch_VT_7 0x1008fe07 +#define XKB_KEY_XF86Switch_VT_8 0x1008fe08 +#define XKB_KEY_XF86Switch_VT_9 0x1008fe09 +#define XKB_KEY_XF86Switch_VT_10 0x1008fe0a +#define XKB_KEY_XF86Switch_VT_11 0x1008fe0b +#define XKB_KEY_XF86Switch_VT_12 0x1008fe0c + +#define XKB_KEY_XF86Ungrab 0x1008fe20 /* force ungrab */ +#define XKB_KEY_XF86ClearGrab 0x1008fe21 /* kill application with grab */ +#define XKB_KEY_XF86Next_VMode 0x1008fe22 /* next video mode available */ +#define XKB_KEY_XF86Prev_VMode 0x1008fe23 /* prev. video mode available */ +#define XKB_KEY_XF86LogWindowTree 0x1008fe24 /* print window tree to log */ +#define XKB_KEY_XF86LogGrabInfo 0x1008fe25 /* print all active grabs to log */ + + +/* + * Reserved range for evdev symbols: 0x10081000-0x10081FFF + * + * Key symbols within this range are intended for a 1:1 mapping to the + * Linux kernel input-event-codes.h file: + * - Keysym value: `_EVDEVK(kernel value)` + * - Keysym name: it must be prefixed by `XKB_KEY_XF86`. The recommended *default* + * name uses the following pattern: `XKB_KEY_XF86CamelCaseKernelName`. CamelCasing + * is done with a human control as last authority, e.g. see VOD instead of Vod + * for the Video on Demand key. In case that the kernel key name is too + * ambiguous, it is recommended to create a more explicit name with the + * following guidelines: + * 1. Names should be mnemonic. + * 2. Names should avoid acronyms, unless sufficiently common and documented + * in a comment. + * 3. Names should identify a function. + * 4. Keysyms share a common namespace, so keys with a generic name should + * denote a generic function, otherwise it should be renamed to add context. + * E.g. `KEY_OK` has the associated keysym `XKB_KEY_XF86OK`, while `KEY_TITLE` + * (used to open a menu to select a chapter of a media) is associated to + * the keysym `XKB_KEY_XF86MediaTitleMenu` to avoid ambiguity. + * 5. Keysyms should support designing *portable* applications, therefore + * their names should be self-explaining to facilitate finding them and + * to avoid misuse. + * 6. The “HID usage tables for USB” can be used if there is an unambiguous + * mapping. See: + * - Reference document: https://usb.org/document-library/hid-usage-tables-16 + * - Mapping in the Linux source file: `drivers/hid/hid-input.c` as of 2025-07 + * + * For example, the kernel + * #define KEY_MACRO_RECORD_START 0x2b0 + * effectively ends up as: + * #define XKB_KEY_XF86MacroRecordStart 0x100812b0 + * + * For historical reasons, some keysyms within the reserved range will be + * missing, most notably all "normal" keys that are mapped through default + * XKB layouts (e.g. KEY_Q). + * + * The format for #defines is strict: + * + * #define XKB_KEY_XF86Foo_EVDEVK(0xABC) |* kver KEY_FOO *| + * #define XKB_KEY_XF86Foo_EVDEVK(0xABC) |* Alias for XF86Bar *| + * #define XKB_KEY_XF86Foo_EVDEVK(0xABC) |* Deprecated alias for XF86Bar *| + * + * Where + * - alignment by spaces + * - the _EVDEVK macro must be used + * - the hex code must be in uppercase hex + * - the kernel version (kver) is in the form v5.10 + * - kver and key name are within a slash-star comment (a pipe is used in + * this example for technical reasons) + * These #defines are parsed by scripts. Do not stray from the given format. + * + * Where the evdev keycode is mapped to a different symbol, please add a + * comment line starting with Use: but otherwise the same format, e.g. + * Use: XKB_KEY_XF86RotationLockToggle _EVDEVK(0x231) v4.16 KEY_ROTATE_LOCK_TOGGLE + * + */ +/* Use: XKB_KEY_XF86Eject _EVDEVK(0x0a2) KEY_EJECTCLOSECD */ +/* Use: XKB_KEY_XF86New _EVDEVK(0x0b5) v2.6.14 KEY_NEW */ +/* Use: XKB_KEY_Redo _EVDEVK(0x0b6) v2.6.14 KEY_REDO */ +/* KEY_DASHBOARD has been mapped to LaunchB in xkeyboard-config since 2011 */ +/* Use: XKB_KEY_XF86LaunchB _EVDEVK(0x0cc) v2.6.28 KEY_DASHBOARD */ +/* Use: XKB_KEY_XF86Display _EVDEVK(0x0e3) v2.6.12 KEY_SWITCHVIDEOMODE */ +/* Use: XKB_KEY_XF86KbdLightOnOff _EVDEVK(0x0e4) v2.6.12 KEY_KBDILLUMTOGGLE */ +/* Use: XKB_KEY_XF86KbdBrightnessDown _EVDEVK(0x0e5) v2.6.12 KEY_KBDILLUMDOWN */ +/* Use: XKB_KEY_XF86KbdBrightnessUp _EVDEVK(0x0e6) v2.6.12 KEY_KBDILLUMUP */ +/* Use: XKB_KEY_XF86Send _EVDEVK(0x0e7) v2.6.14 KEY_SEND */ +/* Use: XKB_KEY_XF86Reply _EVDEVK(0x0e8) v2.6.14 KEY_REPLY */ +/* Use: XKB_KEY_XF86MailForward _EVDEVK(0x0e9) v2.6.14 KEY_FORWARDMAIL */ +/* Use: XKB_KEY_XF86Save _EVDEVK(0x0ea) v2.6.14 KEY_SAVE */ +/* Use: XKB_KEY_XF86Documents _EVDEVK(0x0eb) v2.6.14 KEY_DOCUMENTS */ +/* Use: XKB_KEY_XF86Battery _EVDEVK(0x0ec) v2.6.17 KEY_BATTERY */ +/* Use: XKB_KEY_XF86Bluetooth _EVDEVK(0x0ed) v2.6.19 KEY_BLUETOOTH */ +/* Use: XKB_KEY_XF86WLAN _EVDEVK(0x0ee) v2.6.19 KEY_WLAN */ +/* Use: XKB_KEY_XF86UWB _EVDEVK(0x0ef) v2.6.24 KEY_UWB */ +/* Use: XKB_KEY_XF86Next_VMode _EVDEVK(0x0f1) v2.6.23 KEY_VIDEO_NEXT */ +/* Use: XKB_KEY_XF86Prev_VMode _EVDEVK(0x0f2) v2.6.23 KEY_VIDEO_PREV */ +/* Use: XKB_KEY_XF86MonBrightnessCycle _EVDEVK(0x0f3) v2.6.23 KEY_BRIGHTNESS_CYCLE */ +#define XKB_KEY_XF86BrightnessAuto 0x100810f4 /* v3.16 KEY_BRIGHTNESS_AUTO */ +#define XKB_KEY_XF86DisplayOff 0x100810f5 /* v2.6.23 KEY_DISPLAY_OFF */ +/* Use: XKB_KEY_XF86WWAN _EVDEVK(0x0f6) v3.13 KEY_WWAN */ +/* Use: XKB_KEY_XF86RFKill _EVDEVK(0x0f7) v2.6.33 KEY_RFKILL */ +/* Use: XKB_KEY_XF86AudioMicMute _EVDEVK(0x0f8) v3.1 KEY_MICMUTE */ +#define XKB_KEY_XF86OK 0x10081160 /* v2.5.26 KEY_OK */ +/* Use: XKB_KEY_XF86Select _EVDEVK(0x161) v2.5.26 KEY_SELECT */ +#define XKB_KEY_XF86GoTo 0x10081162 /* v2.5.26 KEY_GOTO */ +/* Use: XKB_KEY_XF86Clear _EVDEVK(0x163) v2.5.26 KEY_CLEAR */ +/* TODO: Unclear function _EVDEVK(0x164) v2.5.26 KEY_POWER2 */ +/* Use: XKB_KEY_XF86Option _EVDEVK(0x165) v2.5.26 KEY_OPTION */ +#define XKB_KEY_XF86Info 0x10081166 /* v2.5.26 KEY_INFO */ +/* Use: XKB_KEY_XF86Time _EVDEVK(0x167) v2.5.26 KEY_TIME */ +#define XKB_KEY_XF86VendorLogo 0x10081168 /* v2.5.26 KEY_VENDOR */ +/* TODO: unclear function _EVDEVK(0x169) v2.5.26 KEY_ARCHIVE */ +#define XKB_KEY_XF86MediaSelectProgramGuide 0x1008116a /* v2.5.26 KEY_PROGRAM */ +/* Use: XKB_KEY_XF86NextFavorite _EVDEVK(0x16b) v2.5.26 KEY_CHANNEL */ +/* Use: XKB_KEY_XF86Favorites _EVDEVK(0x16c) v2.5.26 KEY_FAVORITES */ +/* Use: XKB_KEY_XF86MediaSelectProgramGuide _EVDEVK(0x16d) v2.5.26 KEY_EPG */ +#define XKB_KEY_XF86MediaSelectHome 0x1008116e /* v2.5.26 KEY_PVR */ +/* TODO: Multimedia Home Platform _EVDEVK(0x16f) v2.5.26 KEY_MHP */ +#define XKB_KEY_XF86MediaLanguageMenu 0x10081170 /* v2.5.26 KEY_LANGUAGE */ +#define XKB_KEY_XF86MediaTitleMenu 0x10081171 /* v2.5.26 KEY_TITLE */ +/* Use: XKB_KEY_XF86Subtitle _EVDEVK(0x172) v2.5.26 KEY_SUBTITLE */ +/* Use: XKB_KEY_XF86CycleAngle _EVDEVK(0x173) v2.5.26 KEY_ANGLE */ +/* Use: XKB_KEY_XF86FullScreen _EVDEVK(0x174) v5.1 KEY_FULL_SCREEN */ +#define XKB_KEY_XF86AudioChannelMode 0x10081175 /* v2.5.26 KEY_MODE */ +/* Use: XKB_KEY_XF86Keyboard _EVDEVK(0x176) v2.5.26 KEY_KEYBOARD */ +#define XKB_KEY_XF86AspectRatio 0x10081177 /* v5.1 KEY_ASPECT_RATIO */ +#define XKB_KEY_XF86MediaSelectPC 0x10081178 /* v2.5.26 KEY_PC */ +#define XKB_KEY_XF86MediaSelectTV 0x10081179 /* v2.5.26 KEY_TV */ +#define XKB_KEY_XF86MediaSelectCable 0x1008117a /* v2.5.26 KEY_TV2 */ +#define XKB_KEY_XF86MediaSelectVCR 0x1008117b /* v2.5.26 KEY_VCR */ +#define XKB_KEY_XF86MediaSelectVCRPlus 0x1008117c /* v2.5.26 KEY_VCR2 */ +#define XKB_KEY_XF86MediaSelectSatellite 0x1008117d /* v2.5.26 KEY_SAT */ +/* TODO: unclear media selector _EVDEVK(0x17e) v2.5.26 KEY_SAT2 */ +/* Use: XKB_KEY_XF86MediaSelectCD _EVDEVK(0x17f) v2.5.26 KEY_CD */ +#define XKB_KEY_XF86MediaSelectTape 0x10081180 /* v2.5.26 KEY_TAPE */ +#define XKB_KEY_XF86MediaSelectRadio 0x10081181 /* v2.5.26 KEY_RADIO */ +#define XKB_KEY_XF86MediaSelectTuner 0x10081182 /* v2.5.26 KEY_TUNER */ +#define XKB_KEY_XF86MediaPlayer 0x10081183 /* v2.5.26 KEY_PLAYER */ +#define XKB_KEY_XF86MediaSelectTeletext 0x10081184 /* v2.5.26 KEY_TEXT */ +#define XKB_KEY_XF86DVD 0x10081185 /* v2.5.26 KEY_DVD */ +#define XKB_KEY_XF86MediaSelectDVD 0x10081185 /* Alias for XF86DVD */ +#define XKB_KEY_XF86MediaSelectAuxiliary 0x10081186 /* v2.5.26 KEY_AUX */ +/* TODO: unclear media selector _EVDEVK(0x187) v2.5.26 KEY_MP3 */ +#define XKB_KEY_XF86Audio 0x10081188 /* v2.5.26 KEY_AUDIO */ +/* Use: XKB_KEY_XF86Video _EVDEVK(0x189) v2.5.26 KEY_VIDEO */ +/* TODO: unclear function _EVDEVK(0x18a) v2.5.26 KEY_DIRECTORY */ +/* TODO: unclear function _EVDEVK(0x18b) v2.5.26 KEY_LIST */ +/* Use: XKB_KEY_XF86Memo _EVDEVK(0x18c) v2.5.26 KEY_MEMO */ +/* Use: XKB_KEY_XF86Calendar _EVDEVK(0x18d) v2.5.26 KEY_CALENDAR */ +/* Use: XKB_KEY_XF86Red _EVDEVK(0x18e) v2.5.26 KEY_RED */ +/* Use: XKB_KEY_XF86Green _EVDEVK(0x18f) v2.5.26 KEY_GREEN */ +/* Use: XKB_KEY_XF86Yellow _EVDEVK(0x190) v2.5.26 KEY_YELLOW */ +/* Use: XKB_KEY_XF86Blue _EVDEVK(0x191) v2.5.26 KEY_BLUE */ +#define XKB_KEY_XF86ChannelUp 0x10081192 /* v2.5.26 KEY_CHANNELUP */ +#define XKB_KEY_XF86ChannelDown 0x10081193 /* v2.5.26 KEY_CHANNELDOWN */ +/* TODO: unclear function _EVDEVK(0x194) v2.5.26 KEY_FIRST */ +/* TODO: unclear function _EVDEVK(0x195) v2.5.26 KEY_LAST */ +/* TODO: unclear function _EVDEVK(0x196) v2.5.26 KEY_AB */ +/* TODO: unclear function _EVDEVK(0x197) v2.5.26 KEY_NEXT */ +/* TODO: unclear function _EVDEVK(0x198) v2.5.26 KEY_RESTART */ +#define XKB_KEY_XF86MediaPlaySlow 0x10081199 /* v2.5.26 KEY_SLOW */ +/* Use: XKB_KEY_XF86AudioRandomPlay _EVDEVK(0x19a) v2.5.26 KEY_SHUFFLE */ +#define XKB_KEY_XF86Break 0x1008119b /* v2.5.26 KEY_BREAK */ +/* TODO: unclear function _EVDEVK(0x19c) v2.5.26 KEY_PREVIOUS */ +#define XKB_KEY_XF86NumberEntryMode 0x1008119d /* v2.5.26 KEY_DIGITS */ +/* TODO: unclear function _EVDEVK(0x19e) v2.5.26 KEY_TEEN */ +/* TODO: unclear function (Twenties?) _EVDEVK(0x19f) v2.5.26 KEY_TWEN */ +#define XKB_KEY_XF86VideoPhone 0x100811a0 /* v2.6.20 KEY_VIDEOPHONE */ +/* Use: XKB_KEY_XF86Game _EVDEVK(0x1a1) v2.6.20 KEY_GAMES */ +/* Use: XKB_KEY_XF86ZoomIn _EVDEVK(0x1a2) v2.6.20 KEY_ZOOMIN */ +/* Use: XKB_KEY_XF86ZoomOut _EVDEVK(0x1a3) v2.6.20 KEY_ZOOMOUT */ +#define XKB_KEY_XF86ZoomReset 0x100811a4 /* v2.6.20 KEY_ZOOMRESET */ +/* Use: XKB_KEY_XF86Word _EVDEVK(0x1a5) v2.6.20 KEY_WORDPROCESSOR */ +#define XKB_KEY_XF86Editor 0x100811a6 /* v2.6.20 KEY_EDITOR */ +/* Use: XKB_KEY_XF86Excel _EVDEVK(0x1a7) v2.6.20 KEY_SPREADSHEET */ +#define XKB_KEY_XF86GraphicsEditor 0x100811a8 /* v2.6.20 KEY_GRAPHICSEDITOR */ +#define XKB_KEY_XF86Presentation 0x100811a9 /* v2.6.20 KEY_PRESENTATION */ +#define XKB_KEY_XF86Database 0x100811aa /* v2.6.20 KEY_DATABASE */ +/* Use: XKB_KEY_XF86News _EVDEVK(0x1ab) v2.6.20 KEY_NEWS */ +#define XKB_KEY_XF86Voicemail 0x100811ac /* v2.6.20 KEY_VOICEMAIL */ +#define XKB_KEY_XF86Addressbook 0x100811ad /* v2.6.20 KEY_ADDRESSBOOK */ +/* Use: XKB_KEY_XF86Messenger _EVDEVK(0x1ae) v2.6.20 KEY_MESSENGER */ +#define XKB_KEY_XF86DisplayToggle 0x100811af /* v2.6.20 KEY_DISPLAYTOGGLE */ +#define XKB_KEY_XF86SpellCheck 0x100811b0 /* v2.6.24 KEY_SPELLCHECK */ +/* Use: XKB_KEY_XF86LogOff _EVDEVK(0x1b1) v2.6.24 KEY_LOGOFF */ +/* Use: XKB_KEY_dollar _EVDEVK(0x1b2) v2.6.24 KEY_DOLLAR */ +/* Use: XKB_KEY_EuroSign _EVDEVK(0x1b3) v2.6.24 KEY_EURO */ +/* Use: XKB_KEY_XF86FrameBack _EVDEVK(0x1b4) v2.6.24 KEY_FRAMEBACK */ +/* Use: XKB_KEY_XF86FrameForward _EVDEVK(0x1b5) v2.6.24 KEY_FRAMEFORWARD */ +#define XKB_KEY_XF86ContextMenu 0x100811b6 /* v2.6.24 KEY_CONTEXT_MENU */ +#define XKB_KEY_XF86MediaRepeat 0x100811b7 /* v2.6.26 KEY_MEDIA_REPEAT */ +#define XKB_KEY_XF8610ChannelsUp 0x100811b8 /* v2.6.38 KEY_10CHANNELSUP */ +#define XKB_KEY_XF8610ChannelsDown 0x100811b9 /* v2.6.38 KEY_10CHANNELSDOWN */ +#define XKB_KEY_XF86Images 0x100811ba /* v2.6.39 KEY_IMAGES */ +#define XKB_KEY_XF86NotificationCenter 0x100811bc /* v5.10 KEY_NOTIFICATION_CENTER */ +#define XKB_KEY_XF86PickupPhone 0x100811bd /* v5.10 KEY_PICKUP_PHONE */ +#define XKB_KEY_XF86HangupPhone 0x100811be /* v5.10 KEY_HANGUP_PHONE */ +#define XKB_KEY_XF86Fn 0x100811d0 /* KEY_FN */ +#define XKB_KEY_XF86Fn_Esc 0x100811d1 /* KEY_FN_ESC */ +#define XKB_KEY_XF86FnRightShift 0x100811e5 /* v5.10 KEY_FN_RIGHT_SHIFT */ +/* Use: XKB_KEY_braille_dot_1 _EVDEVK(0x1f1) v2.6.17 KEY_BRL_DOT1 */ +/* Use: XKB_KEY_braille_dot_2 _EVDEVK(0x1f2) v2.6.17 KEY_BRL_DOT2 */ +/* Use: XKB_KEY_braille_dot_3 _EVDEVK(0x1f3) v2.6.17 KEY_BRL_DOT3 */ +/* Use: XKB_KEY_braille_dot_4 _EVDEVK(0x1f4) v2.6.17 KEY_BRL_DOT4 */ +/* Use: XKB_KEY_braille_dot_5 _EVDEVK(0x1f5) v2.6.17 KEY_BRL_DOT5 */ +/* Use: XKB_KEY_braille_dot_6 _EVDEVK(0x1f6) v2.6.17 KEY_BRL_DOT6 */ +/* Use: XKB_KEY_braille_dot_7 _EVDEVK(0x1f7) v2.6.17 KEY_BRL_DOT7 */ +/* Use: XKB_KEY_braille_dot_8 _EVDEVK(0x1f8) v2.6.17 KEY_BRL_DOT8 */ +/* Use: XKB_KEY_braille_dot_9 _EVDEVK(0x1f9) v2.6.23 KEY_BRL_DOT9 */ +/* Use: XKB_KEY_braille_dot_1 _EVDEVK(0x1fa) v2.6.23 KEY_BRL_DOT10 */ +#define XKB_KEY_XF86Numeric0 0x10081200 /* v2.6.28 KEY_NUMERIC_0 */ +#define XKB_KEY_XF86Numeric1 0x10081201 /* v2.6.28 KEY_NUMERIC_1 */ +#define XKB_KEY_XF86Numeric2 0x10081202 /* v2.6.28 KEY_NUMERIC_2 */ +#define XKB_KEY_XF86Numeric3 0x10081203 /* v2.6.28 KEY_NUMERIC_3 */ +#define XKB_KEY_XF86Numeric4 0x10081204 /* v2.6.28 KEY_NUMERIC_4 */ +#define XKB_KEY_XF86Numeric5 0x10081205 /* v2.6.28 KEY_NUMERIC_5 */ +#define XKB_KEY_XF86Numeric6 0x10081206 /* v2.6.28 KEY_NUMERIC_6 */ +#define XKB_KEY_XF86Numeric7 0x10081207 /* v2.6.28 KEY_NUMERIC_7 */ +#define XKB_KEY_XF86Numeric8 0x10081208 /* v2.6.28 KEY_NUMERIC_8 */ +#define XKB_KEY_XF86Numeric9 0x10081209 /* v2.6.28 KEY_NUMERIC_9 */ +#define XKB_KEY_XF86NumericStar 0x1008120a /* v2.6.28 KEY_NUMERIC_STAR */ +#define XKB_KEY_XF86NumericPound 0x1008120b /* v2.6.28 KEY_NUMERIC_POUND */ +#define XKB_KEY_XF86NumericA 0x1008120c /* v4.1 KEY_NUMERIC_A */ +#define XKB_KEY_XF86NumericB 0x1008120d /* v4.1 KEY_NUMERIC_B */ +#define XKB_KEY_XF86NumericC 0x1008120e /* v4.1 KEY_NUMERIC_C */ +#define XKB_KEY_XF86NumericD 0x1008120f /* v4.1 KEY_NUMERIC_D */ +#define XKB_KEY_XF86CameraFocus 0x10081210 /* v2.6.33 KEY_CAMERA_FOCUS */ +#define XKB_KEY_XF86WPSButton 0x10081211 /* v2.6.34 KEY_WPS_BUTTON */ +/* Use: XKB_KEY_XF86TouchpadToggle _EVDEVK(0x212) v2.6.37 KEY_TOUCHPAD_TOGGLE */ +/* Use: XKB_KEY_XF86TouchpadOn _EVDEVK(0x213) v2.6.37 KEY_TOUCHPAD_ON */ +/* Use: XKB_KEY_XF86TouchpadOff _EVDEVK(0x214) v2.6.37 KEY_TOUCHPAD_OFF */ +#define XKB_KEY_XF86CameraZoomIn 0x10081215 /* v2.6.39 KEY_CAMERA_ZOOMIN */ +#define XKB_KEY_XF86CameraZoomOut 0x10081216 /* v2.6.39 KEY_CAMERA_ZOOMOUT */ +#define XKB_KEY_XF86CameraUp 0x10081217 /* v2.6.39 KEY_CAMERA_UP */ +#define XKB_KEY_XF86CameraDown 0x10081218 /* v2.6.39 KEY_CAMERA_DOWN */ +#define XKB_KEY_XF86CameraLeft 0x10081219 /* v2.6.39 KEY_CAMERA_LEFT */ +#define XKB_KEY_XF86CameraRight 0x1008121a /* v2.6.39 KEY_CAMERA_RIGHT */ +#define XKB_KEY_XF86AttendantOn 0x1008121b /* v3.10 KEY_ATTENDANT_ON */ +#define XKB_KEY_XF86AttendantOff 0x1008121c /* v3.10 KEY_ATTENDANT_OFF */ +#define XKB_KEY_XF86AttendantToggle 0x1008121d /* v3.10 KEY_ATTENDANT_TOGGLE */ +#define XKB_KEY_XF86LightsToggle 0x1008121e /* v3.10 KEY_LIGHTS_TOGGLE */ +#define XKB_KEY_XF86ALSToggle 0x10081230 /* v3.13 KEY_ALS_TOGGLE */ +/* Use: XKB_KEY_XF86RotationLockToggle _EVDEVK(0x231) v4.16 KEY_ROTATE_LOCK_TOGGLE */ +#define XKB_KEY_XF86RefreshRateToggle 0x10081232 /* v6.9 KEY_REFRESH_RATE_TOGGLE */ +#define XKB_KEY_XF86Buttonconfig 0x10081240 /* v3.16 KEY_BUTTONCONFIG */ +#define XKB_KEY_XF86Taskmanager 0x10081241 /* v3.16 KEY_TASKMANAGER */ +#define XKB_KEY_XF86Journal 0x10081242 /* v3.16 KEY_JOURNAL */ +#define XKB_KEY_XF86ControlPanel 0x10081243 /* v3.16 KEY_CONTROLPANEL */ +#define XKB_KEY_XF86AppSelect 0x10081244 /* v3.16 KEY_APPSELECT */ +#define XKB_KEY_XF86Screensaver 0x10081245 /* v3.16 KEY_SCREENSAVER */ +#define XKB_KEY_XF86VoiceCommand 0x10081246 /* v3.16 KEY_VOICECOMMAND */ +#define XKB_KEY_XF86Assistant 0x10081247 /* v4.13 KEY_ASSISTANT */ +/* Use: XKB_KEY_ISO_Next_Group _EVDEVK(0x248) v5.2 KEY_KBD_LAYOUT_NEXT */ +#define XKB_KEY_XF86EmojiPicker 0x10081249 /* v5.13 KEY_EMOJI_PICKER */ +#define XKB_KEY_XF86Dictate 0x1008124a /* v5.17 KEY_DICTATE */ +#define XKB_KEY_XF86CameraAccessEnable 0x1008124b /* v6.2 KEY_CAMERA_ACCESS_ENABLE */ +#define XKB_KEY_XF86CameraAccessDisable 0x1008124c /* v6.2 KEY_CAMERA_ACCESS_DISABLE */ +#define XKB_KEY_XF86CameraAccessToggle 0x1008124d /* v6.2 KEY_CAMERA_ACCESS_TOGGLE */ +#define XKB_KEY_XF86Accessibility 0x1008124e /* v6.10 KEY_ACCESSIBILITY */ +#define XKB_KEY_XF86DoNotDisturb 0x1008124f /* v6.10 KEY_DO_NOT_DISTURB */ +#define XKB_KEY_XF86BrightnessMin 0x10081250 /* v3.16 KEY_BRIGHTNESS_MIN */ +#define XKB_KEY_XF86BrightnessMax 0x10081251 /* v3.16 KEY_BRIGHTNESS_MAX */ +#define XKB_KEY_XF86KbdInputAssistPrev 0x10081260 /* v3.18 KEY_KBDINPUTASSIST_PREV */ +#define XKB_KEY_XF86KbdInputAssistNext 0x10081261 /* v3.18 KEY_KBDINPUTASSIST_NEXT */ +#define XKB_KEY_XF86KbdInputAssistPrevgroup 0x10081262 /* v3.18 KEY_KBDINPUTASSIST_PREVGROUP */ +#define XKB_KEY_XF86KbdInputAssistNextgroup 0x10081263 /* v3.18 KEY_KBDINPUTASSIST_NEXTGROUP */ +#define XKB_KEY_XF86KbdInputAssistAccept 0x10081264 /* v3.18 KEY_KBDINPUTASSIST_ACCEPT */ +#define XKB_KEY_XF86KbdInputAssistCancel 0x10081265 /* v3.18 KEY_KBDINPUTASSIST_CANCEL */ +#define XKB_KEY_XF86RightUp 0x10081266 /* v4.7 KEY_RIGHT_UP */ +#define XKB_KEY_XF86RightDown 0x10081267 /* v4.7 KEY_RIGHT_DOWN */ +#define XKB_KEY_XF86LeftUp 0x10081268 /* v4.7 KEY_LEFT_UP */ +#define XKB_KEY_XF86LeftDown 0x10081269 /* v4.7 KEY_LEFT_DOWN */ +#define XKB_KEY_XF86RootMenu 0x1008126a /* v4.7 KEY_ROOT_MENU */ +#define XKB_KEY_XF86MediaTopMenu 0x1008126b /* v4.7 KEY_MEDIA_TOP_MENU */ +#define XKB_KEY_XF86Numeric11 0x1008126c /* v4.7 KEY_NUMERIC_11 */ +#define XKB_KEY_XF86Numeric12 0x1008126d /* v4.7 KEY_NUMERIC_12 */ +#define XKB_KEY_XF86AudioDesc 0x1008126e /* v4.7 KEY_AUDIO_DESC */ +#define XKB_KEY_XF863DMode 0x1008126f /* v4.7 KEY_3D_MODE */ +#define XKB_KEY_XF86NextFavorite 0x10081270 /* v4.7 KEY_NEXT_FAVORITE */ +#define XKB_KEY_XF86StopRecord 0x10081271 /* v4.7 KEY_STOP_RECORD */ +#define XKB_KEY_XF86PauseRecord 0x10081272 /* v4.7 KEY_PAUSE_RECORD */ +#define XKB_KEY_XF86VOD 0x10081273 /* v4.7 KEY_VOD */ +#define XKB_KEY_XF86Unmute 0x10081274 /* v4.7 KEY_UNMUTE */ +#define XKB_KEY_XF86FastReverse 0x10081275 /* v4.7 KEY_FASTREVERSE */ +#define XKB_KEY_XF86SlowReverse 0x10081276 /* v4.7 KEY_SLOWREVERSE */ +#define XKB_KEY_XF86Data 0x10081277 /* v4.7 KEY_DATA */ +#define XKB_KEY_XF86OnScreenKeyboard 0x10081278 /* v4.12 KEY_ONSCREEN_KEYBOARD */ +#define XKB_KEY_XF86PrivacyScreenToggle 0x10081279 /* v5.5 KEY_PRIVACY_SCREEN_TOGGLE */ +#define XKB_KEY_XF86SelectiveScreenshot 0x1008127a /* v5.6 KEY_SELECTIVE_SCREENSHOT */ +#define XKB_KEY_XF86NextElement 0x1008127b /* v5.18 KEY_NEXT_ELEMENT */ +#define XKB_KEY_XF86PreviousElement 0x1008127c /* v5.18 KEY_PREVIOUS_ELEMENT */ +#define XKB_KEY_XF86AutopilotEngageToggle 0x1008127d /* v5.18 KEY_AUTOPILOT_ENGAGE_TOGGLE */ +#define XKB_KEY_XF86MarkWaypoint 0x1008127e /* v5.18 KEY_MARK_WAYPOINT */ +#define XKB_KEY_XF86Sos 0x1008127f /* v5.18 KEY_SOS */ +#define XKB_KEY_XF86NavChart 0x10081280 /* v5.18 KEY_NAV_CHART */ +#define XKB_KEY_XF86FishingChart 0x10081281 /* v5.18 KEY_FISHING_CHART */ +#define XKB_KEY_XF86SingleRangeRadar 0x10081282 /* v5.18 KEY_SINGLE_RANGE_RADAR */ +#define XKB_KEY_XF86DualRangeRadar 0x10081283 /* v5.18 KEY_DUAL_RANGE_RADAR */ +#define XKB_KEY_XF86RadarOverlay 0x10081284 /* v5.18 KEY_RADAR_OVERLAY */ +#define XKB_KEY_XF86TraditionalSonar 0x10081285 /* v5.18 KEY_TRADITIONAL_SONAR */ +#define XKB_KEY_XF86ClearvuSonar 0x10081286 /* v5.18 KEY_CLEARVU_SONAR */ +#define XKB_KEY_XF86SidevuSonar 0x10081287 /* v5.18 KEY_SIDEVU_SONAR */ +#define XKB_KEY_XF86NavInfo 0x10081288 /* v5.18 KEY_NAV_INFO */ +/* Use: XKB_KEY_XF86BrightnessAdjust _EVDEVK(0x289) v5.18 KEY_BRIGHTNESS_MENU */ +#define XKB_KEY_XF86Macro1 0x10081290 /* v5.5 KEY_MACRO1 */ +#define XKB_KEY_XF86Macro2 0x10081291 /* v5.5 KEY_MACRO2 */ +#define XKB_KEY_XF86Macro3 0x10081292 /* v5.5 KEY_MACRO3 */ +#define XKB_KEY_XF86Macro4 0x10081293 /* v5.5 KEY_MACRO4 */ +#define XKB_KEY_XF86Macro5 0x10081294 /* v5.5 KEY_MACRO5 */ +#define XKB_KEY_XF86Macro6 0x10081295 /* v5.5 KEY_MACRO6 */ +#define XKB_KEY_XF86Macro7 0x10081296 /* v5.5 KEY_MACRO7 */ +#define XKB_KEY_XF86Macro8 0x10081297 /* v5.5 KEY_MACRO8 */ +#define XKB_KEY_XF86Macro9 0x10081298 /* v5.5 KEY_MACRO9 */ +#define XKB_KEY_XF86Macro10 0x10081299 /* v5.5 KEY_MACRO10 */ +#define XKB_KEY_XF86Macro11 0x1008129a /* v5.5 KEY_MACRO11 */ +#define XKB_KEY_XF86Macro12 0x1008129b /* v5.5 KEY_MACRO12 */ +#define XKB_KEY_XF86Macro13 0x1008129c /* v5.5 KEY_MACRO13 */ +#define XKB_KEY_XF86Macro14 0x1008129d /* v5.5 KEY_MACRO14 */ +#define XKB_KEY_XF86Macro15 0x1008129e /* v5.5 KEY_MACRO15 */ +#define XKB_KEY_XF86Macro16 0x1008129f /* v5.5 KEY_MACRO16 */ +#define XKB_KEY_XF86Macro17 0x100812a0 /* v5.5 KEY_MACRO17 */ +#define XKB_KEY_XF86Macro18 0x100812a1 /* v5.5 KEY_MACRO18 */ +#define XKB_KEY_XF86Macro19 0x100812a2 /* v5.5 KEY_MACRO19 */ +#define XKB_KEY_XF86Macro20 0x100812a3 /* v5.5 KEY_MACRO20 */ +#define XKB_KEY_XF86Macro21 0x100812a4 /* v5.5 KEY_MACRO21 */ +#define XKB_KEY_XF86Macro22 0x100812a5 /* v5.5 KEY_MACRO22 */ +#define XKB_KEY_XF86Macro23 0x100812a6 /* v5.5 KEY_MACRO23 */ +#define XKB_KEY_XF86Macro24 0x100812a7 /* v5.5 KEY_MACRO24 */ +#define XKB_KEY_XF86Macro25 0x100812a8 /* v5.5 KEY_MACRO25 */ +#define XKB_KEY_XF86Macro26 0x100812a9 /* v5.5 KEY_MACRO26 */ +#define XKB_KEY_XF86Macro27 0x100812aa /* v5.5 KEY_MACRO27 */ +#define XKB_KEY_XF86Macro28 0x100812ab /* v5.5 KEY_MACRO28 */ +#define XKB_KEY_XF86Macro29 0x100812ac /* v5.5 KEY_MACRO29 */ +#define XKB_KEY_XF86Macro30 0x100812ad /* v5.5 KEY_MACRO30 */ +#define XKB_KEY_XF86MacroRecordStart 0x100812b0 /* v5.5 KEY_MACRO_RECORD_START */ +#define XKB_KEY_XF86MacroRecordStop 0x100812b1 /* v5.5 KEY_MACRO_RECORD_STOP */ +#define XKB_KEY_XF86MacroPresetCycle 0x100812b2 /* v5.5 KEY_MACRO_PRESET_CYCLE */ +#define XKB_KEY_XF86MacroPreset1 0x100812b3 /* v5.5 KEY_MACRO_PRESET1 */ +#define XKB_KEY_XF86MacroPreset2 0x100812b4 /* v5.5 KEY_MACRO_PRESET2 */ +#define XKB_KEY_XF86MacroPreset3 0x100812b5 /* v5.5 KEY_MACRO_PRESET3 */ +#define XKB_KEY_XF86KbdLcdMenu1 0x100812b8 /* v5.5 KEY_KBD_LCD_MENU1 */ +#define XKB_KEY_XF86KbdLcdMenu2 0x100812b9 /* v5.5 KEY_KBD_LCD_MENU2 */ +#define XKB_KEY_XF86KbdLcdMenu3 0x100812ba /* v5.5 KEY_KBD_LCD_MENU3 */ +#define XKB_KEY_XF86KbdLcdMenu4 0x100812bb /* v5.5 KEY_KBD_LCD_MENU4 */ +#define XKB_KEY_XF86KbdLcdMenu5 0x100812bc /* v5.5 KEY_KBD_LCD_MENU5 */ +#undef _EVDEVK +/* + * Copyright (c) 1991, Oracle and/or its affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +/************************************************************ + +Copyright 1991, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +***********************************************************/ + +/* + * Floating Accent + */ + +#define XKB_KEY_SunFA_Grave 0x1005ff00 +#define XKB_KEY_SunFA_Circum 0x1005ff01 +#define XKB_KEY_SunFA_Tilde 0x1005ff02 +#define XKB_KEY_SunFA_Acute 0x1005ff03 +#define XKB_KEY_SunFA_Diaeresis 0x1005ff04 +#define XKB_KEY_SunFA_Cedilla 0x1005ff05 + +/* + * Miscellaneous Functions + */ + +#define XKB_KEY_SunF36 0x1005ff10 /* Labeled F11 */ +#define XKB_KEY_SunF37 0x1005ff11 /* Labeled F12 */ + +#define XKB_KEY_SunSys_Req 0x1005ff60 +#define XKB_KEY_SunPrint_Screen 0x0000ff61 /* Same as XKB_KEY_Print */ + +/* + * International & Multi-Key Character Composition + */ + +#define XKB_KEY_SunCompose 0x0000ff20 /* Same as XKB_KEY_Multi_key */ +#define XKB_KEY_SunAltGraph 0x0000ff7e /* Same as XKB_KEY_Mode_switch */ + +/* + * Cursor Control + */ + +#define XKB_KEY_SunPageUp 0x0000ff55 /* Same as XKB_KEY_Prior */ +#define XKB_KEY_SunPageDown 0x0000ff56 /* Same as XKB_KEY_Next */ + +/* + * Open Look Functions + */ + +#define XKB_KEY_SunUndo 0x0000ff65 /* Same as XKB_KEY_Undo */ +#define XKB_KEY_SunAgain 0x0000ff66 /* Same as XKB_KEY_Redo */ +#define XKB_KEY_SunFind 0x0000ff68 /* Same as XKB_KEY_Find */ +#define XKB_KEY_SunStop 0x0000ff69 /* Same as XKB_KEY_Cancel */ +#define XKB_KEY_SunProps 0x1005ff70 +#define XKB_KEY_SunFront 0x1005ff71 +#define XKB_KEY_SunCopy 0x1005ff72 +#define XKB_KEY_SunOpen 0x1005ff73 +#define XKB_KEY_SunPaste 0x1005ff74 +#define XKB_KEY_SunCut 0x1005ff75 + +#define XKB_KEY_SunPowerSwitch 0x1005ff76 +#define XKB_KEY_SunAudioLowerVolume 0x1005ff77 +#define XKB_KEY_SunAudioMute 0x1005ff78 +#define XKB_KEY_SunAudioRaiseVolume 0x1005ff79 +#define XKB_KEY_SunVideoDegauss 0x1005ff7a +#define XKB_KEY_SunVideoLowerBrightness 0x1005ff7b +#define XKB_KEY_SunVideoRaiseBrightness 0x1005ff7c +#define XKB_KEY_SunPowerSwitchShift 0x1005ff7d +/*********************************************************** + +Copyright 1988, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +/* + * DEC private keysyms + * (29th bit set) + */ + +/* two-key compose sequence initiators, chosen to map to Latin1 characters */ + +#define XKB_KEY_Dring_accent 0x1000feb0 +#define XKB_KEY_Dcircumflex_accent 0x1000fe5e +#define XKB_KEY_Dcedilla_accent 0x1000fe2c +#define XKB_KEY_Dacute_accent 0x1000fe27 +#define XKB_KEY_Dgrave_accent 0x1000fe60 +#define XKB_KEY_Dtilde 0x1000fe7e +#define XKB_KEY_Ddiaeresis 0x1000fe22 + +/* special keysym for LK2** "Remove" key on editing keypad */ + +#define XKB_KEY_DRemove 0x1000ff00 /* Remove */ +/* + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the names of Hewlett Packard +or Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD +TO THIS SOFTWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. Hewlett-Packard shall not be liable for errors +contained herein or direct, indirect, special, incidental or +consequential damages in connection with the furnishing, +performance, or use of this material. + +*/ + + + +#define XKB_KEY_hpClearLine 0x1000ff6f +#define XKB_KEY_hpInsertLine 0x1000ff70 +#define XKB_KEY_hpDeleteLine 0x1000ff71 +#define XKB_KEY_hpInsertChar 0x1000ff72 +#define XKB_KEY_hpDeleteChar 0x1000ff73 +#define XKB_KEY_hpBackTab 0x1000ff74 +#define XKB_KEY_hpKP_BackTab 0x1000ff75 +#define XKB_KEY_hpModelock1 0x1000ff48 +#define XKB_KEY_hpModelock2 0x1000ff49 +#define XKB_KEY_hpReset 0x1000ff6c +#define XKB_KEY_hpSystem 0x1000ff6d +#define XKB_KEY_hpUser 0x1000ff6e +#define XKB_KEY_hpmute_acute 0x100000a8 +#define XKB_KEY_hpmute_grave 0x100000a9 +#define XKB_KEY_hpmute_asciicircum 0x100000aa +#define XKB_KEY_hpmute_diaeresis 0x100000ab +#define XKB_KEY_hpmute_asciitilde 0x100000ac +#define XKB_KEY_hplira 0x100000af +#define XKB_KEY_hpguilder 0x100000be +#define XKB_KEY_hpYdiaeresis 0x100000ee +#define XKB_KEY_hpIO 0x100000ee /* deprecated alias for hpYdiaeresis */ +#define XKB_KEY_hplongminus 0x100000f6 +#define XKB_KEY_hpblock 0x100000fc + + + +#define XKB_KEY_osfCopy 0x1004ff02 +#define XKB_KEY_osfCut 0x1004ff03 +#define XKB_KEY_osfPaste 0x1004ff04 +#define XKB_KEY_osfBackTab 0x1004ff07 +#define XKB_KEY_osfBackSpace 0x1004ff08 +#define XKB_KEY_osfClear 0x1004ff0b +#define XKB_KEY_osfEscape 0x1004ff1b +#define XKB_KEY_osfAddMode 0x1004ff31 +#define XKB_KEY_osfPrimaryPaste 0x1004ff32 +#define XKB_KEY_osfQuickPaste 0x1004ff33 +#define XKB_KEY_osfPageLeft 0x1004ff40 +#define XKB_KEY_osfPageUp 0x1004ff41 +#define XKB_KEY_osfPageDown 0x1004ff42 +#define XKB_KEY_osfPageRight 0x1004ff43 +#define XKB_KEY_osfActivate 0x1004ff44 +#define XKB_KEY_osfMenuBar 0x1004ff45 +#define XKB_KEY_osfLeft 0x1004ff51 +#define XKB_KEY_osfUp 0x1004ff52 +#define XKB_KEY_osfRight 0x1004ff53 +#define XKB_KEY_osfDown 0x1004ff54 +#define XKB_KEY_osfEndLine 0x1004ff57 +#define XKB_KEY_osfBeginLine 0x1004ff58 +#define XKB_KEY_osfEndData 0x1004ff59 +#define XKB_KEY_osfBeginData 0x1004ff5a +#define XKB_KEY_osfPrevMenu 0x1004ff5b +#define XKB_KEY_osfNextMenu 0x1004ff5c +#define XKB_KEY_osfPrevField 0x1004ff5d +#define XKB_KEY_osfNextField 0x1004ff5e +#define XKB_KEY_osfSelect 0x1004ff60 +#define XKB_KEY_osfInsert 0x1004ff63 +#define XKB_KEY_osfUndo 0x1004ff65 +#define XKB_KEY_osfMenu 0x1004ff67 +#define XKB_KEY_osfCancel 0x1004ff69 +#define XKB_KEY_osfHelp 0x1004ff6a +#define XKB_KEY_osfSelectAll 0x1004ff71 +#define XKB_KEY_osfDeselectAll 0x1004ff72 +#define XKB_KEY_osfReselect 0x1004ff73 +#define XKB_KEY_osfExtend 0x1004ff74 +#define XKB_KEY_osfRestore 0x1004ff78 +#define XKB_KEY_osfDelete 0x1004ffff + + + +/************************************************************** + * The use of the following macros is deprecated. + * They are listed below only for backwards compatibility. + */ +#define XKB_KEY_Reset 0x1000ff6c /* deprecated alias for hpReset */ +#define XKB_KEY_System 0x1000ff6d /* deprecated alias for hpSystem */ +#define XKB_KEY_User 0x1000ff6e /* deprecated alias for hpUser */ +#define XKB_KEY_ClearLine 0x1000ff6f /* deprecated alias for hpClearLine */ +#define XKB_KEY_InsertLine 0x1000ff70 /* deprecated alias for hpInsertLine */ +#define XKB_KEY_DeleteLine 0x1000ff71 /* deprecated alias for hpDeleteLine */ +#define XKB_KEY_InsertChar 0x1000ff72 /* deprecated alias for hpInsertChar */ +#define XKB_KEY_DeleteChar 0x1000ff73 /* deprecated alias for hpDeleteChar */ +#define XKB_KEY_BackTab 0x1000ff74 /* deprecated alias for hpBackTab */ +#define XKB_KEY_KP_BackTab 0x1000ff75 /* deprecated alias for hpKP_BackTab */ +#define XKB_KEY_Ext16bit_L 0x1000ff76 /* deprecated */ +#define XKB_KEY_Ext16bit_R 0x1000ff77 /* deprecated */ +#define XKB_KEY_mute_acute 0x100000a8 /* deprecated alias for hpmute_acute */ +#define XKB_KEY_mute_grave 0x100000a9 /* deprecated alias for hpmute_grave */ +#define XKB_KEY_mute_asciicircum 0x100000aa /* deprecated alias for hpmute_asciicircum */ +#define XKB_KEY_mute_diaeresis 0x100000ab /* deprecated alias for hpmute_diaeresis */ +#define XKB_KEY_mute_asciitilde 0x100000ac /* deprecated alias for hpmute_asciitilde */ +#define XKB_KEY_lira 0x100000af /* deprecated alias for hplira */ +#define XKB_KEY_guilder 0x100000be /* deprecated alias for hpguilder */ +#define XKB_KEY_IO 0x100000ee /* deprecated alias for hpYdiaeresis */ +#define XKB_KEY_longminus 0x100000f6 /* deprecated alias for hplongminus */ +#define XKB_KEY_block 0x100000fc /* deprecated alias for hpblock */ + + + +#endif diff --git a/data/miniconda3/include/xkbcommon/xkbcommon-names.h b/data/miniconda3/include/xkbcommon/xkbcommon-names.h new file mode 100644 index 0000000000000000000000000000000000000000..791e5490f51738ac27ca6b0d18e5944e3a631b3e --- /dev/null +++ b/data/miniconda3/include/xkbcommon/xkbcommon-names.h @@ -0,0 +1,144 @@ +/* + * Copyright © 2012 Intel Corporation + * SPDX-License-Identifier: MIT + * + * Author: Daniel Stone + */ + +#ifndef _XKBCOMMON_NAMES_H +#define _XKBCOMMON_NAMES_H + +/** + * @file + * @brief Predefined names for common modifiers and LEDs. + */ + +/** + * @defgroup modifier-names Predefined names for common modifiers and LEDs + * + * @{ + */ + +/** + * @defgroup real-modifier-names Real modifiers names + * + * [*Real* modifiers][real modifier] names are hardcoded in libxkbcommon. + * + * [real modifier]: @ref real-modifier-def + * + * @{ + */ +#define XKB_MOD_NAME_SHIFT "Shift" +#define XKB_MOD_NAME_CAPS "Lock" +#define XKB_MOD_NAME_CTRL "Control" +#define XKB_MOD_NAME_MOD1 "Mod1" +#define XKB_MOD_NAME_MOD2 "Mod2" +#define XKB_MOD_NAME_MOD3 "Mod3" +#define XKB_MOD_NAME_MOD4 "Mod4" +#define XKB_MOD_NAME_MOD5 "Mod5" +/** @} */ + +/** + * @defgroup virtual-modifier-names Virtual modifiers names + * + * Common [*virtual* modifiers][virtual modifiers], encoded in [xkeyboard-config] + * in the [compat] and [symbols] files. They have been stable since the beginning + * of the project and are unlikely to ever change. + * + * [virtual modifiers]: @ref virtual-modifier-def + * [xkeyboard-config]: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config + * [compat]: @ref the-xkb_compat-section + * [symbols]: @ref the-xkb_symbols-section + * + * @{ + */ +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_ALT "Alt" +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_HYPER "Hyper" +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_LEVEL3 "LevelThree" +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_LEVEL5 "LevelFive" +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_META "Meta" +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_NUM "NumLock" +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_SCROLL "ScrollLock" +/** @since 1.8.0 */ +#define XKB_VMOD_NAME_SUPER "Super" +/** @} */ + +/** + * @defgroup legacy-virtual-modifier-names Legacy virtual modifier names + * + * Usual [*virtual* modifiers][virtual modifiers] mappings to + * [*real* modifiers][real modifiers]. + * + * @deprecated Use @ref virtual-modifier-names instead + * + * [virtual modifiers]: @ref virtual-modifier-def + * [real modifiers]: @ref real-modifier-def + * + * @{ + */ +/** + * Usual [*real* modifier][real modifier] for the + * [*virtual* modifier][virtual modifier] `Alt`. + * + * @deprecated Use `::XKB_VMOD_NAME_ALT` instead. + * @since 1.10: deprecated + * + * [virtual modifier]: @ref virtual-modifier-def + * [real modifier]: @ref real-modifier-def + */ +#define XKB_MOD_NAME_ALT "Mod1" +/** + * Usual [*real* modifier][real modifier] for the + * [*virtual* modifier][virtual modifier] `Super`. + * + * @deprecated Use `::XKB_VMOD_NAME_SUPER` instead. + * @since 1.10: deprecated + * + * [virtual modifier]: @ref virtual-modifier-def + * [real modifier]: @ref real-modifier-def + */ +#define XKB_MOD_NAME_LOGO "Mod4" +/** + * Usual [*real* modifier][real modifier] for the + * [*virtual* modifier][virtual modifier] `NumLock`. + * + * @deprecated Use `::XKB_VMOD_NAME_NUM` instead. + * @since 1.10: deprecated + * + * [virtual modifier]: @ref virtual-modifier-def + * [real modifier]: @ref real-modifier-def + */ +#define XKB_MOD_NAME_NUM "Mod2" +/** @} */ + +/** + * @defgroup led-names LEDs names + * + * LEDs names are encoded in [xkeyboard-config], in the [keycodes] and [compat] + * files. They have been stable since the beginning of the project and are + * unlikely to ever change. + * + * [xkeyboard-config]: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config + * [keycodes]: @ref the-xkb_keycodes-section + * [compat]: @ref the-xkb_compat-section + * + * @{ + */ +#define XKB_LED_NAME_NUM "Num Lock" +#define XKB_LED_NAME_CAPS "Caps Lock" +#define XKB_LED_NAME_SCROLL "Scroll Lock" +/** @since 1.8.0 */ +#define XKB_LED_NAME_COMPOSE "Compose" +#define XKB_LED_NAME_KANA "Kana" +/** @} */ + +/** @} */ + +#endif diff --git a/data/miniconda3/include/xkbcommon/xkbcommon-x11.h b/data/miniconda3/include/xkbcommon/xkbcommon-x11.h new file mode 100644 index 0000000000000000000000000000000000000000..76e510317fcbfc6b63c75e7c3ea6335864919e6f --- /dev/null +++ b/data/miniconda3/include/xkbcommon/xkbcommon-x11.h @@ -0,0 +1,226 @@ +/* + * Copyright © 2013 Ran Benita + * SPDX-License-Identifier: MIT + */ + +#ifndef _XKBCOMMON_X11_H +#define _XKBCOMMON_X11_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file + * libxkbcommon-x11 API - Additional X11 support for xkbcommon. + */ + +/** + * @defgroup x11 X11 support + * Additional X11 support for xkbcommon. + * @since 0.4.0 + * + * @{ + */ + +/** + * @page x11-overview Overview + * @parblock + * + * The xkbcommon-x11 module provides a means for creating an xkb_keymap + * corresponding to the currently active keymap on the X server. To do + * so, it queries the XKB X11 extension using the xcb-xkb library. It + * can be used as a replacement for Xlib’s keyboard handling. + * + * Following is an example workflow using xkbcommon-x11. A complete + * example may be found in the `tools/interactive-x11.c` file in the + * xkbcommon source repository. On startup: + * + * 1. Connect to the X server using `xcb_connect()`. + * 2. Setup the XKB X11 extension. You can do this either by using the + * `xcb_xkb_use_extension()` request directly, or by using the + * `xkb_x11_setup_xkb_extension()` helper function. + * + * The XKB extension supports using separate keymaps and states for + * different keyboard devices. The devices are identified by an integer + * device ID and are managed by another X11 extension, XInput. The + * original X11 protocol only had one keyboard device, called the *core + * keyboard*, which is still supported as a *virtual device*. + * + * 3. We will use the core keyboard as an example. To get its device ID, + * use either the `xcb_xkb_get_device_info()` request directly, or the + * `xkb_x11_get_core_keyboard_device_id()` helper function. + * 4. Create an initial xkb_keymap for this device, using the + * `xkb_x11_keymap_new_from_device()` function. + * 5. Create an initial xkb_state for this device, using the + * `xkb_x11_state_new_from_device()` function. + * + * @note At this point, you may consider setting various XKB controls and + * XKB per-client flags. For example, enabling detectable autorepeat: \n + * https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Detectable_Autorepeat + * + * Next, you need to react to state changes (e.g. a modifier was pressed, + * the layout was changed) and to keymap changes (e.g. a tool like xkbcomp, + * setxkbmap or xmodmap was used): + * + * 6. Select to listen to at least the following XKB events: + * `NewKeyboardNotify`, `MapNotify`, `StateNotify`; using the + * `xcb_xkb_select_events_aux()` request. + * 7. When `NewKeyboardNotify` or `MapNotify` are received, recreate the + * `xkb_keymap` and `xkb_state` as described above. + * 8. When `StateNotify` is received, update the `xkb_state` accordingly + * using the `xkb_state::xkb_state_update_mask()` function. + * + * @note It is also possible to use the `KeyPress`/`KeyRelease` @p state + * field to find the effective modifier and layout state, instead of + * using `XkbStateNotify`: \n + * https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Computing_A_State_Field_from_an_XKB_State + * \n However, `XkbStateNotify` is more accurate. + * + * @note There is no need to call `xkb_state_update_key()`; the state is + * already synchronized. + * + * Finally, when a key event is received, you can use ordinary xkbcommon + * functions, like `xkb_state::xkb_state_key_get_one_sym()` and + * `xkb_state::xkb_state_key_get_utf8()`, as you normally would. + * + * @endparblock + */ + +/** + * The minimal compatible major version of the XKB X11 extension which + * this library can use. + */ +#define XKB_X11_MIN_MAJOR_XKB_VERSION 1 +/** + * The minimal compatible minor version of the XKB X11 extension which + * this library can use (for the minimal major version). + */ +#define XKB_X11_MIN_MINOR_XKB_VERSION 0 + +/** Flags for the `xkb_x11_setup_xkb_extension()` function. */ +enum xkb_x11_setup_xkb_extension_flags { + /** Do not apply any flags. */ + XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS = 0 +}; + +/** + * Setup the XKB X11 extension for this X client. + * + * The xkbcommon-x11 library uses various XKB requests. Before doing so, + * an X client must notify the server that it will be using the extension. + * This function (or an XCB equivalent) must be called before any other + * function in this library is used. + * + * Some X servers may not support or disable the XKB extension. If you + * want to support such servers, you need to use a different fallback. + * + * You may call this function several times; it is idempotent. + * + * @param connection + * An XCB connection to the X server. + * @param major_xkb_version + * See @p minor_xkb_version. + * @param minor_xkb_version + * The XKB extension version to request. To operate correctly, you + * must have (@p major_xkb_version, @p minor_xkb_version) >= + * (`XKB_X11_MIN_MAJOR_XKB_VERSION`, `XKB_X11_MIN_MINOR_XKB_VERSION`), + * though this is not enforced. + * @param flags + * Optional flags, or 0. + * @param[out] major_xkb_version_out + * See @p minor_xkb_version_out. + * @param[out] minor_xkb_version_out + * Backfilled with the compatible XKB extension version numbers picked + * by the server. Can be `NULL`. + * @param[out] base_event_out + * Backfilled with the XKB base (also known as first) event code, needed + * to distinguish XKB events. Can be `NULL`. + * @param[out] base_error_out + * Backfilled with the XKB base (also known as first) error code, needed + * to distinguish XKB errors. Can be `NULL`. + * + * @returns 1 on success, or 0 on failure. + */ +XKB_EXPORT int +xkb_x11_setup_xkb_extension(xcb_connection_t *connection, + uint16_t major_xkb_version, + uint16_t minor_xkb_version, + enum xkb_x11_setup_xkb_extension_flags flags, + uint16_t *major_xkb_version_out, + uint16_t *minor_xkb_version_out, + uint8_t *base_event_out, + uint8_t *base_error_out); + +/** + * Get the keyboard device ID of the core X11 keyboard. + * + * @param connection An XCB connection to the X server. + * + * @returns A device ID which may be used with other `xkb_x11_*` functions, + * or -1 on failure. + */ +XKB_EXPORT int32_t +xkb_x11_get_core_keyboard_device_id(xcb_connection_t *connection); + +/** + * Create a keymap from an X11 keyboard device. + * + * This function queries the X server with various requests, fetches the + * details of the active keymap on a keyboard device, and creates an + * xkb_keymap from these details. + * + * @param context + * The context in which to create the keymap. + * @param connection + * An XCB connection to the X server. + * @param device_id + * An XInput device ID (in the range 0-127) with input class KEY. + * Passing values outside of this range is an error (the XKB protocol + * predates the XInput2 protocol, which first allowed IDs > 127). + * @param flags + * Optional flags for the keymap, or 0. + * + * @returns A keymap retrieved from the X server, or `NULL` on failure. + * + * @memberof xkb_keymap + */ +XKB_EXPORT struct xkb_keymap * +xkb_x11_keymap_new_from_device(struct xkb_context *context, + xcb_connection_t *connection, + int32_t device_id, + enum xkb_keymap_compile_flags flags); + +/** + * Create a new keyboard state object from an X11 keyboard device. + * + * This function is the same as `xkb_state_new()`, only pre-initialized + * with the state of the device at the time this function is called. + * + * @param keymap + * The keymap for which to create the state. + * @param connection + * An XCB connection to the X server. + * @param device_id + * An XInput 1 device ID (in the range 0-255) with input class KEY. + * Passing values outside of this range is an error. + * + * @returns A new keyboard state object, or `NULL` on failure. + * + * @memberof xkb_state + */ +XKB_EXPORT struct xkb_state * +xkb_x11_state_new_from_device(struct xkb_keymap *keymap, + xcb_connection_t *connection, + int32_t device_id); + +/** @} */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _XKBCOMMON_X11_H */ diff --git a/data/miniconda3/include/xkbcommon/xkbcommon.h b/data/miniconda3/include/xkbcommon/xkbcommon.h new file mode 100644 index 0000000000000000000000000000000000000000..fbd6f211690bd5c06e63c2ccaa87b31df5965c8b --- /dev/null +++ b/data/miniconda3/include/xkbcommon/xkbcommon.h @@ -0,0 +1,2514 @@ +/* + * For MIT-open-group: + * Copyright 1985, 1987, 1990, 1998 The Open Group + * Copyright 2008 Dan Nicholson + * + * For HPND: + * Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + * SPDX-License-Identifier: HPND + * + * For MIT: + * Copyright © 2009-2012 Daniel Stone + * Copyright © 2012 Intel Corporation + * Copyright © 2012 Ran Benita + * + * SPDX-License-Identifier: MIT-open-group AND HPND AND MIT + * + * Author: Daniel Stone + */ + +#ifndef _XKBCOMMON_H_ +#define _XKBCOMMON_H_ + +#include +#include +#include +#include + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__GNUC__) && !defined(__CYGWIN__) +# define XKB_EXPORT __attribute__((visibility("default"))) +#elif defined(_WIN32) +# define XKB_EXPORT __declspec(dllexport) +#else +# define XKB_EXPORT +#endif + +/** + * @file + * Main libxkbcommon API. + */ + +/** + * @struct xkb_context + * Opaque top level library context object. + * + * The context contains various general library data and state, like + * logging level and include paths. + * + * Objects are created in a specific context, and multiple contexts may + * coexist simultaneously. Objects from different contexts are completely + * separated and do not share any memory or state. + */ +struct xkb_context; + +/** + * @struct xkb_keymap + * Opaque compiled keymap object. + * + * The keymap object holds all of the static keyboard information obtained + * from compiling XKB files. + * + * A keymap is immutable after it is created (besides reference counts, etc.); + * if you need to change it, you must create a new one. + */ +struct xkb_keymap; + +/** + * @struct xkb_state + * Opaque keyboard state object. + * + * State objects contain the active state of a keyboard (or keyboards), such + * as the currently effective layout and the active modifiers. It acts as a + * simple state machine, wherein key presses and releases are the input, and + * key symbols (keysyms) are the output. + */ +struct xkb_state; + +/** + * A number used to represent a physical key on a keyboard. + * + * A standard PC-compatible keyboard might have 102 keys. An appropriate + * keymap would assign each of them a keycode, by which the user should + * refer to the key throughout the library. + * + * Historically, the X11 protocol, and consequentially the XKB protocol, + * assign only 8 bits for keycodes. This limits the number of different + * keys that can be used simultaneously in a single keymap to 256 + * (disregarding other limitations). This library does not share this limit; + * keycodes beyond 255 (*extended* keycodes) are not treated specially. + * Keymaps and applications which are compatible with X11 should not use + * these keycodes. + * + * The values of specific keycodes are determined by the keymap and the + * underlying input system. For example, with an X11-compatible keymap + * and Linux evdev scan codes (see `linux/input.h`), a fixed offset is used: + * + * The keymap defines a canonical name for each key, plus possible aliases. + * Historically, the XKB protocol restricts these names to at most 4 (ASCII) + * characters, but this library does not share this limit. + * + * @code + * xkb_keycode_t keycode_A = KEY_A + 8; + * @endcode + * + * @sa xkb_keycode_is_legal_ext() xkb_keycode_is_legal_x11() + */ +typedef uint32_t xkb_keycode_t; + +/** + * A number used to represent the symbols generated from a key on a keyboard. + * + * A key, represented by a keycode, may generate different symbols according + * to keyboard state. For example, on a QWERTY keyboard, pressing the key + * labled \ generates the symbol ‘a’. If the Shift key is held, it + * generates the symbol ‘A’. If a different layout is used, say Greek, + * it generates the symbol ‘α’. And so on. + * + * Each such symbol is represented by a *keysym* (short for “key symbol”). + * Note that keysyms are somewhat more general, in that they can also represent + * some “function”, such as “Left” or “Right” for the arrow keys. For more + * information, see: Appendix A [“KEYSYM Encoding”][encoding] of the X Window + * System Protocol. + * + * Specifically named keysyms can be found in the + * xkbcommon/xkbcommon-keysyms.h header file. Their name does not include + * the `XKB_KEY_` prefix. + * + * Besides those, any Unicode/ISO 10646 character in the range U+0100 to + * U+10FFFF can be represented by a keysym value in the range 0x01000100 to + * 0x0110FFFF. The name of Unicode keysyms is `U`, e.g. `UA1B2`. + * + * The name of other unnamed keysyms is the hexadecimal representation of + * their value, e.g. `0xabcd1234`. + * + * Keysym names are case-sensitive. + * + * @note **Encoding:** Keysyms are 32-bit integers with the 3 most significant + * bits always set to zero. Thus valid keysyms are in the range + * `0 .. 0x1fffffff` = @ref XKB_KEYSYM_MAX. + * See: Appendix A [“KEYSYM Encoding”][encoding] of the X Window System Protocol. + * + * [encoding]: https://www.x.org/releases/current/doc/xproto/x11protocol.html#keysym_encoding + * + * @ingroup keysyms + * @sa `::XKB_KEYSYM_MAX` + */ +typedef uint32_t xkb_keysym_t; + +/** + * Index of a keyboard layout. + * + * The layout index is a state component which determines which keyboard + * layout is active. These may be different alphabets, different key + * arrangements, etc. + * + * Layout indices are consecutive. The first layout has index 0. + * + * Each layout is not required to have a name, and the names are not + * guaranteed to be unique (though they are usually provided and unique). + * Therefore, it is not safe to use the name as a unique identifier for a + * layout. Layout names are case-sensitive. + * + * Layout names are specified in the layout’s definition, for example + * “English (US)”. These are different from the (conventionally) short names + * which are used to locate the layout, for example `us` or `us(intl)`. These + * names are not present in a compiled keymap. + * + * If the user selects layouts from a list generated from the XKB registry + * (using libxkbregistry or directly), and this metadata is needed later on, it + * is recommended to store it along with the keymap. + * + * Layouts are also called *groups* by XKB. + * + * @sa xkb_keymap::xkb_keymap_num_layouts() + * @sa xkb_keymap::xkb_keymap_num_layouts_for_key() + */ +typedef uint32_t xkb_layout_index_t; +/** A mask of layout indices. */ +typedef uint32_t xkb_layout_mask_t; + +/** + * Index of a shift level. + * + * Any key, in any layout, can have several shift levels. Each + * shift level can assign different keysyms to the key. The shift level + * to use is chosen according to the current keyboard state; for example, + * if no keys are pressed, the first level may be used; if the Left Shift + * key is pressed, the second; if Num Lock is pressed, the third; and + * many such combinations are possible (see `xkb_mod_index_t`). + * + * Level indices are consecutive. The first level has index 0. + */ +typedef uint32_t xkb_level_index_t; + +/** + * Index of a modifier. + * + * A @e modifier is a state component which changes the way keys are + * interpreted. A keymap defines a set of modifiers, such as Alt, Shift, + * Num Lock or Meta, and specifies which keys may @e activate which + * modifiers (in a many-to-many relationship, i.e. a key can activate + * several modifiers, and a modifier may be activated by several keys. + * Different keymaps do this differently). + * + * When retrieving the keysyms for a key, the active modifier set is + * consulted; this determines the correct shift level to use within the + * currently active layout (see `xkb_level_index_t`). + * + * Modifier indices are consecutive. The first modifier has index 0. + * + * Each modifier must have a name, and the names are unique. Therefore, it + * is safe to use the name as a unique identifier for a modifier. The names + * of some common modifiers are provided in the `xkbcommon/xkbcommon-names.h` + * header file. Modifier names are case-sensitive. + * + * @sa xkb_keymap_num_mods() + */ +typedef uint32_t xkb_mod_index_t; +/** A mask of modifier indices. */ +typedef uint32_t xkb_mod_mask_t; + +/** + * Index of a keyboard LED. + * + * LEDs are logical objects which may be @e active or @e inactive. They + * typically correspond to the lights on the keyboard. Their state is + * determined by the current keyboard state. + * + * LED indices are non-consecutive. The first LED has index 0. + * + * Each LED must have a name, and the names are unique. Therefore, + * it is safe to use the name as a unique identifier for a LED. The names + * of some common LEDs are provided in the `xkbcommon/xkbcommon-names.h` + * header file. LED names are case-sensitive. + * + * @warning A given keymap may specify an exact index for a given LED. + * Therefore, LED indexing is not necessarily sequential, as opposed to + * modifiers and layouts. This means that when iterating over the LEDs + * in a keymap using e.g. xkb_keymap::xkb_keymap_num_leds(), some indices might + * be invalid. + * Given such an index, functions like xkb_keymap::xkb_keymap_led_get_name() + * will return `NULL`, and `xkb_state::xkb_state_led_index_is_active()` will + * return -1. + * + * LEDs are also called *indicators* by XKB. + * + * @sa `xkb_keymap::xkb_keymap_num_leds()` + */ +typedef uint32_t xkb_led_index_t; +/** A mask of LED indices. */ +typedef uint32_t xkb_led_mask_t; + +/** Invalid keycode */ +#define XKB_KEYCODE_INVALID (0xffffffff) +/** Invalid layout index */ +#define XKB_LAYOUT_INVALID (0xffffffff) +/** Invalid level index */ +#define XKB_LEVEL_INVALID (0xffffffff) +/** Invalid modifier index */ +#define XKB_MOD_INVALID (0xffffffff) +/** Invalid LED index */ +#define XKB_LED_INVALID (0xffffffff) + +/** Maximum legal keycode */ +#define XKB_KEYCODE_MAX (0xffffffff - 1) + +/** + * Maximum keysym value + * + * @since 1.6.0 + * @sa xkb_keysym_t + * @ingroup keysyms + */ +#define XKB_KEYSYM_MAX 0x1fffffff + +/** + * Test whether a value is a valid extended keycode. + * @sa xkb_keycode_t + **/ +#define xkb_keycode_is_legal_ext(key) ((key) <= XKB_KEYCODE_MAX) + +/** + * Test whether a value is a valid X11 keycode. + * @sa xkb_keycode_t + */ +#define xkb_keycode_is_legal_x11(key) ((key) >= 8 && (key) <= 255) + +/** + * @defgroup rules-api Rules + * Utility functions related to *rules*, whose purpose is introduced in: + * @ref xkb-the-config "". + * + * @{ + */ + +/** + * @struct xkb_rmlvo_builder + * Opaque [RMLVO] configuration object. + * + * It denotes the configuration values by which a user picks a keymap. + * + * @see [Introduction to RMLVO][RMLVO] + * @see @ref rules-api "" + * @since 1.11.0 + * + * [RMLVO]: @ref RMLVO-intro + */ +struct xkb_rmlvo_builder; + +enum xkb_rmlvo_builder_flags { + XKB_RMLVO_BUILDER_NO_FLAGS = 0 +}; + +/** + * Create a new [RMLVO] builder. + * + * @param context The context in which to create the builder. + * @param rules The ruleset. + * If `NULL` or the empty string `""`, a default value is used. + * If the `XKB_DEFAULT_RULES` environment variable is set, it is used + * as the default. Otherwise the system default is used. + * @param model The keyboard model. + * If `NULL` or the empty string `""`, a default value is used. + * If the `XKB_DEFAULT_MODEL` environment variable is set, it is used + * as the default. Otherwise the system default is used. + * @param flags Optional flags for the builder, or 0. + * + * @returns A `xkb_rmlvo_builder`, or `NULL` if the compilation failed. + * + * @see `xkb_rule_names` for a detailed description of `rules` and `model`. + * @since 1.11.0 + * @memberof xkb_rmlvo_builder + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT struct xkb_rmlvo_builder* +xkb_rmlvo_builder_new(struct xkb_context *context, + const char *rules, const char *model, + enum xkb_rmlvo_builder_flags flags); + +/** + * Append a layout to the given [RMLVO] builder. + * + * @param rmlvo The builder to modify. + * @param layout The name of the layout. + * @param variant The name of the layout variant, or `NULL` to + * select the default variant. + * @param options An array of options to apply only to this layout, or + * `NULL` if there is no such options. + * @param options_len The length of @p options. + * + * @note The options are only effectual if the corresponding ruleset has the + * proper rules to handle them as *layout-specific* options. + * @note See `rxkb_option_is_layout_specific()` to query whether an option + * supports the layout-specific feature. + * + * @returns `true` if the call succeeded, otherwise `false`. + * + * @since 1.11.0 + * @memberof xkb_rmlvo_builder + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT bool +xkb_rmlvo_builder_append_layout(struct xkb_rmlvo_builder *rmlvo, + const char *layout, const char *variant, + const char* const* options, size_t options_len); + +/** + * Append an option to the given [RMLVO] builder. + * + * @param rmlvo The builder to modify. + * @param option The name of the option. + * + * @returns `true` if the call succeeded, otherwise `false`. + * + * @since 1.11.0 + * @memberof xkb_rmlvo_builder + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT bool +xkb_rmlvo_builder_append_option(struct xkb_rmlvo_builder *rmlvo, + const char *option); + +/** + * Take a new reference on a [RMLVO] builder. + * + * @param rmlvo The builder to reference. + * + * @returns The passed in builder. + * + * @since 1.11.0 + * @memberof xkb_rmlvo_builder + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT struct xkb_rmlvo_builder * +xkb_rmlvo_builder_ref(struct xkb_rmlvo_builder *rmlvo); + +/** + * Release a reference on a [RMLVO] builder, and possibly free it. + * + * @param rmlvo The builder. If it is `NULL`, this function does nothing. + * + * @since 1.11.0 + * @memberof xkb_rmlvo_builder + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT void +xkb_rmlvo_builder_unref(struct xkb_rmlvo_builder *rmlvo); + +/** + * Names to compile a keymap with, also known as [RMLVO]. + * + * The names are the common configuration values by which a user picks + * a keymap. + * + * If the entire struct is `NULL`, then each field is taken to be `NULL`. + * You should prefer passing `NULL` instead of choosing your own defaults. + * + * @see [Introduction to RMLVO][RMLVO] + * @see @ref rules-api "" + * + * [RMLVO]: @ref RMLVO-intro + */ +struct xkb_rule_names { + /** + * The rules file to use. The rules file describes how to interpret + * the values of the model, layout, variant and options fields. + * + * If `NULL` or the empty string `""`, a default value is used. + * If the `XKB_DEFAULT_RULES` environment variable is set, it is used + * as the default. Otherwise the system default is used. + */ + const char *rules; + /** + * The keyboard model by which to interpret keycodes and LEDs. + * + * If `NULL` or the empty string `""`, a default value is used. + * If the `XKB_DEFAULT_MODEL` environment variable is set, it is used + * as the default. Otherwise the system default is used. + */ + const char *model; + /** + * A comma separated list of layouts (languages) to include in the + * keymap. + * + * If `NULL` or the empty string `""`, a default value is used. + * If the `XKB_DEFAULT_LAYOUT` environment variable is set, it is used + * as the default. Otherwise the system default is used. + */ + const char *layout; + /** + * A comma separated list of variants, one per layout, which may + * modify or augment the respective layout in various ways. + * + * Generally, should either be empty or have the same number of values + * as the number of layouts. You may use empty values as in `intl,,neo`. + * + * If `NULL` or the empty string `""`, and a default value is also used + * for the layout, a default value is used. Otherwise no variant is + * used. + * If the `XKB_DEFAULT_VARIANT` environment variable is set, it is used + * as the default. Otherwise the system default is used. + */ + const char *variant; + /** + * A comma separated list of options, through which the user specifies + * non-layout related preferences, like which key combinations are used + * for switching layouts, or which key is the Compose key. + * + * If `NULL`, a default value is used. If the empty string `""`, no + * options are used. + * If the `XKB_DEFAULT_OPTIONS` environment variable is set, it is used + * as the default. Otherwise the system default is used. + * + * Each option can additionally have a *layout index specifier*, so that it + * applies only if matching the given layout. The index is specified by + * appending `!` immediately after the option name, then the 1-indexed + * target layout in decimal format: e.g. `ns:option!2`. When no layout is + * specified, it matches any layout. + * + * @note The layout index specifier is only effectual if the corresponding + * ruleset has the proper rules to handle the option as *layout-specific*. + * @note See `rxkb_option_is_layout_specific()` to query whether an option + * supports the layout-specific feature. + * + * @since 1.11.0: Layout index specifier using `!`. + */ + const char *options; +}; + +/** + * Keymap components, also known as [KcCGST]. + * + * The components are the result of the [RMLVO] resolution. + * + * @see [Introduction to RMLVO][RMLVO] + * @see [Introduction to KcCGST][KcCGST] + * @see @ref rules-api "" + * + * [RMLVO]: @ref RMLVO-intro + * [KcCGST]: @ref KcCGST-intro + */ +struct xkb_component_names { + char *keycodes; + char *compatibility; + char *geometry; + char *symbols; + char *types; +}; + +/** + * Resolve [RMLVO] names to [KcCGST] components. + * + * This function is used primarily for *debugging*. See + * `xkb_keymap::xkb_keymap_new_from_names2()` for creating keymaps from + * [RMLVO] names. + * + * @param[in] context The context in which to resolve the names. + * @param[in] rmlvo_in The [RMLVO] names to use. + * @param[out] rmlvo_out The [RMLVO] names actually used after resolving + * missing values. + * @param[out] components_out The [KcCGST] components resulting of the [RMLVO] + * resolution. + * + * @c rmlvo_out and @c components can be omitted by using `NULL`, but not both. + * + * If @c components is not `NULL`, it is filled with dynamically-allocated + * strings that should be freed by the caller. + * + * @returns `true` if the [RMLVO] names could be resolved, `false` otherwise. + * + * @see [Introduction to RMLVO][RMLVO] + * @see [Introduction to KcCGST][KcCGST] + * @see xkb_rule_names + * @see xkb_component_names + * @see xkb_keymap::xkb_keymap_new_from_names2() + * + * @since 1.9.0 + * @memberof xkb_component_names + * + * [RMLVO]: @ref RMLVO-intro + * [KcCGST]: @ref KcCGST-intro + */ +XKB_EXPORT bool +xkb_components_names_from_rules(struct xkb_context *context, + const struct xkb_rule_names *rmlvo_in, + struct xkb_rule_names *rmlvo_out, + struct xkb_component_names *components_out); + +/** @} */ + +/** + * @defgroup keysyms Keysyms + * Utility functions related to *keysyms* (short for “key symbols”). + * + * @{ + */ + +/** + * @page keysym-transformations Keysym Transformations + * + * Keysym translation is subject to several *keysym transformations*, + * as described in the XKB specification. These are: + * + *

+ *
Capitalization transformation
+ *
+ * If the Caps Lock modifier is + * active and was not consumed by the translation process, keysyms + * are transformed to their upper-case form (if applicable). + * Similarly, the UTF-8/UTF-32 string produced is capitalized. + * + * This is described in: + * https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Lock_Modifier + *
+ *
Control transformation
+ *
+ * If the Control modifier is active and + * was not consumed by the translation process, the string produced + * is transformed to its matching ASCII control character (if + * applicable). Keysyms are not affected. + * + * This is described in: + * https://www.x.org/releases/current/doc/kbproto/xkbproto.html#Interpreting_the_Control_Modifier + *
+ *
+ * + * Each relevant function discusses which transformations it performs. + * + * These transformations are not applicable when a key produces multiple + * keysyms. + */ + + +/** + * Get the name of a keysym. + * + * For a description of how keysyms are named, see @ref xkb_keysym_t. + * + * @param[in] keysym The keysym. + * @param[out] buffer A string buffer to write the name into. + * @param[in] size Size of the buffer. + * + * @warning If the buffer passed is too small, the string is truncated + * (though still `NULL`-terminated); a size of at least 64 bytes is recommended. + * + * @returns The number of bytes in the name, excluding the `NULL` byte. If + * the keysym is invalid, returns -1. + * + * You may check if truncation has occurred by comparing the return value + * with the length of buffer, similarly to the `snprintf(3)` function. + * + * @sa `xkb_keysym_t` + */ +XKB_EXPORT int +xkb_keysym_get_name(xkb_keysym_t keysym, char *buffer, size_t size); + +/** Flags for xkb_keysym_from_name(). */ +enum xkb_keysym_flags { + /** Do not apply any flags. */ + XKB_KEYSYM_NO_FLAGS = 0, + /** Find keysym by case-insensitive search. */ + XKB_KEYSYM_CASE_INSENSITIVE = (1 << 0) +}; + +/** + * Get a keysym from its name. + * + * @param name The name of a keysym. See remarks in `xkb_keysym_get_name()`; + * this function will accept any name returned by that function. + * @param flags A set of flags controlling how the search is done. If + * invalid flags are passed, this will fail with `XKB_KEY_NoSymbol`. + * + * If you use the `::XKB_KEYSYM_CASE_INSENSITIVE` flag and two keysym names + * differ only by case, then the lower-case keysym name is returned. For + * instance, for KEY_a and KEY_A, this function would return KEY_a for the + * case-insensitive search. If this functionality is needed, it is + * recommended to first call this function without this flag; and if that + * fails, only then to try with this flag, while possibly warning the user + * he had misspelled the name, and might get wrong results. + * + * Case folding is done according to the C locale; the current locale is not + * consulted. + * + * @returns The keysym. If the name is invalid, returns `XKB_KEY_NoSymbol`. + * + * @sa xkb_keysym_t + * @since 1.9.0: Enable support for C0 and C1 control characters in the Unicode + * notation. + */ +XKB_EXPORT xkb_keysym_t +xkb_keysym_from_name(const char *name, enum xkb_keysym_flags flags); + +/** + * Get the Unicode/UTF-8 representation of a keysym. + * + * @param[in] keysym The keysym. + * @param[out] buffer A buffer to write the UTF-8 string into. + * @param[in] size The size of buffer. Must be at least 5. + * + * @returns The number of bytes written to the buffer (including the + * terminating byte). If the keysym does not have a Unicode + * representation, returns 0. If the buffer is too small, returns -1. + * + * This function does not perform any @ref keysym-transformations. + * Therefore, prefer to use `xkb_state::xkb_state_key_get_utf8()` if possible. + * + * @sa `xkb_state::xkb_state_key_get_utf8()` + */ +XKB_EXPORT int +xkb_keysym_to_utf8(xkb_keysym_t keysym, char *buffer, size_t size); + +/** + * Get the Unicode/UTF-32 representation of a keysym. + * + * @returns The Unicode/UTF-32 representation of keysym, which is also + * compatible with UCS-4. If the keysym does not have a Unicode + * representation, returns 0. + * + * This function does not perform any @ref keysym-transformations. + * Therefore, prefer to use xkb_state_key_get_utf32() if possible. + * + * @sa `xkb_state::xkb_state_key_get_utf32()` + */ +XKB_EXPORT uint32_t +xkb_keysym_to_utf32(xkb_keysym_t keysym); + +/** + * Get the keysym corresponding to a Unicode/UTF-32 codepoint. + * + * @returns The keysym corresponding to the specified Unicode + * codepoint, or XKB_KEY_NoSymbol if there is none. + * + * This function is the inverse of @ref xkb_keysym_to_utf32. In cases + * where a single codepoint corresponds to multiple keysyms, returns + * the keysym with the lowest value. + * + * Unicode codepoints which do not have a special (legacy) keysym + * encoding use a direct encoding scheme. These keysyms don’t usually + * have an associated keysym constant (`XKB_KEY_*`). + * + * @sa `xkb_keysym_to_utf32()` + * @since 1.0.0 + * @since 1.9.0: Enable support for all noncharacters. + */ +XKB_EXPORT xkb_keysym_t +xkb_utf32_to_keysym(uint32_t ucs); + +/** + * Convert a keysym to its uppercase form. + * + * If there is no such form, the keysym is returned unchanged. + * + * The conversion rules are the *simple* (i.e. one-to-one) Unicode case + * mappings (with some exceptions, see hereinafter) and do not depend + * on the locale. If you need the special case mappings (i.e. not + * one-to-one or locale-dependent), prefer to work with the Unicode + * representation instead, when possible. + * + * Exceptions to the Unicode mappings: + * + * | Lower keysym | Lower letter | Upper keysym | Upper letter | Comment | + * | ------------ | ------------ | ------------ | ------------ | ------- | + * | `ssharp` | `U+00DF`: ß | `U1E9E` | `U+1E9E`: ẞ | [Council for German Orthography] | + * + * [Council for German Orthography]: https://www.rechtschreibrat.com/regeln-und-woerterverzeichnis/ + * + * @since 0.8.0: Initial implementation, based on `libX11`. + * @since 1.8.0: Use Unicode 16.0 mappings for complete Unicode coverage. + */ +XKB_EXPORT xkb_keysym_t +xkb_keysym_to_upper(xkb_keysym_t ks); + +/** + * Convert a keysym to its lowercase form. + * + * If there is no such form, the keysym is returned unchanged. + * + * The conversion rules are the *simple* (i.e. one-to-one) Unicode case + * mappings and do not depend on the locale. If you need the special + * case mappings (i.e. not one-to-one or locale-dependent), prefer to + * work with the Unicode representation instead, when possible. + * + * @since 0.8.0: Initial implementation, based on `libX11`. + * @since 1.8.0: Use Unicode 16.0 mappings for complete Unicode coverage. + */ +XKB_EXPORT xkb_keysym_t +xkb_keysym_to_lower(xkb_keysym_t ks); + +/** @} */ + +/** + * @defgroup context Library Context + * Creating, destroying and using library contexts. + * + * Every keymap compilation request must have a context associated with + * it. The context keeps around state such as the include path. + * + * @{ + */ + +/** + * @page envvars Environment Variables + * + * The user may set some environment variables which affect the library: + * + * - `XKB_CONFIG_ROOT`, `XKB_CONFIG_EXTRA_PATH`, `XDG_CONFIG_DIR`, `HOME` - see @ref include-path. + * - `XKB_LOG_LEVEL` - see `xkb_context::xkb_context_set_log_level()`. + * - `XKB_LOG_VERBOSITY` - see `xkb_context::xkb_context_set_log_verbosity()`. + * - `XKB_DEFAULT_RULES`, `XKB_DEFAULT_MODEL`, `XKB_DEFAULT_LAYOUT`, + * `XKB_DEFAULT_VARIANT`, `XKB_DEFAULT_OPTIONS` - see `xkb_rule_names`. + */ + +/** Flags for context creation. */ +enum xkb_context_flags { + /** Do not apply any context flags. */ + XKB_CONTEXT_NO_FLAGS = 0, + /** Create this context with an empty include path. */ + XKB_CONTEXT_NO_DEFAULT_INCLUDES = (1 << 0), + /** + * Don’t take RMLVO names from the environment. + * + * @since 0.3.0 + */ + XKB_CONTEXT_NO_ENVIRONMENT_NAMES = (1 << 1), + /** + * Disable the use of secure_getenv for this context, so that privileged + * processes can use environment variables. Client uses at their own risk. + * + * @since 1.5.0 + */ + XKB_CONTEXT_NO_SECURE_GETENV = (1 << 2) +}; + +/** + * Create a new context. + * + * @param flags Optional flags for the context, or 0. + * + * @returns A new context, or `NULL` on failure. + * + * @memberof xkb_context + */ +XKB_EXPORT struct xkb_context * +xkb_context_new(enum xkb_context_flags flags); + +/** + * Take a new reference on a context. + * + * @returns The passed in context. + * + * @memberof xkb_context + */ +XKB_EXPORT struct xkb_context * +xkb_context_ref(struct xkb_context *context); + +/** + * Release a reference on a context, and possibly free it. + * + * @param context The context. If it is `NULL`, this function does nothing. + * + * @memberof xkb_context + */ +XKB_EXPORT void +xkb_context_unref(struct xkb_context *context); + +/** + * Store custom user data in the context. + * + * This may be useful in conjunction with `xkb_context::xkb_context_set_log_fn()` + * or other callbacks. + * + * @memberof xkb_context + */ +XKB_EXPORT void +xkb_context_set_user_data(struct xkb_context *context, void *user_data); + +/** + * Retrieves stored user data from the context. + * + * @returns The stored user data. If the user data wasn’t set, or the + * passed in context is `NULL`, returns `NULL`. + * + * This may be useful to access private user data from callbacks like a + * custom logging function. + * + * @memberof xkb_context + **/ +XKB_EXPORT void * +xkb_context_get_user_data(struct xkb_context *context); + +/** @} */ + +/** + * @defgroup include-path Include Paths + * Manipulating the include paths in a context. + * + * The include paths are the file-system paths that are searched when an + * include statement is encountered during keymap compilation. + * + * The default include paths are, in that lookup order: + * - The path `$XDG_CONFIG_HOME/xkb`, with the usual `XDG_CONFIG_HOME` + * fallback to `$HOME/.config/` if unset. + * - The path `$HOME/.xkb`, where $HOME is the value of the environment + * variable `HOME`. + * - The `XKB_CONFIG_EXTRA_PATH` environment variable, if defined, otherwise the + * system configuration directory, defined at library configuration time + * (usually `/etc/xkb`). + * - The `XKB_CONFIG_ROOT` environment variable, if defined, otherwise + * the system XKB root, defined at library configuration time. + * + * @{ + */ + +/** + * Append a new entry to the context’s include path. + * + * @returns 1 on success, or 0 if the include path could not be added or is + * inaccessible. + * + * @memberof xkb_context + */ +XKB_EXPORT int +xkb_context_include_path_append(struct xkb_context *context, const char *path); + +/** + * Append the default include paths to the context’s include path. + * + * @returns 1 on success, or 0 if the primary include path could not be added. + * + * @memberof xkb_context + */ +XKB_EXPORT int +xkb_context_include_path_append_default(struct xkb_context *context); + +/** + * Reset the context’s include path to the default. + * + * Removes all entries from the context’s include path, and inserts the + * default paths. + * + * @returns 1 on success, or 0 if the primary include path could not be added. + * + * @memberof xkb_context + */ +XKB_EXPORT int +xkb_context_include_path_reset_defaults(struct xkb_context *context); + +/** + * Remove all entries from the context’s include path. + * + * @memberof xkb_context + */ +XKB_EXPORT void +xkb_context_include_path_clear(struct xkb_context *context); + +/** + * Get the number of paths in the context’s include path. + * + * @memberof xkb_context + */ +XKB_EXPORT unsigned int +xkb_context_num_include_paths(struct xkb_context *context); + +/** + * Get a specific include path from the context’s include path. + * + * @returns The include path at the specified index. If the index is + * invalid, returns NULL. + * + * @memberof xkb_context + */ +XKB_EXPORT const char * +xkb_context_include_path_get(struct xkb_context *context, unsigned int index); + +/** @} */ + +/** + * @defgroup logging Logging Handling + * Manipulating how logging from this library is handled. + * + * @{ + */ + +/** Specifies a logging level. */ +enum xkb_log_level { + XKB_LOG_LEVEL_CRITICAL = 10, /**< Log critical internal errors only. */ + XKB_LOG_LEVEL_ERROR = 20, /**< Log all errors. */ + XKB_LOG_LEVEL_WARNING = 30, /**< Log warnings and errors. */ + XKB_LOG_LEVEL_INFO = 40, /**< Log information, warnings, and errors. */ + XKB_LOG_LEVEL_DEBUG = 50 /**< Log everything. */ +}; + +/** + * Set the current logging level. + * + * @param context The context in which to set the logging level. + * @param level The logging level to use. Only messages from this level + * and below will be logged. + * + * The default level is `::XKB_LOG_LEVEL_ERROR`. The environment variable + * `XKB_LOG_LEVEL`, if set in the time the context was created, overrides the + * default value. It may be specified as a level number or name. + * + * @memberof xkb_context + */ +XKB_EXPORT void +xkb_context_set_log_level(struct xkb_context *context, + enum xkb_log_level level); + +/** + * Get the current logging level. + * + * @memberof xkb_context + */ +XKB_EXPORT enum xkb_log_level +xkb_context_get_log_level(struct xkb_context *context); + +/** + * Sets the current logging verbosity. + * + * The library can generate a number of warnings which are not helpful to + * ordinary users of the library. The verbosity may be increased if more + * information is desired (e.g. when developing a new keymap). + * + * The default verbosity is 0. The environment variable `XKB_LOG_VERBOSITY`, + * if set in the time the context was created, overrides the default value. + * + * @param context The context in which to use the set verbosity. + * @param verbosity The verbosity to use. Currently used values are + * 1 to 10, higher values being more verbose. 0 would result in no verbose + * messages being logged. + * + * Most verbose messages are of level `::XKB_LOG_LEVEL_WARNING` or lower. + * + * @memberof xkb_context + */ +XKB_EXPORT void +xkb_context_set_log_verbosity(struct xkb_context *context, int verbosity); + +/** + * Get the current logging verbosity of the context. + * + * @memberof xkb_context + */ +XKB_EXPORT int +xkb_context_get_log_verbosity(struct xkb_context *context); + +/** + * Set a custom function to handle logging messages. + * + * @param context The context in which to use the set logging function. + * @param log_fn The function that will be called for logging messages. + * Passing `NULL` restores the default function, which logs to stderr. + * + * By default, log messages from this library are printed to stderr. This + * function allows you to replace the default behavior with a custom + * handler. The handler is only called with messages which match the + * current logging level and verbosity settings for the context. + * level is the logging level of the message. @a format and @a args are + * the same as in the `vprintf(3)` function. + * + * You may use `xkb_context::xkb_context_set_user_data()` on the context, and + * then call `xkb_context::xkb_context_get_user_data()` from within the logging + * function to provide it with additional private context. + * + * @memberof xkb_context + */ +XKB_EXPORT void +xkb_context_set_log_fn(struct xkb_context *context, + void (*log_fn)(struct xkb_context *context, + enum xkb_log_level level, + const char *format, va_list args)); + +/** @} */ + +/** + * @defgroup keymap Keymap Creation + * Creating and destroying keymaps. + * + * @{ + */ + +/** Flags for keymap compilation. */ +enum xkb_keymap_compile_flags { + /** Do not apply any flags. */ + XKB_KEYMAP_COMPILE_NO_FLAGS = 0 +}; + +/** + * The possible keymap formats. + * + * See @ref keymap-text-format-v1-v2 "" for the complete description of the + * formats and @ref keymap-support "" for detailed differences between the + * formats. + * + * @remark A keymap can be parsed in one format and serialized in another, + * thanks to automatic fallback mechanisms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
+ * Keymap format to use depending on the target protocol + *
Protocollibxkbcommon keymap format
NameKeymap formatParsingSerialization
X11XKB + * `::XKB_KEYMAP_FORMAT_TEXT_V1` + * + * *Always* use `::XKB_KEYMAP_FORMAT_TEXT_V1`, since the other formats are + * incompatible. + *
Wayland[xkb_v1] + *
+ *
Wayland compositors
+ *
+ * The format depends on the keyboard layout database (usually [xkeyboard-config]). + * Note that since v2 is a superset of v1, compositors are encouraged to use + * `::XKB_KEYMAP_FORMAT_TEXT_V2` whenever possible. + *
+ *
Client apps
+ *
+ * Clients should use `::XKB_KEYMAP_FORMAT_TEXT_V1` to parse the keymap sent + * by a Wayland compositor, at least until `::XKB_KEYMAP_FORMAT_TEXT_V2` + * stabilizes. + *
+ *
+ * At the time of writing (July 2025), the Wayland [xkb_v1] keymap + * format is only defined as “libxkbcommon compatible”. In theory it enables + * flexibility, but the set of supported features varies depending on the + * libxkbcommon version and libxkbcommon keymap format used. Unfortunately there + * is currently no Wayland API for keymap format *negotiation*. + * + * Therefore the **recommended** serialization format is + * `::XKB_KEYMAP_FORMAT_TEXT_V1`, in order to ensure maximum compatibility for + * interchange. + * + * Serializing using `::XKB_KEYMAP_FORMAT_TEXT_V2` should be considered + * **experimental**, as some clients may fail to parse the resulting string. + *
+ * + * [xkb_v1]: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_keyboard-enum-keymap_format + * [xkeyboard-config]: https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config + */ +enum xkb_keymap_format { + /** + * The classic XKB text format, as generated by `xkbcomp -xkb`. + * + * @important This format should *always* be used when *serializing* a + * keymap for **X11**. + * + * @important For the **Wayland** [xkb_v1] format, it is + * advised to use this format as well for serializing, in order to ensure + * maximum compatibility for interchange. + * + * [xkb_v1]: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_keyboard-enum-keymap_format + */ + XKB_KEYMAP_FORMAT_TEXT_V1 = 1, + /** + * Xkbcommon extensions of the classic XKB text format, **incompatible with + * X11**. + * + * @important Do *not* use when *serializing* a keymap for **X11** + * (incompatible). + * + * @important Considered *experimental* when *serializing* for **Wayland**: + * at the time of writing (July 2025), there is only one XKB keymap format + * [xkb_v1] in Wayland and no Wayland API for keymap format + * *negotiation*, so the clients may not be able to parse the keymap if it + * uses v2-specific features. Therefore a compositor may *parse* keymaps + * using `::XKB_KEYMAP_FORMAT_TEXT_V2` but it should serialize them using + * `::XKB_KEYMAP_FORMAT_TEXT_V1` and rely on the automatic *fallback* + * mechanisms. + * + * @since 1.11.0 + * + * [xkb_v1]: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_keyboard-enum-keymap_format + */ + XKB_KEYMAP_FORMAT_TEXT_V2 = 2 +}; + +/** + * Create a keymap from a [RMLVO] builder. + * + * The primary keymap entry point: creates a new XKB keymap from a set of + * [RMLVO] \(Rules + Model + Layouts + Variants + Options) names. + * + * @param rmlvo The [RMLVO] builder to use. See `xkb_rmlvo_builder`. + * @param format The text format of the keymap file to compile. + * @param flags Optional flags for the keymap, or 0. + * + * @returns A keymap compiled according to the [RMLVO] names, or `NULL` if + * the compilation failed. + * + * @since 1.11.0 + * @sa `xkb_keymap_new_from_names2()` + * @sa `xkb_rmlvo_builder` + * @memberof xkb_keymap + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_rmlvo(const struct xkb_rmlvo_builder *rmlvo, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags); + +/** + * Create a keymap from [RMLVO] names. + * + * Same as `xkb_keymap_new_from_names2()`, but with the keymap format fixed to: + * `::XKB_KEYMAP_FORMAT_TEXT_V2`. + * + * @deprecated Use `xkb_keymap_new_from_names2()` instead. + * @since 1.11.0: Deprecated + * @since 1.11.0: Use internally `::XKB_KEYMAP_FORMAT_TEXT_V2` instead of + * `::XKB_KEYMAP_FORMAT_TEXT_V1` + * @sa `xkb_keymap_new_from_names2()` + * @sa `xkb_rule_names` + * @sa `xkb_keymap_new_from_rmlvo()` + * @memberof xkb_keymap + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_names(struct xkb_context *context, + const struct xkb_rule_names *names, + enum xkb_keymap_compile_flags flags); + +/** + * Create a keymap from [RMLVO] names. + * + * The primary keymap entry point: creates a new XKB keymap from a set of + * [RMLVO] \(Rules + Model + Layouts + Variants + Options) names. + * + * @param context The context in which to create the keymap. + * @param names The [RMLVO] names to use. See xkb_rule_names. + * @param format The text format of the keymap file to compile. + * @param flags Optional flags for the keymap, or 0. + * + * @returns A keymap compiled according to the [RMLVO] names, or `NULL` if + * the compilation failed. + * + * @sa `xkb_rule_names` + * @sa `xkb_keymap_new_from_rmlvo()` + * @memberof xkb_keymap + * @since 1.11.0 + * + * [RMLVO]: @ref RMLVO-intro + */ +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_names2(struct xkb_context *context, + const struct xkb_rule_names *names, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags); + +/** + * Create a keymap from a keymap file. + * + * @param context The context in which to create the keymap. + * @param file The keymap file to compile. + * @param format The text format of the keymap file to compile. + * @param flags Optional flags for the keymap, or 0. + * + * @returns A keymap compiled from the given XKB keymap file, or `NULL` if + * the compilation failed. + * + * The file must contain a complete keymap. For example, in the + * `::XKB_KEYMAP_FORMAT_TEXT_V1` format, this means the file must contain one + * top level `%xkb_keymap` section, which in turn contains other required + * sections. + * + * @memberof xkb_keymap + */ +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_file(struct xkb_context *context, FILE *file, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags); + +/** + * Create a keymap from a keymap string. + * + * This is just like `xkb_keymap_new_from_file()`, but instead of a file, gets + * the keymap as one enormous string. + * + * @see `xkb_keymap_new_from_file()` + * @memberof xkb_keymap + */ +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_string(struct xkb_context *context, const char *string, + enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags); + +/** + * Create a keymap from a memory buffer. + * + * This is just like `xkb_keymap_new_from_string()`, but takes a length argument + * so the input string does not have to be zero-terminated. + * + * @see `xkb_keymap_new_from_string()` + * @memberof xkb_keymap + * @since 0.3.0 + */ +XKB_EXPORT struct xkb_keymap * +xkb_keymap_new_from_buffer(struct xkb_context *context, const char *buffer, + size_t length, enum xkb_keymap_format format, + enum xkb_keymap_compile_flags flags); + +/** + * Take a new reference on a keymap. + * + * @returns The passed in keymap. + * + * @memberof xkb_keymap + */ +XKB_EXPORT struct xkb_keymap * +xkb_keymap_ref(struct xkb_keymap *keymap); + +/** + * Release a reference on a keymap, and possibly free it. + * + * @param keymap The keymap. If it is `NULL`, this function does nothing. + * + * @memberof xkb_keymap + */ +XKB_EXPORT void +xkb_keymap_unref(struct xkb_keymap *keymap); + +/** + * Get the keymap as a string in the format from which it was created. + * @sa `xkb_keymap::xkb_keymap_get_as_string()` + **/ +#define XKB_KEYMAP_USE_ORIGINAL_FORMAT ((enum xkb_keymap_format) -1) + +/** + * Get the compiled keymap as a string. + * + * @param keymap The keymap to get as a string. + * @param format The keymap format to use for the string. You can pass + * in the special value `::XKB_KEYMAP_USE_ORIGINAL_FORMAT` to use the format + * from which the keymap was originally created. When used as an *interchange* + * format such as Wayland [xkb_v1], the format should be explicit. + * + * @returns The keymap as a `NULL`-terminated string, or `NULL` if unsuccessful. + * + * The returned string may be fed back into `xkb_keymap_new_from_string()` to + * get the exact same keymap (possibly in another process, etc.). + * + * The returned string is *dynamically allocated* and should be freed by the + * caller. + * + * @memberof xkb_keymap + * + * [xkb_v1]: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_keyboard-enum-keymap_format + */ +XKB_EXPORT char * +xkb_keymap_get_as_string(struct xkb_keymap *keymap, + enum xkb_keymap_format format); + +/** @} */ + +/** + * @defgroup components Keymap Components + * Enumeration of state components in a keymap. + * + * @{ + */ + +/** + * Get the minimum keycode in the keymap. + * + * @sa xkb_keycode_t + * @memberof xkb_keymap + * @since 0.3.1 + */ +XKB_EXPORT xkb_keycode_t +xkb_keymap_min_keycode(struct xkb_keymap *keymap); + +/** + * Get the maximum keycode in the keymap. + * + * @sa xkb_keycode_t + * @memberof xkb_keymap + * @since 0.3.1 + */ +XKB_EXPORT xkb_keycode_t +xkb_keymap_max_keycode(struct xkb_keymap *keymap); + +/** + * The iterator used by `xkb_keymap_key_for_each()`. + * + * @sa xkb_keymap_key_for_each + * @memberof xkb_keymap + * @since 0.3.1 + */ +typedef void +(*xkb_keymap_key_iter_t)(struct xkb_keymap *keymap, xkb_keycode_t key, + void *data); + +/** + * Run a specified function for every valid keycode in the keymap. If a + * keymap is sparse, this function may be called fewer than + * (max_keycode - min_keycode + 1) times. + * + * @sa xkb_keymap_min_keycode() + * @sa xkb_keymap_max_keycode() + * @sa xkb_keycode_t + * @memberof xkb_keymap + * @since 0.3.1 + */ +XKB_EXPORT void +xkb_keymap_key_for_each(struct xkb_keymap *keymap, xkb_keymap_key_iter_t iter, + void *data); + +/** + * Find the name of the key with the given keycode. + * + * This function always returns the canonical name of the key (see + * description in `xkb_keycode_t`). + * + * @returns The key name. If no key with this keycode exists, + * returns `NULL`. + * + * @sa xkb_keycode_t + * @memberof xkb_keymap + * @since 0.6.0 + */ +XKB_EXPORT const char * +xkb_keymap_key_get_name(struct xkb_keymap *keymap, xkb_keycode_t key); + +/** + * Find the keycode of the key with the given name. + * + * The name can be either a canonical name or an alias. + * + * @returns The keycode. If no key with this name exists, + * returns `::XKB_KEYCODE_INVALID`. + * + * @sa xkb_keycode_t + * @memberof xkb_keymap + * @since 0.6.0 + */ +XKB_EXPORT xkb_keycode_t +xkb_keymap_key_by_name(struct xkb_keymap *keymap, const char *name); + +/** + * Get the number of modifiers in the keymap. + * + * @sa xkb_mod_index_t + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_mod_index_t +xkb_keymap_num_mods(struct xkb_keymap *keymap); + +/** + * Get the name of a modifier by index. + * + * @returns The name. If the index is invalid, returns `NULL`. + * + * @sa xkb_mod_index_t + * @memberof xkb_keymap + */ +XKB_EXPORT const char * +xkb_keymap_mod_get_name(struct xkb_keymap *keymap, xkb_mod_index_t idx); + +/** + * Get the index of a modifier by name. + * + * @returns The index. If no modifier with this name exists, returns + * `::XKB_MOD_INVALID`. + * + * @sa xkb_mod_index_t + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_mod_index_t +xkb_keymap_mod_get_index(struct xkb_keymap *keymap, const char *name); + +/** + * Get the encoding of a modifier by name. + * + * In X11 terminology it corresponds to the mapping to the *[real modifiers]*. + * + * @returns The encoding of a modifier. Note that it may be 0 if the name does + * not exist or if the modifier is not mapped. + * + * @since 1.10.0 + * @sa `xkb_keymap_mod_get_mask2()` + * @memberof xkb_keymap + * + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT xkb_mod_mask_t +xkb_keymap_mod_get_mask(struct xkb_keymap *keymap, const char *name); + +/** + * Get the encoding of a modifier by index. + * + * In X11 terminology it corresponds to the mapping to the *[real modifiers]*. + * + * @returns The encoding of a modifier. Note that it may be 0 if the modifier is + * not mapped. + * + * @since 1.11.0 + * @sa `xkb_keymap_mod_get_mask()` + * @memberof xkb_keymap + * + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT xkb_mod_mask_t +xkb_keymap_mod_get_mask2(struct xkb_keymap *keymap, xkb_mod_index_t idx); + +/** + * Get the number of layouts in the keymap. + * + * @sa `xkb_layout_index_t` + * @sa `xkb_rule_names` + * @sa `xkb_keymap_num_layouts_for_key()` + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_layout_index_t +xkb_keymap_num_layouts(struct xkb_keymap *keymap); + +/** + * Get the name of a layout by index. + * + * @returns The name. If the index is invalid, or the layout does not have + * a name, returns `NULL`. + * + * @sa xkb_layout_index_t + * For notes on layout names. + * @memberof xkb_keymap + */ +XKB_EXPORT const char * +xkb_keymap_layout_get_name(struct xkb_keymap *keymap, xkb_layout_index_t idx); + +/** + * Get the index of a layout by name. + * + * @returns The index. If no layout exists with this name, returns + * `::XKB_LAYOUT_INVALID`. If more than one layout in the keymap has this name, + * returns the lowest index among them. + * + * @sa `xkb_layout_index_t` for notes on layout names. + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_layout_index_t +xkb_keymap_layout_get_index(struct xkb_keymap *keymap, const char *name); + +/** + * Get the number of LEDs in the keymap. + * + * @warning The range [ 0...`xkb_keymap_num_leds()` ) includes all of the LEDs + * in the keymap, but may also contain inactive LEDs. When iterating over + * this range, you need the handle this case when calling functions such as + * `xkb_keymap_led_get_name()` or `xkb_state::xkb_state_led_index_is_active()`. + * + * @sa xkb_led_index_t + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_led_index_t +xkb_keymap_num_leds(struct xkb_keymap *keymap); + +/** + * Get the name of a LED by index. + * + * @returns The name. If the index is invalid, returns `NULL`. + * + * @memberof xkb_keymap + */ +XKB_EXPORT const char * +xkb_keymap_led_get_name(struct xkb_keymap *keymap, xkb_led_index_t idx); + +/** + * Get the index of a LED by name. + * + * @returns The index. If no LED with this name exists, returns + * `::XKB_LED_INVALID`. + * + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_led_index_t +xkb_keymap_led_get_index(struct xkb_keymap *keymap, const char *name); + +/** + * Get the number of layouts for a specific key. + * + * This number can be different from `xkb_keymap_num_layouts()`, but is always + * smaller. It is the appropriate value to use when iterating over the + * layouts of a key. + * + * @sa xkb_layout_index_t + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_layout_index_t +xkb_keymap_num_layouts_for_key(struct xkb_keymap *keymap, xkb_keycode_t key); + +/** + * Get the number of shift levels for a specific key and layout. + * + * If @c layout is out of range for this key (that is, larger or equal to + * the value returned by `xkb_keymap_num_layouts_for_key()`), it is brought + * back into range in a manner consistent with + * `xkb_state::xkb_state_key_get_layout()`. + * + * @sa xkb_level_index_t + * @memberof xkb_keymap + */ +XKB_EXPORT xkb_level_index_t +xkb_keymap_num_levels_for_key(struct xkb_keymap *keymap, xkb_keycode_t key, + xkb_layout_index_t layout); + +/** + * Retrieves every possible modifier mask that produces the specified + * shift level for a specific key and layout. + * + * This API is useful for inverse key transformation; i.e. finding out + * which modifiers need to be active in order to be able to type the + * keysym(s) corresponding to the specific key code, layout and level. + * + * @warning It returns only up to masks_size modifier masks. If the + * buffer passed is too small, some of the possible modifier combinations + * will not be returned. + * + * @param[in] keymap The keymap. + * @param[in] key The keycode of the key. + * @param[in] layout The layout for which to get modifiers. + * @param[in] level The shift level in the layout for which to get the + * modifiers. This should be smaller than: + * @code xkb_keymap_num_levels_for_key(keymap, key) @endcode + * @param[out] masks_out A buffer in which the requested masks should be + * stored. + * @param[out] masks_size The number of elements in the buffer pointed to by + * masks_out. + * + * If @c layout is out of range for this key (that is, larger or equal to + * the value returned by `xkb_keymap_num_layouts_for_key()`), it is brought + * back into range in a manner consistent with + * `xkb_state::xkb_state_key_get_layout()`. + * + * @returns The number of modifier masks stored in the masks_out array. + * If the key is not in the keymap or if the specified shift level cannot + * be reached it returns 0 and does not modify the masks_out buffer. + * + * @sa xkb_level_index_t + * @sa xkb_mod_mask_t + * @memberof xkb_keymap + * @since 1.0.0 + */ +XKB_EXPORT size_t +xkb_keymap_key_get_mods_for_level(struct xkb_keymap *keymap, + xkb_keycode_t key, + xkb_layout_index_t layout, + xkb_level_index_t level, + xkb_mod_mask_t *masks_out, + size_t masks_size); + +/** + * Get the keysyms obtained from pressing a key in a given layout and + * shift level. + * + * This function is like `xkb_state::xkb_state_key_get_syms()`, only the layout + * and shift level are not derived from the keyboard state but are instead + * specified explicitly. + * + * @param[in] keymap The keymap. + * @param[in] key The keycode of the key. + * @param[in] layout The layout for which to get the keysyms. + * @param[in] level The shift level in the layout for which to get the + * keysyms. This should be smaller than: + * @code xkb_keymap_num_levels_for_key(keymap, key) @endcode + * @param[out] syms_out An immutable array of keysyms corresponding to the + * key in the given layout and shift level. + * + * If @c layout is out of range for this key (that is, larger or equal to + * the value returned by `xkb_keymap_num_layouts_for_key()`), it is brought + * back into range in a manner consistent with + * `xkb_state::xkb_state_key_get_layout()`. + * + * @returns The number of keysyms in the syms_out array. If no keysyms + * are produced by the key in the given layout and shift level, returns 0 + * and sets @p syms_out to `NULL`. + * + * @sa `xkb_state::xkb_state_key_get_syms()` + * @memberof xkb_keymap + */ +XKB_EXPORT int +xkb_keymap_key_get_syms_by_level(struct xkb_keymap *keymap, + xkb_keycode_t key, + xkb_layout_index_t layout, + xkb_level_index_t level, + const xkb_keysym_t **syms_out); + +/** + * Determine whether a key should repeat or not. + * + * A keymap may specify different repeat behaviors for different keys. + * Most keys should generally exhibit repeat behavior; for example, holding + * the `a` key down in a text editor should normally insert a single ‘a’ + * character every few milliseconds, until the key is released. However, + * there are keys which should not or do not need to be repeated. For + * example, repeating modifier keys such as Left/Right Shift or Caps Lock + * is not generally useful or desired. + * + * @returns 1 if the key should repeat, 0 otherwise. + * + * @memberof xkb_keymap + */ +XKB_EXPORT int +xkb_keymap_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t key); + +/** @} */ + +/** + * @defgroup state Keyboard State + * Creating, destroying and manipulating keyboard state objects. + * + * @{ + */ + +/** + * Create a new keyboard state object. + * + * @param keymap The keymap which the state will use. + * + * @returns A new keyboard state object, or `NULL` on failure. + * + * @memberof xkb_state + */ +XKB_EXPORT struct xkb_state * +xkb_state_new(struct xkb_keymap *keymap); + +/** + * Take a new reference on a keyboard state object. + * + * @returns The passed in object. + * + * @memberof xkb_state + */ +XKB_EXPORT struct xkb_state * +xkb_state_ref(struct xkb_state *state); + +/** + * Release a reference on a keyboard state object, and possibly free it. + * + * @param state The state. If it is `NULL`, this function does nothing. + * + * @memberof xkb_state + */ +XKB_EXPORT void +xkb_state_unref(struct xkb_state *state); + +/** + * Get the keymap which a keyboard state object is using. + * + * @returns The keymap which was passed to `xkb_state_new()` when creating + * this state object. + * + * This function does not take a new reference on the keymap; you must + * explicitly reference it yourself if you plan to use it beyond the + * lifetime of the state. + * + * @memberof xkb_state + */ +XKB_EXPORT struct xkb_keymap * +xkb_state_get_keymap(struct xkb_state *state); + +/** + * @page server-client-state Server State and Client State + * @parblock + * + * The xkb_state API is used by two distinct actors in most window-system + * architectures: + * + * 1. A *server* - for example, a Wayland compositor, an X11 server, an evdev + * listener. + * + * Servers maintain the XKB state for a device according to input events from + * the device, such as key presses and releases, and out-of-band events from + * the user, like UI layout switchers. + * + * 2. A *client* - for example, a Wayland client, an X11 client. + * + * Clients do not listen to input from the device; instead, whenever the + * server state changes, the server serializes the state and notifies the + * clients that the state has changed; the clients then update the state + * from the serialization. + * + * Some entry points in the xkb_state API are only meant for servers and some + * are only meant for clients, and the two should generally not be mixed. + * + * @endparblock + */ + +/** Specifies the direction of the key (press / release). */ +enum xkb_key_direction { + XKB_KEY_UP, /**< The key was released. */ + XKB_KEY_DOWN /**< The key was pressed. */ +}; + +/** + * Modifier and layout types for state objects. This enum is bitmaskable, + * e.g. (`::XKB_STATE_MODS_DEPRESSED` | `::XKB_STATE_MODS_LATCHED`) is valid to + * exclude locked modifiers. + * + * In XKB, the `DEPRESSED` components are also known as *base*. + */ +enum xkb_state_component { + /** Depressed modifiers, i.e. a key is physically holding them. */ + XKB_STATE_MODS_DEPRESSED = (1 << 0), + /** Latched modifiers, i.e. will be unset after the next non-modifier + * key press. */ + XKB_STATE_MODS_LATCHED = (1 << 1), + /** Locked modifiers, i.e. will be unset after the key provoking the + * lock has been pressed again. */ + XKB_STATE_MODS_LOCKED = (1 << 2), + /** Effective modifiers, i.e. currently active and affect key + * processing (derived from the other state components). + * Use this unless you explicitly care how the state came about. */ + XKB_STATE_MODS_EFFECTIVE = (1 << 3), + /** Depressed layout, i.e. a key is physically holding it. */ + XKB_STATE_LAYOUT_DEPRESSED = (1 << 4), + /** Latched layout, i.e. will be unset after the next non-modifier + * key press. */ + XKB_STATE_LAYOUT_LATCHED = (1 << 5), + /** Locked layout, i.e. will be unset after the key provoking the lock + * has been pressed again. */ + XKB_STATE_LAYOUT_LOCKED = (1 << 6), + /** Effective layout, i.e. currently active and affects key processing + * (derived from the other state components). + * Use this unless you explicitly care how the state came about. */ + XKB_STATE_LAYOUT_EFFECTIVE = (1 << 7), + /** LEDs (derived from the other state components). */ + XKB_STATE_LEDS = (1 << 8) +}; + +/** + * Update the keyboard state to reflect a given key being pressed or + * released. + * + * This entry point is intended for *server* applications and should not be used + * by *client* applications; see @ref server-client-state for details. + * + * A series of calls to this function should be consistent; that is, a call + * with `::XKB_KEY_DOWN` for a key should be matched by an `::XKB_KEY_UP`; if a + * key is pressed twice, it should be released twice; etc. Otherwise (e.g. due + * to missed input events), situations like “stuck modifiers” may occur. + * + * This function is often used in conjunction with the function + * `xkb_state_key_get_syms()` (or `xkb_state_key_get_one_sym()`), for example, + * when handling a key event. In this case, you should prefer to get the + * keysyms *before* updating the key, such that the keysyms reported for + * the key event are not affected by the event itself. This is the + * conventional behavior. + * + * @returns A mask of state components that have changed as a result of + * the update. If nothing in the state has changed, returns 0. + * + * @memberof xkb_state + * + * @sa `xkb_state_update_mask()` + */ +XKB_EXPORT enum xkb_state_component +xkb_state_update_key(struct xkb_state *state, xkb_keycode_t key, + enum xkb_key_direction direction); + +/** + * Update the keyboard state to change the latched and locked state of + * the modifiers and layout. + * + * This entry point is intended for *server* applications and should not be used + * by *client* applications; see @ref server-client-state for details. + * + * Use this function to update the latched and locked state according to + * “out of band” (non-device) inputs, such as UI layout switchers. + * + * @par Layout out of range + * @parblock + * + * If the effective layout, after taking into account the depressed, latched and + * locked layout, is out of range (negative or greater than the maximum layout), + * it is brought into range. Currently, the layout is wrapped using integer + * modulus (with negative values wrapping from the end). The wrapping behavior + * may be made configurable in the future. + * + * @endparblock + * + * @param state The keyboard state object. + * @param affect_latched_mods + * @param latched_mods + * Modifiers to set as latched or unlatched. Only modifiers in + * @p affect_latched_mods are considered. + * @param affect_latched_layout + * @param latched_layout + * Layout to latch. Only considered if @p affect_latched_layout is true. + * Maybe be out of range (including negative) -- see note above. + * @param affect_locked_mods + * @param locked_mods + * Modifiers to set as locked or unlocked. Only modifiers in + * @p affect_locked_mods are considered. + * @param affect_locked_layout + * @param locked_layout + * Layout to lock. Only considered if @p affect_locked_layout is true. + * Maybe be out of range (including negative) -- see note above. + * + * @returns A mask of state components that have changed as a result of + * the update. If nothing in the state has changed, returns 0. + * + * @memberof xkb_state + * + * @sa xkb_state_update_mask() + */ +XKB_EXPORT enum xkb_state_component +xkb_state_update_latched_locked(struct xkb_state *state, + xkb_mod_mask_t affect_latched_mods, + xkb_mod_mask_t latched_mods, + bool affect_latched_layout, + int32_t latched_layout, + xkb_mod_mask_t affect_locked_mods, + xkb_mod_mask_t locked_mods, + bool affect_locked_layout, + int32_t locked_layout); + +/** + * Update a keyboard state from a set of explicit masks. + * + * This entry point is intended for *client* applications; see @ref + * server-client-state for details. *Server* applications should use + * `xkb_state_update_key()` instead. + * + * All parameters must always be passed, or the resulting state may be + * incoherent. + * + * @warning The serialization is lossy and will not survive round trips; it must + * only be used to feed client state objects, and must not be used to update the + * server state. + * + * @returns A mask of state components that have changed as a result of + * the update. If nothing in the state has changed, returns 0. + * + * @memberof xkb_state + * + * @sa `xkb_state_component` + * @sa `xkb_state_update_key()` + */ +XKB_EXPORT enum xkb_state_component +xkb_state_update_mask(struct xkb_state *state, + xkb_mod_mask_t depressed_mods, + xkb_mod_mask_t latched_mods, + xkb_mod_mask_t locked_mods, + xkb_layout_index_t depressed_layout, + xkb_layout_index_t latched_layout, + xkb_layout_index_t locked_layout); + +/** + * Get the keysyms obtained from pressing a particular key in a given + * keyboard state. + * + * Get the keysyms for a key according to the current active layout, + * modifiers and shift level for the key, as determined by a keyboard + * state. + * + * @param[in] state The keyboard state object. + * @param[in] key The keycode of the key. + * @param[out] syms_out An immutable array of keysyms corresponding the + * key in the given keyboard state. + * + * As an extension to XKB, this function can return more than one keysym. + * If you do not want to handle this case, you can use + * `xkb_state_key_get_one_sym()` for a simpler interface. + * + * @returns The number of keysyms in the syms_out array. If no keysyms + * are produced by the key in the given keyboard state, returns 0 and sets + * syms_out to `NULL`. + * + * This function performs Capitalization @ref keysym-transformations. + * + * @memberof xkb_state + * + * @since 1.9.0 This function now performs @ref keysym-transformations. + */ +XKB_EXPORT int +xkb_state_key_get_syms(struct xkb_state *state, xkb_keycode_t key, + const xkb_keysym_t **syms_out); + +/** + * Get the Unicode/UTF-8 string obtained from pressing a particular key + * in a given keyboard state. + * + * @param[in] state The keyboard state object. + * @param[in] key The keycode of the key. + * @param[out] buffer A buffer to write the string into. + * @param[in] size Size of the buffer. + * + * @warning If the buffer passed is too small, the string is truncated + * (though still `NULL`-terminated). + * + * @returns The number of bytes required for the string, excluding the + * `NULL` byte. If there is nothing to write, returns 0. + * + * You may check if truncation has occurred by comparing the return value + * with the size of @p buffer, similarly to the `snprintf(3)` function. + * You may safely pass `NULL` and 0 to @p buffer and @p size to find the + * required size (without the `NULL`-byte). + * + * This function performs Capitalization and Control @ref + * keysym-transformations. + * + * @memberof xkb_state + * @since 0.4.1 + */ +XKB_EXPORT int +xkb_state_key_get_utf8(struct xkb_state *state, xkb_keycode_t key, + char *buffer, size_t size); + +/** + * Get the Unicode/UTF-32 codepoint obtained from pressing a particular + * key in a a given keyboard state. + * + * @returns The UTF-32 representation for the key, if it consists of only + * a single codepoint. Otherwise, returns 0. + * + * This function performs Capitalization and Control @ref + * keysym-transformations. + * + * @memberof xkb_state + * @since 0.4.1 + */ +XKB_EXPORT uint32_t +xkb_state_key_get_utf32(struct xkb_state *state, xkb_keycode_t key); + +/** + * Get the single keysym obtained from pressing a particular key in a + * given keyboard state. + * + * This function is similar to `xkb_state_key_get_syms()`, but intended + * for users which cannot or do not want to handle the case where + * multiple keysyms are returned (in which case this function is + * preferred). + * + * @returns The keysym. If the key does not have exactly one keysym, + * returns `XKB_KEY_NoSymbol`. + * + * This function performs Capitalization @ref keysym-transformations. + * + * @sa xkb_state_key_get_syms() + * @memberof xkb_state + */ +XKB_EXPORT xkb_keysym_t +xkb_state_key_get_one_sym(struct xkb_state *state, xkb_keycode_t key); + +/** + * Get the effective layout index for a key in a given keyboard state. + * + * @returns The layout index for the key in the given keyboard state. If + * the given keycode is invalid, or if the key is not included in any + * layout at all, returns `::XKB_LAYOUT_INVALID`. + * + * @invariant If the returned layout is valid, the following always holds: + * @code + * xkb_state_key_get_layout(state, key) < xkb_keymap_num_layouts_for_key(keymap, key) + * @endcode + * + * @memberof xkb_state + */ +XKB_EXPORT xkb_layout_index_t +xkb_state_key_get_layout(struct xkb_state *state, xkb_keycode_t key); + +/** + * Get the effective shift level for a key in a given keyboard state and + * layout. + * + * @param state The keyboard state. + * @param key The keycode of the key. + * @param layout The layout for which to get the shift level. This must be + * smaller than: + * @code xkb_keymap_num_layouts_for_key(keymap, key) @endcode + * usually it would be: + * @code xkb_state_key_get_layout(state, key) @endcode + * + * @return The shift level index. If the key or layout are invalid, + * returns `::XKB_LEVEL_INVALID`. + * + * @invariant If the returned level is valid, the following always holds: + * @code + * xkb_state_key_get_level(state, key, layout) < xkb_keymap_num_levels_for_key(keymap, key, layout) + * @endcode + * + * @memberof xkb_state + */ +XKB_EXPORT xkb_level_index_t +xkb_state_key_get_level(struct xkb_state *state, xkb_keycode_t key, + xkb_layout_index_t layout); + +/** + * Match flags for `xkb_state::xkb_state_mod_indices_are_active()` and + * `xkb_state::xkb_state_mod_names_are_active()`, specifying the conditions for a + * successful match. `::XKB_STATE_MATCH_NON_EXCLUSIVE` is bitmaskable with + * the other modes. + */ +enum xkb_state_match { + /** Returns true if any of the modifiers are active. */ + XKB_STATE_MATCH_ANY = (1 << 0), + /** Returns true if all of the modifiers are active. */ + XKB_STATE_MATCH_ALL = (1 << 1), + /** Makes matching non-exclusive, i.e. will not return false if a + * modifier not specified in the arguments is active. */ + XKB_STATE_MATCH_NON_EXCLUSIVE = (1 << 16) +}; + +/** + * The counterpart to `xkb_state::xkb_state_update_mask()` for modifiers, to be + * used on the server side of serialization. + * + * This entry point is intended for *server* applications; see @ref + * server-client-state for details. *Client* applications should use the + * `xkb_state_mod_*_is_active` API. + * + * @param state The keyboard state. + * @param components A mask of the modifier state components to serialize. + * State components other than `XKB_STATE_MODS_*` are ignored. + * If `::XKB_STATE_MODS_EFFECTIVE` is included, all other state components are + * ignored. + * + * @returns A `xkb_mod_mask_t` representing the given components of the + * modifier state. + * + * @memberof xkb_state + */ +XKB_EXPORT xkb_mod_mask_t +xkb_state_serialize_mods(struct xkb_state *state, + enum xkb_state_component components); + +/** + * The counterpart to `xkb_state::xkb_state_update_mask()` for layouts, to be + * used on the server side of serialization. + * + * This entry point is intended for *server* applications; see @ref + * server-client-state for details. *Client* applications should use the + * xkb_state_layout_*_is_active API. + * + * @param state The keyboard state. + * @param components A mask of the layout state components to serialize. + * State components other than `XKB_STATE_LAYOUT_*` are ignored. + * If `::XKB_STATE_LAYOUT_EFFECTIVE` is included, all other state components are + * ignored. + * + * @returns A layout index representing the given components of the + * layout state. + * + * @memberof xkb_state + */ +XKB_EXPORT xkb_layout_index_t +xkb_state_serialize_layout(struct xkb_state *state, + enum xkb_state_component components); + +/** + * Test whether a modifier is active in a given keyboard state by name. + * + * @warning For [virtual modifiers], this function may *overmatch* in case + * there are virtual modifiers with overlapping mappings to [real modifiers]. + * + * @returns 1 if the modifier is active, 0 if it is not. If the modifier + * name does not exist in the keymap, returns -1. + * + * @memberof xkb_state + * + * @since 0.1.0: Works only with *real* modifiers + * @since 1.8.0: Works also with *virtual* modifiers + * + * [virtual modifiers]: @ref virtual-modifier-def + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT int +xkb_state_mod_name_is_active(struct xkb_state *state, const char *name, + enum xkb_state_component type); + +/** + * Test whether a set of modifiers are active in a given keyboard state by + * name. + * + * @warning For [virtual modifiers], this function may *overmatch* in case + * there are virtual modifiers with overlapping mappings to [real modifiers]. + * + * @param state The keyboard state. + * @param type The component of the state against which to match the + * given modifiers. + * @param match The manner by which to match the state against the + * given modifiers. + * @param ... The set of of modifier names to test, terminated by a NULL + * argument (sentinel). + * + * @returns 1 if the modifiers are active, 0 if they are not. If any of + * the modifier names do not exist in the keymap, returns -1. + * + * @memberof xkb_state + * + * @since 0.1.0: Works only with *real* modifiers + * @since 1.8.0: Works also with *virtual* modifiers + * + * [virtual modifiers]: @ref virtual-modifier-def + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT int +xkb_state_mod_names_are_active(struct xkb_state *state, + enum xkb_state_component type, + enum xkb_state_match match, + ...); + +/** + * Test whether a modifier is active in a given keyboard state by index. + * + * @warning For [virtual modifiers], this function may *overmatch* in case + * there are virtual modifiers with overlapping mappings to [real modifiers]. + * + * @returns 1 if the modifier is active, 0 if it is not. If the modifier + * index is invalid in the keymap, returns -1. + * + * @memberof xkb_state + * + * @since 0.1.0: Works only with *real* modifiers + * @since 1.8.0: Works also with *virtual* modifiers + * + * [virtual modifiers]: @ref virtual-modifier-def + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT int +xkb_state_mod_index_is_active(struct xkb_state *state, xkb_mod_index_t idx, + enum xkb_state_component type); + +/** + * Test whether a set of modifiers are active in a given keyboard state by + * index. + * + * @warning For [virtual modifiers], this function may *overmatch* in case + * there are virtual modifiers with overlapping mappings to [real modifiers]. + * + * @param state The keyboard state. + * @param type The component of the state against which to match the + * given modifiers. + * @param match The manner by which to match the state against the + * given modifiers. + * @param ... The set of of modifier indices to test, terminated by a + * `::XKB_MOD_INVALID` argument (sentinel). + * + * @returns 1 if the modifiers are active, 0 if they are not. If any of + * the modifier indices are invalid in the keymap, returns -1. + * + * @memberof xkb_state + * + * @since 0.1.0: Works only with *real* modifiers + * @since 1.8.0: Works also with *virtual* modifiers + * + * [virtual modifiers]: @ref virtual-modifier-def + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT int +xkb_state_mod_indices_are_active(struct xkb_state *state, + enum xkb_state_component type, + enum xkb_state_match match, + ...); + +/** + * @page consumed-modifiers Consumed Modifiers + * @parblock + * + * Some functions, like `xkb_state::xkb_state_key_get_syms()`, look at the state + * of the modifiers in the keymap and derive from it the correct shift level + * to use for the key. For example, in a US layout, pressing the key + * labeled `
` while the Shift modifier is active, generates the keysym + * `A`. In this case, the Shift modifier is said to be *consumed*. + * However, the Num Lock modifier does not affect this translation at all, + * even if it is active, so it is not consumed by this translation. + * + * It may be desirable for some application to not reuse consumed modifiers + * for further processing, e.g. for hotkeys or keyboard shortcuts. To + * understand why, consider some requirements from a standard shortcut + * mechanism, and how they are implemented: + * + * 1. The shortcut’s modifiers must match exactly to the state. For + * example, it is possible to bind separate actions to `` + * and to ``. Further, if only `` is + * bound to an action, pressing `` should not + * trigger the shortcut. + * Effectively, this means that the modifiers are compared using the + * equality operator (`==`). + * + * 2. Only relevant modifiers are considered for the matching. For example, + * Caps Lock and Num Lock should not generally affect the matching, e.g. + * when matching `` against the state, it does not matter + * whether Num Lock is active or not. These relevant, or *significant*, + * modifiers usually include Alt, Control, Shift, Super and similar. + * Effectively, this means that non-significant modifiers are masked out, + * before doing the comparison as described above. + * + * 3. The matching must be independent of the layout/keymap. For example, + * the `` (+) symbol is found on the first level on some layouts, + * but requires holding Shift on others. If you simply bind the action + * to the `` keysym, it would work for the unshifted kind, but + * not for the others, because the match against Shift would fail. If + * you bind the action to ``, only the shifted kind would + * work. So what is needed is to recognize that Shift is used up in the + * translation of the keysym itself, and therefore should not be included + * in the matching. + * Effectively, this means that consumed modifiers (Shift in this example) + * are masked out as well, before doing the comparison. + * + * In summary, this is approximately how the matching would be performed: + * + * ```c + * (keysym == shortcut_keysym) && + * ((state_mods & ~consumed_mods & significant_mods) == shortcut_mods) + * ``` + * + * @c state_mods are the modifiers reported by + * `xkb_state::xkb_state_mod_index_is_active()` and similar functions. + * @c consumed_mods are the modifiers reported by + * `xkb_state::xkb_state_mod_index_is_consumed()` and similar functions. + * @c significant_mods are decided upon by the application/toolkit/user; + * it is up to them to decide whether these are configurable or hard-coded. + * + * @endparblock + */ + +/** + * Consumed modifiers mode. + * + * There are several possible methods for deciding which modifiers are + * consumed and which are not, each applicable for different systems or + * situations. The mode selects the method to use. + * + * Keep in mind that in all methods, the keymap may decide to *preserve* + * a modifier, meaning it is not reported as consumed even if it would + * have otherwise. + */ +enum xkb_consumed_mode { + /** + * This is the mode defined in the XKB specification and used by libX11. + * + * A modifier is consumed if and only if it *may affect* key translation. + * + * For example, if `Control+Alt+` produces some assigned keysym, + * then when pressing just ``, `Control` and `Alt` are consumed, + * even though they are not active, since if they *were* active they would + * have affected key translation. + */ + XKB_CONSUMED_MODE_XKB, + /** + * This is the mode used by the GTK+ toolkit. + * + * The mode consists of the following two independent heuristics: + * + * - The currently active set of modifiers, excluding modifiers which do + * not affect the key (as described for @ref XKB_CONSUMED_MODE_XKB), are + * considered consumed, if the keysyms produced when all of them are + * active are different from the keysyms produced when no modifiers are + * active. + * + * - A single modifier is considered consumed if the keysyms produced for + * the key when it is the only active modifier are different from the + * keysyms produced when no modifiers are active. + */ + XKB_CONSUMED_MODE_GTK +}; + +/** + * Get the mask of modifiers consumed by translating a given key. + * + * @param state The keyboard state. + * @param key The keycode of the key. + * @param mode The consumed modifiers mode to use; see enum description. + * + * @returns a mask of the consumed [real modifiers] modifiers. + * + * @memberof xkb_state + * @since 0.7.0 + * + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT xkb_mod_mask_t +xkb_state_key_get_consumed_mods2(struct xkb_state *state, xkb_keycode_t key, + enum xkb_consumed_mode mode); + +/** + * Same as `xkb_state_key_get_consumed_mods2()` with mode `::XKB_CONSUMED_MODE_XKB`. + * + * @memberof xkb_state + * @since 0.4.1 + */ +XKB_EXPORT xkb_mod_mask_t +xkb_state_key_get_consumed_mods(struct xkb_state *state, xkb_keycode_t key); + +/** + * Test whether a modifier is consumed by keyboard state translation for + * a key. + * + * @warning For [virtual modifiers], this function may *overmatch* in case + * there are virtual modifiers with overlapping mappings to [real modifiers]. + * + * @param state The keyboard state. + * @param key The keycode of the key. + * @param idx The index of the modifier to check. + * @param mode The consumed modifiers mode to use; see enum description. + * + * @returns 1 if the modifier is consumed, 0 if it is not. If the modifier + * index is not valid in the keymap, returns -1. + * + * @sa xkb_state_mod_mask_remove_consumed() + * @sa xkb_state_key_get_consumed_mods() + * @memberof xkb_state + * @since 0.7.0: Works only with *real* modifiers + * @since 1.8.0: Works also with *virtual* modifiers + * + * [virtual modifiers]: @ref virtual-modifier-def + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT int +xkb_state_mod_index_is_consumed2(struct xkb_state *state, + xkb_keycode_t key, + xkb_mod_index_t idx, + enum xkb_consumed_mode mode); + +/** + * Same as `xkb_state_mod_index_is_consumed2()` with mode `::XKB_CONSUMED_MOD_XKB`. + * + * @warning For [virtual modifiers], this function may *overmatch* in case + * there are virtual modifiers with overlapping mappings to [real modifiers]. + * + * @memberof xkb_state + * @since 0.4.1: Works only with *real* modifiers + * @since 1.8.0: Works also with *virtual* modifiers + * + * [virtual modifiers]: @ref virtual-modifier-def + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT int +xkb_state_mod_index_is_consumed(struct xkb_state *state, xkb_keycode_t key, + xkb_mod_index_t idx); + +/** + * Remove consumed modifiers from a modifier mask for a key. + * + * @deprecated Use `xkb_state_key_get_consumed_mods2()` instead. + * + * Takes the given modifier mask, and removes all modifiers which are + * consumed for that particular key (as in `xkb_state_mod_index_is_consumed()`). + * + * @returns a mask of [real modifiers] modifiers. + * + * @sa xkb_state_mod_index_is_consumed() + * @memberof xkb_state + * @since 0.5.0: Works only with *real* modifiers + * @since 1.8.0: Works also with *virtual* modifiers + * + * [real modifiers]: @ref real-modifier-def + */ +XKB_EXPORT xkb_mod_mask_t +xkb_state_mod_mask_remove_consumed(struct xkb_state *state, xkb_keycode_t key, + xkb_mod_mask_t mask); + +/** + * Test whether a layout is active in a given keyboard state by name. + * + * @returns 1 if the layout is active, 0 if it is not. If no layout with + * this name exists in the keymap, return -1. + * + * If multiple layouts in the keymap have this name, the one with the lowest + * index is tested. + * + * @sa xkb_layout_index_t + * @memberof xkb_state + */ +XKB_EXPORT int +xkb_state_layout_name_is_active(struct xkb_state *state, const char *name, + enum xkb_state_component type); + +/** + * Test whether a layout is active in a given keyboard state by index. + * + * @returns 1 if the layout is active, 0 if it is not. If the layout index + * is not valid in the keymap, returns -1. + * + * @sa xkb_layout_index_t + * @memberof xkb_state + */ +XKB_EXPORT int +xkb_state_layout_index_is_active(struct xkb_state *state, + xkb_layout_index_t idx, + enum xkb_state_component type); + +/** + * Test whether a LED is active in a given keyboard state by name. + * + * @returns 1 if the LED is active, 0 if it not. If no LED with this name + * exists in the keymap, returns -1. + * + * @sa xkb_led_index_t + * @memberof xkb_state + */ +XKB_EXPORT int +xkb_state_led_name_is_active(struct xkb_state *state, const char *name); + +/** + * Test whether a LED is active in a given keyboard state by index. + * + * @returns 1 if the LED is active, 0 if it not. If the LED index is not + * valid in the keymap, returns -1. + * + * @sa xkb_led_index_t + * @memberof xkb_state + */ +XKB_EXPORT int +xkb_state_led_index_is_active(struct xkb_state *state, xkb_led_index_t idx); + +/** @} */ + +/* Leave this include last, so it can pick up our types, etc. */ +#include + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _XKBCOMMON_H_ */ diff --git a/data/miniconda3/include/xkbcommon/xkbregistry.h b/data/miniconda3/include/xkbcommon/xkbregistry.h new file mode 100644 index 0000000000000000000000000000000000000000..91b45c7a6ac6ea6e1dd0f70b3aab42587aa306ab --- /dev/null +++ b/data/miniconda3/include/xkbcommon/xkbregistry.h @@ -0,0 +1,792 @@ +/* + * Copyright © 2020 Red Hat, Inc. + * SPDX-License-Identifier: MIT + */ + +#ifndef _XKBREGISTRY_H_ +#define _XKBREGISTRY_H_ + +#include +#include + +/** + * @file + * @brief Query for available RMLVO + * + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(__GNUC__) && !defined(__CYGWIN__) +# define RXKB_EXPORT __attribute__((visibility("default"))) +#elif defined(_WIN32) +# define RXKB_EXPORT __declspec(dllexport) +#else +# define RXKB_EXPORT +#endif + +/** + * @defgroup registry Query for available RMLVO + * + * The libxkbregistry API to query for available rules, models, layouts, + * variants and options (RMLVO). libxkbregistry is a separate library to + * libxkbcommon. + * + * This library is the replacement for clients currently parsing evdev.xml + * directly. The library is intended to provide easy access to the set of + * **possible** MLVO configurations for a given ruleset. It is not a library to + * apply these configurations, merely to enumerate them. The intended users of + * this library are the configuration UIs that allow a user to select their + * keyboard layout of choice. + * + * @{ + */ + +/** + * @struct rxkb_context + * + * Opaque top level library context object. + * + * The context contains general library state, like include paths and parsed + * data. Objects are created in a specific context, and multiple contexts + * may coexist simultaneously. Objects from different contexts are + * completely separated and do not share any memory or state. + */ +struct rxkb_context; + +/** + * @struct rxkb_model + * + * Opaque struct representing an XKB model. + */ +struct rxkb_model; + +/** + * @struct rxkb_layout + * + * Opaque struct representing an XKB layout, including an optional variant. + * Where the variant is `NULL`, the layout is the base layout. + * + * For example, `us` is the base layout, `us(intl)` is the `intl` variant of the + * layout `us`. + */ +struct rxkb_layout; + +/** + * @struct rxkb_option_group + * + * Opaque struct representing an option group. Option groups divide the + * individual options into logical groups. Their main purpose is to indicate + * whether some options are mutually exclusive or not. + */ +struct rxkb_option_group; + +/** + * @struct rxkb_option + * + * Opaque struct representing an XKB option. Options are grouped inside an @ref + * rxkb_option_group. + */ +struct rxkb_option; + +/** + * + * @struct rxkb_iso639_code + * + * Opaque struct representing an ISO 639-3 code (e.g. `eng`, `fra`). There + * is no guarantee that two identical ISO codes share the same struct. You + * must not rely on the pointer value of this struct. + * + * See https://iso639-3.sil.org/code_tables/639/data for a list of codes. + */ +struct rxkb_iso639_code; + +/** + * + * @struct rxkb_iso3166_code + * + * Opaque struct representing an ISO 3166 Alpha 2 code (e.g. `US`, `FR`). + * There is no guarantee that two identical ISO codes share the same struct. + * You must not rely on the pointer value of this struct. + * + * See https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes for a list + * of codes. + */ +struct rxkb_iso3166_code; + +/** + * Describes the popularity of an item. Historically, some highly specialized or + * experimental definitions are excluded from the default list and shipped in + * separate files. If these extra definitions are loaded (see @ref + * RXKB_CONTEXT_LOAD_EXOTIC_RULES), the popularity of the item is set + * accordingly. + * + * If the exotic items are not loaded, all items will have the standard + * popularity. + */ +enum rxkb_popularity { + RXKB_POPULARITY_STANDARD = 1, + RXKB_POPULARITY_EXOTIC, +}; + +/** + * Flags for context creation. + */ +enum rxkb_context_flags { + RXKB_CONTEXT_NO_FLAGS = 0, + /** + * Skip the default include paths. This requires the caller to call + * `rxkb_context_include_path_append()` or + * `rxkb_context_include_path_append_default()`. + */ + RXKB_CONTEXT_NO_DEFAULT_INCLUDES = (1 << 0), + /** + * Load the extra items that are considered too exotic for the default list. + * + * For historical reasons, xkeyboard-config ships those exotic rules in a + * separate file (e.g. `evdev.extras.xml`). Where the exotic rules are + * requested, libxkbregistry will look for and load `$ruleset.extras.xml` + * in the include paths, see `rxkb_context_include_path_append()` for + * details on the lookup behavior. + */ + RXKB_CONTEXT_LOAD_EXOTIC_RULES = (1 << 1), + /** + * Disable the use of `secure_getenv()` for this context, so that privileged + * processes can use environment variables. Client uses at their own risk. + * + * @since 1.5.0 + */ + RXKB_CONTEXT_NO_SECURE_GETENV = (1 << 2) +}; + +/** + * Create a new xkb registry context. + * + * The context has an initial refcount of 1. Use `rxkb_context_unref()` to + * release memory associated with this context. + * + * Creating a context does not parse the files yet, use + * `rxkb_context_parse()`. + * + * @param flags Flags affecting context behavior + * @return A new xkb registry context or `NULL` on failure + */ +RXKB_EXPORT struct rxkb_context * +rxkb_context_new(enum rxkb_context_flags flags); + +/** Specifies a logging level. */ +enum rxkb_log_level { + RXKB_LOG_LEVEL_CRITICAL = 10, /**< Log critical internal errors only. */ + RXKB_LOG_LEVEL_ERROR = 20, /**< Log all errors. */ + RXKB_LOG_LEVEL_WARNING = 30, /**< Log warnings and errors. */ + RXKB_LOG_LEVEL_INFO = 40, /**< Log information, warnings, and errors. */ + RXKB_LOG_LEVEL_DEBUG = 50 /**< Log everything. */ +}; + +/** + * Set the current logging level. + * + * @param ctx The context in which to set the logging level. + * @param level The logging level to use. Only messages from this level + * and below will be logged. + * + * The default level is `::RXKB_LOG_LEVEL_ERROR`. The environment variable + * `RXKB_LOG_LEVEL`, if set at the time the context was created, overrides the + * default value. It may be specified as a level number or name. + */ +RXKB_EXPORT void +rxkb_context_set_log_level(struct rxkb_context *ctx, + enum rxkb_log_level level); + +/** + * Get the current logging level. + */ +RXKB_EXPORT enum rxkb_log_level +rxkb_context_get_log_level(struct rxkb_context *ctx); + +/** + * Set a custom function to handle logging messages. + * + * @param ctx The context in which to use the set logging function. + * @param log_fn The function that will be called for logging messages. + * Passing `NULL` restores the default function, which logs to `stderr`. + * + * By default, log messages from this library are printed to stderr. This + * function allows you to replace the default behavior with a custom + * handler. The handler is only called with messages which match the + * current logging level and verbosity settings for the context. + * level is the logging level of the message. @a format and @a args are + * the same as in the `vprintf(3)` function. + * + * You may use `rxkb_context_set_user_data()` on the context, and then call + * `rxkb_context_get_user_data()` from within the logging function to provide + * it with additional private context. + */ +RXKB_EXPORT void +rxkb_context_set_log_fn(struct rxkb_context *ctx, + void (*log_fn)(struct rxkb_context *ctx, + enum rxkb_log_level level, + const char *format, va_list args)); + + +/** + * Parse the given ruleset. This can only be called once per context and once + * parsed the data in the context is considered constant and will never + * change. + * + * This function parses all files with the given ruleset name. See + * rxkb_context_include_path_append() for details. + * + * If this function returns false, libxkbregistry failed to parse the xml files. + * This is usually caused by invalid files on the host and should be debugged by + * the host’s administrator using external tools. Callers should reduce the + * include paths to known good paths and/or fall back to a default RMLVO set. + * + * If this function returns false, the context should be be considered dead and + * must be released with `rxkb_context_unref()`. + * + * @param ctx The xkb registry context + * @param ruleset The ruleset to parse, e.g. `evdev` + * @return `true` on success or `false` on failure + */ +RXKB_EXPORT bool +rxkb_context_parse(struct rxkb_context *ctx, const char *ruleset); + +/** + * Parse the default ruleset as configured at build time. See + * `rxkb_context_parse()` for details. + */ +RXKB_EXPORT bool +rxkb_context_parse_default_ruleset(struct rxkb_context *ctx); + +/** + * Increases the refcount of this object by one and returns the object. + * + * @param ctx The xkb registry context + * @return The passed in object + */ +RXKB_EXPORT struct rxkb_context* +rxkb_context_ref(struct rxkb_context *ctx); + +/** + * Decreases the refcount of this object by one. Where the refcount of an + * object hits zero, associated resources will be freed. + * + * @param ctx The xkb registry context + * @return always `NULL` + */ +RXKB_EXPORT struct rxkb_context* +rxkb_context_unref(struct rxkb_context *ctx); + +/** + * Assign user-specific data. libxkbregistry will not look at or modify the + * data, it will merely return the same pointer in + * `rxkb_context_get_user_data()`. + * + * @param ctx The xkb registry context + * @param user_data User-specific data pointer + */ +RXKB_EXPORT void +rxkb_context_set_user_data(struct rxkb_context *ctx, void *user_data); + +/** + * Return the pointer passed into `rxkb_context_get_user_data()`. + * + * @param ctx The xkb registry context + * @return User-specific data pointer + */ +RXKB_EXPORT void * +rxkb_context_get_user_data(struct rxkb_context *ctx); + +/** + * Append a new entry to the context’s include path. + * + * The include path handling is optimized for the most common use-case: a set of + * system files that provide a complete set of MLVO and some + * custom MLVO provided by a user **in addition** to the system set. + * + * The include paths should be given so that the least complete path is + * specified first and the most complete path is appended last. For example: + * + * ```c + * ctx = rxkb_context_new(RXKB_CONTEXT_NO_DEFAULT_INCLUDES); + * rxkb_context_include_path_append(ctx, `/home/user/.config/xkb`); + * rxkb_context_include_path_append(ctx, `/usr/share/X11/xkb`); + * rxkb_context_parse(ctx, `evdev`); + * ``` + * + * The above example reflects the default behavior unless @ref + * RXKB_CONTEXT_NO_DEFAULT_INCLUDES is provided. + * + * Loading of the files is in **reverse order**, i.e. the last path appended is + * loaded first - in this case the ``/usr/share/X11/xkb`` path. + * Any models, layouts, variants and options defined in the `evdev` ruleset + * are loaded into the context. Then, any RMLVO found in the `evdev` ruleset of + * the user’s path (``/home/user/.config/xkb`` in this example) are **appended** + * to the existing set. + * + * Note that data from previously loaded include paths is never overwritten, + * only appended to. It is not not possible to change the system-provided data, + * only to append new models, layouts, variants and options to it. + * + * In other words, to define a new variant of the `us` layout called `banana`, + * the following XML is sufficient. + * + * ```xml + * + * + * + * + * us + * + * + * + * + * banana + * English (Banana) + * + * + * + * + * + * ``` + * + * The list of models, options and all other layouts (including `us` and its + * variants) is taken from the system files. The resulting list of layouts will + * thus have a `us` keyboard layout with the variant `banana` and all other + * system-provided variants (`dvorak`, `colemak`, `intl`, etc.) + * + * This function must be called before `rxkb_context_parse()` or + * `rxkb_context_parse_default_ruleset()`. + * + * @returns `true` on success, or `false` if the include path could not be added + * or is inaccessible. + */ +RXKB_EXPORT bool +rxkb_context_include_path_append(struct rxkb_context *ctx, const char *path); + +/** + * Append the default include paths to the context’s include path. + * See `rxkb_context_include_path_append()` for details about the merge order. + * + * This function must be called before `rxkb_context_parse()` or + * `rxkb_context_parse_default_ruleset()`. + * + * @returns `true` on success, or `false` if the include path could not be added + * or is inaccessible. + */ +RXKB_EXPORT bool +rxkb_context_include_path_append_default(struct rxkb_context *ctx); + +/** + * Return the first model for this context. Use this to start iterating over + * the models, followed by calls to `rxkb_model_next()`. Models are not sorted. + * + * The refcount of the returned model is not increased. Use `rxkb_model_ref()` + * if you need to keep this struct outside the immediate scope. + * + * @return The first model in the model list. + */ +RXKB_EXPORT struct rxkb_model * +rxkb_model_first(struct rxkb_context *ctx); + +/** + * Return the next model for this context. Returns `NULL` when no more models + * are available. + * + * The refcount of the returned model is not increased. Use `rxkb_model_ref()` + * if you need to keep this struct outside the immediate scope. + * + * @return the next model or `NULL` at the end of the list + */ +RXKB_EXPORT struct rxkb_model * +rxkb_model_next(struct rxkb_model *m); + +/** + * Increase the refcount of the argument by one. + * + * @returns The argument passed in to this function. + */ +RXKB_EXPORT struct rxkb_model * +rxkb_model_ref(struct rxkb_model *m); + +/** + * Decrease the refcount of the argument by one. When the refcount hits zero, + * all memory associated with this struct is freed. + * + * @returns always `NULL` + */ +RXKB_EXPORT struct rxkb_model * +rxkb_model_unref(struct rxkb_model *m); + +/** + * Return the name of this model. This is the value for M in RMLVO, to be used + * with libxkbcommon. + */ +RXKB_EXPORT const char * +rxkb_model_get_name(struct rxkb_model *m); + +/** + * Return a human-readable description of this model. This function may return + * `NULL`. + */ +RXKB_EXPORT const char * +rxkb_model_get_description(struct rxkb_model *m); + +/** + * Return the vendor name for this model. This function may return `NULL`. + */ +RXKB_EXPORT const char * +rxkb_model_get_vendor(struct rxkb_model *m); + +/** + * Return the popularity for this model. + */ +RXKB_EXPORT enum rxkb_popularity +rxkb_model_get_popularity(struct rxkb_model *m); + +/** + * Return the first layout for this context. Use this to start iterating over + * the layouts, followed by calls to `rxkb_layout_next()`. + * + * @note Layouts are not sorted. + * + * The refcount of the returned layout is not increased. + * Use `rxkb_layout_ref()` if you need to keep this struct outside the immediate + * scope. + * + * @return The first layout in the layout list. + */ +RXKB_EXPORT struct rxkb_layout * +rxkb_layout_first(struct rxkb_context *ctx); + +/** + * Return the next layout for this context. Returns `NULL` when no more layouts + * are available. + * + * The refcount of the returned layout is not increased. Use `rxkb_layout_ref()` + * if you need to keep this struct outside the immediate scope. + * + * @return the next layout or `NULL` at the end of the list + */ +RXKB_EXPORT struct rxkb_layout * +rxkb_layout_next(struct rxkb_layout *l); + +/** + * Increase the refcount of the argument by one. + * + * @returns The argument passed in to this function. + */ +RXKB_EXPORT struct rxkb_layout * +rxkb_layout_ref(struct rxkb_layout *l); + +/** + * Decrease the refcount of the argument by one. When the refcount hits zero, + * all memory associated with this struct is freed. + * + * @returns always `NULL` + */ +RXKB_EXPORT struct rxkb_layout * +rxkb_layout_unref(struct rxkb_layout *l); + +/** + * Return the name of this layout. This is the value for L in RMLVO, to be used + * with libxkbcommon. + */ +RXKB_EXPORT const char * +rxkb_layout_get_name(struct rxkb_layout *l); + +/** + * Return the variant of this layout. This is the value for V in RMLVO, to be + * used with libxkbcommon. + * + * A variant does not stand on its own, it always depends on the base layout. + * e.g. there may be multiple variants called `intl` but there is only one + * `us(intl)`. + * + * Where the variant is `NULL`, the layout is the base layout (e.g. `us`). + */ +RXKB_EXPORT const char * +rxkb_layout_get_variant(struct rxkb_layout *l); + +/** + * Return a short (one-word) description of this layout. This function may + * return `NULL`. + */ +RXKB_EXPORT const char * +rxkb_layout_get_brief(struct rxkb_layout *l); + +/** + * Return a human-readable description of this layout. This function may return + * `NULL`. + */ +RXKB_EXPORT const char * +rxkb_layout_get_description(struct rxkb_layout *l); + +/** + * Return the popularity for this layout. + */ +RXKB_EXPORT enum rxkb_popularity +rxkb_layout_get_popularity(struct rxkb_layout *l); + +/** + * Return the first option group for this context. Use this to start iterating + * over the option groups, followed by calls to `rxkb_option_group_next()`. + * Option groups are not sorted. + * + * The refcount of the returned option group is not increased. Use + * `rxkb_option_group_ref()` if you need to keep this struct outside the immediate + * scope. + * + * @return The first option group in the option group list. + */ +RXKB_EXPORT struct rxkb_option_group * +rxkb_option_group_first(struct rxkb_context *ctx); + +/** + * Return the next option group for this context. Returns `NULL` when no more + * option groups are available. + * + * The refcount of the returned option group is not increased. Use + * `rxkb_option_group_ref()` if you need to keep this struct outside the immediate + * scope. + * + * @return the next option group or `NULL` at the end of the list + */ +RXKB_EXPORT struct rxkb_option_group * +rxkb_option_group_next(struct rxkb_option_group *g); + +/** + * Increase the refcount of the argument by one. + * + * @returns The argument passed in to this function. + */ +RXKB_EXPORT struct rxkb_option_group * +rxkb_option_group_ref(struct rxkb_option_group *g); + +/** + * Decrease the refcount of the argument by one. When the refcount hits zero, + * all memory associated with this struct is freed. + * + * @returns always `NULL` + */ +RXKB_EXPORT struct rxkb_option_group * +rxkb_option_group_unref(struct rxkb_option_group *g); + +/** + * Return the name of this option group. This is **not** the value for O in + * RMLVO, the name can be used for internal sorting in the caller. This function + * may return `NULL`. + */ +RXKB_EXPORT const char * +rxkb_option_group_get_name(struct rxkb_option_group *m); + +/** + * Return a human-readable description of this option group. This function may + * return `NULL`. + */ +RXKB_EXPORT const char * +rxkb_option_group_get_description(struct rxkb_option_group *m); + +/** + * @return `true` if multiple options within this option group can be selected + * simultaneously, `false` if all options within this option + * group are mutually exclusive. + */ +RXKB_EXPORT bool +rxkb_option_group_allows_multiple(struct rxkb_option_group *g); + +/** + * Return the popularity for this option group. + */ +RXKB_EXPORT enum rxkb_popularity +rxkb_option_group_get_popularity(struct rxkb_option_group *g); + +/** + * Return the first option for this option group. Use this to start iterating + * over the options, followed by calls to `rxkb_option_next()`. Options are not + * sorted. + * + * The refcount of the returned option is not increased. Use `rxkb_option_ref()` + * if you need to keep this struct outside the immediate scope. + * + * @return The first option in the option list. + */ +RXKB_EXPORT struct rxkb_option * +rxkb_option_first(struct rxkb_option_group *group); + +/** + * Return the next option for this option group. Returns `NULL` when no more + * options are available. + * + * The refcount of the returned options is not increased. Use `rxkb_option_ref()` + * if you need to keep this struct outside the immediate scope. + * + * @returns The next option or `NULL` at the end of the list + */ +RXKB_EXPORT struct rxkb_option * +rxkb_option_next(struct rxkb_option *o); + +/** + * Increase the refcount of the argument by one. + * + * @returns The argument passed in to this function. + */ +RXKB_EXPORT struct rxkb_option * +rxkb_option_ref(struct rxkb_option *o); + +/** + * Decrease the refcount of the argument by one. When the refcount hits zero, + * all memory associated with this struct is freed. + * + * @returns always `NULL` + */ +RXKB_EXPORT struct rxkb_option * +rxkb_option_unref(struct rxkb_option *o); + +/** + * Return the name of this option. This is the value for O in RMLVO, to be used + * with libxkbcommon. + */ +RXKB_EXPORT const char * +rxkb_option_get_name(struct rxkb_option *o); + +/** + * Return a short (one-word) description of this option. This function may + * return `NULL`. + */ +RXKB_EXPORT const char * +rxkb_option_get_brief(struct rxkb_option *o); + +/** + * Return a human-readable description of this option. This function may return + * `NULL`. + */ +RXKB_EXPORT const char * +rxkb_option_get_description(struct rxkb_option *o); + +/** + * Return the popularity for this option. + */ +RXKB_EXPORT enum rxkb_popularity +rxkb_option_get_popularity(struct rxkb_option *o); + +/** + * Return `true` if the given option accepts layout index specifiers to restrict + * its application to the corresponding layouts, `false` otherwise. + * + * @sa `xkb_rmlvo_builder::xkb_rmlvo_builder_append_layout()` + * @sa `xkb_rule_names::options` + */ +RXKB_EXPORT bool +rxkb_option_is_layout_specific(struct rxkb_option *o); + +/** + * Increase the refcount of the argument by one. + * + * @returns The argument passed in to this function. + */ +RXKB_EXPORT struct rxkb_iso639_code * +rxkb_iso639_code_ref(struct rxkb_iso639_code *iso639); + +/** + * Decrease the refcount of the argument by one. When the refcount hits zero, + * all memory associated with this struct is freed. + * + * @returns always `NULL` + */ +RXKB_EXPORT struct rxkb_iso639_code * +rxkb_iso639_code_unref(struct rxkb_iso639_code *iso639); + +/** + * Return the ISO 639-3 code for this code. E.g. `eng`, `fra`. + */ +RXKB_EXPORT const char * +rxkb_iso639_code_get_code(struct rxkb_iso639_code *iso639); + +/** + * Return the first ISO 639 for this layout. Use this to start iterating over + * the codes, followed by calls to `rxkb_iso639_code_next()`. Codes are not + * sorted. + * + * The refcount of the returned code is not increased. + * Use `rxkb_iso639_code_ref()` if you need to keep this struct outside the + * immediate scope. + * + * @return The first code in the code list. + */ +RXKB_EXPORT struct rxkb_iso639_code * +rxkb_layout_get_iso639_first(struct rxkb_layout *layout); + +/** + * Return the next code in the list. Returns `NULL` when no more codes + * are available. + * + * The refcount of the returned codes is not increased. + * Use `rxkb_iso639_code_ref()` if you need to keep this struct outside the + * immediate scope. + * + * @returns The next code or `NULL` at the end of the list + */ +RXKB_EXPORT struct rxkb_iso639_code * +rxkb_iso639_code_next(struct rxkb_iso639_code *iso639); + +/** + * Increase the refcount of the argument by one. + * + * @returns The argument passed in to this function. + */ +RXKB_EXPORT struct rxkb_iso3166_code * +rxkb_iso3166_code_ref(struct rxkb_iso3166_code *iso3166); + +/** + * Decrease the refcount of the argument by one. When the refcount hits zero, + * all memory associated with this struct is freed. + * + * @returns always `NULL` + */ +RXKB_EXPORT struct rxkb_iso3166_code * +rxkb_iso3166_code_unref(struct rxkb_iso3166_code *iso3166); + +/** + * Return the ISO 3166 Alpha 2 code for this code (e.g. `US`, `FR`). + */ +RXKB_EXPORT const char * +rxkb_iso3166_code_get_code(struct rxkb_iso3166_code *iso3166); + +/** + * Return the first ISO 3166 for this layout. Use this to start iterating over + * the codes, followed by calls to `rxkb_iso3166_code_next()`. Codes are not + * sorted. + * + * The refcount of the returned code is not increased. Use + * `rxkb_iso3166_code_ref()` if you need to keep this struct outside the immediate + * scope. + * + * @return The first code in the code list. + */ +RXKB_EXPORT struct rxkb_iso3166_code * +rxkb_layout_get_iso3166_first(struct rxkb_layout *layout); + +/** + * Return the next code in the list. Returns `NULL` when no more codes + * are available. + * + * The refcount of the returned codes is not increased. Use + * `rxkb_iso3166_code_ref()` if you need to keep this struct outside the immediate + * scope. + * + * @returns The next code or `NULL` at the end of the list + */ +RXKB_EXPORT struct rxkb_iso3166_code * +rxkb_iso3166_code_next(struct rxkb_iso3166_code *iso3166); + +/** @} */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _XKBREGISTRY_H_ */ diff --git a/data/miniconda3/include/yaml-cpp/anchor.h b/data/miniconda3/include/yaml-cpp/anchor.h new file mode 100644 index 0000000000000000000000000000000000000000..f46d1d79dd8a1478b4055dc1b572c14c8c93ce9a --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/anchor.h @@ -0,0 +1,17 @@ +#ifndef ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include + +namespace YAML { +using anchor_t = std::size_t; +const anchor_t NullAnchor = 0; +} + +#endif // ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/binary.h b/data/miniconda3/include/yaml-cpp/binary.h new file mode 100644 index 0000000000000000000000000000000000000000..1050dae98c3cc9fe0b6261737895c24bf8518fde --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/binary.h @@ -0,0 +1,71 @@ +#ifndef BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include +#include + +#include "yaml-cpp/dll.h" + +namespace YAML { +YAML_CPP_API std::string EncodeBase64(const unsigned char *data, + std::size_t size); +YAML_CPP_API std::vector DecodeBase64(const std::string &input); + +class YAML_CPP_API Binary { + public: + Binary(const unsigned char *data_, std::size_t size_) + : m_data{}, m_unownedData(data_), m_unownedSize(size_) {} + Binary() : Binary(nullptr, 0) {} + Binary(const Binary &) = default; + Binary(Binary &&) = default; + Binary &operator=(const Binary &) = default; + Binary &operator=(Binary &&) = default; + + bool owned() const { return !m_unownedData; } + std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; } + const unsigned char *data() const { + return owned() ? &m_data[0] : m_unownedData; + } + + void swap(std::vector &rhs) { + if (m_unownedData) { + m_data.swap(rhs); + rhs.clear(); + rhs.resize(m_unownedSize); + std::copy(m_unownedData, m_unownedData + m_unownedSize, rhs.begin()); + m_unownedData = nullptr; + m_unownedSize = 0; + } else { + m_data.swap(rhs); + } + } + + bool operator==(const Binary &rhs) const { + const std::size_t s = size(); + if (s != rhs.size()) + return false; + const unsigned char *d1 = data(); + const unsigned char *d2 = rhs.data(); + for (std::size_t i = 0; i < s; i++) { + if (*d1++ != *d2++) + return false; + } + return true; + } + + bool operator!=(const Binary &rhs) const { return !(*this == rhs); } + + private: + std::vector m_data; + const unsigned char *m_unownedData; + std::size_t m_unownedSize; +}; +} // namespace YAML + +#endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/depthguard.h b/data/miniconda3/include/yaml-cpp/depthguard.h new file mode 100644 index 0000000000000000000000000000000000000000..8ca61ac6ccc175fc557d3e3a203ed72fe0387b9e --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/depthguard.h @@ -0,0 +1,77 @@ +#ifndef DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000 +#define DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include "exceptions.h" + +namespace YAML { + +/** + * @brief The DeepRecursion class + * An exception class which is thrown by DepthGuard. Ideally it should be + * a member of DepthGuard. However, DepthGuard is a templated class which means + * that any catch points would then need to know the template parameters. It is + * simpler for clients to not have to know at the catch point what was the + * maximum depth. + */ +class DeepRecursion : public ParserException { +public: + virtual ~DeepRecursion() = default; + + DeepRecursion(int depth, const Mark& mark_, const std::string& msg_); + + // Returns the recursion depth when the exception was thrown + int depth() const { + return m_depth; + } + +private: + int m_depth = 0; +}; + +/** + * @brief The DepthGuard class + * DepthGuard takes a reference to an integer. It increments the integer upon + * construction of DepthGuard and decrements the integer upon destruction. + * + * If the integer would be incremented past max_depth, then an exception is + * thrown. This is ideally geared toward guarding against deep recursion. + * + * @param max_depth + * compile-time configurable maximum depth. + */ +template +class DepthGuard final { +public: + DepthGuard(int & depth_, const Mark& mark_, const std::string& msg_) : m_depth(depth_) { + ++m_depth; + if ( max_depth <= m_depth ) { + throw DeepRecursion{m_depth, mark_, msg_}; + } + } + + DepthGuard(const DepthGuard & copy_ctor) = delete; + DepthGuard(DepthGuard && move_ctor) = delete; + DepthGuard & operator=(const DepthGuard & copy_assign) = delete; + DepthGuard & operator=(DepthGuard && move_assign) = delete; + + ~DepthGuard() { + --m_depth; + } + + int current_depth() const { + return m_depth; + } + +private: + int & m_depth; +}; + +} // namespace YAML + +#endif // DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000 diff --git a/data/miniconda3/include/yaml-cpp/dll.h b/data/miniconda3/include/yaml-cpp/dll.h new file mode 100644 index 0000000000000000000000000000000000000000..eabdda1d95cb07617292c7e2afb4cff44a965878 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/dll.h @@ -0,0 +1,61 @@ +#ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +// Definition YAML_CPP_STATIC_DEFINE using to building YAML-CPP as static +// library (definition created by CMake or defined manually) + +// Definition yaml_cpp_EXPORTS using to building YAML-CPP as dll/so library +// (definition created by CMake or defined manually) + +#ifdef YAML_CPP_STATIC_DEFINE +# define YAML_CPP_API +# define YAML_CPP_NO_EXPORT +#else +# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) +# ifndef YAML_CPP_API +# ifdef yaml_cpp_EXPORTS + /* We are building this library */ +# pragma message( "Defining YAML_CPP_API for DLL export" ) +# define YAML_CPP_API __declspec(dllexport) +# else + /* We are using this library */ +# pragma message( "Defining YAML_CPP_API for DLL import" ) +# define YAML_CPP_API __declspec(dllimport) +# endif +# endif +# ifndef YAML_CPP_NO_EXPORT +# define YAML_CPP_NO_EXPORT +# endif +# else /* No _MSC_VER */ +# ifndef YAML_CPP_API +# ifdef yaml_cpp_EXPORTS + /* We are building this library */ +# define YAML_CPP_API __attribute__((visibility("default"))) +# else + /* We are using this library */ +# define YAML_CPP_API __attribute__((visibility("default"))) +# endif +# endif +# ifndef YAML_CPP_NO_EXPORT +# define YAML_CPP_NO_EXPORT __attribute__((visibility("hidden"))) +# endif +# endif /* _MSC_VER */ +#endif /* YAML_CPP_STATIC_DEFINE */ + +#ifndef YAML_CPP_DEPRECATED +# ifdef _MSC_VER +# define YAML_CPP_DEPRECATED __declspec(deprecated) +# else +# define YAML_CPP_DEPRECATED __attribute__ ((__deprecated__)) +# endif +#endif + +#ifndef YAML_CPP_DEPRECATED_EXPORT +# define YAML_CPP_DEPRECATED_EXPORT YAML_CPP_API YAML_CPP_DEPRECATED +#endif + +#ifndef YAML_CPP_DEPRECATED_NO_EXPORT +# define YAML_CPP_DEPRECATED_NO_EXPORT YAML_CPP_NO_EXPORT YAML_CPP_DEPRECATED +#endif + +#endif /* DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 */ diff --git a/data/miniconda3/include/yaml-cpp/emitfromevents.h b/data/miniconda3/include/yaml-cpp/emitfromevents.h new file mode 100644 index 0000000000000000000000000000000000000000..1f389c5a138918a569263b40573515580c918ba4 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/emitfromevents.h @@ -0,0 +1,57 @@ +#ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include + +#include "yaml-cpp/anchor.h" +#include "yaml-cpp/emitterstyle.h" +#include "yaml-cpp/eventhandler.h" + +namespace YAML { +struct Mark; +} // namespace YAML + +namespace YAML { +class Emitter; + +class EmitFromEvents : public EventHandler { + public: + EmitFromEvents(Emitter& emitter); + + void OnDocumentStart(const Mark& mark) override; + void OnDocumentEnd() override; + + void OnNull(const Mark& mark, anchor_t anchor) override; + void OnAlias(const Mark& mark, anchor_t anchor) override; + void OnScalar(const Mark& mark, const std::string& tag, + anchor_t anchor, const std::string& value) override; + + void OnSequenceStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) override; + void OnSequenceEnd() override; + + void OnMapStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) override; + void OnMapEnd() override; + + private: + void BeginNode(); + void EmitProps(const std::string& tag, anchor_t anchor); + + private: + Emitter& m_emitter; + + struct State { + enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue }; + }; + std::stack m_stateStack; +}; +} + +#endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/emitter.h b/data/miniconda3/include/yaml-cpp/emitter.h new file mode 100644 index 0000000000000000000000000000000000000000..210b1ec974420eb955aff1680cf7e91588c4e2e2 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/emitter.h @@ -0,0 +1,281 @@ +#ifndef EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include "yaml-cpp/binary.h" +#include "yaml-cpp/dll.h" +#include "yaml-cpp/emitterdef.h" +#include "yaml-cpp/emittermanip.h" +#include "yaml-cpp/null.h" +#include "yaml-cpp/ostream_wrapper.h" + +namespace YAML { +class Binary; +struct _Null; +} // namespace YAML + +namespace YAML { +class EmitterState; + +class YAML_CPP_API Emitter { + public: + Emitter(); + explicit Emitter(std::ostream& stream); + Emitter(const Emitter&) = delete; + Emitter& operator=(const Emitter&) = delete; + ~Emitter(); + + // output + const char* c_str() const; + std::size_t size() const; + + // state checking + bool good() const; + const std::string GetLastError() const; + + // global setters + bool SetOutputCharset(EMITTER_MANIP value); + bool SetStringFormat(EMITTER_MANIP value); + bool SetBoolFormat(EMITTER_MANIP value); + bool SetNullFormat(EMITTER_MANIP value); + bool SetIntBase(EMITTER_MANIP value); + bool SetSeqFormat(EMITTER_MANIP value); + bool SetMapFormat(EMITTER_MANIP value); + bool SetIndent(std::size_t n); + bool SetPreCommentIndent(std::size_t n); + bool SetPostCommentIndent(std::size_t n); + bool SetFloatPrecision(std::size_t n); + bool SetDoublePrecision(std::size_t n); + void RestoreGlobalModifiedSettings(); + + // local setters + Emitter& SetLocalValue(EMITTER_MANIP value); + Emitter& SetLocalIndent(const _Indent& indent); + Emitter& SetLocalPrecision(const _Precision& precision); + + // overloads of write + Emitter& Write(const std::string& str); + Emitter& Write(bool b); + Emitter& Write(char ch); + Emitter& Write(const _Alias& alias); + Emitter& Write(const _Anchor& anchor); + Emitter& Write(const _Tag& tag); + Emitter& Write(const _Comment& comment); + Emitter& Write(const _Null& n); + Emitter& Write(const Binary& binary); + + template + Emitter& WriteIntegralType(T value); + + template + Emitter& WriteStreamable(T value); + + private: + template + void SetStreamablePrecision(std::stringstream&) {} + std::size_t GetFloatPrecision() const; + std::size_t GetDoublePrecision() const; + + void PrepareIntegralStream(std::stringstream& stream) const; + void StartedScalar(); + + private: + void EmitBeginDoc(); + void EmitEndDoc(); + void EmitBeginSeq(); + void EmitEndSeq(); + void EmitBeginMap(); + void EmitEndMap(); + void EmitNewline(); + void EmitKindTag(); + void EmitTag(bool verbatim, const _Tag& tag); + + void PrepareNode(EmitterNodeType::value child); + void PrepareTopNode(EmitterNodeType::value child); + void FlowSeqPrepareNode(EmitterNodeType::value child); + void BlockSeqPrepareNode(EmitterNodeType::value child); + + void FlowMapPrepareNode(EmitterNodeType::value child); + + void FlowMapPrepareLongKey(EmitterNodeType::value child); + void FlowMapPrepareLongKeyValue(EmitterNodeType::value child); + void FlowMapPrepareSimpleKey(EmitterNodeType::value child); + void FlowMapPrepareSimpleKeyValue(EmitterNodeType::value child); + + void BlockMapPrepareNode(EmitterNodeType::value child); + + void BlockMapPrepareLongKey(EmitterNodeType::value child); + void BlockMapPrepareLongKeyValue(EmitterNodeType::value child); + void BlockMapPrepareSimpleKey(EmitterNodeType::value child); + void BlockMapPrepareSimpleKeyValue(EmitterNodeType::value child); + + void SpaceOrIndentTo(bool requireSpace, std::size_t indent); + + const char* ComputeFullBoolName(bool b) const; + const char* ComputeNullName() const; + bool CanEmitNewline() const; + + private: + std::unique_ptr m_pState; + ostream_wrapper m_stream; +}; + +template +inline Emitter& Emitter::WriteIntegralType(T value) { + if (!good()) + return *this; + + PrepareNode(EmitterNodeType::Scalar); + + std::stringstream stream; + PrepareIntegralStream(stream); + stream << value; + m_stream << stream.str(); + + StartedScalar(); + + return *this; +} + +template +inline Emitter& Emitter::WriteStreamable(T value) { + if (!good()) + return *this; + + PrepareNode(EmitterNodeType::Scalar); + + std::stringstream stream; + SetStreamablePrecision(stream); + + bool special = false; + if (std::is_floating_point::value) { + if ((std::numeric_limits::has_quiet_NaN || + std::numeric_limits::has_signaling_NaN) && + std::isnan(value)) { + special = true; + stream << ".nan"; + } else if (std::numeric_limits::has_infinity && std::isinf(value)) { + special = true; + if (std::signbit(value)) { + stream << "-.inf"; + } else { + stream << ".inf"; + } + } + } + + if (!special) { + stream << value; + } + m_stream << stream.str(); + + StartedScalar(); + + return *this; +} + +template <> +inline void Emitter::SetStreamablePrecision(std::stringstream& stream) { + stream.precision(static_cast(GetFloatPrecision())); +} + +template <> +inline void Emitter::SetStreamablePrecision(std::stringstream& stream) { + stream.precision(static_cast(GetDoublePrecision())); +} + +// overloads of insertion +inline Emitter& operator<<(Emitter& emitter, const std::string& v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, bool v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, char v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, unsigned char v) { + return emitter.Write(static_cast(v)); +} +inline Emitter& operator<<(Emitter& emitter, const _Alias& v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, const _Anchor& v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, const _Tag& v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, const _Comment& v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, const _Null& v) { + return emitter.Write(v); +} +inline Emitter& operator<<(Emitter& emitter, const Binary& b) { + return emitter.Write(b); +} + +inline Emitter& operator<<(Emitter& emitter, const char* v) { + return emitter.Write(std::string(v)); +} + +inline Emitter& operator<<(Emitter& emitter, int v) { + return emitter.WriteIntegralType(v); +} +inline Emitter& operator<<(Emitter& emitter, unsigned int v) { + return emitter.WriteIntegralType(v); +} +inline Emitter& operator<<(Emitter& emitter, short v) { + return emitter.WriteIntegralType(v); +} +inline Emitter& operator<<(Emitter& emitter, unsigned short v) { + return emitter.WriteIntegralType(v); +} +inline Emitter& operator<<(Emitter& emitter, long v) { + return emitter.WriteIntegralType(v); +} +inline Emitter& operator<<(Emitter& emitter, unsigned long v) { + return emitter.WriteIntegralType(v); +} +inline Emitter& operator<<(Emitter& emitter, long long v) { + return emitter.WriteIntegralType(v); +} +inline Emitter& operator<<(Emitter& emitter, unsigned long long v) { + return emitter.WriteIntegralType(v); +} + +inline Emitter& operator<<(Emitter& emitter, float v) { + return emitter.WriteStreamable(v); +} +inline Emitter& operator<<(Emitter& emitter, double v) { + return emitter.WriteStreamable(v); +} + +inline Emitter& operator<<(Emitter& emitter, EMITTER_MANIP value) { + return emitter.SetLocalValue(value); +} + +inline Emitter& operator<<(Emitter& emitter, _Indent indent) { + return emitter.SetLocalIndent(indent); +} + +inline Emitter& operator<<(Emitter& emitter, _Precision precision) { + return emitter.SetLocalPrecision(precision); +} +} // namespace YAML + +#endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/emitterdef.h b/data/miniconda3/include/yaml-cpp/emitterdef.h new file mode 100644 index 0000000000000000000000000000000000000000..0b426957fae2764eeceefb51e6ad8add6626c7e2 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/emitterdef.h @@ -0,0 +1,16 @@ +#ifndef EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +namespace YAML { +struct EmitterNodeType { + enum value { NoType, Property, Scalar, FlowSeq, BlockSeq, FlowMap, BlockMap }; +}; +} + +#endif // EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/emittermanip.h b/data/miniconda3/include/yaml-cpp/emittermanip.h new file mode 100644 index 0000000000000000000000000000000000000000..976d14950fc7a71fffa34ca714322d0405dc9bd0 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/emittermanip.h @@ -0,0 +1,144 @@ +#ifndef EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include + +namespace YAML { +enum EMITTER_MANIP { + // general manipulators + Auto, + TagByKind, + Newline, + + // output character set + EmitNonAscii, + EscapeNonAscii, + EscapeAsJson, + + // string manipulators + // Auto, // duplicate + SingleQuoted, + DoubleQuoted, + Literal, + + // null manipulators + LowerNull, + UpperNull, + CamelNull, + TildeNull, + + // bool manipulators + YesNoBool, // yes, no + TrueFalseBool, // true, false + OnOffBool, // on, off + UpperCase, // TRUE, N + LowerCase, // f, yes + CamelCase, // No, Off + LongBool, // yes, On + ShortBool, // y, t + + // int manipulators + Dec, + Hex, + Oct, + + // document manipulators + BeginDoc, + EndDoc, + + // sequence manipulators + BeginSeq, + EndSeq, + Flow, + Block, + + // map manipulators + BeginMap, + EndMap, + Key, + Value, + // Flow, // duplicate + // Block, // duplicate + // Auto, // duplicate + LongKey +}; + +struct _Indent { + _Indent(int value_) : value(value_) {} + int value; +}; + +inline _Indent Indent(int value) { return _Indent(value); } + +struct _Alias { + _Alias(const std::string& content_) : content(content_) {} + std::string content; +}; + +inline _Alias Alias(const std::string& content) { return _Alias(content); } + +struct _Anchor { + _Anchor(const std::string& content_) : content(content_) {} + std::string content; +}; + +inline _Anchor Anchor(const std::string& content) { return _Anchor(content); } + +struct _Tag { + struct Type { + enum value { Verbatim, PrimaryHandle, NamedHandle }; + }; + + explicit _Tag(const std::string& prefix_, const std::string& content_, + Type::value type_) + : prefix(prefix_), content(content_), type(type_) {} + std::string prefix; + std::string content; + Type::value type; +}; + +inline _Tag VerbatimTag(const std::string& content) { + return _Tag("", content, _Tag::Type::Verbatim); +} + +inline _Tag LocalTag(const std::string& content) { + return _Tag("", content, _Tag::Type::PrimaryHandle); +} + +inline _Tag LocalTag(const std::string& prefix, const std::string content) { + return _Tag(prefix, content, _Tag::Type::NamedHandle); +} + +inline _Tag SecondaryTag(const std::string& content) { + return _Tag("", content, _Tag::Type::NamedHandle); +} + +struct _Comment { + _Comment(const std::string& content_) : content(content_) {} + std::string content; +}; + +inline _Comment Comment(const std::string& content) { return _Comment(content); } + +struct _Precision { + _Precision(int floatPrecision_, int doublePrecision_) + : floatPrecision(floatPrecision_), doublePrecision(doublePrecision_) {} + + int floatPrecision; + int doublePrecision; +}; + +inline _Precision FloatPrecision(int n) { return _Precision(n, -1); } + +inline _Precision DoublePrecision(int n) { return _Precision(-1, n); } + +inline _Precision Precision(int n) { return _Precision(n, n); } +} + +#endif // EMITTERMANIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/emitterstyle.h b/data/miniconda3/include/yaml-cpp/emitterstyle.h new file mode 100644 index 0000000000000000000000000000000000000000..67bb3981b12cb235e9959635f7e98b2dd55e8ccb --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/emitterstyle.h @@ -0,0 +1,16 @@ +#ifndef EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +namespace YAML { +struct EmitterStyle { + enum value { Default, Block, Flow }; +}; +} + +#endif // EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/eventhandler.h b/data/miniconda3/include/yaml-cpp/eventhandler.h new file mode 100644 index 0000000000000000000000000000000000000000..7242fe1f5ba9dbb8808ab74a26959a05c375572a --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/eventhandler.h @@ -0,0 +1,45 @@ +#ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include + +#include "yaml-cpp/anchor.h" +#include "yaml-cpp/emitterstyle.h" + +namespace YAML { +struct Mark; + +class EventHandler { + public: + virtual ~EventHandler() = default; + + virtual void OnDocumentStart(const Mark& mark) = 0; + virtual void OnDocumentEnd() = 0; + + virtual void OnNull(const Mark& mark, anchor_t anchor) = 0; + virtual void OnAlias(const Mark& mark, anchor_t anchor) = 0; + virtual void OnScalar(const Mark& mark, const std::string& tag, + anchor_t anchor, const std::string& value) = 0; + + virtual void OnSequenceStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) = 0; + virtual void OnSequenceEnd() = 0; + + virtual void OnMapStart(const Mark& mark, const std::string& tag, + anchor_t anchor, EmitterStyle::value style) = 0; + virtual void OnMapEnd() = 0; + + virtual void OnAnchor(const Mark& /*mark*/, + const std::string& /*anchor_name*/) { + // empty default implementation for compatibility + } +}; +} // namespace YAML + +#endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/exceptions.h b/data/miniconda3/include/yaml-cpp/exceptions.h new file mode 100644 index 0000000000000000000000000000000000000000..f6b2602ae1c313a649b5d398543cbe2cedee50ae --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/exceptions.h @@ -0,0 +1,303 @@ +#ifndef EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include "yaml-cpp/mark.h" +#include "yaml-cpp/noexcept.h" +#include "yaml-cpp/traits.h" +#include +#include +#include + +namespace YAML { +// error messages +namespace ErrorMsg { +const char* const YAML_DIRECTIVE_ARGS = + "YAML directives must have exactly one argument"; +const char* const YAML_VERSION = "bad YAML version: "; +const char* const YAML_MAJOR_VERSION = "YAML major version too large"; +const char* const REPEATED_YAML_DIRECTIVE = "repeated YAML directive"; +const char* const TAG_DIRECTIVE_ARGS = + "TAG directives must have exactly two arguments"; +const char* const REPEATED_TAG_DIRECTIVE = "repeated TAG directive"; +const char* const CHAR_IN_TAG_HANDLE = + "illegal character found while scanning tag handle"; +const char* const TAG_WITH_NO_SUFFIX = "tag handle with no suffix"; +const char* const END_OF_VERBATIM_TAG = "end of verbatim tag not found"; +const char* const END_OF_MAP = "end of map not found"; +const char* const END_OF_MAP_FLOW = "end of map flow not found"; +const char* const END_OF_SEQ = "end of sequence not found"; +const char* const END_OF_SEQ_FLOW = "end of sequence flow not found"; +const char* const MULTIPLE_TAGS = + "cannot assign multiple tags to the same node"; +const char* const MULTIPLE_ANCHORS = + "cannot assign multiple anchors to the same node"; +const char* const MULTIPLE_ALIASES = + "cannot assign multiple aliases to the same node"; +const char* const ALIAS_CONTENT = + "aliases can't have any content, *including* tags"; +const char* const INVALID_HEX = "bad character found while scanning hex number"; +const char* const INVALID_UNICODE = "invalid unicode: "; +const char* const INVALID_ESCAPE = "unknown escape character: "; +const char* const UNKNOWN_TOKEN = "unknown token"; +const char* const DOC_IN_SCALAR = "illegal document indicator in scalar"; +const char* const EOF_IN_SCALAR = "illegal EOF in scalar"; +const char* const CHAR_IN_SCALAR = "illegal character in scalar"; +const char* const TAB_IN_INDENTATION = + "illegal tab when looking for indentation"; +const char* const FLOW_END = "illegal flow end"; +const char* const BLOCK_ENTRY = "illegal block entry"; +const char* const MAP_KEY = "illegal map key"; +const char* const MAP_VALUE = "illegal map value"; +const char* const ALIAS_NOT_FOUND = "alias not found after *"; +const char* const ANCHOR_NOT_FOUND = "anchor not found after &"; +const char* const CHAR_IN_ALIAS = + "illegal character found while scanning alias"; +const char* const CHAR_IN_ANCHOR = + "illegal character found while scanning anchor"; +const char* const ZERO_INDENT_IN_BLOCK = + "cannot set zero indentation for a block scalar"; +const char* const CHAR_IN_BLOCK = "unexpected character in block scalar"; +const char* const AMBIGUOUS_ANCHOR = + "cannot assign the same alias to multiple nodes"; +const char* const UNKNOWN_ANCHOR = "the referenced anchor is not defined: "; + +const char* const INVALID_NODE = + "invalid node; this may result from using a map iterator as a sequence " + "iterator, or vice-versa"; +const char* const INVALID_SCALAR = "invalid scalar"; +const char* const KEY_NOT_FOUND = "key not found"; +const char* const BAD_CONVERSION = "bad conversion"; +const char* const BAD_DEREFERENCE = "bad dereference"; +const char* const BAD_SUBSCRIPT = "operator[] call on a scalar"; +const char* const BAD_PUSHBACK = "appending to a non-sequence"; +const char* const BAD_INSERT = "inserting in a non-convertible-to-map"; + +const char* const UNMATCHED_GROUP_TAG = "unmatched group tag"; +const char* const UNEXPECTED_END_SEQ = "unexpected end sequence token"; +const char* const UNEXPECTED_END_MAP = "unexpected end map token"; +const char* const SINGLE_QUOTED_CHAR = + "invalid character in single-quoted string"; +const char* const INVALID_ANCHOR = "invalid anchor"; +const char* const INVALID_ALIAS = "invalid alias"; +const char* const INVALID_TAG = "invalid tag"; +const char* const BAD_FILE = "bad file"; + +template +inline const std::string KEY_NOT_FOUND_WITH_KEY( + const T&, typename disable_if>::type* = 0) { + return KEY_NOT_FOUND; +} + +inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) { + std::stringstream stream; + stream << KEY_NOT_FOUND << ": " << key; + return stream.str(); +} + +inline const std::string KEY_NOT_FOUND_WITH_KEY(const char* key) { + std::stringstream stream; + stream << KEY_NOT_FOUND << ": " << key; + return stream.str(); +} + +template +inline const std::string KEY_NOT_FOUND_WITH_KEY( + const T& key, typename enable_if>::type* = 0) { + std::stringstream stream; + stream << KEY_NOT_FOUND << ": " << key; + return stream.str(); +} + +template +inline const std::string BAD_SUBSCRIPT_WITH_KEY( + const T&, typename disable_if>::type* = nullptr) { + return BAD_SUBSCRIPT; +} + +inline const std::string BAD_SUBSCRIPT_WITH_KEY(const std::string& key) { + std::stringstream stream; + stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")"; + return stream.str(); +} + +inline const std::string BAD_SUBSCRIPT_WITH_KEY(const char* key) { + std::stringstream stream; + stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")"; + return stream.str(); +} + +template +inline const std::string BAD_SUBSCRIPT_WITH_KEY( + const T& key, typename enable_if>::type* = nullptr) { + std::stringstream stream; + stream << BAD_SUBSCRIPT << " (key: \"" << key << "\")"; + return stream.str(); +} + +inline const std::string INVALID_NODE_WITH_KEY(const std::string& key) { + std::stringstream stream; + if (key.empty()) { + return INVALID_NODE; + } + stream << "invalid node; first invalid key: \"" << key << "\""; + return stream.str(); +} +} // namespace ErrorMsg + +class YAML_CPP_API Exception : public std::runtime_error { + public: + Exception(const Mark& mark_, const std::string& msg_) + : std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {} + ~Exception() YAML_CPP_NOEXCEPT override; + + Exception(const Exception&) = default; + + Mark mark; + std::string msg; + + private: + static const std::string build_what(const Mark& mark, + const std::string& msg) { + if (mark.is_null()) { + return msg; + } + + std::stringstream output; + output << "yaml-cpp: error at line " << mark.line + 1 << ", column " + << mark.column + 1 << ": " << msg; + return output.str(); + } +}; + +class YAML_CPP_API ParserException : public Exception { + public: + ParserException(const Mark& mark_, const std::string& msg_) + : Exception(mark_, msg_) {} + ParserException(const ParserException&) = default; + ~ParserException() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API RepresentationException : public Exception { + public: + RepresentationException(const Mark& mark_, const std::string& msg_) + : Exception(mark_, msg_) {} + RepresentationException(const RepresentationException&) = default; + ~RepresentationException() YAML_CPP_NOEXCEPT override; +}; + +// representation exceptions +class YAML_CPP_API InvalidScalar : public RepresentationException { + public: + InvalidScalar(const Mark& mark_) + : RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {} + InvalidScalar(const InvalidScalar&) = default; + ~InvalidScalar() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API KeyNotFound : public RepresentationException { + public: + template + KeyNotFound(const Mark& mark_, const T& key_) + : RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) { + } + KeyNotFound(const KeyNotFound&) = default; + ~KeyNotFound() YAML_CPP_NOEXCEPT override; +}; + +template +class YAML_CPP_API TypedKeyNotFound : public KeyNotFound { + public: + TypedKeyNotFound(const Mark& mark_, const T& key_) + : KeyNotFound(mark_, key_), key(key_) {} + ~TypedKeyNotFound() YAML_CPP_NOEXCEPT override = default; + + T key; +}; + +template +inline TypedKeyNotFound MakeTypedKeyNotFound(const Mark& mark, + const T& key) { + return TypedKeyNotFound(mark, key); +} + +class YAML_CPP_API InvalidNode : public RepresentationException { + public: + InvalidNode(const std::string& key) + : RepresentationException(Mark::null_mark(), + ErrorMsg::INVALID_NODE_WITH_KEY(key)) {} + InvalidNode(const InvalidNode&) = default; + ~InvalidNode() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API BadConversion : public RepresentationException { + public: + explicit BadConversion(const Mark& mark_) + : RepresentationException(mark_, ErrorMsg::BAD_CONVERSION) {} + BadConversion(const BadConversion&) = default; + ~BadConversion() YAML_CPP_NOEXCEPT override; +}; + +template +class TypedBadConversion : public BadConversion { + public: + explicit TypedBadConversion(const Mark& mark_) : BadConversion(mark_) {} +}; + +class YAML_CPP_API BadDereference : public RepresentationException { + public: + BadDereference() + : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {} + BadDereference(const BadDereference&) = default; + ~BadDereference() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API BadSubscript : public RepresentationException { + public: + template + BadSubscript(const Mark& mark_, const Key& key) + : RepresentationException(mark_, ErrorMsg::BAD_SUBSCRIPT_WITH_KEY(key)) {} + BadSubscript(const BadSubscript&) = default; + ~BadSubscript() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API BadPushback : public RepresentationException { + public: + BadPushback() + : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {} + BadPushback(const BadPushback&) = default; + ~BadPushback() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API BadInsert : public RepresentationException { + public: + BadInsert() + : RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {} + BadInsert(const BadInsert&) = default; + ~BadInsert() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API EmitterException : public Exception { + public: + EmitterException(const std::string& msg_) + : Exception(Mark::null_mark(), msg_) {} + EmitterException(const EmitterException&) = default; + ~EmitterException() YAML_CPP_NOEXCEPT override; +}; + +class YAML_CPP_API BadFile : public Exception { + public: + explicit BadFile(const std::string& filename) + : Exception(Mark::null_mark(), + std::string(ErrorMsg::BAD_FILE) + ": " + filename) {} + BadFile(const BadFile&) = default; + ~BadFile() YAML_CPP_NOEXCEPT override; +}; +} // namespace YAML + +#endif // EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/mark.h b/data/miniconda3/include/yaml-cpp/mark.h new file mode 100644 index 0000000000000000000000000000000000000000..bf94b4f41fc6c96fcb9ffebcda55a4f60cc6cfdf --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/mark.h @@ -0,0 +1,29 @@ +#ifndef MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include "yaml-cpp/dll.h" + +namespace YAML { +struct YAML_CPP_API Mark { + Mark() : pos(0), line(0), column(0) {} + + static const Mark null_mark() { return Mark(-1, -1, -1); } + + bool is_null() const { return pos == -1 && line == -1 && column == -1; } + + int pos; + int line, column; + + private: + Mark(int pos_, int line_, int column_) + : pos(pos_), line(line_), column(column_) {} +}; +} + +#endif // MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/noexcept.h b/data/miniconda3/include/yaml-cpp/noexcept.h new file mode 100644 index 0000000000000000000000000000000000000000..6aac63516f357aab77a3019099e1a5545dd7d48b --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/noexcept.h @@ -0,0 +1,18 @@ +#ifndef NOEXCEPT_H_768872DA_476C_11EA_88B8_90B11C0C0FF8 +#define NOEXCEPT_H_768872DA_476C_11EA_88B8_90B11C0C0FF8 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +// This is here for compatibility with older versions of Visual Studio +// which don't support noexcept. +#if defined(_MSC_VER) && _MSC_VER < 1900 + #define YAML_CPP_NOEXCEPT _NOEXCEPT +#else + #define YAML_CPP_NOEXCEPT noexcept +#endif + +#endif diff --git a/data/miniconda3/include/yaml-cpp/null.h b/data/miniconda3/include/yaml-cpp/null.h new file mode 100644 index 0000000000000000000000000000000000000000..b9521d488a6acb04b4219423a20b5a064352c96f --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/null.h @@ -0,0 +1,26 @@ +#ifndef NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include "yaml-cpp/dll.h" +#include + +namespace YAML { +class Node; + +struct YAML_CPP_API _Null {}; +inline bool operator==(const _Null&, const _Null&) { return true; } +inline bool operator!=(const _Null&, const _Null&) { return false; } + +YAML_CPP_API bool IsNull(const Node& node); // old API only +YAML_CPP_API bool IsNullString(const std::string& str); + +extern YAML_CPP_API _Null Null; +} + +#endif // NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/ostream_wrapper.h b/data/miniconda3/include/yaml-cpp/ostream_wrapper.h new file mode 100644 index 0000000000000000000000000000000000000000..cf89741d0935aad2d7b28ad49eb59a1cb0e05326 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/ostream_wrapper.h @@ -0,0 +1,76 @@ +#ifndef OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include +#include + +#include "yaml-cpp/dll.h" + +namespace YAML { +class YAML_CPP_API ostream_wrapper { + public: + ostream_wrapper(); + explicit ostream_wrapper(std::ostream& stream); + ostream_wrapper(const ostream_wrapper&) = delete; + ostream_wrapper(ostream_wrapper&&) = delete; + ostream_wrapper& operator=(const ostream_wrapper&) = delete; + ostream_wrapper& operator=(ostream_wrapper&&) = delete; + ~ostream_wrapper(); + + void write(const std::string& str); + void write(const char* str, std::size_t size); + + void set_comment() { m_comment = true; } + + const char* str() const { + if (m_pStream) { + return nullptr; + } else { + m_buffer[m_pos] = '\0'; + return &m_buffer[0]; + } + } + + std::size_t row() const { return m_row; } + std::size_t col() const { return m_col; } + std::size_t pos() const { return m_pos; } + bool comment() const { return m_comment; } + + private: + void update_pos(char ch); + + private: + mutable std::vector m_buffer; + std::ostream* const m_pStream; + + std::size_t m_pos; + std::size_t m_row, m_col; + bool m_comment; +}; + +template +inline ostream_wrapper& operator<<(ostream_wrapper& stream, + const char (&str)[N]) { + stream.write(str, N - 1); + return stream; +} + +inline ostream_wrapper& operator<<(ostream_wrapper& stream, + const std::string& str) { + stream.write(str); + return stream; +} + +inline ostream_wrapper& operator<<(ostream_wrapper& stream, char ch) { + stream.write(&ch, 1); + return stream; +} +} // namespace YAML + +#endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/parser.h b/data/miniconda3/include/yaml-cpp/parser.h new file mode 100644 index 0000000000000000000000000000000000000000..2f403c3504805641884eab084e4c7729e1c18cdd --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/parser.h @@ -0,0 +1,90 @@ +#ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include +#include + +#include "yaml-cpp/dll.h" + +namespace YAML { +class EventHandler; +class Node; +class Scanner; +struct Directives; +struct Token; + +/** + * A parser turns a stream of bytes into one stream of "events" per YAML + * document in the input stream. + */ +class YAML_CPP_API Parser { + public: + /** Constructs an empty parser (with no input. */ + Parser(); + + Parser(const Parser&) = delete; + Parser(Parser&&) = delete; + Parser& operator=(const Parser&) = delete; + Parser& operator=(Parser&&) = delete; + + /** + * Constructs a parser from the given input stream. The input stream must + * live as long as the parser. + */ + explicit Parser(std::istream& in); + + ~Parser(); + + /** Evaluates to true if the parser has some valid input to be read. */ + explicit operator bool() const; + + /** + * Resets the parser with the given input stream. Any existing state is + * erased. + */ + void Load(std::istream& in); + + /** + * Handles the next document by calling events on the {@code eventHandler}. + * + * @throw a ParserException on error. + * @return false if there are no more documents + */ + bool HandleNextDocument(EventHandler& eventHandler); + + void PrintTokens(std::ostream& out); + + private: + /** + * Reads any directives that are next in the queue, setting the internal + * {@code m_pDirectives} state. + */ + void ParseDirectives(); + + void HandleDirective(const Token& token); + + /** + * Handles a "YAML" directive, which should be of the form 'major.minor' (like + * a version number). + */ + void HandleYamlDirective(const Token& token); + + /** + * Handles a "TAG" directive, which should be of the form 'handle prefix', + * where 'handle' is converted to 'prefix' in the file. + */ + void HandleTagDirective(const Token& token); + + private: + std::unique_ptr m_pScanner; + std::unique_ptr m_pDirectives; +}; +} // namespace YAML + +#endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/stlemitter.h b/data/miniconda3/include/yaml-cpp/stlemitter.h new file mode 100644 index 0000000000000000000000000000000000000000..210a2f64e6a816bca3535dcb945e52881d452562 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/stlemitter.h @@ -0,0 +1,50 @@ +#ifndef STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include +#include +#include +#include + +namespace YAML { +template +inline Emitter& EmitSeq(Emitter& emitter, const Seq& seq) { + emitter << BeginSeq; + for (const auto& v : seq) + emitter << v; + emitter << EndSeq; + return emitter; +} + +template +inline Emitter& operator<<(Emitter& emitter, const std::vector& v) { + return EmitSeq(emitter, v); +} + +template +inline Emitter& operator<<(Emitter& emitter, const std::list& v) { + return EmitSeq(emitter, v); +} + +template +inline Emitter& operator<<(Emitter& emitter, const std::set& v) { + return EmitSeq(emitter, v); +} + +template +inline Emitter& operator<<(Emitter& emitter, const std::map& m) { + emitter << BeginMap; + for (const auto& v : m) + emitter << Key << v.first << Value << v.second; + emitter << EndMap; + return emitter; +} +} + +#endif // STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/traits.h b/data/miniconda3/include/yaml-cpp/traits.h new file mode 100644 index 0000000000000000000000000000000000000000..ffe9999f191fe83d7fbc33401d598c26c80cf2e8 --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/traits.h @@ -0,0 +1,135 @@ +#ifndef TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include +#include +#include +#include + +namespace YAML { +template +struct is_numeric { + enum { value = false }; +}; + +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +#if defined(_MSC_VER) && (_MSC_VER < 1310) +template <> +struct is_numeric<__int64> { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +#else +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +#endif +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; +template <> +struct is_numeric { + enum { value = true }; +}; + +template +struct enable_if_c { + using type = T; +}; + +template +struct enable_if_c {}; + +template +struct enable_if : public enable_if_c {}; + +template +struct disable_if_c { + using type = T; +}; + +template +struct disable_if_c {}; + +template +struct disable_if : public disable_if_c {}; +} + +template +struct is_streamable { + template + static auto test(int) + -> decltype(std::declval() << std::declval(), std::true_type()); + + template + static auto test(...) -> std::false_type; + + static const bool value = decltype(test(0))::value; +}; + +template +struct streamable_to_string { + static std::string impl(const Key& key) { + std::stringstream ss; + ss << key; + return ss.str(); + } +}; + +template +struct streamable_to_string { + static std::string impl(const Key&) { + return ""; + } +}; +#endif // TRAITS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/data/miniconda3/include/yaml-cpp/yaml.h b/data/miniconda3/include/yaml-cpp/yaml.h new file mode 100644 index 0000000000000000000000000000000000000000..7f515efb9610568a5738984292afcee212920f4e --- /dev/null +++ b/data/miniconda3/include/yaml-cpp/yaml.h @@ -0,0 +1,24 @@ +#ifndef YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 +#define YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 + +#if defined(_MSC_VER) || \ + (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ + (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 +#pragma once +#endif + +#include "yaml-cpp/parser.h" +#include "yaml-cpp/emitter.h" +#include "yaml-cpp/emitterstyle.h" +#include "yaml-cpp/stlemitter.h" +#include "yaml-cpp/exceptions.h" + +#include "yaml-cpp/node/node.h" +#include "yaml-cpp/node/impl.h" +#include "yaml-cpp/node/convert.h" +#include "yaml-cpp/node/iterator.h" +#include "yaml-cpp/node/detail/impl.h" +#include "yaml-cpp/node/parse.h" +#include "yaml-cpp/node/emit.h" + +#endif // YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66