OSDN Git Service

updated sources.
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Thu, 15 May 2014 15:05:40 +0000 (23:05 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Thu, 15 May 2014 15:05:40 +0000 (23:05 +0800)
src/texsourc/makefile
src/texsourc/md5file.c [deleted file]
src/texsourc/subroute.c
src/texsourc/yandytex.h

index c8cd8d6..ab1da22 100644 (file)
@@ -5,13 +5,6 @@
 
 # Makefile for Y&YTeX
 
-# TO SET UP DEBUGGING INFO:
-# (1) add -Zi to CFLAGS for CL
-# (2) add /MAP /DEBUG /PDB:yandytex.pdb for LINK
-
-# NOTE: full optimization causes some problems especially in TEX5.C & TEX6.C
-# NOTE: assuming no aliasing causes some problems especially in TEXMF.C
-
 CC = cl
 LINK = link
 RC = rc
@@ -25,7 +18,8 @@ RC = rc
 # Release version
 # CFLAGS=/c /Ge /Gy /Gf /Ox /W4 /DMSDOS /DTeX /DPHARLAP /DNDEBUG /Ilib /YX
 CFLAGS=/nologo /c /MT /GF /Gy /Ox /W4 /DMSDOS /DTeX /DPHARLAP /DNDEBUG \
-       /I"kpathsea" /I"libharu/include" /I"libharu/win32/include" /I"zlib"
+       /I"kpathsea" /I"libharu/include" /I"libharu/win32/include" /I"zlib" \
+       /I"libmd5"
 # Debugging version
 # CFLAGS=/c /Ge /Gy /Gf /Od /Zi /W4 /DMSDOS /DTeX /DPHARLAP /Ilib /YX
 
@@ -44,15 +38,14 @@ LFLAGS=/NOLOGO /MAP
 objs = yandytex.obj itex.obj openinou.obj subroute.obj local.obj \
        tex0.obj tex1.obj tex2.obj tex3.obj tex4.obj \
        tex5.obj tex6.obj tex7.obj tex8.obj tex9.obj \
-       yandy_pool.obj yandytex.res md5.obj md5file.obj \
-       yandy_pdf_backend.obj
+       yandy_pool.obj yandytex.res md5.obj yandy_pdf_backend.obj
 
 # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
 
 yandytex.exe: $(objs)
        $(LINK) $(LFLAGS) yandytex itex openinou subroute local \
        tex0 tex1 tex2 tex3 tex4 tex5 tex6 tex7 tex8 tex9 \
-       yandy_pool yandytex.res md5 md5file yandy_pdf_backend \
+       yandy_pool yandytex.res md5 yandy_pdf_backend \
        kpathsea\kpathsea.lib libharu\libhpdf.lib libpng\libpng.lib zlib\zlib.lib
        del ..\yandy\bin\yandytex.exe
        copy yandytex.exe ..\yandy\bin\yandytex.exe
@@ -63,9 +56,6 @@ yandy_pdf_backend.obj: yandy_pdf_backend.c
 md5.obj: libmd5\md5.c
        $(CC) -Ilibmd5 $(CFLAGS) libmd5\md5.c
 
-md5file.obj: md5file.c
-       $(CC) -Ilibmd5 $(CFLAGS) md5file.c
-
 yandytex.res: yandytex.rc
        rc yandytex.rc
 
diff --git a/src/texsourc/md5file.c b/src/texsourc/md5file.c
deleted file mode 100644 (file)
index 4ce9d04..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Copyright 2014 Clerk Ma
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301 USA.  */
-
-#pragma warning(disable:4996)
-
-#include <stdio.h>
-#include "libmd5/md5.h"
-
-char * md5_file_name(const char * file_name)
-{
-  md5_state_t md5_ship;
-  md5_byte_t  md5_data[1024];
-  md5_byte_t  md5_digest[16];
-  static char md5_hex[33];
-  int         md5_len;
-  FILE * ship_file;
-  int i;
-
-  ship_file = fopen(file_name, "rb");
-
-  md5_init(&md5_ship);
-
-  while ((md5_len = fread(md5_data, 1, 1024, ship_file)) != 0)
-    md5_append(&md5_ship, md5_data, md5_len);
-
-  md5_finish(&md5_ship, md5_digest);
-
-  fclose(ship_file);
-
-  for (i = 0; i < 16; ++i)
-    sprintf(md5_hex + i * 2, "%02X", md5_digest[i]);
-
-  return md5_hex;
-}
-
-char * md5_file(FILE * in_file)
-{
-  md5_state_t md5_ship;
-  md5_byte_t  md5_data[1024];
-  md5_byte_t  md5_digest[16];
-  static char md5_hex[33];
-  int         md5_len;
-  int i;
-
-  md5_init(&md5_ship);
-
-  while ((md5_len = fread(md5_data, 1, 1024, in_file)) != 0)
-    md5_append(&md5_ship, md5_data, md5_len);
-
-  md5_finish(&md5_ship, md5_digest);
-
-  fclose(in_file);
-
-  for (i = 0; i < 16; ++i)
-    sprintf(md5_hex + i * 2, "%02X", md5_digest[i]);
-
-  return md5_hex;
-}
-
-#ifdef MD5TEST
-int main(void)
-{
-  printf("%s", md5_file("md5.c"));
-
-  return 0;
-}
-#endif
index 84cba11..4185e29 100644 (file)
@@ -105,4 +105,55 @@ char * unixify (char * t)
   }
 
   return t;
+}
+
+char * md5_file_name(const char * file_name)
+{
+  md5_state_t md5_ship;
+  md5_byte_t  md5_data[1024];
+  md5_byte_t  md5_digest[16];
+  static char md5_hex[33];
+  int         md5_len;
+  FILE * ship_file;
+  int i;
+
+  ship_file = fopen(file_name, "rb");
+
+  md5_init(&md5_ship);
+
+  while ((md5_len = fread(md5_data, 1, 1024, ship_file)) != 0)
+    md5_append(&md5_ship, md5_data, md5_len);
+
+  md5_finish(&md5_ship, md5_digest);
+
+  fclose(ship_file);
+
+  for (i = 0; i < 16; ++i)
+    sprintf(md5_hex + i * 2, "%02X", md5_digest[i]);
+
+  return md5_hex;
+}
+
+char * md5_file(FILE * in_file)
+{
+  md5_state_t md5_ship;
+  md5_byte_t  md5_data[1024];
+  md5_byte_t  md5_digest[16];
+  static char md5_hex[33];
+  int         md5_len;
+  int i;
+
+  md5_init(&md5_ship);
+
+  while ((md5_len = fread(md5_data, 1, 1024, in_file)) != 0)
+    md5_append(&md5_ship, md5_data, md5_len);
+
+  md5_finish(&md5_ship, md5_digest);
+
+  fclose(in_file);
+
+  for (i = 0; i < 16; ++i)
+    sprintf(md5_hex + i * 2, "%02X", md5_digest[i]);
+
+  return md5_hex;
 }
\ No newline at end of file
index 5769fff..00ce6a8 100644 (file)
@@ -54,7 +54,8 @@
 #else
   #include <unistd.h>
 #endif
-#include <zlib.h>
+#include "zlib.h"
+#include "md5.h"
 #include "hpdf.h"
 #include "hpdf_utils.h"