LCOV - differential code coverage report
Current view: top level - src/include/common - kwlookup.h (source / functions) Coverage Total Hit CBC
Current: Differential Code Coverage 16@8cea358b128 vs 17@8cea358b128 Lines: 100.0 % 2 2 2
Current Date: 2024-04-14 14:21:10 Functions: 100.0 % 1 1 1
Baseline: 16@8cea358b128 Branches: - 0 0
Baseline Date: 2024-04-14 14:21:09 Line coverage date bins:
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed (240..) days: 100.0 % 2 2 2
Function coverage date bins:
(240..) days: 100.0 % 1 1 1

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*-------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * kwlookup.h
                                  4                 :                :  *    Key word lookup for PostgreSQL
                                  5                 :                :  *
                                  6                 :                :  *
                                  7                 :                :  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
                                  8                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  9                 :                :  *
                                 10                 :                :  * src/include/common/kwlookup.h
                                 11                 :                :  *
                                 12                 :                :  *-------------------------------------------------------------------------
                                 13                 :                :  */
                                 14                 :                : #ifndef KWLOOKUP_H
                                 15                 :                : #define KWLOOKUP_H
                                 16                 :                : 
                                 17                 :                : /* Hash function used by ScanKeywordLookup */
                                 18                 :                : typedef int (*ScanKeywordHashFunc) (const void *key, size_t keylen);
                                 19                 :                : 
                                 20                 :                : /*
                                 21                 :                :  * This struct contains the data needed by ScanKeywordLookup to perform a
                                 22                 :                :  * search within a set of keywords.  The contents are typically generated by
                                 23                 :                :  * src/tools/gen_keywordlist.pl from a header containing PG_KEYWORD macros.
                                 24                 :                :  */
                                 25                 :                : typedef struct ScanKeywordList
                                 26                 :                : {
                                 27                 :                :     const char *kw_string;      /* all keywords in order, separated by \0 */
                                 28                 :                :     const uint16 *kw_offsets;   /* offsets to the start of each keyword */
                                 29                 :                :     ScanKeywordHashFunc hash;   /* perfect hash function for keywords */
                                 30                 :                :     int         num_keywords;   /* number of keywords */
                                 31                 :                :     int         max_kw_len;     /* length of longest keyword */
                                 32                 :                : } ScanKeywordList;
                                 33                 :                : 
                                 34                 :                : 
                                 35                 :                : extern int  ScanKeywordLookup(const char *str, const ScanKeywordList *keywords);
                                 36                 :                : 
                                 37                 :                : /* Code that wants to retrieve the text of the N'th keyword should use this. */
                                 38                 :                : static inline const char *
 1925 tgl@sss.pgh.pa.us          39                 :CBC     5851316 : GetScanKeyword(int n, const ScanKeywordList *keywords)
                                 40                 :                : {
                                 41                 :        5851316 :     return keywords->kw_string + keywords->kw_offsets[n];
                                 42                 :                : }
                                 43                 :                : 
                                 44                 :                : #endif                          /* KWLOOKUP_H */
        

Generated by: LCOV version 2.1-beta2-3-g6141622