summaryrefslogtreecommitdiff
path: root/src/preproc/html/pre-html.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/preproc/html/pre-html.cc')
-rw-r--r--src/preproc/html/pre-html.cc137
1 files changed, 0 insertions, 137 deletions
diff --git a/src/preproc/html/pre-html.cc b/src/preproc/html/pre-html.cc
index 199c3315..e4ee0ef3 100644
--- a/src/preproc/html/pre-html.cc
+++ b/src/preproc/html/pre-html.cc
@@ -160,14 +160,6 @@ void html_system(const char *s, int redirect_stdout)
fprintf(stderr, "Calling `%s' returned status %d\n", s, status);
}
-#if 0
-
-/*
- * if/when vsnprintf becomes available on all *NIX machines we can use this function,
- * until then we must use the more complex function below which performs hand built
- * %d, %s and %%.
- */
-
/*
* make_message - taken from man printf(3), creates a string via malloc
* and places the result of the va args into string.
@@ -210,135 +202,6 @@ make_message (const char *fmt, ...)
p = np; /* use realloc'ed, p */
}
}
-#else
-
-/*
- * lengthOfintToStr - returns the length of the proposed string value of i.
- * Hand built log10.
- */
-
-int
-lengthOfintToStr (int i)
-{
- int n=0;
-
- if (i < 0)
- sys_fatal("expecting positive integer value");
-
- do {
- i /= 10;
- n++;
- } while (i > 0);
- return n;
-}
-
-/*
- * intToStr - returns a string containing the positive value of i.
- * (int i is assumed to be positive).
- */
-
-char *
-intToStr (int i)
-{
- int n=lengthOfintToStr(i)+1;
- char *p = (char *)malloc(n);
-
- if (p == NULL)
- sys_fatal("malloc");
-
- if (i < 0)
- sys_fatal("expecting positive integer value");
-
- n--;
- p[n] = (char)0;
- do {
- n--;
- p[n] = (char)((i % 10) + (int)'0');
- i /= 10;
- } while (i > 0);
- return( p );
-}
-
-/*
- * make_message - returns a string built from a format specifier.
- * This function does not use vsnprintf; it only
- * understands primitive %%, %s, and %d specifiers.
- */
-
-char *
-make_message (const char *fmt, ...)
-{
- char *p = strsave(fmt); /* so we can splat a nul anywhere in the string */
- char *np;
- char *l;
- char *s;
- char *num;
- int search=0;
- va_list ap;
-
- va_start(ap, fmt);
- while (p) {
- int lenp=strlen(p);
- char *f = strchr(p+search, '%');
-
- search = f-p;
- np = p;
-
- if (f == NULL) {
- va_end(ap);
- return p;
- }
- switch (*(f+1)) {
-
- case 'd':
- l = strsave(f+2);
- *f = (char)0;
- num = intToStr(va_arg(ap, int));
- np = (char *)malloc(strlen(p)+strlen(num)+strlen(l)+1);
- if (np == NULL)
- sys_fatal("malloc");
- strcpy(np, p);
- strcat(np, num);
- strcat(np, l);
- search += strlen(np)-lenp;
- free(num);
- a_delete l;
- break;
- case 's':
- /* concat */
- l = f+2;
- s = va_arg(ap, char *);
- *f = (char)0;
- np = (char *)malloc(strlen(l)+1+strlen(p)+strlen(s));
- if (np == NULL)
- sys_fatal("malloc");
- strcpy(np, p);
- strcat(np, s);
- strcat(np, l);
- search += strlen(s);
- break;
- case '%':
- /* remove one of the two % that we have seen */
- *f = (char)0;
- l = f+1;
- np = (char *)malloc(strlen(l)+1+strlen(p));
- if (np == NULL)
- sys_fatal("malloc");
- strcpy(np, p);
- strcat(np, l);
- search++;
- break;
- default:
- sys_fatal("unexpected format specifier");
- return NULL;
- }
- a_delete p;
- p = np;
- }
- va_end(ap);
- return NULL;
-}
-#endif
/*
* the class and methods for retaining ascii text