PostgreSQL Source Code: src/common/kwlookup.c Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16#include "c.h"

17

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37int

40{

41 size_t len;

42 int h;

43 const char *kw;

44

45

46

47

48

51 return -1;

52

53

54

55

56

57

59

60

61 if (h < 0 || h >= keywords->num_keywords)

62 return -1;

63

64

65

66

67

68

69

71 while (*str != '\0')

72 {

73 char ch = *str++;

74

75 if (ch >= 'A' && ch <= 'Z')

76 ch += 'a' - 'A';

77 if (ch != *kw++)

78 return -1;

79 }

80 if (*kw != '\0')

81 return -1;

82

83

84 return h;

85}

static const JsonPathKeyword keywords[]

int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords)

static const char * GetScanKeyword(int n, const ScanKeywordList *keywords)