Removed some obsolete Perl binding.

Added Version Index "version" method.
Implemented automatic selection of default_print_profile and
default_filament_profile, when the print / filament profiles are
not compatible with the selected printer profile.
Fixed selection of a printer profile, if the currently selected
printer profile becomes invisible.
This commit is contained in:
bubnikv 2018-04-13 14:49:33 +02:00
parent 0f6fc689aa
commit 82890ec815
18 changed files with 146 additions and 550 deletions

View file

@ -175,6 +175,9 @@ semver_parse_version (const char *str, semver_t *ver) {
slice = (char *) str;
index = 0;
// non mandatory
ver->patch = 0;
while (slice != NULL && index++ < 4) {
next = strchr(slice, DELIMITER[0]);
if (next == NULL)
@ -200,7 +203,8 @@ semver_parse_version (const char *str, semver_t *ver) {
slice = next + 1;
}
return (index == 3) ? 0 : -1;
// Major and minor versions are mandatory, patch version is not mandatory.
return (index == 2 || index == 3) ? 0 : -1;
}
static int
@ -632,4 +636,5 @@ semver_copy(const semver_t *ver) {
if (ver->prerelease != NULL) {
res.prerelease = strdup(ver->prerelease);
}
return res;
}