diff options
Diffstat (limited to 'hwpfilter/source/hwpfile.cpp')
-rw-r--r-- | hwpfilter/source/hwpfile.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/hwpfilter/source/hwpfile.cpp b/hwpfilter/source/hwpfile.cpp index 5d8b5f09e910..2b1bde79f7d1 100644 --- a/hwpfilter/source/hwpfile.cpp +++ b/hwpfilter/source/hwpfile.cpp @@ -43,14 +43,9 @@ #include "hcode.h" #include "hstream.h" -#define HWPIDLen 30 #define HWPHeadLen 128 #define HWPSummaryLen 1008 -#define V20SIGNATURE "HWP Document File V2.00 \032\1\2\3\4\5" -#define V21SIGNATURE "HWP Document File V2.10 \032\1\2\3\4\5" -#define V30SIGNATURE "HWP Document File V3.00 \032\1\2\3\4\5" - #define FILESTG_SIGNATURE 0xF8995567 #define FILESTG_SIGNATURE_NORMAL 0xF8995568 @@ -127,8 +122,7 @@ int HWPFile::ReadHwpFile(HStream & stream) return State(); } - -static int hwp_version(char *str) +int detect_hwp_version(const char *str) { if (memcmp(V20SIGNATURE, str, HWPIDLen) == 0) return HWP_V20; @@ -139,7 +133,6 @@ static int hwp_version(char *str) return 0; } - // HIODev wrapper int HWPFile::Open(HStream & stream) @@ -162,7 +155,7 @@ int HWPFile::Open(HStream & stream) char idstr[HWPIDLen]; if (ReadBlock(idstr, HWPIDLen) <= 0 - || HWP_V30 != (version = hwp_version(idstr))) + || HWP_V30 != (version = detect_hwp_version(idstr))) { return SetState(HWP_UNSUPPORTED_VERSION); } |