+/* $Header$ */
+
+#define SEP_CHAR ('|')
+
#define dump_nl(f) { if (putc('\n', f) < 0) wpunt(); }
-#define dump_sep(f) { if (putc(':', f) < 0) wpunt(); }
+#define dump_sep(f) { if (putc(SEP_CHAR, f) < 0) wpunt(); }
#include <sys/file.h>
#include <ctype.h>
#include <mit-copyright.h>
+#include "dump_db.h"
/* putc without the line buffer hair */
bzero(act, 128);
- act[':']=1;
+ act[SEP_CHAR]=1;
act['\\']=1;
act[127]=2;
for (i=0; i<' '; i++) act[i]=2;
*t = '\0';
return s;
}
-
-
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
#include <stdio.h>
#include <ctype.h>
#include <mit-copyright.h>
+#include "dump_db.h"
/*ARGSUSED*/
register int c;
register int val = 0;
register int sign = 1;
- while ((c = getc(f)) != EOF && c != ':' && c != '\n') {
+ while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n') {
if (c == '-') sign = -1;
else if (isdigit(c)) {
val *= 10;
{
register int c;
- while ((c = getc(f)) != EOF && c != ':' && c != '\n' && len > 0) {
+ while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n' && len > 0) {
if (c == '\\') {
c = getc(f);
if (isdigit(c)) {
punt("Broken \\###");
/* Convert to ASCII code: */
*buf++ = (((c-'0')<<6) + ((c1-'0')<<3) + c2-'0');
- } else if (c == '\\' || c == ':') {
+ } else if (c == '\\' || c == SEP_CHAR) {
*buf++ = c;
--len;
} else punt ("Broken '\\'");
if (c == EOF)
return;
- if (c != EOF && c != ':' && c != '\n') {
+ if (c != EOF && c != SEP_CHAR && c != '\n') {
fprintf(stderr, "Field too wide, truncated\n");
- while ((c = getc(f)) != EOF && c != ':' && c != '\n');
+ while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n');
(void) ungetc(c, f);
} else {
*buf++ = 0;
void parse_sep(f)
FILE *f;
{
- if (getc(f) != ':') punt("Expected colon");
+ if (getc(f) != SEP_CHAR) punt("Expected Separator");
}
void parse_nl(f)
FILE *f;
fprintf(stderr, "Working on %s\n", name);
return(f);
}
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */