diff --git a/libycp/src/YCPBuiltinString.cc b/libycp/src/YCPBuiltinString.cc index d9adf725f..ff9165da2 100644 --- a/libycp/src/YCPBuiltinString.cc +++ b/libycp/src/YCPBuiltinString.cc @@ -1260,7 +1260,7 @@ s_crypt (const YCPString &s) string unencrypted = s->value(); string encrypted; - if (crypt_pass (unencrypted, CRYPT, &encrypted)) + if (YaST::crypt_pass(unencrypted, YaST::CRYPT, &encrypted)) return YCPString (encrypted); else { @@ -1291,7 +1291,7 @@ s_cryptmd5 (const YCPString &s) string unencrypted = s->value(); string encrypted; - if (crypt_pass (unencrypted, MD5, &encrypted)) + if (YaST::crypt_pass(unencrypted, YaST::MD5, &encrypted)) return YCPString (encrypted); else { @@ -1322,7 +1322,7 @@ s_cryptblowfish(const YCPString& original) string unencrypted = original->value(); string encrypted; - if (crypt_pass (unencrypted, BLOWFISH, &encrypted)) + if (YaST::crypt_pass(unencrypted, YaST::BLOWFISH, &encrypted)) return YCPString (encrypted); else { @@ -1353,7 +1353,7 @@ s_cryptsha256(const YCPString& original) string unencrypted = original->value(); string encrypted; - if (crypt_pass (unencrypted, SHA256, &encrypted)) + if (YaST::crypt_pass(unencrypted, YaST::SHA256, &encrypted)) return YCPString (encrypted); else { @@ -1384,7 +1384,7 @@ s_cryptsha512(const YCPString& original) string unencrypted = original->value(); string encrypted; - if (crypt_pass (unencrypted, SHA512, &encrypted)) + if (YaST::crypt_pass(unencrypted, YaST::SHA512, &encrypted)) return YCPString (encrypted); else { diff --git a/libycp/src/YCPString.cc b/libycp/src/YCPString.cc index 6a6a0c707..4afe7760d 100644 --- a/libycp/src/YCPString.cc +++ b/libycp/src/YCPString.cc @@ -40,7 +40,7 @@ YCPStringRep::YCPStringRep(const string& s) YCPStringRep::YCPStringRep(const wstring& s) : v(), is_ascii(false) { - wchar2utf8(s, &v); + YaST::wchar2utf8(s, &v); is_ascii = all_of(v.begin(), v.end(), isascii); } @@ -63,7 +63,7 @@ wstring YCPStringRep::wvalue() const { std::wstring ret; - utf82wchar(v, &ret); + YaST::utf82wchar(v, &ret); return ret; } @@ -87,7 +87,7 @@ YCPOrder YCPStringRep::compare(const YCPString& s, bool rl) const std::wstring wa, wb; - if (utf82wchar (a, &wa) && utf82wchar (b, &wb)) + if (YaST::utf82wchar (a, &wa) && YaST::utf82wchar (b, &wb)) tmp = wcscoll (wa.c_str (), wb.c_str ()); else tmp = strcoll (a, b); diff --git a/libycp/src/include/ycp/y2string.h b/libycp/src/include/ycp/y2string.h index 66b4f1ce8..b62a38545 100644 --- a/libycp/src/include/ycp/y2string.h +++ b/libycp/src/include/ycp/y2string.h @@ -14,6 +14,9 @@ #include +namespace YaST +{ + bool recode (iconv_t cd, const std::string& in, std::string* out); @@ -56,5 +59,6 @@ utf82wchar (const std::string& in, std::wstring* out); bool wchar2utf8 (const std::wstring& in, std::string* out); +} #endif diff --git a/libycp/src/y2crypt.cc b/libycp/src/y2crypt.cc index 45e2a7f46..d8d0e703f 100644 --- a/libycp/src/y2crypt.cc +++ b/libycp/src/y2crypt.cc @@ -28,6 +28,8 @@ extern "C" { #include "y2log.h" #include "y2crypt.h" +namespace YaST +{ static int read_loop (int fd, char* buffer, int count) @@ -182,3 +184,5 @@ crypt_pass (string unencrypted, crypt_t use_crypt, string* encrypted) *encrypted = string (newencrypted); return true; } + +} diff --git a/libycp/src/y2crypt.h b/libycp/src/y2crypt.h index a5515be02..ed0109eec 100644 --- a/libycp/src/y2crypt.h +++ b/libycp/src/y2crypt.h @@ -13,11 +13,14 @@ using std::string; +namespace YaST +{ enum crypt_t { CRYPT, MD5, BLOWFISH, SHA256, SHA512 }; bool crypt_pass (string unencrypted, crypt_t use_crypt, string* encrypted); +} #endif diff --git a/libycp/src/y2string.cc b/libycp/src/y2string.cc index 710255e0b..0d82b349e 100644 --- a/libycp/src/y2string.cc +++ b/libycp/src/y2string.cc @@ -11,6 +11,9 @@ #include "y2string.h" +namespace YaST +{ + template void recode_errors(const In& in, const Out* out) { @@ -159,3 +162,5 @@ wchar2utf8 (const std::wstring& in, std::string* out) return recode (cd, in, out); } + +}