diff --git a/WEGA/contrib/ingres/dbs/src/gutil/append.c b/WEGA/contrib/ingres/dbs/src/gutil/append.c new file mode 100644 index 0000000..dd70307 --- /dev/null +++ b/WEGA/contrib/ingres/dbs/src/gutil/append.c @@ -0,0 +1,23 @@ +/* +** BLOCK CONCATANATE +** block `q' of length `n' is concatenated to block +** `b2' of length `l2', giving `p'. +** +** Returns the address of the next byte available after +** the end of `p'. +*/ +char *AAappend(q, n, b2, l2, p) +register char *q; +register int n; +register char *p; +register char *b2; +register int l2; +{ + while (n-- > 0) + *p++ = *q++; + n = l2; + q = b2; + while (n-- > 0) + *p++ = *q++; + return (p); +} diff --git a/WEGA/contrib/ingres/dbs/src/gutil/concat.c b/WEGA/contrib/ingres/dbs/src/gutil/concat.c new file mode 100644 index 0000000..95174da --- /dev/null +++ b/WEGA/contrib/ingres/dbs/src/gutil/concat.c @@ -0,0 +1,20 @@ +/* +** STRING CONCATENATE +** +** The strings `s1' and `s2' are concatenated and stored into +** `dst'. It is ok for `s1' to equal `dst', but terrible things +** will happen if `s2' equals `dst'. The return value is is a +** pointer to the end of `dst' field. +*/ +char *AAconcat(s1, s2, dst) +register char *s1; +register char *s2; +register char *dst; +{ + while (*s1) + *dst++ = *s1++; + while (*s2) + *dst++ = *s2++; + *dst = 0; + return (dst); +} diff --git a/WEGA/contrib/ingres/dbs/src/gutil/ztack.c b/WEGA/contrib/ingres/dbs/src/gutil/ztack.c new file mode 100644 index 0000000..09f793e --- /dev/null +++ b/WEGA/contrib/ingres/dbs/src/gutil/ztack.c @@ -0,0 +1,27 @@ +/* +** LOCAL STRING CONCATENATE +** Strings `a' and `b' are concatenated and left in an +** internal buffer. A pointer to that buffer is returned. +** +** Ztack can be called recursively as: +** AAztack(AAztack(AAztack(w, x), y), z); +*/ +char *AAztack(a, b) +register char *a; +register char *b; +{ + register char *c; + static char buf[101]; + + c = buf; + + while (*a) + *c++ = *a++; + + while (*b) + *c++ = *b++; + + *c = '\0'; + + return (buf); +}