PostgreSQL Source Code: src/backend/utils/mb/wstrncmp.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

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

36

38

39int

41{

42 if (n == 0)

43 return 0;

44 do

45 {

46 if (*s1 != *s2++)

47 return (*s1 - *(s2 - 1));

48 if (*s1++ == 0)

49 break;

50 } while (--n != 0);

51 return 0;

52}

53

54int

56{

57 if (n == 0)

58 return 0;

59 do

60 {

61 if ((pg_wchar) ((unsigned char) *s1) != *s2++)

62 return ((pg_wchar) ((unsigned char) *s1) - *(s2 - 1));

63 if (*s1++ == 0)

64 break;

65 } while (--n != 0);

66 return 0;

67}

68

69size_t

71{

73

74 for (s = str; *s; ++s)

75 ;

76 return (s - str);

77}

size_t pg_wchar_strlen(const pg_wchar *str)

int pg_wchar_strncmp(const pg_wchar *s1, const pg_wchar *s2, size_t n)

int pg_char_and_wchar_strncmp(const char *s1, const pg_wchar *s2, size_t n)