Skip to content

Commit

Permalink
timeutils: add scan_iso_timezone() function
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
  • Loading branch information
bazsi committed Feb 10, 2023
1 parent f0a5256 commit b5d8324
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/timeutils/scan-timestamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,16 @@ __parse_iso_timezone(const guchar **data, gint *length)
return tz;
}

gboolean
scan_iso_timezone(const guchar **data, gint *length, gint *gmtoff)
{
if (__has_iso_timezone(*data, *length))
{
*gmtoff = __parse_iso_timezone(data, length);
return TRUE;
}
return FALSE;
}

static gboolean
__parse_iso_stamp(WallClockTime *wct, const guchar **data, gint *length)
Expand Down
2 changes: 2 additions & 0 deletions lib/timeutils/scan-timestamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "timeutils/wallclocktime.h"
#include "timeutils/unixtime.h"

gboolean scan_iso_timezone(const guchar **buf, gint *length, gint *gmtoff);

gboolean scan_iso_timestamp(const gchar **buf, gint *left, WallClockTime *wct);
gboolean scan_pix_timestamp(const gchar **buf, gint *left, WallClockTime *wct);
gboolean scan_linksys_timestamp(const gchar **buf, gint *left, WallClockTime *wct);
Expand Down

0 comments on commit b5d8324

Please sign in to comment.