diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /wsutil/ws_strptime.h | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wsutil/ws_strptime.h')
-rw-r--r-- | wsutil/ws_strptime.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/wsutil/ws_strptime.h b/wsutil/ws_strptime.h new file mode 100644 index 0000000..0eb0c56 --- /dev/null +++ b/wsutil/ws_strptime.h @@ -0,0 +1,46 @@ +/** @file + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef __WS_STRPTIME_H__ +#define __WS_STRPTIME_H__ + +#include <wireshark.h> +#include <time.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Struct to pass the "tm_gmtoff" and "tm_zone" fields, for systems whose + * libc struct tm type lacks these non-standard extensions. */ +struct ws_timezone { + long tm_gmtoff; + const char *tm_zone; +}; + +/* + * This is the NetBSD strptime(), modified to always use the "C" locale. + */ +WS_DLL_PUBLIC +char * +ws_strptime(const char *buf, const char *format, struct tm *tm, + struct ws_timezone *zonep); + +/* + * Portability wrapper around the system's strptime(). + */ +WS_DLL_PUBLIC +char * +ws_strptime_p(const char *buf, const char *format, struct tm *tm); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __WS_STRPTIME_H__ */ |