00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "mark.hpp"
00027 #include "uti.h"
00028 #include "spl.h"
00029
00030
00031
00032 PRIVATE int cmpf( const Mark1D*a, const Mark1D*b)
00033 {
00034 return Mark1D::compare_psl(*a,*b);
00035 }
00036
00037
00038
00039 PRIVATE int rcmpf( const Mark1D*a, const Mark1D*b)
00040 {
00041 return -Mark1D::compare_psl(*a,*b);
00042 }
00043
00044
00045
00046 VOID Mark1DList::sort( BOOL reverse )
00047 {
00048 if (reverse) l.sortf(rcmpf);
00049 else l.sortf(cmpf);
00050 }
00051
00052
00053
00054 Lix Mark1DList::seek_p(LONG pos, Lix from) const
00055 {
00056 for (Lix p=from?from:l.first(); p!=0; p=l.next(p))
00057 if (pos==l(p).pos) return p;
00058 return 0;
00059 }
00060
00061
00062
00063 Lix Mark1DList::seek_s(LONG span, Lix from) const
00064 {
00065 for (Lix p=from?from:l.first(); p!=0; p=l.next(p))
00066 if (span==l(p).span) return p;
00067 return 0;
00068 }
00069
00070
00071
00072 Lix Mark1DList::seek_l(String label, Lix from) const
00073 {
00074 for (Lix p=from?from:l.first(); p!=0; p=l.next(p))
00075 if (!compare(label,l(p).label)) return p;
00076 return 0;
00077 }
00078
00079
00080
00081 Lix Mark1DList::seek_ps(LONG pos, LONG span, Lix from) const
00082 {
00083 for (Lix p=from?from:l.first(); p!=0; p=l.next(p))
00084 if ((pos==l(p).pos)&&(span==l(p).span)) return p;
00085 return 0;
00086 }
00087
00088
00089
00090 Lix Mark1DList::seek_pl(LONG pos, String label, Lix from) const
00091 {
00092 for (Lix p=from?from:l.first(); p!=0; p=l.next(p))
00093 if ((pos==l(p).pos)&&(!compare(label,l(p).label))) return p;
00094 return 0;
00095 }
00096
00097
00098
00099 Lix Mark1DList::seek_sl(LONG span, String label, Lix from) const
00100 {
00101 for (Lix p=from?from:l.first(); p!=0; p=l.next(p))
00102 if ((span==l(p).span)&&(!compare(label,l(p).label))) return p;
00103 return 0;
00104 }
00105
00106
00107
00108 Lix Mark1DList::seek_psl(LONG pos, LONG span, String label, Lix from) const
00109 {
00110 for (Lix p=from?from:l.first(); p!=0; p=l.next(p))
00111 if ((pos==l(p).pos)&&(span==l(p).span)&&(!compare(label,l(p).label)))
00112 return p;
00113 return 0;
00114 }
00115
00116
00117
00118 Lix Mark1DList::rseek_p(LONG pos, Lix from) const
00119 {
00120 for (Lix p=from?from:l.last(); p!=0; p=l.prev(p))
00121 if (pos==l(p).pos) return p;
00122 return 0;
00123 }
00124
00125
00126
00127 Lix Mark1DList::rseek_s(LONG span, Lix from) const
00128 {
00129 for (Lix p=from?from:l.last(); p!=0; p=l.prev(p))
00130 if (span==l(p).span) return p;
00131 return 0;
00132 }
00133
00134
00135
00136 Lix Mark1DList::rseek_l(String label, Lix from) const
00137 {
00138 for (Lix p=from?from:l.last(); p!=0; p=l.prev(p))
00139 if (!compare(label,l(p).label)) return p;
00140 return 0;
00141 }
00142
00143
00144
00145 Lix Mark1DList::rseek_ps(LONG pos, LONG span, Lix from) const
00146 {
00147 for (Lix p=from?from:l.last(); p!=0; p=l.prev(p))
00148 if ((pos==l(p).pos)&&(span==l(p).span)) return p;
00149 return 0;
00150 }
00151
00152
00153
00154 Lix Mark1DList::rseek_pl(LONG pos, String label, Lix from) const
00155 {
00156 for (Lix p=from?from:l.last(); p!=0; p=l.prev(p))
00157 if ((pos==l(p).pos)&&(!compare(label,l(p).label))) return p;
00158 return 0;
00159 }
00160
00161
00162
00163 Lix Mark1DList::rseek_sl(LONG span, String label, Lix from) const
00164 {
00165 for (Lix p=from?from:l.last(); p!=0; p=l.prev(p))
00166 if ((span==l(p).span)&&(!compare(label,l(p).label))) return p;
00167 return 0;
00168 }
00169
00170
00171
00172 Lix Mark1DList::rseek_psl(LONG pos, LONG span, String label, Lix from) const
00173 {
00174 for (Lix p=from?from:l.last(); p!=0; p=l.prev(p))
00175 if ((pos==l(p).pos)&&(span==l(p).span)&&(!compare(label,l(p).label)))
00176 return p;
00177 return 0;
00178 }
00179
00180
00181
00182 VOID Mark1DList::uniq_p( VOID )
00183 {
00184 for (Lix p=first(); p!=0; p=next(p)) {
00185 Lix q=next(p);
00186 while (q) if ((q=seek_p(l(p),q))!=0) q=del(q,1);
00187 }
00188 }
00189
00190
00191
00192 VOID Mark1DList::uniq_s( VOID )
00193 {
00194 for (Lix p=first(); p!=0; p=next(p)) {
00195 Lix q=next(p);
00196 while (q) if ((q=seek_s(l(p),q))!=0) q=del(q,1);
00197 }
00198 }
00199
00200
00201
00202 VOID Mark1DList::uniq_l( VOID )
00203 {
00204 for (Lix p=first(); p!=0; p=next(p)) {
00205 Lix q=next(p);
00206 while (q) if ((q=seek_l(l(p),q))!=0) q=del(q,1);
00207 }
00208 }
00209
00210
00211
00212 VOID Mark1DList::uniq_ps( VOID )
00213 {
00214 for (Lix p=first(); p!=0; p=next(p)) {
00215 Lix q=next(p);
00216 while (q) if ((q=seek_ps(l(p),q))!=0) q=del(q,1);
00217 }
00218 }
00219
00220
00221
00222 VOID Mark1DList::uniq_pl( VOID )
00223 {
00224 for (Lix p=first(); p!=0; p=next(p)) {
00225 Lix q=next(p);
00226 while (q) if ((q=seek_pl(l(p),q))!=0) q=del(q,1);
00227 }
00228 }
00229
00230
00231
00232 VOID Mark1DList::uniq_sl( VOID )
00233 {
00234 for (Lix p=first(); p!=0; p=next(p)) {
00235 Lix q=next(p);
00236 while (q) if ((q=seek_sl(l(p),q))!=0) q=del(q,1);
00237 }
00238 }
00239
00240
00241
00242 VOID Mark1DList::uniq_psl( VOID )
00243 {
00244 for (Lix p=first(); p!=0; p=next(p)) {
00245 Lix q=next(p);
00246 while (q) if ((q=seek_psl(l(p),q))!=0) q=del(q,1);
00247 }
00248 }
00249
00250
00251