~ubuntu-branches/ubuntu/karmic/gimp/karmic-security

« back to all changes in this revision

Viewing changes to plug-ins/imagemap/imap_ncsa_lex.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20081006133041-axco233xt49jobn7
Tags: 2.6.0-1ubuntu1
* Sync on debian and new version (lp: #276839)
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch:
  - updated some strings for ubuntu
* debian/rules:
  - updated translation templates

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
/* A lexical scanner generated by flex */
7
7
 
 
8
#define yy_create_buffer ncsa__create_buffer
 
9
#define yy_delete_buffer ncsa__delete_buffer
 
10
#define yy_flex_debug ncsa__flex_debug
 
11
#define yy_init_buffer ncsa__init_buffer
 
12
#define yy_flush_buffer ncsa__flush_buffer
 
13
#define yy_load_buffer_state ncsa__load_buffer_state
 
14
#define yy_switch_to_buffer ncsa__switch_to_buffer
 
15
#define yyin ncsa_in
 
16
#define yyleng ncsa_leng
 
17
#define yylex ncsa_lex
 
18
#define yylineno ncsa_lineno
 
19
#define yyout ncsa_out
 
20
#define yyrestart ncsa_restart
 
21
#define yytext ncsa_text
 
22
#define yywrap ncsa_wrap
 
23
#define yyalloc ncsa_alloc
 
24
#define yyrealloc ncsa_realloc
 
25
#define yyfree ncsa_free
 
26
 
8
27
#define FLEX_SCANNER
9
28
#define YY_FLEX_MAJOR_VERSION 2
10
29
#define YY_FLEX_MINOR_VERSION 5
33
52
#if __STDC_VERSION__ >= 199901L
34
53
 
35
54
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36
 
 * if you want the limit (max/min) macros for int types. 
 
55
 * if you want the limit (max/min) macros for int types.
37
56
 */
38
57
#ifndef __STDC_LIMIT_MACROS
39
58
#define __STDC_LIMIT_MACROS 1
50
69
typedef signed char flex_int8_t;
51
70
typedef short int flex_int16_t;
52
71
typedef int flex_int32_t;
53
 
typedef unsigned char flex_uint8_t; 
 
72
typedef unsigned char flex_uint8_t;
54
73
typedef unsigned short int flex_uint16_t;
55
74
typedef unsigned int flex_uint32_t;
56
75
#endif /* ! C99 */
160
179
#define EOB_ACT_LAST_MATCH 2
161
180
 
162
181
    #define YY_LESS_LINENO(n)
163
 
    
 
182
 
164
183
/* Return all but the first "n" matched characters back to the input stream. */
165
184
#define yyless(n) \
166
185
        do \
227
246
 
228
247
    int yy_bs_lineno; /**< The line count. */
229
248
    int yy_bs_column; /**< The column count. */
230
 
    
 
249
 
231
250
        /* Whether to try to fill the input buffer when we reach the
232
251
         * end of it.
233
252
         */
335
354
 
336
355
/* Begin user sect3 */
337
356
 
338
 
#define ncsa_wrap() 1
 
357
#define ncsa_wrap(n) 1
339
358
#define YY_SKIP_YYWRAP
340
359
 
341
360
typedef unsigned char YY_CHAR;
541
560
 
542
561
 
543
562
 
544
 
#line 545 "<stdout>"
 
563
#line 564 "<stdout>"
545
564
 
546
565
#define INITIAL 0
547
566
#define imap_link 1
574
593
#endif
575
594
 
576
595
    static void yyunput (int c,char *buf_ptr  );
577
 
    
 
596
 
578
597
#ifndef yytext_ptr
579
598
static void yy_flex_strncpy (char *,yyconst char *,int );
580
599
#endif
695
714
        register yy_state_type yy_current_state;
696
715
        register char *yy_cp, *yy_bp;
697
716
        register int yy_act;
698
 
    
 
717
 
699
718
#line 46 "imap_ncsa.l"
700
719
 
701
720
 
702
 
#line 703 "<stdout>"
 
721
#line 722 "<stdout>"
703
722
 
704
723
        if ( !(yy_init) )
705
724
                {
819
838
#line 68 "imap_ncsa.l"
820
839
{
821
840
                                   BEGIN(INITIAL);
822
 
                                   strcpy(ncsa_lval.id, ncsa_text);
 
841
                                   ncsa_lval.id = g_strndup (ncsa_text, ncsa_leng);
823
842
                                   return COMMENT;
824
843
                                }
825
844
        YY_BREAK
860
879
#line 94 "imap_ncsa.l"
861
880
{
862
881
                                   BEGIN(INITIAL);
863
 
                                   strcpy(ncsa_lval.id, ncsa_text);
864
 
                                   ncsa_lval.id[ncsa_leng - 1] = '\0';
 
882
                                   ncsa_lval.id = g_strndup (ncsa_text, ncsa_leng);
865
883
                                   return LINK;
866
884
                                }
867
885
        YY_BREAK
868
886
case 11:
869
887
YY_RULE_SETUP
870
 
#line 101 "imap_ncsa.l"
 
888
#line 100 "imap_ncsa.l"
871
889
{
872
890
                                   ncsa_lval.value = g_ascii_strtod (ncsa_text, NULL);
873
891
                                   return FLOAT;
876
894
case 12:
877
895
/* rule 12 can match eol */
878
896
YY_RULE_SETUP
879
 
#line 106 "imap_ncsa.l"
 
897
#line 105 "imap_ncsa.l"
880
898
; /* Eat white space */
881
899
        YY_BREAK
882
900
case 13:
883
901
YY_RULE_SETUP
884
 
#line 108 "imap_ncsa.l"
 
902
#line 107 "imap_ncsa.l"
885
903
return *ncsa_text;
886
904
        YY_BREAK
887
905
case 14:
888
906
YY_RULE_SETUP
889
 
#line 110 "imap_ncsa.l"
 
907
#line 109 "imap_ncsa.l"
890
908
ECHO;
891
909
        YY_BREAK
892
 
#line 893 "<stdout>"
 
910
#line 911 "<stdout>"
893
911
case YY_STATE_EOF(INITIAL):
894
912
case YY_STATE_EOF(imap_link):
895
913
case YY_STATE_EOF(comment):
1122
1140
 
1123
1141
                /* Read in more data. */
1124
1142
                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1125
 
                        (yy_n_chars), (size_t) num_to_read );
 
1143
                        (yy_n_chars), num_to_read );
1126
1144
 
1127
1145
                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1128
1146
                }
1161
1179
{
1162
1180
        register yy_state_type yy_current_state;
1163
1181
        register char *yy_cp;
1164
 
    
 
1182
 
1165
1183
        yy_current_state = (yy_start);
1166
1184
 
1167
1185
        for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1215
1233
    static void yyunput (int c, register char * yy_bp )
1216
1234
{
1217
1235
        register char *yy_cp;
1218
 
    
 
1236
 
1219
1237
    yy_cp = (yy_c_buf_p);
1220
1238
 
1221
1239
        /* undo effects of setting up ncsa_text */
1258
1276
 
1259
1277
{
1260
1278
        int c;
1261
 
    
 
1279
 
1262
1280
        *(yy_c_buf_p) = (yy_hold_char);
1263
1281
 
1264
1282
        if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1325
1343
 
1326
1344
/** Immediately switch to a different input stream.
1327
1345
 * @param input_file A readable stream.
1328
 
 * 
 
1346
 *
1329
1347
 * @note This function does not reset the start condition to @c INITIAL .
1330
1348
 */
1331
1349
    void ncsa_restart  (FILE * input_file )
1332
1350
{
1333
 
    
 
1351
 
1334
1352
        if ( ! YY_CURRENT_BUFFER ){
1335
1353
        ncsa_ensure_buffer_stack ();
1336
1354
                YY_CURRENT_BUFFER_LVALUE =
1343
1361
 
1344
1362
/** Switch to a different input buffer.
1345
1363
 * @param new_buffer The new input buffer.
1346
 
 * 
 
1364
 *
1347
1365
 */
1348
1366
    void ncsa__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
1349
1367
{
1350
 
    
 
1368
 
1351
1369
        /* TODO. We should be able to replace this entire function body
1352
1370
         * with
1353
1371
         *              ncsa_pop_buffer_state();
1387
1405
/** Allocate and initialize an input buffer state.
1388
1406
 * @param file A readable stream.
1389
1407
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1390
 
 * 
 
1408
 *
1391
1409
 * @return the allocated buffer state.
1392
1410
 */
1393
1411
    YY_BUFFER_STATE ncsa__create_buffer  (FILE * file, int  size )
1394
1412
{
1395
1413
        YY_BUFFER_STATE b;
1396
 
    
 
1414
 
1397
1415
        b = (YY_BUFFER_STATE) ncsa_alloc(sizeof( struct yy_buffer_state )  );
1398
1416
        if ( ! b )
1399
1417
                YY_FATAL_ERROR( "out of dynamic memory in ncsa__create_buffer()" );
1416
1434
 
1417
1435
/** Destroy the buffer.
1418
1436
 * @param b a buffer created with ncsa__create_buffer()
1419
 
 * 
 
1437
 *
1420
1438
 */
1421
1439
    void ncsa__delete_buffer (YY_BUFFER_STATE  b )
1422
1440
{
1423
 
    
 
1441
 
1424
1442
        if ( ! b )
1425
1443
                return;
1426
1444
 
1436
1454
#ifndef __cplusplus
1437
1455
extern int isatty (int );
1438
1456
#endif /* __cplusplus */
1439
 
    
 
1457
 
1440
1458
/* Initializes or reinitializes a buffer.
1441
1459
 * This function is sometimes called more than once on the same buffer,
1442
1460
 * such as during a ncsa_restart() or at EOF.
1445
1463
 
1446
1464
{
1447
1465
        int oerrno = errno;
1448
 
    
 
1466
 
1449
1467
        ncsa__flush_buffer(b );
1450
1468
 
1451
1469
        b->yy_input_file = file;
1461
1479
    }
1462
1480
 
1463
1481
        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1464
 
    
 
1482
 
1465
1483
        errno = oerrno;
1466
1484
}
1467
1485
 
1468
1486
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1469
1487
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1470
 
 * 
 
1488
 *
1471
1489
 */
1472
1490
    void ncsa__flush_buffer (YY_BUFFER_STATE  b )
1473
1491
{
1496
1514
 *  the current state. This function will allocate the stack
1497
1515
 *  if necessary.
1498
1516
 *  @param new_buffer The new state.
1499
 
 *  
 
1517
 *
1500
1518
 */
1501
1519
void ncsa_push_buffer_state (YY_BUFFER_STATE new_buffer )
1502
1520
{
1526
1544
 
1527
1545
/** Removes and deletes the top of the stack, if present.
1528
1546
 *  The next element becomes the new top.
1529
 
 *  
 
1547
 *
1530
1548
 */
1531
1549
void ncsa_pop_buffer_state (void)
1532
1550
{
1550
1568
static void ncsa_ensure_buffer_stack (void)
1551
1569
{
1552
1570
        int num_to_alloc;
1553
 
    
 
1571
 
1554
1572
        if (!(yy_buffer_stack)) {
1555
1573
 
1556
1574
                /* First allocation is just for 2 elements, since we don't know if this
1561
1579
                (yy_buffer_stack) = (struct yy_buffer_state**)ncsa_alloc
1562
1580
                                                                (num_to_alloc * sizeof(struct yy_buffer_state*)
1563
1581
                                                                );
1564
 
                
 
1582
 
1565
1583
                memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1566
 
                                
 
1584
 
1567
1585
                (yy_buffer_stack_max) = num_to_alloc;
1568
1586
                (yy_buffer_stack_top) = 0;
1569
1587
                return;
1589
1607
/** Setup the input buffer state to scan directly from a user-specified character buffer.
1590
1608
 * @param base the character buffer
1591
1609
 * @param size the size in bytes of the character buffer
1592
 
 * 
1593
 
 * @return the newly allocated buffer state object. 
 
1610
 *
 
1611
 * @return the newly allocated buffer state object.
1594
1612
 */
1595
1613
YY_BUFFER_STATE ncsa__scan_buffer  (char * base, yy_size_t  size )
1596
1614
{
1597
1615
        YY_BUFFER_STATE b;
1598
 
    
 
1616
 
1599
1617
        if ( size < 2 ||
1600
1618
             base[size-2] != YY_END_OF_BUFFER_CHAR ||
1601
1619
             base[size-1] != YY_END_OF_BUFFER_CHAR )
1623
1641
 
1624
1642
/** Setup the input buffer state to scan a string. The next call to ncsa_lex() will
1625
1643
 * scan from a @e copy of @a str.
1626
 
 * @param yystr a NUL-terminated string to scan
1627
 
 * 
 
1644
 * @param str a NUL-terminated string to scan
 
1645
 *
1628
1646
 * @return the newly allocated buffer state object.
1629
1647
 * @note If you want to scan bytes that may contain NUL values, then use
1630
1648
 *       ncsa__scan_bytes() instead.
1631
1649
 */
1632
1650
YY_BUFFER_STATE ncsa__scan_string (yyconst char * yystr )
1633
1651
{
1634
 
    
 
1652
 
1635
1653
        return ncsa__scan_bytes(yystr,strlen(yystr) );
1636
1654
}
1637
1655
 
1639
1657
 * scan from a @e copy of @a bytes.
1640
1658
 * @param bytes the byte buffer to scan
1641
1659
 * @param len the number of bytes in the buffer pointed to by @a bytes.
1642
 
 * 
 
1660
 *
1643
1661
 * @return the newly allocated buffer state object.
1644
1662
 */
1645
1663
YY_BUFFER_STATE ncsa__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
1648
1666
        char *buf;
1649
1667
        yy_size_t n;
1650
1668
        int i;
1651
 
    
 
1669
 
1652
1670
        /* Get memory for full buffer, including space for trailing EOB's. */
1653
1671
        n = _yybytes_len + 2;
1654
1672
        buf = (char *) ncsa_alloc(n  );
1702
1720
/* Accessor  methods (get/set functions) to struct members. */
1703
1721
 
1704
1722
/** Get the current line number.
1705
 
 * 
 
1723
 *
1706
1724
 */
1707
1725
int ncsa_get_lineno  (void)
1708
1726
{
1709
 
        
 
1727
 
1710
1728
    return ncsa_lineno;
1711
1729
}
1712
1730
 
1713
1731
/** Get the input stream.
1714
 
 * 
 
1732
 *
1715
1733
 */
1716
1734
FILE *ncsa_get_in  (void)
1717
1735
{
1719
1737
}
1720
1738
 
1721
1739
/** Get the output stream.
1722
 
 * 
 
1740
 *
1723
1741
 */
1724
1742
FILE *ncsa_get_out  (void)
1725
1743
{
1727
1745
}
1728
1746
 
1729
1747
/** Get the length of the current token.
1730
 
 * 
 
1748
 *
1731
1749
 */
1732
1750
int ncsa_get_leng  (void)
1733
1751
{
1735
1753
}
1736
1754
 
1737
1755
/** Get the current token.
1738
 
 * 
 
1756
 *
1739
1757
 */
1740
1758
 
1741
1759
char *ncsa_get_text  (void)
1745
1763
 
1746
1764
/** Set the current line number.
1747
1765
 * @param line_number
1748
 
 * 
 
1766
 *
1749
1767
 */
1750
1768
void ncsa_set_lineno (int  line_number )
1751
1769
{
1752
 
    
 
1770
 
1753
1771
    ncsa_lineno = line_number;
1754
1772
}
1755
1773
 
1756
1774
/** Set the input stream. This does not discard the current
1757
1775
 * input buffer.
1758
1776
 * @param in_str A readable stream.
1759
 
 * 
 
1777
 *
1760
1778
 * @see ncsa__switch_to_buffer
1761
1779
 */
1762
1780
void ncsa_set_in (FILE *  in_str )
1810
1828
/* ncsa_lex_destroy is for both reentrant and non-reentrant scanners. */
1811
1829
int ncsa_lex_destroy  (void)
1812
1830
{
1813
 
    
 
1831
 
1814
1832
    /* Pop the buffer stack, destroying each element. */
1815
1833
        while(YY_CURRENT_BUFFER){
1816
1834
                ncsa__delete_buffer(YY_CURRENT_BUFFER  );
1877
1895
 
1878
1896
#define YYTABLES_NAME "yytables"
1879
1897
 
1880
 
#line 110 "imap_ncsa.l"
 
1898
#line 109 "imap_ncsa.l"
1881
1899
 
1882
1900
 
1883
1901