buffer.
+Fri Jan 5 22:25:06 CST 2001 Adam Heath <doogie@debian.org>
+
+ * lib/varbuf.c: varbuf(v)printf now return the number of characters
+ they added to the buffer.
+
Thu Jan 4 01:20:27 CST 2001 Adam Heath <doogie@debian.org>
* dpkg-deb/build.c, dpkg-deb/extract.c, dpkg-deb/info.c,
extern void varbufaddc(struct varbuf *v, int c);
extern void varbufdupc(struct varbuf *v, int c, ssize_t s);
+int varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2,3);
+int varbufvprintf(struct varbuf *v, const char *fmt, va_list va);
void varbufinit(struct varbuf *v);
void varbufreset(struct varbuf *v);
void varbufextend(struct varbuf *v);
void varbufrecord(struct varbuf*, const struct pkginfo*, const struct pkginfoperfile*);
void varbufdependency(struct varbuf *vb, struct dependency *dep);
-void varbufprintf(struct varbuf *v, const char *fmt, ...) PRINTFFORMAT(2,3);
-void varbufvprintf(struct varbuf *v, const char *fmt, va_list va);
/* NB THE VARBUF MUST HAVE BEEN INITIALISED AND WILL NOT BE NULL-TERMINATED */
/*** from vercmp.c ***/
}
}
-void varbufprintf(struct varbuf *v, const char *fmt, ...) {
+int varbufprintf(struct varbuf *v, const char *fmt, ...) {
int ou, r;
va_list al;
if (r < 0) r= (v->size-ou+1) * 2;
v->used= ou+r;
} while (r >= v->size-ou-1);
+ return r;
}
-void varbufvprintf(struct varbuf *v, const char *fmt, va_list va) {
+int varbufvprintf(struct varbuf *v, const char *fmt, va_list va) {
int ou, r;
va_list al;
if (r < 0) r= (v->size-ou+1) * 2;
v->used= ou+r;
} while (r >= v->size-ou-1);
+ return r;
}
void varbufaddbuf(struct varbuf *v, const void *s, const int l) {