gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 satır
1.6KB

  1. /*-------------------------------------------------------------------------
  2. *
  3. * ts_locale.h
  4. * locale compatibility layer for tsearch
  5. *
  6. * Copyright (c) 1998-2019, PostgreSQL Global Development Group
  7. *
  8. * src/include/tsearch/ts_locale.h
  9. *
  10. *-------------------------------------------------------------------------
  11. */
  12. #ifndef __TSLOCALE_H__
  13. #define __TSLOCALE_H__
  14. #include <ctype.h>
  15. #include <limits.h>
  16. #include "utils/pg_locale.h"
  17. #include "mb/pg_wchar.h"
  18. /*
  19. * towlower() and friends should be in <wctype.h>, but some pre-C99 systems
  20. * declare them in <wchar.h>.
  21. */
  22. #ifdef HAVE_WCHAR_H
  23. #include <wchar.h>
  24. #endif
  25. #ifdef HAVE_WCTYPE_H
  26. #include <wctype.h>
  27. #endif
  28. /* working state for tsearch_readline (should be a local var in caller) */
  29. typedef struct
  30. {
  31. FILE *fp;
  32. const char *filename;
  33. int lineno;
  34. char *curline;
  35. ErrorContextCallback cb;
  36. } tsearch_readline_state;
  37. #define TOUCHAR(x) (*((const unsigned char *) (x)))
  38. /* The second argument of t_iseq() must be a plain ASCII character */
  39. #define t_iseq(x,c) (TOUCHAR(x) == (unsigned char) (c))
  40. #define COPYCHAR(d,s) memcpy(d, s, pg_mblen(s))
  41. extern int t_isdigit(const char *ptr);
  42. extern int t_isspace(const char *ptr);
  43. extern int t_isalpha(const char *ptr);
  44. extern int t_isprint(const char *ptr);
  45. extern char *lowerstr(const char *str);
  46. extern char *lowerstr_with_len(const char *str, int len);
  47. extern bool tsearch_readline_begin(tsearch_readline_state *stp,
  48. const char *filename);
  49. extern char *tsearch_readline(tsearch_readline_state *stp);
  50. extern void tsearch_readline_end(tsearch_readline_state *stp);
  51. extern char *t_readline(FILE *fp);
  52. #endif /* __TSLOCALE_H__ */
上海开阖软件有限公司 沪ICP备12045867号-1