diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-06-24 11:30:55 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-06-24 11:30:55 +0000 |
commit | 76b55956ae3d8decfc46202c9252ec4aa6b19102 (patch) | |
tree | bbc5b79c052035a96e495a89648f046c4a19fb93 /Build/source/texk/web2c/pdftexdir | |
parent | b3500af8f475211c508744d8685510d9780b8045 (diff) |
xdv2pdf: Removed (obsolete)
git-svn-id: svn://tug.org/texlive/trunk@30901 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ChangeLog | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/ptexlib.h | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/utils.c | 192 |
3 files changed, 11 insertions, 199 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index b36fe16a784..27d4d2c3f45 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,3 +1,13 @@ +2013-06-12 Peter Breitenlohner <peb@mppmu.mpg.de> + + Update to e-pTeX and e-upTeX 130605 from Hironori Kitagawa. + * ptexlib.h (initstarttime, makecstring, makecfilename, + getcreationdate, getfilemoddate, getfilesize): Move declarations + of functions also used by e-(u)pTeX from here to ../texmfmp.h. + * utils.c (initstarttime, makecstring, makecfilename, + getcreationdate, getfilemoddate, getfilesize): Move definition + of these functions from here to ../lib/texmfmp.c. + 2013-04-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * pdftex.web: pdftex_revision = "14" diff --git a/Build/source/texk/web2c/pdftexdir/ptexlib.h b/Build/source/texk/web2c/pdftexdir/ptexlib.h index c8164381f6b..04be8a94269 100644 --- a/Build/source/texk/web2c/pdftexdir/ptexlib.h +++ b/Build/source/texk/web2c/pdftexdir/ptexlib.h @@ -1,5 +1,5 @@ /* -Copyright (c) 1996-2011 Han The Thanh, <thanh@pdftex.org> +Copyright (c) 1996-2013 Han The Thanh, <thanh@pdftex.org> This file is part of pdfTeX. @@ -197,7 +197,6 @@ extern integer write_tounicode(char **, const char *, const char *); /* utils.c */ extern boolean str_eq_cstr(strnumber, char *); -extern char *makecstring(integer); extern int xfflush(FILE *); extern int xgetc(FILE *); extern int xputc(int, FILE *); @@ -210,7 +209,6 @@ extern void fb_flush(void); extern void fb_putchar(eightbits b); extern void fb_seek(integer); extern void libpdffinish(void); -extern char *makecfilename(strnumber s); extern void make_subset_tag(fd_entry *); extern void setjobid(int, int, int, int); extern void writestreamlength(longinteger, longinteger); @@ -221,15 +219,11 @@ extern void escapename(poolpointer in); extern void escapestring(poolpointer in); extern void escapehex(poolpointer in); extern void unescapehex(poolpointer in); -extern void getcreationdate(void); -extern void getfilemoddate(strnumber s); -extern void getfilesize(strnumber s); extern void getmd5sum(strnumber s, boolean file); extern void getfiledump(strnumber s, int offset, int length); extern void matchstrings(strnumber s, strnumber t, int subcount, boolean icase); extern void getmatch(int i); extern void makepdftexbanner(void); -extern void initstarttime(void); extern void removepdffile(void); extern void garbagewarning(void); extern void initversionstring(char **versions); diff --git a/Build/source/texk/web2c/pdftexdir/utils.c b/Build/source/texk/web2c/pdftexdir/utils.c index 5fc23f229f1..b8dc994c2a3 100644 --- a/Build/source/texk/web2c/pdftexdir/utils.c +++ b/Build/source/texk/web2c/pdftexdir/utils.c @@ -278,33 +278,6 @@ void garbagewarning(void) removepdffile(); } -char *makecstring(integer s) -{ - static char *cstrbuf = NULL; - char *p; - static int allocsize; - int allocgrow, i, l = strstart[s + 1] - strstart[s]; - check_buf(l + 1, MAX_CSTRING_LEN); - if (cstrbuf == NULL) { - allocsize = l + 1; - cstrbuf = xmallocarray(char, allocsize); - } else if (l + 1 > allocsize) { - allocgrow = allocsize * 0.2; - if (l + 1 - allocgrow > allocsize) - allocsize = l + 1; - else if (allocsize < MAX_CSTRING_LEN - allocgrow) - allocsize += allocgrow; - else - allocsize = MAX_CSTRING_LEN; - cstrbuf = xreallocarray(cstrbuf, char, allocsize); - } - p = cstrbuf; - for (i = 0; i < l; i++) - *p++ = strpool[i + strstart[s]]; - *p = 0; - return cstrbuf; -} - void setjobid(int year, int month, int day, int time) { char *name_string, *format_string, *s; @@ -839,68 +812,6 @@ void printID(strnumber filename) Solaris 2.5). */ -static time_t start_time = 0; -#define TIME_STR_SIZE 30 -static char start_time_str[TIME_STR_SIZE]; -static char time_str[TIME_STR_SIZE]; - /* minimum size for time_str is 24: "D:YYYYmmddHHMMSS+HH'MM'" */ - -static void makepdftime(time_t t, char *time_str) -{ - - struct tm lt, gmt; - size_t size; - int i, off, off_hours, off_mins; - - /* get the time */ - lt = *localtime(&t); - size = strftime(time_str, TIME_STR_SIZE, "D:%Y%m%d%H%M%S", <); - /* expected format: "YYYYmmddHHMMSS" */ - if (size == 0) { - /* unexpected, contents of time_str is undefined */ - time_str[0] = '\0'; - return; - } - - /* correction for seconds: %S can be in range 00..61, - the PDF reference expects 00..59, - therefore we map "60" and "61" to "59" */ - if (time_str[14] == '6') { - time_str[14] = '5'; - time_str[15] = '9'; - time_str[16] = '\0'; /* for safety */ - } - - /* get the time zone offset */ - gmt = *gmtime(&t); - - /* this calculation method was found in exim's tod.c */ - off = 60 * (lt.tm_hour - gmt.tm_hour) + lt.tm_min - gmt.tm_min; - if (lt.tm_year != gmt.tm_year) { - off += (lt.tm_year > gmt.tm_year) ? 1440 : -1440; - } else if (lt.tm_yday != gmt.tm_yday) { - off += (lt.tm_yday > gmt.tm_yday) ? 1440 : -1440; - } - - if (off == 0) { - time_str[size++] = 'Z'; - time_str[size] = 0; - } else { - off_hours = off / 60; - off_mins = abs(off - off_hours * 60); - i = snprintf(&time_str[size], 9, "%+03d'%02d'", off_hours, off_mins); - check_nprintf(i, 9); - } -} - -void initstarttime(void) -{ - if (start_time == 0) { - start_time = time((time_t *) NULL); - makepdftime(start_time, start_time_str); - } -} - void printcreationdate(void) { initstarttime(); @@ -913,86 +824,6 @@ void printmoddate(void) pdf_printf("/ModDate (%s)\n", start_time_str); } -void getcreationdate(void) -{ - /* put creation date on top of string pool and update poolptr */ - size_t len = strlen(start_time_str); - - initstarttime(); - - if ((unsigned) (poolptr + len) >= (unsigned) (poolsize)) { - poolptr = poolsize; - /* error by str_toks that calls str_room(1) */ - return; - } - - memcpy(&strpool[poolptr], start_time_str, len); - poolptr += len; -} - -void getfilemoddate(strnumber s) -{ - struct stat file_data; - - char *file_name = kpse_find_tex(makecfilename(s)); - if (file_name == NULL) { - return; /* empty string */ - } - - recorder_record_input(file_name); - /* get file status */ - if (stat(file_name, &file_data) == 0) { - size_t len; - - makepdftime(file_data.st_mtime, time_str); - len = strlen(time_str); - if ((unsigned) (poolptr + len) >= (unsigned) (poolsize)) { - poolptr = poolsize; - /* error by str_toks that calls str_room(1) */ - } else { - memcpy(&strpool[poolptr], time_str, len); - poolptr += len; - } - } - /* else { errno contains error code } */ - - xfree(file_name); -} - -void getfilesize(strnumber s) -{ - struct stat file_data; - int i; - - char *file_name = kpse_find_tex(makecfilename(s)); - if (file_name == NULL) { - return; /* empty string */ - } - - recorder_record_input(file_name); - /* get file status */ - if (stat(file_name, &file_data) == 0) { - size_t len; - char buf[20]; - - /* st_size has type off_t */ - i = snprintf(buf, sizeof(buf), - "%lu", (long unsigned int) file_data.st_size); - check_nprintf(i, sizeof(buf)); - len = strlen(buf); - if ((unsigned) (poolptr + len) >= (unsigned) (poolsize)) { - poolptr = poolsize; - /* error by str_toks that calls str_room(1) */ - } else { - memcpy(&strpool[poolptr], buf, len); - poolptr += len; - } - } - /* else { errno contains error code } */ - - xfree(file_name); -} - #define DIGEST_SIZE 16 #define FILE_BUF_SIZE 1024 @@ -1188,29 +1019,6 @@ void getmatch(int i) strpool[poolptr++] = '>'; } - -/* makecfilename - input/ouput same as makecstring: - input: string number - output: C string with quotes removed. - That means, file names that are legal on some operation systems - cannot any more be used since pdfTeX version 1.30.4. -*/ -char *makecfilename(strnumber s) -{ - char *name = makecstring(s); - char *p = name; - char *q = name; - - while (*p) { - if (*p != '"') - *q++ = *p; - p++; - } - *q = '\0'; - return name; -} - /* function strips trailing zeros in string with numbers; */ /* leading zeros are not stripped (as in real life) */ char *stripzeros(char *a) |