diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-08-13 10:59:03 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-08-13 10:59:03 +0000 |
commit | 2d4a7ddf09618de3129cecb386faa05eab3a551f (patch) | |
tree | 0af27e2b5a5ff6d8bbd8373ca805700d5cab043c /Build/source/texk/dvipdfm-x/dpxutil.c | |
parent | e99c0ea4de186714209c6be95394fe48a720567f (diff) |
texk/dvipdfm-x: More static functions
git-svn-id: svn://tug.org/texlive/trunk@38112 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/dpxutil.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/dpxutil.c | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/Build/source/texk/dvipdfm-x/dpxutil.c b/Build/source/texk/dvipdfm-x/dpxutil.c index acf318026ab..05640096af0 100644 --- a/Build/source/texk/dvipdfm-x/dpxutil.c +++ b/Build/source/texk/dvipdfm-x/dpxutil.c @@ -49,109 +49,6 @@ xtoi (char c) return -1; } -int -sputx (unsigned char c, char **s, char *end) -{ - char hi = (c >> 4), lo = c & 0x0f; - - if (*s + 2 > end) - ERROR("Buffer overflow."); - **s = (hi < 10) ? hi + '0' : hi + '7'; - *(*s+1) = (lo < 10) ? lo + '0' : lo + '7'; - *s += 2; - - return 2; -} - -int -getxpair (unsigned char **s) -{ - int hi, lo; - hi = xtoi(**s); - if (hi < 0) - return hi; - (*s)++; - lo = xtoi(**s); - if (lo < 0) - return lo; - (*s)++; - return ((hi << 4)| lo); -} - -int -putxpair (unsigned char c, char **s) -{ - char hi = (c >> 4), lo = c & 0x0f; - - **s = (hi < 10) ? hi + '0' : hi + '7'; - *(*s+1) = (lo < 10) ? lo + '0' : lo + '7'; - *s += 2; - - return 2; -} - -/* Overflowed value is set to invalid char. */ -unsigned char -ostrtouc (unsigned char **inbuf, unsigned char *inbufend, unsigned char *valid) -{ - unsigned char *cur = *inbuf; - unsigned int val = 0; - - while (cur < inbufend && cur < *inbuf + 3 && - (*cur >= '0' && *cur <= '7')) { - val = (val << 3) | (*cur - '0'); - cur++; - } - if (val > 255 || cur == *inbuf) - *valid = 0; - else - *valid = 1; - - *inbuf = cur; - return (unsigned char) val; -} - -unsigned char -esctouc (unsigned char **inbuf, unsigned char *inbufend, unsigned char *valid) -{ - unsigned char unescaped, escaped; - - escaped = **inbuf; - *valid = 1; - switch (escaped) { - /* Backslash, unbalanced paranthes */ - case '\\': case ')': case '(': - unescaped = escaped; - (*inbuf)++; - break; - /* Other escaped char */ - case 'n': unescaped = '\n'; (*inbuf)++; break; - case 'r': unescaped = '\r'; (*inbuf)++; break; - case 't': unescaped = '\t'; (*inbuf)++; break; - case 'b': unescaped = '\b'; (*inbuf)++; break; - case 'f': unescaped = '\f'; (*inbuf)++; break; - /* - * An end-of-line marker preceeded by backslash is not part of a - * literal string - */ - case '\r': - unescaped = 0; - *valid = 0; - *inbuf += (*inbuf < inbufend - 1 && *(*inbuf+1) == '\n') ? 2 : 1; - break; - case '\n': - unescaped = 0; - *valid = 0; - (*inbuf)++; - break; - /* Possibly octal notion */ - default: - unescaped = ostrtouc(inbuf, inbufend, valid); - } - - return unescaped; -} - void skip_white_spaces (unsigned char **s, unsigned char *endptr) { |