Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * This file is part of LibCSS.
  3.  * Licensed under the MIT License,
  4.  *                http://www.opensource.org/licenses/mit-license.php
  5.  * Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org>
  6.  */
  7.  
  8. #include "parse/propstrings.h"
  9. #include "stylesheet.h"
  10.  
  11. #include <assert.h>
  12.  
  13. typedef struct stringmap_entry {
  14.         const char *data;
  15.         size_t len;
  16. } stringmap_entry;
  17.  
  18. typedef struct css__propstrings_ctx {
  19.         uint32_t count;
  20.         lwc_string *strings[LAST_KNOWN];
  21. } css__propstrings_ctx;
  22.  
  23. static css__propstrings_ctx css__propstrings;
  24.  
  25. /* Must be synchronised with enum in propstrings.h */
  26. const stringmap_entry stringmap[LAST_KNOWN] = {
  27.         { "*", SLEN("*") },
  28.  
  29.         { ":", SLEN(":") },
  30.         { ",", SLEN(",") },
  31.         { ";", SLEN(";") },
  32.         { "{", SLEN("{") },
  33.         { "}", SLEN("}") },
  34.         { "0", SLEN("0") },
  35.  
  36.         { "charset", SLEN("charset") },
  37.         { "import", SLEN("import") },
  38.         { "media", SLEN("media") },
  39.         { "namespace", SLEN("namespace") },
  40.         { "font-face", SLEN("font-face") },
  41.         { "page", SLEN("page") },
  42.  
  43.         { "aural", SLEN("aural") },
  44.         { "braille", SLEN("braille") },
  45.         { "embossed", SLEN("embossed") },
  46.         { "handheld", SLEN("handheld") },
  47.         { "print", SLEN("print") },
  48.         { "projection", SLEN("projection") },
  49.         { "screen", SLEN("screen") },
  50.         { "speech", SLEN("speech") },
  51.         { "tty", SLEN("tty") },
  52.         { "tv", SLEN("tv") },
  53.         { "all", SLEN("all") },
  54.  
  55.         { "first-child", SLEN("first-child") },
  56.         { "link", SLEN("link") },
  57.         { "visited", SLEN("visited") },
  58.         { "hover", SLEN("hover") },
  59.         { "active", SLEN("active") },
  60.         { "focus", SLEN("focus") },
  61.         { "lang", SLEN("lang") },
  62.         { "first", SLEN("first") },
  63.         { "root", SLEN("root") },
  64.         { "nth-child", SLEN("nth-child") },
  65.         { "nth-last-child", SLEN("nth-last-child") },
  66.         { "nth-of-type", SLEN("nth-of-type") },
  67.         { "nth-last-of-type", SLEN("nth-last-of-type") },
  68.         { "last-child", SLEN("last-child") },
  69.         { "first-of-type", SLEN("first-of-type") },
  70.         { "last-of-type", SLEN("last-of-type") },
  71.         { "only-child", SLEN("only-child") },
  72.         { "only-of-type", SLEN("only-of-type") },
  73.         { "empty", SLEN("empty") },
  74.         { "target", SLEN("target") },
  75.         { "enabled", SLEN("enabled") },
  76.         { "disabled", SLEN("disabled") },
  77.         { "checked", SLEN("checked") },
  78.         { "not", SLEN("not") },
  79.  
  80.         { "first-line", SLEN("first-line") },
  81.         { "first-letter", SLEN("first-letter") },
  82.         { "before", SLEN("before") },
  83.         { "after", SLEN("after") },
  84.  
  85.         { "azimuth", SLEN("azimuth") },
  86.         { "background", SLEN("background") },
  87.         { "background-attachment", SLEN("background-attachment") },
  88.         { "background-color", SLEN("background-color") },
  89.         { "background-image", SLEN("background-image") },
  90.         { "background-position", SLEN("background-position") },
  91.         { "background-repeat", SLEN("background-repeat") },
  92.         { "border", SLEN("border") },
  93.         { "border-bottom", SLEN("border-bottom") },
  94.         { "border-bottom-color", SLEN("border-bottom-color") },
  95.         { "border-bottom-style", SLEN("border-bottom-style") },
  96.         { "border-bottom-width", SLEN("border-bottom-width") },
  97.         { "border-collapse", SLEN("border-collapse") },
  98.         { "border-color", SLEN("border-color") },
  99.         { "border-left", SLEN("border-left") },
  100.         { "border-left-color", SLEN("border-left-color") },
  101.         { "border-left-style", SLEN("border-left-style") },
  102.         { "border-left-width", SLEN("border-left-width") },
  103.         { "border-right", SLEN("border-right") },
  104.         { "border-right-color", SLEN("border-right-color") },
  105.         { "border-right-style", SLEN("border-right-style") },
  106.         { "border-right-width", SLEN("border-right-width") },
  107.         { "border-spacing", SLEN("border-spacing") },
  108.         { "border-style", SLEN("border-style") },
  109.         { "border-top", SLEN("border-top") },
  110.         { "border-top-color", SLEN("border-top-color") },
  111.         { "border-top-style", SLEN("border-top-style") },
  112.         { "border-top-width", SLEN("border-top-width") },
  113.         { "border-width", SLEN("border-width") },
  114.         { "bottom", SLEN("bottom") },
  115.         { "break-after", SLEN("break-after") },
  116.         { "break-before", SLEN("break-before") },
  117.         { "break-inside", SLEN("break-inside") },
  118.         { "caption-side", SLEN("caption-side") },
  119.         { "clear", SLEN("clear") },
  120.         { "clip", SLEN("clip") },
  121.         { "color", SLEN("color") },
  122.         { "columns", SLEN("columns") },
  123.         { "column-count", SLEN("column-count") },
  124.         { "column-fill", SLEN("column-fill") },
  125.         { "column-gap", SLEN("column-gap") },
  126.         { "column-rule", SLEN("column-rule") },
  127.         { "column-rule-color", SLEN("column-rule-color") },
  128.         { "column-rule-style", SLEN("column-rule-style") },
  129.         { "column-rule-width", SLEN("column-rule_width") },
  130.         { "column-span", SLEN("column-span") },
  131.         { "column-width", SLEN("column-width") },
  132.         { "content", SLEN("content") },
  133.         { "counter-increment", SLEN("counter-increment") },
  134.         { "counter-reset", SLEN("counter-reset") },
  135.         { "cue", SLEN("cue") },
  136.         { "cue-after", SLEN("cue-after") },
  137.         { "cue-before", SLEN("cue-before") },
  138.         { "cursor", SLEN("cursor") },
  139.         { "direction", SLEN("direction") },
  140.         { "display", SLEN("display") },
  141.         { "elevation", SLEN("elevation") },
  142.         { "empty-cells", SLEN("empty-cells") },
  143.         { "float", SLEN("float") },
  144.         { "font", SLEN("font") },
  145.         { "font-family", SLEN("font-family") },
  146.         { "font-size", SLEN("font-size") },
  147.         { "font-style", SLEN("font-style") },
  148.         { "font-variant", SLEN("font-variant") },
  149.         { "font-weight", SLEN("font-weight") },
  150.         { "height", SLEN("height") },
  151.         { "left", SLEN("left") },
  152.         { "letter-spacing", SLEN("letter-spacing") },
  153.         { "line-height", SLEN("line-height") },
  154.         { "list-style", SLEN("list-style") },
  155.         { "list-style-image", SLEN("list-style-image") },
  156.         { "list-style-position", SLEN("list-style-position") },
  157.         { "list-style-type", SLEN("list-style-type") },
  158.         { "margin", SLEN("margin") },
  159.         { "margin-bottom", SLEN("margin-bottom") },
  160.         { "margin-left", SLEN("margin-left") },
  161.         { "margin-right", SLEN("margin-right") },
  162.         { "margin-top", SLEN("margin-top") },
  163.         { "max-height", SLEN("max-height") },
  164.         { "max-width", SLEN("max-width") },
  165.         { "min-height", SLEN("min-height") },
  166.         { "min-width", SLEN("min-width") },
  167.         { "opacity", SLEN("opacity") },
  168.         { "orphans", SLEN("orphans") },
  169.         { "outline", SLEN("outline") },
  170.         { "outline-color", SLEN("outline-color") },
  171.         { "outline-style", SLEN("outline-style") },
  172.         { "outline-width", SLEN("outline-width") },
  173.         { "overflow", SLEN("overflow") },
  174.         { "padding", SLEN("padding") },
  175.         { "padding-bottom", SLEN("padding-bottom") },
  176.         { "padding-left", SLEN("padding-left") },
  177.         { "padding-right", SLEN("padding-right") },
  178.         { "padding-top", SLEN("padding-top") },
  179.         { "page-break-after", SLEN("page-break-after") },
  180.         { "page-break-before", SLEN("page-break-before") },
  181.         { "page-break-inside", SLEN("page-break-inside") },
  182.         { "pause", SLEN("pause") },
  183.         { "pause-after", SLEN("pause-after") },
  184.         { "pause-before", SLEN("pause-before") },
  185.         { "pitch-range", SLEN("pitch-range") },
  186.         { "pitch", SLEN("pitch") },
  187.         { "play-during", SLEN("play-during") },
  188.         { "position", SLEN("position") },
  189.         { "quotes", SLEN("quotes") },
  190.         { "richness", SLEN("richness") },
  191.         { "right", SLEN("right") },
  192.         { "speak-header", SLEN("speak-header") },
  193.         { "speak-numeral", SLEN("speak-numeral") },
  194.         { "speak-punctuation", SLEN("speak-punctuation") },
  195.         { "speak", SLEN("speak") },
  196.         { "speech-rate", SLEN("speech-rate") },
  197.         { "stress", SLEN("stress") },
  198.         { "table-layout", SLEN("table-layout") },
  199.         { "text-align", SLEN("text-align") },
  200.         { "text-decoration", SLEN("text-decoration") },
  201.         { "text-indent", SLEN("text-indent") },
  202.         { "text-transform", SLEN("text-transform") },
  203.         { "top", SLEN("top") },
  204.         { "unicode-bidi", SLEN("unicode-bidi") },
  205.         { "vertical-align", SLEN("vertical-align") },
  206.         { "visibility", SLEN("visibility") },
  207.         { "voice-family", SLEN("voice-family") },
  208.         { "volume", SLEN("volume") },
  209.         { "white-space", SLEN("white-space") },
  210.         { "widows", SLEN("widows") },
  211.         { "width", SLEN("width") },
  212.         { "word-spacing", SLEN("word-spacing") },
  213.         { "z-index", SLEN("z-index") },
  214.  
  215.         { "inherit", SLEN("inherit") },
  216.         { "important", SLEN("important") },
  217.         { "none", SLEN("none") },
  218.         { "both", SLEN("both") },
  219.         { "fixed", SLEN("fixed") },
  220.         { "scroll", SLEN("scroll") },
  221.         { "transparent", SLEN("transparent") },
  222.         { "no-repeat", SLEN("no-repeat") },
  223.         { "repeat-x", SLEN("repeat-x") },
  224.         { "repeat-y", SLEN("repeat-y") },
  225.         { "repeat", SLEN("repeat") },
  226.         { "hidden", SLEN("hidden") },
  227.         { "dotted", SLEN("dotted") },
  228.         { "dashed", SLEN("dashed") },
  229.         { "solid", SLEN("solid") },
  230.         { "double", SLEN("double") },
  231.         { "groove", SLEN("groove") },
  232.         { "ridge", SLEN("ridge") },
  233.         { "inset", SLEN("inset") },
  234.         { "outset", SLEN("outset") },
  235.         { "thin", SLEN("thin") },
  236.         { "medium", SLEN("medium") },
  237.         { "thick", SLEN("thick") },
  238.         { "collapse", SLEN("collapse") },
  239.         { "separate", SLEN("separate") },
  240.         { "auto", SLEN("auto") },
  241.         { "ltr", SLEN("ltr") },
  242.         { "rtl", SLEN("rtl") },
  243.         { "inline", SLEN("inline") },
  244.         { "block", SLEN("block") },
  245.         { "list-item", SLEN("list-item") },
  246.         { "run-in", SLEN("run-in") },
  247.         { "inline-block", SLEN("inline-block") },
  248.         { "table", SLEN("table") },
  249.         { "inline-table", SLEN("inline-table") },
  250.         { "table-row-group", SLEN("table-row-group") },
  251.         { "table-header-group", SLEN("table-header-group") },
  252.         { "table-footer-group", SLEN("table-footer-group") },
  253.         { "table-row", SLEN("table-row") },
  254.         { "table-column-group", SLEN("table-column-group") },
  255.         { "table-column", SLEN("table-column") },
  256.         { "table-cell", SLEN("table-cell") },
  257.         { "table-caption", SLEN("table-caption") },
  258.         { "below", SLEN("below") },
  259.         { "level", SLEN("level") },
  260.         { "above", SLEN("above") },
  261.         { "higher", SLEN("higher") },
  262.         { "lower", SLEN("lower") },
  263.         { "show", SLEN("show") },
  264.         { "hide", SLEN("hide") },
  265.         { "xx-small", SLEN("xx-small") },
  266.         { "x-small", SLEN("x-small") },
  267.         { "small", SLEN("small") },
  268.         { "large", SLEN("large") },
  269.         { "x-large", SLEN("x-large") },
  270.         { "xx-large", SLEN("xx-large") },
  271.         { "larger", SLEN("larger") },
  272.         { "smaller", SLEN("smaller") },
  273.         { "normal", SLEN("normal") },
  274.         { "italic", SLEN("italic") },
  275.         { "oblique", SLEN("oblique") },
  276.         { "small-caps", SLEN("small-caps") },
  277.         { "bold", SLEN("bold") },
  278.         { "bolder", SLEN("bolder") },
  279.         { "lighter", SLEN("lighter") },
  280.         { "inside", SLEN("inside") },
  281.         { "outside", SLEN("outside") },
  282.         { "disc", SLEN("disc") },
  283.         { "circle", SLEN("circle") },
  284.         { "square", SLEN("square") },
  285.         { "decimal", SLEN("decimal") },
  286.         { "decimal-leading-zero", SLEN("decimal-leading-zero") },
  287.         { "lower-roman", SLEN("lower-roman") },
  288.         { "upper-roman", SLEN("upper-roman") },
  289.         { "lower-greek", SLEN("lower-greek") },
  290.         { "lower-latin", SLEN("lower-latin") },
  291.         { "upper-latin", SLEN("upper-latin") },
  292.         { "armenian", SLEN("armenian") },
  293.         { "georgian", SLEN("georgian") },
  294.         { "lower-alpha", SLEN("lower-alpha") },
  295.         { "upper-alpha", SLEN("upper-alpha") },
  296.         { "invert", SLEN("invert") },
  297.         { "visible", SLEN("visible") },
  298.         { "always", SLEN("always") },
  299.         { "avoid", SLEN("avoid") },
  300.         { "x-low", SLEN("x-low") },
  301.         { "low", SLEN("low") },
  302.         { "high", SLEN("high") },
  303.         { "x-high", SLEN("x-high") },
  304.         { "static", SLEN("static") },
  305.         { "relative", SLEN("relative") },
  306.         { "absolute", SLEN("absolute") },
  307.         { "once", SLEN("once") },
  308.         { "digits", SLEN("digits") },
  309.         { "continuous", SLEN("continuous") },
  310.         { "code", SLEN("code") },
  311.         { "spell-out", SLEN("spell-out") },
  312.         { "x-slow", SLEN("x-slow") },
  313.         { "slow", SLEN("slow") },
  314.         { "fast", SLEN("fast") },
  315.         { "x-fast", SLEN("x-fast") },
  316.         { "faster", SLEN("faster") },
  317.         { "slower", SLEN("slower") },
  318.         { "center", SLEN("center") },
  319.         { "justify", SLEN("justify") },
  320.         { "capitalize", SLEN("capitalize") },
  321.         { "uppercase", SLEN("uppercase") },
  322.         { "lowercase", SLEN("lowercase") },
  323.         { "embed", SLEN("embed") },
  324.         { "bidi-override", SLEN("bidi-override") },
  325.         { "baseline", SLEN("baseline") },
  326.         { "sub", SLEN("sub") },
  327.         { "super", SLEN("super") },
  328.         { "text-top", SLEN("text-top") },
  329.         { "middle", SLEN("middle") },
  330.         { "text-bottom", SLEN("text-bottom") },
  331.         { "silent", SLEN("silent") },
  332.         { "x-soft", SLEN("x-soft") },
  333.         { "soft", SLEN("soft") },
  334.         { "loud", SLEN("loud") },
  335.         { "x-loud", SLEN("x-loud") },
  336.         { "pre", SLEN("pre") },
  337.         { "nowrap", SLEN("nowrap") },
  338.         { "pre-wrap", SLEN("pre-wrap") },
  339.         { "pre-line", SLEN("pre-line") },
  340.         { "leftwards", SLEN("leftwards") },
  341.         { "rightwards", SLEN("rightwards") },
  342.         { "left-side", SLEN("left-side") },
  343.         { "far-left", SLEN("far-left") },
  344.         { "center-left", SLEN("center-left") },
  345.         { "center-right", SLEN("center-right") },
  346.         { "far-right", SLEN("far-right") },
  347.         { "right-side", SLEN("right-side") },
  348.         { "behind", SLEN("behind") },
  349.         { "rect", SLEN("rect") },
  350.         { "open-quote", SLEN("open-quote") },
  351.         { "close-quote", SLEN("close-quote") },
  352.         { "no-open-quote", SLEN("no-open-quote") },
  353.         { "no-close-quote", SLEN("no-close-quote") },
  354.         { "attr", SLEN("attr") },
  355.         { "counter", SLEN("counter") },
  356.         { "counters", SLEN("counters") },
  357.         { "crosshair", SLEN("crosshair") },
  358.         { "default", SLEN("default") },
  359.         { "pointer", SLEN("pointer") },
  360.         { "move", SLEN("move") },
  361.         { "e-resize", SLEN("e-resize") },
  362.         { "ne-resize", SLEN("ne-resize") },
  363.         { "nw-resize", SLEN("nw-resize") },
  364.         { "n-resize", SLEN("n-resize") },
  365.         { "se-resize", SLEN("se-resize") },
  366.         { "sw-resize", SLEN("sw-resize") },
  367.         { "s-resize", SLEN("s-resize") },
  368.         { "w-resize", SLEN("w-resize") },
  369.         { "text", SLEN("text") },
  370.         { "wait", SLEN("wait") },
  371.         { "help", SLEN("help") },
  372.         { "progress", SLEN("progress") },
  373.         { "serif", SLEN("serif") },
  374.         { "sans-serif", SLEN("sans-serif") },
  375.         { "cursive", SLEN("cursive") },
  376.         { "fantasy", SLEN("fantasy") },
  377.         { "monospace", SLEN("monospace") },
  378.         { "male", SLEN("male") },
  379.         { "female", SLEN("female") },
  380.         { "child", SLEN("child") },
  381.         { "mix", SLEN("mix") },
  382.         { "underline", SLEN("underline") },
  383.         { "overline", SLEN("overline") },
  384.         { "line-through", SLEN("line-through") },
  385.         { "blink", SLEN("blink") },
  386.         { "rgb", SLEN("rgb") },
  387.         { "rgba", SLEN("rgba") },
  388.         { "hsl", SLEN("hsl") },
  389.         { "hsla", SLEN("hsla") },
  390.         { "-libcss-left", SLEN("-libcss-left") },
  391.         { "-libcss-center", SLEN("-libcss-center") },
  392.         { "-libcss-right", SLEN("-libcss-right") },
  393.         { "currentColor", SLEN("currentColor") },
  394.         { "odd", SLEN("odd") },
  395.         { "even", SLEN("even") },
  396.         { "src", SLEN("src") },
  397.         { "local", SLEN("local") },
  398.         { "initial", SLEN("initial") },
  399.         { "format", SLEN("format") },
  400.         { "woff", SLEN("woff") },
  401.         { "truetype", SLEN("truetype") },
  402.         { "opentype", SLEN("opentype") },
  403.         { "embedded-opentype", SLEN("embedded-opentype") },
  404.         { "svg", SLEN("svg") },
  405.         { "column", SLEN("column") },
  406.         { "avoid-page", SLEN("avoid_page") },
  407.         { "avoid-column", SLEN("avoid-column") },
  408.         { "balance", SLEN("balance") },
  409.  
  410.         { "aliceblue", SLEN("aliceblue") },
  411.         { "antiquewhite", SLEN("antiquewhite") },
  412.         { "aqua", SLEN("aqua") },
  413.         { "aquamarine", SLEN("aquamarine") },
  414.         { "azure", SLEN("azure") },
  415.         { "beige", SLEN("beige") },
  416.         { "bisque", SLEN("bisque") },
  417.         { "black", SLEN("black") },
  418.         { "blanchedalmond", SLEN("blanchedalmond") },
  419.         { "blue", SLEN("blue") },
  420.         { "blueviolet", SLEN("blueviolet") },
  421.         { "brown", SLEN("brown") },
  422.         { "burlywood", SLEN("burlywood") },
  423.         { "cadetblue", SLEN("cadetblue") },
  424.         { "chartreuse", SLEN("chartreuse") },
  425.         { "chocolate", SLEN("chocolate") },
  426.         { "coral", SLEN("coral") },
  427.         { "cornflowerblue", SLEN("cornflowerblue") },
  428.         { "cornsilk", SLEN("cornsilk") },
  429.         { "crimson", SLEN("crimson") },
  430.         { "cyan", SLEN("cyan") },
  431.         { "darkblue", SLEN("darkblue") },
  432.         { "darkcyan", SLEN("darkcyan") },
  433.         { "darkgoldenrod", SLEN("darkgoldenrod") },
  434.         { "darkgray", SLEN("darkgray") },
  435.         { "darkgreen", SLEN("darkgreen") },
  436.         { "darkgrey", SLEN("darkgrey") },
  437.         { "darkkhaki", SLEN("darkkhaki") },
  438.         { "darkmagenta", SLEN("darkmagenta") },
  439.         { "darkolivegreen", SLEN("darkolivegreen") },
  440.         { "darkorange", SLEN("darkorange") },
  441.         { "darkorchid", SLEN("darkorchid") },
  442.         { "darkred", SLEN("darkred") },
  443.         { "darksalmon", SLEN("darksalmon") },
  444.         { "darkseagreen", SLEN("darkseagreen") },
  445.         { "darkslateblue", SLEN("darkslateblue") },
  446.         { "darkslategray", SLEN("darkslategray") },
  447.         { "darkslategrey", SLEN("darkslategrey") },
  448.         { "darkturquoise", SLEN("darkturquoise") },
  449.         { "darkviolet", SLEN("darkviolet") },
  450.         { "deeppink", SLEN("deeppink") },
  451.         { "deepskyblue", SLEN("deepskyblue") },
  452.         { "dimgray", SLEN("dimgray") },
  453.         { "dimgrey", SLEN("dimgrey") },
  454.         { "dodgerblue", SLEN("dodgerblue") },
  455.         { "feldspar", SLEN("feldspar") },
  456.         { "firebrick", SLEN("firebrick") },
  457.         { "floralwhite", SLEN("floralwhite") },
  458.         { "forestgreen", SLEN("forestgreen") },
  459.         { "fuchsia", SLEN("fuchsia") },
  460.         { "gainsboro", SLEN("gainsboro") },
  461.         { "ghostwhite", SLEN("ghostwhite") },
  462.         { "gold", SLEN("gold") },
  463.         { "goldenrod", SLEN("goldenrod") },
  464.         { "gray", SLEN("gray") },
  465.         { "green", SLEN("green") },
  466.         { "greenyellow", SLEN("greenyellow") },
  467.         { "grey", SLEN("grey") },
  468.         { "honeydew", SLEN("honeydew") },
  469.         { "hotpink", SLEN("hotpink") },
  470.         { "indianred", SLEN("indianred") },
  471.         { "indigo", SLEN("indigo") },
  472.         { "ivory", SLEN("ivory") },
  473.         { "khaki", SLEN("khaki") },
  474.         { "lavender", SLEN("lavender") },
  475.         { "lavenderblush", SLEN("lavenderblush") },
  476.         { "lawngreen", SLEN("lawngreen") },
  477.         { "lemonchiffon", SLEN("lemonchiffon") },
  478.         { "lightblue", SLEN("lightblue") },
  479.         { "lightcoral", SLEN("lightcoral") },
  480.         { "lightcyan", SLEN("lightcyan") },
  481.         { "lightgoldenrodyellow", SLEN("lightgoldenrodyellow") },
  482.         { "lightgray", SLEN("lightgray") },
  483.         { "lightgreen", SLEN("lightgreen") },
  484.         { "lightgrey", SLEN("lightgrey") },
  485.         { "lightpink", SLEN("lightpink") },
  486.         { "lightsalmon", SLEN("lightsalmon") },
  487.         { "lightseagreen", SLEN("lightseagreen") },
  488.         { "lightskyblue", SLEN("lightskyblue") },
  489.         { "lightslateblue", SLEN("lightslateblue") },
  490.         { "lightslategray", SLEN("lightslategray") },
  491.         { "lightslategrey", SLEN("lightslategrey") },
  492.         { "lightsteelblue", SLEN("lightsteelblue") },
  493.         { "lightyellow", SLEN("lightyellow") },
  494.         { "lime", SLEN("lime") },
  495.         { "limegreen", SLEN("limegreen") },
  496.         { "linen", SLEN("linen") },
  497.         { "magenta", SLEN("magenta") },
  498.         { "maroon", SLEN("maroon") },
  499.         { "mediumaquamarine", SLEN("mediumaquamarine") },
  500.         { "mediumblue", SLEN("mediumblue") },
  501.         { "mediumorchid", SLEN("mediumorchid") },
  502.         { "mediumpurple", SLEN("mediumpurple") },
  503.         { "mediumseagreen", SLEN("mediumseagreen") },
  504.         { "mediumslateblue", SLEN("mediumslateblue") },
  505.         { "mediumspringgreen", SLEN("mediumspringgreen") },
  506.         { "mediumturquoise", SLEN("mediumturquoise") },
  507.         { "mediumvioletred", SLEN("mediumvioletred") },
  508.         { "midnightblue", SLEN("midnightblue") },
  509.         { "mintcream", SLEN("mintcream") },
  510.         { "mistyrose", SLEN("mistyrose") },
  511.         { "moccasin", SLEN("moccasin") },
  512.         { "navajowhite", SLEN("navajowhite") },
  513.         { "navy", SLEN("navy") },
  514.         { "oldlace", SLEN("oldlace") },
  515.         { "olive", SLEN("olive") },
  516.         { "olivedrab", SLEN("olivedrab") },
  517.         { "orange", SLEN("orange") },
  518.         { "orangered", SLEN("orangered") },
  519.         { "orchid", SLEN("orchid") },
  520.         { "palegoldenrod", SLEN("palegoldenrod") },
  521.         { "palegreen", SLEN("palegreen") },
  522.         { "paleturquoise", SLEN("paleturquoise") },
  523.         { "palevioletred", SLEN("palevioletred") },
  524.         { "papayawhip", SLEN("papayawhip") },
  525.         { "peachpuff", SLEN("peachpuff") },
  526.         { "peru", SLEN("peru") },
  527.         { "pink", SLEN("pink") },
  528.         { "plum", SLEN("plum") },
  529.         { "powderblue", SLEN("powderblue") },
  530.         { "purple", SLEN("purple") },
  531.         { "red", SLEN("red") },
  532.         { "rosybrown", SLEN("rosybrown") },
  533.         { "royalblue", SLEN("royalblue") },
  534.         { "saddlebrown", SLEN("saddlebrown") },
  535.         { "salmon", SLEN("salmon") },
  536.         { "sandybrown", SLEN("sandybrown") },
  537.         { "seagreen", SLEN("seagreen") },
  538.         { "seashell", SLEN("seashell") },
  539.         { "sienna", SLEN("sienna") },
  540.         { "silver", SLEN("silver") },
  541.         { "skyblue", SLEN("skyblue") },
  542.         { "slateblue", SLEN("slateblue") },
  543.         { "slategray", SLEN("slategray") },
  544.         { "slategrey", SLEN("slategrey") },
  545.         { "snow", SLEN("snow") },
  546.         { "springgreen", SLEN("springgreen") },
  547.         { "steelblue", SLEN("steelblue") },
  548.         { "tan", SLEN("tan") },
  549.         { "teal", SLEN("teal") },
  550.         { "thistle", SLEN("thistle") },
  551.         { "tomato", SLEN("tomato") },
  552.         { "turquoise", SLEN("turquoise") },
  553.         { "violet", SLEN("violet") },
  554.         { "violetred", SLEN("violetred") },
  555.         { "wheat", SLEN("wheat") },
  556.         { "white", SLEN("white") },
  557.         { "whitesmoke", SLEN("whitesmoke") },
  558.         { "yellow", SLEN("yellow") },
  559.         { "yellowgreen", SLEN("yellowgreen") }
  560. };
  561.  
  562.  
  563. /**
  564.  * Obtain pointer to interned propstring list
  565.  *
  566.  * \param sheet     Returns pointer to propstring table
  567.  * \return CSS_OK on success,
  568.  *         CSS_NOMEM on memory exhaustion
  569.  *
  570.  * The propstring list is generated with the first call to this function and
  571.  * destroyed when it has no more users.  Call css__propstrings_unref() when
  572.  * finished with the propstring list.
  573.  */
  574. css_error css__propstrings_get(lwc_string ***strings)
  575. {
  576.         if (css__propstrings.count > 0) {
  577.                 css__propstrings.count++;
  578.         } else {
  579.                 int i;
  580.                 lwc_error lerror;
  581.  
  582.                 /* Intern all known strings */
  583.                 for (i = 0; i < LAST_KNOWN; i++) {
  584.                         lerror = lwc_intern_string(stringmap[i].data,
  585.                                         stringmap[i].len,
  586.                                         &css__propstrings.strings[i]);
  587.  
  588.                         if (lerror != lwc_error_ok)
  589.                                 return CSS_NOMEM;
  590.                 }
  591.                 css__propstrings.count++;
  592.         }
  593.  
  594.         *strings = css__propstrings.strings;
  595.  
  596.         return CSS_OK;
  597. }
  598.  
  599. /**
  600.  * Reduce reference count for propstring list by one.
  601.  *
  602.  * When count hits zero, the list is destroyed.
  603.  */
  604. void css__propstrings_unref(void)
  605. {
  606.         css__propstrings.count--;
  607.  
  608.         if (css__propstrings.count == 0) {
  609.                 int i;
  610.  
  611.                 for (i = 0; i < LAST_KNOWN; i++)
  612.                         lwc_string_unref(css__propstrings.strings[i]);
  613.         }
  614. }
  615.  
  616.  
  617.