wireshark/wsutil/ws_strptime.h
João Valverde 6aa22b952d dfilter: Extend support for timezones in filter expressions
Extends the dfilter syntax with more the timezones supported
by ws_strptime().

We remove the handling of tm_gmtoff and tm_zone in struct tm,
because it is more trouble than it is worth due to platform
incompatibilites, and instead use an extra arguments to pass
these two non-standard fields.

Remove a test that is no longer relevant (we do not need to
assert that WET in particular is not supported).
2023-09-08 14:10:11 +01:00

47 lines
962 B
C

/** @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__ */