summaryrefslogtreecommitdiff
path: root/src/testpattern/testpatterny.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testpattern/testpatterny.c')
-rw-r--r--src/testpattern/testpatterny.c143
1 files changed, 72 insertions, 71 deletions
diff --git a/src/testpattern/testpatterny.c b/src/testpattern/testpatterny.c
index 47bd3bf..da90dcc 100644
--- a/src/testpattern/testpatterny.c
+++ b/src/testpattern/testpatterny.c
@@ -71,6 +71,7 @@
#endif
#include <string.h>
+#include <strings.h>
#include <stdio.h>
#include <stdlib.h>
#include "testpattern.h"
@@ -131,7 +132,7 @@ find_color(const char *name)
/* Line 371 of yacc.c */
-#line 135 "testpatterny.c"
+#line 136 "testpatterny.c"
# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
@@ -292,7 +293,7 @@ int yyparse ();
/* Copy the second part of user declarations. */
/* Line 390 of yacc.c */
-#line 296 "testpatterny.c"
+#line 297 "testpatterny.c"
#ifdef short
# undef short
@@ -628,20 +629,20 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 143, 143, 143, 148, 158, 168, 178, 188, 198,
- 208, 218, 218, 218, 218, 218, 218, 218, 221, 229,
- 229, 232, 235, 245, 254, 264, 273, 280, 287, 294,
- 303, 312, 321, 321, 324, 334, 343, 352, 361, 375,
- 375, 375, 375, 375, 377, 384, 391, 398, 405, 412,
- 419, 426, 426, 426, 426, 428, 430, 437, 444, 452,
- 460, 475, 475, 478, 478, 481, 484, 498, 511, 511,
- 514, 514, 517, 517, 520, 520, 523, 538, 541, 556,
- 567, 584, 591, 591, 594, 597, 607, 613, 613, 616,
- 620, 624, 624, 624, 624, 624, 624, 625, 625, 625,
- 625, 625, 625, 625, 626, 626, 626, 626, 626, 626,
- 627, 627, 627, 627, 630, 634, 634, 634, 634, 637,
- 641, 641, 644, 648, 648, 651, 651, 654, 654, 659,
- 658
+ 0, 144, 144, 144, 149, 159, 169, 179, 189, 199,
+ 209, 219, 219, 219, 219, 219, 219, 219, 222, 230,
+ 230, 233, 236, 246, 255, 265, 274, 281, 288, 295,
+ 304, 313, 322, 322, 325, 335, 344, 353, 362, 376,
+ 376, 376, 376, 376, 378, 385, 392, 399, 406, 413,
+ 420, 427, 427, 427, 427, 429, 431, 438, 445, 453,
+ 461, 476, 476, 479, 479, 482, 485, 499, 512, 512,
+ 515, 515, 518, 518, 521, 521, 524, 539, 542, 557,
+ 568, 585, 592, 592, 595, 598, 608, 614, 614, 617,
+ 621, 625, 625, 625, 625, 625, 625, 626, 626, 626,
+ 626, 626, 626, 626, 627, 627, 627, 627, 627, 627,
+ 628, 628, 628, 628, 631, 635, 635, 635, 635, 638,
+ 642, 642, 645, 649, 649, 652, 652, 655, 655, 660,
+ 659
};
#endif
@@ -1682,14 +1683,14 @@ yyreduce:
{
case 3:
/* Line 1792 of yacc.c */
-#line 144 "testpatterny.y"
+#line 145 "testpatterny.y"
{
}
break;
case 4:
/* Line 1792 of yacc.c */
-#line 149 "testpatterny.y"
+#line 150 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>cmykspec\n");
@@ -1701,7 +1702,7 @@ yyreduce:
case 5:
/* Line 1792 of yacc.c */
-#line 159 "testpatterny.y"
+#line 160 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>kcmyspec\n");
@@ -1713,7 +1714,7 @@ yyreduce:
case 6:
/* Line 1792 of yacc.c */
-#line 169 "testpatterny.y"
+#line 170 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>rgbspec\n");
@@ -1725,7 +1726,7 @@ yyreduce:
case 7:
/* Line 1792 of yacc.c */
-#line 179 "testpatterny.y"
+#line 180 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>cmyspec\n");
@@ -1737,7 +1738,7 @@ yyreduce:
case 8:
/* Line 1792 of yacc.c */
-#line 189 "testpatterny.y"
+#line 190 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>grayspec\n");
@@ -1749,7 +1750,7 @@ yyreduce:
case 9:
/* Line 1792 of yacc.c */
-#line 199 "testpatterny.y"
+#line 200 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>whitespec\n");
@@ -1761,7 +1762,7 @@ yyreduce:
case 10:
/* Line 1792 of yacc.c */
-#line 209 "testpatterny.y"
+#line 210 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>extendedspec %d\n", (yyvsp[(2) - (2)].ival));
@@ -1773,7 +1774,7 @@ yyreduce:
case 18:
/* Line 1792 of yacc.c */
-#line 222 "testpatterny.y"
+#line 223 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>modespec2 %d\n", (yyvsp[(2) - (2)].ival));
@@ -1784,7 +1785,7 @@ yyreduce:
case 22:
/* Line 1792 of yacc.c */
-#line 236 "testpatterny.y"
+#line 237 "testpatterny.y"
{
int channel = find_color((yyvsp[(2) - (3)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -1796,7 +1797,7 @@ yyreduce:
case 23:
/* Line 1792 of yacc.c */
-#line 246 "testpatterny.y"
+#line 247 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>channel_level %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval));
@@ -1807,7 +1808,7 @@ yyreduce:
case 24:
/* Line 1792 of yacc.c */
-#line 255 "testpatterny.y"
+#line 256 "testpatterny.y"
{
int channel = find_color((yyvsp[(2) - (3)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -1819,7 +1820,7 @@ yyreduce:
case 25:
/* Line 1792 of yacc.c */
-#line 265 "testpatterny.y"
+#line 266 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>channel_gamma %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval));
@@ -1830,7 +1831,7 @@ yyreduce:
case 26:
/* Line 1792 of yacc.c */
-#line 274 "testpatterny.y"
+#line 275 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>global_gamma %f\n", (yyvsp[(2) - (2)].dval));
@@ -1840,7 +1841,7 @@ yyreduce:
case 27:
/* Line 1792 of yacc.c */
-#line 281 "testpatterny.y"
+#line 282 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>steps %d\n", (yyvsp[(2) - (2)].ival));
@@ -1850,7 +1851,7 @@ yyreduce:
case 28:
/* Line 1792 of yacc.c */
-#line 288 "testpatterny.y"
+#line 289 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>ink_limit %f\n", (yyvsp[(2) - (2)].dval));
@@ -1860,18 +1861,18 @@ yyreduce:
case 29:
/* Line 1792 of yacc.c */
-#line 295 "testpatterny.y"
+#line 296 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>printer %s\n", (yyvsp[(2) - (2)].sval));
- global_printer = strdup((yyvsp[(2) - (2)].sval));
+ global_printer = stp_strdup((yyvsp[(2) - (2)].sval));
free((yyvsp[(2) - (2)].sval));
}
break;
case 30:
/* Line 1792 of yacc.c */
-#line 304 "testpatterny.y"
+#line 305 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>page_size_name %s\n", (yyvsp[(2) - (2)].sval));
@@ -1882,7 +1883,7 @@ yyreduce:
case 31:
/* Line 1792 of yacc.c */
-#line 313 "testpatterny.y"
+#line 314 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>page_size_custom %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival));
@@ -1893,7 +1894,7 @@ yyreduce:
case 34:
/* Line 1792 of yacc.c */
-#line 325 "testpatterny.y"
+#line 326 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_string %s %s\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval));
@@ -1905,7 +1906,7 @@ yyreduce:
case 35:
/* Line 1792 of yacc.c */
-#line 335 "testpatterny.y"
+#line 336 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_int %s %d\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival));
@@ -1916,7 +1917,7 @@ yyreduce:
case 36:
/* Line 1792 of yacc.c */
-#line 344 "testpatterny.y"
+#line 345 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_bool %s %d\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival));
@@ -1927,7 +1928,7 @@ yyreduce:
case 37:
/* Line 1792 of yacc.c */
-#line 353 "testpatterny.y"
+#line 354 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>parameter_float %s %f\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].dval));
@@ -1938,7 +1939,7 @@ yyreduce:
case 38:
/* Line 1792 of yacc.c */
-#line 362 "testpatterny.y"
+#line 363 "testpatterny.y"
{
stp_curve_t *curve = stp_curve_create_from_string((yyvsp[(3) - (3)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -1954,7 +1955,7 @@ yyreduce:
case 44:
/* Line 1792 of yacc.c */
-#line 378 "testpatterny.y"
+#line 379 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>density %f\n", (yyvsp[(2) - (2)].dval));
@@ -1964,7 +1965,7 @@ yyreduce:
case 45:
/* Line 1792 of yacc.c */
-#line 385 "testpatterny.y"
+#line 386 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>top %f\n", (yyvsp[(2) - (2)].dval));
@@ -1974,7 +1975,7 @@ yyreduce:
case 46:
/* Line 1792 of yacc.c */
-#line 392 "testpatterny.y"
+#line 393 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>left %f\n", (yyvsp[(2) - (2)].dval));
@@ -1984,7 +1985,7 @@ yyreduce:
case 47:
/* Line 1792 of yacc.c */
-#line 399 "testpatterny.y"
+#line 400 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>relative size\n");
@@ -1994,7 +1995,7 @@ yyreduce:
case 48:
/* Line 1792 of yacc.c */
-#line 406 "testpatterny.y"
+#line 407 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>size inches\n");
@@ -2004,7 +2005,7 @@ yyreduce:
case 49:
/* Line 1792 of yacc.c */
-#line 413 "testpatterny.y"
+#line 414 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>size pt\n");
@@ -2014,7 +2015,7 @@ yyreduce:
case 50:
/* Line 1792 of yacc.c */
-#line 420 "testpatterny.y"
+#line 421 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>size mm\n");
@@ -2024,7 +2025,7 @@ yyreduce:
case 56:
/* Line 1792 of yacc.c */
-#line 431 "testpatterny.y"
+#line 432 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>hsize %f\n", (yyvsp[(2) - (2)].dval));
@@ -2034,7 +2035,7 @@ yyreduce:
case 57:
/* Line 1792 of yacc.c */
-#line 438 "testpatterny.y"
+#line 439 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>vsize %f\n", (yyvsp[(2) - (2)].dval));
@@ -2044,7 +2045,7 @@ yyreduce:
case 58:
/* Line 1792 of yacc.c */
-#line 445 "testpatterny.y"
+#line 446 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>blackline %d\n", (yyvsp[(2) - (2)].ival));
@@ -2054,7 +2055,7 @@ yyreduce:
case 59:
/* Line 1792 of yacc.c */
-#line 453 "testpatterny.y"
+#line 454 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>noscale %d\n", (yyvsp[(2) - (2)].ival));
@@ -2064,7 +2065,7 @@ yyreduce:
case 60:
/* Line 1792 of yacc.c */
-#line 461 "testpatterny.y"
+#line 462 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>color_block1 %f %f %f (%d)\n", (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].dval), (yyvsp[(3) - (3)].dval),
@@ -2081,7 +2082,7 @@ yyreduce:
case 66:
/* Line 1792 of yacc.c */
-#line 485 "testpatterny.y"
+#line 486 "testpatterny.y"
{
int channel = find_color((yyvsp[(1) - (4)].sval));
if (getenv("STP_TESTPATTERN_DEBUG"))
@@ -2097,7 +2098,7 @@ yyreduce:
case 67:
/* Line 1792 of yacc.c */
-#line 499 "testpatterny.y"
+#line 500 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>color_block2b %d %f %f %f\n", (yyvsp[(2) - (5)].ival), (yyvsp[(3) - (5)].dval), (yyvsp[(4) - (5)].dval), (yyvsp[(5) - (5)].dval));
@@ -2112,7 +2113,7 @@ yyreduce:
case 76:
/* Line 1792 of yacc.c */
-#line 524 "testpatterny.y"
+#line 525 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>patvars %f %f %f %f %f\n", (yyvsp[(1) - (5)].dval), (yyvsp[(2) - (5)].dval), (yyvsp[(3) - (5)].dval), (yyvsp[(4) - (5)].dval), (yyvsp[(5) - (5)].dval));
@@ -2129,7 +2130,7 @@ yyreduce:
case 78:
/* Line 1792 of yacc.c */
-#line 542 "testpatterny.y"
+#line 543 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>xpattern\n");
@@ -2146,7 +2147,7 @@ yyreduce:
case 79:
/* Line 1792 of yacc.c */
-#line 557 "testpatterny.y"
+#line 558 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>grid %d\n", (yyvsp[(2) - (2)].ival));
@@ -2159,7 +2160,7 @@ yyreduce:
case 80:
/* Line 1792 of yacc.c */
-#line 568 "testpatterny.y"
+#line 569 "testpatterny.y"
{
if (getenv("STP_TESTPATTERN_DEBUG"))
fprintf(stderr, ">>>image %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival));
@@ -2178,7 +2179,7 @@ yyreduce:
case 81:
/* Line 1792 of yacc.c */
-#line 585 "testpatterny.y"
+#line 586 "testpatterny.y"
{
fprintf(stderr,"%s",(yyvsp[(1) - (1)].sval));
free((yyvsp[(1) - (1)].sval));
@@ -2187,7 +2188,7 @@ yyreduce:
case 85:
/* Line 1792 of yacc.c */
-#line 598 "testpatterny.y"
+#line 599 "testpatterny.y"
{
close_output();
if (global_output)
@@ -2199,7 +2200,7 @@ yyreduce:
case 86:
/* Line 1792 of yacc.c */
-#line 608 "testpatterny.y"
+#line 609 "testpatterny.y"
{
global_output = (yyvsp[(2) - (2)].sval);
}
@@ -2207,43 +2208,43 @@ yyreduce:
case 89:
/* Line 1792 of yacc.c */
-#line 617 "testpatterny.y"
+#line 618 "testpatterny.y"
{ start_job = 1; }
break;
case 90:
/* Line 1792 of yacc.c */
-#line 621 "testpatterny.y"
+#line 622 "testpatterny.y"
{ end_job = 1; }
break;
case 114:
/* Line 1792 of yacc.c */
-#line 631 "testpatterny.y"
+#line 632 "testpatterny.y"
{ global_did_something = 1; }
break;
case 119:
/* Line 1792 of yacc.c */
-#line 638 "testpatterny.y"
+#line 639 "testpatterny.y"
{ global_did_something = 1; }
break;
case 122:
/* Line 1792 of yacc.c */
-#line 645 "testpatterny.y"
+#line 646 "testpatterny.y"
{ global_did_something = 1; }
break;
case 128:
/* Line 1792 of yacc.c */
-#line 655 "testpatterny.y"
+#line 656 "testpatterny.y"
{ return 0; }
break;
case 129:
/* Line 1792 of yacc.c */
-#line 659 "testpatterny.y"
+#line 660 "testpatterny.y"
{
current_testpattern = get_next_testpattern();
}
@@ -2251,7 +2252,7 @@ yyreduce:
/* Line 1792 of yacc.c */
-#line 2255 "testpatterny.c"
+#line 2256 "testpatterny.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -2483,5 +2484,5 @@ yyreturn:
/* Line 2055 of yacc.c */
-#line 665 "testpatterny.y"
+#line 666 "testpatterny.y"