// SPDX-License-Identifier: GPL-2.0-only
/*
 *  ppm/src/core/version_req.h
 *
 *  Version requirement matching. Supports a small but sufficient
 *  subset of the npm/cargo style requirement grammar:
 *      "1.2.3"      exact
 *      "=1.2.3"     exact
 *      "^1.2.3"     caret: >=1.2.3, <2.0.0 (or 0.x.y if major is 0)
 *      "~1.2.3"     tilde: >=1.2.3, <1.3.0
 *      ">=1.2.3"    inclusive lower
 *      ">1.2.3"     exclusive lower
 *      "<=1.2.3"    inclusive upper
 *      "<1.2.3"     exclusive upper
 *      "1.2"        treated as 1.2.0 caret-ish (>=1.2.0, <2.0.0)
 *      "a, b"       conjunction: every constraint must hold
 *
 *  Copyright (C) 2026 Project Tick
 */

#ifndef PPM_CORE_VERSION_REQ_H
#define PPM_CORE_VERSION_REQ_H

#include <stdbool.h>

#include <ppm/error.h>
#include <ppm/manifest.h>

bool ppm_version_req_match(const char *req, const ppm_version_t *v);

#endif
