summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-12 11:06:16 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-12 11:06:16 +0000
commit73447a07f1f4c93539418cc14fbfbbe6ede62728 (patch)
treeed4f5efb169a8e20e9947af3b09aee9b886452d4 /Build
parentaecb768e7189355e7b96d2796a6ec23133088840 (diff)
texk/dvipdfm-x: Moved check_for_mp() and declared as static
git-svn-id: svn://tug.org/texlive/trunk@38104 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog5
-rw-r--r--Build/source/texk/dvipdfm-x/mpost.c25
-rw-r--r--Build/source/texk/dvipdfm-x/mpost.h4
-rw-r--r--Build/source/texk/dvipdfm-x/pdfximage.c28
4 files changed, 32 insertions, 30 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index e4516a1bdad..88d9d6159ab 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * mpost.[ch]: Extern check_for_mp() moved from here ...
+ * pdfximage.c: ... to here as static.
+
2015-08-05 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* dvi.c: Introduce a new static function static int is_notdef_notzero()
diff --git a/Build/source/texk/dvipdfm-x/mpost.c b/Build/source/texk/dvipdfm-x/mpost.c
index 36476929021..047d4767650 100644
--- a/Build/source/texk/dvipdfm-x/mpost.c
+++ b/Build/source/texk/dvipdfm-x/mpost.c
@@ -1,6 +1,6 @@
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
- Copyright (C) 2007-2014 by Jin-Hwan Cho and Shunsaku Hirata,
+ Copyright (C) 2007-2015 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
@@ -1658,26 +1658,3 @@ mps_do_page (FILE *image_file)
*/
return (error ? -1 : 0);
}
-
-int
-check_for_mp (FILE *image_file)
-{
- int try_count = 10;
-
- rewind (image_file);
- mfgets(work_buffer, WORK_BUFFER_SIZE, image_file);
- if (strncmp(work_buffer, "%!PS", 4))
- return 0;
-
- while (try_count > 0) {
- mfgets(work_buffer, WORK_BUFFER_SIZE, image_file);
- if (!strncmp(work_buffer, "%%Creator:", 10)) {
- if (strlen(work_buffer+10) >= 8 &&
- strstr(work_buffer+10, "MetaPost"))
- break;
- }
- try_count--;
- }
-
- return ((try_count > 0) ? 1 : 0);
-}
diff --git a/Build/source/texk/dvipdfm-x/mpost.h b/Build/source/texk/dvipdfm-x/mpost.h
index abb6c3b8c24..a2980a4b314 100644
--- a/Build/source/texk/dvipdfm-x/mpost.h
+++ b/Build/source/texk/dvipdfm-x/mpost.h
@@ -1,6 +1,6 @@
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
- Copyright (C) 2002-2014 by Jin-Hwan Cho and Shunsaku Hirata,
+ Copyright (C) 2002-2015 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
@@ -27,8 +27,6 @@
#include "pdfximage.h"
#include "pdfdev.h"
-extern int check_for_mp (FILE *fp);
-
extern int mps_scan_bbox (const char **pp, const char *endptr, pdf_rect *bbox);
/* returns xobj_id */
diff --git a/Build/source/texk/dvipdfm-x/pdfximage.c b/Build/source/texk/dvipdfm-x/pdfximage.c
index 8765e3a4f10..5e6aa96344c 100644
--- a/Build/source/texk/dvipdfm-x/pdfximage.c
+++ b/Build/source/texk/dvipdfm-x/pdfximage.c
@@ -1,6 +1,6 @@
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
- Copyright (C) 2007-2014 by Jin-Hwan Cho and Shunsaku Hirata,
+ Copyright (C) 2007-2015 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
@@ -45,8 +45,8 @@
#include "pdfximage.h"
-/* From psimage.h */
-static int check_for_ps (FILE *fp);
+static int check_for_ps (FILE *image_file);
+static int check_for_mp (FILE *image_file);
static int ps_include_page (pdf_ximage *ximage, const char *file_name);
@@ -979,3 +979,25 @@ static int check_for_ps (FILE *image_file)
return 1;
return 0;
}
+
+static int check_for_mp (FILE *image_file)
+{
+ int try_count = 10;
+
+ rewind (image_file);
+ mfgets(work_buffer, WORK_BUFFER_SIZE, image_file);
+ if (strncmp(work_buffer, "%!PS", 4))
+ return 0;
+
+ while (try_count > 0) {
+ mfgets(work_buffer, WORK_BUFFER_SIZE, image_file);
+ if (!strncmp(work_buffer, "%%Creator:", 10)) {
+ if (strlen(work_buffer+10) >= 8 &&
+ strstr(work_buffer+10, "MetaPost"))
+ break;
+ }
+ try_count--;
+ }
+
+ return ((try_count > 0) ? 1 : 0);
+}