/*
 * Copyright (C) 2015 Sebastian Pipping <sebastian@pipping.org>
 * Licensed under CC0
 */
#include <stdio.h>
#include <stdbool.h>
#include <string.h>

bool requires_old_style_CURRENT(const char * version) {
    return strcmp (version, "4.55") < 0;
}

bool requires_old_style_FIXED(const char * version) {
    const size_t ver_len = strlen(version);
    return (strcmp (version, "4.55") < 0) && (ver_len > 1) && (version[1] == '.');
}

void RUN(const char * version) {
    printf("%s %s  %s\n",
            requires_old_style_CURRENT(version) ? "OLD" : "new",
            requires_old_style_FIXED(version) ? "OLD" : "new",
            version
            );
}

int main() {
    RUN("4.0");
    RUN("4.54");
    RUN("4.55");
    RUN("9.38.1");
    RUN("15.09");
    return 0;
}
