7
* MenTaLguY <mental@rydia.net>
9
* Copyright (C) 2003 MenTaLguY
11
* Released under GNU GPL, read the file 'COPYING' for more information
15
#include <glib/gstrfuncs.h>
18
gboolean sp_version_from_string(const gchar *string, Inkscape::Version *version)
27
return sscanf((const char *)string, "%u.%u",
28
&version->major, &version->minor) ||
29
sscanf((const char *)string, "%u", &version->major);
32
gchar *sp_version_to_string(Inkscape::Version version)
34
return g_strdup_printf("%u.%u", version.major, version.minor);
37
gboolean sp_version_inside_range(Inkscape::Version version,
38
unsigned major_min, unsigned minor_min,
39
unsigned major_max, unsigned minor_max)
41
if ( version.major < major_min || version.major > major_max ) {
43
} else if ( version.major == major_min &&
44
version.minor <= minor_min )
47
} else if ( version.major == major_max &&
48
version.minor >= minor_max )
59
c-file-style:"stroustrup"
60
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
65
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :