1706f2543Smrg/* A Bison parser, made by GNU Bison 2.5. */ 2706f2543Smrg 3706f2543Smrg/* Bison implementation for Yacc-like parsers in C 4706f2543Smrg 5706f2543Smrg Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 6706f2543Smrg 7706f2543Smrg This program is free software: you can redistribute it and/or modify 8706f2543Smrg it under the terms of the GNU General Public License as published by 9706f2543Smrg the Free Software Foundation, either version 3 of the License, or 10706f2543Smrg (at your option) any later version. 11706f2543Smrg 12706f2543Smrg This program is distributed in the hope that it will be useful, 13706f2543Smrg but WITHOUT ANY WARRANTY; without even the implied warranty of 14706f2543Smrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15706f2543Smrg GNU General Public License for more details. 16706f2543Smrg 17706f2543Smrg You should have received a copy of the GNU General Public License 18706f2543Smrg along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19706f2543Smrg 20706f2543Smrg/* As a special exception, you may create a larger work that contains 21706f2543Smrg part or all of the Bison parser skeleton and distribute that work 22706f2543Smrg under terms of your choice, so long as that work isn't itself a 23706f2543Smrg parser generator using the skeleton or a modified version thereof 24706f2543Smrg as a parser skeleton. Alternatively, if you modify or redistribute 25706f2543Smrg the parser skeleton itself, you may (at your option) remove this 26706f2543Smrg special exception, which will cause the skeleton and the resulting 27706f2543Smrg Bison output files to be licensed under the GNU General Public 28706f2543Smrg License without this special exception. 29706f2543Smrg 30706f2543Smrg This special exception was added by the Free Software Foundation in 31706f2543Smrg version 2.2 of Bison. */ 32706f2543Smrg 33706f2543Smrg/* C LALR(1) parser skeleton written by Richard Stallman, by 34706f2543Smrg simplifying the original so-called "semantic" parser. */ 35706f2543Smrg 36706f2543Smrg/* All symbols defined below should begin with yy or YY, to avoid 37706f2543Smrg infringing on user name space. This should be done even for local 38706f2543Smrg variables, as they might otherwise be expanded by user macros. 39706f2543Smrg There are some unavoidable exceptions within include files to 40706f2543Smrg define necessary library symbols; they are noted "INFRINGES ON 41706f2543Smrg USER NAME SPACE" below. */ 42706f2543Smrg 43706f2543Smrg/* Identify Bison output. */ 44706f2543Smrg#define YYBISON 1 45706f2543Smrg 46706f2543Smrg/* Bison version. */ 47706f2543Smrg#define YYBISON_VERSION "2.5" 48706f2543Smrg 49706f2543Smrg/* Skeleton name. */ 50706f2543Smrg#define YYSKELETON_NAME "yacc.c" 51706f2543Smrg 52706f2543Smrg/* Pure parsers. */ 53706f2543Smrg#define YYPURE 0 54706f2543Smrg 55706f2543Smrg/* Push parsers. */ 56706f2543Smrg#define YYPUSH 0 57706f2543Smrg 58706f2543Smrg/* Pull parsers. */ 59706f2543Smrg#define YYPULL 1 60706f2543Smrg 61706f2543Smrg/* Using locations. */ 62706f2543Smrg#define YYLSP_NEEDED 0 63706f2543Smrg 64706f2543Smrg 65706f2543Smrg 66706f2543Smrg/* Copy the first part of user declarations. */ 67706f2543Smrg 68706f2543Smrg/* Line 268 of yacc.c */ 69706f2543Smrg#line 1 "winprefsyacc.y" 70706f2543Smrg 71706f2543Smrg/* 72706f2543Smrg * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. 73706f2543Smrg * Copyright (C) Colin Harrison 2005-2008 74706f2543Smrg * 75706f2543Smrg * Permission is hereby granted, free of charge, to any person obtaining 76706f2543Smrg * a copy of this software and associated documentation files (the 77706f2543Smrg * "Software"), to deal in the Software without restriction, including 78706f2543Smrg * without limitation the rights to use, copy, modify, merge, publish, 79706f2543Smrg * distribute, sublicense, and/or sell copies of the Software, and to 80706f2543Smrg * permit persons to whom the Software is furnished to do so, subject to 81706f2543Smrg * the following conditions: 82706f2543Smrg * 83706f2543Smrg * The above copyright notice and this permission notice shall be 84706f2543Smrg * included in all copies or substantial portions of the Software. 85706f2543Smrg * 86706f2543Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 87706f2543Smrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 88706f2543Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 89706f2543Smrg * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR 90706f2543Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 91706f2543Smrg * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 92706f2543Smrg * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 93706f2543Smrg * 94706f2543Smrg * Except as contained in this notice, the name of the XFree86 Project 95706f2543Smrg * shall not be used in advertising or otherwise to promote the sale, use 96706f2543Smrg * or other dealings in this Software without prior written authorization 97706f2543Smrg * from the XFree86 Project. 98706f2543Smrg * 99706f2543Smrg * Authors: Earle F. Philhower, III 100706f2543Smrg * Colin Harrison 101706f2543Smrg */ 102706f2543Smrg/* $XFree86: $ */ 103706f2543Smrg 104706f2543Smrg#ifdef HAVE_XWIN_CONFIG_H 105706f2543Smrg#include <xwin-config.h> 106706f2543Smrg#endif 107706f2543Smrg#include <stdio.h> 108706f2543Smrg#include <stdlib.h> 109706f2543Smrg#include <string.h> 110706f2543Smrg#include "winprefs.h" 111706f2543Smrg 112706f2543Smrg/* The following give better error messages in bison at the cost of a few KB */ 113706f2543Smrg#define YYERROR_VERBOSE 1 114706f2543Smrg 115706f2543Smrg/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */ 116706f2543Smrg#define YYLTYPE_IS_TRIVIAL 1 117706f2543Smrg#define YYENABLE_NLS 0 118706f2543Smrg 119706f2543Smrg/* The global pref settings */ 120706f2543SmrgWINPREFS pref; 121706f2543Smrg 122706f2543Smrg/* The working menu */ 123706f2543Smrgstatic MENUPARSED menu; 124706f2543Smrg 125706f2543Smrg/* Functions for parsing the tokens into out structure */ 126706f2543Smrg/* Defined at the end section of this file */ 127706f2543Smrg 128706f2543Smrgstatic void SetIconDirectory (char *path); 129706f2543Smrgstatic void SetDefaultIcon (char *fname); 130706f2543Smrgstatic void SetRootMenu (char *menu); 131706f2543Smrgstatic void SetDefaultSysMenu (char *menu, int pos); 132706f2543Smrgstatic void SetTrayIcon (char *fname); 133706f2543Smrg 134706f2543Smrgstatic void OpenMenu(char *menuname); 135706f2543Smrgstatic void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param); 136706f2543Smrgstatic void CloseMenu(void); 137706f2543Smrg 138706f2543Smrgstatic void OpenIcons(void); 139706f2543Smrgstatic void AddIconLine(char *matchstr, char *iconfile); 140706f2543Smrgstatic void CloseIcons(void); 141706f2543Smrg 142706f2543Smrgstatic void OpenStyles(void); 143706f2543Smrgstatic void AddStyleLine(char *matchstr, unsigned long style); 144706f2543Smrgstatic void CloseStyles(void); 145706f2543Smrg 146706f2543Smrgstatic void OpenSysMenu(void); 147706f2543Smrgstatic void AddSysMenuLine(char *matchstr, char *menuname, int pos); 148706f2543Smrgstatic void CloseSysMenu(void); 149706f2543Smrg 150706f2543Smrgstatic int yyerror (char *s); 151706f2543Smrg 152706f2543Smrgextern void ErrorF (const char* /*f*/, ...); 153706f2543Smrgextern char *yytext; 154706f2543Smrgextern int yylex(void); 155706f2543Smrg 156706f2543Smrg 157706f2543Smrg 158706f2543Smrg/* Line 268 of yacc.c */ 159706f2543Smrg#line 160 "winprefsyacc.c" 160706f2543Smrg 161706f2543Smrg/* Enabling traces. */ 162706f2543Smrg#ifndef YYDEBUG 163706f2543Smrg# define YYDEBUG 0 164706f2543Smrg#endif 165706f2543Smrg 166706f2543Smrg/* Enabling verbose error messages. */ 167706f2543Smrg#ifdef YYERROR_VERBOSE 168706f2543Smrg# undef YYERROR_VERBOSE 169706f2543Smrg# define YYERROR_VERBOSE 1 170706f2543Smrg#else 171706f2543Smrg# define YYERROR_VERBOSE 0 172706f2543Smrg#endif 173706f2543Smrg 174706f2543Smrg/* Enabling the token table. */ 175706f2543Smrg#ifndef YYTOKEN_TABLE 176706f2543Smrg# define YYTOKEN_TABLE 0 177706f2543Smrg#endif 178706f2543Smrg 179706f2543Smrg 180706f2543Smrg/* Tokens. */ 181706f2543Smrg#ifndef YYTOKENTYPE 182706f2543Smrg# define YYTOKENTYPE 183706f2543Smrg /* Put the tokens into the symbol table, so that GDB and other debuggers 184706f2543Smrg know about them. */ 185706f2543Smrg enum yytokentype { 186706f2543Smrg NEWLINE = 258, 187706f2543Smrg MENU = 259, 188706f2543Smrg LB = 260, 189706f2543Smrg RB = 261, 190706f2543Smrg ICONDIRECTORY = 262, 191706f2543Smrg DEFAULTICON = 263, 192706f2543Smrg ICONS = 264, 193706f2543Smrg STYLES = 265, 194706f2543Smrg TOPMOST = 266, 195706f2543Smrg MAXIMIZE = 267, 196706f2543Smrg MINIMIZE = 268, 197706f2543Smrg BOTTOM = 269, 198706f2543Smrg NOTITLE = 270, 199706f2543Smrg OUTLINE = 271, 200706f2543Smrg NOFRAME = 272, 201706f2543Smrg DEFAULTSYSMENU = 273, 202706f2543Smrg SYSMENU = 274, 203706f2543Smrg ROOTMENU = 275, 204706f2543Smrg SEPARATOR = 276, 205706f2543Smrg ATSTART = 277, 206706f2543Smrg ATEND = 278, 207706f2543Smrg EXEC = 279, 208706f2543Smrg ALWAYSONTOP = 280, 209706f2543Smrg DEBUGOUTPUT = 281, 210706f2543Smrg RELOAD = 282, 211706f2543Smrg TRAYICON = 283, 212706f2543Smrg FORCEEXIT = 284, 213706f2543Smrg SILENTEXIT = 285, 214706f2543Smrg STRING = 286 215706f2543Smrg }; 216706f2543Smrg#endif 217706f2543Smrg/* Tokens. */ 218706f2543Smrg#define NEWLINE 258 219706f2543Smrg#define MENU 259 220706f2543Smrg#define LB 260 221706f2543Smrg#define RB 261 222706f2543Smrg#define ICONDIRECTORY 262 223706f2543Smrg#define DEFAULTICON 263 224706f2543Smrg#define ICONS 264 225706f2543Smrg#define STYLES 265 226706f2543Smrg#define TOPMOST 266 227706f2543Smrg#define MAXIMIZE 267 228706f2543Smrg#define MINIMIZE 268 229706f2543Smrg#define BOTTOM 269 230706f2543Smrg#define NOTITLE 270 231706f2543Smrg#define OUTLINE 271 232706f2543Smrg#define NOFRAME 272 233706f2543Smrg#define DEFAULTSYSMENU 273 234706f2543Smrg#define SYSMENU 274 235706f2543Smrg#define ROOTMENU 275 236706f2543Smrg#define SEPARATOR 276 237706f2543Smrg#define ATSTART 277 238706f2543Smrg#define ATEND 278 239706f2543Smrg#define EXEC 279 240706f2543Smrg#define ALWAYSONTOP 280 241706f2543Smrg#define DEBUGOUTPUT 281 242706f2543Smrg#define RELOAD 282 243706f2543Smrg#define TRAYICON 283 244706f2543Smrg#define FORCEEXIT 284 245706f2543Smrg#define SILENTEXIT 285 246706f2543Smrg#define STRING 286 247706f2543Smrg 248706f2543Smrg 249706f2543Smrg 250706f2543Smrg 251706f2543Smrg#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 252706f2543Smrgtypedef union YYSTYPE 253706f2543Smrg{ 254706f2543Smrg 255706f2543Smrg/* Line 293 of yacc.c */ 256706f2543Smrg#line 89 "winprefsyacc.y" 257706f2543Smrg 258706f2543Smrg char *sVal; 259706f2543Smrg unsigned long uVal; 260706f2543Smrg int iVal; 261706f2543Smrg 262706f2543Smrg 263706f2543Smrg 264706f2543Smrg/* Line 293 of yacc.c */ 265706f2543Smrg#line 266 "winprefsyacc.c" 266706f2543Smrg} YYSTYPE; 267706f2543Smrg# define YYSTYPE_IS_TRIVIAL 1 268706f2543Smrg# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 269706f2543Smrg# define YYSTYPE_IS_DECLARED 1 270706f2543Smrg#endif 271706f2543Smrg 272706f2543Smrg 273706f2543Smrg/* Copy the second part of user declarations. */ 274706f2543Smrg 275706f2543Smrg 276706f2543Smrg/* Line 343 of yacc.c */ 277706f2543Smrg#line 278 "winprefsyacc.c" 278706f2543Smrg 279706f2543Smrg#ifdef short 280706f2543Smrg# undef short 281706f2543Smrg#endif 282706f2543Smrg 283706f2543Smrg#ifdef YYTYPE_UINT8 284706f2543Smrgtypedef YYTYPE_UINT8 yytype_uint8; 285706f2543Smrg#else 286706f2543Smrgtypedef unsigned char yytype_uint8; 287706f2543Smrg#endif 288706f2543Smrg 289706f2543Smrg#ifdef YYTYPE_INT8 290706f2543Smrgtypedef YYTYPE_INT8 yytype_int8; 291706f2543Smrg#elif (defined __STDC__ || defined __C99__FUNC__ \ 292706f2543Smrg || defined __cplusplus || defined _MSC_VER) 293706f2543Smrgtypedef signed char yytype_int8; 294706f2543Smrg#else 295706f2543Smrgtypedef short int yytype_int8; 296706f2543Smrg#endif 297706f2543Smrg 298706f2543Smrg#ifdef YYTYPE_UINT16 299706f2543Smrgtypedef YYTYPE_UINT16 yytype_uint16; 300706f2543Smrg#else 301706f2543Smrgtypedef unsigned short int yytype_uint16; 302706f2543Smrg#endif 303706f2543Smrg 304706f2543Smrg#ifdef YYTYPE_INT16 305706f2543Smrgtypedef YYTYPE_INT16 yytype_int16; 306706f2543Smrg#else 307706f2543Smrgtypedef short int yytype_int16; 308706f2543Smrg#endif 309706f2543Smrg 310706f2543Smrg#ifndef YYSIZE_T 311706f2543Smrg# ifdef __SIZE_TYPE__ 312706f2543Smrg# define YYSIZE_T __SIZE_TYPE__ 313706f2543Smrg# elif defined size_t 314706f2543Smrg# define YYSIZE_T size_t 315706f2543Smrg# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 316706f2543Smrg || defined __cplusplus || defined _MSC_VER) 317706f2543Smrg# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 318706f2543Smrg# define YYSIZE_T size_t 319706f2543Smrg# else 320706f2543Smrg# define YYSIZE_T unsigned int 321706f2543Smrg# endif 322706f2543Smrg#endif 323706f2543Smrg 324706f2543Smrg#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 325706f2543Smrg 326706f2543Smrg#ifndef YY_ 327706f2543Smrg# if defined YYENABLE_NLS && YYENABLE_NLS 328706f2543Smrg# if ENABLE_NLS 329706f2543Smrg# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 330706f2543Smrg# define YY_(msgid) dgettext ("bison-runtime", msgid) 331706f2543Smrg# endif 332706f2543Smrg# endif 333706f2543Smrg# ifndef YY_ 334706f2543Smrg# define YY_(msgid) msgid 335706f2543Smrg# endif 336706f2543Smrg#endif 337706f2543Smrg 338706f2543Smrg/* Suppress unused-variable warnings by "using" E. */ 339706f2543Smrg#if ! defined lint || defined __GNUC__ 340706f2543Smrg# define YYUSE(e) ((void) (e)) 341706f2543Smrg#else 342706f2543Smrg# define YYUSE(e) /* empty */ 343706f2543Smrg#endif 344706f2543Smrg 345706f2543Smrg/* Identity function, used to suppress warnings about constant conditions. */ 346706f2543Smrg#ifndef lint 347706f2543Smrg# define YYID(n) (n) 348706f2543Smrg#else 349706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 350706f2543Smrg || defined __cplusplus || defined _MSC_VER) 351706f2543Smrgstatic int 352706f2543SmrgYYID (int yyi) 353706f2543Smrg#else 354706f2543Smrgstatic int 355706f2543SmrgYYID (yyi) 356706f2543Smrg int yyi; 357706f2543Smrg#endif 358706f2543Smrg{ 359706f2543Smrg return yyi; 360706f2543Smrg} 361706f2543Smrg#endif 362706f2543Smrg 363706f2543Smrg#if ! defined yyoverflow || YYERROR_VERBOSE 364706f2543Smrg 365706f2543Smrg/* The parser invokes alloca or malloc; define the necessary symbols. */ 366706f2543Smrg 367706f2543Smrg# ifdef YYSTACK_USE_ALLOCA 368706f2543Smrg# if YYSTACK_USE_ALLOCA 369706f2543Smrg# ifdef __GNUC__ 370706f2543Smrg# define YYSTACK_ALLOC __builtin_alloca 371706f2543Smrg# elif defined __BUILTIN_VA_ARG_INCR 372706f2543Smrg# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 373706f2543Smrg# elif defined _AIX 374706f2543Smrg# define YYSTACK_ALLOC __alloca 375706f2543Smrg# elif defined _MSC_VER 376706f2543Smrg# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 377706f2543Smrg# define alloca _alloca 378706f2543Smrg# else 379706f2543Smrg# define YYSTACK_ALLOC alloca 380706f2543Smrg# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 381706f2543Smrg || defined __cplusplus || defined _MSC_VER) 382706f2543Smrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 383706f2543Smrg# ifndef EXIT_SUCCESS 384706f2543Smrg# define EXIT_SUCCESS 0 385706f2543Smrg# endif 386706f2543Smrg# endif 387706f2543Smrg# endif 388706f2543Smrg# endif 389706f2543Smrg# endif 390706f2543Smrg 391706f2543Smrg# ifdef YYSTACK_ALLOC 392706f2543Smrg /* Pacify GCC's `empty if-body' warning. */ 393706f2543Smrg# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 394706f2543Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 395706f2543Smrg /* The OS might guarantee only one guard page at the bottom of the stack, 396706f2543Smrg and a page size can be as small as 4096 bytes. So we cannot safely 397706f2543Smrg invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 398706f2543Smrg to allow for a few compiler-allocated temporary stack slots. */ 399706f2543Smrg# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 400706f2543Smrg# endif 401706f2543Smrg# else 402706f2543Smrg# define YYSTACK_ALLOC YYMALLOC 403706f2543Smrg# define YYSTACK_FREE YYFREE 404706f2543Smrg# ifndef YYSTACK_ALLOC_MAXIMUM 405706f2543Smrg# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 406706f2543Smrg# endif 407706f2543Smrg# if (defined __cplusplus && ! defined EXIT_SUCCESS \ 408706f2543Smrg && ! ((defined YYMALLOC || defined malloc) \ 409706f2543Smrg && (defined YYFREE || defined free))) 410706f2543Smrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 411706f2543Smrg# ifndef EXIT_SUCCESS 412706f2543Smrg# define EXIT_SUCCESS 0 413706f2543Smrg# endif 414706f2543Smrg# endif 415706f2543Smrg# ifndef YYMALLOC 416706f2543Smrg# define YYMALLOC malloc 417706f2543Smrg# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 418706f2543Smrg || defined __cplusplus || defined _MSC_VER) 419706f2543Smrgvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 420706f2543Smrg# endif 421706f2543Smrg# endif 422706f2543Smrg# ifndef YYFREE 423706f2543Smrg# define YYFREE free 424706f2543Smrg# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 425706f2543Smrg || defined __cplusplus || defined _MSC_VER) 426706f2543Smrgvoid free (void *); /* INFRINGES ON USER NAME SPACE */ 427706f2543Smrg# endif 428706f2543Smrg# endif 429706f2543Smrg# endif 430706f2543Smrg#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 431706f2543Smrg 432706f2543Smrg 433706f2543Smrg#if (! defined yyoverflow \ 434706f2543Smrg && (! defined __cplusplus \ 435706f2543Smrg || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 436706f2543Smrg 437706f2543Smrg/* A type that is properly aligned for any stack member. */ 438706f2543Smrgunion yyalloc 439706f2543Smrg{ 440706f2543Smrg yytype_int16 yyss_alloc; 441706f2543Smrg YYSTYPE yyvs_alloc; 442706f2543Smrg}; 443706f2543Smrg 444706f2543Smrg/* The size of the maximum gap between one aligned stack and the next. */ 445706f2543Smrg# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 446706f2543Smrg 447706f2543Smrg/* The size of an array large to enough to hold all stacks, each with 448706f2543Smrg N elements. */ 449706f2543Smrg# define YYSTACK_BYTES(N) \ 450706f2543Smrg ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 451706f2543Smrg + YYSTACK_GAP_MAXIMUM) 452706f2543Smrg 453706f2543Smrg# define YYCOPY_NEEDED 1 454706f2543Smrg 455706f2543Smrg/* Relocate STACK from its old location to the new one. The 456706f2543Smrg local variables YYSIZE and YYSTACKSIZE give the old and new number of 457706f2543Smrg elements in the stack, and YYPTR gives the new location of the 458706f2543Smrg stack. Advance YYPTR to a properly aligned location for the next 459706f2543Smrg stack. */ 460706f2543Smrg# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 461706f2543Smrg do \ 462706f2543Smrg { \ 463706f2543Smrg YYSIZE_T yynewbytes; \ 464706f2543Smrg YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 465706f2543Smrg Stack = &yyptr->Stack_alloc; \ 466706f2543Smrg yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 467706f2543Smrg yyptr += yynewbytes / sizeof (*yyptr); \ 468706f2543Smrg } \ 469706f2543Smrg while (YYID (0)) 470706f2543Smrg 471706f2543Smrg#endif 472706f2543Smrg 473706f2543Smrg#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 474706f2543Smrg/* Copy COUNT objects from FROM to TO. The source and destination do 475706f2543Smrg not overlap. */ 476706f2543Smrg# ifndef YYCOPY 477706f2543Smrg# if defined __GNUC__ && 1 < __GNUC__ 478706f2543Smrg# define YYCOPY(To, From, Count) \ 479706f2543Smrg __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 480706f2543Smrg# else 481706f2543Smrg# define YYCOPY(To, From, Count) \ 482706f2543Smrg do \ 483706f2543Smrg { \ 484706f2543Smrg YYSIZE_T yyi; \ 485706f2543Smrg for (yyi = 0; yyi < (Count); yyi++) \ 486706f2543Smrg (To)[yyi] = (From)[yyi]; \ 487706f2543Smrg } \ 488706f2543Smrg while (YYID (0)) 489706f2543Smrg# endif 490706f2543Smrg# endif 491706f2543Smrg#endif /* !YYCOPY_NEEDED */ 492706f2543Smrg 493706f2543Smrg/* YYFINAL -- State number of the termination state. */ 494706f2543Smrg#define YYFINAL 2 495706f2543Smrg/* YYLAST -- Last index in YYTABLE. */ 496706f2543Smrg#define YYLAST 98 497706f2543Smrg 498706f2543Smrg/* YYNTOKENS -- Number of terminals. */ 499706f2543Smrg#define YYNTOKENS 32 500706f2543Smrg/* YYNNTS -- Number of nonterminals. */ 501706f2543Smrg#define YYNNTS 33 502706f2543Smrg/* YYNRULES -- Number of rules. */ 503706f2543Smrg#define YYNRULES 65 504706f2543Smrg/* YYNRULES -- Number of states. */ 505706f2543Smrg#define YYNSTATES 121 506706f2543Smrg 507706f2543Smrg/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 508706f2543Smrg#define YYUNDEFTOK 2 509706f2543Smrg#define YYMAXUTOK 286 510706f2543Smrg 511706f2543Smrg#define YYTRANSLATE(YYX) \ 512706f2543Smrg ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 513706f2543Smrg 514706f2543Smrg/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 515706f2543Smrgstatic const yytype_uint8 yytranslate[] = 516706f2543Smrg{ 517706f2543Smrg 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 518706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 519706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 520706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 521706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 522706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 523706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 524706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 525706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 526706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 527706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 528706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 529706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 530706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 531706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 532706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 533706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 534706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 535706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 536706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 537706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 538706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 539706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 540706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 541706f2543Smrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 542706f2543Smrg 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 543706f2543Smrg 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 544706f2543Smrg 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 545706f2543Smrg 25, 26, 27, 28, 29, 30, 31 546706f2543Smrg}; 547706f2543Smrg 548706f2543Smrg#if YYDEBUG 549706f2543Smrg/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 550706f2543Smrg YYRHS. */ 551706f2543Smrgstatic const yytype_uint8 yyprhs[] = 552706f2543Smrg{ 553706f2543Smrg 0, 0, 3, 4, 7, 9, 11, 12, 15, 17, 554706f2543Smrg 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 555706f2543Smrg 39, 43, 47, 52, 56, 60, 64, 69, 75, 81, 556706f2543Smrg 86, 88, 91, 92, 100, 105, 107, 110, 111, 118, 557706f2543Smrg 120, 122, 124, 126, 128, 130, 132, 134, 136, 139, 558706f2543Smrg 142, 147, 149, 152, 153, 160, 161, 163, 165, 171, 559706f2543Smrg 173, 176, 177, 185, 188, 191 560706f2543Smrg}; 561706f2543Smrg 562706f2543Smrg/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 563706f2543Smrgstatic const yytype_int8 yyrhs[] = 564706f2543Smrg{ 565706f2543Smrg 33, 0, -1, -1, 33, 34, -1, 3, -1, 36, 566706f2543Smrg -1, -1, 3, 35, -1, 40, -1, 41, -1, 44, 567706f2543Smrg -1, 48, -1, 55, -1, 60, -1, 38, -1, 39, 568706f2543Smrg -1, 64, -1, 37, -1, 62, -1, 63, -1, 28, 569706f2543Smrg 31, 3, -1, 20, 31, 3, -1, 18, 31, 57, 570706f2543Smrg 3, -1, 8, 31, 3, -1, 7, 31, 3, -1, 571706f2543Smrg 21, 3, 35, -1, 31, 25, 3, 35, -1, 31, 572706f2543Smrg 24, 31, 3, 35, -1, 31, 4, 31, 3, 35, 573706f2543Smrg -1, 31, 27, 3, 35, -1, 42, -1, 42, 43, 574706f2543Smrg -1, -1, 4, 31, 5, 45, 35, 43, 6, -1, 575706f2543Smrg 31, 31, 3, 35, -1, 46, -1, 46, 47, -1, 576706f2543Smrg -1, 9, 5, 49, 35, 47, 6, -1, 11, -1, 577706f2543Smrg 12, -1, 13, -1, 14, -1, 15, -1, 16, -1, 578706f2543Smrg 17, -1, 50, -1, 51, -1, 50, 51, -1, 51, 579706f2543Smrg 50, -1, 31, 52, 3, 35, -1, 53, -1, 53, 580706f2543Smrg 54, -1, -1, 10, 5, 56, 35, 54, 6, -1, 581706f2543Smrg -1, 22, -1, 23, -1, 31, 31, 57, 3, 35, 582706f2543Smrg -1, 58, -1, 58, 59, -1, -1, 19, 5, 3, 583706f2543Smrg 61, 35, 59, 6, -1, 29, 3, -1, 30, 3, 584706f2543Smrg -1, 26, 31, 3, -1 585706f2543Smrg}; 586706f2543Smrg 587706f2543Smrg/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 588706f2543Smrgstatic const yytype_uint8 yyrline[] = 589706f2543Smrg{ 590706f2543Smrg 0, 132, 132, 133, 136, 137, 141, 142, 145, 146, 591706f2543Smrg 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 592706f2543Smrg 159, 162, 165, 168, 171, 174, 175, 176, 177, 178, 593706f2543Smrg 181, 182, 185, 185, 188, 191, 192, 195, 195, 198, 594706f2543Smrg 199, 200, 201, 204, 205, 206, 209, 210, 211, 212, 595706f2543Smrg 215, 218, 219, 222, 222, 225, 226, 227, 230, 233, 596706f2543Smrg 234, 237, 237, 240, 243, 246 597706f2543Smrg}; 598706f2543Smrg#endif 599706f2543Smrg 600706f2543Smrg#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 601706f2543Smrg/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 602706f2543Smrg First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 603706f2543Smrgstatic const char *const yytname[] = 604706f2543Smrg{ 605706f2543Smrg "$end", "error", "$undefined", "NEWLINE", "MENU", "LB", "RB", 606706f2543Smrg "ICONDIRECTORY", "DEFAULTICON", "ICONS", "STYLES", "TOPMOST", "MAXIMIZE", 607706f2543Smrg "MINIMIZE", "BOTTOM", "NOTITLE", "OUTLINE", "NOFRAME", "DEFAULTSYSMENU", 608706f2543Smrg "SYSMENU", "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC", 609706f2543Smrg "ALWAYSONTOP", "\"DEBUG\"", "RELOAD", "TRAYICON", "FORCEEXIT", 610706f2543Smrg "SILENTEXIT", "STRING", "$accept", "input", "line", "newline_or_nada", 611706f2543Smrg "command", "trayicon", "rootmenu", "defaultsysmenu", "defaulticon", 612706f2543Smrg "icondirectory", "menuline", "menulist", "menu", "$@1", "iconline", 613706f2543Smrg "iconlist", "icons", "$@2", "group1", "group2", "stylecombo", 614706f2543Smrg "styleline", "stylelist", "styles", "$@3", "atspot", "sysmenuline", 615706f2543Smrg "sysmenulist", "sysmenu", "$@4", "forceexit", "silentexit", "debug", 0 616706f2543Smrg}; 617706f2543Smrg#endif 618706f2543Smrg 619706f2543Smrg# ifdef YYPRINT 620706f2543Smrg/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 621706f2543Smrg token YYLEX-NUM. */ 622706f2543Smrgstatic const yytype_uint16 yytoknum[] = 623706f2543Smrg{ 624706f2543Smrg 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 625706f2543Smrg 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 626706f2543Smrg 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 627706f2543Smrg 285, 286 628706f2543Smrg}; 629706f2543Smrg# endif 630706f2543Smrg 631706f2543Smrg/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 632706f2543Smrgstatic const yytype_uint8 yyr1[] = 633706f2543Smrg{ 634706f2543Smrg 0, 32, 33, 33, 34, 34, 35, 35, 36, 36, 635706f2543Smrg 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 636706f2543Smrg 37, 38, 39, 40, 41, 42, 42, 42, 42, 42, 637706f2543Smrg 43, 43, 45, 44, 46, 47, 47, 49, 48, 50, 638706f2543Smrg 50, 50, 50, 51, 51, 51, 52, 52, 52, 52, 639706f2543Smrg 53, 54, 54, 56, 55, 57, 57, 57, 58, 59, 640706f2543Smrg 59, 61, 60, 62, 63, 64 641706f2543Smrg}; 642706f2543Smrg 643706f2543Smrg/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 644706f2543Smrgstatic const yytype_uint8 yyr2[] = 645706f2543Smrg{ 646706f2543Smrg 0, 2, 0, 2, 1, 1, 0, 2, 1, 1, 647706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 648706f2543Smrg 3, 3, 4, 3, 3, 3, 4, 5, 5, 4, 649706f2543Smrg 1, 2, 0, 7, 4, 1, 2, 0, 6, 1, 650706f2543Smrg 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 651706f2543Smrg 4, 1, 2, 0, 6, 0, 1, 1, 5, 1, 652706f2543Smrg 2, 0, 7, 2, 2, 3 653706f2543Smrg}; 654706f2543Smrg 655706f2543Smrg/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 656706f2543Smrg Performed when YYTABLE doesn't specify something else to do. Zero 657706f2543Smrg means the default is an error. */ 658706f2543Smrgstatic const yytype_uint8 yydefact[] = 659706f2543Smrg{ 660706f2543Smrg 2, 0, 1, 4, 0, 0, 0, 0, 0, 0, 661706f2543Smrg 0, 0, 0, 0, 0, 0, 3, 5, 17, 14, 662706f2543Smrg 15, 8, 9, 10, 11, 12, 13, 18, 19, 16, 663706f2543Smrg 0, 0, 0, 37, 53, 55, 0, 0, 0, 0, 664706f2543Smrg 63, 64, 32, 24, 23, 6, 6, 56, 57, 0, 665706f2543Smrg 61, 21, 65, 20, 6, 6, 0, 0, 22, 6, 666706f2543Smrg 0, 7, 0, 35, 0, 0, 51, 0, 0, 0, 667706f2543Smrg 0, 30, 0, 0, 36, 38, 39, 40, 41, 42, 668706f2543Smrg 43, 44, 45, 46, 47, 0, 52, 54, 0, 59, 669706f2543Smrg 0, 6, 0, 0, 0, 0, 31, 33, 6, 48, 670706f2543Smrg 49, 6, 55, 60, 62, 25, 0, 0, 6, 6, 671706f2543Smrg 34, 50, 0, 6, 6, 26, 29, 6, 28, 27, 672706f2543Smrg 58 673706f2543Smrg}; 674706f2543Smrg 675706f2543Smrg/* YYDEFGOTO[NTERM-NUM]. */ 676706f2543Smrgstatic const yytype_int8 yydefgoto[] = 677706f2543Smrg{ 678706f2543Smrg -1, 1, 16, 56, 17, 18, 19, 20, 21, 22, 679706f2543Smrg 71, 72, 23, 54, 63, 64, 24, 45, 83, 84, 680706f2543Smrg 85, 66, 67, 25, 46, 49, 89, 90, 26, 59, 681706f2543Smrg 27, 28, 29 682706f2543Smrg}; 683706f2543Smrg 684706f2543Smrg/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 685706f2543Smrg STATE-NUM. */ 686706f2543Smrg#define YYPACT_NINF -47 687706f2543Smrgstatic const yytype_int8 yypact[] = 688706f2543Smrg{ 689706f2543Smrg -47, 7, -47, -47, -1, 0, 1, 18, 29, 15, 690706f2543Smrg 42, 17, 19, 20, 46, 50, -47, -47, -47, -47, 691706f2543Smrg -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, 692706f2543Smrg 49, 53, 54, -47, -47, 6, 55, 56, 57, 58, 693706f2543Smrg -47, -47, -47, -47, -47, 61, 61, -47, -47, 62, 694706f2543Smrg -47, -47, -47, -47, 61, 61, 35, 38, -47, 61, 695706f2543Smrg -19, -47, 39, 35, 66, 27, 38, 67, 43, 72, 696706f2543Smrg -3, -19, 70, 74, -47, -47, -47, -47, -47, -47, 697706f2543Smrg -47, -47, -47, 3, -8, 75, -47, -47, 48, 43, 698706f2543Smrg 76, 61, 52, 59, 77, 78, -47, -47, 61, -47, 699706f2543Smrg -47, 61, 6, -47, -47, -47, 81, 82, 61, 61, 700706f2543Smrg -47, -47, 83, 61, 61, -47, -47, 61, -47, -47, 701706f2543Smrg -47 702706f2543Smrg}; 703706f2543Smrg 704706f2543Smrg/* YYPGOTO[NTERM-NUM]. */ 705706f2543Smrgstatic const yytype_int8 yypgoto[] = 706706f2543Smrg{ 707706f2543Smrg -47, -47, -47, -46, -47, -47, -47, -47, -47, -47, 708706f2543Smrg -47, 16, -47, -47, -47, 25, -47, -47, 5, 8, 709706f2543Smrg -47, -47, 26, -47, -47, -9, -47, 9, -47, -47, 710706f2543Smrg -47, -47, -47 711706f2543Smrg}; 712706f2543Smrg 713706f2543Smrg/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 714706f2543Smrg positive, shift that token. If negative, reduce the rule which 715706f2543Smrg number is the opposite. If YYTABLE_NINF, syntax error. */ 716706f2543Smrg#define YYTABLE_NINF -1 717706f2543Smrgstatic const yytype_uint8 yytable[] = 718706f2543Smrg{ 719706f2543Smrg 57, 92, 69, 76, 77, 78, 79, 2, 60, 61, 720706f2543Smrg 3, 4, 70, 68, 5, 6, 7, 8, 80, 81, 721706f2543Smrg 82, 93, 94, 33, 95, 9, 10, 11, 47, 48, 722706f2543Smrg 30, 31, 32, 12, 34, 13, 14, 15, 76, 77, 723706f2543Smrg 78, 79, 80, 81, 82, 105, 35, 36, 37, 40, 724706f2543Smrg 38, 39, 110, 41, 42, 111, 43, 44, 50, 51, 725706f2543Smrg 52, 53, 115, 116, 55, 58, 62, 118, 119, 65, 726706f2543Smrg 73, 120, 75, 87, 88, 91, 97, 98, 101, 102, 727706f2543Smrg 108, 109, 104, 106, 113, 114, 117, 96, 74, 100, 728706f2543Smrg 107, 99, 86, 112, 0, 0, 0, 0, 103 729706f2543Smrg}; 730706f2543Smrg 731706f2543Smrg#define yypact_value_is_default(yystate) \ 732706f2543Smrg ((yystate) == (-47)) 733706f2543Smrg 734706f2543Smrg#define yytable_value_is_error(yytable_value) \ 735706f2543Smrg YYID (0) 736706f2543Smrg 737706f2543Smrgstatic const yytype_int8 yycheck[] = 738706f2543Smrg{ 739706f2543Smrg 46, 4, 21, 11, 12, 13, 14, 0, 54, 55, 740706f2543Smrg 3, 4, 31, 59, 7, 8, 9, 10, 15, 16, 741706f2543Smrg 17, 24, 25, 5, 27, 18, 19, 20, 22, 23, 742706f2543Smrg 31, 31, 31, 26, 5, 28, 29, 30, 11, 12, 743706f2543Smrg 13, 14, 15, 16, 17, 91, 31, 5, 31, 3, 744706f2543Smrg 31, 31, 98, 3, 5, 101, 3, 3, 3, 3, 745706f2543Smrg 3, 3, 108, 109, 3, 3, 31, 113, 114, 31, 746706f2543Smrg 31, 117, 6, 6, 31, 3, 6, 3, 3, 31, 747706f2543Smrg 3, 3, 6, 31, 3, 3, 3, 71, 63, 84, 748706f2543Smrg 31, 83, 66, 102, -1, -1, -1, -1, 89 749706f2543Smrg}; 750706f2543Smrg 751706f2543Smrg/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 752706f2543Smrg symbol of state STATE-NUM. */ 753706f2543Smrgstatic const yytype_uint8 yystos[] = 754706f2543Smrg{ 755706f2543Smrg 0, 33, 0, 3, 4, 7, 8, 9, 10, 18, 756706f2543Smrg 19, 20, 26, 28, 29, 30, 34, 36, 37, 38, 757706f2543Smrg 39, 40, 41, 44, 48, 55, 60, 62, 63, 64, 758706f2543Smrg 31, 31, 31, 5, 5, 31, 5, 31, 31, 31, 759706f2543Smrg 3, 3, 5, 3, 3, 49, 56, 22, 23, 57, 760706f2543Smrg 3, 3, 3, 3, 45, 3, 35, 35, 3, 61, 761706f2543Smrg 35, 35, 31, 46, 47, 31, 53, 54, 35, 21, 762706f2543Smrg 31, 42, 43, 31, 47, 6, 11, 12, 13, 14, 763706f2543Smrg 15, 16, 17, 50, 51, 52, 54, 6, 31, 58, 764706f2543Smrg 59, 3, 4, 24, 25, 27, 43, 6, 3, 51, 765706f2543Smrg 50, 3, 31, 59, 6, 35, 31, 31, 3, 3, 766706f2543Smrg 35, 35, 57, 3, 3, 35, 35, 3, 35, 35, 767706f2543Smrg 35 768706f2543Smrg}; 769706f2543Smrg 770706f2543Smrg#define yyerrok (yyerrstatus = 0) 771706f2543Smrg#define yyclearin (yychar = YYEMPTY) 772706f2543Smrg#define YYEMPTY (-2) 773706f2543Smrg#define YYEOF 0 774706f2543Smrg 775706f2543Smrg#define YYACCEPT goto yyacceptlab 776706f2543Smrg#define YYABORT goto yyabortlab 777706f2543Smrg#define YYERROR goto yyerrorlab 778706f2543Smrg 779706f2543Smrg 780706f2543Smrg/* Like YYERROR except do call yyerror. This remains here temporarily 781706f2543Smrg to ease the transition to the new meaning of YYERROR, for GCC. 782706f2543Smrg Once GCC version 2 has supplanted version 1, this can go. However, 783706f2543Smrg YYFAIL appears to be in use. Nevertheless, it is formally deprecated 784706f2543Smrg in Bison 2.4.2's NEWS entry, where a plan to phase it out is 785706f2543Smrg discussed. */ 786706f2543Smrg 787706f2543Smrg#define YYFAIL goto yyerrlab 788706f2543Smrg#if defined YYFAIL 789706f2543Smrg /* This is here to suppress warnings from the GCC cpp's 790706f2543Smrg -Wunused-macros. Normally we don't worry about that warning, but 791706f2543Smrg some users do, and we want to make it easy for users to remove 792706f2543Smrg YYFAIL uses, which will produce warnings from Bison 2.5. */ 793706f2543Smrg#endif 794706f2543Smrg 795706f2543Smrg#define YYRECOVERING() (!!yyerrstatus) 796706f2543Smrg 797706f2543Smrg#define YYBACKUP(Token, Value) \ 798706f2543Smrgdo \ 799706f2543Smrg if (yychar == YYEMPTY && yylen == 1) \ 800706f2543Smrg { \ 801706f2543Smrg yychar = (Token); \ 802706f2543Smrg yylval = (Value); \ 803706f2543Smrg YYPOPSTACK (1); \ 804706f2543Smrg goto yybackup; \ 805706f2543Smrg } \ 806706f2543Smrg else \ 807706f2543Smrg { \ 808706f2543Smrg yyerror (YY_("syntax error: cannot back up")); \ 809706f2543Smrg YYERROR; \ 810706f2543Smrg } \ 811706f2543Smrgwhile (YYID (0)) 812706f2543Smrg 813706f2543Smrg 814706f2543Smrg#define YYTERROR 1 815706f2543Smrg#define YYERRCODE 256 816706f2543Smrg 817706f2543Smrg 818706f2543Smrg/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 819706f2543Smrg If N is 0, then set CURRENT to the empty location which ends 820706f2543Smrg the previous symbol: RHS[0] (always defined). */ 821706f2543Smrg 822706f2543Smrg#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 823706f2543Smrg#ifndef YYLLOC_DEFAULT 824706f2543Smrg# define YYLLOC_DEFAULT(Current, Rhs, N) \ 825706f2543Smrg do \ 826706f2543Smrg if (YYID (N)) \ 827706f2543Smrg { \ 828706f2543Smrg (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 829706f2543Smrg (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 830706f2543Smrg (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 831706f2543Smrg (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 832706f2543Smrg } \ 833706f2543Smrg else \ 834706f2543Smrg { \ 835706f2543Smrg (Current).first_line = (Current).last_line = \ 836706f2543Smrg YYRHSLOC (Rhs, 0).last_line; \ 837706f2543Smrg (Current).first_column = (Current).last_column = \ 838706f2543Smrg YYRHSLOC (Rhs, 0).last_column; \ 839706f2543Smrg } \ 840706f2543Smrg while (YYID (0)) 841706f2543Smrg#endif 842706f2543Smrg 843706f2543Smrg 844706f2543Smrg/* This macro is provided for backward compatibility. */ 845706f2543Smrg 846706f2543Smrg#ifndef YY_LOCATION_PRINT 847706f2543Smrg# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 848706f2543Smrg#endif 849706f2543Smrg 850706f2543Smrg 851706f2543Smrg/* YYLEX -- calling `yylex' with the right arguments. */ 852706f2543Smrg 853706f2543Smrg#ifdef YYLEX_PARAM 854706f2543Smrg# define YYLEX yylex (YYLEX_PARAM) 855706f2543Smrg#else 856706f2543Smrg# define YYLEX yylex () 857706f2543Smrg#endif 858706f2543Smrg 859706f2543Smrg/* Enable debugging if requested. */ 860706f2543Smrg#if YYDEBUG 861706f2543Smrg 862706f2543Smrg# ifndef YYFPRINTF 863706f2543Smrg# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 864706f2543Smrg# define YYFPRINTF fprintf 865706f2543Smrg# endif 866706f2543Smrg 867706f2543Smrg# define YYDPRINTF(Args) \ 868706f2543Smrgdo { \ 869706f2543Smrg if (yydebug) \ 870706f2543Smrg YYFPRINTF Args; \ 871706f2543Smrg} while (YYID (0)) 872706f2543Smrg 873706f2543Smrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 874706f2543Smrgdo { \ 875706f2543Smrg if (yydebug) \ 876706f2543Smrg { \ 877706f2543Smrg YYFPRINTF (stderr, "%s ", Title); \ 878706f2543Smrg yy_symbol_print (stderr, \ 879706f2543Smrg Type, Value); \ 880706f2543Smrg YYFPRINTF (stderr, "\n"); \ 881706f2543Smrg } \ 882706f2543Smrg} while (YYID (0)) 883706f2543Smrg 884706f2543Smrg 885706f2543Smrg/*--------------------------------. 886706f2543Smrg| Print this symbol on YYOUTPUT. | 887706f2543Smrg`--------------------------------*/ 888706f2543Smrg 889706f2543Smrg/*ARGSUSED*/ 890706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 891706f2543Smrg || defined __cplusplus || defined _MSC_VER) 892706f2543Smrgstatic void 893706f2543Smrgyy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 894706f2543Smrg#else 895706f2543Smrgstatic void 896706f2543Smrgyy_symbol_value_print (yyoutput, yytype, yyvaluep) 897706f2543Smrg FILE *yyoutput; 898706f2543Smrg int yytype; 899706f2543Smrg YYSTYPE const * const yyvaluep; 900706f2543Smrg#endif 901706f2543Smrg{ 902706f2543Smrg if (!yyvaluep) 903706f2543Smrg return; 904706f2543Smrg# ifdef YYPRINT 905706f2543Smrg if (yytype < YYNTOKENS) 906706f2543Smrg YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 907706f2543Smrg# else 908706f2543Smrg YYUSE (yyoutput); 909706f2543Smrg# endif 910706f2543Smrg switch (yytype) 911706f2543Smrg { 912706f2543Smrg default: 913706f2543Smrg break; 914706f2543Smrg } 915706f2543Smrg} 916706f2543Smrg 917706f2543Smrg 918706f2543Smrg/*--------------------------------. 919706f2543Smrg| Print this symbol on YYOUTPUT. | 920706f2543Smrg`--------------------------------*/ 921706f2543Smrg 922706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 923706f2543Smrg || defined __cplusplus || defined _MSC_VER) 924706f2543Smrgstatic void 925706f2543Smrgyy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 926706f2543Smrg#else 927706f2543Smrgstatic void 928706f2543Smrgyy_symbol_print (yyoutput, yytype, yyvaluep) 929706f2543Smrg FILE *yyoutput; 930706f2543Smrg int yytype; 931706f2543Smrg YYSTYPE const * const yyvaluep; 932706f2543Smrg#endif 933706f2543Smrg{ 934706f2543Smrg if (yytype < YYNTOKENS) 935706f2543Smrg YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 936706f2543Smrg else 937706f2543Smrg YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 938706f2543Smrg 939706f2543Smrg yy_symbol_value_print (yyoutput, yytype, yyvaluep); 940706f2543Smrg YYFPRINTF (yyoutput, ")"); 941706f2543Smrg} 942706f2543Smrg 943706f2543Smrg/*------------------------------------------------------------------. 944706f2543Smrg| yy_stack_print -- Print the state stack from its BOTTOM up to its | 945706f2543Smrg| TOP (included). | 946706f2543Smrg`------------------------------------------------------------------*/ 947706f2543Smrg 948706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 949706f2543Smrg || defined __cplusplus || defined _MSC_VER) 950706f2543Smrgstatic void 951706f2543Smrgyy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 952706f2543Smrg#else 953706f2543Smrgstatic void 954706f2543Smrgyy_stack_print (yybottom, yytop) 955706f2543Smrg yytype_int16 *yybottom; 956706f2543Smrg yytype_int16 *yytop; 957706f2543Smrg#endif 958706f2543Smrg{ 959706f2543Smrg YYFPRINTF (stderr, "Stack now"); 960706f2543Smrg for (; yybottom <= yytop; yybottom++) 961706f2543Smrg { 962706f2543Smrg int yybot = *yybottom; 963706f2543Smrg YYFPRINTF (stderr, " %d", yybot); 964706f2543Smrg } 965706f2543Smrg YYFPRINTF (stderr, "\n"); 966706f2543Smrg} 967706f2543Smrg 968706f2543Smrg# define YY_STACK_PRINT(Bottom, Top) \ 969706f2543Smrgdo { \ 970706f2543Smrg if (yydebug) \ 971706f2543Smrg yy_stack_print ((Bottom), (Top)); \ 972706f2543Smrg} while (YYID (0)) 973706f2543Smrg 974706f2543Smrg 975706f2543Smrg/*------------------------------------------------. 976706f2543Smrg| Report that the YYRULE is going to be reduced. | 977706f2543Smrg`------------------------------------------------*/ 978706f2543Smrg 979706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 980706f2543Smrg || defined __cplusplus || defined _MSC_VER) 981706f2543Smrgstatic void 982706f2543Smrgyy_reduce_print (YYSTYPE *yyvsp, int yyrule) 983706f2543Smrg#else 984706f2543Smrgstatic void 985706f2543Smrgyy_reduce_print (yyvsp, yyrule) 986706f2543Smrg YYSTYPE *yyvsp; 987706f2543Smrg int yyrule; 988706f2543Smrg#endif 989706f2543Smrg{ 990706f2543Smrg int yynrhs = yyr2[yyrule]; 991706f2543Smrg int yyi; 992706f2543Smrg unsigned long int yylno = yyrline[yyrule]; 993706f2543Smrg YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 994706f2543Smrg yyrule - 1, yylno); 995706f2543Smrg /* The symbols being reduced. */ 996706f2543Smrg for (yyi = 0; yyi < yynrhs; yyi++) 997706f2543Smrg { 998706f2543Smrg YYFPRINTF (stderr, " $%d = ", yyi + 1); 999706f2543Smrg yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 1000706f2543Smrg &(yyvsp[(yyi + 1) - (yynrhs)]) 1001706f2543Smrg ); 1002706f2543Smrg YYFPRINTF (stderr, "\n"); 1003706f2543Smrg } 1004706f2543Smrg} 1005706f2543Smrg 1006706f2543Smrg# define YY_REDUCE_PRINT(Rule) \ 1007706f2543Smrgdo { \ 1008706f2543Smrg if (yydebug) \ 1009706f2543Smrg yy_reduce_print (yyvsp, Rule); \ 1010706f2543Smrg} while (YYID (0)) 1011706f2543Smrg 1012706f2543Smrg/* Nonzero means print parse trace. It is left uninitialized so that 1013706f2543Smrg multiple parsers can coexist. */ 1014706f2543Smrgint yydebug; 1015706f2543Smrg#else /* !YYDEBUG */ 1016706f2543Smrg# define YYDPRINTF(Args) 1017706f2543Smrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 1018706f2543Smrg# define YY_STACK_PRINT(Bottom, Top) 1019706f2543Smrg# define YY_REDUCE_PRINT(Rule) 1020706f2543Smrg#endif /* !YYDEBUG */ 1021706f2543Smrg 1022706f2543Smrg 1023706f2543Smrg/* YYINITDEPTH -- initial size of the parser's stacks. */ 1024706f2543Smrg#ifndef YYINITDEPTH 1025706f2543Smrg# define YYINITDEPTH 200 1026706f2543Smrg#endif 1027706f2543Smrg 1028706f2543Smrg/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1029706f2543Smrg if the built-in stack extension method is used). 1030706f2543Smrg 1031706f2543Smrg Do not make this value too large; the results are undefined if 1032706f2543Smrg YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 1033706f2543Smrg evaluated with infinite-precision integer arithmetic. */ 1034706f2543Smrg 1035706f2543Smrg#ifndef YYMAXDEPTH 1036706f2543Smrg# define YYMAXDEPTH 10000 1037706f2543Smrg#endif 1038706f2543Smrg 1039706f2543Smrg 1040706f2543Smrg#if YYERROR_VERBOSE 1041706f2543Smrg 1042706f2543Smrg# ifndef yystrlen 1043706f2543Smrg# if defined __GLIBC__ && defined _STRING_H 1044706f2543Smrg# define yystrlen strlen 1045706f2543Smrg# else 1046706f2543Smrg/* Return the length of YYSTR. */ 1047706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1048706f2543Smrg || defined __cplusplus || defined _MSC_VER) 1049706f2543Smrgstatic YYSIZE_T 1050706f2543Smrgyystrlen (const char *yystr) 1051706f2543Smrg#else 1052706f2543Smrgstatic YYSIZE_T 1053706f2543Smrgyystrlen (yystr) 1054706f2543Smrg const char *yystr; 1055706f2543Smrg#endif 1056706f2543Smrg{ 1057706f2543Smrg YYSIZE_T yylen; 1058706f2543Smrg for (yylen = 0; yystr[yylen]; yylen++) 1059706f2543Smrg continue; 1060706f2543Smrg return yylen; 1061706f2543Smrg} 1062706f2543Smrg# endif 1063706f2543Smrg# endif 1064706f2543Smrg 1065706f2543Smrg# ifndef yystpcpy 1066706f2543Smrg# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1067706f2543Smrg# define yystpcpy stpcpy 1068706f2543Smrg# else 1069706f2543Smrg/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1070706f2543Smrg YYDEST. */ 1071706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1072706f2543Smrg || defined __cplusplus || defined _MSC_VER) 1073706f2543Smrgstatic char * 1074706f2543Smrgyystpcpy (char *yydest, const char *yysrc) 1075706f2543Smrg#else 1076706f2543Smrgstatic char * 1077706f2543Smrgyystpcpy (yydest, yysrc) 1078706f2543Smrg char *yydest; 1079706f2543Smrg const char *yysrc; 1080706f2543Smrg#endif 1081706f2543Smrg{ 1082706f2543Smrg char *yyd = yydest; 1083706f2543Smrg const char *yys = yysrc; 1084706f2543Smrg 1085706f2543Smrg while ((*yyd++ = *yys++) != '\0') 1086706f2543Smrg continue; 1087706f2543Smrg 1088706f2543Smrg return yyd - 1; 1089706f2543Smrg} 1090706f2543Smrg# endif 1091706f2543Smrg# endif 1092706f2543Smrg 1093706f2543Smrg# ifndef yytnamerr 1094706f2543Smrg/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1095706f2543Smrg quotes and backslashes, so that it's suitable for yyerror. The 1096706f2543Smrg heuristic is that double-quoting is unnecessary unless the string 1097706f2543Smrg contains an apostrophe, a comma, or backslash (other than 1098706f2543Smrg backslash-backslash). YYSTR is taken from yytname. If YYRES is 1099706f2543Smrg null, do not copy; instead, return the length of what the result 1100706f2543Smrg would have been. */ 1101706f2543Smrgstatic YYSIZE_T 1102706f2543Smrgyytnamerr (char *yyres, const char *yystr) 1103706f2543Smrg{ 1104706f2543Smrg if (*yystr == '"') 1105706f2543Smrg { 1106706f2543Smrg YYSIZE_T yyn = 0; 1107706f2543Smrg char const *yyp = yystr; 1108706f2543Smrg 1109706f2543Smrg for (;;) 1110706f2543Smrg switch (*++yyp) 1111706f2543Smrg { 1112706f2543Smrg case '\'': 1113706f2543Smrg case ',': 1114706f2543Smrg goto do_not_strip_quotes; 1115706f2543Smrg 1116706f2543Smrg case '\\': 1117706f2543Smrg if (*++yyp != '\\') 1118706f2543Smrg goto do_not_strip_quotes; 1119706f2543Smrg /* Fall through. */ 1120706f2543Smrg default: 1121706f2543Smrg if (yyres) 1122706f2543Smrg yyres[yyn] = *yyp; 1123706f2543Smrg yyn++; 1124706f2543Smrg break; 1125706f2543Smrg 1126706f2543Smrg case '"': 1127706f2543Smrg if (yyres) 1128706f2543Smrg yyres[yyn] = '\0'; 1129706f2543Smrg return yyn; 1130706f2543Smrg } 1131706f2543Smrg do_not_strip_quotes: ; 1132706f2543Smrg } 1133706f2543Smrg 1134706f2543Smrg if (! yyres) 1135706f2543Smrg return yystrlen (yystr); 1136706f2543Smrg 1137706f2543Smrg return yystpcpy (yyres, yystr) - yyres; 1138706f2543Smrg} 1139706f2543Smrg# endif 1140706f2543Smrg 1141706f2543Smrg/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 1142706f2543Smrg about the unexpected token YYTOKEN for the state stack whose top is 1143706f2543Smrg YYSSP. 1144706f2543Smrg 1145706f2543Smrg Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 1146706f2543Smrg not large enough to hold the message. In that case, also set 1147706f2543Smrg *YYMSG_ALLOC to the required number of bytes. Return 2 if the 1148706f2543Smrg required number of bytes is too large to store. */ 1149706f2543Smrgstatic int 1150706f2543Smrgyysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 1151706f2543Smrg yytype_int16 *yyssp, int yytoken) 1152706f2543Smrg{ 1153706f2543Smrg YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 1154706f2543Smrg YYSIZE_T yysize = yysize0; 1155706f2543Smrg YYSIZE_T yysize1; 1156706f2543Smrg enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1157706f2543Smrg /* Internationalized format string. */ 1158706f2543Smrg const char *yyformat = 0; 1159706f2543Smrg /* Arguments of yyformat. */ 1160706f2543Smrg char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1161706f2543Smrg /* Number of reported tokens (one for the "unexpected", one per 1162706f2543Smrg "expected"). */ 1163706f2543Smrg int yycount = 0; 1164706f2543Smrg 1165706f2543Smrg /* There are many possibilities here to consider: 1166706f2543Smrg - Assume YYFAIL is not used. It's too flawed to consider. See 1167706f2543Smrg <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 1168706f2543Smrg for details. YYERROR is fine as it does not invoke this 1169706f2543Smrg function. 1170706f2543Smrg - If this state is a consistent state with a default action, then 1171706f2543Smrg the only way this function was invoked is if the default action 1172706f2543Smrg is an error action. In that case, don't check for expected 1173706f2543Smrg tokens because there are none. 1174706f2543Smrg - The only way there can be no lookahead present (in yychar) is if 1175706f2543Smrg this state is a consistent state with a default action. Thus, 1176706f2543Smrg detecting the absence of a lookahead is sufficient to determine 1177706f2543Smrg that there is no unexpected or expected token to report. In that 1178706f2543Smrg case, just report a simple "syntax error". 1179706f2543Smrg - Don't assume there isn't a lookahead just because this state is a 1180706f2543Smrg consistent state with a default action. There might have been a 1181706f2543Smrg previous inconsistent state, consistent state with a non-default 1182706f2543Smrg action, or user semantic action that manipulated yychar. 1183706f2543Smrg - Of course, the expected token list depends on states to have 1184706f2543Smrg correct lookahead information, and it depends on the parser not 1185706f2543Smrg to perform extra reductions after fetching a lookahead from the 1186706f2543Smrg scanner and before detecting a syntax error. Thus, state merging 1187706f2543Smrg (from LALR or IELR) and default reductions corrupt the expected 1188706f2543Smrg token list. However, the list is correct for canonical LR with 1189706f2543Smrg one exception: it will still contain any token that will not be 1190706f2543Smrg accepted due to an error action in a later state. 1191706f2543Smrg */ 1192706f2543Smrg if (yytoken != YYEMPTY) 1193706f2543Smrg { 1194706f2543Smrg int yyn = yypact[*yyssp]; 1195706f2543Smrg yyarg[yycount++] = yytname[yytoken]; 1196706f2543Smrg if (!yypact_value_is_default (yyn)) 1197706f2543Smrg { 1198706f2543Smrg /* Start YYX at -YYN if negative to avoid negative indexes in 1199706f2543Smrg YYCHECK. In other words, skip the first -YYN actions for 1200706f2543Smrg this state because they are default actions. */ 1201706f2543Smrg int yyxbegin = yyn < 0 ? -yyn : 0; 1202706f2543Smrg /* Stay within bounds of both yycheck and yytname. */ 1203706f2543Smrg int yychecklim = YYLAST - yyn + 1; 1204706f2543Smrg int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1205706f2543Smrg int yyx; 1206706f2543Smrg 1207706f2543Smrg for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1208706f2543Smrg if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 1209706f2543Smrg && !yytable_value_is_error (yytable[yyx + yyn])) 1210706f2543Smrg { 1211706f2543Smrg if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1212706f2543Smrg { 1213706f2543Smrg yycount = 1; 1214706f2543Smrg yysize = yysize0; 1215706f2543Smrg break; 1216706f2543Smrg } 1217706f2543Smrg yyarg[yycount++] = yytname[yyx]; 1218706f2543Smrg yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1219706f2543Smrg if (! (yysize <= yysize1 1220706f2543Smrg && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1221706f2543Smrg return 2; 1222706f2543Smrg yysize = yysize1; 1223706f2543Smrg } 1224706f2543Smrg } 1225706f2543Smrg } 1226706f2543Smrg 1227706f2543Smrg switch (yycount) 1228706f2543Smrg { 1229706f2543Smrg# define YYCASE_(N, S) \ 1230706f2543Smrg case N: \ 1231706f2543Smrg yyformat = S; \ 1232706f2543Smrg break 1233706f2543Smrg YYCASE_(0, YY_("syntax error")); 1234706f2543Smrg YYCASE_(1, YY_("syntax error, unexpected %s")); 1235706f2543Smrg YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 1236706f2543Smrg YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 1237706f2543Smrg YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 1238706f2543Smrg YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 1239706f2543Smrg# undef YYCASE_ 1240706f2543Smrg } 1241706f2543Smrg 1242706f2543Smrg yysize1 = yysize + yystrlen (yyformat); 1243706f2543Smrg if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 1244706f2543Smrg return 2; 1245706f2543Smrg yysize = yysize1; 1246706f2543Smrg 1247706f2543Smrg if (*yymsg_alloc < yysize) 1248706f2543Smrg { 1249706f2543Smrg *yymsg_alloc = 2 * yysize; 1250706f2543Smrg if (! (yysize <= *yymsg_alloc 1251706f2543Smrg && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 1252706f2543Smrg *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 1253706f2543Smrg return 1; 1254706f2543Smrg } 1255706f2543Smrg 1256706f2543Smrg /* Avoid sprintf, as that infringes on the user's name space. 1257706f2543Smrg Don't have undefined behavior even if the translation 1258706f2543Smrg produced a string with the wrong number of "%s"s. */ 1259706f2543Smrg { 1260706f2543Smrg char *yyp = *yymsg; 1261706f2543Smrg int yyi = 0; 1262706f2543Smrg while ((*yyp = *yyformat) != '\0') 1263706f2543Smrg if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 1264706f2543Smrg { 1265706f2543Smrg yyp += yytnamerr (yyp, yyarg[yyi++]); 1266706f2543Smrg yyformat += 2; 1267706f2543Smrg } 1268706f2543Smrg else 1269706f2543Smrg { 1270706f2543Smrg yyp++; 1271706f2543Smrg yyformat++; 1272706f2543Smrg } 1273706f2543Smrg } 1274706f2543Smrg return 0; 1275706f2543Smrg} 1276706f2543Smrg#endif /* YYERROR_VERBOSE */ 1277706f2543Smrg 1278706f2543Smrg/*-----------------------------------------------. 1279706f2543Smrg| Release the memory associated to this symbol. | 1280706f2543Smrg`-----------------------------------------------*/ 1281706f2543Smrg 1282706f2543Smrg/*ARGSUSED*/ 1283706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1284706f2543Smrg || defined __cplusplus || defined _MSC_VER) 1285706f2543Smrgstatic void 1286706f2543Smrgyydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1287706f2543Smrg#else 1288706f2543Smrgstatic void 1289706f2543Smrgyydestruct (yymsg, yytype, yyvaluep) 1290706f2543Smrg const char *yymsg; 1291706f2543Smrg int yytype; 1292706f2543Smrg YYSTYPE *yyvaluep; 1293706f2543Smrg#endif 1294706f2543Smrg{ 1295706f2543Smrg YYUSE (yyvaluep); 1296706f2543Smrg 1297706f2543Smrg if (!yymsg) 1298706f2543Smrg yymsg = "Deleting"; 1299706f2543Smrg YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1300706f2543Smrg 1301706f2543Smrg switch (yytype) 1302706f2543Smrg { 1303706f2543Smrg 1304706f2543Smrg default: 1305706f2543Smrg break; 1306706f2543Smrg } 1307706f2543Smrg} 1308706f2543Smrg 1309706f2543Smrg 1310706f2543Smrg/* Prevent warnings from -Wmissing-prototypes. */ 1311706f2543Smrg#ifdef YYPARSE_PARAM 1312706f2543Smrg#if defined __STDC__ || defined __cplusplus 1313706f2543Smrgint yyparse (void *YYPARSE_PARAM); 1314706f2543Smrg#else 1315706f2543Smrgint yyparse (); 1316706f2543Smrg#endif 1317706f2543Smrg#else /* ! YYPARSE_PARAM */ 1318706f2543Smrg#if defined __STDC__ || defined __cplusplus 1319706f2543Smrgint yyparse (void); 1320706f2543Smrg#else 1321706f2543Smrgint yyparse (); 1322706f2543Smrg#endif 1323706f2543Smrg#endif /* ! YYPARSE_PARAM */ 1324706f2543Smrg 1325706f2543Smrg 1326706f2543Smrg/* The lookahead symbol. */ 1327706f2543Smrgint yychar; 1328706f2543Smrg 1329706f2543Smrg/* The semantic value of the lookahead symbol. */ 1330706f2543SmrgYYSTYPE yylval; 1331706f2543Smrg 1332706f2543Smrg/* Number of syntax errors so far. */ 1333706f2543Smrgint yynerrs; 1334706f2543Smrg 1335706f2543Smrg 1336706f2543Smrg/*----------. 1337706f2543Smrg| yyparse. | 1338706f2543Smrg`----------*/ 1339706f2543Smrg 1340706f2543Smrg#ifdef YYPARSE_PARAM 1341706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1342706f2543Smrg || defined __cplusplus || defined _MSC_VER) 1343706f2543Smrgint 1344706f2543Smrgyyparse (void *YYPARSE_PARAM) 1345706f2543Smrg#else 1346706f2543Smrgint 1347706f2543Smrgyyparse (YYPARSE_PARAM) 1348706f2543Smrg void *YYPARSE_PARAM; 1349706f2543Smrg#endif 1350706f2543Smrg#else /* ! YYPARSE_PARAM */ 1351706f2543Smrg#if (defined __STDC__ || defined __C99__FUNC__ \ 1352706f2543Smrg || defined __cplusplus || defined _MSC_VER) 1353706f2543Smrgint 1354706f2543Smrgyyparse (void) 1355706f2543Smrg#else 1356706f2543Smrgint 1357706f2543Smrgyyparse () 1358706f2543Smrg 1359706f2543Smrg#endif 1360706f2543Smrg#endif 1361706f2543Smrg{ 1362706f2543Smrg int yystate; 1363706f2543Smrg /* Number of tokens to shift before error messages enabled. */ 1364706f2543Smrg int yyerrstatus; 1365706f2543Smrg 1366706f2543Smrg /* The stacks and their tools: 1367706f2543Smrg `yyss': related to states. 1368706f2543Smrg `yyvs': related to semantic values. 1369706f2543Smrg 1370706f2543Smrg Refer to the stacks thru separate pointers, to allow yyoverflow 1371706f2543Smrg to reallocate them elsewhere. */ 1372706f2543Smrg 1373706f2543Smrg /* The state stack. */ 1374706f2543Smrg yytype_int16 yyssa[YYINITDEPTH]; 1375706f2543Smrg yytype_int16 *yyss; 1376706f2543Smrg yytype_int16 *yyssp; 1377706f2543Smrg 1378706f2543Smrg /* The semantic value stack. */ 1379706f2543Smrg YYSTYPE yyvsa[YYINITDEPTH]; 1380706f2543Smrg YYSTYPE *yyvs; 1381706f2543Smrg YYSTYPE *yyvsp; 1382706f2543Smrg 1383706f2543Smrg YYSIZE_T yystacksize; 1384706f2543Smrg 1385706f2543Smrg int yyn; 1386706f2543Smrg int yyresult; 1387706f2543Smrg /* Lookahead token as an internal (translated) token number. */ 1388706f2543Smrg int yytoken; 1389706f2543Smrg /* The variables used to return semantic value and location from the 1390706f2543Smrg action routines. */ 1391706f2543Smrg YYSTYPE yyval; 1392706f2543Smrg 1393706f2543Smrg#if YYERROR_VERBOSE 1394706f2543Smrg /* Buffer for error messages, and its allocated size. */ 1395706f2543Smrg char yymsgbuf[128]; 1396706f2543Smrg char *yymsg = yymsgbuf; 1397706f2543Smrg YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1398706f2543Smrg#endif 1399706f2543Smrg 1400706f2543Smrg#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1401706f2543Smrg 1402706f2543Smrg /* The number of symbols on the RHS of the reduced rule. 1403706f2543Smrg Keep to zero when no symbol should be popped. */ 1404706f2543Smrg int yylen = 0; 1405706f2543Smrg 1406706f2543Smrg yytoken = 0; 1407706f2543Smrg yyss = yyssa; 1408706f2543Smrg yyvs = yyvsa; 1409706f2543Smrg yystacksize = YYINITDEPTH; 1410706f2543Smrg 1411706f2543Smrg YYDPRINTF ((stderr, "Starting parse\n")); 1412706f2543Smrg 1413706f2543Smrg yystate = 0; 1414706f2543Smrg yyerrstatus = 0; 1415706f2543Smrg yynerrs = 0; 1416706f2543Smrg yychar = YYEMPTY; /* Cause a token to be read. */ 1417706f2543Smrg 1418706f2543Smrg /* Initialize stack pointers. 1419706f2543Smrg Waste one element of value and location stack 1420706f2543Smrg so that they stay on the same level as the state stack. 1421706f2543Smrg The wasted elements are never initialized. */ 1422706f2543Smrg yyssp = yyss; 1423706f2543Smrg yyvsp = yyvs; 1424706f2543Smrg 1425706f2543Smrg goto yysetstate; 1426706f2543Smrg 1427706f2543Smrg/*------------------------------------------------------------. 1428706f2543Smrg| yynewstate -- Push a new state, which is found in yystate. | 1429706f2543Smrg`------------------------------------------------------------*/ 1430706f2543Smrg yynewstate: 1431706f2543Smrg /* In all cases, when you get here, the value and location stacks 1432706f2543Smrg have just been pushed. So pushing a state here evens the stacks. */ 1433706f2543Smrg yyssp++; 1434706f2543Smrg 1435706f2543Smrg yysetstate: 1436706f2543Smrg *yyssp = yystate; 1437706f2543Smrg 1438706f2543Smrg if (yyss + yystacksize - 1 <= yyssp) 1439706f2543Smrg { 1440706f2543Smrg /* Get the current used size of the three stacks, in elements. */ 1441706f2543Smrg YYSIZE_T yysize = yyssp - yyss + 1; 1442706f2543Smrg 1443706f2543Smrg#ifdef yyoverflow 1444706f2543Smrg { 1445706f2543Smrg /* Give user a chance to reallocate the stack. Use copies of 1446706f2543Smrg these so that the &'s don't force the real ones into 1447706f2543Smrg memory. */ 1448706f2543Smrg YYSTYPE *yyvs1 = yyvs; 1449706f2543Smrg yytype_int16 *yyss1 = yyss; 1450706f2543Smrg 1451706f2543Smrg /* Each stack pointer address is followed by the size of the 1452706f2543Smrg data in use in that stack, in bytes. This used to be a 1453706f2543Smrg conditional around just the two extra args, but that might 1454706f2543Smrg be undefined if yyoverflow is a macro. */ 1455706f2543Smrg yyoverflow (YY_("memory exhausted"), 1456706f2543Smrg &yyss1, yysize * sizeof (*yyssp), 1457706f2543Smrg &yyvs1, yysize * sizeof (*yyvsp), 1458706f2543Smrg &yystacksize); 1459706f2543Smrg 1460706f2543Smrg yyss = yyss1; 1461706f2543Smrg yyvs = yyvs1; 1462706f2543Smrg } 1463706f2543Smrg#else /* no yyoverflow */ 1464706f2543Smrg# ifndef YYSTACK_RELOCATE 1465706f2543Smrg goto yyexhaustedlab; 1466706f2543Smrg# else 1467706f2543Smrg /* Extend the stack our own way. */ 1468706f2543Smrg if (YYMAXDEPTH <= yystacksize) 1469706f2543Smrg goto yyexhaustedlab; 1470706f2543Smrg yystacksize *= 2; 1471706f2543Smrg if (YYMAXDEPTH < yystacksize) 1472706f2543Smrg yystacksize = YYMAXDEPTH; 1473706f2543Smrg 1474706f2543Smrg { 1475706f2543Smrg yytype_int16 *yyss1 = yyss; 1476706f2543Smrg union yyalloc *yyptr = 1477706f2543Smrg (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1478706f2543Smrg if (! yyptr) 1479706f2543Smrg goto yyexhaustedlab; 1480706f2543Smrg YYSTACK_RELOCATE (yyss_alloc, yyss); 1481706f2543Smrg YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1482706f2543Smrg# undef YYSTACK_RELOCATE 1483706f2543Smrg if (yyss1 != yyssa) 1484706f2543Smrg YYSTACK_FREE (yyss1); 1485706f2543Smrg } 1486706f2543Smrg# endif 1487706f2543Smrg#endif /* no yyoverflow */ 1488706f2543Smrg 1489706f2543Smrg yyssp = yyss + yysize - 1; 1490706f2543Smrg yyvsp = yyvs + yysize - 1; 1491706f2543Smrg 1492706f2543Smrg YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1493706f2543Smrg (unsigned long int) yystacksize)); 1494706f2543Smrg 1495706f2543Smrg if (yyss + yystacksize - 1 <= yyssp) 1496706f2543Smrg YYABORT; 1497706f2543Smrg } 1498706f2543Smrg 1499706f2543Smrg YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1500706f2543Smrg 1501706f2543Smrg if (yystate == YYFINAL) 1502706f2543Smrg YYACCEPT; 1503706f2543Smrg 1504706f2543Smrg goto yybackup; 1505706f2543Smrg 1506706f2543Smrg/*-----------. 1507706f2543Smrg| yybackup. | 1508706f2543Smrg`-----------*/ 1509706f2543Smrgyybackup: 1510706f2543Smrg 1511706f2543Smrg /* Do appropriate processing given the current state. Read a 1512706f2543Smrg lookahead token if we need one and don't already have one. */ 1513706f2543Smrg 1514706f2543Smrg /* First try to decide what to do without reference to lookahead token. */ 1515706f2543Smrg yyn = yypact[yystate]; 1516706f2543Smrg if (yypact_value_is_default (yyn)) 1517706f2543Smrg goto yydefault; 1518706f2543Smrg 1519706f2543Smrg /* Not known => get a lookahead token if don't already have one. */ 1520706f2543Smrg 1521706f2543Smrg /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1522706f2543Smrg if (yychar == YYEMPTY) 1523706f2543Smrg { 1524706f2543Smrg YYDPRINTF ((stderr, "Reading a token: ")); 1525706f2543Smrg yychar = YYLEX; 1526706f2543Smrg } 1527706f2543Smrg 1528706f2543Smrg if (yychar <= YYEOF) 1529706f2543Smrg { 1530706f2543Smrg yychar = yytoken = YYEOF; 1531706f2543Smrg YYDPRINTF ((stderr, "Now at end of input.\n")); 1532706f2543Smrg } 1533706f2543Smrg else 1534706f2543Smrg { 1535706f2543Smrg yytoken = YYTRANSLATE (yychar); 1536706f2543Smrg YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1537706f2543Smrg } 1538706f2543Smrg 1539706f2543Smrg /* If the proper action on seeing token YYTOKEN is to reduce or to 1540706f2543Smrg detect an error, take that action. */ 1541706f2543Smrg yyn += yytoken; 1542706f2543Smrg if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1543706f2543Smrg goto yydefault; 1544706f2543Smrg yyn = yytable[yyn]; 1545706f2543Smrg if (yyn <= 0) 1546706f2543Smrg { 1547706f2543Smrg if (yytable_value_is_error (yyn)) 1548706f2543Smrg goto yyerrlab; 1549706f2543Smrg yyn = -yyn; 1550706f2543Smrg goto yyreduce; 1551706f2543Smrg } 1552706f2543Smrg 1553706f2543Smrg /* Count tokens shifted since error; after three, turn off error 1554706f2543Smrg status. */ 1555706f2543Smrg if (yyerrstatus) 1556706f2543Smrg yyerrstatus--; 1557706f2543Smrg 1558706f2543Smrg /* Shift the lookahead token. */ 1559706f2543Smrg YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1560706f2543Smrg 1561706f2543Smrg /* Discard the shifted token. */ 1562706f2543Smrg yychar = YYEMPTY; 1563706f2543Smrg 1564706f2543Smrg yystate = yyn; 1565706f2543Smrg *++yyvsp = yylval; 1566706f2543Smrg 1567706f2543Smrg goto yynewstate; 1568706f2543Smrg 1569706f2543Smrg 1570706f2543Smrg/*-----------------------------------------------------------. 1571706f2543Smrg| yydefault -- do the default action for the current state. | 1572706f2543Smrg`-----------------------------------------------------------*/ 1573706f2543Smrgyydefault: 1574706f2543Smrg yyn = yydefact[yystate]; 1575706f2543Smrg if (yyn == 0) 1576706f2543Smrg goto yyerrlab; 1577706f2543Smrg goto yyreduce; 1578706f2543Smrg 1579706f2543Smrg 1580706f2543Smrg/*-----------------------------. 1581706f2543Smrg| yyreduce -- Do a reduction. | 1582706f2543Smrg`-----------------------------*/ 1583706f2543Smrgyyreduce: 1584706f2543Smrg /* yyn is the number of a rule to reduce with. */ 1585706f2543Smrg yylen = yyr2[yyn]; 1586706f2543Smrg 1587706f2543Smrg /* If YYLEN is nonzero, implement the default value of the action: 1588706f2543Smrg `$$ = $1'. 1589706f2543Smrg 1590706f2543Smrg Otherwise, the following line sets YYVAL to garbage. 1591706f2543Smrg This behavior is undocumented and Bison 1592706f2543Smrg users should not rely upon it. Assigning to YYVAL 1593706f2543Smrg unconditionally makes the parser a bit smaller, and it avoids a 1594706f2543Smrg GCC warning that YYVAL may be used uninitialized. */ 1595706f2543Smrg yyval = yyvsp[1-yylen]; 1596706f2543Smrg 1597706f2543Smrg 1598706f2543Smrg YY_REDUCE_PRINT (yyn); 1599706f2543Smrg switch (yyn) 1600706f2543Smrg { 1601706f2543Smrg case 20: 1602706f2543Smrg 1603706f2543Smrg/* Line 1806 of yacc.c */ 1604706f2543Smrg#line 159 "winprefsyacc.y" 1605706f2543Smrg { SetTrayIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 1606706f2543Smrg break; 1607706f2543Smrg 1608706f2543Smrg case 21: 1609706f2543Smrg 1610706f2543Smrg/* Line 1806 of yacc.c */ 1611706f2543Smrg#line 162 "winprefsyacc.y" 1612706f2543Smrg { SetRootMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 1613706f2543Smrg break; 1614706f2543Smrg 1615706f2543Smrg case 22: 1616706f2543Smrg 1617706f2543Smrg/* Line 1806 of yacc.c */ 1618706f2543Smrg#line 165 "winprefsyacc.y" 1619706f2543Smrg { SetDefaultSysMenu((yyvsp[(2) - (4)].sVal), (yyvsp[(3) - (4)].iVal)); free((yyvsp[(2) - (4)].sVal)); } 1620706f2543Smrg break; 1621706f2543Smrg 1622706f2543Smrg case 23: 1623706f2543Smrg 1624706f2543Smrg/* Line 1806 of yacc.c */ 1625706f2543Smrg#line 168 "winprefsyacc.y" 1626706f2543Smrg { SetDefaultIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 1627706f2543Smrg break; 1628706f2543Smrg 1629706f2543Smrg case 24: 1630706f2543Smrg 1631706f2543Smrg/* Line 1806 of yacc.c */ 1632706f2543Smrg#line 171 "winprefsyacc.y" 1633706f2543Smrg { SetIconDirectory((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 1634706f2543Smrg break; 1635706f2543Smrg 1636706f2543Smrg case 25: 1637706f2543Smrg 1638706f2543Smrg/* Line 1806 of yacc.c */ 1639706f2543Smrg#line 174 "winprefsyacc.y" 1640706f2543Smrg { AddMenuLine("-", CMD_SEPARATOR, ""); } 1641706f2543Smrg break; 1642706f2543Smrg 1643706f2543Smrg case 26: 1644706f2543Smrg 1645706f2543Smrg/* Line 1806 of yacc.c */ 1646706f2543Smrg#line 175 "winprefsyacc.y" 1647706f2543Smrg { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_ALWAYSONTOP, ""); free((yyvsp[(1) - (4)].sVal)); } 1648706f2543Smrg break; 1649706f2543Smrg 1650706f2543Smrg case 27: 1651706f2543Smrg 1652706f2543Smrg/* Line 1806 of yacc.c */ 1653706f2543Smrg#line 176 "winprefsyacc.y" 1654706f2543Smrg { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_EXEC, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); } 1655706f2543Smrg break; 1656706f2543Smrg 1657706f2543Smrg case 28: 1658706f2543Smrg 1659706f2543Smrg/* Line 1806 of yacc.c */ 1660706f2543Smrg#line 177 "winprefsyacc.y" 1661706f2543Smrg { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_MENU, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); } 1662706f2543Smrg break; 1663706f2543Smrg 1664706f2543Smrg case 29: 1665706f2543Smrg 1666706f2543Smrg/* Line 1806 of yacc.c */ 1667706f2543Smrg#line 178 "winprefsyacc.y" 1668706f2543Smrg { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_RELOAD, ""); free((yyvsp[(1) - (4)].sVal)); } 1669706f2543Smrg break; 1670706f2543Smrg 1671706f2543Smrg case 32: 1672706f2543Smrg 1673706f2543Smrg/* Line 1806 of yacc.c */ 1674706f2543Smrg#line 185 "winprefsyacc.y" 1675706f2543Smrg { OpenMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 1676706f2543Smrg break; 1677706f2543Smrg 1678706f2543Smrg case 33: 1679706f2543Smrg 1680706f2543Smrg/* Line 1806 of yacc.c */ 1681706f2543Smrg#line 185 "winprefsyacc.y" 1682706f2543Smrg {CloseMenu();} 1683706f2543Smrg break; 1684706f2543Smrg 1685706f2543Smrg case 34: 1686706f2543Smrg 1687706f2543Smrg/* Line 1806 of yacc.c */ 1688706f2543Smrg#line 188 "winprefsyacc.y" 1689706f2543Smrg { AddIconLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].sVal)); free((yyvsp[(1) - (4)].sVal)); free((yyvsp[(2) - (4)].sVal)); } 1690706f2543Smrg break; 1691706f2543Smrg 1692706f2543Smrg case 37: 1693706f2543Smrg 1694706f2543Smrg/* Line 1806 of yacc.c */ 1695706f2543Smrg#line 195 "winprefsyacc.y" 1696706f2543Smrg {OpenIcons();} 1697706f2543Smrg break; 1698706f2543Smrg 1699706f2543Smrg case 38: 1700706f2543Smrg 1701706f2543Smrg/* Line 1806 of yacc.c */ 1702706f2543Smrg#line 195 "winprefsyacc.y" 1703706f2543Smrg {CloseIcons();} 1704706f2543Smrg break; 1705706f2543Smrg 1706706f2543Smrg case 39: 1707706f2543Smrg 1708706f2543Smrg/* Line 1806 of yacc.c */ 1709706f2543Smrg#line 198 "winprefsyacc.y" 1710706f2543Smrg { (yyval.uVal)=STYLE_TOPMOST; } 1711706f2543Smrg break; 1712706f2543Smrg 1713706f2543Smrg case 40: 1714706f2543Smrg 1715706f2543Smrg/* Line 1806 of yacc.c */ 1716706f2543Smrg#line 199 "winprefsyacc.y" 1717706f2543Smrg { (yyval.uVal)=STYLE_MAXIMIZE; } 1718706f2543Smrg break; 1719706f2543Smrg 1720706f2543Smrg case 41: 1721706f2543Smrg 1722706f2543Smrg/* Line 1806 of yacc.c */ 1723706f2543Smrg#line 200 "winprefsyacc.y" 1724706f2543Smrg { (yyval.uVal)=STYLE_MINIMIZE; } 1725706f2543Smrg break; 1726706f2543Smrg 1727706f2543Smrg case 42: 1728706f2543Smrg 1729706f2543Smrg/* Line 1806 of yacc.c */ 1730706f2543Smrg#line 201 "winprefsyacc.y" 1731706f2543Smrg { (yyval.uVal)=STYLE_BOTTOM; } 1732706f2543Smrg break; 1733706f2543Smrg 1734706f2543Smrg case 43: 1735706f2543Smrg 1736706f2543Smrg/* Line 1806 of yacc.c */ 1737706f2543Smrg#line 204 "winprefsyacc.y" 1738706f2543Smrg { (yyval.uVal)=STYLE_NOTITLE; } 1739706f2543Smrg break; 1740706f2543Smrg 1741706f2543Smrg case 44: 1742706f2543Smrg 1743706f2543Smrg/* Line 1806 of yacc.c */ 1744706f2543Smrg#line 205 "winprefsyacc.y" 1745706f2543Smrg { (yyval.uVal)=STYLE_OUTLINE; } 1746706f2543Smrg break; 1747706f2543Smrg 1748706f2543Smrg case 45: 1749706f2543Smrg 1750706f2543Smrg/* Line 1806 of yacc.c */ 1751706f2543Smrg#line 206 "winprefsyacc.y" 1752706f2543Smrg { (yyval.uVal)=STYLE_NOFRAME; } 1753706f2543Smrg break; 1754706f2543Smrg 1755706f2543Smrg case 46: 1756706f2543Smrg 1757706f2543Smrg/* Line 1806 of yacc.c */ 1758706f2543Smrg#line 209 "winprefsyacc.y" 1759706f2543Smrg { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } 1760706f2543Smrg break; 1761706f2543Smrg 1762706f2543Smrg case 47: 1763706f2543Smrg 1764706f2543Smrg/* Line 1806 of yacc.c */ 1765706f2543Smrg#line 210 "winprefsyacc.y" 1766706f2543Smrg { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } 1767706f2543Smrg break; 1768706f2543Smrg 1769706f2543Smrg case 48: 1770706f2543Smrg 1771706f2543Smrg/* Line 1806 of yacc.c */ 1772706f2543Smrg#line 211 "winprefsyacc.y" 1773706f2543Smrg { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } 1774706f2543Smrg break; 1775706f2543Smrg 1776706f2543Smrg case 49: 1777706f2543Smrg 1778706f2543Smrg/* Line 1806 of yacc.c */ 1779706f2543Smrg#line 212 "winprefsyacc.y" 1780706f2543Smrg { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } 1781706f2543Smrg break; 1782706f2543Smrg 1783706f2543Smrg case 50: 1784706f2543Smrg 1785706f2543Smrg/* Line 1806 of yacc.c */ 1786706f2543Smrg#line 215 "winprefsyacc.y" 1787706f2543Smrg { AddStyleLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].uVal)); free((yyvsp[(1) - (4)].sVal)); } 1788706f2543Smrg break; 1789706f2543Smrg 1790706f2543Smrg case 53: 1791706f2543Smrg 1792706f2543Smrg/* Line 1806 of yacc.c */ 1793706f2543Smrg#line 222 "winprefsyacc.y" 1794706f2543Smrg {OpenStyles();} 1795706f2543Smrg break; 1796706f2543Smrg 1797706f2543Smrg case 54: 1798706f2543Smrg 1799706f2543Smrg/* Line 1806 of yacc.c */ 1800706f2543Smrg#line 222 "winprefsyacc.y" 1801706f2543Smrg {CloseStyles();} 1802706f2543Smrg break; 1803706f2543Smrg 1804706f2543Smrg case 55: 1805706f2543Smrg 1806706f2543Smrg/* Line 1806 of yacc.c */ 1807706f2543Smrg#line 225 "winprefsyacc.y" 1808706f2543Smrg { (yyval.iVal)=AT_END; } 1809706f2543Smrg break; 1810706f2543Smrg 1811706f2543Smrg case 56: 1812706f2543Smrg 1813706f2543Smrg/* Line 1806 of yacc.c */ 1814706f2543Smrg#line 226 "winprefsyacc.y" 1815706f2543Smrg { (yyval.iVal)=AT_START; } 1816706f2543Smrg break; 1817706f2543Smrg 1818706f2543Smrg case 57: 1819706f2543Smrg 1820706f2543Smrg/* Line 1806 of yacc.c */ 1821706f2543Smrg#line 227 "winprefsyacc.y" 1822706f2543Smrg { (yyval.iVal)=AT_END; } 1823706f2543Smrg break; 1824706f2543Smrg 1825706f2543Smrg case 58: 1826706f2543Smrg 1827706f2543Smrg/* Line 1806 of yacc.c */ 1828706f2543Smrg#line 230 "winprefsyacc.y" 1829706f2543Smrg { AddSysMenuLine((yyvsp[(1) - (5)].sVal), (yyvsp[(2) - (5)].sVal), (yyvsp[(3) - (5)].iVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(2) - (5)].sVal)); } 1830706f2543Smrg break; 1831706f2543Smrg 1832706f2543Smrg case 61: 1833706f2543Smrg 1834706f2543Smrg/* Line 1806 of yacc.c */ 1835706f2543Smrg#line 237 "winprefsyacc.y" 1836706f2543Smrg {OpenSysMenu();} 1837706f2543Smrg break; 1838706f2543Smrg 1839706f2543Smrg case 62: 1840706f2543Smrg 1841706f2543Smrg/* Line 1806 of yacc.c */ 1842706f2543Smrg#line 237 "winprefsyacc.y" 1843706f2543Smrg {CloseSysMenu();} 1844706f2543Smrg break; 1845706f2543Smrg 1846706f2543Smrg case 63: 1847706f2543Smrg 1848706f2543Smrg/* Line 1806 of yacc.c */ 1849706f2543Smrg#line 240 "winprefsyacc.y" 1850706f2543Smrg { pref.fForceExit = TRUE; } 1851706f2543Smrg break; 1852706f2543Smrg 1853706f2543Smrg case 64: 1854706f2543Smrg 1855706f2543Smrg/* Line 1806 of yacc.c */ 1856706f2543Smrg#line 243 "winprefsyacc.y" 1857706f2543Smrg { pref.fSilentExit = TRUE; } 1858706f2543Smrg break; 1859706f2543Smrg 1860706f2543Smrg case 65: 1861706f2543Smrg 1862706f2543Smrg/* Line 1806 of yacc.c */ 1863706f2543Smrg#line 246 "winprefsyacc.y" 1864706f2543Smrg { ErrorF("LoadPreferences: %s\n", (yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 1865706f2543Smrg break; 1866706f2543Smrg 1867706f2543Smrg 1868706f2543Smrg 1869706f2543Smrg/* Line 1806 of yacc.c */ 1870706f2543Smrg#line 1871 "winprefsyacc.c" 1871706f2543Smrg default: break; 1872706f2543Smrg } 1873706f2543Smrg /* User semantic actions sometimes alter yychar, and that requires 1874706f2543Smrg that yytoken be updated with the new translation. We take the 1875706f2543Smrg approach of translating immediately before every use of yytoken. 1876706f2543Smrg One alternative is translating here after every semantic action, 1877706f2543Smrg but that translation would be missed if the semantic action invokes 1878706f2543Smrg YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 1879706f2543Smrg if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 1880706f2543Smrg incorrect destructor might then be invoked immediately. In the 1881706f2543Smrg case of YYERROR or YYBACKUP, subsequent parser actions might lead 1882706f2543Smrg to an incorrect destructor call or verbose syntax error message 1883706f2543Smrg before the lookahead is translated. */ 1884706f2543Smrg YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1885706f2543Smrg 1886706f2543Smrg YYPOPSTACK (yylen); 1887706f2543Smrg yylen = 0; 1888706f2543Smrg YY_STACK_PRINT (yyss, yyssp); 1889706f2543Smrg 1890706f2543Smrg *++yyvsp = yyval; 1891706f2543Smrg 1892706f2543Smrg /* Now `shift' the result of the reduction. Determine what state 1893706f2543Smrg that goes to, based on the state we popped back to and the rule 1894706f2543Smrg number reduced by. */ 1895706f2543Smrg 1896706f2543Smrg yyn = yyr1[yyn]; 1897706f2543Smrg 1898706f2543Smrg yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1899706f2543Smrg if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1900706f2543Smrg yystate = yytable[yystate]; 1901706f2543Smrg else 1902706f2543Smrg yystate = yydefgoto[yyn - YYNTOKENS]; 1903706f2543Smrg 1904706f2543Smrg goto yynewstate; 1905706f2543Smrg 1906706f2543Smrg 1907706f2543Smrg/*------------------------------------. 1908706f2543Smrg| yyerrlab -- here on detecting error | 1909706f2543Smrg`------------------------------------*/ 1910706f2543Smrgyyerrlab: 1911706f2543Smrg /* Make sure we have latest lookahead translation. See comments at 1912706f2543Smrg user semantic actions for why this is necessary. */ 1913706f2543Smrg yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 1914706f2543Smrg 1915706f2543Smrg /* If not already recovering from an error, report this error. */ 1916706f2543Smrg if (!yyerrstatus) 1917706f2543Smrg { 1918706f2543Smrg ++yynerrs; 1919706f2543Smrg#if ! YYERROR_VERBOSE 1920706f2543Smrg yyerror (YY_("syntax error")); 1921706f2543Smrg#else 1922706f2543Smrg# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 1923706f2543Smrg yyssp, yytoken) 1924706f2543Smrg { 1925706f2543Smrg char const *yymsgp = YY_("syntax error"); 1926706f2543Smrg int yysyntax_error_status; 1927706f2543Smrg yysyntax_error_status = YYSYNTAX_ERROR; 1928706f2543Smrg if (yysyntax_error_status == 0) 1929706f2543Smrg yymsgp = yymsg; 1930706f2543Smrg else if (yysyntax_error_status == 1) 1931706f2543Smrg { 1932706f2543Smrg if (yymsg != yymsgbuf) 1933706f2543Smrg YYSTACK_FREE (yymsg); 1934706f2543Smrg yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 1935706f2543Smrg if (!yymsg) 1936706f2543Smrg { 1937706f2543Smrg yymsg = yymsgbuf; 1938706f2543Smrg yymsg_alloc = sizeof yymsgbuf; 1939706f2543Smrg yysyntax_error_status = 2; 1940706f2543Smrg } 1941706f2543Smrg else 1942706f2543Smrg { 1943706f2543Smrg yysyntax_error_status = YYSYNTAX_ERROR; 1944706f2543Smrg yymsgp = yymsg; 1945706f2543Smrg } 1946706f2543Smrg } 1947706f2543Smrg yyerror (yymsgp); 1948706f2543Smrg if (yysyntax_error_status == 2) 1949706f2543Smrg goto yyexhaustedlab; 1950706f2543Smrg } 1951706f2543Smrg# undef YYSYNTAX_ERROR 1952706f2543Smrg#endif 1953706f2543Smrg } 1954706f2543Smrg 1955706f2543Smrg 1956706f2543Smrg 1957706f2543Smrg if (yyerrstatus == 3) 1958706f2543Smrg { 1959706f2543Smrg /* If just tried and failed to reuse lookahead token after an 1960706f2543Smrg error, discard it. */ 1961706f2543Smrg 1962706f2543Smrg if (yychar <= YYEOF) 1963706f2543Smrg { 1964706f2543Smrg /* Return failure if at end of input. */ 1965706f2543Smrg if (yychar == YYEOF) 1966706f2543Smrg YYABORT; 1967706f2543Smrg } 1968706f2543Smrg else 1969706f2543Smrg { 1970706f2543Smrg yydestruct ("Error: discarding", 1971706f2543Smrg yytoken, &yylval); 1972706f2543Smrg yychar = YYEMPTY; 1973706f2543Smrg } 1974706f2543Smrg } 1975706f2543Smrg 1976706f2543Smrg /* Else will try to reuse lookahead token after shifting the error 1977706f2543Smrg token. */ 1978706f2543Smrg goto yyerrlab1; 1979706f2543Smrg 1980706f2543Smrg 1981706f2543Smrg/*---------------------------------------------------. 1982706f2543Smrg| yyerrorlab -- error raised explicitly by YYERROR. | 1983706f2543Smrg`---------------------------------------------------*/ 1984706f2543Smrgyyerrorlab: 1985706f2543Smrg 1986706f2543Smrg /* Pacify compilers like GCC when the user code never invokes 1987706f2543Smrg YYERROR and the label yyerrorlab therefore never appears in user 1988706f2543Smrg code. */ 1989706f2543Smrg if (/*CONSTCOND*/ 0) 1990706f2543Smrg goto yyerrorlab; 1991706f2543Smrg 1992706f2543Smrg /* Do not reclaim the symbols of the rule which action triggered 1993706f2543Smrg this YYERROR. */ 1994706f2543Smrg YYPOPSTACK (yylen); 1995706f2543Smrg yylen = 0; 1996706f2543Smrg YY_STACK_PRINT (yyss, yyssp); 1997706f2543Smrg yystate = *yyssp; 1998706f2543Smrg goto yyerrlab1; 1999706f2543Smrg 2000706f2543Smrg 2001706f2543Smrg/*-------------------------------------------------------------. 2002706f2543Smrg| yyerrlab1 -- common code for both syntax error and YYERROR. | 2003706f2543Smrg`-------------------------------------------------------------*/ 2004706f2543Smrgyyerrlab1: 2005706f2543Smrg yyerrstatus = 3; /* Each real token shifted decrements this. */ 2006706f2543Smrg 2007706f2543Smrg for (;;) 2008706f2543Smrg { 2009706f2543Smrg yyn = yypact[yystate]; 2010706f2543Smrg if (!yypact_value_is_default (yyn)) 2011706f2543Smrg { 2012706f2543Smrg yyn += YYTERROR; 2013706f2543Smrg if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2014706f2543Smrg { 2015706f2543Smrg yyn = yytable[yyn]; 2016706f2543Smrg if (0 < yyn) 2017706f2543Smrg break; 2018706f2543Smrg } 2019706f2543Smrg } 2020706f2543Smrg 2021706f2543Smrg /* Pop the current state because it cannot handle the error token. */ 2022706f2543Smrg if (yyssp == yyss) 2023706f2543Smrg YYABORT; 2024706f2543Smrg 2025706f2543Smrg 2026706f2543Smrg yydestruct ("Error: popping", 2027706f2543Smrg yystos[yystate], yyvsp); 2028706f2543Smrg YYPOPSTACK (1); 2029706f2543Smrg yystate = *yyssp; 2030706f2543Smrg YY_STACK_PRINT (yyss, yyssp); 2031706f2543Smrg } 2032706f2543Smrg 2033706f2543Smrg *++yyvsp = yylval; 2034706f2543Smrg 2035706f2543Smrg 2036706f2543Smrg /* Shift the error token. */ 2037706f2543Smrg YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 2038706f2543Smrg 2039706f2543Smrg yystate = yyn; 2040706f2543Smrg goto yynewstate; 2041706f2543Smrg 2042706f2543Smrg 2043706f2543Smrg/*-------------------------------------. 2044706f2543Smrg| yyacceptlab -- YYACCEPT comes here. | 2045706f2543Smrg`-------------------------------------*/ 2046706f2543Smrgyyacceptlab: 2047706f2543Smrg yyresult = 0; 2048706f2543Smrg goto yyreturn; 2049706f2543Smrg 2050706f2543Smrg/*-----------------------------------. 2051706f2543Smrg| yyabortlab -- YYABORT comes here. | 2052706f2543Smrg`-----------------------------------*/ 2053706f2543Smrgyyabortlab: 2054706f2543Smrg yyresult = 1; 2055706f2543Smrg goto yyreturn; 2056706f2543Smrg 2057706f2543Smrg#if !defined(yyoverflow) || YYERROR_VERBOSE 2058706f2543Smrg/*-------------------------------------------------. 2059706f2543Smrg| yyexhaustedlab -- memory exhaustion comes here. | 2060706f2543Smrg`-------------------------------------------------*/ 2061706f2543Smrgyyexhaustedlab: 2062706f2543Smrg yyerror (YY_("memory exhausted")); 2063706f2543Smrg yyresult = 2; 2064706f2543Smrg /* Fall through. */ 2065706f2543Smrg#endif 2066706f2543Smrg 2067706f2543Smrgyyreturn: 2068706f2543Smrg if (yychar != YYEMPTY) 2069706f2543Smrg { 2070706f2543Smrg /* Make sure we have latest lookahead translation. See comments at 2071706f2543Smrg user semantic actions for why this is necessary. */ 2072706f2543Smrg yytoken = YYTRANSLATE (yychar); 2073706f2543Smrg yydestruct ("Cleanup: discarding lookahead", 2074706f2543Smrg yytoken, &yylval); 2075706f2543Smrg } 2076706f2543Smrg /* Do not reclaim the symbols of the rule which action triggered 2077706f2543Smrg this YYABORT or YYACCEPT. */ 2078706f2543Smrg YYPOPSTACK (yylen); 2079706f2543Smrg YY_STACK_PRINT (yyss, yyssp); 2080706f2543Smrg while (yyssp != yyss) 2081706f2543Smrg { 2082706f2543Smrg yydestruct ("Cleanup: popping", 2083706f2543Smrg yystos[*yyssp], yyvsp); 2084706f2543Smrg YYPOPSTACK (1); 2085706f2543Smrg } 2086706f2543Smrg#ifndef yyoverflow 2087706f2543Smrg if (yyss != yyssa) 2088706f2543Smrg YYSTACK_FREE (yyss); 2089706f2543Smrg#endif 2090706f2543Smrg#if YYERROR_VERBOSE 2091706f2543Smrg if (yymsg != yymsgbuf) 2092706f2543Smrg YYSTACK_FREE (yymsg); 2093706f2543Smrg#endif 2094706f2543Smrg /* Make sure YYID is used. */ 2095706f2543Smrg return YYID (yyresult); 2096706f2543Smrg} 2097706f2543Smrg 2098706f2543Smrg 2099706f2543Smrg 2100706f2543Smrg/* Line 2067 of yacc.c */ 2101706f2543Smrg#line 250 "winprefsyacc.y" 2102706f2543Smrg 2103706f2543Smrg/* 2104706f2543Smrg * Errors in parsing abort and print log messages 2105706f2543Smrg */ 2106706f2543Smrgstatic int 2107706f2543Smrgyyerror (char *s) 2108706f2543Smrg{ 2109706f2543Smrg extern int yylineno; /* Handled by flex internally */ 2110706f2543Smrg 2111706f2543Smrg ErrorF("LoadPreferences: %s line %d\n", s, yylineno); 2112706f2543Smrg return 1; 2113706f2543Smrg} 2114706f2543Smrg 2115706f2543Smrg/* Miscellaneous functions to store TOKENs into the structure */ 2116706f2543Smrgstatic void 2117706f2543SmrgSetIconDirectory (char *path) 2118706f2543Smrg{ 2119706f2543Smrg strncpy (pref.iconDirectory, path, PATH_MAX); 2120706f2543Smrg pref.iconDirectory[PATH_MAX] = 0; 2121706f2543Smrg} 2122706f2543Smrg 2123706f2543Smrgstatic void 2124706f2543SmrgSetDefaultIcon (char *fname) 2125706f2543Smrg{ 2126706f2543Smrg strncpy (pref.defaultIconName, fname, NAME_MAX); 2127706f2543Smrg pref.defaultIconName[NAME_MAX] = 0; 2128706f2543Smrg} 2129706f2543Smrg 2130706f2543Smrgstatic void 2131706f2543SmrgSetTrayIcon (char *fname) 2132706f2543Smrg{ 2133706f2543Smrg strncpy (pref.trayIconName, fname, NAME_MAX); 2134706f2543Smrg pref.trayIconName[NAME_MAX] = 0; 2135706f2543Smrg} 2136706f2543Smrg 2137706f2543Smrgstatic void 2138706f2543SmrgSetRootMenu (char *menu) 2139706f2543Smrg{ 2140706f2543Smrg strncpy (pref.rootMenuName, menu, MENU_MAX); 2141706f2543Smrg pref.rootMenuName[MENU_MAX] = 0; 2142706f2543Smrg} 2143706f2543Smrg 2144706f2543Smrgstatic void 2145706f2543SmrgSetDefaultSysMenu (char *menu, int pos) 2146706f2543Smrg{ 2147706f2543Smrg strncpy (pref.defaultSysMenuName, menu, MENU_MAX); 2148706f2543Smrg pref.defaultSysMenuName[MENU_MAX] = 0; 2149706f2543Smrg pref.defaultSysMenuPos = pos; 2150706f2543Smrg} 2151706f2543Smrg 2152706f2543Smrgstatic void 2153706f2543SmrgOpenMenu (char *menuname) 2154706f2543Smrg{ 2155706f2543Smrg if (menu.menuItem) free(menu.menuItem); 2156706f2543Smrg menu.menuItem = NULL; 2157706f2543Smrg strncpy(menu.menuName, menuname, MENU_MAX); 2158706f2543Smrg menu.menuName[MENU_MAX] = 0; 2159706f2543Smrg menu.menuItems = 0; 2160706f2543Smrg} 2161706f2543Smrg 2162706f2543Smrgstatic void 2163706f2543SmrgAddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param) 2164706f2543Smrg{ 2165706f2543Smrg if (menu.menuItem==NULL) 2166706f2543Smrg menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM)); 2167706f2543Smrg else 2168706f2543Smrg menu.menuItem = (MENUITEM*) 2169706f2543Smrg realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1)); 2170706f2543Smrg 2171706f2543Smrg strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX); 2172706f2543Smrg menu.menuItem[menu.menuItems].text[MENU_MAX] = 0; 2173706f2543Smrg 2174706f2543Smrg menu.menuItem[menu.menuItems].cmd = cmd; 2175706f2543Smrg 2176706f2543Smrg strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX); 2177706f2543Smrg menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0; 2178706f2543Smrg 2179706f2543Smrg menu.menuItem[menu.menuItems].commandID = 0; 2180706f2543Smrg 2181706f2543Smrg menu.menuItems++; 2182706f2543Smrg} 2183706f2543Smrg 2184706f2543Smrgstatic void 2185706f2543SmrgCloseMenu (void) 2186706f2543Smrg{ 2187706f2543Smrg if (menu.menuItem==NULL || menu.menuItems==0) 2188706f2543Smrg { 2189706f2543Smrg ErrorF("LoadPreferences: Empty menu detected\n"); 2190706f2543Smrg return; 2191706f2543Smrg } 2192706f2543Smrg 2193706f2543Smrg if (pref.menuItems) 2194706f2543Smrg pref.menu = (MENUPARSED*) 2195706f2543Smrg realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED)); 2196706f2543Smrg else 2197706f2543Smrg pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED)); 2198706f2543Smrg 2199706f2543Smrg memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED)); 2200706f2543Smrg pref.menuItems++; 2201706f2543Smrg 2202706f2543Smrg memset (&menu, 0, sizeof(MENUPARSED)); 2203706f2543Smrg} 2204706f2543Smrg 2205706f2543Smrgstatic void 2206706f2543SmrgOpenIcons (void) 2207706f2543Smrg{ 2208706f2543Smrg if (pref.icon != NULL) { 2209706f2543Smrg ErrorF("LoadPreferences: Redefining icon mappings\n"); 2210706f2543Smrg free(pref.icon); 2211706f2543Smrg pref.icon = NULL; 2212706f2543Smrg } 2213706f2543Smrg pref.iconItems = 0; 2214706f2543Smrg} 2215706f2543Smrg 2216706f2543Smrgstatic void 2217706f2543SmrgAddIconLine (char *matchstr, char *iconfile) 2218706f2543Smrg{ 2219706f2543Smrg if (pref.icon==NULL) 2220706f2543Smrg pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM)); 2221706f2543Smrg else 2222706f2543Smrg pref.icon = (ICONITEM*) 2223706f2543Smrg realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1)); 2224706f2543Smrg 2225706f2543Smrg strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX); 2226706f2543Smrg pref.icon[pref.iconItems].match[MENU_MAX] = 0; 2227706f2543Smrg 2228706f2543Smrg strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1); 2229706f2543Smrg pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0; 2230706f2543Smrg 2231706f2543Smrg pref.icon[pref.iconItems].hicon = 0; 2232706f2543Smrg 2233706f2543Smrg pref.iconItems++; 2234706f2543Smrg} 2235706f2543Smrg 2236706f2543Smrgstatic void 2237706f2543SmrgCloseIcons (void) 2238706f2543Smrg{ 2239706f2543Smrg} 2240706f2543Smrg 2241706f2543Smrgstatic void 2242706f2543SmrgOpenStyles (void) 2243706f2543Smrg{ 2244706f2543Smrg if (pref.style != NULL) { 2245706f2543Smrg ErrorF("LoadPreferences: Redefining window style\n"); 2246706f2543Smrg free(pref.style); 2247706f2543Smrg pref.style = NULL; 2248706f2543Smrg } 2249706f2543Smrg pref.styleItems = 0; 2250706f2543Smrg} 2251706f2543Smrg 2252706f2543Smrgstatic void 2253706f2543SmrgAddStyleLine (char *matchstr, unsigned long style) 2254706f2543Smrg{ 2255706f2543Smrg if (pref.style==NULL) 2256706f2543Smrg pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM)); 2257706f2543Smrg else 2258706f2543Smrg pref.style = (STYLEITEM*) 2259706f2543Smrg realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1)); 2260706f2543Smrg 2261706f2543Smrg strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX); 2262706f2543Smrg pref.style[pref.styleItems].match[MENU_MAX] = 0; 2263706f2543Smrg 2264706f2543Smrg pref.style[pref.styleItems].type = style; 2265706f2543Smrg 2266706f2543Smrg pref.styleItems++; 2267706f2543Smrg} 2268706f2543Smrg 2269706f2543Smrgstatic void 2270706f2543SmrgCloseStyles (void) 2271706f2543Smrg{ 2272706f2543Smrg} 2273706f2543Smrg 2274706f2543Smrgstatic void 2275706f2543SmrgOpenSysMenu (void) 2276706f2543Smrg{ 2277706f2543Smrg if (pref.sysMenu != NULL) { 2278706f2543Smrg ErrorF("LoadPreferences: Redefining system menu\n"); 2279706f2543Smrg free(pref.sysMenu); 2280706f2543Smrg pref.sysMenu = NULL; 2281706f2543Smrg } 2282706f2543Smrg pref.sysMenuItems = 0; 2283706f2543Smrg} 2284706f2543Smrg 2285706f2543Smrgstatic void 2286706f2543SmrgAddSysMenuLine (char *matchstr, char *menuname, int pos) 2287706f2543Smrg{ 2288706f2543Smrg if (pref.sysMenu==NULL) 2289706f2543Smrg pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM)); 2290706f2543Smrg else 2291706f2543Smrg pref.sysMenu = (SYSMENUITEM*) 2292706f2543Smrg realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1)); 2293706f2543Smrg 2294706f2543Smrg strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX); 2295706f2543Smrg pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0; 2296706f2543Smrg 2297706f2543Smrg strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX); 2298706f2543Smrg pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0; 2299706f2543Smrg 2300706f2543Smrg pref.sysMenu[pref.sysMenuItems].menuPos = pos; 2301706f2543Smrg 2302706f2543Smrg pref.sysMenuItems++; 2303706f2543Smrg} 2304706f2543Smrg 2305706f2543Smrgstatic void 2306706f2543SmrgCloseSysMenu (void) 2307706f2543Smrg{ 2308706f2543Smrg} 2309706f2543Smrg 2310706f2543Smrg 2311