winprefsyacc.c revision 05b261ec
1/* A Bison parser, made by GNU Bison 2.3.  */
2
3/* Skeleton implementation for Bison's Yacc-like parsers in C
4
5   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
6   Free Software Foundation, Inc.
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with this program; if not, write to the Free Software
20   Foundation, Inc., 51 Franklin Street, Fifth Floor,
21   Boston, MA 02110-1301, USA.  */
22
23/* As a special exception, you may create a larger work that contains
24   part or all of the Bison parser skeleton and distribute that work
25   under terms of your choice, so long as that work isn't itself a
26   parser generator using the skeleton or a modified version thereof
27   as a parser skeleton.  Alternatively, if you modify or redistribute
28   the parser skeleton itself, you may (at your option) remove this
29   special exception, which will cause the skeleton and the resulting
30   Bison output files to be licensed under the GNU General Public
31   License without this special exception.
32
33   This special exception was added by the Free Software Foundation in
34   version 2.2 of Bison.  */
35
36/* C LALR(1) parser skeleton written by Richard Stallman, by
37   simplifying the original so-called "semantic" parser.  */
38
39/* All symbols defined below should begin with yy or YY, to avoid
40   infringing on user name space.  This should be done even for local
41   variables, as they might otherwise be expanded by user macros.
42   There are some unavoidable exceptions within include files to
43   define necessary library symbols; they are noted "INFRINGES ON
44   USER NAME SPACE" below.  */
45
46/* Identify Bison output.  */
47#define YYBISON 1
48
49/* Bison version.  */
50#define YYBISON_VERSION "2.3"
51
52/* Skeleton name.  */
53#define YYSKELETON_NAME "yacc.c"
54
55/* Pure parsers.  */
56#define YYPURE 0
57
58/* Using locations.  */
59#define YYLSP_NEEDED 0
60
61
62
63/* Tokens.  */
64#ifndef YYTOKENTYPE
65# define YYTOKENTYPE
66   /* Put the tokens into the symbol table, so that GDB and other debuggers
67      know about them.  */
68   enum yytokentype {
69     NEWLINE = 258,
70     MENU = 259,
71     LB = 260,
72     RB = 261,
73     ICONDIRECTORY = 262,
74     DEFAULTICON = 263,
75     ICONS = 264,
76     DEFAULTSYSMENU = 265,
77     SYSMENU = 266,
78     ROOTMENU = 267,
79     SEPARATOR = 268,
80     ATSTART = 269,
81     ATEND = 270,
82     EXEC = 271,
83     ALWAYSONTOP = 272,
84     DEBUG = 273,
85     RELOAD = 274,
86     TRAYICON = 275,
87     SILENTEXIT = 276,
88     STRING = 277
89   };
90#endif
91/* Tokens.  */
92#define NEWLINE 258
93#define MENU 259
94#define LB 260
95#define RB 261
96#define ICONDIRECTORY 262
97#define DEFAULTICON 263
98#define ICONS 264
99#define DEFAULTSYSMENU 265
100#define SYSMENU 266
101#define ROOTMENU 267
102#define SEPARATOR 268
103#define ATSTART 269
104#define ATEND 270
105#define EXEC 271
106#define ALWAYSONTOP 272
107#define DEBUG 273
108#define RELOAD 274
109#define TRAYICON 275
110#define SILENTEXIT 276
111#define STRING 277
112
113
114
115
116/* Copy the first part of user declarations.  */
117#line 1 "winprefsyacc.y"
118
119/*
120 * Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
121 *
122 * Permission is hereby granted, free of charge, to any person obtaining
123 * a copy of this software and associated documentation files (the
124 * "Software"), to deal in the Software without restriction, including
125 * without limitation the rights to use, copy, modify, merge, publish,
126 * distribute, sublicense, and/or sell copies of the Software, and to
127 * permit persons to whom the Software is furnished to do so, subject to
128 * the following conditions:
129 *
130 * The above copyright notice and this permission notice shall be
131 * included in all copies or substantial portions of the Software.
132 *
133 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
134 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
135 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
136 * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
137 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
138 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
139 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
140 *
141 * Except as contained in this notice, the name of the XFree86 Project
142 * shall not be used in advertising or otherwise to promote the sale, use
143 * or other dealings in this Software without prior written authorization
144 * from the XFree86 Project.
145 *
146 * Authors:     Earle F. Philhower, III
147 */
148/* $XFree86: $ */
149
150#ifdef HAVE_XWIN_CONFIG_H
151#include <xwin-config.h>
152#endif
153#include <stdio.h>
154#include <stdlib.h>
155#include <string.h>
156#include "winprefs.h"
157
158/* The following give better error messages in bison at the cost of a few KB */
159#define YYERROR_VERBOSE 1
160
161/* The global pref settings */
162WINPREFS pref;
163
164/* The working menu */
165static MENUPARSED menu;
166
167/* Functions for parsing the tokens into out structure */
168/* Defined at the end section of this file */
169
170static void SetIconDirectory (char *path);
171static void SetDefaultIcon (char *fname);
172static void SetRootMenu (char *menu);
173static void SetDefaultSysMenu (char *menu, int pos);
174static void SetTrayIcon (char *fname);
175
176static void OpenMenu(char *menuname);
177static void AddMenuLine(char *name, MENUCOMMANDTYPE cmd, char *param);
178static void CloseMenu(void);
179
180static void OpenIcons(void);
181static void AddIconLine(char *matchstr, char *iconfile);
182static void CloseIcons(void);
183
184static void OpenSysMenu(void);
185static void AddSysMenuLine(char *matchstr, char *menuname, int pos);
186static void CloseSysMenu(void);
187
188static int yyerror (char *s);
189
190extern void ErrorF (const char* /*f*/, ...);
191extern char *yytext;
192extern int yylex(void);
193
194
195
196/* Enabling traces.  */
197#ifndef YYDEBUG
198# define YYDEBUG 0
199#endif
200
201/* Enabling verbose error messages.  */
202#ifdef YYERROR_VERBOSE
203# undef YYERROR_VERBOSE
204# define YYERROR_VERBOSE 1
205#else
206# define YYERROR_VERBOSE 0
207#endif
208
209/* Enabling the token table.  */
210#ifndef YYTOKEN_TABLE
211# define YYTOKEN_TABLE 0
212#endif
213
214#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
215typedef union YYSTYPE
216#line 79 "winprefsyacc.y"
217{
218  char *sVal;
219  int iVal;
220}
221/* Line 187 of yacc.c.  */
222#line 223 "winprefsyacc.c"
223	YYSTYPE;
224# define yystype YYSTYPE /* obsolescent; will be withdrawn */
225# define YYSTYPE_IS_DECLARED 1
226# define YYSTYPE_IS_TRIVIAL 1
227#endif
228
229
230
231/* Copy the second part of user declarations.  */
232
233
234/* Line 216 of yacc.c.  */
235#line 236 "winprefsyacc.c"
236
237#ifdef short
238# undef short
239#endif
240
241#ifdef YYTYPE_UINT8
242typedef YYTYPE_UINT8 yytype_uint8;
243#else
244typedef unsigned char yytype_uint8;
245#endif
246
247#ifdef YYTYPE_INT8
248typedef YYTYPE_INT8 yytype_int8;
249#elif (defined __STDC__ || defined __C99__FUNC__ \
250     || defined __cplusplus || defined _MSC_VER)
251typedef signed char yytype_int8;
252#else
253typedef short int yytype_int8;
254#endif
255
256#ifdef YYTYPE_UINT16
257typedef YYTYPE_UINT16 yytype_uint16;
258#else
259typedef unsigned short int yytype_uint16;
260#endif
261
262#ifdef YYTYPE_INT16
263typedef YYTYPE_INT16 yytype_int16;
264#else
265typedef short int yytype_int16;
266#endif
267
268#ifndef YYSIZE_T
269# ifdef __SIZE_TYPE__
270#  define YYSIZE_T __SIZE_TYPE__
271# elif defined size_t
272#  define YYSIZE_T size_t
273# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
274     || defined __cplusplus || defined _MSC_VER)
275#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
276#  define YYSIZE_T size_t
277# else
278#  define YYSIZE_T unsigned int
279# endif
280#endif
281
282#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
283
284#ifndef YY_
285# if YYENABLE_NLS
286#  if ENABLE_NLS
287#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
288#   define YY_(msgid) dgettext ("bison-runtime", msgid)
289#  endif
290# endif
291# ifndef YY_
292#  define YY_(msgid) msgid
293# endif
294#endif
295
296/* Suppress unused-variable warnings by "using" E.  */
297#if ! defined lint || defined __GNUC__
298# define YYUSE(e) ((void) (e))
299#else
300# define YYUSE(e) /* empty */
301#endif
302
303/* Identity function, used to suppress warnings about constant conditions.  */
304#ifndef lint
305# define YYID(n) (n)
306#else
307#if (defined __STDC__ || defined __C99__FUNC__ \
308     || defined __cplusplus || defined _MSC_VER)
309static int
310YYID (int i)
311#else
312static int
313YYID (i)
314    int i;
315#endif
316{
317  return i;
318}
319#endif
320
321#if ! defined yyoverflow || YYERROR_VERBOSE
322
323/* The parser invokes alloca or malloc; define the necessary symbols.  */
324
325# ifdef YYSTACK_USE_ALLOCA
326#  if YYSTACK_USE_ALLOCA
327#   ifdef __GNUC__
328#    define YYSTACK_ALLOC __builtin_alloca
329#   elif defined __BUILTIN_VA_ARG_INCR
330#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
331#   elif defined _AIX
332#    define YYSTACK_ALLOC __alloca
333#   elif defined _MSC_VER
334#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
335#    define alloca _alloca
336#   else
337#    define YYSTACK_ALLOC alloca
338#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
339     || defined __cplusplus || defined _MSC_VER)
340#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
341#     ifndef _STDLIB_H
342#      define _STDLIB_H 1
343#     endif
344#    endif
345#   endif
346#  endif
347# endif
348
349# ifdef YYSTACK_ALLOC
350   /* Pacify GCC's `empty if-body' warning.  */
351#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
352#  ifndef YYSTACK_ALLOC_MAXIMUM
353    /* The OS might guarantee only one guard page at the bottom of the stack,
354       and a page size can be as small as 4096 bytes.  So we cannot safely
355       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
356       to allow for a few compiler-allocated temporary stack slots.  */
357#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
358#  endif
359# else
360#  define YYSTACK_ALLOC YYMALLOC
361#  define YYSTACK_FREE YYFREE
362#  ifndef YYSTACK_ALLOC_MAXIMUM
363#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
364#  endif
365#  if (defined __cplusplus && ! defined _STDLIB_H \
366       && ! ((defined YYMALLOC || defined malloc) \
367	     && (defined YYFREE || defined free)))
368#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
369#   ifndef _STDLIB_H
370#    define _STDLIB_H 1
371#   endif
372#  endif
373#  ifndef YYMALLOC
374#   define YYMALLOC malloc
375#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
376     || defined __cplusplus || defined _MSC_VER)
377void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
378#   endif
379#  endif
380#  ifndef YYFREE
381#   define YYFREE free
382#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
383     || defined __cplusplus || defined _MSC_VER)
384void free (void *); /* INFRINGES ON USER NAME SPACE */
385#   endif
386#  endif
387# endif
388#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
389
390
391#if (! defined yyoverflow \
392     && (! defined __cplusplus \
393	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
394
395/* A type that is properly aligned for any stack member.  */
396union yyalloc
397{
398  yytype_int16 yyss;
399  YYSTYPE yyvs;
400  };
401
402/* The size of the maximum gap between one aligned stack and the next.  */
403# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
404
405/* The size of an array large to enough to hold all stacks, each with
406   N elements.  */
407# define YYSTACK_BYTES(N) \
408     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
409      + YYSTACK_GAP_MAXIMUM)
410
411/* Copy COUNT objects from FROM to TO.  The source and destination do
412   not overlap.  */
413# ifndef YYCOPY
414#  if defined __GNUC__ && 1 < __GNUC__
415#   define YYCOPY(To, From, Count) \
416      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
417#  else
418#   define YYCOPY(To, From, Count)		\
419      do					\
420	{					\
421	  YYSIZE_T yyi;				\
422	  for (yyi = 0; yyi < (Count); yyi++)	\
423	    (To)[yyi] = (From)[yyi];		\
424	}					\
425      while (YYID (0))
426#  endif
427# endif
428
429/* Relocate STACK from its old location to the new one.  The
430   local variables YYSIZE and YYSTACKSIZE give the old and new number of
431   elements in the stack, and YYPTR gives the new location of the
432   stack.  Advance YYPTR to a properly aligned location for the next
433   stack.  */
434# define YYSTACK_RELOCATE(Stack)					\
435    do									\
436      {									\
437	YYSIZE_T yynewbytes;						\
438	YYCOPY (&yyptr->Stack, Stack, yysize);				\
439	Stack = &yyptr->Stack;						\
440	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
441	yyptr += yynewbytes / sizeof (*yyptr);				\
442      }									\
443    while (YYID (0))
444
445#endif
446
447/* YYFINAL -- State number of the termination state.  */
448#define YYFINAL  2
449/* YYLAST -- Last index in YYTABLE.  */
450#define YYLAST   68
451
452/* YYNTOKENS -- Number of terminals.  */
453#define YYNTOKENS  23
454/* YYNNTS -- Number of nonterminals.  */
455#define YYNNTS  25
456/* YYNRULES -- Number of rules.  */
457#define YYNRULES  46
458/* YYNRULES -- Number of states.  */
459#define YYNSTATES  94
460
461/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
462#define YYUNDEFTOK  2
463#define YYMAXUTOK   277
464
465#define YYTRANSLATE(YYX)						\
466  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
467
468/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
469static const yytype_uint8 yytranslate[] =
470{
471       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
472       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
473       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
474       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
475       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
476       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
477       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
478       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
479       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
480       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
481       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
482       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
483       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
484       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
485       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
486       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
487       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
488       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
489       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
490       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
491       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
492       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
493       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
494       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
495       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
496       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
497       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
498      15,    16,    17,    18,    19,    20,    21,    22
499};
500
501#if YYDEBUG
502/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
503   YYRHS.  */
504static const yytype_uint8 yyprhs[] =
505{
506       0,     0,     3,     4,     7,     9,    11,    12,    15,    17,
507      19,    21,    23,    25,    27,    29,    31,    33,    35,    39,
508      43,    48,    52,    56,    60,    65,    71,    77,    82,    84,
509      87,    88,    96,   101,   103,   106,   107,   114,   115,   117,
510     119,   125,   127,   130,   131,   139,   142
511};
512
513/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
514static const yytype_int8 yyrhs[] =
515{
516      24,     0,    -1,    -1,    24,    25,    -1,     3,    -1,    27,
517      -1,    -1,     3,    26,    -1,    31,    -1,    32,    -1,    35,
518      -1,    39,    -1,    44,    -1,    29,    -1,    30,    -1,    47,
519      -1,    28,    -1,    46,    -1,    20,    22,     3,    -1,    12,
520      22,     3,    -1,    10,    22,    41,     3,    -1,     8,    22,
521       3,    -1,     7,    22,     3,    -1,    13,     3,    26,    -1,
522      22,    17,     3,    26,    -1,    22,    16,    22,     3,    26,
523      -1,    22,     4,    22,     3,    26,    -1,    22,    19,     3,
524      26,    -1,    33,    -1,    33,    34,    -1,    -1,     4,    22,
525       5,    36,    26,    34,     6,    -1,    22,    22,     3,    26,
526      -1,    37,    -1,    37,    38,    -1,    -1,     9,     5,    40,
527      26,    38,     6,    -1,    -1,    14,    -1,    15,    -1,    22,
528      22,    41,     3,    26,    -1,    42,    -1,    42,    43,    -1,
529      -1,    11,     5,     3,    45,    26,    43,     6,    -1,    21,
530       3,    -1,    18,    22,     3,    -1
531};
532
533/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
534static const yytype_uint8 yyrline[] =
535{
536       0,    93,    93,    94,    97,    98,   102,   103,   106,   107,
537     108,   109,   110,   111,   112,   113,   114,   115,   118,   121,
538     124,   127,   130,   133,   134,   135,   136,   137,   140,   141,
539     144,   144,   147,   150,   151,   154,   154,   157,   158,   159,
540     162,   165,   166,   169,   169,   172,   175
541};
542#endif
543
544#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
545/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
546   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
547static const char *const yytname[] =
548{
549  "$end", "error", "$undefined", "NEWLINE", "MENU", "LB", "RB",
550  "ICONDIRECTORY", "DEFAULTICON", "ICONS", "DEFAULTSYSMENU", "SYSMENU",
551  "ROOTMENU", "SEPARATOR", "ATSTART", "ATEND", "EXEC", "ALWAYSONTOP",
552  "DEBUG", "RELOAD", "TRAYICON", "SILENTEXIT", "STRING", "$accept",
553  "input", "line", "newline_or_nada", "command", "trayicon", "rootmenu",
554  "defaultsysmenu", "defaulticon", "icondirectory", "menuline", "menulist",
555  "menu", "@1", "iconline", "iconlist", "icons", "@2", "atspot",
556  "sysmenuline", "sysmenulist", "sysmenu", "@3", "silentexit", "debug", 0
557};
558#endif
559
560# ifdef YYPRINT
561/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
562   token YYLEX-NUM.  */
563static const yytype_uint16 yytoknum[] =
564{
565       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
566     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
567     275,   276,   277
568};
569# endif
570
571/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
572static const yytype_uint8 yyr1[] =
573{
574       0,    23,    24,    24,    25,    25,    26,    26,    27,    27,
575      27,    27,    27,    27,    27,    27,    27,    27,    28,    29,
576      30,    31,    32,    33,    33,    33,    33,    33,    34,    34,
577      36,    35,    37,    38,    38,    40,    39,    41,    41,    41,
578      42,    43,    43,    45,    44,    46,    47
579};
580
581/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
582static const yytype_uint8 yyr2[] =
583{
584       0,     2,     0,     2,     1,     1,     0,     2,     1,     1,
585       1,     1,     1,     1,     1,     1,     1,     1,     3,     3,
586       4,     3,     3,     3,     4,     5,     5,     4,     1,     2,
587       0,     7,     4,     1,     2,     0,     6,     0,     1,     1,
588       5,     1,     2,     0,     7,     2,     3
589};
590
591/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
592   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
593   means the default is an error.  */
594static const yytype_uint8 yydefact[] =
595{
596       2,     0,     1,     4,     0,     0,     0,     0,     0,     0,
597       0,     0,     0,     0,     3,     5,    16,    13,    14,     8,
598       9,    10,    11,    12,    17,    15,     0,     0,     0,    35,
599      37,     0,     0,     0,     0,    45,    30,    22,    21,     6,
600      38,    39,     0,    43,    19,    46,    18,     6,     6,     0,
601      20,     6,     0,     7,     0,    33,     0,     0,     0,     0,
602      28,     0,     0,    34,    36,     0,    41,     0,     6,     0,
603       0,     0,     0,    29,    31,     6,    37,    42,    44,    23,
604       0,     0,     6,     6,    32,     0,     6,     6,    24,    27,
605       6,    26,    25,    40
606};
607
608/* YYDEFGOTO[NTERM-NUM].  */
609static const yytype_int8 yydefgoto[] =
610{
611      -1,     1,    14,    49,    15,    16,    17,    18,    19,    20,
612      60,    61,    21,    47,    55,    56,    22,    39,    42,    66,
613      67,    23,    51,    24,    25
614};
615
616/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
617   STATE-NUM.  */
618#define YYPACT_NINF -48
619static const yytype_int8 yypact[] =
620{
621     -48,     2,   -48,   -48,   -15,    -3,     4,    22,     7,    25,
622       9,    11,    12,    29,   -48,   -48,   -48,   -48,   -48,   -48,
623     -48,   -48,   -48,   -48,   -48,   -48,    32,    35,    38,   -48,
624      10,    39,    41,    42,    43,   -48,   -48,   -48,   -48,    44,
625     -48,   -48,    45,   -48,   -48,   -48,   -48,    44,    44,    27,
626     -48,    44,    -5,   -48,    28,    27,    46,    31,    48,    -1,
627      -5,    49,    51,   -48,   -48,    34,    31,    52,    44,    37,
628      40,    54,    57,   -48,   -48,    44,    10,   -48,   -48,   -48,
629      58,    60,    44,    44,   -48,    61,    44,    44,   -48,   -48,
630      44,   -48,   -48,   -48
631};
632
633/* YYPGOTO[NTERM-NUM].  */
634static const yytype_int8 yypgoto[] =
635{
636     -48,   -48,   -48,   -47,   -48,   -48,   -48,   -48,   -48,   -48,
637     -48,     5,   -48,   -48,   -48,    13,   -48,   -48,   -10,   -48,
638       1,   -48,   -48,   -48,   -48
639};
640
641/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
642   positive, shift that token.  If negative, reduce the rule which
643   number is the opposite.  If zero, do what YYDEFACT says.
644   If YYTABLE_NINF, syntax error.  */
645#define YYTABLE_NINF -1
646static const yytype_uint8 yytable[] =
647{
648      52,    53,     2,    69,    57,     3,     4,    26,    58,     5,
649       6,     7,     8,     9,    10,    70,    71,    59,    72,    27,
650      11,    79,    12,    13,    40,    41,    28,    29,    84,    30,
651      31,    32,    35,    33,    34,    88,    89,    36,    37,    91,
652      92,    38,    43,    93,    44,    45,    46,    48,    50,    54,
653      62,    68,    64,    65,    75,    74,    76,    82,    78,    80,
654      83,    86,    81,    87,    90,    73,    85,    77,    63
655};
656
657static const yytype_uint8 yycheck[] =
658{
659      47,    48,     0,     4,    51,     3,     4,    22,    13,     7,
660       8,     9,    10,    11,    12,    16,    17,    22,    19,    22,
661      18,    68,    20,    21,    14,    15,    22,     5,    75,    22,
662       5,    22,     3,    22,    22,    82,    83,     5,     3,    86,
663      87,     3,     3,    90,     3,     3,     3,     3,     3,    22,
664      22,     3,     6,    22,     3,     6,    22,     3,     6,    22,
665       3,     3,    22,     3,     3,    60,    76,    66,    55
666};
667
668/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
669   symbol of state STATE-NUM.  */
670static const yytype_uint8 yystos[] =
671{
672       0,    24,     0,     3,     4,     7,     8,     9,    10,    11,
673      12,    18,    20,    21,    25,    27,    28,    29,    30,    31,
674      32,    35,    39,    44,    46,    47,    22,    22,    22,     5,
675      22,     5,    22,    22,    22,     3,     5,     3,     3,    40,
676      14,    15,    41,     3,     3,     3,     3,    36,     3,    26,
677       3,    45,    26,    26,    22,    37,    38,    26,    13,    22,
678      33,    34,    22,    38,     6,    22,    42,    43,     3,     4,
679      16,    17,    19,    34,     6,     3,    22,    43,     6,    26,
680      22,    22,     3,     3,    26,    41,     3,     3,    26,    26,
681       3,    26,    26,    26
682};
683
684#define yyerrok		(yyerrstatus = 0)
685#define yyclearin	(yychar = YYEMPTY)
686#define YYEMPTY		(-2)
687#define YYEOF		0
688
689#define YYACCEPT	goto yyacceptlab
690#define YYABORT		goto yyabortlab
691#define YYERROR		goto yyerrorlab
692
693
694/* Like YYERROR except do call yyerror.  This remains here temporarily
695   to ease the transition to the new meaning of YYERROR, for GCC.
696   Once GCC version 2 has supplanted version 1, this can go.  */
697
698#define YYFAIL		goto yyerrlab
699
700#define YYRECOVERING()  (!!yyerrstatus)
701
702#define YYBACKUP(Token, Value)					\
703do								\
704  if (yychar == YYEMPTY && yylen == 1)				\
705    {								\
706      yychar = (Token);						\
707      yylval = (Value);						\
708      yytoken = YYTRANSLATE (yychar);				\
709      YYPOPSTACK (1);						\
710      goto yybackup;						\
711    }								\
712  else								\
713    {								\
714      yyerror (YY_("syntax error: cannot back up")); \
715      YYERROR;							\
716    }								\
717while (YYID (0))
718
719
720#define YYTERROR	1
721#define YYERRCODE	256
722
723
724/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
725   If N is 0, then set CURRENT to the empty location which ends
726   the previous symbol: RHS[0] (always defined).  */
727
728#define YYRHSLOC(Rhs, K) ((Rhs)[K])
729#ifndef YYLLOC_DEFAULT
730# define YYLLOC_DEFAULT(Current, Rhs, N)				\
731    do									\
732      if (YYID (N))                                                    \
733	{								\
734	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
735	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
736	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
737	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
738	}								\
739      else								\
740	{								\
741	  (Current).first_line   = (Current).last_line   =		\
742	    YYRHSLOC (Rhs, 0).last_line;				\
743	  (Current).first_column = (Current).last_column =		\
744	    YYRHSLOC (Rhs, 0).last_column;				\
745	}								\
746    while (YYID (0))
747#endif
748
749
750/* YY_LOCATION_PRINT -- Print the location on the stream.
751   This macro was not mandated originally: define only if we know
752   we won't break user code: when these are the locations we know.  */
753
754#ifndef YY_LOCATION_PRINT
755# if YYLTYPE_IS_TRIVIAL
756#  define YY_LOCATION_PRINT(File, Loc)			\
757     fprintf (File, "%d.%d-%d.%d",			\
758	      (Loc).first_line, (Loc).first_column,	\
759	      (Loc).last_line,  (Loc).last_column)
760# else
761#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
762# endif
763#endif
764
765
766/* YYLEX -- calling `yylex' with the right arguments.  */
767
768#ifdef YYLEX_PARAM
769# define YYLEX yylex (YYLEX_PARAM)
770#else
771# define YYLEX yylex ()
772#endif
773
774/* Enable debugging if requested.  */
775#if YYDEBUG
776
777# ifndef YYFPRINTF
778#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
779#  define YYFPRINTF fprintf
780# endif
781
782# define YYDPRINTF(Args)			\
783do {						\
784  if (yydebug)					\
785    YYFPRINTF Args;				\
786} while (YYID (0))
787
788# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
789do {									  \
790  if (yydebug)								  \
791    {									  \
792      YYFPRINTF (stderr, "%s ", Title);					  \
793      yy_symbol_print (stderr,						  \
794		  Type, Value); \
795      YYFPRINTF (stderr, "\n");						  \
796    }									  \
797} while (YYID (0))
798
799
800/*--------------------------------.
801| Print this symbol on YYOUTPUT.  |
802`--------------------------------*/
803
804/*ARGSUSED*/
805#if (defined __STDC__ || defined __C99__FUNC__ \
806     || defined __cplusplus || defined _MSC_VER)
807static void
808yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
809#else
810static void
811yy_symbol_value_print (yyoutput, yytype, yyvaluep)
812    FILE *yyoutput;
813    int yytype;
814    YYSTYPE const * const yyvaluep;
815#endif
816{
817  if (!yyvaluep)
818    return;
819# ifdef YYPRINT
820  if (yytype < YYNTOKENS)
821    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
822# else
823  YYUSE (yyoutput);
824# endif
825  switch (yytype)
826    {
827      default:
828	break;
829    }
830}
831
832
833/*--------------------------------.
834| Print this symbol on YYOUTPUT.  |
835`--------------------------------*/
836
837#if (defined __STDC__ || defined __C99__FUNC__ \
838     || defined __cplusplus || defined _MSC_VER)
839static void
840yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
841#else
842static void
843yy_symbol_print (yyoutput, yytype, yyvaluep)
844    FILE *yyoutput;
845    int yytype;
846    YYSTYPE const * const yyvaluep;
847#endif
848{
849  if (yytype < YYNTOKENS)
850    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
851  else
852    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
853
854  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
855  YYFPRINTF (yyoutput, ")");
856}
857
858/*------------------------------------------------------------------.
859| yy_stack_print -- Print the state stack from its BOTTOM up to its |
860| TOP (included).                                                   |
861`------------------------------------------------------------------*/
862
863#if (defined __STDC__ || defined __C99__FUNC__ \
864     || defined __cplusplus || defined _MSC_VER)
865static void
866yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
867#else
868static void
869yy_stack_print (bottom, top)
870    yytype_int16 *bottom;
871    yytype_int16 *top;
872#endif
873{
874  YYFPRINTF (stderr, "Stack now");
875  for (; bottom <= top; ++bottom)
876    YYFPRINTF (stderr, " %d", *bottom);
877  YYFPRINTF (stderr, "\n");
878}
879
880# define YY_STACK_PRINT(Bottom, Top)				\
881do {								\
882  if (yydebug)							\
883    yy_stack_print ((Bottom), (Top));				\
884} while (YYID (0))
885
886
887/*------------------------------------------------.
888| Report that the YYRULE is going to be reduced.  |
889`------------------------------------------------*/
890
891#if (defined __STDC__ || defined __C99__FUNC__ \
892     || defined __cplusplus || defined _MSC_VER)
893static void
894yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
895#else
896static void
897yy_reduce_print (yyvsp, yyrule)
898    YYSTYPE *yyvsp;
899    int yyrule;
900#endif
901{
902  int yynrhs = yyr2[yyrule];
903  int yyi;
904  unsigned long int yylno = yyrline[yyrule];
905  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
906	     yyrule - 1, yylno);
907  /* The symbols being reduced.  */
908  for (yyi = 0; yyi < yynrhs; yyi++)
909    {
910      fprintf (stderr, "   $%d = ", yyi + 1);
911      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
912		       &(yyvsp[(yyi + 1) - (yynrhs)])
913		       		       );
914      fprintf (stderr, "\n");
915    }
916}
917
918# define YY_REDUCE_PRINT(Rule)		\
919do {					\
920  if (yydebug)				\
921    yy_reduce_print (yyvsp, Rule); \
922} while (YYID (0))
923
924/* Nonzero means print parse trace.  It is left uninitialized so that
925   multiple parsers can coexist.  */
926int yydebug;
927#else /* !YYDEBUG */
928# define YYDPRINTF(Args)
929# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
930# define YY_STACK_PRINT(Bottom, Top)
931# define YY_REDUCE_PRINT(Rule)
932#endif /* !YYDEBUG */
933
934
935/* YYINITDEPTH -- initial size of the parser's stacks.  */
936#ifndef	YYINITDEPTH
937# define YYINITDEPTH 200
938#endif
939
940/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
941   if the built-in stack extension method is used).
942
943   Do not make this value too large; the results are undefined if
944   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
945   evaluated with infinite-precision integer arithmetic.  */
946
947#ifndef YYMAXDEPTH
948# define YYMAXDEPTH 10000
949#endif
950
951
952
953#if YYERROR_VERBOSE
954
955# ifndef yystrlen
956#  if defined __GLIBC__ && defined _STRING_H
957#   define yystrlen strlen
958#  else
959/* Return the length of YYSTR.  */
960#if (defined __STDC__ || defined __C99__FUNC__ \
961     || defined __cplusplus || defined _MSC_VER)
962static YYSIZE_T
963yystrlen (const char *yystr)
964#else
965static YYSIZE_T
966yystrlen (yystr)
967    const char *yystr;
968#endif
969{
970  YYSIZE_T yylen;
971  for (yylen = 0; yystr[yylen]; yylen++)
972    continue;
973  return yylen;
974}
975#  endif
976# endif
977
978# ifndef yystpcpy
979#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
980#   define yystpcpy stpcpy
981#  else
982/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
983   YYDEST.  */
984#if (defined __STDC__ || defined __C99__FUNC__ \
985     || defined __cplusplus || defined _MSC_VER)
986static char *
987yystpcpy (char *yydest, const char *yysrc)
988#else
989static char *
990yystpcpy (yydest, yysrc)
991    char *yydest;
992    const char *yysrc;
993#endif
994{
995  char *yyd = yydest;
996  const char *yys = yysrc;
997
998  while ((*yyd++ = *yys++) != '\0')
999    continue;
1000
1001  return yyd - 1;
1002}
1003#  endif
1004# endif
1005
1006# ifndef yytnamerr
1007/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1008   quotes and backslashes, so that it's suitable for yyerror.  The
1009   heuristic is that double-quoting is unnecessary unless the string
1010   contains an apostrophe, a comma, or backslash (other than
1011   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1012   null, do not copy; instead, return the length of what the result
1013   would have been.  */
1014static YYSIZE_T
1015yytnamerr (char *yyres, const char *yystr)
1016{
1017  if (*yystr == '"')
1018    {
1019      YYSIZE_T yyn = 0;
1020      char const *yyp = yystr;
1021
1022      for (;;)
1023	switch (*++yyp)
1024	  {
1025	  case '\'':
1026	  case ',':
1027	    goto do_not_strip_quotes;
1028
1029	  case '\\':
1030	    if (*++yyp != '\\')
1031	      goto do_not_strip_quotes;
1032	    /* Fall through.  */
1033	  default:
1034	    if (yyres)
1035	      yyres[yyn] = *yyp;
1036	    yyn++;
1037	    break;
1038
1039	  case '"':
1040	    if (yyres)
1041	      yyres[yyn] = '\0';
1042	    return yyn;
1043	  }
1044    do_not_strip_quotes: ;
1045    }
1046
1047  if (! yyres)
1048    return yystrlen (yystr);
1049
1050  return yystpcpy (yyres, yystr) - yyres;
1051}
1052# endif
1053
1054/* Copy into YYRESULT an error message about the unexpected token
1055   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
1056   including the terminating null byte.  If YYRESULT is null, do not
1057   copy anything; just return the number of bytes that would be
1058   copied.  As a special case, return 0 if an ordinary "syntax error"
1059   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
1060   size calculation.  */
1061static YYSIZE_T
1062yysyntax_error (char *yyresult, int yystate, int yychar)
1063{
1064  int yyn = yypact[yystate];
1065
1066  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1067    return 0;
1068  else
1069    {
1070      int yytype = YYTRANSLATE (yychar);
1071      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1072      YYSIZE_T yysize = yysize0;
1073      YYSIZE_T yysize1;
1074      int yysize_overflow = 0;
1075      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1076      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1077      int yyx;
1078
1079# if 0
1080      /* This is so xgettext sees the translatable formats that are
1081	 constructed on the fly.  */
1082      YY_("syntax error, unexpected %s");
1083      YY_("syntax error, unexpected %s, expecting %s");
1084      YY_("syntax error, unexpected %s, expecting %s or %s");
1085      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1086      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1087# endif
1088      char *yyfmt;
1089      char const *yyf;
1090      static char const yyunexpected[] = "syntax error, unexpected %s";
1091      static char const yyexpecting[] = ", expecting %s";
1092      static char const yyor[] = " or %s";
1093      char yyformat[sizeof yyunexpected
1094		    + sizeof yyexpecting - 1
1095		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1096		       * (sizeof yyor - 1))];
1097      char const *yyprefix = yyexpecting;
1098
1099      /* Start YYX at -YYN if negative to avoid negative indexes in
1100	 YYCHECK.  */
1101      int yyxbegin = yyn < 0 ? -yyn : 0;
1102
1103      /* Stay within bounds of both yycheck and yytname.  */
1104      int yychecklim = YYLAST - yyn + 1;
1105      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1106      int yycount = 1;
1107
1108      yyarg[0] = yytname[yytype];
1109      yyfmt = yystpcpy (yyformat, yyunexpected);
1110
1111      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1112	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1113	  {
1114	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1115	      {
1116		yycount = 1;
1117		yysize = yysize0;
1118		yyformat[sizeof yyunexpected - 1] = '\0';
1119		break;
1120	      }
1121	    yyarg[yycount++] = yytname[yyx];
1122	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1123	    yysize_overflow |= (yysize1 < yysize);
1124	    yysize = yysize1;
1125	    yyfmt = yystpcpy (yyfmt, yyprefix);
1126	    yyprefix = yyor;
1127	  }
1128
1129      yyf = YY_(yyformat);
1130      yysize1 = yysize + yystrlen (yyf);
1131      yysize_overflow |= (yysize1 < yysize);
1132      yysize = yysize1;
1133
1134      if (yysize_overflow)
1135	return YYSIZE_MAXIMUM;
1136
1137      if (yyresult)
1138	{
1139	  /* Avoid sprintf, as that infringes on the user's name space.
1140	     Don't have undefined behavior even if the translation
1141	     produced a string with the wrong number of "%s"s.  */
1142	  char *yyp = yyresult;
1143	  int yyi = 0;
1144	  while ((*yyp = *yyf) != '\0')
1145	    {
1146	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1147		{
1148		  yyp += yytnamerr (yyp, yyarg[yyi++]);
1149		  yyf += 2;
1150		}
1151	      else
1152		{
1153		  yyp++;
1154		  yyf++;
1155		}
1156	    }
1157	}
1158      return yysize;
1159    }
1160}
1161#endif /* YYERROR_VERBOSE */
1162
1163
1164/*-----------------------------------------------.
1165| Release the memory associated to this symbol.  |
1166`-----------------------------------------------*/
1167
1168/*ARGSUSED*/
1169#if (defined __STDC__ || defined __C99__FUNC__ \
1170     || defined __cplusplus || defined _MSC_VER)
1171static void
1172yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1173#else
1174static void
1175yydestruct (yymsg, yytype, yyvaluep)
1176    const char *yymsg;
1177    int yytype;
1178    YYSTYPE *yyvaluep;
1179#endif
1180{
1181  YYUSE (yyvaluep);
1182
1183  if (!yymsg)
1184    yymsg = "Deleting";
1185  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1186
1187  switch (yytype)
1188    {
1189
1190      default:
1191	break;
1192    }
1193}
1194
1195
1196/* Prevent warnings from -Wmissing-prototypes.  */
1197
1198#ifdef YYPARSE_PARAM
1199#if defined __STDC__ || defined __cplusplus
1200int yyparse (void *YYPARSE_PARAM);
1201#else
1202int yyparse ();
1203#endif
1204#else /* ! YYPARSE_PARAM */
1205#if defined __STDC__ || defined __cplusplus
1206int yyparse (void);
1207#else
1208int yyparse ();
1209#endif
1210#endif /* ! YYPARSE_PARAM */
1211
1212
1213
1214/* The look-ahead symbol.  */
1215int yychar;
1216
1217/* The semantic value of the look-ahead symbol.  */
1218YYSTYPE yylval;
1219
1220/* Number of syntax errors so far.  */
1221int yynerrs;
1222
1223
1224
1225/*----------.
1226| yyparse.  |
1227`----------*/
1228
1229#ifdef YYPARSE_PARAM
1230#if (defined __STDC__ || defined __C99__FUNC__ \
1231     || defined __cplusplus || defined _MSC_VER)
1232int
1233yyparse (void *YYPARSE_PARAM)
1234#else
1235int
1236yyparse (YYPARSE_PARAM)
1237    void *YYPARSE_PARAM;
1238#endif
1239#else /* ! YYPARSE_PARAM */
1240#if (defined __STDC__ || defined __C99__FUNC__ \
1241     || defined __cplusplus || defined _MSC_VER)
1242int
1243yyparse (void)
1244#else
1245int
1246yyparse ()
1247
1248#endif
1249#endif
1250{
1251
1252  int yystate;
1253  int yyn;
1254  int yyresult;
1255  /* Number of tokens to shift before error messages enabled.  */
1256  int yyerrstatus;
1257  /* Look-ahead token as an internal (translated) token number.  */
1258  int yytoken = 0;
1259#if YYERROR_VERBOSE
1260  /* Buffer for error messages, and its allocated size.  */
1261  char yymsgbuf[128];
1262  char *yymsg = yymsgbuf;
1263  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1264#endif
1265
1266  /* Three stacks and their tools:
1267     `yyss': related to states,
1268     `yyvs': related to semantic values,
1269     `yyls': related to locations.
1270
1271     Refer to the stacks thru separate pointers, to allow yyoverflow
1272     to reallocate them elsewhere.  */
1273
1274  /* The state stack.  */
1275  yytype_int16 yyssa[YYINITDEPTH];
1276  yytype_int16 *yyss = yyssa;
1277  yytype_int16 *yyssp;
1278
1279  /* The semantic value stack.  */
1280  YYSTYPE yyvsa[YYINITDEPTH];
1281  YYSTYPE *yyvs = yyvsa;
1282  YYSTYPE *yyvsp;
1283
1284
1285
1286#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1287
1288  YYSIZE_T yystacksize = YYINITDEPTH;
1289
1290  /* The variables used to return semantic value and location from the
1291     action routines.  */
1292  YYSTYPE yyval;
1293
1294
1295  /* The number of symbols on the RHS of the reduced rule.
1296     Keep to zero when no symbol should be popped.  */
1297  int yylen = 0;
1298
1299  YYDPRINTF ((stderr, "Starting parse\n"));
1300
1301  yystate = 0;
1302  yyerrstatus = 0;
1303  yynerrs = 0;
1304  yychar = YYEMPTY;		/* Cause a token to be read.  */
1305
1306  /* Initialize stack pointers.
1307     Waste one element of value and location stack
1308     so that they stay on the same level as the state stack.
1309     The wasted elements are never initialized.  */
1310
1311  yyssp = yyss;
1312  yyvsp = yyvs;
1313
1314  goto yysetstate;
1315
1316/*------------------------------------------------------------.
1317| yynewstate -- Push a new state, which is found in yystate.  |
1318`------------------------------------------------------------*/
1319 yynewstate:
1320  /* In all cases, when you get here, the value and location stacks
1321     have just been pushed.  So pushing a state here evens the stacks.  */
1322  yyssp++;
1323
1324 yysetstate:
1325  *yyssp = yystate;
1326
1327  if (yyss + yystacksize - 1 <= yyssp)
1328    {
1329      /* Get the current used size of the three stacks, in elements.  */
1330      YYSIZE_T yysize = yyssp - yyss + 1;
1331
1332#ifdef yyoverflow
1333      {
1334	/* Give user a chance to reallocate the stack.  Use copies of
1335	   these so that the &'s don't force the real ones into
1336	   memory.  */
1337	YYSTYPE *yyvs1 = yyvs;
1338	yytype_int16 *yyss1 = yyss;
1339
1340
1341	/* Each stack pointer address is followed by the size of the
1342	   data in use in that stack, in bytes.  This used to be a
1343	   conditional around just the two extra args, but that might
1344	   be undefined if yyoverflow is a macro.  */
1345	yyoverflow (YY_("memory exhausted"),
1346		    &yyss1, yysize * sizeof (*yyssp),
1347		    &yyvs1, yysize * sizeof (*yyvsp),
1348
1349		    &yystacksize);
1350
1351	yyss = yyss1;
1352	yyvs = yyvs1;
1353      }
1354#else /* no yyoverflow */
1355# ifndef YYSTACK_RELOCATE
1356      goto yyexhaustedlab;
1357# else
1358      /* Extend the stack our own way.  */
1359      if (YYMAXDEPTH <= yystacksize)
1360	goto yyexhaustedlab;
1361      yystacksize *= 2;
1362      if (YYMAXDEPTH < yystacksize)
1363	yystacksize = YYMAXDEPTH;
1364
1365      {
1366	yytype_int16 *yyss1 = yyss;
1367	union yyalloc *yyptr =
1368	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1369	if (! yyptr)
1370	  goto yyexhaustedlab;
1371	YYSTACK_RELOCATE (yyss);
1372	YYSTACK_RELOCATE (yyvs);
1373
1374#  undef YYSTACK_RELOCATE
1375	if (yyss1 != yyssa)
1376	  YYSTACK_FREE (yyss1);
1377      }
1378# endif
1379#endif /* no yyoverflow */
1380
1381      yyssp = yyss + yysize - 1;
1382      yyvsp = yyvs + yysize - 1;
1383
1384
1385      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1386		  (unsigned long int) yystacksize));
1387
1388      if (yyss + yystacksize - 1 <= yyssp)
1389	YYABORT;
1390    }
1391
1392  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1393
1394  goto yybackup;
1395
1396/*-----------.
1397| yybackup.  |
1398`-----------*/
1399yybackup:
1400
1401  /* Do appropriate processing given the current state.  Read a
1402     look-ahead token if we need one and don't already have one.  */
1403
1404  /* First try to decide what to do without reference to look-ahead token.  */
1405  yyn = yypact[yystate];
1406  if (yyn == YYPACT_NINF)
1407    goto yydefault;
1408
1409  /* Not known => get a look-ahead token if don't already have one.  */
1410
1411  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1412  if (yychar == YYEMPTY)
1413    {
1414      YYDPRINTF ((stderr, "Reading a token: "));
1415      yychar = YYLEX;
1416    }
1417
1418  if (yychar <= YYEOF)
1419    {
1420      yychar = yytoken = YYEOF;
1421      YYDPRINTF ((stderr, "Now at end of input.\n"));
1422    }
1423  else
1424    {
1425      yytoken = YYTRANSLATE (yychar);
1426      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1427    }
1428
1429  /* If the proper action on seeing token YYTOKEN is to reduce or to
1430     detect an error, take that action.  */
1431  yyn += yytoken;
1432  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1433    goto yydefault;
1434  yyn = yytable[yyn];
1435  if (yyn <= 0)
1436    {
1437      if (yyn == 0 || yyn == YYTABLE_NINF)
1438	goto yyerrlab;
1439      yyn = -yyn;
1440      goto yyreduce;
1441    }
1442
1443  if (yyn == YYFINAL)
1444    YYACCEPT;
1445
1446  /* Count tokens shifted since error; after three, turn off error
1447     status.  */
1448  if (yyerrstatus)
1449    yyerrstatus--;
1450
1451  /* Shift the look-ahead token.  */
1452  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1453
1454  /* Discard the shifted token unless it is eof.  */
1455  if (yychar != YYEOF)
1456    yychar = YYEMPTY;
1457
1458  yystate = yyn;
1459  *++yyvsp = yylval;
1460
1461  goto yynewstate;
1462
1463
1464/*-----------------------------------------------------------.
1465| yydefault -- do the default action for the current state.  |
1466`-----------------------------------------------------------*/
1467yydefault:
1468  yyn = yydefact[yystate];
1469  if (yyn == 0)
1470    goto yyerrlab;
1471  goto yyreduce;
1472
1473
1474/*-----------------------------.
1475| yyreduce -- Do a reduction.  |
1476`-----------------------------*/
1477yyreduce:
1478  /* yyn is the number of a rule to reduce with.  */
1479  yylen = yyr2[yyn];
1480
1481  /* If YYLEN is nonzero, implement the default value of the action:
1482     `$$ = $1'.
1483
1484     Otherwise, the following line sets YYVAL to garbage.
1485     This behavior is undocumented and Bison
1486     users should not rely upon it.  Assigning to YYVAL
1487     unconditionally makes the parser a bit smaller, and it avoids a
1488     GCC warning that YYVAL may be used uninitialized.  */
1489  yyval = yyvsp[1-yylen];
1490
1491
1492  YY_REDUCE_PRINT (yyn);
1493  switch (yyn)
1494    {
1495        case 18:
1496#line 118 "winprefsyacc.y"
1497    { SetTrayIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
1498    break;
1499
1500  case 19:
1501#line 121 "winprefsyacc.y"
1502    { SetRootMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
1503    break;
1504
1505  case 20:
1506#line 124 "winprefsyacc.y"
1507    { SetDefaultSysMenu((yyvsp[(2) - (4)].sVal), (yyvsp[(3) - (4)].iVal)); free((yyvsp[(2) - (4)].sVal)); }
1508    break;
1509
1510  case 21:
1511#line 127 "winprefsyacc.y"
1512    { SetDefaultIcon((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
1513    break;
1514
1515  case 22:
1516#line 130 "winprefsyacc.y"
1517    { SetIconDirectory((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
1518    break;
1519
1520  case 23:
1521#line 133 "winprefsyacc.y"
1522    { AddMenuLine("-", CMD_SEPARATOR, ""); }
1523    break;
1524
1525  case 24:
1526#line 134 "winprefsyacc.y"
1527    { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_ALWAYSONTOP, ""); free((yyvsp[(1) - (4)].sVal)); }
1528    break;
1529
1530  case 25:
1531#line 135 "winprefsyacc.y"
1532    { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_EXEC, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); }
1533    break;
1534
1535  case 26:
1536#line 136 "winprefsyacc.y"
1537    { AddMenuLine((yyvsp[(1) - (5)].sVal), CMD_MENU, (yyvsp[(3) - (5)].sVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(3) - (5)].sVal)); }
1538    break;
1539
1540  case 27:
1541#line 137 "winprefsyacc.y"
1542    { AddMenuLine((yyvsp[(1) - (4)].sVal), CMD_RELOAD, ""); free((yyvsp[(1) - (4)].sVal)); }
1543    break;
1544
1545  case 30:
1546#line 144 "winprefsyacc.y"
1547    { OpenMenu((yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
1548    break;
1549
1550  case 31:
1551#line 144 "winprefsyacc.y"
1552    {CloseMenu();}
1553    break;
1554
1555  case 32:
1556#line 147 "winprefsyacc.y"
1557    { AddIconLine((yyvsp[(1) - (4)].sVal), (yyvsp[(2) - (4)].sVal)); free((yyvsp[(1) - (4)].sVal)); free((yyvsp[(2) - (4)].sVal)); }
1558    break;
1559
1560  case 35:
1561#line 154 "winprefsyacc.y"
1562    {OpenIcons();}
1563    break;
1564
1565  case 36:
1566#line 154 "winprefsyacc.y"
1567    {CloseIcons();}
1568    break;
1569
1570  case 37:
1571#line 157 "winprefsyacc.y"
1572    { (yyval.iVal)=AT_END; }
1573    break;
1574
1575  case 38:
1576#line 158 "winprefsyacc.y"
1577    { (yyval.iVal)=AT_START; }
1578    break;
1579
1580  case 39:
1581#line 159 "winprefsyacc.y"
1582    { (yyval.iVal)=AT_END; }
1583    break;
1584
1585  case 40:
1586#line 162 "winprefsyacc.y"
1587    { AddSysMenuLine((yyvsp[(1) - (5)].sVal), (yyvsp[(2) - (5)].sVal), (yyvsp[(3) - (5)].iVal)); free((yyvsp[(1) - (5)].sVal)); free((yyvsp[(2) - (5)].sVal)); }
1588    break;
1589
1590  case 43:
1591#line 169 "winprefsyacc.y"
1592    {OpenSysMenu();}
1593    break;
1594
1595  case 44:
1596#line 169 "winprefsyacc.y"
1597    {CloseSysMenu();}
1598    break;
1599
1600  case 45:
1601#line 172 "winprefsyacc.y"
1602    { pref.fSilentExit = TRUE; }
1603    break;
1604
1605  case 46:
1606#line 175 "winprefsyacc.y"
1607    { ErrorF("LoadPreferences: %s\n", (yyvsp[(2) - (3)].sVal)); free((yyvsp[(2) - (3)].sVal)); }
1608    break;
1609
1610
1611/* Line 1267 of yacc.c.  */
1612#line 1613 "winprefsyacc.c"
1613      default: break;
1614    }
1615  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1616
1617  YYPOPSTACK (yylen);
1618  yylen = 0;
1619  YY_STACK_PRINT (yyss, yyssp);
1620
1621  *++yyvsp = yyval;
1622
1623
1624  /* Now `shift' the result of the reduction.  Determine what state
1625     that goes to, based on the state we popped back to and the rule
1626     number reduced by.  */
1627
1628  yyn = yyr1[yyn];
1629
1630  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1631  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1632    yystate = yytable[yystate];
1633  else
1634    yystate = yydefgoto[yyn - YYNTOKENS];
1635
1636  goto yynewstate;
1637
1638
1639/*------------------------------------.
1640| yyerrlab -- here on detecting error |
1641`------------------------------------*/
1642yyerrlab:
1643  /* If not already recovering from an error, report this error.  */
1644  if (!yyerrstatus)
1645    {
1646      ++yynerrs;
1647#if ! YYERROR_VERBOSE
1648      yyerror (YY_("syntax error"));
1649#else
1650      {
1651	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1652	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1653	  {
1654	    YYSIZE_T yyalloc = 2 * yysize;
1655	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1656	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
1657	    if (yymsg != yymsgbuf)
1658	      YYSTACK_FREE (yymsg);
1659	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1660	    if (yymsg)
1661	      yymsg_alloc = yyalloc;
1662	    else
1663	      {
1664		yymsg = yymsgbuf;
1665		yymsg_alloc = sizeof yymsgbuf;
1666	      }
1667	  }
1668
1669	if (0 < yysize && yysize <= yymsg_alloc)
1670	  {
1671	    (void) yysyntax_error (yymsg, yystate, yychar);
1672	    yyerror (yymsg);
1673	  }
1674	else
1675	  {
1676	    yyerror (YY_("syntax error"));
1677	    if (yysize != 0)
1678	      goto yyexhaustedlab;
1679	  }
1680      }
1681#endif
1682    }
1683
1684
1685
1686  if (yyerrstatus == 3)
1687    {
1688      /* If just tried and failed to reuse look-ahead token after an
1689	 error, discard it.  */
1690
1691      if (yychar <= YYEOF)
1692	{
1693	  /* Return failure if at end of input.  */
1694	  if (yychar == YYEOF)
1695	    YYABORT;
1696	}
1697      else
1698	{
1699	  yydestruct ("Error: discarding",
1700		      yytoken, &yylval);
1701	  yychar = YYEMPTY;
1702	}
1703    }
1704
1705  /* Else will try to reuse look-ahead token after shifting the error
1706     token.  */
1707  goto yyerrlab1;
1708
1709
1710/*---------------------------------------------------.
1711| yyerrorlab -- error raised explicitly by YYERROR.  |
1712`---------------------------------------------------*/
1713yyerrorlab:
1714
1715  /* Pacify compilers like GCC when the user code never invokes
1716     YYERROR and the label yyerrorlab therefore never appears in user
1717     code.  */
1718  if (/*CONSTCOND*/ 0)
1719     goto yyerrorlab;
1720
1721  /* Do not reclaim the symbols of the rule which action triggered
1722     this YYERROR.  */
1723  YYPOPSTACK (yylen);
1724  yylen = 0;
1725  YY_STACK_PRINT (yyss, yyssp);
1726  yystate = *yyssp;
1727  goto yyerrlab1;
1728
1729
1730/*-------------------------------------------------------------.
1731| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1732`-------------------------------------------------------------*/
1733yyerrlab1:
1734  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
1735
1736  for (;;)
1737    {
1738      yyn = yypact[yystate];
1739      if (yyn != YYPACT_NINF)
1740	{
1741	  yyn += YYTERROR;
1742	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1743	    {
1744	      yyn = yytable[yyn];
1745	      if (0 < yyn)
1746		break;
1747	    }
1748	}
1749
1750      /* Pop the current state because it cannot handle the error token.  */
1751      if (yyssp == yyss)
1752	YYABORT;
1753
1754
1755      yydestruct ("Error: popping",
1756		  yystos[yystate], yyvsp);
1757      YYPOPSTACK (1);
1758      yystate = *yyssp;
1759      YY_STACK_PRINT (yyss, yyssp);
1760    }
1761
1762  if (yyn == YYFINAL)
1763    YYACCEPT;
1764
1765  *++yyvsp = yylval;
1766
1767
1768  /* Shift the error token.  */
1769  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1770
1771  yystate = yyn;
1772  goto yynewstate;
1773
1774
1775/*-------------------------------------.
1776| yyacceptlab -- YYACCEPT comes here.  |
1777`-------------------------------------*/
1778yyacceptlab:
1779  yyresult = 0;
1780  goto yyreturn;
1781
1782/*-----------------------------------.
1783| yyabortlab -- YYABORT comes here.  |
1784`-----------------------------------*/
1785yyabortlab:
1786  yyresult = 1;
1787  goto yyreturn;
1788
1789#ifndef yyoverflow
1790/*-------------------------------------------------.
1791| yyexhaustedlab -- memory exhaustion comes here.  |
1792`-------------------------------------------------*/
1793yyexhaustedlab:
1794  yyerror (YY_("memory exhausted"));
1795  yyresult = 2;
1796  /* Fall through.  */
1797#endif
1798
1799yyreturn:
1800  if (yychar != YYEOF && yychar != YYEMPTY)
1801     yydestruct ("Cleanup: discarding lookahead",
1802		 yytoken, &yylval);
1803  /* Do not reclaim the symbols of the rule which action triggered
1804     this YYABORT or YYACCEPT.  */
1805  YYPOPSTACK (yylen);
1806  YY_STACK_PRINT (yyss, yyssp);
1807  while (yyssp != yyss)
1808    {
1809      yydestruct ("Cleanup: popping",
1810		  yystos[*yyssp], yyvsp);
1811      YYPOPSTACK (1);
1812    }
1813#ifndef yyoverflow
1814  if (yyss != yyssa)
1815    YYSTACK_FREE (yyss);
1816#endif
1817#if YYERROR_VERBOSE
1818  if (yymsg != yymsgbuf)
1819    YYSTACK_FREE (yymsg);
1820#endif
1821  /* Make sure YYID is used.  */
1822  return YYID (yyresult);
1823}
1824
1825
1826#line 179 "winprefsyacc.y"
1827
1828/*
1829 * Errors in parsing abort and print log messages
1830 */
1831static int
1832yyerror (char *s)
1833{
1834  extern int yylineno; /* Handled by flex internally */
1835
1836  ErrorF("LoadPreferences: %s line %d\n", s, yylineno);
1837  return 1;
1838}
1839
1840/* Miscellaneous functions to store TOKENs into the structure */
1841static void
1842SetIconDirectory (char *path)
1843{
1844  strncpy (pref.iconDirectory, path, PATH_MAX);
1845  pref.iconDirectory[PATH_MAX] = 0;
1846}
1847
1848static void
1849SetDefaultIcon (char *fname)
1850{
1851  strncpy (pref.defaultIconName, fname, NAME_MAX);
1852  pref.defaultIconName[NAME_MAX] = 0;
1853}
1854
1855static void
1856SetTrayIcon (char *fname)
1857{
1858  strncpy (pref.trayIconName, fname, NAME_MAX);
1859  pref.trayIconName[NAME_MAX] = 0;
1860}
1861
1862static void
1863SetRootMenu (char *menu)
1864{
1865  strncpy (pref.rootMenuName, menu, MENU_MAX);
1866  pref.rootMenuName[MENU_MAX] = 0;
1867}
1868
1869static void
1870SetDefaultSysMenu (char *menu, int pos)
1871{
1872  strncpy (pref.defaultSysMenuName, menu, MENU_MAX);
1873  pref.defaultSysMenuName[MENU_MAX] = 0;
1874  pref.defaultSysMenuPos = pos;
1875}
1876
1877static void
1878OpenMenu (char *menuname)
1879{
1880  if (menu.menuItem) free(menu.menuItem);
1881  menu.menuItem = NULL;
1882  strncpy(menu.menuName, menuname, MENU_MAX);
1883  menu.menuName[MENU_MAX] = 0;
1884  menu.menuItems = 0;
1885}
1886
1887static void
1888AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param)
1889{
1890  if (menu.menuItem==NULL)
1891    menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM));
1892  else
1893    menu.menuItem = (MENUITEM*)
1894      realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
1895
1896  strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX);
1897  menu.menuItem[menu.menuItems].text[MENU_MAX] = 0;
1898
1899  menu.menuItem[menu.menuItems].cmd = cmd;
1900
1901  strncpy(menu.menuItem[menu.menuItems].param, param, PARAM_MAX);
1902  menu.menuItem[menu.menuItems].param[PARAM_MAX] = 0;
1903
1904  menu.menuItem[menu.menuItems].commandID = 0;
1905
1906  menu.menuItems++;
1907}
1908
1909static void
1910CloseMenu (void)
1911{
1912  if (menu.menuItem==NULL || menu.menuItems==0)
1913    {
1914      ErrorF("LoadPreferences: Empty menu detected\n");
1915      return;
1916    }
1917
1918  if (pref.menuItems)
1919    pref.menu = (MENUPARSED*)
1920      realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
1921  else
1922    pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED));
1923
1924  memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED));
1925  pref.menuItems++;
1926
1927  memset (&menu, 0, sizeof(MENUPARSED));
1928}
1929
1930static void
1931OpenIcons (void)
1932{
1933  if (pref.icon != NULL) {
1934    ErrorF("LoadPreferences: Redefining icon mappings\n");
1935    free(pref.icon);
1936    pref.icon = NULL;
1937  }
1938  pref.iconItems = 0;
1939}
1940
1941static void
1942AddIconLine (char *matchstr, char *iconfile)
1943{
1944  if (pref.icon==NULL)
1945    pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM));
1946  else
1947    pref.icon = (ICONITEM*)
1948      realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
1949
1950  strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX);
1951  pref.icon[pref.iconItems].match[MENU_MAX] = 0;
1952
1953  strncpy(pref.icon[pref.iconItems].iconFile, iconfile, PATH_MAX+NAME_MAX+1);
1954  pref.icon[pref.iconItems].iconFile[PATH_MAX+NAME_MAX+1] = 0;
1955
1956  pref.icon[pref.iconItems].hicon = 0;
1957
1958  pref.iconItems++;
1959}
1960
1961static void
1962CloseIcons (void)
1963{
1964}
1965
1966static void
1967OpenSysMenu (void)
1968{
1969  if (pref.sysMenu != NULL) {
1970    ErrorF("LoadPreferences: Redefining system menu\n");
1971    free(pref.sysMenu);
1972    pref.sysMenu = NULL;
1973  }
1974  pref.sysMenuItems = 0;
1975}
1976
1977static void
1978AddSysMenuLine (char *matchstr, char *menuname, int pos)
1979{
1980  if (pref.sysMenu==NULL)
1981    pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM));
1982  else
1983    pref.sysMenu = (SYSMENUITEM*)
1984      realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
1985
1986  strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX);
1987  pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0;
1988
1989  strncpy (pref.sysMenu[pref.sysMenuItems].menuName, menuname, MENU_MAX);
1990  pref.sysMenu[pref.sysMenuItems].menuName[MENU_MAX] = 0;
1991
1992  pref.sysMenu[pref.sysMenuItems].menuPos = pos;
1993
1994  pref.sysMenuItems++;
1995}
1996
1997static void
1998CloseSysMenu (void)
1999{
2000}
2001
2002
2003