LCOV - differential code coverage report
Current view: top level - src/include/tsearch - ts_locale.h (source / functions) Coverage Total Hit CBC
Current: 0e5ff9b9b45a657aea12440478dc002e9b01f138 vs 0123ce131fca454009439dfa3b2266d1d40737d7 Lines: 100.0 % 5 5 5
Current Date: 2026-03-14 14:10:32 -0400 Functions: 100.0 % 2 2 2
Baseline: lcov-20260315-024220-baseline Line coverage date bins:
Baseline Date: 2026-03-14 15:27:56 +0100 (30,360] days: 100.0 % 5 5 5
Legend: Lines:     hit not hit Function coverage date bins:
(30,360] days: 100.0 % 2 2 2

 Age         Owner                  TLA  Line data    Source code
                                  1                 : /*-------------------------------------------------------------------------
                                  2                 :  *
                                  3                 :  * ts_locale.h
                                  4                 :  *      locale compatibility layer for tsearch
                                  5                 :  *
                                  6                 :  * Copyright (c) 1998-2026, PostgreSQL Global Development Group
                                  7                 :  *
                                  8                 :  * src/include/tsearch/ts_locale.h
                                  9                 :  *
                                 10                 :  *-------------------------------------------------------------------------
                                 11                 :  */
                                 12                 : #ifndef __TSLOCALE_H__
                                 13                 : #define __TSLOCALE_H__
                                 14                 : 
                                 15                 : #include <ctype.h>
                                 16                 : #include <limits.h>
                                 17                 : #include <wctype.h>
                                 18                 : 
                                 19                 : #include "lib/stringinfo.h"
                                 20                 : #include "mb/pg_wchar.h"
                                 21                 : #include "utils/pg_locale.h"
                                 22                 : 
                                 23                 : /* working state for tsearch_readline (should be a local var in caller) */
                                 24                 : typedef struct
                                 25                 : {
                                 26                 :     FILE       *fp;
                                 27                 :     const char *filename;
                                 28                 :     int         lineno;
                                 29                 :     StringInfoData buf;         /* current input line, in UTF-8 */
                                 30                 :     char       *curline;        /* current input line, in DB's encoding */
                                 31                 :     /* curline may be NULL, or equal to buf.data, or a palloc'd string */
                                 32                 :     ErrorContextCallback cb;
                                 33                 : } tsearch_readline_state;
                                 34                 : 
                                 35                 : #define TOUCHAR(x)  (*((const unsigned char *) (x)))
                                 36                 : 
                                 37                 : /* The second argument of t_iseq() must be a plain ASCII character */
                                 38                 : #define t_iseq(x,c)     (TOUCHAR(x) == (unsigned char) (c))
                                 39                 : 
                                 40                 : /* Copy multibyte character of known byte length, return byte length. */
                                 41                 : static inline int
   67 tmunro@postgresql.or       42 CBC      215141 : ts_copychar_with_len(void *dest, const void *src, int length)
                                 43                 : {
                                 44          215141 :     memcpy(dest, src, length);
                                 45          215141 :     return length;
                                 46                 : }
                                 47                 : 
                                 48                 : /* Copy multibyte character from null-terminated string,  return byte length. */
                                 49                 : static inline int
                                 50          202663 : ts_copychar_cstr(void *dest, const void *src)
                                 51                 : {
                                 52          202663 :     return ts_copychar_with_len(dest, src, pg_mblen_cstr((const char *) src));
                                 53                 : }
                                 54                 : 
                                 55                 : /* Historical macro for the above. */
                                 56                 : #define COPYCHAR ts_copychar_cstr
                                 57                 : 
                                 58                 : #define GENERATE_T_ISCLASS_DECL(character_class) \
                                 59                 : extern int  t_is##character_class##_with_len(const char *ptr, int len); \
                                 60                 : extern int  t_is##character_class##_cstr(const char *ptr); \
                                 61                 : extern int  t_is##character_class##_unbounded(const char *ptr); \
                                 62                 : \
                                 63                 : /* deprecated */ \
                                 64                 : extern int  t_is##character_class(const char *ptr);
                                 65                 : 
                                 66                 : GENERATE_T_ISCLASS_DECL(alnum);
                                 67                 : GENERATE_T_ISCLASS_DECL(alpha);
                                 68                 : 
                                 69                 : extern bool tsearch_readline_begin(tsearch_readline_state *stp,
                                 70                 :                                    const char *filename);
                                 71                 : extern char *tsearch_readline(tsearch_readline_state *stp);
                                 72                 : extern void tsearch_readline_end(tsearch_readline_state *stp);
                                 73                 : 
                                 74                 : #endif                          /* __TSLOCALE_H__ */
        

Generated by: LCOV version 2.4-beta