/* */
/* */
/* */
-/* (C) 1998-2000 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 1998-2011, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
+int CompareFilePos (const FilePos* P1, const FilePos* P2)
+/* Compare two file positions. Return zero if both are equal, return a value
+ * > 0 if P1 is greater and P2, and a value < 0 if P1 is less than P2. The
+ * compare rates file index over line over column.
+ */
+{
+ if (P1->Name > P2->Name) {
+ return 1;
+ } else if (P1->Name < P2->Name) {
+ return -1;
+ } else if (P1->Line > P2->Line) {
+ return 1;
+ } else if (P1->Line < P2->Line) {
+ return -1;
+ } else if (P1->Col > P2->Col) {
+ return 1;
+ } else if (P1->Col < P2->Col) {
+ return -1;
+ } else {
+ return 0;
+ }
+}
+
+
+
/* */
/* */
/* */
-/* (C) 1998-2010, Ullrich von Bassewitz */
+/* (C) 1998-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
void InitFilePos (FilePos* P);
/* Initialize the file position (set all fields to zero) */
+int CompareFilePos (const FilePos* P1, const FilePos* P2);
+/* Compare two file positions. Return zero if both are equal, return a value
+ * > 0 if P1 is greater and P2, and a value < 0 if P1 is less than P2. The
+ * compare rates file index over line over column.
+ */
+
/* End of filepos.h */