LCOV - code coverage report
Current view: top level - src/interfaces/ecpg/preproc - c_kwlist_d.h (source / functions) Hit Total Coverage
Test: PostgreSQL 17devel Lines: 9 9 100.0 %
Date: 2024-03-28 21:11:01 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * c_kwlist_d.h
       4             :  *    List of keywords represented as a ScanKeywordList.
       5             :  *
       6             :  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
       7             :  * Portions Copyright (c) 1994, Regents of the University of California
       8             :  *
       9             :  * NOTES
      10             :  *  ******************************
      11             :  *  *** DO NOT EDIT THIS FILE! ***
      12             :  *  ******************************
      13             :  *
      14             :  *  It has been GENERATED by src/tools/gen_keywordlist.pl
      15             :  *
      16             :  *-------------------------------------------------------------------------
      17             :  */
      18             : 
      19             : #ifndef C_KWLIST_D_H
      20             : #define C_KWLIST_D_H
      21             : 
      22             : #include "common/kwlookup.h"
      23             : 
      24             : static const char ScanCKeywords_kw_string[] =
      25             :     "VARCHAR\0"
      26             :     "auto\0"
      27             :     "bool\0"
      28             :     "char\0"
      29             :     "const\0"
      30             :     "enum\0"
      31             :     "extern\0"
      32             :     "float\0"
      33             :     "hour\0"
      34             :     "int\0"
      35             :     "long\0"
      36             :     "minute\0"
      37             :     "month\0"
      38             :     "register\0"
      39             :     "second\0"
      40             :     "short\0"
      41             :     "signed\0"
      42             :     "static\0"
      43             :     "struct\0"
      44             :     "to\0"
      45             :     "typedef\0"
      46             :     "union\0"
      47             :     "unsigned\0"
      48             :     "varchar\0"
      49             :     "volatile\0"
      50             :     "year";
      51             : 
      52             : static const uint16 ScanCKeywords_kw_offsets[] = {
      53             :     0,
      54             :     8,
      55             :     13,
      56             :     18,
      57             :     23,
      58             :     29,
      59             :     34,
      60             :     41,
      61             :     47,
      62             :     52,
      63             :     56,
      64             :     61,
      65             :     68,
      66             :     74,
      67             :     83,
      68             :     90,
      69             :     96,
      70             :     103,
      71             :     110,
      72             :     117,
      73             :     120,
      74             :     128,
      75             :     134,
      76             :     143,
      77             :     151,
      78             :     160,
      79             : };
      80             : 
      81             : #define SCANCKEYWORDS_NUM_KEYWORDS 26
      82             : 
      83             : static int
      84       17198 : ScanCKeywords_hash_func(const void *key, size_t keylen)
      85             : {
      86             :     static const int8 h[53] = {
      87             :         -5,    0,     127,   -9,    0,     127,   127,   3,
      88             :         127,   15,    127,   127,   127,   127,   11,    16,
      89             :         1,     0,     6,     16,    9,     5,     127,   0,
      90             :         127,   20,    24,    -5,    5,     18,    5,     18,
      91             :         2,     127,   127,   127,   20,    127,   -17,   0,
      92             :         127,   2,     127,   6,     127,   -10,   12,    19,
      93             :         0,     0,     0,     127,   0
      94             :     };
      95             : 
      96       17198 :     const unsigned char *k = (const unsigned char *) key;
      97       17198 :     uint32      a = 0;
      98       17198 :     uint32      b = 0;
      99             : 
     100       87478 :     while (keylen--)
     101             :     {
     102       70280 :         unsigned char c = *k++;
     103             : 
     104       70280 :         a = a * 257 + c;
     105       70280 :         b = b * 17 + c;
     106             :     }
     107       17198 :     return h[a % 53] + h[b % 53];
     108             : }
     109             : 
     110             : static const ScanKeywordList ScanCKeywords = {
     111             :     ScanCKeywords_kw_string,
     112             :     ScanCKeywords_kw_offsets,
     113             :     ScanCKeywords_hash_func,
     114             :     SCANCKEYWORDS_NUM_KEYWORDS,
     115             :     8
     116             : };
     117             : 
     118             : #endif                          /* C_KWLIST_D_H */

Generated by: LCOV version 1.14