</natures>
<filteredResources>
<filter>
- <id>1325156677028</id>
+ <id>1391696678342</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677034</id>
+ <id>1391696678346</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677038</id>
+ <id>1391696678351</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677042</id>
+ <id>1391696678356</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677046</id>
+ <id>1391696678361</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677050</id>
+ <id>1391696678365</id>
<name></name>
<type>30</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677053</id>
+ <id>1391696678370</id>
<name></name>
<type>30</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677056</id>
+ <id>1391696678376</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677059</id>
+ <id>1391696678381</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677062</id>
+ <id>1391696678386</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677066</id>
+ <id>1391696678398</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677069</id>
+ <id>1391696678402</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677073</id>
+ <id>1391696678406</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677076</id>
+ <id>1391696678410</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677079</id>
+ <id>1391696678414</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677083</id>
+ <id>1391696678548</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677086</id>
+ <id>1391696678551</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677094</id>
+ <id>1391696678555</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677099</id>
+ <id>1391696678559</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677103</id>
+ <id>1391696678563</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677107</id>
+ <id>1391696678567</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677111</id>
+ <id>1391696678570</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677114</id>
+ <id>1391696678574</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1325156677119</id>
+ <id>1391696678578</id>
<name></name>
<type>22</type>
<matcher>
<arguments>1.0-name-matches-false-false-libtool</arguments>
</matcher>
</filter>
+ <filter>
+ <id>1391696678582</id>
+ <name></name>
+ <type>22</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.dll</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1391696678588</id>
+ <name></name>
+ <type>22</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.a</arguments>
+ </matcher>
+ </filter>
</filteredResources>
</projectDescription>
/*
- * Copyright (C) 2010-2012 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2014 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#endif
}
+int
+solipa_compare_version (const gchar *ver1, const gchar *ver2, const gchar *delimiters, guint *part)
+{
+ gchar **_ver1;
+ gchar **_ver2;
+
+ gchar *_delimiters;
+
+ guint i;
+ guint l;
+
+ if (ver1 == NULL)
+ {
+ return -1;
+ }
+ if (ver2 == NULL)
+ {
+ return 1;
+ }
+
+ if (delimiters == NULL)
+ {
+ _delimiters = g_strdup (".");
+ }
+ else
+ {
+ _delimiters = g_strstrip (g_strdup (delimiters));
+ if (g_strcmp0 (_delimiters, "") == 0)
+ {
+ g_free (_delimiters);
+ _delimiters = g_strdup (".");
+ }
+ }
+
+ _ver1 = g_strsplit (g_strstrip (g_strdup (ver1)), _delimiters, -1);
+ _ver2 = g_strsplit (g_strstrip (g_strdup (ver2)), _delimiters, -1);
+
+ l = MIN (g_strv_length (_ver1), g_strv_length (_ver2));
+ for (i = 0; i < l; i++)
+ {
+ if (strtol (_ver1[i], NULL, 10) < strtol (_ver2[i], NULL, 10))
+ {
+ if (part != NULL)
+ {
+ *part = i;
+ }
+ return -1;
+ }
+ else if (strtol (_ver1[i], NULL, 10) > strtol (_ver2[i], NULL, 10))
+ {
+ if (part != NULL)
+ {
+ *part = i;
+ }
+ return 1;
+ }
+ }
+
+ if (g_strv_length (_ver1) < g_strv_length (_ver2))
+ {
+ *part = g_strv_length (_ver1) + 1;
+ return -1;
+ }
+ else if (g_strv_length (_ver1) > g_strv_length (_ver2))
+ {
+ *part = g_strv_length (_ver2) + 1;
+ return 1;
+ }
+
+ *part = 0;
+ return 0;
+}
+
/**
* This function is copied from
* http://bugzilla.gnome.org/show_bug.cgi?id=524831.
/*
- * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2014 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
void solipa_apri_collegamento (GtkWindow *transient, const gchar *indirizzo);
+int solipa_compare_version (const gchar *ver1, const gchar *ver2, const gchar *delimiters, guint *part);
+
gchar *g_mkdtemp (gchar *tmpl);
utils \
utils_apri_collegamento \
utils_codfisc_piva \
+ utils_compare_version \
utils_format_money \
utils_gdatetime \
utils_gstring_initial_capital \
--- /dev/null
+/*
+ * Copyright (C) 2014 Andrea Zagli <azagli@libero.it>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <solipa.h>
+#include <utils.h>
+
+int
+main (int argc, char *argv[])
+{
+ int ret;
+ guint part;
+
+ g_type_init ();
+
+ if (argc == 3)
+ {
+ ret = solipa_compare_version (argv[1], argv[2], NULL, &part);
+ g_message ("%s รจ %s %s (%d)",
+ argv[1],
+ ret == -1 ? "minore di" : ret == 0 ? "uguale a" : "maggiore di",
+ argv[2],
+ part);
+ }
+ else
+ {
+ g_message ("Usage: utils_compare_version <ver1> <ver2>");
+ return 0;
+ }
+
+ return 0;
+}