winprefsyacc.c revision 9ace9065
19ace9065Smrg/* A Bison parser, made by GNU Bison 2.5. */ 205b261ecSmrg 39ace9065Smrg/* Bison implementation for Yacc-like parsers in C 44642e01fSmrg 59ace9065Smrg Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 64642e01fSmrg 74642e01fSmrg This program is free software: you can redistribute it and/or modify 805b261ecSmrg it under the terms of the GNU General Public License as published by 94642e01fSmrg the Free Software Foundation, either version 3 of the License, or 104642e01fSmrg (at your option) any later version. 114642e01fSmrg 1205b261ecSmrg This program is distributed in the hope that it will be useful, 1305b261ecSmrg but WITHOUT ANY WARRANTY; without even the implied warranty of 1405b261ecSmrg MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1505b261ecSmrg GNU General Public License for more details. 164642e01fSmrg 1705b261ecSmrg You should have received a copy of the GNU General Public License 184642e01fSmrg along with this program. If not, see <http://www.gnu.org/licenses/>. */ 1905b261ecSmrg 2005b261ecSmrg/* As a special exception, you may create a larger work that contains 2105b261ecSmrg part or all of the Bison parser skeleton and distribute that work 2205b261ecSmrg under terms of your choice, so long as that work isn't itself a 2305b261ecSmrg parser generator using the skeleton or a modified version thereof 2405b261ecSmrg as a parser skeleton. Alternatively, if you modify or redistribute 2505b261ecSmrg the parser skeleton itself, you may (at your option) remove this 2605b261ecSmrg special exception, which will cause the skeleton and the resulting 2705b261ecSmrg Bison output files to be licensed under the GNU General Public 2805b261ecSmrg License without this special exception. 294642e01fSmrg 3005b261ecSmrg This special exception was added by the Free Software Foundation in 3105b261ecSmrg version 2.2 of Bison. */ 3205b261ecSmrg 3305b261ecSmrg/* C LALR(1) parser skeleton written by Richard Stallman, by 3405b261ecSmrg simplifying the original so-called "semantic" parser. */ 3505b261ecSmrg 3605b261ecSmrg/* All symbols defined below should begin with yy or YY, to avoid 3705b261ecSmrg infringing on user name space. This should be done even for local 3805b261ecSmrg variables, as they might otherwise be expanded by user macros. 3905b261ecSmrg There are some unavoidable exceptions within include files to 4005b261ecSmrg define necessary library symbols; they are noted "INFRINGES ON 4105b261ecSmrg USER NAME SPACE" below. */ 4205b261ecSmrg 4305b261ecSmrg/* Identify Bison output. */ 4405b261ecSmrg#define YYBISON 1 4505b261ecSmrg 4605b261ecSmrg/* Bison version. */ 479ace9065Smrg#define YYBISON_VERSION "2.5" 4805b261ecSmrg 4905b261ecSmrg/* Skeleton name. */ 5005b261ecSmrg#define YYSKELETON_NAME "yacc.c" 5105b261ecSmrg 5205b261ecSmrg/* Pure parsers. */ 5305b261ecSmrg#define YYPURE 0 5405b261ecSmrg 554642e01fSmrg/* Push parsers. */ 564642e01fSmrg#define YYPUSH 0 5705b261ecSmrg 584642e01fSmrg/* Pull parsers. */ 594642e01fSmrg#define YYPULL 1 6005b261ecSmrg 614642e01fSmrg/* Using locations. */ 624642e01fSmrg#define YYLSP_NEEDED 0 6305b261ecSmrg 6405b261ecSmrg 6505b261ecSmrg 6605b261ecSmrg/* Copy the first part of user declarations. */ 674642e01fSmrg 689ace9065Smrg/* Line 268 of yacc.c */ 6905b261ecSmrg#line 1 "winprefsyacc.y" 7005b261ecSmrg 7105b261ecSmrg/* 7205b261ecSmrg * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. 736747b715Smrg * Copyright (C) Colin Harrison 2005-2008 7405b261ecSmrg * 7505b261ecSmrg * Permission is hereby granted, free of charge, to any person obtaining 7605b261ecSmrg * a copy of this software and associated documentation files (the 7705b261ecSmrg * "Software"), to deal in the Software without restriction, including 7805b261ecSmrg * without limitation the rights to use, copy, modify, merge, publish, 7905b261ecSmrg * distribute, sublicense, and/or sell copies of the Software, and to 8005b261ecSmrg * permit persons to whom the Software is furnished to do so, subject to 8105b261ecSmrg * the following conditions: 8205b261ecSmrg * 8305b261ecSmrg * The above copyright notice and this permission notice shall be 8405b261ecSmrg * included in all copies or substantial portions of the Software. 8505b261ecSmrg * 8605b261ecSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 8705b261ecSmrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 8805b261ecSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 8905b261ecSmrg * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR 9005b261ecSmrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 9105b261ecSmrg * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 9205b261ecSmrg * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9305b261ecSmrg * 9405b261ecSmrg * Except as contained in this notice, the name of the XFree86 Project 9505b261ecSmrg * shall not be used in advertising or otherwise to promote the sale, use 9605b261ecSmrg * or other dealings in this Software without prior written authorization 9705b261ecSmrg * from the XFree86 Project. 9805b261ecSmrg * 9905b261ecSmrg * Authors: Earle F. Philhower, III 1006747b715Smrg * Colin Harrison 10105b261ecSmrg */ 10205b261ecSmrg/* $XFree86: $ */ 10305b261ecSmrg 10405b261ecSmrg#ifdef HAVE_XWIN_CONFIG_H 10505b261ecSmrg#include <xwin-config.h> 10605b261ecSmrg#endif 10705b261ecSmrg#include <stdio.h> 10805b261ecSmrg#include <stdlib.h> 10905b261ecSmrg#include <string.h> 11005b261ecSmrg#include "winprefs.h" 11105b261ecSmrg 11205b261ecSmrg/* The following give better error messages in bison at the cost of a few KB */ 11305b261ecSmrg#define YYERROR_VERBOSE 1 11405b261ecSmrg 1156747b715Smrg/* YYLTYPE_IS_TRIVIAL and YYENABLE_NLS defined to suppress warnings */ 1166747b715Smrg#define YYLTYPE_IS_TRIVIAL 1 1176747b715Smrg#define YYENABLE_NLS 0 1186747b715Smrg 11905b261ecSmrg/* The global pref settings */ 12005b261ecSmrgWINPREFS pref; 12105b261ecSmrg 12205b261ecSmrg/* The working menu */ 12305b261ecSmrgstatic MENUPARSED menu; 12405b261ecSmrg 12505b261ecSmrg/* Functions for parsing the tokens into out structure */ 12605b261ecSmrg/* Defined at the end section of this file */ 12705b261ecSmrg 12805b261ecSmrgstatic void SetIconDirectory (char *path); 12905b261ecSmrgstatic void SetDefaultIcon (char *fname); 13005b261ecSmrgstatic void SetRootMenu (char *menu); 13105b261ecSmrgstatic void SetDefaultSysMenu (char *menu, int pos); 13205b261ecSmrgstatic void SetTrayIcon (char *fname); 13305b261ecSmrg 13405b261ecSmrgstatic void OpenMenu(char *menuname); 13505b261ecSmrgstatic void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param); 13605b261ecSmrgstatic void CloseMenu(void); 13705b261ecSmrg 13805b261ecSmrgstatic void OpenIcons(void); 13905b261ecSmrgstatic void AddIconLine(char *matchstr, char *iconfile); 14005b261ecSmrgstatic void CloseIcons(void); 14105b261ecSmrg 1426747b715Smrgstatic void OpenStyles(void); 1436747b715Smrgstatic void AddStyleLine(char *matchstr, unsigned long style); 1446747b715Smrgstatic void CloseStyles(void); 1456747b715Smrg 14605b261ecSmrgstatic void OpenSysMenu(void); 14705b261ecSmrgstatic void AddSysMenuLine(char *matchstr, char *menuname, int pos); 14805b261ecSmrgstatic void CloseSysMenu(void); 14905b261ecSmrg 15005b261ecSmrgstatic int yyerror (char *s); 15105b261ecSmrg 15205b261ecSmrgextern void ErrorF (const char* /*f*/, ...); 15305b261ecSmrgextern char *yytext; 15405b261ecSmrgextern int yylex(void); 15505b261ecSmrg 15605b261ecSmrg 15705b261ecSmrg 1589ace9065Smrg/* Line 268 of yacc.c */ 1599ace9065Smrg#line 160 "winprefsyacc.c" 1604642e01fSmrg 16105b261ecSmrg/* Enabling traces. */ 16205b261ecSmrg#ifndef YYDEBUG 16305b261ecSmrg# define YYDEBUG 0 16405b261ecSmrg#endif 16505b261ecSmrg 16605b261ecSmrg/* Enabling verbose error messages. */ 16705b261ecSmrg#ifdef YYERROR_VERBOSE 16805b261ecSmrg# undef YYERROR_VERBOSE 16905b261ecSmrg# define YYERROR_VERBOSE 1 17005b261ecSmrg#else 17105b261ecSmrg# define YYERROR_VERBOSE 0 17205b261ecSmrg#endif 17305b261ecSmrg 17405b261ecSmrg/* Enabling the token table. */ 17505b261ecSmrg#ifndef YYTOKEN_TABLE 17605b261ecSmrg# define YYTOKEN_TABLE 0 17705b261ecSmrg#endif 17805b261ecSmrg 1794642e01fSmrg 1804642e01fSmrg/* Tokens. */ 1814642e01fSmrg#ifndef YYTOKENTYPE 1824642e01fSmrg# define YYTOKENTYPE 1834642e01fSmrg /* Put the tokens into the symbol table, so that GDB and other debuggers 1844642e01fSmrg know about them. */ 1854642e01fSmrg enum yytokentype { 1864642e01fSmrg NEWLINE = 258, 1874642e01fSmrg MENU = 259, 1884642e01fSmrg LB = 260, 1894642e01fSmrg RB = 261, 1904642e01fSmrg ICONDIRECTORY = 262, 1914642e01fSmrg DEFAULTICON = 263, 1924642e01fSmrg ICONS = 264, 1936747b715Smrg STYLES = 265, 1946747b715Smrg TOPMOST = 266, 1956747b715Smrg MAXIMIZE = 267, 1966747b715Smrg MINIMIZE = 268, 1976747b715Smrg BOTTOM = 269, 1986747b715Smrg NOTITLE = 270, 1996747b715Smrg OUTLINE = 271, 2006747b715Smrg NOFRAME = 272, 2016747b715Smrg DEFAULTSYSMENU = 273, 2026747b715Smrg SYSMENU = 274, 2036747b715Smrg ROOTMENU = 275, 2046747b715Smrg SEPARATOR = 276, 2056747b715Smrg ATSTART = 277, 2066747b715Smrg ATEND = 278, 2076747b715Smrg EXEC = 279, 2086747b715Smrg ALWAYSONTOP = 280, 2096747b715Smrg DEBUGOUTPUT = 281, 2106747b715Smrg RELOAD = 282, 2116747b715Smrg TRAYICON = 283, 2126747b715Smrg FORCEEXIT = 284, 2136747b715Smrg SILENTEXIT = 285, 2146747b715Smrg STRING = 286 2154642e01fSmrg }; 2164642e01fSmrg#endif 2174642e01fSmrg/* Tokens. */ 2184642e01fSmrg#define NEWLINE 258 2194642e01fSmrg#define MENU 259 2204642e01fSmrg#define LB 260 2214642e01fSmrg#define RB 261 2224642e01fSmrg#define ICONDIRECTORY 262 2234642e01fSmrg#define DEFAULTICON 263 2244642e01fSmrg#define ICONS 264 2256747b715Smrg#define STYLES 265 2266747b715Smrg#define TOPMOST 266 2276747b715Smrg#define MAXIMIZE 267 2286747b715Smrg#define MINIMIZE 268 2296747b715Smrg#define BOTTOM 269 2306747b715Smrg#define NOTITLE 270 2316747b715Smrg#define OUTLINE 271 2326747b715Smrg#define NOFRAME 272 2336747b715Smrg#define DEFAULTSYSMENU 273 2346747b715Smrg#define SYSMENU 274 2356747b715Smrg#define ROOTMENU 275 2366747b715Smrg#define SEPARATOR 276 2376747b715Smrg#define ATSTART 277 2386747b715Smrg#define ATEND 278 2396747b715Smrg#define EXEC 279 2406747b715Smrg#define ALWAYSONTOP 280 2416747b715Smrg#define DEBUGOUTPUT 281 2426747b715Smrg#define RELOAD 282 2436747b715Smrg#define TRAYICON 283 2446747b715Smrg#define FORCEEXIT 284 2456747b715Smrg#define SILENTEXIT 285 2466747b715Smrg#define STRING 286 2474642e01fSmrg 2484642e01fSmrg 2494642e01fSmrg 2504642e01fSmrg 25105b261ecSmrg#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 25205b261ecSmrgtypedef union YYSTYPE 25305b261ecSmrg{ 2544642e01fSmrg 2559ace9065Smrg/* Line 293 of yacc.c */ 2566747b715Smrg#line 89 "winprefsyacc.y" 2574642e01fSmrg 25805b261ecSmrg char *sVal; 2596747b715Smrg unsigned long uVal; 26005b261ecSmrg int iVal; 2614642e01fSmrg 2624642e01fSmrg 2634642e01fSmrg 2649ace9065Smrg/* Line 293 of yacc.c */ 2659ace9065Smrg#line 266 "winprefsyacc.c" 2664642e01fSmrg} YYSTYPE; 2674642e01fSmrg# define YYSTYPE_IS_TRIVIAL 1 26805b261ecSmrg# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 26905b261ecSmrg# define YYSTYPE_IS_DECLARED 1 27005b261ecSmrg#endif 27105b261ecSmrg 27205b261ecSmrg 27305b261ecSmrg/* Copy the second part of user declarations. */ 27405b261ecSmrg 27505b261ecSmrg 2769ace9065Smrg/* Line 343 of yacc.c */ 2779ace9065Smrg#line 278 "winprefsyacc.c" 27805b261ecSmrg 27905b261ecSmrg#ifdef short 28005b261ecSmrg# undef short 28105b261ecSmrg#endif 28205b261ecSmrg 28305b261ecSmrg#ifdef YYTYPE_UINT8 28405b261ecSmrgtypedef YYTYPE_UINT8 yytype_uint8; 28505b261ecSmrg#else 28605b261ecSmrgtypedef unsigned char yytype_uint8; 28705b261ecSmrg#endif 28805b261ecSmrg 28905b261ecSmrg#ifdef YYTYPE_INT8 29005b261ecSmrgtypedef YYTYPE_INT8 yytype_int8; 29105b261ecSmrg#elif (defined __STDC__ || defined __C99__FUNC__ \ 29205b261ecSmrg || defined __cplusplus || defined _MSC_VER) 29305b261ecSmrgtypedef signed char yytype_int8; 29405b261ecSmrg#else 29505b261ecSmrgtypedef short int yytype_int8; 29605b261ecSmrg#endif 29705b261ecSmrg 29805b261ecSmrg#ifdef YYTYPE_UINT16 29905b261ecSmrgtypedef YYTYPE_UINT16 yytype_uint16; 30005b261ecSmrg#else 30105b261ecSmrgtypedef unsigned short int yytype_uint16; 30205b261ecSmrg#endif 30305b261ecSmrg 30405b261ecSmrg#ifdef YYTYPE_INT16 30505b261ecSmrgtypedef YYTYPE_INT16 yytype_int16; 30605b261ecSmrg#else 30705b261ecSmrgtypedef short int yytype_int16; 30805b261ecSmrg#endif 30905b261ecSmrg 31005b261ecSmrg#ifndef YYSIZE_T 31105b261ecSmrg# ifdef __SIZE_TYPE__ 31205b261ecSmrg# define YYSIZE_T __SIZE_TYPE__ 31305b261ecSmrg# elif defined size_t 31405b261ecSmrg# define YYSIZE_T size_t 31505b261ecSmrg# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 31605b261ecSmrg || defined __cplusplus || defined _MSC_VER) 31705b261ecSmrg# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 31805b261ecSmrg# define YYSIZE_T size_t 31905b261ecSmrg# else 32005b261ecSmrg# define YYSIZE_T unsigned int 32105b261ecSmrg# endif 32205b261ecSmrg#endif 32305b261ecSmrg 32405b261ecSmrg#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 32505b261ecSmrg 32605b261ecSmrg#ifndef YY_ 3276747b715Smrg# if defined YYENABLE_NLS && YYENABLE_NLS 32805b261ecSmrg# if ENABLE_NLS 32905b261ecSmrg# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 33005b261ecSmrg# define YY_(msgid) dgettext ("bison-runtime", msgid) 33105b261ecSmrg# endif 33205b261ecSmrg# endif 33305b261ecSmrg# ifndef YY_ 33405b261ecSmrg# define YY_(msgid) msgid 33505b261ecSmrg# endif 33605b261ecSmrg#endif 33705b261ecSmrg 33805b261ecSmrg/* Suppress unused-variable warnings by "using" E. */ 33905b261ecSmrg#if ! defined lint || defined __GNUC__ 34005b261ecSmrg# define YYUSE(e) ((void) (e)) 34105b261ecSmrg#else 34205b261ecSmrg# define YYUSE(e) /* empty */ 34305b261ecSmrg#endif 34405b261ecSmrg 34505b261ecSmrg/* Identity function, used to suppress warnings about constant conditions. */ 34605b261ecSmrg#ifndef lint 34705b261ecSmrg# define YYID(n) (n) 34805b261ecSmrg#else 34905b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 35005b261ecSmrg || defined __cplusplus || defined _MSC_VER) 35105b261ecSmrgstatic int 3524642e01fSmrgYYID (int yyi) 35305b261ecSmrg#else 35405b261ecSmrgstatic int 3554642e01fSmrgYYID (yyi) 3564642e01fSmrg int yyi; 35705b261ecSmrg#endif 35805b261ecSmrg{ 3594642e01fSmrg return yyi; 36005b261ecSmrg} 36105b261ecSmrg#endif 36205b261ecSmrg 36305b261ecSmrg#if ! defined yyoverflow || YYERROR_VERBOSE 36405b261ecSmrg 36505b261ecSmrg/* The parser invokes alloca or malloc; define the necessary symbols. */ 36605b261ecSmrg 36705b261ecSmrg# ifdef YYSTACK_USE_ALLOCA 36805b261ecSmrg# if YYSTACK_USE_ALLOCA 36905b261ecSmrg# ifdef __GNUC__ 37005b261ecSmrg# define YYSTACK_ALLOC __builtin_alloca 37105b261ecSmrg# elif defined __BUILTIN_VA_ARG_INCR 37205b261ecSmrg# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 37305b261ecSmrg# elif defined _AIX 37405b261ecSmrg# define YYSTACK_ALLOC __alloca 37505b261ecSmrg# elif defined _MSC_VER 37605b261ecSmrg# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 37705b261ecSmrg# define alloca _alloca 37805b261ecSmrg# else 37905b261ecSmrg# define YYSTACK_ALLOC alloca 3809ace9065Smrg# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 38105b261ecSmrg || defined __cplusplus || defined _MSC_VER) 38205b261ecSmrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 3839ace9065Smrg# ifndef EXIT_SUCCESS 3849ace9065Smrg# define EXIT_SUCCESS 0 38505b261ecSmrg# endif 38605b261ecSmrg# endif 38705b261ecSmrg# endif 38805b261ecSmrg# endif 38905b261ecSmrg# endif 39005b261ecSmrg 39105b261ecSmrg# ifdef YYSTACK_ALLOC 39205b261ecSmrg /* Pacify GCC's `empty if-body' warning. */ 39305b261ecSmrg# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 39405b261ecSmrg# ifndef YYSTACK_ALLOC_MAXIMUM 39505b261ecSmrg /* The OS might guarantee only one guard page at the bottom of the stack, 39605b261ecSmrg and a page size can be as small as 4096 bytes. So we cannot safely 39705b261ecSmrg invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 39805b261ecSmrg to allow for a few compiler-allocated temporary stack slots. */ 39905b261ecSmrg# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 40005b261ecSmrg# endif 40105b261ecSmrg# else 40205b261ecSmrg# define YYSTACK_ALLOC YYMALLOC 40305b261ecSmrg# define YYSTACK_FREE YYFREE 40405b261ecSmrg# ifndef YYSTACK_ALLOC_MAXIMUM 40505b261ecSmrg# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 40605b261ecSmrg# endif 4079ace9065Smrg# if (defined __cplusplus && ! defined EXIT_SUCCESS \ 40805b261ecSmrg && ! ((defined YYMALLOC || defined malloc) \ 40905b261ecSmrg && (defined YYFREE || defined free))) 41005b261ecSmrg# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 4119ace9065Smrg# ifndef EXIT_SUCCESS 4129ace9065Smrg# define EXIT_SUCCESS 0 41305b261ecSmrg# endif 41405b261ecSmrg# endif 41505b261ecSmrg# ifndef YYMALLOC 41605b261ecSmrg# define YYMALLOC malloc 4179ace9065Smrg# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 41805b261ecSmrg || defined __cplusplus || defined _MSC_VER) 41905b261ecSmrgvoid *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 42005b261ecSmrg# endif 42105b261ecSmrg# endif 42205b261ecSmrg# ifndef YYFREE 42305b261ecSmrg# define YYFREE free 4249ace9065Smrg# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ 42505b261ecSmrg || defined __cplusplus || defined _MSC_VER) 42605b261ecSmrgvoid free (void *); /* INFRINGES ON USER NAME SPACE */ 42705b261ecSmrg# endif 42805b261ecSmrg# endif 42905b261ecSmrg# endif 43005b261ecSmrg#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 43105b261ecSmrg 43205b261ecSmrg 43305b261ecSmrg#if (! defined yyoverflow \ 43405b261ecSmrg && (! defined __cplusplus \ 43505b261ecSmrg || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 43605b261ecSmrg 43705b261ecSmrg/* A type that is properly aligned for any stack member. */ 43805b261ecSmrgunion yyalloc 43905b261ecSmrg{ 4404642e01fSmrg yytype_int16 yyss_alloc; 4414642e01fSmrg YYSTYPE yyvs_alloc; 4424642e01fSmrg}; 44305b261ecSmrg 44405b261ecSmrg/* The size of the maximum gap between one aligned stack and the next. */ 44505b261ecSmrg# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 44605b261ecSmrg 44705b261ecSmrg/* The size of an array large to enough to hold all stacks, each with 44805b261ecSmrg N elements. */ 44905b261ecSmrg# define YYSTACK_BYTES(N) \ 45005b261ecSmrg ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 45105b261ecSmrg + YYSTACK_GAP_MAXIMUM) 45205b261ecSmrg 4539ace9065Smrg# define YYCOPY_NEEDED 1 45405b261ecSmrg 45505b261ecSmrg/* Relocate STACK from its old location to the new one. The 45605b261ecSmrg local variables YYSIZE and YYSTACKSIZE give the old and new number of 45705b261ecSmrg elements in the stack, and YYPTR gives the new location of the 45805b261ecSmrg stack. Advance YYPTR to a properly aligned location for the next 45905b261ecSmrg stack. */ 4604642e01fSmrg# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 46105b261ecSmrg do \ 46205b261ecSmrg { \ 46305b261ecSmrg YYSIZE_T yynewbytes; \ 4644642e01fSmrg YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 4654642e01fSmrg Stack = &yyptr->Stack_alloc; \ 46605b261ecSmrg yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 46705b261ecSmrg yyptr += yynewbytes / sizeof (*yyptr); \ 46805b261ecSmrg } \ 46905b261ecSmrg while (YYID (0)) 47005b261ecSmrg 47105b261ecSmrg#endif 47205b261ecSmrg 4739ace9065Smrg#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 4749ace9065Smrg/* Copy COUNT objects from FROM to TO. The source and destination do 4759ace9065Smrg not overlap. */ 4769ace9065Smrg# ifndef YYCOPY 4779ace9065Smrg# if defined __GNUC__ && 1 < __GNUC__ 4789ace9065Smrg# define YYCOPY(To, From, Count) \ 4799ace9065Smrg __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 4809ace9065Smrg# else 4819ace9065Smrg# define YYCOPY(To, From, Count) \ 4829ace9065Smrg do \ 4839ace9065Smrg { \ 4849ace9065Smrg YYSIZE_T yyi; \ 4859ace9065Smrg for (yyi = 0; yyi < (Count); yyi++) \ 4869ace9065Smrg (To)[yyi] = (From)[yyi]; \ 4879ace9065Smrg } \ 4889ace9065Smrg while (YYID (0)) 4899ace9065Smrg# endif 4909ace9065Smrg# endif 4919ace9065Smrg#endif /* !YYCOPY_NEEDED */ 4929ace9065Smrg 49305b261ecSmrg/* YYFINAL -- State number of the termination state. */ 49405b261ecSmrg#define YYFINAL 2 49505b261ecSmrg/* YYLAST -- Last index in YYTABLE. */ 4966747b715Smrg#define YYLAST 98 49705b261ecSmrg 49805b261ecSmrg/* YYNTOKENS -- Number of terminals. */ 4996747b715Smrg#define YYNTOKENS 32 50005b261ecSmrg/* YYNNTS -- Number of nonterminals. */ 5016747b715Smrg#define YYNNTS 33 50205b261ecSmrg/* YYNRULES -- Number of rules. */ 5036747b715Smrg#define YYNRULES 65 50405b261ecSmrg/* YYNRULES -- Number of states. */ 5056747b715Smrg#define YYNSTATES 121 50605b261ecSmrg 50705b261ecSmrg/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 50805b261ecSmrg#define YYUNDEFTOK 2 5096747b715Smrg#define YYMAXUTOK 286 51005b261ecSmrg 51105b261ecSmrg#define YYTRANSLATE(YYX) \ 51205b261ecSmrg ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 51305b261ecSmrg 51405b261ecSmrg/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 51505b261ecSmrgstatic const yytype_uint8 yytranslate[] = 51605b261ecSmrg{ 51705b261ecSmrg 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 51805b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 51905b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52005b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52105b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52205b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52305b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52405b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52505b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52605b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52705b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52805b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52905b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53005b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53105b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53205b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53305b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53405b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53505b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53605b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53705b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53805b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53905b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 54005b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 54105b261ecSmrg 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 54205b261ecSmrg 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 54305b261ecSmrg 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 5446747b715Smrg 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 5456747b715Smrg 25, 26, 27, 28, 29, 30, 31 54605b261ecSmrg}; 54705b261ecSmrg 54805b261ecSmrg#if YYDEBUG 54905b261ecSmrg/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 55005b261ecSmrg YYRHS. */ 55105b261ecSmrgstatic const yytype_uint8 yyprhs[] = 55205b261ecSmrg{ 55305b261ecSmrg 0, 0, 3, 4, 7, 9, 11, 12, 15, 17, 5546747b715Smrg 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 5556747b715Smrg 39, 43, 47, 52, 56, 60, 64, 69, 75, 81, 5566747b715Smrg 86, 88, 91, 92, 100, 105, 107, 110, 111, 118, 5576747b715Smrg 120, 122, 124, 126, 128, 130, 132, 134, 136, 139, 5586747b715Smrg 142, 147, 149, 152, 153, 160, 161, 163, 165, 171, 5596747b715Smrg 173, 176, 177, 185, 188, 191 56005b261ecSmrg}; 56105b261ecSmrg 56205b261ecSmrg/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 56305b261ecSmrgstatic const yytype_int8 yyrhs[] = 56405b261ecSmrg{ 5656747b715Smrg 33, 0, -1, -1, 33, 34, -1, 3, -1, 36, 5666747b715Smrg -1, -1, 3, 35, -1, 40, -1, 41, -1, 44, 5676747b715Smrg -1, 48, -1, 55, -1, 60, -1, 38, -1, 39, 5686747b715Smrg -1, 64, -1, 37, -1, 62, -1, 63, -1, 28, 5696747b715Smrg 31, 3, -1, 20, 31, 3, -1, 18, 31, 57, 5706747b715Smrg 3, -1, 8, 31, 3, -1, 7, 31, 3, -1, 5716747b715Smrg 21, 3, 35, -1, 31, 25, 3, 35, -1, 31, 5726747b715Smrg 24, 31, 3, 35, -1, 31, 4, 31, 3, 35, 5736747b715Smrg -1, 31, 27, 3, 35, -1, 42, -1, 42, 43, 5746747b715Smrg -1, -1, 4, 31, 5, 45, 35, 43, 6, -1, 5756747b715Smrg 31, 31, 3, 35, -1, 46, -1, 46, 47, -1, 5766747b715Smrg -1, 9, 5, 49, 35, 47, 6, -1, 11, -1, 5776747b715Smrg 12, -1, 13, -1, 14, -1, 15, -1, 16, -1, 5786747b715Smrg 17, -1, 50, -1, 51, -1, 50, 51, -1, 51, 5796747b715Smrg 50, -1, 31, 52, 3, 35, -1, 53, -1, 53, 5806747b715Smrg 54, -1, -1, 10, 5, 56, 35, 54, 6, -1, 5816747b715Smrg -1, 22, -1, 23, -1, 31, 31, 57, 3, 35, 5826747b715Smrg -1, 58, -1, 58, 59, -1, -1, 19, 5, 3, 5836747b715Smrg 61, 35, 59, 6, -1, 29, 3, -1, 30, 3, 5846747b715Smrg -1, 26, 31, 3, -1 58505b261ecSmrg}; 58605b261ecSmrg 58705b261ecSmrg/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 58805b261ecSmrgstatic const yytype_uint8 yyrline[] = 58905b261ecSmrg{ 5906747b715Smrg 0, 132, 132, 133, 136, 137, 141, 142, 145, 146, 5916747b715Smrg 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 5926747b715Smrg 159, 162, 165, 168, 171, 174, 175, 176, 177, 178, 5936747b715Smrg 181, 182, 185, 185, 188, 191, 192, 195, 195, 198, 5946747b715Smrg 199, 200, 201, 204, 205, 206, 209, 210, 211, 212, 5956747b715Smrg 215, 218, 219, 222, 222, 225, 226, 227, 230, 233, 5966747b715Smrg 234, 237, 237, 240, 243, 246 59705b261ecSmrg}; 59805b261ecSmrg#endif 59905b261ecSmrg 60005b261ecSmrg#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 60105b261ecSmrg/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 60205b261ecSmrg First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 60305b261ecSmrgstatic const char *const yytname[] = 60405b261ecSmrg{ 60505b261ecSmrg "$end", "error", "$undefined", "NEWLINE", "MENU", "LB", "RB", 6066747b715Smrg "ICONDIRECTORY", "DEFAULTICON", "ICONS", "STYLES", "TOPMOST", "MAXIMIZE", 6076747b715Smrg "MINIMIZE", "BOTTOM", "NOTITLE", "OUTLINE", "NOFRAME", "DEFAULTSYSMENU", 6086747b715Smrg "SYSMENU", "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC", 6096747b715Smrg "ALWAYSONTOP", "\"DEBUG\"", "RELOAD", "TRAYICON", "FORCEEXIT", 6106747b715Smrg "SILENTEXIT", "STRING", "$accept", "input", "line", "newline_or_nada", 6116747b715Smrg "command", "trayicon", "rootmenu", "defaultsysmenu", "defaulticon", 6126747b715Smrg "icondirectory", "menuline", "menulist", "menu", "$@1", "iconline", 6136747b715Smrg "iconlist", "icons", "$@2", "group1", "group2", "stylecombo", 6146747b715Smrg "styleline", "stylelist", "styles", "$@3", "atspot", "sysmenuline", 6156747b715Smrg "sysmenulist", "sysmenu", "$@4", "forceexit", "silentexit", "debug", 0 61605b261ecSmrg}; 61705b261ecSmrg#endif 61805b261ecSmrg 61905b261ecSmrg# ifdef YYPRINT 62005b261ecSmrg/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 62105b261ecSmrg token YYLEX-NUM. */ 62205b261ecSmrgstatic const yytype_uint16 yytoknum[] = 62305b261ecSmrg{ 62405b261ecSmrg 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 62505b261ecSmrg 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 6266747b715Smrg 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 6276747b715Smrg 285, 286 62805b261ecSmrg}; 62905b261ecSmrg# endif 63005b261ecSmrg 63105b261ecSmrg/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 63205b261ecSmrgstatic const yytype_uint8 yyr1[] = 63305b261ecSmrg{ 6346747b715Smrg 0, 32, 33, 33, 34, 34, 35, 35, 36, 36, 6356747b715Smrg 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 6366747b715Smrg 37, 38, 39, 40, 41, 42, 42, 42, 42, 42, 6376747b715Smrg 43, 43, 45, 44, 46, 47, 47, 49, 48, 50, 6386747b715Smrg 50, 50, 50, 51, 51, 51, 52, 52, 52, 52, 6396747b715Smrg 53, 54, 54, 56, 55, 57, 57, 57, 58, 59, 6406747b715Smrg 59, 61, 60, 62, 63, 64 64105b261ecSmrg}; 64205b261ecSmrg 64305b261ecSmrg/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 64405b261ecSmrgstatic const yytype_uint8 yyr2[] = 64505b261ecSmrg{ 64605b261ecSmrg 0, 2, 0, 2, 1, 1, 0, 2, 1, 1, 6476747b715Smrg 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6486747b715Smrg 3, 3, 4, 3, 3, 3, 4, 5, 5, 4, 6496747b715Smrg 1, 2, 0, 7, 4, 1, 2, 0, 6, 1, 6506747b715Smrg 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 6516747b715Smrg 4, 1, 2, 0, 6, 0, 1, 1, 5, 1, 6526747b715Smrg 2, 0, 7, 2, 2, 3 65305b261ecSmrg}; 65405b261ecSmrg 6559ace9065Smrg/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. 6569ace9065Smrg Performed when YYTABLE doesn't specify something else to do. Zero 65705b261ecSmrg means the default is an error. */ 65805b261ecSmrgstatic const yytype_uint8 yydefact[] = 65905b261ecSmrg{ 66005b261ecSmrg 2, 0, 1, 4, 0, 0, 0, 0, 0, 0, 6616747b715Smrg 0, 0, 0, 0, 0, 0, 3, 5, 17, 14, 6626747b715Smrg 15, 8, 9, 10, 11, 12, 13, 18, 19, 16, 6636747b715Smrg 0, 0, 0, 37, 53, 55, 0, 0, 0, 0, 6646747b715Smrg 63, 64, 32, 24, 23, 6, 6, 56, 57, 0, 6656747b715Smrg 61, 21, 65, 20, 6, 6, 0, 0, 22, 6, 6666747b715Smrg 0, 7, 0, 35, 0, 0, 51, 0, 0, 0, 6676747b715Smrg 0, 30, 0, 0, 36, 38, 39, 40, 41, 42, 6686747b715Smrg 43, 44, 45, 46, 47, 0, 52, 54, 0, 59, 6696747b715Smrg 0, 6, 0, 0, 0, 0, 31, 33, 6, 48, 6706747b715Smrg 49, 6, 55, 60, 62, 25, 0, 0, 6, 6, 6716747b715Smrg 34, 50, 0, 6, 6, 26, 29, 6, 28, 27, 6726747b715Smrg 58 67305b261ecSmrg}; 67405b261ecSmrg 67505b261ecSmrg/* YYDEFGOTO[NTERM-NUM]. */ 67605b261ecSmrgstatic const yytype_int8 yydefgoto[] = 67705b261ecSmrg{ 6786747b715Smrg -1, 1, 16, 56, 17, 18, 19, 20, 21, 22, 6796747b715Smrg 71, 72, 23, 54, 63, 64, 24, 45, 83, 84, 6806747b715Smrg 85, 66, 67, 25, 46, 49, 89, 90, 26, 59, 6816747b715Smrg 27, 28, 29 68205b261ecSmrg}; 68305b261ecSmrg 68405b261ecSmrg/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 68505b261ecSmrg STATE-NUM. */ 6866747b715Smrg#define YYPACT_NINF -47 68705b261ecSmrgstatic const yytype_int8 yypact[] = 68805b261ecSmrg{ 6896747b715Smrg -47, 7, -47, -47, -1, 0, 1, 18, 29, 15, 6906747b715Smrg 42, 17, 19, 20, 46, 50, -47, -47, -47, -47, 6916747b715Smrg -47, -47, -47, -47, -47, -47, -47, -47, -47, -47, 6926747b715Smrg 49, 53, 54, -47, -47, 6, 55, 56, 57, 58, 6936747b715Smrg -47, -47, -47, -47, -47, 61, 61, -47, -47, 62, 6946747b715Smrg -47, -47, -47, -47, 61, 61, 35, 38, -47, 61, 6956747b715Smrg -19, -47, 39, 35, 66, 27, 38, 67, 43, 72, 6966747b715Smrg -3, -19, 70, 74, -47, -47, -47, -47, -47, -47, 6976747b715Smrg -47, -47, -47, 3, -8, 75, -47, -47, 48, 43, 6986747b715Smrg 76, 61, 52, 59, 77, 78, -47, -47, 61, -47, 6996747b715Smrg -47, 61, 6, -47, -47, -47, 81, 82, 61, 61, 7006747b715Smrg -47, -47, 83, 61, 61, -47, -47, 61, -47, -47, 7016747b715Smrg -47 70205b261ecSmrg}; 70305b261ecSmrg 70405b261ecSmrg/* YYPGOTO[NTERM-NUM]. */ 70505b261ecSmrgstatic const yytype_int8 yypgoto[] = 70605b261ecSmrg{ 7076747b715Smrg -47, -47, -47, -46, -47, -47, -47, -47, -47, -47, 7086747b715Smrg -47, 16, -47, -47, -47, 25, -47, -47, 5, 8, 7096747b715Smrg -47, -47, 26, -47, -47, -9, -47, 9, -47, -47, 7106747b715Smrg -47, -47, -47 71105b261ecSmrg}; 71205b261ecSmrg 71305b261ecSmrg/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 71405b261ecSmrg positive, shift that token. If negative, reduce the rule which 7159ace9065Smrg number is the opposite. If YYTABLE_NINF, syntax error. */ 71605b261ecSmrg#define YYTABLE_NINF -1 71705b261ecSmrgstatic const yytype_uint8 yytable[] = 71805b261ecSmrg{ 7196747b715Smrg 57, 92, 69, 76, 77, 78, 79, 2, 60, 61, 7206747b715Smrg 3, 4, 70, 68, 5, 6, 7, 8, 80, 81, 7216747b715Smrg 82, 93, 94, 33, 95, 9, 10, 11, 47, 48, 7226747b715Smrg 30, 31, 32, 12, 34, 13, 14, 15, 76, 77, 7236747b715Smrg 78, 79, 80, 81, 82, 105, 35, 36, 37, 40, 7246747b715Smrg 38, 39, 110, 41, 42, 111, 43, 44, 50, 51, 7256747b715Smrg 52, 53, 115, 116, 55, 58, 62, 118, 119, 65, 7266747b715Smrg 73, 120, 75, 87, 88, 91, 97, 98, 101, 102, 7276747b715Smrg 108, 109, 104, 106, 113, 114, 117, 96, 74, 100, 7286747b715Smrg 107, 99, 86, 112, 0, 0, 0, 0, 103 72905b261ecSmrg}; 73005b261ecSmrg 7319ace9065Smrg#define yypact_value_is_default(yystate) \ 7329ace9065Smrg ((yystate) == (-47)) 7339ace9065Smrg 7349ace9065Smrg#define yytable_value_is_error(yytable_value) \ 7359ace9065Smrg YYID (0) 7369ace9065Smrg 7376747b715Smrgstatic const yytype_int8 yycheck[] = 73805b261ecSmrg{ 7396747b715Smrg 46, 4, 21, 11, 12, 13, 14, 0, 54, 55, 7406747b715Smrg 3, 4, 31, 59, 7, 8, 9, 10, 15, 16, 7416747b715Smrg 17, 24, 25, 5, 27, 18, 19, 20, 22, 23, 7426747b715Smrg 31, 31, 31, 26, 5, 28, 29, 30, 11, 12, 7436747b715Smrg 13, 14, 15, 16, 17, 91, 31, 5, 31, 3, 7446747b715Smrg 31, 31, 98, 3, 5, 101, 3, 3, 3, 3, 7456747b715Smrg 3, 3, 108, 109, 3, 3, 31, 113, 114, 31, 7466747b715Smrg 31, 117, 6, 6, 31, 3, 6, 3, 3, 31, 7476747b715Smrg 3, 3, 6, 31, 3, 3, 3, 71, 63, 84, 7486747b715Smrg 31, 83, 66, 102, -1, -1, -1, -1, 89 74905b261ecSmrg}; 75005b261ecSmrg 75105b261ecSmrg/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 75205b261ecSmrg symbol of state STATE-NUM. */ 75305b261ecSmrgstatic const yytype_uint8 yystos[] = 75405b261ecSmrg{ 7556747b715Smrg 0, 33, 0, 3, 4, 7, 8, 9, 10, 18, 7566747b715Smrg 19, 20, 26, 28, 29, 30, 34, 36, 37, 38, 7576747b715Smrg 39, 40, 41, 44, 48, 55, 60, 62, 63, 64, 7586747b715Smrg 31, 31, 31, 5, 5, 31, 5, 31, 31, 31, 7596747b715Smrg 3, 3, 5, 3, 3, 49, 56, 22, 23, 57, 7606747b715Smrg 3, 3, 3, 3, 45, 3, 35, 35, 3, 61, 7616747b715Smrg 35, 35, 31, 46, 47, 31, 53, 54, 35, 21, 7626747b715Smrg 31, 42, 43, 31, 47, 6, 11, 12, 13, 14, 7636747b715Smrg 15, 16, 17, 50, 51, 52, 54, 6, 31, 58, 7646747b715Smrg 59, 3, 4, 24, 25, 27, 43, 6, 3, 51, 7656747b715Smrg 50, 3, 31, 59, 6, 35, 31, 31, 3, 3, 7666747b715Smrg 35, 35, 57, 3, 3, 35, 35, 3, 35, 35, 7676747b715Smrg 35 76805b261ecSmrg}; 76905b261ecSmrg 77005b261ecSmrg#define yyerrok (yyerrstatus = 0) 77105b261ecSmrg#define yyclearin (yychar = YYEMPTY) 77205b261ecSmrg#define YYEMPTY (-2) 77305b261ecSmrg#define YYEOF 0 77405b261ecSmrg 77505b261ecSmrg#define YYACCEPT goto yyacceptlab 77605b261ecSmrg#define YYABORT goto yyabortlab 77705b261ecSmrg#define YYERROR goto yyerrorlab 77805b261ecSmrg 77905b261ecSmrg 78005b261ecSmrg/* Like YYERROR except do call yyerror. This remains here temporarily 78105b261ecSmrg to ease the transition to the new meaning of YYERROR, for GCC. 7826747b715Smrg Once GCC version 2 has supplanted version 1, this can go. However, 7836747b715Smrg YYFAIL appears to be in use. Nevertheless, it is formally deprecated 7846747b715Smrg in Bison 2.4.2's NEWS entry, where a plan to phase it out is 7856747b715Smrg discussed. */ 78605b261ecSmrg 78705b261ecSmrg#define YYFAIL goto yyerrlab 7886747b715Smrg#if defined YYFAIL 7896747b715Smrg /* This is here to suppress warnings from the GCC cpp's 7906747b715Smrg -Wunused-macros. Normally we don't worry about that warning, but 7916747b715Smrg some users do, and we want to make it easy for users to remove 7926747b715Smrg YYFAIL uses, which will produce warnings from Bison 2.5. */ 7936747b715Smrg#endif 79405b261ecSmrg 79505b261ecSmrg#define YYRECOVERING() (!!yyerrstatus) 79605b261ecSmrg 79705b261ecSmrg#define YYBACKUP(Token, Value) \ 79805b261ecSmrgdo \ 79905b261ecSmrg if (yychar == YYEMPTY && yylen == 1) \ 80005b261ecSmrg { \ 80105b261ecSmrg yychar = (Token); \ 80205b261ecSmrg yylval = (Value); \ 80305b261ecSmrg YYPOPSTACK (1); \ 80405b261ecSmrg goto yybackup; \ 80505b261ecSmrg } \ 80605b261ecSmrg else \ 80705b261ecSmrg { \ 80805b261ecSmrg yyerror (YY_("syntax error: cannot back up")); \ 80905b261ecSmrg YYERROR; \ 81005b261ecSmrg } \ 81105b261ecSmrgwhile (YYID (0)) 81205b261ecSmrg 81305b261ecSmrg 81405b261ecSmrg#define YYTERROR 1 81505b261ecSmrg#define YYERRCODE 256 81605b261ecSmrg 81705b261ecSmrg 81805b261ecSmrg/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 81905b261ecSmrg If N is 0, then set CURRENT to the empty location which ends 82005b261ecSmrg the previous symbol: RHS[0] (always defined). */ 82105b261ecSmrg 82205b261ecSmrg#define YYRHSLOC(Rhs, K) ((Rhs)[K]) 82305b261ecSmrg#ifndef YYLLOC_DEFAULT 82405b261ecSmrg# define YYLLOC_DEFAULT(Current, Rhs, N) \ 82505b261ecSmrg do \ 82605b261ecSmrg if (YYID (N)) \ 82705b261ecSmrg { \ 82805b261ecSmrg (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 82905b261ecSmrg (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 83005b261ecSmrg (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 83105b261ecSmrg (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 83205b261ecSmrg } \ 83305b261ecSmrg else \ 83405b261ecSmrg { \ 83505b261ecSmrg (Current).first_line = (Current).last_line = \ 83605b261ecSmrg YYRHSLOC (Rhs, 0).last_line; \ 83705b261ecSmrg (Current).first_column = (Current).last_column = \ 83805b261ecSmrg YYRHSLOC (Rhs, 0).last_column; \ 83905b261ecSmrg } \ 84005b261ecSmrg while (YYID (0)) 84105b261ecSmrg#endif 84205b261ecSmrg 84305b261ecSmrg 8449ace9065Smrg/* This macro is provided for backward compatibility. */ 84505b261ecSmrg 84605b261ecSmrg#ifndef YY_LOCATION_PRINT 8479ace9065Smrg# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 84805b261ecSmrg#endif 84905b261ecSmrg 85005b261ecSmrg 85105b261ecSmrg/* YYLEX -- calling `yylex' with the right arguments. */ 85205b261ecSmrg 85305b261ecSmrg#ifdef YYLEX_PARAM 85405b261ecSmrg# define YYLEX yylex (YYLEX_PARAM) 85505b261ecSmrg#else 85605b261ecSmrg# define YYLEX yylex () 85705b261ecSmrg#endif 85805b261ecSmrg 85905b261ecSmrg/* Enable debugging if requested. */ 86005b261ecSmrg#if YYDEBUG 86105b261ecSmrg 86205b261ecSmrg# ifndef YYFPRINTF 86305b261ecSmrg# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 86405b261ecSmrg# define YYFPRINTF fprintf 86505b261ecSmrg# endif 86605b261ecSmrg 86705b261ecSmrg# define YYDPRINTF(Args) \ 86805b261ecSmrgdo { \ 86905b261ecSmrg if (yydebug) \ 87005b261ecSmrg YYFPRINTF Args; \ 87105b261ecSmrg} while (YYID (0)) 87205b261ecSmrg 87305b261ecSmrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 87405b261ecSmrgdo { \ 87505b261ecSmrg if (yydebug) \ 87605b261ecSmrg { \ 87705b261ecSmrg YYFPRINTF (stderr, "%s ", Title); \ 87805b261ecSmrg yy_symbol_print (stderr, \ 87905b261ecSmrg Type, Value); \ 88005b261ecSmrg YYFPRINTF (stderr, "\n"); \ 88105b261ecSmrg } \ 88205b261ecSmrg} while (YYID (0)) 88305b261ecSmrg 88405b261ecSmrg 88505b261ecSmrg/*--------------------------------. 88605b261ecSmrg| Print this symbol on YYOUTPUT. | 88705b261ecSmrg`--------------------------------*/ 88805b261ecSmrg 88905b261ecSmrg/*ARGSUSED*/ 89005b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 89105b261ecSmrg || defined __cplusplus || defined _MSC_VER) 89205b261ecSmrgstatic void 89305b261ecSmrgyy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 89405b261ecSmrg#else 89505b261ecSmrgstatic void 89605b261ecSmrgyy_symbol_value_print (yyoutput, yytype, yyvaluep) 89705b261ecSmrg FILE *yyoutput; 89805b261ecSmrg int yytype; 89905b261ecSmrg YYSTYPE const * const yyvaluep; 90005b261ecSmrg#endif 90105b261ecSmrg{ 90205b261ecSmrg if (!yyvaluep) 90305b261ecSmrg return; 90405b261ecSmrg# ifdef YYPRINT 90505b261ecSmrg if (yytype < YYNTOKENS) 90605b261ecSmrg YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 90705b261ecSmrg# else 90805b261ecSmrg YYUSE (yyoutput); 90905b261ecSmrg# endif 91005b261ecSmrg switch (yytype) 91105b261ecSmrg { 91205b261ecSmrg default: 91305b261ecSmrg break; 91405b261ecSmrg } 91505b261ecSmrg} 91605b261ecSmrg 91705b261ecSmrg 91805b261ecSmrg/*--------------------------------. 91905b261ecSmrg| Print this symbol on YYOUTPUT. | 92005b261ecSmrg`--------------------------------*/ 92105b261ecSmrg 92205b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 92305b261ecSmrg || defined __cplusplus || defined _MSC_VER) 92405b261ecSmrgstatic void 92505b261ecSmrgyy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 92605b261ecSmrg#else 92705b261ecSmrgstatic void 92805b261ecSmrgyy_symbol_print (yyoutput, yytype, yyvaluep) 92905b261ecSmrg FILE *yyoutput; 93005b261ecSmrg int yytype; 93105b261ecSmrg YYSTYPE const * const yyvaluep; 93205b261ecSmrg#endif 93305b261ecSmrg{ 93405b261ecSmrg if (yytype < YYNTOKENS) 93505b261ecSmrg YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 93605b261ecSmrg else 93705b261ecSmrg YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 93805b261ecSmrg 93905b261ecSmrg yy_symbol_value_print (yyoutput, yytype, yyvaluep); 94005b261ecSmrg YYFPRINTF (yyoutput, ")"); 94105b261ecSmrg} 94205b261ecSmrg 94305b261ecSmrg/*------------------------------------------------------------------. 94405b261ecSmrg| yy_stack_print -- Print the state stack from its BOTTOM up to its | 94505b261ecSmrg| TOP (included). | 94605b261ecSmrg`------------------------------------------------------------------*/ 94705b261ecSmrg 94805b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 94905b261ecSmrg || defined __cplusplus || defined _MSC_VER) 95005b261ecSmrgstatic void 9514642e01fSmrgyy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 95205b261ecSmrg#else 95305b261ecSmrgstatic void 9544642e01fSmrgyy_stack_print (yybottom, yytop) 9554642e01fSmrg yytype_int16 *yybottom; 9564642e01fSmrg yytype_int16 *yytop; 95705b261ecSmrg#endif 95805b261ecSmrg{ 95905b261ecSmrg YYFPRINTF (stderr, "Stack now"); 9604642e01fSmrg for (; yybottom <= yytop; yybottom++) 9614642e01fSmrg { 9624642e01fSmrg int yybot = *yybottom; 9634642e01fSmrg YYFPRINTF (stderr, " %d", yybot); 9644642e01fSmrg } 96505b261ecSmrg YYFPRINTF (stderr, "\n"); 96605b261ecSmrg} 96705b261ecSmrg 96805b261ecSmrg# define YY_STACK_PRINT(Bottom, Top) \ 96905b261ecSmrgdo { \ 97005b261ecSmrg if (yydebug) \ 97105b261ecSmrg yy_stack_print ((Bottom), (Top)); \ 97205b261ecSmrg} while (YYID (0)) 97305b261ecSmrg 97405b261ecSmrg 97505b261ecSmrg/*------------------------------------------------. 97605b261ecSmrg| Report that the YYRULE is going to be reduced. | 97705b261ecSmrg`------------------------------------------------*/ 97805b261ecSmrg 97905b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 98005b261ecSmrg || defined __cplusplus || defined _MSC_VER) 98105b261ecSmrgstatic void 98205b261ecSmrgyy_reduce_print (YYSTYPE *yyvsp, int yyrule) 98305b261ecSmrg#else 98405b261ecSmrgstatic void 98505b261ecSmrgyy_reduce_print (yyvsp, yyrule) 98605b261ecSmrg YYSTYPE *yyvsp; 98705b261ecSmrg int yyrule; 98805b261ecSmrg#endif 98905b261ecSmrg{ 99005b261ecSmrg int yynrhs = yyr2[yyrule]; 99105b261ecSmrg int yyi; 99205b261ecSmrg unsigned long int yylno = yyrline[yyrule]; 99305b261ecSmrg YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 99405b261ecSmrg yyrule - 1, yylno); 99505b261ecSmrg /* The symbols being reduced. */ 99605b261ecSmrg for (yyi = 0; yyi < yynrhs; yyi++) 99705b261ecSmrg { 9984642e01fSmrg YYFPRINTF (stderr, " $%d = ", yyi + 1); 99905b261ecSmrg yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 100005b261ecSmrg &(yyvsp[(yyi + 1) - (yynrhs)]) 100105b261ecSmrg ); 10024642e01fSmrg YYFPRINTF (stderr, "\n"); 100305b261ecSmrg } 100405b261ecSmrg} 100505b261ecSmrg 100605b261ecSmrg# define YY_REDUCE_PRINT(Rule) \ 100705b261ecSmrgdo { \ 100805b261ecSmrg if (yydebug) \ 100905b261ecSmrg yy_reduce_print (yyvsp, Rule); \ 101005b261ecSmrg} while (YYID (0)) 101105b261ecSmrg 101205b261ecSmrg/* Nonzero means print parse trace. It is left uninitialized so that 101305b261ecSmrg multiple parsers can coexist. */ 101405b261ecSmrgint yydebug; 101505b261ecSmrg#else /* !YYDEBUG */ 101605b261ecSmrg# define YYDPRINTF(Args) 101705b261ecSmrg# define YY_SYMBOL_PRINT(Title, Type, Value, Location) 101805b261ecSmrg# define YY_STACK_PRINT(Bottom, Top) 101905b261ecSmrg# define YY_REDUCE_PRINT(Rule) 102005b261ecSmrg#endif /* !YYDEBUG */ 102105b261ecSmrg 102205b261ecSmrg 102305b261ecSmrg/* YYINITDEPTH -- initial size of the parser's stacks. */ 102405b261ecSmrg#ifndef YYINITDEPTH 102505b261ecSmrg# define YYINITDEPTH 200 102605b261ecSmrg#endif 102705b261ecSmrg 102805b261ecSmrg/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 102905b261ecSmrg if the built-in stack extension method is used). 103005b261ecSmrg 103105b261ecSmrg Do not make this value too large; the results are undefined if 103205b261ecSmrg YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 103305b261ecSmrg evaluated with infinite-precision integer arithmetic. */ 103405b261ecSmrg 103505b261ecSmrg#ifndef YYMAXDEPTH 103605b261ecSmrg# define YYMAXDEPTH 10000 103705b261ecSmrg#endif 103805b261ecSmrg 103905b261ecSmrg 104005b261ecSmrg#if YYERROR_VERBOSE 104105b261ecSmrg 104205b261ecSmrg# ifndef yystrlen 104305b261ecSmrg# if defined __GLIBC__ && defined _STRING_H 104405b261ecSmrg# define yystrlen strlen 104505b261ecSmrg# else 104605b261ecSmrg/* Return the length of YYSTR. */ 104705b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 104805b261ecSmrg || defined __cplusplus || defined _MSC_VER) 104905b261ecSmrgstatic YYSIZE_T 105005b261ecSmrgyystrlen (const char *yystr) 105105b261ecSmrg#else 105205b261ecSmrgstatic YYSIZE_T 105305b261ecSmrgyystrlen (yystr) 105405b261ecSmrg const char *yystr; 105505b261ecSmrg#endif 105605b261ecSmrg{ 105705b261ecSmrg YYSIZE_T yylen; 105805b261ecSmrg for (yylen = 0; yystr[yylen]; yylen++) 105905b261ecSmrg continue; 106005b261ecSmrg return yylen; 106105b261ecSmrg} 106205b261ecSmrg# endif 106305b261ecSmrg# endif 106405b261ecSmrg 106505b261ecSmrg# ifndef yystpcpy 106605b261ecSmrg# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 106705b261ecSmrg# define yystpcpy stpcpy 106805b261ecSmrg# else 106905b261ecSmrg/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 107005b261ecSmrg YYDEST. */ 107105b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 107205b261ecSmrg || defined __cplusplus || defined _MSC_VER) 107305b261ecSmrgstatic char * 107405b261ecSmrgyystpcpy (char *yydest, const char *yysrc) 107505b261ecSmrg#else 107605b261ecSmrgstatic char * 107705b261ecSmrgyystpcpy (yydest, yysrc) 107805b261ecSmrg char *yydest; 107905b261ecSmrg const char *yysrc; 108005b261ecSmrg#endif 108105b261ecSmrg{ 108205b261ecSmrg char *yyd = yydest; 108305b261ecSmrg const char *yys = yysrc; 108405b261ecSmrg 108505b261ecSmrg while ((*yyd++ = *yys++) != '\0') 108605b261ecSmrg continue; 108705b261ecSmrg 108805b261ecSmrg return yyd - 1; 108905b261ecSmrg} 109005b261ecSmrg# endif 109105b261ecSmrg# endif 109205b261ecSmrg 109305b261ecSmrg# ifndef yytnamerr 109405b261ecSmrg/* Copy to YYRES the contents of YYSTR after stripping away unnecessary 109505b261ecSmrg quotes and backslashes, so that it's suitable for yyerror. The 109605b261ecSmrg heuristic is that double-quoting is unnecessary unless the string 109705b261ecSmrg contains an apostrophe, a comma, or backslash (other than 109805b261ecSmrg backslash-backslash). YYSTR is taken from yytname. If YYRES is 109905b261ecSmrg null, do not copy; instead, return the length of what the result 110005b261ecSmrg would have been. */ 110105b261ecSmrgstatic YYSIZE_T 110205b261ecSmrgyytnamerr (char *yyres, const char *yystr) 110305b261ecSmrg{ 110405b261ecSmrg if (*yystr == '"') 110505b261ecSmrg { 110605b261ecSmrg YYSIZE_T yyn = 0; 110705b261ecSmrg char const *yyp = yystr; 110805b261ecSmrg 110905b261ecSmrg for (;;) 111005b261ecSmrg switch (*++yyp) 111105b261ecSmrg { 111205b261ecSmrg case '\'': 111305b261ecSmrg case ',': 111405b261ecSmrg goto do_not_strip_quotes; 111505b261ecSmrg 111605b261ecSmrg case '\\': 111705b261ecSmrg if (*++yyp != '\\') 111805b261ecSmrg goto do_not_strip_quotes; 111905b261ecSmrg /* Fall through. */ 112005b261ecSmrg default: 112105b261ecSmrg if (yyres) 112205b261ecSmrg yyres[yyn] = *yyp; 112305b261ecSmrg yyn++; 112405b261ecSmrg break; 112505b261ecSmrg 112605b261ecSmrg case '"': 112705b261ecSmrg if (yyres) 112805b261ecSmrg yyres[yyn] = '\0'; 112905b261ecSmrg return yyn; 113005b261ecSmrg } 113105b261ecSmrg do_not_strip_quotes: ; 113205b261ecSmrg } 113305b261ecSmrg 113405b261ecSmrg if (! yyres) 113505b261ecSmrg return yystrlen (yystr); 113605b261ecSmrg 113705b261ecSmrg return yystpcpy (yyres, yystr) - yyres; 113805b261ecSmrg} 113905b261ecSmrg# endif 114005b261ecSmrg 11419ace9065Smrg/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 11429ace9065Smrg about the unexpected token YYTOKEN for the state stack whose top is 11439ace9065Smrg YYSSP. 114405b261ecSmrg 11459ace9065Smrg Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is 11469ace9065Smrg not large enough to hold the message. In that case, also set 11479ace9065Smrg *YYMSG_ALLOC to the required number of bytes. Return 2 if the 11489ace9065Smrg required number of bytes is too large to store. */ 11499ace9065Smrgstatic int 11509ace9065Smrgyysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 11519ace9065Smrg yytype_int16 *yyssp, int yytoken) 11529ace9065Smrg{ 11539ace9065Smrg YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); 11549ace9065Smrg YYSIZE_T yysize = yysize0; 11559ace9065Smrg YYSIZE_T yysize1; 11569ace9065Smrg enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 11579ace9065Smrg /* Internationalized format string. */ 11589ace9065Smrg const char *yyformat = 0; 11599ace9065Smrg /* Arguments of yyformat. */ 11609ace9065Smrg char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 11619ace9065Smrg /* Number of reported tokens (one for the "unexpected", one per 11629ace9065Smrg "expected"). */ 11639ace9065Smrg int yycount = 0; 11649ace9065Smrg 11659ace9065Smrg /* There are many possibilities here to consider: 11669ace9065Smrg - Assume YYFAIL is not used. It's too flawed to consider. See 11679ace9065Smrg <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> 11689ace9065Smrg for details. YYERROR is fine as it does not invoke this 11699ace9065Smrg function. 11709ace9065Smrg - If this state is a consistent state with a default action, then 11719ace9065Smrg the only way this function was invoked is if the default action 11729ace9065Smrg is an error action. In that case, don't check for expected 11739ace9065Smrg tokens because there are none. 11749ace9065Smrg - The only way there can be no lookahead present (in yychar) is if 11759ace9065Smrg this state is a consistent state with a default action. Thus, 11769ace9065Smrg detecting the absence of a lookahead is sufficient to determine 11779ace9065Smrg that there is no unexpected or expected token to report. In that 11789ace9065Smrg case, just report a simple "syntax error". 11799ace9065Smrg - Don't assume there isn't a lookahead just because this state is a 11809ace9065Smrg consistent state with a default action. There might have been a 11819ace9065Smrg previous inconsistent state, consistent state with a non-default 11829ace9065Smrg action, or user semantic action that manipulated yychar. 11839ace9065Smrg - Of course, the expected token list depends on states to have 11849ace9065Smrg correct lookahead information, and it depends on the parser not 11859ace9065Smrg to perform extra reductions after fetching a lookahead from the 11869ace9065Smrg scanner and before detecting a syntax error. Thus, state merging 11879ace9065Smrg (from LALR or IELR) and default reductions corrupt the expected 11889ace9065Smrg token list. However, the list is correct for canonical LR with 11899ace9065Smrg one exception: it will still contain any token that will not be 11909ace9065Smrg accepted due to an error action in a later state. 11919ace9065Smrg */ 11929ace9065Smrg if (yytoken != YYEMPTY) 119305b261ecSmrg { 11949ace9065Smrg int yyn = yypact[*yyssp]; 11959ace9065Smrg yyarg[yycount++] = yytname[yytoken]; 11969ace9065Smrg if (!yypact_value_is_default (yyn)) 11979ace9065Smrg { 11989ace9065Smrg /* Start YYX at -YYN if negative to avoid negative indexes in 11999ace9065Smrg YYCHECK. In other words, skip the first -YYN actions for 12009ace9065Smrg this state because they are default actions. */ 12019ace9065Smrg int yyxbegin = yyn < 0 ? -yyn : 0; 12029ace9065Smrg /* Stay within bounds of both yycheck and yytname. */ 12039ace9065Smrg int yychecklim = YYLAST - yyn + 1; 12049ace9065Smrg int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 12059ace9065Smrg int yyx; 12069ace9065Smrg 12079ace9065Smrg for (yyx = yyxbegin; yyx < yyxend; ++yyx) 12089ace9065Smrg if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 12099ace9065Smrg && !yytable_value_is_error (yytable[yyx + yyn])) 12109ace9065Smrg { 12119ace9065Smrg if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 12129ace9065Smrg { 12139ace9065Smrg yycount = 1; 12149ace9065Smrg yysize = yysize0; 12159ace9065Smrg break; 12169ace9065Smrg } 12179ace9065Smrg yyarg[yycount++] = yytname[yyx]; 12189ace9065Smrg yysize1 = yysize + yytnamerr (0, yytname[yyx]); 12199ace9065Smrg if (! (yysize <= yysize1 12209ace9065Smrg && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 12219ace9065Smrg return 2; 12229ace9065Smrg yysize = yysize1; 12239ace9065Smrg } 12249ace9065Smrg } 12259ace9065Smrg } 122605b261ecSmrg 12279ace9065Smrg switch (yycount) 12289ace9065Smrg { 12299ace9065Smrg# define YYCASE_(N, S) \ 12309ace9065Smrg case N: \ 12319ace9065Smrg yyformat = S; \ 12329ace9065Smrg break 12339ace9065Smrg YYCASE_(0, YY_("syntax error")); 12349ace9065Smrg YYCASE_(1, YY_("syntax error, unexpected %s")); 12359ace9065Smrg YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 12369ace9065Smrg YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 12379ace9065Smrg YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 12389ace9065Smrg YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 12399ace9065Smrg# undef YYCASE_ 12409ace9065Smrg } 124105b261ecSmrg 12429ace9065Smrg yysize1 = yysize + yystrlen (yyformat); 12439ace9065Smrg if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 12449ace9065Smrg return 2; 12459ace9065Smrg yysize = yysize1; 124605b261ecSmrg 12479ace9065Smrg if (*yymsg_alloc < yysize) 12489ace9065Smrg { 12499ace9065Smrg *yymsg_alloc = 2 * yysize; 12509ace9065Smrg if (! (yysize <= *yymsg_alloc 12519ace9065Smrg && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 12529ace9065Smrg *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 12539ace9065Smrg return 1; 125405b261ecSmrg } 12559ace9065Smrg 12569ace9065Smrg /* Avoid sprintf, as that infringes on the user's name space. 12579ace9065Smrg Don't have undefined behavior even if the translation 12589ace9065Smrg produced a string with the wrong number of "%s"s. */ 12599ace9065Smrg { 12609ace9065Smrg char *yyp = *yymsg; 12619ace9065Smrg int yyi = 0; 12629ace9065Smrg while ((*yyp = *yyformat) != '\0') 12639ace9065Smrg if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 12649ace9065Smrg { 12659ace9065Smrg yyp += yytnamerr (yyp, yyarg[yyi++]); 12669ace9065Smrg yyformat += 2; 12679ace9065Smrg } 12689ace9065Smrg else 12699ace9065Smrg { 12709ace9065Smrg yyp++; 12719ace9065Smrg yyformat++; 12729ace9065Smrg } 12739ace9065Smrg } 12749ace9065Smrg return 0; 127505b261ecSmrg} 127605b261ecSmrg#endif /* YYERROR_VERBOSE */ 127705b261ecSmrg 127805b261ecSmrg/*-----------------------------------------------. 127905b261ecSmrg| Release the memory associated to this symbol. | 128005b261ecSmrg`-----------------------------------------------*/ 128105b261ecSmrg 128205b261ecSmrg/*ARGSUSED*/ 128305b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 128405b261ecSmrg || defined __cplusplus || defined _MSC_VER) 128505b261ecSmrgstatic void 128605b261ecSmrgyydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 128705b261ecSmrg#else 128805b261ecSmrgstatic void 128905b261ecSmrgyydestruct (yymsg, yytype, yyvaluep) 129005b261ecSmrg const char *yymsg; 129105b261ecSmrg int yytype; 129205b261ecSmrg YYSTYPE *yyvaluep; 129305b261ecSmrg#endif 129405b261ecSmrg{ 129505b261ecSmrg YYUSE (yyvaluep); 129605b261ecSmrg 129705b261ecSmrg if (!yymsg) 129805b261ecSmrg yymsg = "Deleting"; 129905b261ecSmrg YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 130005b261ecSmrg 130105b261ecSmrg switch (yytype) 130205b261ecSmrg { 130305b261ecSmrg 130405b261ecSmrg default: 130505b261ecSmrg break; 130605b261ecSmrg } 130705b261ecSmrg} 130805b261ecSmrg 13099ace9065Smrg 131005b261ecSmrg/* Prevent warnings from -Wmissing-prototypes. */ 131105b261ecSmrg#ifdef YYPARSE_PARAM 131205b261ecSmrg#if defined __STDC__ || defined __cplusplus 131305b261ecSmrgint yyparse (void *YYPARSE_PARAM); 131405b261ecSmrg#else 131505b261ecSmrgint yyparse (); 131605b261ecSmrg#endif 131705b261ecSmrg#else /* ! YYPARSE_PARAM */ 131805b261ecSmrg#if defined __STDC__ || defined __cplusplus 131905b261ecSmrgint yyparse (void); 132005b261ecSmrg#else 132105b261ecSmrgint yyparse (); 132205b261ecSmrg#endif 132305b261ecSmrg#endif /* ! YYPARSE_PARAM */ 132405b261ecSmrg 132505b261ecSmrg 13264642e01fSmrg/* The lookahead symbol. */ 132705b261ecSmrgint yychar; 132805b261ecSmrg 13294642e01fSmrg/* The semantic value of the lookahead symbol. */ 133005b261ecSmrgYYSTYPE yylval; 133105b261ecSmrg 133205b261ecSmrg/* Number of syntax errors so far. */ 133305b261ecSmrgint yynerrs; 133405b261ecSmrg 133505b261ecSmrg 13369ace9065Smrg/*----------. 13379ace9065Smrg| yyparse. | 13389ace9065Smrg`----------*/ 133905b261ecSmrg 134005b261ecSmrg#ifdef YYPARSE_PARAM 134105b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 134205b261ecSmrg || defined __cplusplus || defined _MSC_VER) 134305b261ecSmrgint 134405b261ecSmrgyyparse (void *YYPARSE_PARAM) 134505b261ecSmrg#else 134605b261ecSmrgint 134705b261ecSmrgyyparse (YYPARSE_PARAM) 134805b261ecSmrg void *YYPARSE_PARAM; 134905b261ecSmrg#endif 135005b261ecSmrg#else /* ! YYPARSE_PARAM */ 135105b261ecSmrg#if (defined __STDC__ || defined __C99__FUNC__ \ 135205b261ecSmrg || defined __cplusplus || defined _MSC_VER) 135305b261ecSmrgint 135405b261ecSmrgyyparse (void) 135505b261ecSmrg#else 135605b261ecSmrgint 135705b261ecSmrgyyparse () 135805b261ecSmrg 135905b261ecSmrg#endif 136005b261ecSmrg#endif 136105b261ecSmrg{ 13624642e01fSmrg int yystate; 13634642e01fSmrg /* Number of tokens to shift before error messages enabled. */ 13644642e01fSmrg int yyerrstatus; 136505b261ecSmrg 13664642e01fSmrg /* The stacks and their tools: 13674642e01fSmrg `yyss': related to states. 13684642e01fSmrg `yyvs': related to semantic values. 136905b261ecSmrg 13704642e01fSmrg Refer to the stacks thru separate pointers, to allow yyoverflow 13714642e01fSmrg to reallocate them elsewhere. */ 137205b261ecSmrg 13734642e01fSmrg /* The state stack. */ 13744642e01fSmrg yytype_int16 yyssa[YYINITDEPTH]; 13754642e01fSmrg yytype_int16 *yyss; 13764642e01fSmrg yytype_int16 *yyssp; 137705b261ecSmrg 13784642e01fSmrg /* The semantic value stack. */ 13794642e01fSmrg YYSTYPE yyvsa[YYINITDEPTH]; 13804642e01fSmrg YYSTYPE *yyvs; 13814642e01fSmrg YYSTYPE *yyvsp; 138205b261ecSmrg 13834642e01fSmrg YYSIZE_T yystacksize; 138405b261ecSmrg 13854642e01fSmrg int yyn; 13864642e01fSmrg int yyresult; 13874642e01fSmrg /* Lookahead token as an internal (translated) token number. */ 13884642e01fSmrg int yytoken; 138905b261ecSmrg /* The variables used to return semantic value and location from the 139005b261ecSmrg action routines. */ 139105b261ecSmrg YYSTYPE yyval; 139205b261ecSmrg 13934642e01fSmrg#if YYERROR_VERBOSE 13944642e01fSmrg /* Buffer for error messages, and its allocated size. */ 13954642e01fSmrg char yymsgbuf[128]; 13964642e01fSmrg char *yymsg = yymsgbuf; 13974642e01fSmrg YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 13984642e01fSmrg#endif 13994642e01fSmrg 14004642e01fSmrg#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 140105b261ecSmrg 140205b261ecSmrg /* The number of symbols on the RHS of the reduced rule. 140305b261ecSmrg Keep to zero when no symbol should be popped. */ 140405b261ecSmrg int yylen = 0; 140505b261ecSmrg 14064642e01fSmrg yytoken = 0; 14074642e01fSmrg yyss = yyssa; 14084642e01fSmrg yyvs = yyvsa; 14094642e01fSmrg yystacksize = YYINITDEPTH; 14104642e01fSmrg 141105b261ecSmrg YYDPRINTF ((stderr, "Starting parse\n")); 141205b261ecSmrg 141305b261ecSmrg yystate = 0; 141405b261ecSmrg yyerrstatus = 0; 141505b261ecSmrg yynerrs = 0; 14164642e01fSmrg yychar = YYEMPTY; /* Cause a token to be read. */ 141705b261ecSmrg 141805b261ecSmrg /* Initialize stack pointers. 141905b261ecSmrg Waste one element of value and location stack 142005b261ecSmrg so that they stay on the same level as the state stack. 142105b261ecSmrg The wasted elements are never initialized. */ 142205b261ecSmrg yyssp = yyss; 142305b261ecSmrg yyvsp = yyvs; 142405b261ecSmrg 142505b261ecSmrg goto yysetstate; 142605b261ecSmrg 142705b261ecSmrg/*------------------------------------------------------------. 142805b261ecSmrg| yynewstate -- Push a new state, which is found in yystate. | 142905b261ecSmrg`------------------------------------------------------------*/ 143005b261ecSmrg yynewstate: 143105b261ecSmrg /* In all cases, when you get here, the value and location stacks 143205b261ecSmrg have just been pushed. So pushing a state here evens the stacks. */ 143305b261ecSmrg yyssp++; 143405b261ecSmrg 143505b261ecSmrg yysetstate: 143605b261ecSmrg *yyssp = yystate; 143705b261ecSmrg 143805b261ecSmrg if (yyss + yystacksize - 1 <= yyssp) 143905b261ecSmrg { 144005b261ecSmrg /* Get the current used size of the three stacks, in elements. */ 144105b261ecSmrg YYSIZE_T yysize = yyssp - yyss + 1; 144205b261ecSmrg 144305b261ecSmrg#ifdef yyoverflow 144405b261ecSmrg { 144505b261ecSmrg /* Give user a chance to reallocate the stack. Use copies of 144605b261ecSmrg these so that the &'s don't force the real ones into 144705b261ecSmrg memory. */ 144805b261ecSmrg YYSTYPE *yyvs1 = yyvs; 144905b261ecSmrg yytype_int16 *yyss1 = yyss; 145005b261ecSmrg 145105b261ecSmrg /* Each stack pointer address is followed by the size of the 145205b261ecSmrg data in use in that stack, in bytes. This used to be a 145305b261ecSmrg conditional around just the two extra args, but that might 145405b261ecSmrg be undefined if yyoverflow is a macro. */ 145505b261ecSmrg yyoverflow (YY_("memory exhausted"), 145605b261ecSmrg &yyss1, yysize * sizeof (*yyssp), 145705b261ecSmrg &yyvs1, yysize * sizeof (*yyvsp), 145805b261ecSmrg &yystacksize); 145905b261ecSmrg 146005b261ecSmrg yyss = yyss1; 146105b261ecSmrg yyvs = yyvs1; 146205b261ecSmrg } 146305b261ecSmrg#else /* no yyoverflow */ 146405b261ecSmrg# ifndef YYSTACK_RELOCATE 146505b261ecSmrg goto yyexhaustedlab; 146605b261ecSmrg# else 146705b261ecSmrg /* Extend the stack our own way. */ 146805b261ecSmrg if (YYMAXDEPTH <= yystacksize) 146905b261ecSmrg goto yyexhaustedlab; 147005b261ecSmrg yystacksize *= 2; 147105b261ecSmrg if (YYMAXDEPTH < yystacksize) 147205b261ecSmrg yystacksize = YYMAXDEPTH; 147305b261ecSmrg 147405b261ecSmrg { 147505b261ecSmrg yytype_int16 *yyss1 = yyss; 147605b261ecSmrg union yyalloc *yyptr = 147705b261ecSmrg (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 147805b261ecSmrg if (! yyptr) 147905b261ecSmrg goto yyexhaustedlab; 14804642e01fSmrg YYSTACK_RELOCATE (yyss_alloc, yyss); 14814642e01fSmrg YYSTACK_RELOCATE (yyvs_alloc, yyvs); 148205b261ecSmrg# undef YYSTACK_RELOCATE 148305b261ecSmrg if (yyss1 != yyssa) 148405b261ecSmrg YYSTACK_FREE (yyss1); 148505b261ecSmrg } 148605b261ecSmrg# endif 148705b261ecSmrg#endif /* no yyoverflow */ 148805b261ecSmrg 148905b261ecSmrg yyssp = yyss + yysize - 1; 149005b261ecSmrg yyvsp = yyvs + yysize - 1; 149105b261ecSmrg 149205b261ecSmrg YYDPRINTF ((stderr, "Stack size increased to %lu\n", 149305b261ecSmrg (unsigned long int) yystacksize)); 149405b261ecSmrg 149505b261ecSmrg if (yyss + yystacksize - 1 <= yyssp) 149605b261ecSmrg YYABORT; 149705b261ecSmrg } 149805b261ecSmrg 149905b261ecSmrg YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 150005b261ecSmrg 15014642e01fSmrg if (yystate == YYFINAL) 15024642e01fSmrg YYACCEPT; 15034642e01fSmrg 150405b261ecSmrg goto yybackup; 150505b261ecSmrg 150605b261ecSmrg/*-----------. 150705b261ecSmrg| yybackup. | 150805b261ecSmrg`-----------*/ 150905b261ecSmrgyybackup: 151005b261ecSmrg 151105b261ecSmrg /* Do appropriate processing given the current state. Read a 15124642e01fSmrg lookahead token if we need one and don't already have one. */ 151305b261ecSmrg 15144642e01fSmrg /* First try to decide what to do without reference to lookahead token. */ 151505b261ecSmrg yyn = yypact[yystate]; 15169ace9065Smrg if (yypact_value_is_default (yyn)) 151705b261ecSmrg goto yydefault; 151805b261ecSmrg 15194642e01fSmrg /* Not known => get a lookahead token if don't already have one. */ 152005b261ecSmrg 15214642e01fSmrg /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 152205b261ecSmrg if (yychar == YYEMPTY) 152305b261ecSmrg { 152405b261ecSmrg YYDPRINTF ((stderr, "Reading a token: ")); 152505b261ecSmrg yychar = YYLEX; 152605b261ecSmrg } 152705b261ecSmrg 152805b261ecSmrg if (yychar <= YYEOF) 152905b261ecSmrg { 153005b261ecSmrg yychar = yytoken = YYEOF; 153105b261ecSmrg YYDPRINTF ((stderr, "Now at end of input.\n")); 153205b261ecSmrg } 153305b261ecSmrg else 153405b261ecSmrg { 153505b261ecSmrg yytoken = YYTRANSLATE (yychar); 153605b261ecSmrg YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 153705b261ecSmrg } 153805b261ecSmrg 153905b261ecSmrg /* If the proper action on seeing token YYTOKEN is to reduce or to 154005b261ecSmrg detect an error, take that action. */ 154105b261ecSmrg yyn += yytoken; 154205b261ecSmrg if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 154305b261ecSmrg goto yydefault; 154405b261ecSmrg yyn = yytable[yyn]; 154505b261ecSmrg if (yyn <= 0) 154605b261ecSmrg { 15479ace9065Smrg if (yytable_value_is_error (yyn)) 15489ace9065Smrg goto yyerrlab; 154905b261ecSmrg yyn = -yyn; 155005b261ecSmrg goto yyreduce; 155105b261ecSmrg } 155205b261ecSmrg 155305b261ecSmrg /* Count tokens shifted since error; after three, turn off error 155405b261ecSmrg status. */ 155505b261ecSmrg if (yyerrstatus) 155605b261ecSmrg yyerrstatus--; 155705b261ecSmrg 15584642e01fSmrg /* Shift the lookahead token. */ 155905b261ecSmrg YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 156005b261ecSmrg 15614642e01fSmrg /* Discard the shifted token. */ 15624642e01fSmrg yychar = YYEMPTY; 156305b261ecSmrg 156405b261ecSmrg yystate = yyn; 156505b261ecSmrg *++yyvsp = yylval; 156605b261ecSmrg 156705b261ecSmrg goto yynewstate; 156805b261ecSmrg 156905b261ecSmrg 157005b261ecSmrg/*-----------------------------------------------------------. 157105b261ecSmrg| yydefault -- do the default action for the current state. | 157205b261ecSmrg`-----------------------------------------------------------*/ 157305b261ecSmrgyydefault: 157405b261ecSmrg yyn = yydefact[yystate]; 157505b261ecSmrg if (yyn == 0) 157605b261ecSmrg goto yyerrlab; 157705b261ecSmrg goto yyreduce; 157805b261ecSmrg 157905b261ecSmrg 158005b261ecSmrg/*-----------------------------. 158105b261ecSmrg| yyreduce -- Do a reduction. | 158205b261ecSmrg`-----------------------------*/ 158305b261ecSmrgyyreduce: 158405b261ecSmrg /* yyn is the number of a rule to reduce with. */ 158505b261ecSmrg yylen = yyr2[yyn]; 158605b261ecSmrg 158705b261ecSmrg /* If YYLEN is nonzero, implement the default value of the action: 158805b261ecSmrg `$$ = $1'. 158905b261ecSmrg 159005b261ecSmrg Otherwise, the following line sets YYVAL to garbage. 159105b261ecSmrg This behavior is undocumented and Bison 159205b261ecSmrg users should not rely upon it. Assigning to YYVAL 159305b261ecSmrg unconditionally makes the parser a bit smaller, and it avoids a 159405b261ecSmrg GCC warning that YYVAL may be used uninitialized. */ 159505b261ecSmrg yyval = yyvsp[1-yylen]; 159605b261ecSmrg 159705b261ecSmrg 159805b261ecSmrg YY_REDUCE_PRINT (yyn); 159905b261ecSmrg switch (yyn) 160005b261ecSmrg { 16016747b715Smrg case 20: 16024642e01fSmrg 16039ace9065Smrg/* Line 1806 of yacc.c */ 16046747b715Smrg#line 159 "winprefsyacc.y" 160505b261ecSmrg { SetTrayIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 160605b261ecSmrg break; 160705b261ecSmrg 16086747b715Smrg case 21: 16094642e01fSmrg 16109ace9065Smrg/* Line 1806 of yacc.c */ 16116747b715Smrg#line 162 "winprefsyacc.y" 161205b261ecSmrg { SetRootMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 161305b261ecSmrg break; 161405b261ecSmrg 16156747b715Smrg case 22: 16164642e01fSmrg 16179ace9065Smrg/* Line 1806 of yacc.c */ 16186747b715Smrg#line 165 "winprefsyacc.y" 161905b261ecSmrg { SetDefaultSysMenu((yyvsp[(2) - (4)].sVal), (yyvsp[(3) - (4)].iVal)); free((yyvsp[(2) - (4)].sVal)); } 162005b261ecSmrg break; 162105b261ecSmrg 16226747b715Smrg case 23: 16234642e01fSmrg 16249ace9065Smrg/* Line 1806 of yacc.c */ 16256747b715Smrg#line 168 "winprefsyacc.y" 162605b261ecSmrg { SetDefaultIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 162705b261ecSmrg break; 162805b261ecSmrg 16296747b715Smrg case 24: 16304642e01fSmrg 16319ace9065Smrg/* Line 1806 of yacc.c */ 16326747b715Smrg#line 171 "winprefsyacc.y" 163305b261ecSmrg { SetIconDirectory((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 163405b261ecSmrg break; 163505b261ecSmrg 16366747b715Smrg case 25: 16374642e01fSmrg 16389ace9065Smrg/* Line 1806 of yacc.c */ 16396747b715Smrg#line 174 "winprefsyacc.y" 164005b261ecSmrg { AddMenuLine("-", CMD_SEPARATOR, ""); } 164105b261ecSmrg break; 164205b261ecSmrg 16436747b715Smrg case 26: 16444642e01fSmrg 16459ace9065Smrg/* Line 1806 of yacc.c */ 16466747b715Smrg#line 175 "winprefsyacc.y" 164705b261ecSmrg { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_ALWAYSONTOP, ""); free((yyvsp[(1) - (4)].sVal)); } 164805b261ecSmrg break; 164905b261ecSmrg 16506747b715Smrg case 27: 16514642e01fSmrg 16529ace9065Smrg/* Line 1806 of yacc.c */ 16536747b715Smrg#line 176 "winprefsyacc.y" 165405b261ecSmrg { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_EXEC, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); } 165505b261ecSmrg break; 165605b261ecSmrg 16576747b715Smrg case 28: 16584642e01fSmrg 16599ace9065Smrg/* Line 1806 of yacc.c */ 16606747b715Smrg#line 177 "winprefsyacc.y" 166105b261ecSmrg { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_MENU, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); } 166205b261ecSmrg break; 166305b261ecSmrg 16646747b715Smrg case 29: 16654642e01fSmrg 16669ace9065Smrg/* Line 1806 of yacc.c */ 16676747b715Smrg#line 178 "winprefsyacc.y" 166805b261ecSmrg { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_RELOAD, ""); free((yyvsp[(1) - (4)].sVal)); } 166905b261ecSmrg break; 167005b261ecSmrg 16716747b715Smrg case 32: 16724642e01fSmrg 16739ace9065Smrg/* Line 1806 of yacc.c */ 16746747b715Smrg#line 185 "winprefsyacc.y" 167505b261ecSmrg { OpenMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 167605b261ecSmrg break; 167705b261ecSmrg 16786747b715Smrg case 33: 16794642e01fSmrg 16809ace9065Smrg/* Line 1806 of yacc.c */ 16816747b715Smrg#line 185 "winprefsyacc.y" 168205b261ecSmrg {CloseMenu();} 168305b261ecSmrg break; 168405b261ecSmrg 16856747b715Smrg case 34: 16864642e01fSmrg 16879ace9065Smrg/* Line 1806 of yacc.c */ 16886747b715Smrg#line 188 "winprefsyacc.y" 168905b261ecSmrg { AddIconLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].sVal)); free((yyvsp[(1) - (4)].sVal)); free((yyvsp[(2) - (4)].sVal)); } 169005b261ecSmrg break; 169105b261ecSmrg 16926747b715Smrg case 37: 16934642e01fSmrg 16949ace9065Smrg/* Line 1806 of yacc.c */ 16956747b715Smrg#line 195 "winprefsyacc.y" 169605b261ecSmrg {OpenIcons();} 169705b261ecSmrg break; 169805b261ecSmrg 16996747b715Smrg case 38: 17004642e01fSmrg 17019ace9065Smrg/* Line 1806 of yacc.c */ 17026747b715Smrg#line 195 "winprefsyacc.y" 170305b261ecSmrg {CloseIcons();} 170405b261ecSmrg break; 170505b261ecSmrg 17066747b715Smrg case 39: 17076747b715Smrg 17089ace9065Smrg/* Line 1806 of yacc.c */ 17096747b715Smrg#line 198 "winprefsyacc.y" 17106747b715Smrg { (yyval.uVal)=STYLE_TOPMOST; } 17116747b715Smrg break; 17126747b715Smrg 17136747b715Smrg case 40: 17146747b715Smrg 17159ace9065Smrg/* Line 1806 of yacc.c */ 17166747b715Smrg#line 199 "winprefsyacc.y" 17176747b715Smrg { (yyval.uVal)=STYLE_MAXIMIZE; } 17186747b715Smrg break; 17196747b715Smrg 17206747b715Smrg case 41: 17216747b715Smrg 17229ace9065Smrg/* Line 1806 of yacc.c */ 17236747b715Smrg#line 200 "winprefsyacc.y" 17246747b715Smrg { (yyval.uVal)=STYLE_MINIMIZE; } 17256747b715Smrg break; 17266747b715Smrg 17276747b715Smrg case 42: 17286747b715Smrg 17299ace9065Smrg/* Line 1806 of yacc.c */ 17306747b715Smrg#line 201 "winprefsyacc.y" 17316747b715Smrg { (yyval.uVal)=STYLE_BOTTOM; } 17326747b715Smrg break; 17336747b715Smrg 17346747b715Smrg case 43: 17356747b715Smrg 17369ace9065Smrg/* Line 1806 of yacc.c */ 17376747b715Smrg#line 204 "winprefsyacc.y" 17386747b715Smrg { (yyval.uVal)=STYLE_NOTITLE; } 17396747b715Smrg break; 17406747b715Smrg 17416747b715Smrg case 44: 17426747b715Smrg 17439ace9065Smrg/* Line 1806 of yacc.c */ 17446747b715Smrg#line 205 "winprefsyacc.y" 17456747b715Smrg { (yyval.uVal)=STYLE_OUTLINE; } 17466747b715Smrg break; 17476747b715Smrg 17486747b715Smrg case 45: 17496747b715Smrg 17509ace9065Smrg/* Line 1806 of yacc.c */ 17516747b715Smrg#line 206 "winprefsyacc.y" 17526747b715Smrg { (yyval.uVal)=STYLE_NOFRAME; } 17536747b715Smrg break; 17546747b715Smrg 17556747b715Smrg case 46: 17566747b715Smrg 17579ace9065Smrg/* Line 1806 of yacc.c */ 17586747b715Smrg#line 209 "winprefsyacc.y" 17596747b715Smrg { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } 17606747b715Smrg break; 17616747b715Smrg 17626747b715Smrg case 47: 17636747b715Smrg 17649ace9065Smrg/* Line 1806 of yacc.c */ 17656747b715Smrg#line 210 "winprefsyacc.y" 17666747b715Smrg { (yyval.uVal)=(yyvsp[(1) - (1)].uVal); } 17676747b715Smrg break; 17686747b715Smrg 17696747b715Smrg case 48: 17706747b715Smrg 17719ace9065Smrg/* Line 1806 of yacc.c */ 17726747b715Smrg#line 211 "winprefsyacc.y" 17736747b715Smrg { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } 17746747b715Smrg break; 17756747b715Smrg 17766747b715Smrg case 49: 17776747b715Smrg 17789ace9065Smrg/* Line 1806 of yacc.c */ 17796747b715Smrg#line 212 "winprefsyacc.y" 17806747b715Smrg { (yyval.uVal)=(yyvsp[(1) - (2)].uVal)|(yyvsp[(2) - (2)].uVal); } 17816747b715Smrg break; 17826747b715Smrg 17836747b715Smrg case 50: 17844642e01fSmrg 17859ace9065Smrg/* Line 1806 of yacc.c */ 17866747b715Smrg#line 215 "winprefsyacc.y" 17876747b715Smrg { AddStyleLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].uVal)); free((yyvsp[(1) - (4)].sVal)); } 17886747b715Smrg break; 17896747b715Smrg 17906747b715Smrg case 53: 17916747b715Smrg 17929ace9065Smrg/* Line 1806 of yacc.c */ 17936747b715Smrg#line 222 "winprefsyacc.y" 17946747b715Smrg {OpenStyles();} 17956747b715Smrg break; 17966747b715Smrg 17976747b715Smrg case 54: 17986747b715Smrg 17999ace9065Smrg/* Line 1806 of yacc.c */ 18006747b715Smrg#line 222 "winprefsyacc.y" 18016747b715Smrg {CloseStyles();} 18026747b715Smrg break; 18036747b715Smrg 18046747b715Smrg case 55: 18056747b715Smrg 18069ace9065Smrg/* Line 1806 of yacc.c */ 18076747b715Smrg#line 225 "winprefsyacc.y" 180805b261ecSmrg { (yyval.iVal)=AT_END; } 180905b261ecSmrg break; 181005b261ecSmrg 18116747b715Smrg case 56: 18124642e01fSmrg 18139ace9065Smrg/* Line 1806 of yacc.c */ 18146747b715Smrg#line 226 "winprefsyacc.y" 181505b261ecSmrg { (yyval.iVal)=AT_START; } 181605b261ecSmrg break; 181705b261ecSmrg 18186747b715Smrg case 57: 18194642e01fSmrg 18209ace9065Smrg/* Line 1806 of yacc.c */ 18216747b715Smrg#line 227 "winprefsyacc.y" 182205b261ecSmrg { (yyval.iVal)=AT_END; } 182305b261ecSmrg break; 182405b261ecSmrg 18256747b715Smrg case 58: 18264642e01fSmrg 18279ace9065Smrg/* Line 1806 of yacc.c */ 18286747b715Smrg#line 230 "winprefsyacc.y" 182905b261ecSmrg { AddSysMenuLine((yyvsp[(1) - (5)].sVal), (yyvsp[(2) - (5)].sVal), (yyvsp[(3) - (5)].iVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(2) - (5)].sVal)); } 183005b261ecSmrg break; 183105b261ecSmrg 18326747b715Smrg case 61: 18334642e01fSmrg 18349ace9065Smrg/* Line 1806 of yacc.c */ 18356747b715Smrg#line 237 "winprefsyacc.y" 183605b261ecSmrg {OpenSysMenu();} 183705b261ecSmrg break; 183805b261ecSmrg 18396747b715Smrg case 62: 18404642e01fSmrg 18419ace9065Smrg/* Line 1806 of yacc.c */ 18426747b715Smrg#line 237 "winprefsyacc.y" 184305b261ecSmrg {CloseSysMenu();} 184405b261ecSmrg break; 184505b261ecSmrg 18466747b715Smrg case 63: 18476747b715Smrg 18489ace9065Smrg/* Line 1806 of yacc.c */ 18496747b715Smrg#line 240 "winprefsyacc.y" 18506747b715Smrg { pref.fForceExit = TRUE; } 18516747b715Smrg break; 18526747b715Smrg 18536747b715Smrg case 64: 18544642e01fSmrg 18559ace9065Smrg/* Line 1806 of yacc.c */ 18566747b715Smrg#line 243 "winprefsyacc.y" 185705b261ecSmrg { pref.fSilentExit = TRUE; } 185805b261ecSmrg break; 185905b261ecSmrg 18606747b715Smrg case 65: 18614642e01fSmrg 18629ace9065Smrg/* Line 1806 of yacc.c */ 18636747b715Smrg#line 246 "winprefsyacc.y" 186405b261ecSmrg { ErrorF("LoadPreferences: %s\n", (yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); } 186505b261ecSmrg break; 186605b261ecSmrg 186705b261ecSmrg 18684642e01fSmrg 18699ace9065Smrg/* Line 1806 of yacc.c */ 18709ace9065Smrg#line 1871 "winprefsyacc.c" 187105b261ecSmrg default: break; 187205b261ecSmrg } 18739ace9065Smrg /* User semantic actions sometimes alter yychar, and that requires 18749ace9065Smrg that yytoken be updated with the new translation. We take the 18759ace9065Smrg approach of translating immediately before every use of yytoken. 18769ace9065Smrg One alternative is translating here after every semantic action, 18779ace9065Smrg but that translation would be missed if the semantic action invokes 18789ace9065Smrg YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 18799ace9065Smrg if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an 18809ace9065Smrg incorrect destructor might then be invoked immediately. In the 18819ace9065Smrg case of YYERROR or YYBACKUP, subsequent parser actions might lead 18829ace9065Smrg to an incorrect destructor call or verbose syntax error message 18839ace9065Smrg before the lookahead is translated. */ 188405b261ecSmrg YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 188505b261ecSmrg 188605b261ecSmrg YYPOPSTACK (yylen); 188705b261ecSmrg yylen = 0; 188805b261ecSmrg YY_STACK_PRINT (yyss, yyssp); 188905b261ecSmrg 189005b261ecSmrg *++yyvsp = yyval; 189105b261ecSmrg 189205b261ecSmrg /* Now `shift' the result of the reduction. Determine what state 189305b261ecSmrg that goes to, based on the state we popped back to and the rule 189405b261ecSmrg number reduced by. */ 189505b261ecSmrg 189605b261ecSmrg yyn = yyr1[yyn]; 189705b261ecSmrg 189805b261ecSmrg yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 189905b261ecSmrg if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 190005b261ecSmrg yystate = yytable[yystate]; 190105b261ecSmrg else 190205b261ecSmrg yystate = yydefgoto[yyn - YYNTOKENS]; 190305b261ecSmrg 190405b261ecSmrg goto yynewstate; 190505b261ecSmrg 190605b261ecSmrg 190705b261ecSmrg/*------------------------------------. 190805b261ecSmrg| yyerrlab -- here on detecting error | 190905b261ecSmrg`------------------------------------*/ 191005b261ecSmrgyyerrlab: 19119ace9065Smrg /* Make sure we have latest lookahead translation. See comments at 19129ace9065Smrg user semantic actions for why this is necessary. */ 19139ace9065Smrg yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 19149ace9065Smrg 191505b261ecSmrg /* If not already recovering from an error, report this error. */ 191605b261ecSmrg if (!yyerrstatus) 191705b261ecSmrg { 191805b261ecSmrg ++yynerrs; 191905b261ecSmrg#if ! YYERROR_VERBOSE 192005b261ecSmrg yyerror (YY_("syntax error")); 192105b261ecSmrg#else 19229ace9065Smrg# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 19239ace9065Smrg yyssp, yytoken) 192405b261ecSmrg { 19259ace9065Smrg char const *yymsgp = YY_("syntax error"); 19269ace9065Smrg int yysyntax_error_status; 19279ace9065Smrg yysyntax_error_status = YYSYNTAX_ERROR; 19289ace9065Smrg if (yysyntax_error_status == 0) 19299ace9065Smrg yymsgp = yymsg; 19309ace9065Smrg else if (yysyntax_error_status == 1) 19319ace9065Smrg { 19329ace9065Smrg if (yymsg != yymsgbuf) 19339ace9065Smrg YYSTACK_FREE (yymsg); 19349ace9065Smrg yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 19359ace9065Smrg if (!yymsg) 19369ace9065Smrg { 19379ace9065Smrg yymsg = yymsgbuf; 19389ace9065Smrg yymsg_alloc = sizeof yymsgbuf; 19399ace9065Smrg yysyntax_error_status = 2; 19409ace9065Smrg } 19419ace9065Smrg else 19429ace9065Smrg { 19439ace9065Smrg yysyntax_error_status = YYSYNTAX_ERROR; 19449ace9065Smrg yymsgp = yymsg; 19459ace9065Smrg } 19469ace9065Smrg } 19479ace9065Smrg yyerror (yymsgp); 19489ace9065Smrg if (yysyntax_error_status == 2) 19499ace9065Smrg goto yyexhaustedlab; 195005b261ecSmrg } 19519ace9065Smrg# undef YYSYNTAX_ERROR 195205b261ecSmrg#endif 195305b261ecSmrg } 195405b261ecSmrg 195505b261ecSmrg 195605b261ecSmrg 195705b261ecSmrg if (yyerrstatus == 3) 195805b261ecSmrg { 19594642e01fSmrg /* If just tried and failed to reuse lookahead token after an 196005b261ecSmrg error, discard it. */ 196105b261ecSmrg 196205b261ecSmrg if (yychar <= YYEOF) 196305b261ecSmrg { 196405b261ecSmrg /* Return failure if at end of input. */ 196505b261ecSmrg if (yychar == YYEOF) 196605b261ecSmrg YYABORT; 196705b261ecSmrg } 196805b261ecSmrg else 196905b261ecSmrg { 197005b261ecSmrg yydestruct ("Error: discarding", 197105b261ecSmrg yytoken, &yylval); 197205b261ecSmrg yychar = YYEMPTY; 197305b261ecSmrg } 197405b261ecSmrg } 197505b261ecSmrg 19764642e01fSmrg /* Else will try to reuse lookahead token after shifting the error 197705b261ecSmrg token. */ 197805b261ecSmrg goto yyerrlab1; 197905b261ecSmrg 198005b261ecSmrg 198105b261ecSmrg/*---------------------------------------------------. 198205b261ecSmrg| yyerrorlab -- error raised explicitly by YYERROR. | 198305b261ecSmrg`---------------------------------------------------*/ 198405b261ecSmrgyyerrorlab: 198505b261ecSmrg 198605b261ecSmrg /* Pacify compilers like GCC when the user code never invokes 198705b261ecSmrg YYERROR and the label yyerrorlab therefore never appears in user 198805b261ecSmrg code. */ 198905b261ecSmrg if (/*CONSTCOND*/ 0) 199005b261ecSmrg goto yyerrorlab; 199105b261ecSmrg 199205b261ecSmrg /* Do not reclaim the symbols of the rule which action triggered 199305b261ecSmrg this YYERROR. */ 199405b261ecSmrg YYPOPSTACK (yylen); 199505b261ecSmrg yylen = 0; 199605b261ecSmrg YY_STACK_PRINT (yyss, yyssp); 199705b261ecSmrg yystate = *yyssp; 199805b261ecSmrg goto yyerrlab1; 199905b261ecSmrg 200005b261ecSmrg 200105b261ecSmrg/*-------------------------------------------------------------. 200205b261ecSmrg| yyerrlab1 -- common code for both syntax error and YYERROR. | 200305b261ecSmrg`-------------------------------------------------------------*/ 200405b261ecSmrgyyerrlab1: 200505b261ecSmrg yyerrstatus = 3; /* Each real token shifted decrements this. */ 200605b261ecSmrg 200705b261ecSmrg for (;;) 200805b261ecSmrg { 200905b261ecSmrg yyn = yypact[yystate]; 20109ace9065Smrg if (!yypact_value_is_default (yyn)) 201105b261ecSmrg { 201205b261ecSmrg yyn += YYTERROR; 201305b261ecSmrg if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 201405b261ecSmrg { 201505b261ecSmrg yyn = yytable[yyn]; 201605b261ecSmrg if (0 < yyn) 201705b261ecSmrg break; 201805b261ecSmrg } 201905b261ecSmrg } 202005b261ecSmrg 202105b261ecSmrg /* Pop the current state because it cannot handle the error token. */ 202205b261ecSmrg if (yyssp == yyss) 202305b261ecSmrg YYABORT; 202405b261ecSmrg 202505b261ecSmrg 202605b261ecSmrg yydestruct ("Error: popping", 202705b261ecSmrg yystos[yystate], yyvsp); 202805b261ecSmrg YYPOPSTACK (1); 202905b261ecSmrg yystate = *yyssp; 203005b261ecSmrg YY_STACK_PRINT (yyss, yyssp); 203105b261ecSmrg } 203205b261ecSmrg 203305b261ecSmrg *++yyvsp = yylval; 203405b261ecSmrg 203505b261ecSmrg 203605b261ecSmrg /* Shift the error token. */ 203705b261ecSmrg YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 203805b261ecSmrg 203905b261ecSmrg yystate = yyn; 204005b261ecSmrg goto yynewstate; 204105b261ecSmrg 204205b261ecSmrg 204305b261ecSmrg/*-------------------------------------. 204405b261ecSmrg| yyacceptlab -- YYACCEPT comes here. | 204505b261ecSmrg`-------------------------------------*/ 204605b261ecSmrgyyacceptlab: 204705b261ecSmrg yyresult = 0; 204805b261ecSmrg goto yyreturn; 204905b261ecSmrg 205005b261ecSmrg/*-----------------------------------. 205105b261ecSmrg| yyabortlab -- YYABORT comes here. | 205205b261ecSmrg`-----------------------------------*/ 205305b261ecSmrgyyabortlab: 205405b261ecSmrg yyresult = 1; 205505b261ecSmrg goto yyreturn; 205605b261ecSmrg 20574642e01fSmrg#if !defined(yyoverflow) || YYERROR_VERBOSE 205805b261ecSmrg/*-------------------------------------------------. 205905b261ecSmrg| yyexhaustedlab -- memory exhaustion comes here. | 206005b261ecSmrg`-------------------------------------------------*/ 206105b261ecSmrgyyexhaustedlab: 206205b261ecSmrg yyerror (YY_("memory exhausted")); 206305b261ecSmrg yyresult = 2; 206405b261ecSmrg /* Fall through. */ 206505b261ecSmrg#endif 206605b261ecSmrg 206705b261ecSmrgyyreturn: 20684642e01fSmrg if (yychar != YYEMPTY) 20699ace9065Smrg { 20709ace9065Smrg /* Make sure we have latest lookahead translation. See comments at 20719ace9065Smrg user semantic actions for why this is necessary. */ 20729ace9065Smrg yytoken = YYTRANSLATE (yychar); 20739ace9065Smrg yydestruct ("Cleanup: discarding lookahead", 20749ace9065Smrg yytoken, &yylval); 20759ace9065Smrg } 207605b261ecSmrg /* Do not reclaim the symbols of the rule which action triggered 207705b261ecSmrg this YYABORT or YYACCEPT. */ 207805b261ecSmrg YYPOPSTACK (yylen); 207905b261ecSmrg YY_STACK_PRINT (yyss, yyssp); 208005b261ecSmrg while (yyssp != yyss) 208105b261ecSmrg { 208205b261ecSmrg yydestruct ("Cleanup: popping", 208305b261ecSmrg yystos[*yyssp], yyvsp); 208405b261ecSmrg YYPOPSTACK (1); 208505b261ecSmrg } 208605b261ecSmrg#ifndef yyoverflow 208705b261ecSmrg if (yyss != yyssa) 208805b261ecSmrg YYSTACK_FREE (yyss); 208905b261ecSmrg#endif 209005b261ecSmrg#if YYERROR_VERBOSE 209105b261ecSmrg if (yymsg != yymsgbuf) 209205b261ecSmrg YYSTACK_FREE (yymsg); 209305b261ecSmrg#endif 209405b261ecSmrg /* Make sure YYID is used. */ 209505b261ecSmrg return YYID (yyresult); 209605b261ecSmrg} 209705b261ecSmrg 209805b261ecSmrg 20994642e01fSmrg 21009ace9065Smrg/* Line 2067 of yacc.c */ 21016747b715Smrg#line 250 "winprefsyacc.y" 210205b261ecSmrg 210305b261ecSmrg/* 210405b261ecSmrg * Errors in parsing abort and print log messages 210505b261ecSmrg */ 210605b261ecSmrgstatic int 210705b261ecSmrgyyerror (char *s) 210805b261ecSmrg{ 210905b261ecSmrg extern int yylineno; /* Handled by flex internally */ 211005b261ecSmrg 211105b261ecSmrg ErrorF("LoadPreferences: %s line %d\n", s, yylineno); 211205b261ecSmrg return 1; 211305b261ecSmrg} 211405b261ecSmrg 211505b261ecSmrg/* Miscellaneous functions to store TOKENs into the structure */ 211605b261ecSmrgstatic void 211705b261ecSmrgSetIconDirectory (char *path) 211805b261ecSmrg{ 211905b261ecSmrg strncpy (pref.iconDirectory, path, PATH_MAX); 212005b261ecSmrg pref.iconDirectory[PATH_MAX] = 0; 212105b261ecSmrg} 212205b261ecSmrg 212305b261ecSmrgstatic void 212405b261ecSmrgSetDefaultIcon (char *fname) 212505b261ecSmrg{ 212605b261ecSmrg strncpy (pref.defaultIconName, fname, NAME_MAX); 212705b261ecSmrg pref.defaultIconName[NAME_MAX] = 0; 212805b261ecSmrg} 212905b261ecSmrg 213005b261ecSmrgstatic void 213105b261ecSmrgSetTrayIcon (char *fname) 213205b261ecSmrg{ 213305b261ecSmrg strncpy (pref.trayIconName, fname, NAME_MAX); 213405b261ecSmrg pref.trayIconName[NAME_MAX] = 0; 213505b261ecSmrg} 213605b261ecSmrg 213705b261ecSmrgstatic void 213805b261ecSmrgSetRootMenu (char *menu) 213905b261ecSmrg{ 214005b261ecSmrg strncpy (pref.rootMenuName, menu, MENU_MAX); 214105b261ecSmrg pref.rootMenuName[MENU_MAX] = 0; 214205b261ecSmrg} 214305b261ecSmrg 214405b261ecSmrgstatic void 214505b261ecSmrgSetDefaultSysMenu (char *menu, int pos) 214605b261ecSmrg{ 214705b261ecSmrg strncpy (pref.defaultSysMenuName, menu, MENU_MAX); 214805b261ecSmrg pref.defaultSysMenuName[MENU_MAX] = 0; 214905b261ecSmrg pref.defaultSysMenuPos = pos; 215005b261ecSmrg} 215105b261ecSmrg 215205b261ecSmrgstatic void 215305b261ecSmrgOpenMenu (char *menuname) 215405b261ecSmrg{ 215505b261ecSmrg if (menu.menuItem) free(menu.menuItem); 215605b261ecSmrg menu.menuItem = NULL; 215705b261ecSmrg strncpy(menu.menuName, menuname, MENU_MAX); 215805b261ecSmrg menu.menuName[MENU_MAX] = 0; 215905b261ecSmrg menu.menuItems = 0; 216005b261ecSmrg} 216105b261ecSmrg 216205b261ecSmrgstatic void 216305b261ecSmrgAddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param) 216405b261ecSmrg{ 216505b261ecSmrg if (menu.menuItem==NULL) 216605b261ecSmrg menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM)); 216705b261ecSmrg else 216805b261ecSmrg menu.menuItem = (MENUITEM*) 216905b261ecSmrg realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1)); 217005b261ecSmrg 217105b261ecSmrg strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX); 217205b261ecSmrg menu.menuItem[menu.menuItems].text[MENU_MAX] = 0; 217305b261ecSmrg 217405b261ecSmrg menu.menuItem[menu.menuItems].cmd = cmd; 217505b261ecSmrg 217605b261ecSmrg strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX); 217705b261ecSmrg menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0; 217805b261ecSmrg 217905b261ecSmrg menu.menuItem[menu.menuItems].commandID = 0; 218005b261ecSmrg 218105b261ecSmrg menu.menuItems++; 218205b261ecSmrg} 218305b261ecSmrg 218405b261ecSmrgstatic void 218505b261ecSmrgCloseMenu (void) 218605b261ecSmrg{ 218705b261ecSmrg if (menu.menuItem==NULL || menu.menuItems==0) 218805b261ecSmrg { 218905b261ecSmrg ErrorF("LoadPreferences: Empty menu detected\n"); 219005b261ecSmrg return; 219105b261ecSmrg } 219205b261ecSmrg 219305b261ecSmrg if (pref.menuItems) 219405b261ecSmrg pref.menu = (MENUPARSED*) 219505b261ecSmrg realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED)); 219605b261ecSmrg else 219705b261ecSmrg pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED)); 219805b261ecSmrg 219905b261ecSmrg memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED)); 220005b261ecSmrg pref.menuItems++; 220105b261ecSmrg 220205b261ecSmrg memset (&menu, 0, sizeof(MENUPARSED)); 220305b261ecSmrg} 220405b261ecSmrg 220505b261ecSmrgstatic void 220605b261ecSmrgOpenIcons (void) 220705b261ecSmrg{ 220805b261ecSmrg if (pref.icon != NULL) { 220905b261ecSmrg ErrorF("LoadPreferences: Redefining icon mappings\n"); 221005b261ecSmrg free(pref.icon); 221105b261ecSmrg pref.icon = NULL; 221205b261ecSmrg } 221305b261ecSmrg pref.iconItems = 0; 221405b261ecSmrg} 221505b261ecSmrg 221605b261ecSmrgstatic void 221705b261ecSmrgAddIconLine (char *matchstr, char *iconfile) 221805b261ecSmrg{ 221905b261ecSmrg if (pref.icon==NULL) 222005b261ecSmrg pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM)); 222105b261ecSmrg else 222205b261ecSmrg pref.icon = (ICONITEM*) 222305b261ecSmrg realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1)); 222405b261ecSmrg 222505b261ecSmrg strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX); 222605b261ecSmrg pref.icon[pref.iconItems].match[MENU_MAX] = 0; 222705b261ecSmrg 222805b261ecSmrg strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1); 222905b261ecSmrg pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0; 223005b261ecSmrg 223105b261ecSmrg pref.icon[pref.iconItems].hicon = 0; 223205b261ecSmrg 223305b261ecSmrg pref.iconItems++; 223405b261ecSmrg} 223505b261ecSmrg 223605b261ecSmrgstatic void 223705b261ecSmrgCloseIcons (void) 223805b261ecSmrg{ 223905b261ecSmrg} 224005b261ecSmrg 22416747b715Smrgstatic void 22426747b715SmrgOpenStyles (void) 22436747b715Smrg{ 22446747b715Smrg if (pref.style != NULL) { 22456747b715Smrg ErrorF("LoadPreferences: Redefining window style\n"); 22466747b715Smrg free(pref.style); 22476747b715Smrg pref.style = NULL; 22486747b715Smrg } 22496747b715Smrg pref.styleItems = 0; 22506747b715Smrg} 22516747b715Smrg 22526747b715Smrgstatic void 22536747b715SmrgAddStyleLine (char *matchstr, unsigned long style) 22546747b715Smrg{ 22556747b715Smrg if (pref.style==NULL) 22566747b715Smrg pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM)); 22576747b715Smrg else 22586747b715Smrg pref.style = (STYLEITEM*) 22596747b715Smrg realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1)); 22606747b715Smrg 22616747b715Smrg strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX); 22626747b715Smrg pref.style[pref.styleItems].match[MENU_MAX] = 0; 22636747b715Smrg 22646747b715Smrg pref.style[pref.styleItems].type = style; 22656747b715Smrg 22666747b715Smrg pref.styleItems++; 22676747b715Smrg} 22686747b715Smrg 22696747b715Smrgstatic void 22706747b715SmrgCloseStyles (void) 22716747b715Smrg{ 22726747b715Smrg} 22736747b715Smrg 227405b261ecSmrgstatic void 227505b261ecSmrgOpenSysMenu (void) 227605b261ecSmrg{ 227705b261ecSmrg if (pref.sysMenu != NULL) { 227805b261ecSmrg ErrorF("LoadPreferences: Redefining system menu\n"); 227905b261ecSmrg free(pref.sysMenu); 228005b261ecSmrg pref.sysMenu = NULL; 228105b261ecSmrg } 228205b261ecSmrg pref.sysMenuItems = 0; 228305b261ecSmrg} 228405b261ecSmrg 228505b261ecSmrgstatic void 228605b261ecSmrgAddSysMenuLine (char *matchstr, char *menuname, int pos) 228705b261ecSmrg{ 228805b261ecSmrg if (pref.sysMenu==NULL) 228905b261ecSmrg pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM)); 229005b261ecSmrg else 229105b261ecSmrg pref.sysMenu = (SYSMENUITEM*) 229205b261ecSmrg realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1)); 229305b261ecSmrg 229405b261ecSmrg strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX); 229505b261ecSmrg pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0; 229605b261ecSmrg 229705b261ecSmrg strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX); 229805b261ecSmrg pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0; 229905b261ecSmrg 230005b261ecSmrg pref.sysMenu[pref.sysMenuItems].menuPos = pos; 230105b261ecSmrg 230205b261ecSmrg pref.sysMenuItems++; 230305b261ecSmrg} 230405b261ecSmrg 230505b261ecSmrgstatic void 230605b261ecSmrgCloseSysMenu (void) 230705b261ecSmrg{ 230805b261ecSmrg} 230905b261ecSmrg 231005b261ecSmrg 2311