<commit_before>/*
 * This file is part of LibCSS.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2007 <NAME> <<EMAIL>>
 */

#ifndef libcss_types_h_
#define libcss_types_h_

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

/** Source of charset information, in order of importance
 * A client-dictated charset will override all others.
 * A document-specified charset will override autodetection or the default */
typedef enum css_charset_source {
	CSS_CHARSET_DEFAULT          = 0,	/**< Default setting */
	CSS_CHARSET_REFERRED         = 1,	/**< From referring document */
	CSS_CHARSET_METADATA         = 2,	/**< From linking metadata */
	CSS_CHARSET_DOCUMENT         = 3,	/**< Defined in document */
	CSS_CHARSET_DICTATED         = 4,	/**< Dictated by client */
} css_charset_source;

/**
 * Stylesheet language level -- defines parsing rules and supported properties
 */
typedef enum css_language_level {
	CSS_LEVEL_1                 = 0,	/**< CSS 1 */
	CSS_LEVEL_2                 = 1,	/**< CSS 2 */
	CSS_LEVEL_21                = 2,	/**< CSS 2.1 */
	CSS_LEVEL_3                 = 3,	/**< CSS 3 */
	CSS_LEVEL_DEFAULT           = CSS_LEVEL_21	/**< Default level */
} css_language_level;

/**
 * Stylesheet media types
 */
typedef enum css_media_type {
	CSS_MEDIA_SCREEN            = (1<<0),
	CSS_MEDIA_ALL               = CSS_MEDIA_SCREEN
} css_media_type;

/**
 * Stylesheet origin
 */
typedef enum css_origin {
	CSS_ORIGIN_UA               = 0,	/**< User agent stylesheet */
	CSS_ORIGIN_USER             = 1,	/**< User stylesheet */
	CSS_ORIGIN_AUTHOR           = 2		/**< Author stylesheet */
} css_origin;

/**
 * String type
 */
typedef struct css_string {
	size_t len;
	uint8_t *data;
} css_string;

/** CSS colour -- RRGGBBAA */
typedef uint32_t css_color;

/* Fixed point type */
/** \todo Do we want to make utils/fp*.h public? */
typedef int32_t css_fixed;

/* CSS unit */<commit_msg>Enumerate all media types defined in CSS 2.1 (includes aural, which is deprecated)<commit_after>/*
 * This file is part of LibCSS.
 * Licensed under the MIT License,
 *                http://www.opensource.org/licenses/mit-license.php
 * Copyright 2007 <NAME> <<EMAIL>>
 */

#ifndef libcss_types_h_
#define libcss_types_h_

#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

/** Source of charset information, in order of importance
 * A client-dictated charset will override all others.
 * A document-specified charset will override autodetection or the default */
typedef enum css_charset_source {
	CSS_CHARSET_DEFAULT          = 0,	/**< Default setting */
	CSS_CHARSET_REFERRED         = 1,	/**< From referring document */
	CSS_CHARSET_METADATA         = 2,	/**< From linking metadata */
	CSS_CHARSET_DOCUMENT         = 3,	/**< Defined in document */
	CSS_CHARSET_DICTATED         = 4,	/**< Dictated by client */
} css_charset_source;

/**
 * Stylesheet language level -- defines parsing rules and supported properties
 */
typedef enum css_language_level {
	CSS_LEVEL_1                 = 0,	/**< CSS 1 */
	CSS_LEVEL_2                 = 1,	/**< CSS 2 */
	CSS_LEVEL_21                = 2,	/**< CSS 2.1 */
	CSS_LEVEL_3                 = 3,	/**< CSS 3 */
	CSS_LEVEL_DEFAULT           = CSS_LEVEL_21	/**< Default level */
} css_language_level;

/**
 * Stylesheet media types
 */
typedef enum css_media_type {
	CSS_MEDIA_AURAL             = (1<<0),
	CSS_MEDIA_BRAILLE           = (1<<1),
	CSS_MEDIA_EMBOSSED          = (1<<2),
	CSS_MEDIA_HANDHELD          = (1<<3),
	CSS_MEDIA_PRINT             = (1<<4),
	CSS_MEDIA_PROJECTION        = (1<<5),
	CSS_MEDIA_SCREEN            = (1<<6),
	CSS_MEDIA_SPEECH            = (1<<7),
	CSS_MEDIA_TTY               = (1<<8),
	CSS_MEDIA_TV                = (1<<9),
	CSS_MEDIA_ALL               = CSS_MEDIA_AURAL | CSS_MEDIA_BRAILLE |
                                      CSS_MEDIA_EMBOSSED | CSS_MEDIA_HANDHELD |
                                      CSS_MEDIA_PRINT | CSS_MEDIA_PROJECTION |
                                      CSS_MEDIA_SCREEN | CSS_MEDIA_SPEECH |
                                      CSS_MEDIA_TTY | CSS_MEDIA_TV
} css_media_type;

/**
 * Stylesheet origin
 */
typedef enum css_origin {
	CSS_ORIGIN_UA               = 0,	/**< User agent stylesheet */
	CSS_ORIGIN_USER             = 1,	/**< User stylesheet */
	CSS_ORIGIN_AUTHOR           = 2		/**< Author stylesheet */
} css_origin;

/**
 * String type
 */
typedef struct css_string {
	size_t len;
	uint8_t *data;
} css_string;

/** CSS colour -- RRGGBBAA */
typedef uint32_t css_color;

/* Fixed point type */
/** \todo Do we want to make utils/fp*.h public? */
typedef int32_t css_fixed;

/* CSS unit */
{'fraction_non_alphanumeric': 0.11385401149180677, 'fraction_numerical': 0.019153011278995533, 'mean_word_length': 2.2798325191905096, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7423632', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1552, 'n_words': 387}