From 0afe9b3464b06d9b1d4b8f3bb33b110d6d970a7c Mon Sep 17 00:00:00 2001
From: magnum <magnum>
Date: Fri, 16 Sep 2011 20:00:08 +0200
Subject: [PATCH] legacy function names fixed in unicode.[ch]

---
 src/unicode.c |   16 ++++++++--------
 src/unicode.h |    8 ++++----
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/unicode.c b/src/unicode.c
index 7f1924c..32b41ee 100644
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -591,7 +591,7 @@ char * utf8_to_enc_r (UTF8 *src, char* dst)
 	UTF16 tmp16[PLAINTEXT_BUFFER_SIZE + 1];
 	utf8_to_utf16(tmp16, PLAINTEXT_BUFFER_SIZE, (unsigned char*)src,
 	              PLAINTEXT_BUFFER_SIZE);
-	dst = (char*)utf16_to_plain_r((UTF8*)dst, PLAINTEXT_BUFFER_SIZE, tmp16);
+	dst = (char*)utf16_to_enc_r((UTF8*)dst, PLAINTEXT_BUFFER_SIZE, tmp16);
 	return dst;
 }
 
@@ -600,11 +600,11 @@ char * utf8_to_enc_r (UTF8 *src, char* dst)
 // Non thread-safe version
 UTF8 *utf16_to_enc (const UTF16 *source) {
 	static UTF8 ret_Key[PLAINTEXT_BUFFER_SIZE + 1];
-	return utf16_to_plain_r(ret_Key, PLAINTEXT_BUFFER_SIZE, source);
+	return utf16_to_enc_r(ret_Key, PLAINTEXT_BUFFER_SIZE, source);
 }
 
 // Thread-safe version
-UTF8 *utf16_to_plain_r (UTF8 *dst, int dst_len, const UTF16 *source) {
+UTF8 *utf16_to_enc_r (UTF8 *dst, int dst_len, const UTF16 *source) {
 	if (options.utf8)
 		return utf16_to_utf8_r(dst, dst_len, source);
 	else {
@@ -846,7 +846,7 @@ int initUnicode(int type) {
 
 /* single char conversion inlines. Inlines vs macros, so that we get type 'safety'           */
 /* NOTE these functions do NOT return multi UTF16 conversion characters, so they are         */
-/* only 'partly' proper.  The plain_to_utf16_uc() and  plain_to_utf16_lc() do full conversions as    */
+/* only 'partly' proper.  The enc_to_utf16_uc() and  enc_to_utf16_lc() do full conversions as    */
 /* does the utf16_lc() and utf16_uc().  Full conversion uses the utc_*case[] arrays, but  it */
 /* also uses the 1 UTC2 to multi UTC2 lookup table to do things 'properly'.                  */
 //_inline unsigned char low2up_ansi(unsigned char c) {if (ucs2_upcase[c]) {return ucs2_upcase[c]; return c; }
@@ -855,10 +855,10 @@ int initUnicode(int type) {
 //_inline UTF16 up2low_u16(UTF16 w) {if (ucs2_downcase[w]) return ucs2_downcase[w]; return w; }
 
 /* Convert to UTF-16LE from UTF-8 or ISO-8859-1 depending on --encoding=utf8 flag, and upcase/lowcase at same time */
-//int plain_to_utf16_uc(UTF16 *dst, unsigned int maxdstlen, const UTF8 *src, unsigned int srclen) {
+//int enc_to_utf16_uc(UTF16 *dst, unsigned int maxdstlen, const UTF8 *src, unsigned int srclen) {
 //	return 0;
 //}
-//int plain_to_utf16_lc(UTF16 *dst, unsigned int maxdstlen, const UTF8 *src, unsigned int srclen) {
+//int enc_to_utf16_lc(UTF16 *dst, unsigned int maxdstlen, const UTF8 *src, unsigned int srclen) {
 //	return 0;
 //}
 
@@ -960,7 +960,7 @@ int enc_lc(UTF8 *dst, unsigned dst_len, const UTF8 *src, unsigned src_len) {
 	utf16len = utf16_lc(tmp16l, 512, tmp16, utf16len);
 	if (utf16len <= 0)
 		goto lcFallback;
-	utf16_to_plain_r(dst, dst_len, tmp16l);
+	utf16_to_enc_r(dst, dst_len, tmp16l);
 	return strlen((char*)dst);
 
 	// Limp-home mode: If we failed doing the right thing (garbage data) we
@@ -1018,7 +1018,7 @@ int enc_uc(UTF8 *dst, unsigned dst_len, const UTF8 *src, unsigned src_len) {
 	utf16len = utf16_uc(tmp16u, 512, tmp16, utf16len);
 	if (utf16len <= 0)
 		goto ucFallback;
-	utf16_to_plain_r(dst, dst_len, tmp16u);
+	utf16_to_enc_r(dst, dst_len, tmp16u);
 	return strlen((char*)dst);
 
 	// Limp-home mode: If we failed doing the right thing (garbage data) we
diff --git a/src/unicode.h b/src/unicode.h
index 9678163..bebab99 100644
--- a/src/unicode.h
+++ b/src/unicode.h
@@ -84,7 +84,7 @@ extern UTF8 * utf16_to_utf8_r (UTF8 *dst, int dst_len, const UTF16* source);
 /* Convert back to UTF-8 or ISO-8859-1 depending on --encoding= flag
  * (for get_key without a saved_plain) */
 extern UTF8 * utf16_to_enc (const UTF16* source);
-extern UTF8 * utf16_to_plain_r (UTF8 *dst, int dst_len, const UTF16* source);
+extern UTF8 * utf16_to_enc_r (UTF8 *dst, int dst_len, const UTF16* source);
 
 /* These were in smbencrypt.c before: */
 
@@ -106,7 +106,7 @@ extern UTF16 ucs2_downcase[0x10000]; /* array. The 1 is not valid, just an indic
 
 /* single char conversion inlines. Inlines vs macros, so that we get type 'safety'           */
 /* NOTE these functions do NOT return multi UTF16 conversion characters, so they are         */
-/* only 'partly' proper.  The plain_to_utf16_uc() and  plain_to_utf16_lc() do full conversions as    */
+/* only 'partly' proper.  The enc_to_utf16_uc() and  enc_to_utf16_lc() do full conversions as    */
 /* does the utf16_lc() and utf16_uc().  Full conversion uses the utc_*case[] arrays, but  it */
 /* also uses the 1 UTC2 to multi UTC2 lookup table to do things 'properly'.                  */
 /* NOTE low2up_ansi() does not handle 0xDF to "SS" conversion, since it is 1 to many.       */
@@ -116,8 +116,8 @@ static inline UTF16 low2up_u16(UTF16 w) {if (ucs2_upcase[w]&0xFFFE) return ucs2_
 static inline UTF16 up2low_u16(UTF16 w) {if (ucs2_downcase[w]&0xFFFE) return ucs2_downcase[w]; return w; }
 
 /* Convert to UTF-16LE from UTF-8 or ISO-8859-1 depending on --encoding= flag, and upcase/lowcase at same time */
-//extern int plain_to_utf16_uc(UTF16 * dst, unsigned int maxdstlen, const UTF8 * src, unsigned int srclen);
-//extern int plain_to_utf16_lc(UTF16 * dst, unsigned int maxdstlen, const UTF8 * src, unsigned int srclen);
+//extern int enc_to_utf16_uc(UTF16 * dst, unsigned int maxdstlen, const UTF8 * src, unsigned int srclen);
+//extern int enc_to_utf16_lc(UTF16 * dst, unsigned int maxdstlen, const UTF8 * src, unsigned int srclen);
 
 // Lowercase UTF-16 string
 extern int utf16_lc(UTF16 *dst, unsigned dst_len, const UTF16 *src, unsigned src_len);
-- 
1.7.4.1

