Team Fortress 2 Source Code as on 22/4/2020
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.

79 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. /*
  9. *
  10. * Copyright (c) 1998-9
  11. * Dr John Maddock
  12. *
  13. * Permission to use, copy, modify, distribute and sell this software
  14. * and its documentation for any purpose is hereby granted without fee,
  15. * provided that the above copyright notice appear in all copies and
  16. * that both that copyright notice and this permission notice appear
  17. * in supporting documentation. Dr John Maddock makes no representations
  18. * about the suitability of this software for any purpose.
  19. * It is provided "as is" without express or implied warranty.
  20. *
  21. */
  22. /*
  23. * FILE re_cls.h
  24. * VERSION 2.12
  25. * This is an internal header file, do not include directly.
  26. * character class lookup, for regular
  27. * expression library.
  28. */
  29. #ifndef RE_CLS_H
  30. #define RE_CLS_H
  31. #ifndef JM_CFG_H
  32. #include <jm/jm_cfg.h>
  33. #endif
  34. #ifndef RE_STR_H
  35. #include <jm/re_str.h>
  36. #endif
  37. JM_NAMESPACE(__JM)
  38. #define re_classes_max 14
  39. void RE_CALL re_init_classes();
  40. void RE_CALL re_free_classes();
  41. void RE_CALL re_update_classes();
  42. JM_IX_DECL jm_uintfast32_t RE_CALL __re_lookup_class(const char* p);
  43. inline jm_uintfast32_t RE_CALL re_lookup_class(const char* first, const char* last)
  44. {
  45. re_str<char> s(first, last);
  46. return __re_lookup_class(s.c_str());
  47. }
  48. #ifndef JM_NO_WCSTRING
  49. inline jm_uintfast32_t RE_CALL re_lookup_class(const wchar_t* first, const wchar_t* last)
  50. {
  51. re_str<wchar_t> s(first, last);
  52. unsigned int len = re_strnarrow((char*)NULL, 0, s.c_str());
  53. auto_array<char> buf(new char[len]);
  54. re_strnarrow((char*)buf, len, s.c_str());
  55. len = __re_lookup_class((char*)buf);
  56. return len;
  57. }
  58. #endif
  59. #ifdef RE_LOCALE_CPP
  60. extern jm_uintfast32_t re_char_class_id[];
  61. extern const char* re_char_class_names[];
  62. #endif
  63. JM_END_NAMESPACE
  64. #endif