2002-10-28 20:15:03 +00:00
|
|
|
#include "stralloc.h"
|
|
|
|
#include "byte.h"
|
|
|
|
#include "str.h"
|
|
|
|
|
2005-04-23 15:50:16 +00:00
|
|
|
extern int stralloc_diffs(const stralloc* a,const char* b) {
|
2007-10-17 16:23:01 +00:00
|
|
|
register size_t i;
|
2002-10-28 20:15:03 +00:00
|
|
|
register int j;
|
|
|
|
for (i=0;;++i) {
|
|
|
|
if (i==a->len) return (!b[i])?0:-1; if (!b[i]) return 1;
|
2005-04-23 15:50:16 +00:00
|
|
|
if ((j=((unsigned char)(a->s[i])-(unsigned char)(b[i])))) return j;
|
2002-10-28 20:15:03 +00:00
|
|
|
}
|
|
|
|
return j;
|
|
|
|
}
|
|
|
|
|