summaryrefslogtreecommitdiffstats
path: root/src/sysupdate/sysupdate-pattern.h
blob: e8ea104623f55ca341d99e39deb44bb2c7d0bda8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once

#include <stdbool.h>

#include "sysupdate-instance.h"
#include "time-util.h"

enum {
        PATTERN_MATCH_NO,
        PATTERN_MATCH_YES,
        PATTERN_MATCH_RETRY,
};

int pattern_match(const char *pattern, const char *s, InstanceMetadata *ret);
int pattern_match_many(char **patterns, const char *s, InstanceMetadata *ret);
int pattern_valid(const char *pattern);
int pattern_format(const char *pattern, const InstanceMetadata *fields, char **ret);