add stralloc_diff and stralloc_diffs

This commit is contained in:
leitner
2002-10-28 20:15:03 +00:00
parent e108646f26
commit 2cd4641da9
8 changed files with 93 additions and 2 deletions

14
stralloc/stralloc_diffs.c Normal file
View File

@@ -0,0 +1,14 @@
#include "stralloc.h"
#include "byte.h"
#include "str.h"
extern int stralloc_diffs(const stralloc* a,const char* b) {
register unsigned int i;
register int j;
for (i=0;;++i) {
if (i==a->len) return (!b[i])?0:-1; if (!b[i]) return 1;
if ((j=(a->s[i]-b[i]))) return j;
}
return j;
}