naev 0.12.6
semver.h
1/*
2 * semver.h
3 *
4 * Copyright (c) 2015-2017 Tomas Aparicio
5 * MIT licensed
6 */
7
8#ifndef __SEMVER_H
9#define __SEMVER_H
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#ifndef SEMVER_VERSION
16#define SEMVER_VERSION "0.2.0"
17#endif
18
22
23typedef struct semver_version_s {
24 int major;
25 int minor;
26 int patch;
27 char *metadata;
28 char *prerelease;
29} semver_t;
30
34
35int semver_satisfies( semver_t x, semver_t y, const char *op );
36
37int semver_satisfies_caret( semver_t x, semver_t y );
38
39int semver_satisfies_patch( semver_t x, semver_t y );
40
41int semver_compare( semver_t x, semver_t y );
42
43int semver_compare_version( semver_t x, semver_t y );
44
45int semver_compare_prerelease( semver_t x, semver_t y );
46
47int semver_gt( semver_t x, semver_t y );
48
49int semver_gte( semver_t x, semver_t y );
50
51int semver_lt( semver_t x, semver_t y );
52
53int semver_lte( semver_t x, semver_t y );
54
55int semver_eq( semver_t x, semver_t y );
56
57int semver_neq( semver_t x, semver_t y );
58
59int semver_parse( const char *str, semver_t *ver );
60
61int semver_parse_version( const char *str, semver_t *ver );
62
63void semver_render( semver_t *x, char *dest );
64
65int semver_numeric( semver_t *x );
66
67void semver_bump( semver_t *x );
68
69void semver_bump_minor( semver_t *x );
70
71void semver_bump_patch( semver_t *x );
72
73void semver_free( semver_t *x );
74
75int semver_is_valid( const char *s );
76
77int semver_clean( char *s );
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif