Atrinik Server 2.5
loaders/map_header.c
00001 #line 2 "src/loaders/map_header.c"
00002 
00003 #line 4 "src/loaders/map_header.c"
00004 
00005 #define  YY_INT_ALIGNED short int
00006 
00007 /* A lexical scanner generated by flex */
00008 
00009 #define yy_create_buffer yy_map_header_create_buffer
00010 #define yy_delete_buffer yy_map_header_delete_buffer
00011 #define yy_flex_debug yy_map_header_flex_debug
00012 #define yy_init_buffer yy_map_header_init_buffer
00013 #define yy_flush_buffer yy_map_header_flush_buffer
00014 #define yy_load_buffer_state yy_map_header_load_buffer_state
00015 #define yy_switch_to_buffer yy_map_header_switch_to_buffer
00016 #define yyin yy_map_headerin
00017 #define yyleng yy_map_headerleng
00018 #define yylex yy_map_headerlex
00019 #define yylineno yy_map_headerlineno
00020 #define yyout yy_map_headerout
00021 #define yyrestart yy_map_headerrestart
00022 #define yytext yy_map_headertext
00023 #define yywrap yy_map_headerwrap
00024 #define yyalloc yy_map_headeralloc
00025 #define yyrealloc yy_map_headerrealloc
00026 #define yyfree yy_map_headerfree
00027 
00028 #define FLEX_SCANNER
00029 #define YY_FLEX_MAJOR_VERSION 2
00030 #define YY_FLEX_MINOR_VERSION 5
00031 #define YY_FLEX_SUBMINOR_VERSION 35
00032 #if YY_FLEX_SUBMINOR_VERSION > 0
00033 #define FLEX_BETA
00034 #endif
00035 
00036 /* First, we deal with  platform-specific or compiler-specific issues. */
00037 
00038 /* begin standard C headers. */
00039 #include <stdio.h>
00040 #include <string.h>
00041 #include <errno.h>
00042 #include <stdlib.h>
00043 
00044 /* end standard C headers. */
00045 
00046 /* flex integer type definitions */
00047 
00048 #ifndef FLEXINT_H
00049 #define FLEXINT_H
00050 
00051 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
00052 
00053 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
00054 
00055 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
00056  * if you want the limit (max/min) macros for int types. 
00057  */
00058 #ifndef __STDC_LIMIT_MACROS
00059 #define __STDC_LIMIT_MACROS 1
00060 #endif
00061 
00062 #include <inttypes.h>
00063 typedef int8_t flex_int8_t;
00064 typedef uint8_t flex_uint8_t;
00065 typedef int16_t flex_int16_t;
00066 typedef uint16_t flex_uint16_t;
00067 typedef int32_t flex_int32_t;
00068 typedef uint32_t flex_uint32_t;
00069 #else
00070 typedef signed char flex_int8_t;
00071 typedef short int flex_int16_t;
00072 typedef int flex_int32_t;
00073 typedef unsigned char flex_uint8_t; 
00074 typedef unsigned short int flex_uint16_t;
00075 typedef unsigned int flex_uint32_t;
00076 
00077 /* Limits of integral types. */
00078 #ifndef INT8_MIN
00079 #define INT8_MIN               (-128)
00080 #endif
00081 #ifndef INT16_MIN
00082 #define INT16_MIN              (-32767-1)
00083 #endif
00084 #ifndef INT32_MIN
00085 #define INT32_MIN              (-2147483647-1)
00086 #endif
00087 #ifndef INT8_MAX
00088 #define INT8_MAX               (127)
00089 #endif
00090 #ifndef INT16_MAX
00091 #define INT16_MAX              (32767)
00092 #endif
00093 #ifndef INT32_MAX
00094 #define INT32_MAX              (2147483647)
00095 #endif
00096 #ifndef UINT8_MAX
00097 #define UINT8_MAX              (255U)
00098 #endif
00099 #ifndef UINT16_MAX
00100 #define UINT16_MAX             (65535U)
00101 #endif
00102 #ifndef UINT32_MAX
00103 #define UINT32_MAX             (4294967295U)
00104 #endif
00105 
00106 #endif /* ! C99 */
00107 
00108 #endif /* ! FLEXINT_H */
00109 
00110 #ifdef __cplusplus
00111 
00112 /* The "const" storage-class-modifier is valid. */
00113 #define YY_USE_CONST
00114 
00115 #else   /* ! __cplusplus */
00116 
00117 /* C99 requires __STDC__ to be defined as 1. */
00118 #if defined (__STDC__)
00119 
00120 #define YY_USE_CONST
00121 
00122 #endif  /* defined (__STDC__) */
00123 #endif  /* ! __cplusplus */
00124 
00125 #ifdef YY_USE_CONST
00126 #define yyconst const
00127 #else
00128 #define yyconst
00129 #endif
00130 
00131 /* Returned upon end-of-file. */
00132 #define YY_NULL 0
00133 
00134 /* Promotes a possibly negative, possibly signed char to an unsigned
00135  * integer for use as an array index.  If the signed char is negative,
00136  * we want to instead treat it as an 8-bit unsigned char, hence the
00137  * double cast.
00138  */
00139 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00140 
00141 /* Enter a start condition.  This macro really ought to take a parameter,
00142  * but we do it the disgusting crufty way forced on us by the ()-less
00143  * definition of BEGIN.
00144  */
00145 #define BEGIN (yy_start) = 1 + 2 *
00146 
00147 /* Translate the current start state into a value that can be later handed
00148  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00149  * compatibility.
00150  */
00151 #define YY_START (((yy_start) - 1) / 2)
00152 #define YYSTATE YY_START
00153 
00154 /* Action number for EOF rule of a given start state. */
00155 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00156 
00157 /* Special action meaning "start processing a new file". */
00158 #define YY_NEW_FILE yy_map_headerrestart(yy_map_headerin  )
00159 
00160 #define YY_END_OF_BUFFER_CHAR 0
00161 
00162 /* Size of default input buffer. */
00163 #ifndef YY_BUF_SIZE
00164 #ifdef __ia64__
00165 /* On IA-64, the buffer size is 16k, not 8k.
00166  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
00167  * Ditto for the __ia64__ case accordingly.
00168  */
00169 #define YY_BUF_SIZE 32768
00170 #else
00171 #define YY_BUF_SIZE 16384
00172 #endif /* __ia64__ */
00173 #endif
00174 
00175 /* The state buf must be large enough to hold one state per character in the main buffer.
00176  */
00177 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
00178 
00179 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00180 #define YY_TYPEDEF_YY_BUFFER_STATE
00181 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00182 #endif
00183 
00184 extern int yy_map_headerleng;
00185 
00186 extern FILE *yy_map_headerin, *yy_map_headerout;
00187 
00188 #define EOB_ACT_CONTINUE_SCAN 0
00189 #define EOB_ACT_END_OF_FILE 1
00190 #define EOB_ACT_LAST_MATCH 2
00191 
00192     #define YY_LESS_LINENO(n)
00193     
00194 /* Return all but the first "n" matched characters back to the input stream. */
00195 #define yyless(n) \
00196     do \
00197         { \
00198         /* Undo effects of setting up yy_map_headertext. */ \
00199         int yyless_macro_arg = (n); \
00200         YY_LESS_LINENO(yyless_macro_arg);\
00201         *yy_cp = (yy_hold_char); \
00202         YY_RESTORE_YY_MORE_OFFSET \
00203         (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00204         YY_DO_BEFORE_ACTION; /* set up yy_map_headertext again */ \
00205         } \
00206     while ( 0 )
00207 
00208 #define unput(c) yyunput( c, (yytext_ptr)  )
00209 
00210 #ifndef YY_TYPEDEF_YY_SIZE_T
00211 #define YY_TYPEDEF_YY_SIZE_T
00212 typedef size_t yy_size_t;
00213 #endif
00214 
00215 #ifndef YY_STRUCT_YY_BUFFER_STATE
00216 #define YY_STRUCT_YY_BUFFER_STATE
00217 struct yy_buffer_state
00218     {
00219     FILE *yy_input_file;
00220 
00221     char *yy_ch_buf;        /* input buffer */
00222     char *yy_buf_pos;       /* current position in input buffer */
00223 
00224     /* Size of input buffer in bytes, not including room for EOB
00225      * characters.
00226      */
00227     yy_size_t yy_buf_size;
00228 
00229     /* Number of characters read into yy_ch_buf, not including EOB
00230      * characters.
00231      */
00232     int yy_n_chars;
00233 
00234     /* Whether we "own" the buffer - i.e., we know we created it,
00235      * and can realloc() it to grow it, and should free() it to
00236      * delete it.
00237      */
00238     int yy_is_our_buffer;
00239 
00240     /* Whether this is an "interactive" input source; if so, and
00241      * if we're using stdio for input, then we want to use getc()
00242      * instead of fread(), to make sure we stop fetching input after
00243      * each newline.
00244      */
00245     int yy_is_interactive;
00246 
00247     /* Whether we're considered to be at the beginning of a line.
00248      * If so, '^' rules will be active on the next match, otherwise
00249      * not.
00250      */
00251     int yy_at_bol;
00252 
00253     int yy_bs_lineno; 
00254     int yy_bs_column; 
00256     /* Whether to try to fill the input buffer when we reach the
00257      * end of it.
00258      */
00259     int yy_fill_buffer;
00260 
00261     int yy_buffer_status;
00262 
00263 #define YY_BUFFER_NEW 0
00264 #define YY_BUFFER_NORMAL 1
00265     /* When an EOF's been seen but there's still some text to process
00266      * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00267      * shouldn't try reading from the input source any more.  We might
00268      * still have a bunch of tokens to match, though, because of
00269      * possible backing-up.
00270      *
00271      * When we actually see the EOF, we change the status to "new"
00272      * (via yy_map_headerrestart()), so that the user can continue scanning by
00273      * just pointing yy_map_headerin at a new input file.
00274      */
00275 #define YY_BUFFER_EOF_PENDING 2
00276 
00277     };
00278 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
00279 
00280 /* Stack of input buffers. */
00281 static size_t yy_buffer_stack_top = 0; 
00282 static size_t yy_buffer_stack_max = 0; 
00283 static YY_BUFFER_STATE * yy_buffer_stack = 0; 
00285 /* We provide macros for accessing buffer states in case in the
00286  * future we want to put the buffer states in a more general
00287  * "scanner state".
00288  *
00289  * Returns the top of the stack, or NULL.
00290  */
00291 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
00292                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
00293                           : NULL)
00294 
00295 /* Same as previous macro, but useful when we know that the buffer stack is not
00296  * NULL or when we need an lvalue. For internal use only.
00297  */
00298 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
00299 
00300 /* yy_hold_char holds the character lost when yy_map_headertext is formed. */
00301 static char yy_hold_char;
00302 static int yy_n_chars;      /* number of characters read into yy_ch_buf */
00303 int yy_map_headerleng;
00304 
00305 /* Points to current character in buffer. */
00306 static char *yy_c_buf_p = (char *) 0;
00307 static int yy_init = 0;     /* whether we need to initialize */
00308 static int yy_start = 0;    /* start state number */
00309 
00310 /* Flag which is used to allow yy_map_headerwrap()'s to do buffer switches
00311  * instead of setting up a fresh yy_map_headerin.  A bit of a hack ...
00312  */
00313 static int yy_did_buffer_switch_on_eof;
00314 
00315 void yy_map_headerrestart (FILE *input_file  );
00316 void yy_map_header_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
00317 YY_BUFFER_STATE yy_map_header_create_buffer (FILE *file,int size  );
00318 void yy_map_header_delete_buffer (YY_BUFFER_STATE b  );
00319 void yy_map_header_flush_buffer (YY_BUFFER_STATE b  );
00320 void yy_map_headerpush_buffer_state (YY_BUFFER_STATE new_buffer  );
00321 void yy_map_headerpop_buffer_state (void );
00322 
00323 static void yy_map_headerensure_buffer_stack (void );
00324 static void yy_map_header_load_buffer_state (void );
00325 static void yy_map_header_init_buffer (YY_BUFFER_STATE b,FILE *file  );
00326 
00327 #define YY_FLUSH_BUFFER yy_map_header_flush_buffer(YY_CURRENT_BUFFER )
00328 
00329 YY_BUFFER_STATE yy_map_header_scan_buffer (char *base,yy_size_t size  );
00330 YY_BUFFER_STATE yy_map_header_scan_string (yyconst char *yy_str  );
00331 YY_BUFFER_STATE yy_map_header_scan_bytes (yyconst char *bytes,int len  );
00332 
00333 void *yy_map_headeralloc (yy_size_t  );
00334 void *yy_map_headerrealloc (void *,yy_size_t  );
00335 void yy_map_headerfree (void *  );
00336 
00337 #define yy_new_buffer yy_map_header_create_buffer
00338 
00339 #define yy_set_interactive(is_interactive) \
00340     { \
00341     if ( ! YY_CURRENT_BUFFER ){ \
00342         yy_map_headerensure_buffer_stack (); \
00343         YY_CURRENT_BUFFER_LVALUE =    \
00344             yy_map_header_create_buffer(yy_map_headerin,YY_BUF_SIZE ); \
00345     } \
00346     YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00347     }
00348 
00349 #define yy_set_bol(at_bol) \
00350     { \
00351     if ( ! YY_CURRENT_BUFFER ){\
00352         yy_map_headerensure_buffer_stack (); \
00353         YY_CURRENT_BUFFER_LVALUE =    \
00354             yy_map_header_create_buffer(yy_map_headerin,YY_BUF_SIZE ); \
00355     } \
00356     YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00357     }
00358 
00359 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00360 
00361 /* Begin user sect3 */
00362 
00363 #define yy_map_headerwrap(n) 1
00364 #define YY_SKIP_YYWRAP
00365 
00366 typedef unsigned char YY_CHAR;
00367 
00368 FILE *yy_map_headerin = (FILE *) 0, *yy_map_headerout = (FILE *) 0;
00369 
00370 typedef int yy_state_type;
00371 
00372 extern int yy_map_headerlineno;
00373 
00374 int yy_map_headerlineno = 1;
00375 
00376 extern char *yy_map_headertext;
00377 #define yytext_ptr yy_map_headertext
00378 
00379 static yy_state_type yy_get_previous_state (void );
00380 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
00381 static int yy_get_next_buffer (void );
00382 static void yy_fatal_error (yyconst char msg[]  );
00383 
00384 /* Done after the current pattern has been matched and before the
00385  * corresponding action - sets up yy_map_headertext.
00386  */
00387 #define YY_DO_BEFORE_ACTION \
00388     (yytext_ptr) = yy_bp; \
00389     yy_map_headerleng = (size_t) (yy_cp - yy_bp); \
00390     (yy_hold_char) = *yy_cp; \
00391     *yy_cp = '\0'; \
00392     (yy_c_buf_p) = yy_cp;
00393 
00394 #define YY_NUM_RULES 33
00395 #define YY_END_OF_BUFFER 34
00396 /* This struct is not used in this scanner,
00397    but its presence is necessary. */
00398 struct yy_trans_info
00399     {
00400     flex_int32_t yy_verify;
00401     flex_int32_t yy_nxt;
00402     };
00403 static yyconst flex_int16_t yy_accept[280] =
00404     {   0,
00405        32,   32,   28,   28,   34,   32,   29,   32,   32,   32,
00406        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00407        32,   32,   32,   32,   28,   28,   28,   32,   32,   30,
00408        32,   29,   32,   32,   32,   32,   32,   32,   32,   32,
00409        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00410        32,   28,   28,   28,   28,   32,   32,   32,   32,   32,
00411        32,   32,   32,   26,   32,   32,   32,   32,   32,   32,
00412        32,   32,   32,   32,   32,   32,   28,   32,   32,   32,
00413        31,   32,   32,   32,   32,   26,   32,   32,   32,   32,
00414        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00415 
00416        32,   28,   32,   32,   32,   32,   32,   32,   32,   32,
00417        32,   32,   32,   32,   32,   32,   32,   21,   21,   32,
00418        32,   32,   32,   32,   32,   32,   28,   32,   32,   32,
00419        32,   32,   32,   32,    1,    1,   32,   32,   32,   32,
00420        32,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00421        27,   32,   32,   32,   32,   32,   32,   32,   32,   13,
00422        13,   32,   32,   32,   32,   32,   32,   32,   32,   32,
00423        32,   32,   32,   32,    7,    7,   27,   32,   32,   32,
00424        32,   32,   32,   32,    8,    8,   32,   32,   32,   32,
00425        32,   32,   32,    4,    4,   32,   32,   32,   23,   23,
00426 
00427        32,   32,   32,   32,    5,    5,    6,    6,   32,   32,
00428        17,   17,   32,   32,   14,   14,   32,   22,   22,   32,
00429        32,   32,   32,    3,    3,    2,    2,   12,   12,   32,
00430        32,   32,   15,   15,   32,   32,   32,   32,   32,   32,
00431        32,   32,   32,   16,   16,   18,   18,   32,   32,   10,
00432        10,   32,   11,   11,   32,   32,   32,   32,   32,   19,
00433        19,   32,   32,   32,   25,   25,   32,   32,   32,   32,
00434        32,    9,    9,   32,   20,   20,   24,   24,    0
00435     } ;
00436 
00437 static yyconst flex_int32_t yy_ec[256] =
00438     {   0,
00439         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00440         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00441         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00442         1,    2,    1,    1,    4,    5,    1,    1,    1,    1,
00443         1,    1,    1,    1,    1,    1,    1,    1,    6,    6,
00444         6,    6,    6,    6,    6,    6,    1,    1,    1,    1,
00445         1,    1,    1,    1,    7,    8,    9,   10,   11,   12,
00446        13,   14,   15,    1,   16,   17,   18,   19,   20,   21,
00447        22,   23,   24,   25,   26,   27,   28,   29,   30,    1,
00448         1,    1,    1,   31,   32,    1,   33,   34,   35,   36,
00449 
00450        37,   38,   39,   40,   41,    1,   42,   43,   44,   45,
00451        46,   47,   48,   49,   50,   51,   52,   53,   54,   55,
00452        56,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00453         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00454         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00455         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00456         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00457         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00458         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00459         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00460 
00461         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00462         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00463         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00464         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00465         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00466         1,    1,    1,    1,    1
00467     } ;
00468 
00469 static yyconst flex_int32_t yy_meta[57] =
00470     {   0,
00471         1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
00472         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00473         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00474         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00475         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00476         1,    1,    1,    1,    1,    1
00477     } ;
00478 
00479 static yyconst flex_int16_t yy_base[310] =
00480     {   0,
00481         0,   31,   85,   86,  508,    0,  509,  504,    0,   79,
00482        86,   75,   80,   85,   83,   75,   93,   76,   87,   92,
00483        77,   91,   88,   97,    0,    4,   90,    0,  503,  509,
00484         5,    0,  473,   87,   99,  131,  113,  128,  131,  132,
00485       128,  472,  122,  141,  128,  137,  144,  135,  138,  147,
00486       145,    0,    6,    0,  147,  140,  143,  148,  500,  151,
00487       152,  151,  151,  500,  155,  179,  184,  165,  499,  181,
00488       187,  178,  190,  180,  179,  180,  188,  181,  189,  194,
00489       509,  187,  201,  198,  188,  498,  497,  207,  208,  193,
00490       236,  198,  234,  496,  226,  222,  465,  464,  222,  235,
00491 
00492       236,  227,  228,  242,  245,  463,  462,  230,  491,  490,
00493       233,  244,  243,  232,  242,  241,  240,    0,  489,  245,
00494       458,  240,  245,  256,  257,  487,  257,  280,  273,  272,
00495       270,  284,  486,  485,    0,  484,  284,  288,  293,  294,
00496       288,  285,  453,  482,  284,  295,  304,  481,  289,  480,
00497       479,  304,  290,  298,  478,  477,  296,  306,  476,    0,
00498       475,  474,  309,  295,  473,  300,  472,  303,  471,  332,
00499       331,  325,  470,  469,    0,  468,  467,  466,  465,  326,
00500       464,  463,  339,  329,    0,  462,  461,  460,  329,  459,
00501       336,  458,  336,    0,  457,  339,  347,  345,    0,  456,
00502 
00503       455,  454,  453,  330,    0,  452,    0,  451,  346,  351,
00504         0,  450,  449,  448,    0,  447,  446,    0,  445,  414,
00505       352,  443,  412,    0,  441,    0,  440,    0,  439,  438,
00506       345,  340,    0,  437,  436,  435,  342,  347,  434,  429,
00507       424,  422,  343,    0,  421,    0,  420,  362,  344,    0,
00508       419,  418,    0,  417,  416,  356,  345,  349,  415,    0,
00509       414,  381,  390,  413,    0,  412,  391,  411,  410,  409,
00510       408,    0,  407,  406,    0,  405,    0,  404,  509,  428,
00511       430,  404,  432,  403,  402,  216,  114,   90,   89,   29,
00512        28,   27,   26,   25,   24,   23,   22,   21,   20,   19,
00513 
00514        18,   17,   16,   15,   14,   13,   12,   11,    0
00515     } ;
00516 
00517 static yyconst flex_int16_t yy_def[310] =
00518     {   0,
00519       280,  279,  281,  281,  279,  282,  279,  283,  282,  282,
00520       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00521       282,  282,  282,  282,  284,  284,  284,  282,  283,  279,
00522       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00523       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00524       282,  284,  284,  284,  284,  282,  282,  282,  282,  282,
00525       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00526       282,  282,  282,  282,  282,  282,  284,  282,  282,  282,
00527       279,  282,  282,  282,  282,  282,  282,  282,  282,  282,
00528       282,  282,  282,  285,  282,  282,  282,  282,  282,  282,
00529 
00530       282,  284,  282,  282,  282,  282,  282,  282,  282,  286,
00531       282,  282,  282,  282,  282,  282,  282,  285,  285,  282,
00532       282,  282,  282,  282,  282,  282,  284,  282,  282,  282,
00533       282,  282,  282,  287,  286,  286,  282,  282,  282,  282,
00534       282,  282,  282,  282,  282,  282,  282,  282,  282,  288,
00535       284,  282,  282,  282,  282,  282,  282,  282,  289,  287,
00536       287,  282,  282,  282,  282,  282,  282,  282,  290,  282,
00537       282,  282,  291,  282,  288,  288,  284,  282,  282,  282,
00538       292,  293,  282,  282,  289,  289,  294,  282,  282,  295,
00539       282,  296,  282,  290,  290,  282,  282,  282,  291,  291,
00540 
00541       297,  298,  299,  282,  292,  292,  293,  293,  282,  282,
00542       294,  294,  300,  282,  295,  295,  282,  296,  296,  282,
00543       282,  282,  282,  297,  297,  298,  298,  299,  299,  282,
00544       282,  282,  300,  300,  301,  302,  282,  282,  303,  282,
00545       304,  282,  282,  301,  301,  302,  302,  282,  282,  303,
00546       303,  282,  304,  304,  305,  282,  282,  282,  306,  305,
00547       305,  282,  282,  282,  306,  306,  282,  282,  307,  282,
00548       308,  307,  307,  309,  308,  308,  309,  309,    0,  279,
00549       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00550       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00551 
00552       279,  279,  279,  279,  279,  279,  279,  279,  279
00553     } ;
00554 
00555 static yyconst flex_int16_t yy_nxt[566] =
00556     {   0,
00557       277,   31,    7,    8,   32,   53,   31,   53,   54,   32,
00558        54,  275,  272,  265,  260,  253,  250,  246,  244,  233,
00559       228,  226,  224,  218,  215,  211,  207,  205,  199,  194,
00560         9,    6,    6,    7,    8,    6,    6,    6,   10,    6,
00561        11,   12,   13,    6,   14,    6,    6,   15,   16,   17,
00562        18,   19,    6,   20,   21,   22,   23,    6,   24,    6,
00563         6,    9,    6,    6,   10,    6,   11,   12,   13,    6,
00564        14,    6,    6,   15,   16,   17,   18,   19,    6,   20,
00565        21,   22,   23,    6,   24,    6,    6,    7,    7,  185,
00566       175,   33,   34,   36,   37,   38,   27,   39,   40,   41,
00567 
00568        35,   43,   46,   44,   47,   48,   49,   50,   55,   57,
00569        58,   51,   42,   45,  160,   26,   26,   33,   34,   36,
00570        37,   38,   27,   39,   40,   41,   35,   43,   46,   44,
00571        47,   48,   49,   50,   55,   57,   58,   51,   42,   45,
00572        59,   61,   62,   63,   64,   65,   67,   68,   69,   70,
00573        72,   73,   74,   75,   76,   60,   77,   78,   79,   80,
00574        71,   82,   83,   84,   85,   87,   59,   61,   62,   63,
00575        64,   65,   67,   68,   69,   70,   72,   73,   74,   75,
00576        76,   60,   77,   78,   79,   80,   71,   82,   83,   84,
00577        85,   87,   88,   92,   93,   95,   89,   96,   97,   90,
00578 
00579        98,   99,   91,  100,  101,  102,  103,  104,  105,  106,
00580       107,  108,  109,  111,  112,  113,  135,  116,   88,   92,
00581        93,   95,   89,   96,   97,   90,   98,   99,   91,  100,
00582       101,  102,  103,  104,  105,  106,  107,  108,  109,  111,
00583       112,  113,  114,  116,  117,  120,  121,  124,  125,  126,
00584       127,  128,  129,  130,  133,  137,  138,  139,  140,  141,
00585       142,  115,  143,  144,  146,  147,  148,  149,  114,  151,
00586       117,  120,  121,  124,  125,  126,  127,  128,  129,  130,
00587       133,  137,  138,  139,  140,  141,  142,  115,  143,  144,
00588       146,  147,  148,  149,  152,  151,  153,  154,  155,  156,
00589 
00590       157,  162,  163,  164,  165,  166,  158,  167,  170,  171,
00591       172,  174,  178,  179,  180,  183,  184,  188,  189,  191,
00592       152,  193,  153,  154,  155,  156,  157,  162,  163,  164,
00593       165,  166,  158,  167,  170,  171,  172,  174,  178,  179,
00594       180,  183,  184,  188,  189,  191,  196,  193,  197,  198,
00595       204,  209,  210,  214,  217,  220,  221,  222,  223,  230,
00596       231,  232,  238,  242,  243,  248,  249,  256,  257,  258,
00597       262,  263,  196,  264,  197,  198,  204,  209,  210,  214,
00598       217,  220,  221,  222,  223,  230,  231,  232,  238,  242,
00599       243,  248,  249,  256,  257,  258,  262,  263,  267,  264,
00600 
00601       268,  270,  118,   52,   28,  278,  276,  278,  273,  276,
00602       274,  273,  271,  266,  269,  261,  266,  261,  254,  259,
00603       251,  247,  245,  255,  267,  254,  268,  270,    6,    6,
00604        25,   25,   29,   29,  252,  251,  247,  245,  234,  241,
00605       229,  227,  225,  240,  239,  237,  219,  236,  216,  235,
00606       234,  212,  208,  206,  229,  227,  225,  200,  195,  219,
00607       216,  213,  212,  186,  208,  206,  203,  202,  177,  176,
00608       201,  200,  195,  192,  190,  187,  161,  186,  182,  181,
00609       177,  176,  173,  169,  168,  136,  161,  159,  150,  145,
00610       119,  136,  134,  132,  131,  123,  122,  119,  110,   86,
00611 
00612        94,   86,   81,   66,   56,   30,   30,  279,    5,  279,
00613       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00614       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00615       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00616       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00617       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00618       279,  279,  279,  279,  279
00619     } ;
00620 
00621 static yyconst flex_int16_t yy_chk[566] =
00622     {   0,
00623       309,    9,    1,    1,    9,   26,   31,   53,   26,   31,
00624        53,  308,  307,  306,  305,  304,  303,  302,  301,  300,
00625       299,  298,  297,  296,  295,  294,  293,  292,  291,  290,
00626         1,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00627         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00628         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00629         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00630         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
00631         2,    2,    2,    2,    2,    2,    2,    3,    4,  289,
00632       288,   10,   11,   12,   13,   14,    4,   15,   16,   17,
00633 
00634        11,   18,   20,   19,   21,   22,   23,   24,   27,   34,
00635        35,   24,   17,   19,  287,    3,    4,   10,   11,   12,
00636        13,   14,    4,   15,   16,   17,   11,   18,   20,   19,
00637        21,   22,   23,   24,   27,   34,   35,   24,   17,   19,
00638        36,   37,   38,   39,   40,   41,   43,   44,   45,   46,
00639        47,   48,   49,   50,   51,   36,   55,   56,   57,   58,
00640        46,   60,   61,   62,   63,   65,   36,   37,   38,   39,
00641        40,   41,   43,   44,   45,   46,   47,   48,   49,   50,
00642        51,   36,   55,   56,   57,   58,   46,   60,   61,   62,
00643        63,   65,   66,   67,   68,   70,   66,   71,   72,   66,
00644 
00645        73,   74,   66,   75,   76,   77,   78,   79,   80,   82,
00646        83,   84,   85,   88,   89,   90,  286,   92,   66,   67,
00647        68,   70,   66,   71,   72,   66,   73,   74,   66,   75,
00648        76,   77,   78,   79,   80,   82,   83,   84,   85,   88,
00649        89,   90,   91,   92,   93,   95,   96,   99,  100,  101,
00650       102,  103,  104,  105,  108,  111,  112,  113,  114,  115,
00651       116,   91,  117,  120,  122,  123,  124,  125,   91,  127,
00652        93,   95,   96,   99,  100,  101,  102,  103,  104,  105,
00653       108,  111,  112,  113,  114,  115,  116,   91,  117,  120,
00654       122,  123,  124,  125,  128,  127,  129,  130,  131,  131,
00655 
00656       132,  137,  138,  139,  140,  141,  132,  142,  145,  146,
00657       147,  149,  152,  153,  154,  157,  158,  163,  164,  166,
00658       128,  168,  129,  130,  131,  131,  132,  137,  138,  139,
00659       140,  141,  132,  142,  145,  146,  147,  149,  152,  153,
00660       154,  157,  158,  163,  164,  166,  170,  168,  171,  172,
00661       180,  183,  184,  189,  191,  193,  196,  197,  198,  204,
00662       209,  210,  221,  231,  232,  237,  238,  243,  248,  249,
00663       256,  257,  170,  258,  171,  172,  180,  183,  184,  189,
00664       191,  193,  196,  197,  198,  204,  209,  210,  221,  231,
00665       232,  237,  238,  243,  248,  249,  256,  257,  262,  258,
00666 
00667       263,  267,  285,  284,  282,  278,  276,  274,  273,  271,
00668       270,  269,  268,  266,  264,  261,  259,  255,  254,  252,
00669       251,  247,  245,  242,  262,  241,  263,  267,  280,  280,
00670       281,  281,  283,  283,  240,  239,  236,  235,  234,  230,
00671       229,  227,  225,  223,  222,  220,  219,  217,  216,  214,
00672       213,  212,  208,  206,  203,  202,  201,  200,  195,  192,
00673       190,  188,  187,  186,  182,  181,  179,  178,  177,  176,
00674       174,  173,  169,  167,  165,  162,  161,  159,  156,  155,
00675       151,  150,  148,  144,  143,  136,  134,  133,  126,  121,
00676       119,  110,  109,  107,  106,   98,   97,   94,   87,   86,
00677 
00678        69,   64,   59,   42,   33,   29,    8,    5,  279,  279,
00679       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00680       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00681       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00682       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00683       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
00684       279,  279,  279,  279,  279
00685     } ;
00686 
00687 static yy_state_type yy_last_accepting_state;
00688 static char *yy_last_accepting_cpos;
00689 
00690 extern int yy_map_header_flex_debug;
00691 int yy_map_header_flex_debug = 0;
00692 
00693 /* The intent behind this definition is that it'll catch
00694  * any uses of REJECT which flex missed.
00695  */
00696 #define REJECT reject_used_but_not_detected
00697 #define yymore() yymore_used_but_not_detected
00698 #define YY_MORE_ADJ 0
00699 #define YY_RESTORE_YY_MORE_OFFSET
00700 char *yy_map_headertext;
00701 #line 1 "src/loaders/map_header.l"
00702 #line 2 "src/loaders/map_header.l"
00703 /************************************************************************
00704 *            Atrinik, a Multiplayer Online Role Playing Game            *
00705 *                                                                       *
00706 *    Copyright (C) 2009-2011 Alex Tokar and Atrinik Development Team    *
00707 *                                                                       *
00708 * Fork from Daimonin (Massive Multiplayer Online Role Playing Game)     *
00709 * and Crossfire (Multiplayer game for X-windows).                       *
00710 *                                                                       *
00711 * This program is free software; you can redistribute it and/or modify  *
00712 * it under the terms of the GNU General Public License as published by  *
00713 * the Free Software Foundation; either version 2 of the License, or     *
00714 * (at your option) any later version.                                   *
00715 *                                                                       *
00716 * This program is distributed in the hope that it will be useful,       *
00717 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00718 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00719 * GNU General Public License for more details.                          *
00720 *                                                                       *
00721 * You should have received a copy of the GNU General Public License     *
00722 * along with this program; if not, write to the Free Software           *
00723 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             *
00724 *                                                                       *
00725 * The author can be reached at admin@atrinik.org                        *
00726 ************************************************************************/
00727 
00728 #include <global.h>
00729 #include <loader.h>
00730 
00731 #define YY_DECL int map_lex_load(mapstruct *m)
00732 
00733 static char *yval();
00734 
00735 static char msgbuf[HUGE_BUF];
00736 static int lex_error, msg_flag;
00737 
00738 #define IVAL atoi(yval())
00739 
00740 #define SET_OR_CLEAR_MAP_FLAG(m, flag, val) \
00741 { \
00742     if (val) \
00743     { \
00744         m->map_flags |= (flag); \
00745     } \
00746     else \
00747     { \
00748         m->map_flags &= ~(flag); \
00749     } \
00750 }
00751 
00752 #define YY_NO_INPUT
00753 
00754 /* Don't have to link with -lfl with this */
00755 /* Disable unput */
00756 /* Disable tt_top_state */
00757 /* need yy_push_state, yy_pop_state */
00758 #line 759 "src/loaders/map_header.c"
00759 
00760 #define INITIAL 0
00761 #define MESSAGE 1
00762 
00763 #ifndef YY_NO_UNISTD_H
00764 /* Special case for "unistd.h", since it is non-ANSI. We include it way
00765  * down here because we want the user's section 1 to have been scanned first.
00766  * The user has a chance to override it with an option.
00767  */
00768 #include <unistd.h>
00769 #endif
00770 
00771 #ifndef YY_EXTRA_TYPE
00772 #define YY_EXTRA_TYPE void *
00773 #endif
00774 
00775 static int yy_init_globals (void );
00776 
00777 /* Accessor methods to globals.
00778    These are made visible to non-reentrant scanners for convenience. */
00779 
00780 int yy_map_headerlex_destroy (void );
00781 
00782 int yy_map_headerget_debug (void );
00783 
00784 void yy_map_headerset_debug (int debug_flag  );
00785 
00786 YY_EXTRA_TYPE yy_map_headerget_extra (void );
00787 
00788 void yy_map_headerset_extra (YY_EXTRA_TYPE user_defined  );
00789 
00790 FILE *yy_map_headerget_in (void );
00791 
00792 void yy_map_headerset_in  (FILE * in_str  );
00793 
00794 FILE *yy_map_headerget_out (void );
00795 
00796 void yy_map_headerset_out  (FILE * out_str  );
00797 
00798 int yy_map_headerget_leng (void );
00799 
00800 char *yy_map_headerget_text (void );
00801 
00802 int yy_map_headerget_lineno (void );
00803 
00804 void yy_map_headerset_lineno (int line_number  );
00805 
00806 /* Macros after this point can all be overridden by user definitions in
00807  * section 1.
00808  */
00809 
00810 #ifndef YY_SKIP_YYWRAP
00811 #ifdef __cplusplus
00812 extern "C" int yy_map_headerwrap (void );
00813 #else
00814 extern int yy_map_headerwrap (void );
00815 #endif
00816 #endif
00817 
00818 #ifndef yytext_ptr
00819 static void yy_flex_strncpy (char *,yyconst char *,int );
00820 #endif
00821 
00822 #ifdef YY_NEED_STRLEN
00823 static int yy_flex_strlen (yyconst char * );
00824 #endif
00825 
00826 #ifndef YY_NO_INPUT
00827 
00828 #ifdef __cplusplus
00829 static int yyinput (void );
00830 #else
00831 static int input (void );
00832 #endif
00833 
00834 #endif
00835 
00836         static int yy_start_stack_ptr = 0;
00837         static int yy_start_stack_depth = 0;
00838         static int *yy_start_stack = NULL;
00839     
00840     static void yy_push_state (int new_state );
00841     
00842     static void yy_pop_state (void );
00843     
00844 /* Amount of stuff to slurp up with each read. */
00845 #ifndef YY_READ_BUF_SIZE
00846 #ifdef __ia64__
00847 /* On IA-64, the buffer size is 16k, not 8k */
00848 #define YY_READ_BUF_SIZE 16384
00849 #else
00850 #define YY_READ_BUF_SIZE 8192
00851 #endif /* __ia64__ */
00852 #endif
00853 
00854 /* Copy whatever the last rule matched to the standard output. */
00855 #ifndef ECHO
00856 /* This used to be an fputs(), but since the string might contain NUL's,
00857  * we now use fwrite().
00858  */
00859 #define ECHO do { if (fwrite( yy_map_headertext, yy_map_headerleng, 1, yy_map_headerout )) {} } while (0)
00860 #endif
00861 
00862 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
00863  * is returned in "result".
00864  */
00865 #ifndef YY_INPUT
00866 #define YY_INPUT(buf,result,max_size) \
00867     if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
00868         { \
00869         int c = '*'; \
00870         size_t n; \
00871         for ( n = 0; n < max_size && \
00872                  (c = getc( yy_map_headerin )) != EOF && c != '\n'; ++n ) \
00873             buf[n] = (char) c; \
00874         if ( c == '\n' ) \
00875             buf[n++] = (char) c; \
00876         if ( c == EOF && ferror( yy_map_headerin ) ) \
00877             YY_FATAL_ERROR( "input in flex scanner failed" ); \
00878         result = n; \
00879         } \
00880     else \
00881         { \
00882         errno=0; \
00883         while ( (result = fread(buf, 1, max_size, yy_map_headerin))==0 && ferror(yy_map_headerin)) \
00884             { \
00885             if( errno != EINTR) \
00886                 { \
00887                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
00888                 break; \
00889                 } \
00890             errno=0; \
00891             clearerr(yy_map_headerin); \
00892             } \
00893         }\
00894 \
00895 
00896 #endif
00897 
00898 /* No semi-colon after return; correct usage is to write "yyterminate();" -
00899  * we don't want an extra ';' after the "return" because that will cause
00900  * some compilers to complain about unreachable statements.
00901  */
00902 #ifndef yyterminate
00903 #define yyterminate() return YY_NULL
00904 #endif
00905 
00906 /* Number of entries by which start-condition stack grows. */
00907 #ifndef YY_START_STACK_INCR
00908 #define YY_START_STACK_INCR 25
00909 #endif
00910 
00911 /* Report a fatal error. */
00912 #ifndef YY_FATAL_ERROR
00913 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
00914 #endif
00915 
00916 /* end tables serialization structures and prototypes */
00917 
00918 /* Default declaration of generated scanner - a define so the user can
00919  * easily add parameters.
00920  */
00921 #ifndef YY_DECL
00922 #define YY_DECL_IS_OURS 1
00923 
00924 extern int yy_map_headerlex (void);
00925 
00926 #define YY_DECL int yy_map_headerlex (void)
00927 #endif /* !YY_DECL */
00928 
00929 /* Code executed at the beginning of each rule, after yy_map_headertext and yy_map_headerleng
00930  * have been set up.
00931  */
00932 #ifndef YY_USER_ACTION
00933 #define YY_USER_ACTION
00934 #endif
00935 
00936 /* Code executed at the end of each rule. */
00937 #ifndef YY_BREAK
00938 #define YY_BREAK break;
00939 #endif
00940 
00941 #define YY_RULE_SETUP \
00942     if ( yy_map_headerleng > 0 ) \
00943         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
00944                 (yy_map_headertext[yy_map_headerleng - 1] == '\n'); \
00945     YY_USER_ACTION
00946 
00949 YY_DECL
00950 {
00951     register yy_state_type yy_current_state;
00952     register char *yy_cp, *yy_bp;
00953     register int yy_act;
00954     
00955 #line 71 "src/loaders/map_header.l"
00956 
00957 
00958 
00959 /* Declare some local variables */
00960 lex_error = 0;
00961 
00962 
00963 #line 964 "src/loaders/map_header.c"
00964 
00965     if ( !(yy_init) )
00966         {
00967         (yy_init) = 1;
00968 
00969 #ifdef YY_USER_INIT
00970         YY_USER_INIT;
00971 #endif
00972 
00973         if ( ! (yy_start) )
00974             (yy_start) = 1; /* first start state */
00975 
00976         if ( ! yy_map_headerin )
00977             yy_map_headerin = stdin;
00978 
00979         if ( ! yy_map_headerout )
00980             yy_map_headerout = stdout;
00981 
00982         if ( ! YY_CURRENT_BUFFER ) {
00983             yy_map_headerensure_buffer_stack ();
00984             YY_CURRENT_BUFFER_LVALUE =
00985                 yy_map_header_create_buffer(yy_map_headerin,YY_BUF_SIZE );
00986         }
00987 
00988         yy_map_header_load_buffer_state( );
00989         }
00990 
00991     while ( 1 )     /* loops until end-of-file is reached */
00992         {
00993         yy_cp = (yy_c_buf_p);
00994 
00995         /* Support of yy_map_headertext. */
00996         *yy_cp = (yy_hold_char);
00997 
00998         /* yy_bp points to the position in yy_ch_buf of the start of
00999          * the current run.
01000          */
01001         yy_bp = yy_cp;
01002 
01003         yy_current_state = (yy_start);
01004         yy_current_state += YY_AT_BOL();
01005 yy_match:
01006         do
01007             {
01008             register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
01009             if ( yy_accept[yy_current_state] )
01010                 {
01011                 (yy_last_accepting_state) = yy_current_state;
01012                 (yy_last_accepting_cpos) = yy_cp;
01013                 }
01014             while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01015                 {
01016                 yy_current_state = (int) yy_def[yy_current_state];
01017                 if ( yy_current_state >= 280 )
01018                     yy_c = yy_meta[(unsigned int) yy_c];
01019                 }
01020             yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01021             ++yy_cp;
01022             }
01023         while ( yy_base[yy_current_state] != 509 );
01024 
01025 yy_find_action:
01026         yy_act = yy_accept[yy_current_state];
01027         if ( yy_act == 0 )
01028             { /* have to back up */
01029             yy_cp = (yy_last_accepting_cpos);
01030             yy_current_state = (yy_last_accepting_state);
01031             yy_act = yy_accept[yy_current_state];
01032             }
01033 
01034         YY_DO_BEFORE_ACTION;
01035 
01036 do_action:  /* This label is used only to access EOF actions. */
01037 
01038         switch ( yy_act )
01039     { /* beginning of action switch */
01040             case 0: /* must back up */
01041             /* undo the effects of YY_DO_BEFORE_ACTION */
01042             *yy_cp = (yy_hold_char);
01043             yy_cp = (yy_last_accepting_cpos);
01044             yy_current_state = (yy_last_accepting_state);
01045             goto yy_find_action;
01046 
01047 case 1:
01048 YY_RULE_SETUP
01049 #line 78 "src/loaders/map_header.l"
01050 m->name = strdup_local(yval());
01051     YY_BREAK
01052 case 2:
01053 YY_RULE_SETUP
01054 #line 79 "src/loaders/map_header.l"
01055 m->bg_music = strdup_local(yval());
01056     YY_BREAK
01057 case 3:
01058 YY_RULE_SETUP
01059 #line 80 "src/loaders/map_header.l"
01060 m->weather = strdup_local(yval());
01061     YY_BREAK
01062 case 4:
01063 YY_RULE_SETUP
01064 #line 81 "src/loaders/map_header.l"
01065 m->region = get_region_by_name(yval());
01066     YY_BREAK
01067 case 5:
01068 YY_RULE_SETUP
01069 #line 82 "src/loaders/map_header.l"
01070 m->enter_x = IVAL;
01071     YY_BREAK
01072 case 6:
01073 YY_RULE_SETUP
01074 #line 83 "src/loaders/map_header.l"
01075 m->enter_y = IVAL;
01076     YY_BREAK
01077 case 7:
01078 YY_RULE_SETUP
01079 #line 84 "src/loaders/map_header.l"
01080 m->width = IVAL;
01081     YY_BREAK
01082 case 8:
01083 YY_RULE_SETUP
01084 #line 85 "src/loaders/map_header.l"
01085 m->height = IVAL;
01086     YY_BREAK
01087 case 9:
01088 YY_RULE_SETUP
01089 #line 87 "src/loaders/map_header.l"
01090 m->reset_timeout = IVAL;
01091     YY_BREAK
01092 case 10:
01093 YY_RULE_SETUP
01094 #line 88 "src/loaders/map_header.l"
01095 m->swap_time = IVAL;
01096     YY_BREAK
01097 case 11:
01098 YY_RULE_SETUP
01099 #line 89 "src/loaders/map_header.l"
01100 m->difficulty = IVAL;
01101     YY_BREAK
01102 case 12:
01103 YY_RULE_SETUP
01104 #line 90 "src/loaders/map_header.l"
01105 {
01106                         int v = IVAL;
01107 
01108                         if (v < -1 || v > MAX_DARKNESS)
01109                         {
01110                             LOG(llevBug, "Illegal map darkness %d (must be -1 to %d, defaulting to -1).\n", v, MAX_DARKNESS);
01111                         }
01112                         else
01113                         {
01114                             set_map_darkness(m, v);
01115                         }
01116                      }
01117     YY_BREAK
01118 case 13:
01119 YY_RULE_SETUP
01120 #line 102 "src/loaders/map_header.l"
01121 m->light_value = IVAL;
01122     YY_BREAK
01123 case 14:
01124 YY_RULE_SETUP
01125 #line 103 "src/loaders/map_header.l"
01126 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_NO_SAVE, IVAL);
01127     YY_BREAK
01128 case 15:
01129 YY_RULE_SETUP
01130 #line 104 "src/loaders/map_header.l"
01131 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_NOMAGIC, IVAL);
01132     YY_BREAK
01133 case 16:
01134 YY_RULE_SETUP
01135 #line 105 "src/loaders/map_header.l"
01136 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_NOPRIEST, IVAL);
01137     YY_BREAK
01138 case 17:
01139 YY_RULE_SETUP
01140 #line 106 "src/loaders/map_header.l"
01141 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_NOHARM, IVAL);
01142     YY_BREAK
01143 case 18:
01144 YY_RULE_SETUP
01145 #line 107 "src/loaders/map_header.l"
01146 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_NOSUMMON, IVAL);
01147     YY_BREAK
01148 case 19:
01149 YY_RULE_SETUP
01150 #line 108 "src/loaders/map_header.l"
01151 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_FIXED_LOGIN, IVAL);
01152     YY_BREAK
01153 case 20:
01154 YY_RULE_SETUP
01155 #line 109 "src/loaders/map_header.l"
01156 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_PLAYER_NO_SAVE, IVAL);
01157     YY_BREAK
01158 case 21:
01159 YY_RULE_SETUP
01160 #line 110 "src/loaders/map_header.l"
01161 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_PVP, IVAL);
01162     YY_BREAK
01163 case 22:
01164 YY_RULE_SETUP
01165 #line 111 "src/loaders/map_header.l"
01166 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_OUTDOOR, IVAL);
01167     YY_BREAK
01168 case 23:
01169 YY_RULE_SETUP
01170 #line 112 "src/loaders/map_header.l"
01171 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_UNIQUE, IVAL);
01172     YY_BREAK
01173 case 24:
01174 YY_RULE_SETUP
01175 #line 113 "src/loaders/map_header.l"
01176 SET_OR_CLEAR_MAP_FLAG(m, MAP_FLAG_FIXED_RTIME, IVAL);
01177     YY_BREAK
01178 case 25:
01179 YY_RULE_SETUP
01180 #line 114 "src/loaders/map_header.l"
01181 {
01182                         int tile = atoi(yy_map_headertext + 10);
01183 
01184                         if (tile < 1 || tile > TILED_MAPS)
01185                         {
01186                             LOG(llevBug, "load_map_header(): Tile location %d out of bounds (%s)\n", tile, m->path);
01187                         }
01188                         else
01189                         {
01190                             char *value = yval(), path[HUGE_BUF];
01191 
01192                             if (m->tile_path[tile - 1])
01193                             {
01194                                 LOG(llevBug, "load_map_header(): Tile location %d duplicated (%s <-> %s)\n", tile, m->path, m->tile_path[tile - 1]);
01195                                 FREE_AND_CLEAR_HASH(m->tile_path[tile - 1]);
01196                             }
01197 
01198                             /* If path is not absolute, try to normalize it */
01199                             if (check_path(value, 1) == -1)
01200                             {
01201                                 normalize_path(m->path, value, path);
01202 
01203                                 if (check_path(path, 1) == -1)
01204                                 {
01205                                     LOG(llevBug, "load_map_header(): Can not normalize tile path %s %s %s\n", m->path, value, msgbuf);
01206                                     value = NULL;
01207                                 }
01208                                 else
01209                                 {
01210                                     value = path;
01211                                 }
01212                             }
01213 
01214                             /* We have a correct path to a neighbor tile */
01215                             if (value)
01216                             {
01217                                 mapstruct *neighbor;
01218                                 shstr *path_sh = add_string(value);
01219 
01220                                 m->tile_path[tile - 1] = path_sh;
01221 
01222                                 /* If the neighboring map tile has been loaded, set up the map pointers */
01223                                 if ((neighbor = has_been_loaded_sh(path_sh)) && (neighbor->in_memory == MAP_IN_MEMORY || neighbor->in_memory == MAP_LOADING))
01224                                 {
01225                                     int dest_tile = map_tiled_reverse[tile - 1];
01226 
01227                                     m->tile_map[tile - 1] = neighbor;
01228 
01229                                     if (neighbor->tile_path[dest_tile] == NULL || neighbor->tile_path[dest_tile] == m->path)
01230                                     {
01231                                         neighbor->tile_map[dest_tile] = m;
01232                                     }
01233                                 }
01234                             }
01235                         }
01236                      }
01237     YY_BREAK
01238 case 26:
01239 YY_RULE_SETUP
01240 #line 170 "src/loaders/map_header.l"
01241 {
01242                         BEGIN(MESSAGE);
01243                         msgbuf[0] = '\0';
01244                         msg_flag = 0;
01245                      }
01246     YY_BREAK
01247 case 27:
01248 YY_RULE_SETUP
01249 #line 175 "src/loaders/map_header.l"
01250 {
01251                         BEGIN(INITIAL);
01252 
01253                         m->msg = strdup_local(msgbuf);
01254                      }
01255     YY_BREAK
01256 case 28:
01257 YY_RULE_SETUP
01258 #line 180 "src/loaders/map_header.l"
01259 {
01260                         if (msg_flag)
01261                         {
01262                             strcat(msgbuf, "\n");
01263                         }
01264 
01265                         msg_flag = 1;
01266                         strcat(msgbuf, yy_map_headertext);
01267                      }
01268     YY_BREAK
01269 case 29:
01270 /* rule 29 can match eol */
01271 YY_RULE_SETUP
01272 #line 190 "src/loaders/map_header.l"
01273 {/* ignore empty lines, newlines we don't do above */}
01274     YY_BREAK
01275 case 30:
01276 /* rule 30 can match eol */
01277 YY_RULE_SETUP
01278 #line 191 "src/loaders/map_header.l"
01279 {}
01280     YY_BREAK
01281 case 31:
01282 /* rule 31 can match eol */
01283 YY_RULE_SETUP
01284 #line 192 "src/loaders/map_header.l"
01285 return LL_EOF;
01286     YY_BREAK
01287 case YY_STATE_EOF(INITIAL):
01288 case YY_STATE_EOF(MESSAGE):
01289 #line 194 "src/loaders/map_header.l"
01290 {
01291                         return LL_MORE;
01292                      }
01293     YY_BREAK
01294 case 32:
01295 YY_RULE_SETUP
01296 #line 198 "src/loaders/map_header.l"
01297 {
01298                         LOG(llevBug, "Got unknown value in map header: %s\n", yy_map_headertext);
01299                         return LL_NORMAL;
01300                      }
01301     YY_BREAK
01302 case 33:
01303 YY_RULE_SETUP
01304 #line 203 "src/loaders/map_header.l"
01305 ECHO;
01306     YY_BREAK
01307 #line 1308 "src/loaders/map_header.c"
01308 
01309     case YY_END_OF_BUFFER:
01310         {
01311         /* Amount of text matched not including the EOB char. */
01312         int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
01313 
01314         /* Undo the effects of YY_DO_BEFORE_ACTION. */
01315         *yy_cp = (yy_hold_char);
01316         YY_RESTORE_YY_MORE_OFFSET
01317 
01318         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
01319             {
01320             /* We're scanning a new file or input source.  It's
01321              * possible that this happened because the user
01322              * just pointed yy_map_headerin at a new source and called
01323              * yy_map_headerlex().  If so, then we have to assure
01324              * consistency between YY_CURRENT_BUFFER and our
01325              * globals.  Here is the right place to do so, because
01326              * this is the first action (other than possibly a
01327              * back-up) that will match for the new input source.
01328              */
01329             (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01330             YY_CURRENT_BUFFER_LVALUE->yy_input_file = yy_map_headerin;
01331             YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
01332             }
01333 
01334         /* Note that here we test for yy_c_buf_p "<=" to the position
01335          * of the first EOB in the buffer, since yy_c_buf_p will
01336          * already have been incremented past the NUL character
01337          * (since all states make transitions on EOB to the
01338          * end-of-buffer state).  Contrast this with the test
01339          * in input().
01340          */
01341         if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01342             { /* This was really a NUL. */
01343             yy_state_type yy_next_state;
01344 
01345             (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
01346 
01347             yy_current_state = yy_get_previous_state(  );
01348 
01349             /* Okay, we're now positioned to make the NUL
01350              * transition.  We couldn't have
01351              * yy_get_previous_state() go ahead and do it
01352              * for us because it doesn't know how to deal
01353              * with the possibility of jamming (and we don't
01354              * want to build jamming into it because then it
01355              * will run more slowly).
01356              */
01357 
01358             yy_next_state = yy_try_NUL_trans( yy_current_state );
01359 
01360             yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01361 
01362             if ( yy_next_state )
01363                 {
01364                 /* Consume the NUL. */
01365                 yy_cp = ++(yy_c_buf_p);
01366                 yy_current_state = yy_next_state;
01367                 goto yy_match;
01368                 }
01369 
01370             else
01371                 {
01372                 yy_cp = (yy_c_buf_p);
01373                 goto yy_find_action;
01374                 }
01375             }
01376 
01377         else switch ( yy_get_next_buffer(  ) )
01378             {
01379             case EOB_ACT_END_OF_FILE:
01380                 {
01381                 (yy_did_buffer_switch_on_eof) = 0;
01382 
01383                 if ( yy_map_headerwrap( ) )
01384                     {
01385                     /* Note: because we've taken care in
01386                      * yy_get_next_buffer() to have set up
01387                      * yy_map_headertext, we can now set up
01388                      * yy_c_buf_p so that if some total
01389                      * hoser (like flex itself) wants to
01390                      * call the scanner after we return the
01391                      * YY_NULL, it'll still work - another
01392                      * YY_NULL will get returned.
01393                      */
01394                     (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
01395 
01396                     yy_act = YY_STATE_EOF(YY_START);
01397                     goto do_action;
01398                     }
01399 
01400                 else
01401                     {
01402                     if ( ! (yy_did_buffer_switch_on_eof) )
01403                         YY_NEW_FILE;
01404                     }
01405                 break;
01406                 }
01407 
01408             case EOB_ACT_CONTINUE_SCAN:
01409                 (yy_c_buf_p) =
01410                     (yytext_ptr) + yy_amount_of_matched_text;
01411 
01412                 yy_current_state = yy_get_previous_state(  );
01413 
01414                 yy_cp = (yy_c_buf_p);
01415                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01416                 goto yy_match;
01417 
01418             case EOB_ACT_LAST_MATCH:
01419                 (yy_c_buf_p) =
01420                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
01421 
01422                 yy_current_state = yy_get_previous_state(  );
01423 
01424                 yy_cp = (yy_c_buf_p);
01425                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
01426                 goto yy_find_action;
01427             }
01428         break;
01429         }
01430 
01431     default:
01432         YY_FATAL_ERROR(
01433             "fatal flex scanner internal error--no action found" );
01434     } /* end of action switch */
01435         } /* end of scanning one token */
01436 } /* end of yy_map_headerlex */
01437 
01438 /* yy_get_next_buffer - try to read in a new buffer
01439  *
01440  * Returns a code representing an action:
01441  *  EOB_ACT_LAST_MATCH -
01442  *  EOB_ACT_CONTINUE_SCAN - continue scanning from current position
01443  *  EOB_ACT_END_OF_FILE - end of file
01444  */
01445 static int yy_get_next_buffer (void)
01446 {
01447         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
01448     register char *source = (yytext_ptr);
01449     register int number_to_move, i;
01450     int ret_val;
01451 
01452     if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
01453         YY_FATAL_ERROR(
01454         "fatal flex scanner internal error--end of buffer missed" );
01455 
01456     if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
01457         { /* Don't try to fill the buffer, so this is an EOF. */
01458         if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
01459             {
01460             /* We matched a single character, the EOB, so
01461              * treat this as a final EOF.
01462              */
01463             return EOB_ACT_END_OF_FILE;
01464             }
01465 
01466         else
01467             {
01468             /* We matched some text prior to the EOB, first
01469              * process it.
01470              */
01471             return EOB_ACT_LAST_MATCH;
01472             }
01473         }
01474 
01475     /* Try to read more data. */
01476 
01477     /* First move last chars to start of buffer. */
01478     number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
01479 
01480     for ( i = 0; i < number_to_move; ++i )
01481         *(dest++) = *(source++);
01482 
01483     if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
01484         /* don't do the read, it's not guaranteed to return an EOF,
01485          * just force an EOF
01486          */
01487         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
01488 
01489     else
01490         {
01491             int num_to_read =
01492             YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
01493 
01494         while ( num_to_read <= 0 )
01495             { /* Not enough room in the buffer - grow it. */
01496 
01497             /* just a shorter name for the current buffer */
01498             YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
01499 
01500             int yy_c_buf_p_offset =
01501                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
01502 
01503             if ( b->yy_is_our_buffer )
01504                 {
01505                 int new_size = b->yy_buf_size * 2;
01506 
01507                 if ( new_size <= 0 )
01508                     b->yy_buf_size += b->yy_buf_size / 8;
01509                 else
01510                     b->yy_buf_size *= 2;
01511 
01512                 b->yy_ch_buf = (char *)
01513                     /* Include room in for 2 EOB chars. */
01514                     yy_map_headerrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
01515                 }
01516             else
01517                 /* Can't grow it, we don't own it. */
01518                 b->yy_ch_buf = 0;
01519 
01520             if ( ! b->yy_ch_buf )
01521                 YY_FATAL_ERROR(
01522                 "fatal error - scanner input buffer overflow" );
01523 
01524             (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
01525 
01526             num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
01527                         number_to_move - 1;
01528 
01529             }
01530 
01531         if ( num_to_read > YY_READ_BUF_SIZE )
01532             num_to_read = YY_READ_BUF_SIZE;
01533 
01534         /* Read in more data. */
01535         YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
01536             (yy_n_chars), (size_t) num_to_read );
01537 
01538         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01539         }
01540 
01541     if ( (yy_n_chars) == 0 )
01542         {
01543         if ( number_to_move == YY_MORE_ADJ )
01544             {
01545             ret_val = EOB_ACT_END_OF_FILE;
01546             yy_map_headerrestart(yy_map_headerin  );
01547             }
01548 
01549         else
01550             {
01551             ret_val = EOB_ACT_LAST_MATCH;
01552             YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
01553                 YY_BUFFER_EOF_PENDING;
01554             }
01555         }
01556 
01557     else
01558         ret_val = EOB_ACT_CONTINUE_SCAN;
01559 
01560     if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
01561         /* Extend the array by 50%, plus the number we really need. */
01562         yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
01563         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yy_map_headerrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
01564         if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
01565             YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
01566     }
01567 
01568     (yy_n_chars) += number_to_move;
01569     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
01570     YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
01571 
01572     (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
01573 
01574     return ret_val;
01575 }
01576 
01577 /* yy_get_previous_state - get the state just before the EOB char was reached */
01578 
01579     static yy_state_type yy_get_previous_state (void)
01580 {
01581     register yy_state_type yy_current_state;
01582     register char *yy_cp;
01583     
01584     yy_current_state = (yy_start);
01585     yy_current_state += YY_AT_BOL();
01586 
01587     for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
01588         {
01589         register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
01590         if ( yy_accept[yy_current_state] )
01591             {
01592             (yy_last_accepting_state) = yy_current_state;
01593             (yy_last_accepting_cpos) = yy_cp;
01594             }
01595         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01596             {
01597             yy_current_state = (int) yy_def[yy_current_state];
01598             if ( yy_current_state >= 280 )
01599                 yy_c = yy_meta[(unsigned int) yy_c];
01600             }
01601         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01602         }
01603 
01604     return yy_current_state;
01605 }
01606 
01607 /* yy_try_NUL_trans - try to make a transition on the NUL character
01608  *
01609  * synopsis
01610  *  next_state = yy_try_NUL_trans( current_state );
01611  */
01612     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
01613 {
01614     register int yy_is_jam;
01615         register char *yy_cp = (yy_c_buf_p);
01616 
01617     register YY_CHAR yy_c = 1;
01618     if ( yy_accept[yy_current_state] )
01619         {
01620         (yy_last_accepting_state) = yy_current_state;
01621         (yy_last_accepting_cpos) = yy_cp;
01622         }
01623     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01624         {
01625         yy_current_state = (int) yy_def[yy_current_state];
01626         if ( yy_current_state >= 280 )
01627             yy_c = yy_meta[(unsigned int) yy_c];
01628         }
01629     yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01630     yy_is_jam = (yy_current_state == 279);
01631 
01632     return yy_is_jam ? 0 : yy_current_state;
01633 }
01634 
01635 #ifndef YY_NO_INPUT
01636 #ifdef __cplusplus
01637     static int yyinput (void)
01638 #else
01639     static int input  (void)
01640 #endif
01641 
01642 {
01643     int c;
01644     
01645     *(yy_c_buf_p) = (yy_hold_char);
01646 
01647     if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
01648         {
01649         /* yy_c_buf_p now points to the character we want to return.
01650          * If this occurs *before* the EOB characters, then it's a
01651          * valid NUL; if not, then we've hit the end of the buffer.
01652          */
01653         if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
01654             /* This was really a NUL. */
01655             *(yy_c_buf_p) = '\0';
01656 
01657         else
01658             { /* need more input */
01659             int offset = (yy_c_buf_p) - (yytext_ptr);
01660             ++(yy_c_buf_p);
01661 
01662             switch ( yy_get_next_buffer(  ) )
01663                 {
01664                 case EOB_ACT_LAST_MATCH:
01665                     /* This happens because yy_g_n_b()
01666                      * sees that we've accumulated a
01667                      * token and flags that we need to
01668                      * try matching the token before
01669                      * proceeding.  But for input(),
01670                      * there's no matching to consider.
01671                      * So convert the EOB_ACT_LAST_MATCH
01672                      * to EOB_ACT_END_OF_FILE.
01673                      */
01674 
01675                     /* Reset buffer status. */
01676                     yy_map_headerrestart(yy_map_headerin );
01677 
01678                     /*FALLTHROUGH*/
01679 
01680                 case EOB_ACT_END_OF_FILE:
01681                     {
01682                     if ( yy_map_headerwrap( ) )
01683                         return EOF;
01684 
01685                     if ( ! (yy_did_buffer_switch_on_eof) )
01686                         YY_NEW_FILE;
01687 #ifdef __cplusplus
01688                     return yyinput();
01689 #else
01690                     return input();
01691 #endif
01692                     }
01693 
01694                 case EOB_ACT_CONTINUE_SCAN:
01695                     (yy_c_buf_p) = (yytext_ptr) + offset;
01696                     break;
01697                 }
01698             }
01699         }
01700 
01701     c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
01702     *(yy_c_buf_p) = '\0';   /* preserve yy_map_headertext */
01703     (yy_hold_char) = *++(yy_c_buf_p);
01704 
01705     YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
01706 
01707     return c;
01708 }
01709 #endif  /* ifndef YY_NO_INPUT */
01710 
01716     void yy_map_headerrestart  (FILE * input_file )
01717 {
01718     
01719     if ( ! YY_CURRENT_BUFFER ){
01720         yy_map_headerensure_buffer_stack ();
01721         YY_CURRENT_BUFFER_LVALUE =
01722             yy_map_header_create_buffer(yy_map_headerin,YY_BUF_SIZE );
01723     }
01724 
01725     yy_map_header_init_buffer(YY_CURRENT_BUFFER,input_file );
01726     yy_map_header_load_buffer_state( );
01727 }
01728 
01733     void yy_map_header_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
01734 {
01735     
01736     /* TODO. We should be able to replace this entire function body
01737      * with
01738      *      yy_map_headerpop_buffer_state();
01739      *      yy_map_headerpush_buffer_state(new_buffer);
01740      */
01741     yy_map_headerensure_buffer_stack ();
01742     if ( YY_CURRENT_BUFFER == new_buffer )
01743         return;
01744 
01745     if ( YY_CURRENT_BUFFER )
01746         {
01747         /* Flush out information for old buffer. */
01748         *(yy_c_buf_p) = (yy_hold_char);
01749         YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01750         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01751         }
01752 
01753     YY_CURRENT_BUFFER_LVALUE = new_buffer;
01754     yy_map_header_load_buffer_state( );
01755 
01756     /* We don't actually know whether we did this switch during
01757      * EOF (yy_map_headerwrap()) processing, but the only time this flag
01758      * is looked at is after yy_map_headerwrap() is called, so it's safe
01759      * to go ahead and always set it.
01760      */
01761     (yy_did_buffer_switch_on_eof) = 1;
01762 }
01763 
01764 static void yy_map_header_load_buffer_state  (void)
01765 {
01766         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
01767     (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
01768     yy_map_headerin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
01769     (yy_hold_char) = *(yy_c_buf_p);
01770 }
01771 
01778     YY_BUFFER_STATE yy_map_header_create_buffer  (FILE * file, int  size )
01779 {
01780     YY_BUFFER_STATE b;
01781     
01782     b = (YY_BUFFER_STATE) yy_map_headeralloc(sizeof( struct yy_buffer_state )  );
01783     if ( ! b )
01784         YY_FATAL_ERROR( "out of dynamic memory in yy_map_header_create_buffer()" );
01785 
01786     b->yy_buf_size = size;
01787 
01788     /* yy_ch_buf has to be 2 characters longer than the size given because
01789      * we need to put in 2 end-of-buffer characters.
01790      */
01791     b->yy_ch_buf = (char *) yy_map_headeralloc(b->yy_buf_size + 2  );
01792     if ( ! b->yy_ch_buf )
01793         YY_FATAL_ERROR( "out of dynamic memory in yy_map_header_create_buffer()" );
01794 
01795     b->yy_is_our_buffer = 1;
01796 
01797     yy_map_header_init_buffer(b,file );
01798 
01799     return b;
01800 }
01801 
01806     void yy_map_header_delete_buffer (YY_BUFFER_STATE  b )
01807 {
01808     
01809     if ( ! b )
01810         return;
01811 
01812     if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
01813         YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
01814 
01815     if ( b->yy_is_our_buffer )
01816         yy_map_headerfree((void *) b->yy_ch_buf  );
01817 
01818     yy_map_headerfree((void *) b  );
01819 }
01820 
01821 #ifndef __cplusplus
01822 extern int isatty (int );
01823 #endif /* __cplusplus */
01824     
01825 /* Initializes or reinitializes a buffer.
01826  * This function is sometimes called more than once on the same buffer,
01827  * such as during a yy_map_headerrestart() or at EOF.
01828  */
01829     static void yy_map_header_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
01830 
01831 {
01832     int oerrno = errno;
01833     
01834     yy_map_header_flush_buffer(b );
01835 
01836     b->yy_input_file = file;
01837     b->yy_fill_buffer = 1;
01838 
01839     /* If b is the current buffer, then yy_map_header_init_buffer was _probably_
01840      * called from yy_map_headerrestart() or through yy_get_next_buffer.
01841      * In that case, we don't want to reset the lineno or column.
01842      */
01843     if (b != YY_CURRENT_BUFFER){
01844         b->yy_bs_lineno = 1;
01845         b->yy_bs_column = 0;
01846     }
01847 
01848         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
01849     
01850     errno = oerrno;
01851 }
01852 
01857     void yy_map_header_flush_buffer (YY_BUFFER_STATE  b )
01858 {
01859         if ( ! b )
01860         return;
01861 
01862     b->yy_n_chars = 0;
01863 
01864     /* We always need two end-of-buffer characters.  The first causes
01865      * a transition to the end-of-buffer state.  The second causes
01866      * a jam in that state.
01867      */
01868     b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
01869     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
01870 
01871     b->yy_buf_pos = &b->yy_ch_buf[0];
01872 
01873     b->yy_at_bol = 1;
01874     b->yy_buffer_status = YY_BUFFER_NEW;
01875 
01876     if ( b == YY_CURRENT_BUFFER )
01877         yy_map_header_load_buffer_state( );
01878 }
01879 
01886 void yy_map_headerpush_buffer_state (YY_BUFFER_STATE new_buffer )
01887 {
01888         if (new_buffer == NULL)
01889         return;
01890 
01891     yy_map_headerensure_buffer_stack();
01892 
01893     /* This block is copied from yy_map_header_switch_to_buffer. */
01894     if ( YY_CURRENT_BUFFER )
01895         {
01896         /* Flush out information for old buffer. */
01897         *(yy_c_buf_p) = (yy_hold_char);
01898         YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
01899         YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
01900         }
01901 
01902     /* Only push if top exists. Otherwise, replace top. */
01903     if (YY_CURRENT_BUFFER)
01904         (yy_buffer_stack_top)++;
01905     YY_CURRENT_BUFFER_LVALUE = new_buffer;
01906 
01907     /* copied from yy_map_header_switch_to_buffer. */
01908     yy_map_header_load_buffer_state( );
01909     (yy_did_buffer_switch_on_eof) = 1;
01910 }
01911 
01916 void yy_map_headerpop_buffer_state (void)
01917 {
01918         if (!YY_CURRENT_BUFFER)
01919         return;
01920 
01921     yy_map_header_delete_buffer(YY_CURRENT_BUFFER );
01922     YY_CURRENT_BUFFER_LVALUE = NULL;
01923     if ((yy_buffer_stack_top) > 0)
01924         --(yy_buffer_stack_top);
01925 
01926     if (YY_CURRENT_BUFFER) {
01927         yy_map_header_load_buffer_state( );
01928         (yy_did_buffer_switch_on_eof) = 1;
01929     }
01930 }
01931 
01932 /* Allocates the stack if it does not exist.
01933  *  Guarantees space for at least one push.
01934  */
01935 static void yy_map_headerensure_buffer_stack (void)
01936 {
01937     int num_to_alloc;
01938     
01939     if (!(yy_buffer_stack)) {
01940 
01941         /* First allocation is just for 2 elements, since we don't know if this
01942          * scanner will even need a stack. We use 2 instead of 1 to avoid an
01943          * immediate realloc on the next call.
01944          */
01945         num_to_alloc = 1;
01946         (yy_buffer_stack) = (struct yy_buffer_state**)yy_map_headeralloc
01947                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
01948                                 );
01949         if ( ! (yy_buffer_stack) )
01950             YY_FATAL_ERROR( "out of dynamic memory in yy_map_headerensure_buffer_stack()" );
01951                                   
01952         memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
01953                 
01954         (yy_buffer_stack_max) = num_to_alloc;
01955         (yy_buffer_stack_top) = 0;
01956         return;
01957     }
01958 
01959     if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
01960 
01961         /* Increase the buffer to prepare for a possible push. */
01962         int grow_size = 8 /* arbitrary grow size */;
01963 
01964         num_to_alloc = (yy_buffer_stack_max) + grow_size;
01965         (yy_buffer_stack) = (struct yy_buffer_state**)yy_map_headerrealloc
01966                                 ((yy_buffer_stack),
01967                                 num_to_alloc * sizeof(struct yy_buffer_state*)
01968                                 );
01969         if ( ! (yy_buffer_stack) )
01970             YY_FATAL_ERROR( "out of dynamic memory in yy_map_headerensure_buffer_stack()" );
01971 
01972         /* zero only the new slots.*/
01973         memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
01974         (yy_buffer_stack_max) = num_to_alloc;
01975     }
01976 }
01977 
01984 YY_BUFFER_STATE yy_map_header_scan_buffer  (char * base, yy_size_t  size )
01985 {
01986     YY_BUFFER_STATE b;
01987     
01988     if ( size < 2 ||
01989          base[size-2] != YY_END_OF_BUFFER_CHAR ||
01990          base[size-1] != YY_END_OF_BUFFER_CHAR )
01991         /* They forgot to leave room for the EOB's. */
01992         return 0;
01993 
01994     b = (YY_BUFFER_STATE) yy_map_headeralloc(sizeof( struct yy_buffer_state )  );
01995     if ( ! b )
01996         YY_FATAL_ERROR( "out of dynamic memory in yy_map_header_scan_buffer()" );
01997 
01998     b->yy_buf_size = size - 2;  /* "- 2" to take care of EOB's */
01999     b->yy_buf_pos = b->yy_ch_buf = base;
02000     b->yy_is_our_buffer = 0;
02001     b->yy_input_file = 0;
02002     b->yy_n_chars = b->yy_buf_size;
02003     b->yy_is_interactive = 0;
02004     b->yy_at_bol = 1;
02005     b->yy_fill_buffer = 0;
02006     b->yy_buffer_status = YY_BUFFER_NEW;
02007 
02008     yy_map_header_switch_to_buffer(b  );
02009 
02010     return b;
02011 }
02012 
02021 YY_BUFFER_STATE yy_map_header_scan_string (yyconst char * yystr )
02022 {
02023     
02024     return yy_map_header_scan_bytes(yystr,strlen(yystr) );
02025 }
02026 
02034 YY_BUFFER_STATE yy_map_header_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
02035 {
02036     YY_BUFFER_STATE b;
02037     char *buf;
02038     yy_size_t n;
02039     int i;
02040     
02041     /* Get memory for full buffer, including space for trailing EOB's. */
02042     n = _yybytes_len + 2;
02043     buf = (char *) yy_map_headeralloc(n  );
02044     if ( ! buf )
02045         YY_FATAL_ERROR( "out of dynamic memory in yy_map_header_scan_bytes()" );
02046 
02047     for ( i = 0; i < _yybytes_len; ++i )
02048         buf[i] = yybytes[i];
02049 
02050     buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
02051 
02052     b = yy_map_header_scan_buffer(buf,n );
02053     if ( ! b )
02054         YY_FATAL_ERROR( "bad buffer in yy_map_header_scan_bytes()" );
02055 
02056     /* It's okay to grow etc. this buffer, and we should throw it
02057      * away when we're done.
02058      */
02059     b->yy_is_our_buffer = 1;
02060 
02061     return b;
02062 }
02063 
02064     static void yy_push_state (int  new_state )
02065 {
02066         if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
02067         {
02068         yy_size_t new_size;
02069 
02070         (yy_start_stack_depth) += YY_START_STACK_INCR;
02071         new_size = (yy_start_stack_depth) * sizeof( int );
02072 
02073         if ( ! (yy_start_stack) )
02074             (yy_start_stack) = (int *) yy_map_headeralloc(new_size  );
02075 
02076         else
02077             (yy_start_stack) = (int *) yy_map_headerrealloc((void *) (yy_start_stack),new_size  );
02078 
02079         if ( ! (yy_start_stack) )
02080             YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
02081         }
02082 
02083     (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
02084 
02085     BEGIN(new_state);
02086 }
02087 
02088     static void yy_pop_state  (void)
02089 {
02090         if ( --(yy_start_stack_ptr) < 0 )
02091         YY_FATAL_ERROR( "start-condition stack underflow" );
02092 
02093     BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
02094 }
02095 
02096 #ifndef YY_EXIT_FAILURE
02097 #define YY_EXIT_FAILURE 2
02098 #endif
02099 
02100 static void yy_fatal_error (yyconst char* msg )
02101 {
02102         (void) fprintf( stderr, "%s\n", msg );
02103     exit( YY_EXIT_FAILURE );
02104 }
02105 
02106 /* Redefine yyless() so it works in section 3 code. */
02107 
02108 #undef yyless
02109 #define yyless(n) \
02110     do \
02111         { \
02112         /* Undo effects of setting up yy_map_headertext. */ \
02113         int yyless_macro_arg = (n); \
02114         YY_LESS_LINENO(yyless_macro_arg);\
02115         yy_map_headertext[yy_map_headerleng] = (yy_hold_char); \
02116         (yy_c_buf_p) = yy_map_headertext + yyless_macro_arg; \
02117         (yy_hold_char) = *(yy_c_buf_p); \
02118         *(yy_c_buf_p) = '\0'; \
02119         yy_map_headerleng = yyless_macro_arg; \
02120         } \
02121     while ( 0 )
02122 
02123 /* Accessor  methods (get/set functions) to struct members. */
02124 
02128 int yy_map_headerget_lineno  (void)
02129 {
02130         
02131     return yy_map_headerlineno;
02132 }
02133 
02137 FILE *yy_map_headerget_in  (void)
02138 {
02139         return yy_map_headerin;
02140 }
02141 
02145 FILE *yy_map_headerget_out  (void)
02146 {
02147         return yy_map_headerout;
02148 }
02149 
02153 int yy_map_headerget_leng  (void)
02154 {
02155         return yy_map_headerleng;
02156 }
02157 
02162 char *yy_map_headerget_text  (void)
02163 {
02164         return yy_map_headertext;
02165 }
02166 
02171 void yy_map_headerset_lineno (int  line_number )
02172 {
02173     
02174     yy_map_headerlineno = line_number;
02175 }
02176 
02183 void yy_map_headerset_in (FILE *  in_str )
02184 {
02185         yy_map_headerin = in_str ;
02186 }
02187 
02188 void yy_map_headerset_out (FILE *  out_str )
02189 {
02190         yy_map_headerout = out_str ;
02191 }
02192 
02193 int yy_map_headerget_debug  (void)
02194 {
02195         return yy_map_header_flex_debug;
02196 }
02197 
02198 void yy_map_headerset_debug (int  bdebug )
02199 {
02200         yy_map_header_flex_debug = bdebug ;
02201 }
02202 
02203 static int yy_init_globals (void)
02204 {
02205         /* Initialization is the same as for the non-reentrant scanner.
02206      * This function is called from yy_map_headerlex_destroy(), so don't allocate here.
02207      */
02208 
02209     (yy_buffer_stack) = 0;
02210     (yy_buffer_stack_top) = 0;
02211     (yy_buffer_stack_max) = 0;
02212     (yy_c_buf_p) = (char *) 0;
02213     (yy_init) = 0;
02214     (yy_start) = 0;
02215 
02216     (yy_start_stack_ptr) = 0;
02217     (yy_start_stack_depth) = 0;
02218     (yy_start_stack) =  NULL;
02219 
02220 /* Defined in main.c */
02221 #ifdef YY_STDINIT
02222     yy_map_headerin = stdin;
02223     yy_map_headerout = stdout;
02224 #else
02225     yy_map_headerin = (FILE *) 0;
02226     yy_map_headerout = (FILE *) 0;
02227 #endif
02228 
02229     /* For future reference: Set errno on error, since we are called by
02230      * yy_map_headerlex_init()
02231      */
02232     return 0;
02233 }
02234 
02235 /* yy_map_headerlex_destroy is for both reentrant and non-reentrant scanners. */
02236 int yy_map_headerlex_destroy  (void)
02237 {
02238     
02239     /* Pop the buffer stack, destroying each element. */
02240     while(YY_CURRENT_BUFFER){
02241         yy_map_header_delete_buffer(YY_CURRENT_BUFFER  );
02242         YY_CURRENT_BUFFER_LVALUE = NULL;
02243         yy_map_headerpop_buffer_state();
02244     }
02245 
02246     /* Destroy the stack itself. */
02247     yy_map_headerfree((yy_buffer_stack) );
02248     (yy_buffer_stack) = NULL;
02249 
02250     /* Destroy the start condition stack. */
02251         yy_map_headerfree((yy_start_stack)  );
02252         (yy_start_stack) = NULL;
02253 
02254     /* Reset the globals. This is important in a non-reentrant scanner so the next time
02255      * yy_map_headerlex() is called, initialization will occur. */
02256     yy_init_globals( );
02257 
02258     return 0;
02259 }
02260 
02261 /*
02262  * Internal utility routines.
02263  */
02264 
02265 #ifndef yytext_ptr
02266 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
02267 {
02268     register int i;
02269     for ( i = 0; i < n; ++i )
02270         s1[i] = s2[i];
02271 }
02272 #endif
02273 
02274 #ifdef YY_NEED_STRLEN
02275 static int yy_flex_strlen (yyconst char * s )
02276 {
02277     register int n;
02278     for ( n = 0; s[n]; ++n )
02279         ;
02280 
02281     return n;
02282 }
02283 #endif
02284 
02285 void *yy_map_headeralloc (yy_size_t  size )
02286 {
02287     return (void *) malloc( size );
02288 }
02289 
02290 void *yy_map_headerrealloc  (void * ptr, yy_size_t  size )
02291 {
02292     /* The cast to (char *) in the following accommodates both
02293      * implementations that use char* generic pointers, and those
02294      * that use void* generic pointers.  It works with the latter
02295      * because both ANSI C and C++ allow castless assignment from
02296      * any pointer type to void*, and deal with argument conversions
02297      * as though doing an assignment.
02298      */
02299     return (void *) realloc( (char *) ptr, size );
02300 }
02301 
02302 void yy_map_headerfree (void * ptr )
02303 {
02304     free( (char *) ptr );   /* see yy_map_headerrealloc() for (char *) cast */
02305 }
02306 
02307 #define YYTABLES_NAME "yytables"
02308 
02309 #line 203 "src/loaders/map_header.l"
02310 
02311 
02312 
02321 static char *yval()
02322 {
02323     static char *em = "";
02324     char *cp, *end;
02325 
02326     /* First skip over start of line, like animation or name */
02327     for (cp = yy_map_headertext; *cp != ' '; cp++)
02328     {
02329         if (*cp == '\0')
02330         {
02331             return em;
02332         }
02333     }
02334 
02335     /* Skip over whitespace */
02336     for (; *cp == ' '; cp++)
02337     {
02338         if (*cp == '\0')
02339         {
02340             return em;
02341         }
02342     }
02343 
02344     /* Get last character before null and strip
02345      * off trailing whitespace. */
02346     for (end = cp + strlen(cp) - 1; *end == ' ' || *end == 0x0A || *end == 0x0D; end--)
02347     {
02348         if (end == cp)
02349         {
02350             return em;
02351         }
02352 
02353         *end = '\0';
02354     }
02355 
02356     return cp;
02357 }
02358 
02359 int map_set_variable(mapstruct *m, char *buf)
02360 {
02361     YY_BUFFER_STATE yybufstate, yycurbuf = YY_CURRENT_BUFFER;
02362     int retval;
02363 
02364     yy_push_state(INITIAL);
02365     yybufstate = yy_map_header_scan_string(buf);
02366 
02367     retval = map_lex_load(m);
02368 
02369     if (yycurbuf)
02370     {
02371         yy_map_header_switch_to_buffer(yycurbuf);
02372     }
02373 
02374     yy_map_header_delete_buffer(yybufstate);
02375     yy_pop_state();
02376 
02377     return retval;
02378 }
02379 
02386 int load_map_header(mapstruct *m, FILE *fp)
02387 {
02388     char inbuf[HUGE_BUF];
02389     YY_BUFFER_STATE yybufstate;
02390     int retval;
02391 
02392     if (!fgets(inbuf, sizeof(inbuf) - 1, fp) || strcmp(inbuf, "arch map\n"))
02393     {
02394         LOG(llevBug, "load_map_header(): First line should always be 'arch map', but it is not (%s)\n", m->path);
02395         return 0;
02396     }
02397 
02398     while (fgets(inbuf, sizeof(inbuf) - 1, fp))
02399     {
02400         yybufstate = yy_map_header_scan_string(inbuf);
02401         retval = map_lex_load(m);
02402         yy_map_header_delete_buffer(yybufstate);
02403 
02404         if (retval == LL_ERROR)
02405         {
02406             return 0;
02407         }
02408         else if (retval == LL_EOF)
02409         {
02410             return 1;
02411         }
02412     }
02413 
02414     return 1;
02415 }
02416 
02417 void save_map_header(mapstruct *m, FILE *fp, int flag)
02418 {
02419     int i;
02420 
02421     fprintf(fp, "arch map\n");
02422 
02423     if (m->name)
02424     {
02425         fprintf(fp, "name %s\n", m->name);
02426     }
02427 
02428     if (m->bg_music)
02429     {
02430         fprintf(fp, "bg_music %s\n", m->bg_music);
02431     }
02432 
02433     if (m->weather)
02434     {
02435         fprintf(fp, "weather %s\n", m->weather);
02436     }
02437 
02438     if (m->region)
02439     {
02440         fprintf(fp, "region %s\n", m->region->name);
02441     }
02442 
02443     if (!flag)
02444     {
02445         fprintf(fp, "swap_time %d\n", m->swap_time);
02446     }
02447 
02448     if (m->reset_timeout)
02449     {
02450         fprintf(fp, "reset_timeout %d\n", m->reset_timeout);
02451     }
02452 
02453     if (MAP_FIXED_RESETTIME(m))
02454     {
02455         fprintf(fp, "fixed_resettime 1\n");
02456     }
02457 
02458     if (m->difficulty)
02459     {
02460         fprintf(fp, "difficulty %d\n", m->difficulty);
02461     }
02462 
02463     fprintf(fp, "darkness %d\n", m->darkness);
02464     fprintf(fp, "light %d\n", m->light_value);
02465 
02466     if (m->width)
02467     {
02468         fprintf(fp, "width %d\n", m->width);
02469     }
02470 
02471     if (m->height)
02472     {
02473         fprintf(fp, "height %d\n", m->height);
02474     }
02475 
02476     if (m->enter_x)
02477     {
02478         fprintf(fp, "enter_x %d\n", m->enter_x);
02479     }
02480 
02481     if (m->enter_y)
02482     {
02483         fprintf(fp, "enter_y %d\n", m->enter_y);
02484     }
02485 
02486     if (m->msg)
02487     {
02488         fprintf(fp, "msg\n%s\nendmsg\n", m->msg);
02489     }
02490 
02491     if (MAP_UNIQUE(m))
02492     {
02493         fprintf(fp, "unique 1\n");
02494     }
02495 
02496     if (MAP_OUTDOORS(m))
02497     {
02498         fprintf(fp, "outdoor 1\n");
02499     }
02500 
02501     if (MAP_NOSAVE(m))
02502     {
02503         fprintf(fp, "no_save 1\n");
02504     }
02505 
02506     if (MAP_NOMAGIC(m))
02507     {
02508         fprintf(fp, "no_magic 1\n");
02509     }
02510 
02511     if (MAP_NOPRIEST(m))
02512     {
02513         fprintf(fp, "no_priest 1\n");
02514     }
02515 
02516     if (MAP_NOHARM(m))
02517     {
02518         fprintf(fp, "no_harm 1\n");
02519     }
02520 
02521     if (MAP_NOSUMMON(m))
02522     {
02523         fprintf(fp, "no_summon 1\n");
02524     }
02525 
02526     if (MAP_FIXEDLOGIN(m))
02527     {
02528         fprintf(fp, "fixed_login 1\n");
02529     }
02530 
02531     if (MAP_PVP(m))
02532     {
02533         fprintf(fp, "pvp 1\n");
02534     }
02535 
02536     /* Save any tiling information */
02537     for (i = 0; i < TILED_MAPS; i++)
02538     {
02539         if (m->tile_path[i])
02540         {
02541             fprintf(fp, "tile_path_%d %s\n", i + 1, m->tile_path[i]);
02542         }
02543     }
02544 
02545     fprintf(fp, "end\n");
02546 }
02547