diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/tfstats/regexp/include/jm/re_mss.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/tfstats/regexp/include/jm/re_mss.h')
| -rw-r--r-- | utils/tfstats/regexp/include/jm/re_mss.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/utils/tfstats/regexp/include/jm/re_mss.h b/utils/tfstats/regexp/include/jm/re_mss.h new file mode 100644 index 0000000..7ff4809 --- /dev/null +++ b/utils/tfstats/regexp/include/jm/re_mss.h @@ -0,0 +1,90 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +/* + * + * Copyright (c) 1998-9 + * Dr John Maddock + * + * Permission to use, copy, modify, distribute and sell this software + * and its documentation for any purpose is hereby granted without fee, + * provided that the above copyright notice appear in all copies and + * that both that copyright notice and this permission notice appear + * in supporting documentation. Dr John Maddock makes no representations + * about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + */ + + /* + * FILE re_mss.h + * VERSION 2.12 + * This is an internal header file, do not include directly. + * Message helper functions, for regular + * expression library. + */ + +#ifndef RE_MSS_H +#define RE_MSS_H + +#ifndef JM_CFG_H +#include <jm/jm_cfg.h> +#endif + +JM_NAMESPACE(__JM) + +// +// re_get_message +// returns required buffer size if len is zero +// otherwise fills in buf. +// + +JM_IX_DECL unsigned int RE_CALL re_get_default_message(char* buf, unsigned int len, unsigned int id); + +JM_IX_DECL unsigned int RE_CALL __re_get_message(char* buf, unsigned int len, unsigned int id); + +template <class charT> +unsigned int RE_CALL re_get_message(charT* buf, unsigned int len, unsigned int id) +{ + unsigned int size = __re_get_message((char*)0, 0, id); + if(len < size) + return size; + auto_array<char> cb(new char[size]); + __re_get_message((char*)cb, size, id); + size = re_strwiden(buf, len, (char*)cb); + return size; +} + +inline unsigned int RE_CALL re_get_message(char* buf, unsigned int len, unsigned int id) +{ + return __re_get_message(buf, len, id); +} + + +// +// declare message initialisers: +// +void RE_CALL re_message_init(); +void RE_CALL re_message_update(); +void RE_CALL re_message_free(); + +#ifdef RE_LOCALE_CPP + +__JM_STD::messages<char>::string_type RE_CALL re_get_def_message(unsigned int i); + +__JM_STD::messages<wchar_t>::string_type RE_CALL re_get_def_message_w(unsigned int i); + +extern const char *re_default_error_messages[]; + +#endif + + +JM_END_NAMESPACE + + +#endif + |