Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

u_strlen,... collision on sabayon

  • Loading branch information...
commit cbaef9a1f17ef24dc8580efb8a3ff02719d11584 1 parent f4c41c0
@stefanocasazza authored
Showing with 456 additions and 444 deletions.
  1. +6 −8 autoconf/ltmain.sh
  2. +8 −2 configure
  3. +1 −1  examples/IR/cquery.cpp
  4. +1 −1  examples/IR/posting.cpp
  5. +1 −1  examples/IR/web_cgi.cpp
  6. +4 −4 examples/PEC_log/PEC_check_namefile.cpp
  7. +1 −1  examples/PEC_log/PEC_date_generator.cpp
  8. +14 −14 examples/PEC_log/PEC_report.cpp
  9. +6 −6 examples/PEC_log/PEC_report.h
  10. +8 −8 examples/PEC_log/PEC_report_anomalie.cpp
  11. +5 −5 examples/XAdES/context.cpp
  12. +2 −2 examples/XAdES/sign.cpp
  13. +1 −1  examples/doc_classifier/main.cpp
  14. +6 −6 examples/doc_parse/parse.cpp
  15. +6 −6 examples/download_accelerator/main.cpp
  16. +1 −1  examples/http_header/OtpAuthToken.cpp
  17. +1 −1  examples/lrp_session/session.cpp
  18. +2 −2 examples/simple_client_server/client.cpp
  19. +4 −4 examples/test_manager/test_manager.cpp
  20. +1 −1  examples/workflow/action.cpp
  21. +1 −1  examples/workflow/production.cpp
  22. +1 −1  examples/workflow/validation.cpp
  23. +4 −4 include/ulib/base/base.h
  24. +2 −2 include/ulib/base/utility.h
  25. +1 −1  include/ulib/base/win32/system.h
  26. +2 −2 include/ulib/curl/curl.h
  27. +58 −58 include/ulib/date.h
  28. +1 −1  include/ulib/dbi/dbi.h
  29. +2 −2 include/ulib/internal/common.h
  30. +1 −1  include/ulib/internal/memory_pool.h
  31. +1 −1  include/ulib/net/socket.h
  32. +2 −2 include/ulib/ssl/certificate.h
  33. +20 −20 include/ulib/string.h
  34. +1 −1  include/ulib/utility/string_ext.h
  35. +8 −2 m4/ac_compilation_environment.m4
  36. +18 −18 src/ulib/base/base.c
  37. +1 −1  src/ulib/base/base_error.c
  38. +2 −2 src/ulib/base/base_trace.c
  39. +2 −2 src/ulib/base/ssl/des3.c
  40. +13 −13 src/ulib/base/utility.c
  41. +5 −5 src/ulib/base/win32/mingw32.c
  42. +10 −10 src/ulib/base/zip/ziptool.c
  43. +4 −4 src/ulib/command.cpp
  44. +47 −47 src/ulib/date.cpp
  45. +1 −1  src/ulib/db/cdb.cpp
  46. +2 −2 src/ulib/db/rdb.cpp
  47. +1 −1  src/ulib/dbi/dbi.cpp
  48. +4 −4 src/ulib/debug/debug_common.cpp
  49. +1 −1  src/ulib/debug/error.cpp
  50. +6 −6 src/ulib/debug/objectDB.cpp
  51. +2 −2 src/ulib/debug/trace.cpp
  52. +1 −1  src/ulib/dynamic/plugin.cpp
  53. +3 −3 src/ulib/file.cpp
  54. +1 −1  src/ulib/file_config.cpp
  55. +1 −1  src/ulib/internal/common.cpp
  56. +3 −3 src/ulib/json/value.cpp
  57. +1 −1  src/ulib/ldap/ldap.cpp
  58. +5 −5 src/ulib/log.cpp
  59. +3 −3 src/ulib/mime/multipart.cpp
  60. +2 −2 src/ulib/net/client/client.cpp
  61. +1 −1  src/ulib/net/client/smtp.cpp
  62. +1 −1  src/ulib/net/ipaddress.cpp
  63. +1 −1  src/ulib/net/ipt_ACCOUNT.cpp
  64. +1 −1  src/ulib/net/server/plugin/mod_fcgi.cpp
  65. +2 −2 src/ulib/net/server/plugin/mod_scgi.cpp
  66. +1 −1  src/ulib/net/server/plugin/mod_shib/mod_shib.cpp
  67. +4 −4 src/ulib/net/server/plugin/mod_ssi.cpp
  68. +1 −1  src/ulib/net/server/plugin/usp/usp_translator.cpp
  69. +4 −2 src/ulib/net/server/server.cpp
  70. +1 −1  src/ulib/net/socket.cpp
  71. +1 −1  src/ulib/net/unixsocket.cpp
  72. +2 −2 src/ulib/notifier.cpp
  73. +3 −3 src/ulib/options.cpp
  74. +1 −1  src/ulib/pcre/pcre.cpp
  75. +6 −6 src/ulib/process.cpp
  76. +4 −4 src/ulib/ssh/net/sshsocket.cpp
  77. +2 −2 src/ulib/ssl/certificate.cpp
  78. +1 −1  src/ulib/ssl/crl.cpp
  79. +1 −1  src/ulib/ssl/net/sslsocket.cpp
  80. +2 −2 src/ulib/ssl/pkcs10.cpp
  81. +1 −1  src/ulib/ssl/timestamp.cpp
  82. +10 −10 src/ulib/string.cpp
  83. +2 −2 src/ulib/tokenizer.cpp
  84. +1 −1  src/ulib/ui/dialog.cpp
  85. +4 −4 src/ulib/utility/services.cpp
  86. +2 −2 src/ulib/utility/socket_ext.cpp
  87. +1 −1  src/ulib/utility/string_ext.cpp
  88. +12 −12 src/ulib/utility/uhttp.cpp
  89. +1 −1  tests/base/crypto_base64.c
  90. +1 −1  tests/base/crypto_des3.c
  91. +1 −1  tests/base/crypto_dgst.c
  92. +1 −1  tests/base/crypto_qp.c
  93. +1 −1  tests/base/crypto_url.c
  94. +1 −1  tests/base/crypto_xml.c
  95. +1 −1  tests/base/test_gzio.c
  96. +17 −17 tests/base/test_misc.c
  97. +1 −1  tests/base/test_random.c
  98. +4 −4 tests/base/test_sprintf.c
  99. BIN  tests/base/test_utility.c
  100. +1 −1  tests/base/test_zip.c
  101. +1 −1  tests/debug/test_memerror.cpp
  102. +1 −1  tests/debug/test_objectDB.cpp
  103. +1 −1  tests/debug/test_trace.cpp
  104. +1 −1  tests/examples/TSA/CA/tsaserial
  105. BIN  tests/examples/TSA/TSA/.rnd
  106. +1 −1  tests/examples/servlet/hellox.c
  107. +1 −1  tests/examples/servlet/libcaptcha2.c
  108. +1 −1  tests/examples/servlet/v8.c
  109. BIN  tests/ulib/inp/test.db
  110. +16 −16 tests/ulib/test_date.cpp
  111. +1 −1  tests/ulib/test_ipaddress.cpp
  112. +2 −2 tests/ulib/test_log.cpp
  113. +1 −1  tests/ulib/test_memory_pool.cpp
  114. +1 −1  tests/ulib/test_socket.cpp
  115. +2 −2 tests/ulib/test_timer.cpp
View
14 autoconf/ltmain.sh
@@ -136,15 +136,15 @@ progpath="$0"
: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
+: ${EGREP="grep -E"}
+: ${FGREP="grep -F"}
+: ${GREP="grep"}
: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
-: ${SED="/bin/sed"}
+: ${SED="sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
@@ -5643,8 +5643,7 @@ func_mode_link ()
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -6148,8 +6147,7 @@ func_mode_link ()
lib=
found=no
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
View
10 configure
@@ -27486,10 +27486,13 @@ if test "$cross_compiling" != "yes" && test -e /lib/libc.so.6; then
else
libc_version="unknown"
fi
-else
+fi
+
+if test -z "$libc_version"; then
libc_version="unknown"
fi
+
cat >>confdefs.h <<_ACEOF
#define LIBC_VERSION "${libc_version}"
_ACEOF
@@ -27512,10 +27515,13 @@ if test "$cross_compiling" != "yes"; then
else
stdgpp_version="unknown"
fi
-else
+fi
+
+if test -z "$stdgpp_version"; then
stdgpp_version="unknown"
fi
+
cat >>confdefs.h <<_ACEOF
#define STDGPP_VERSION "${stdgpp_version}"
_ACEOF
View
2  examples/IR/cquery.cpp
@@ -248,7 +248,7 @@ void Query::run(const char* ptr)
{
U_TRACE(5, "Query::run(%S)", ptr)
- *UPosting::word = UStringExt::removeEscape(UStringExt::trim(ptr, u_strlen(ptr)));
+ *UPosting::word = UStringExt::removeEscape(UStringExt::trim(ptr, u_str_len(ptr)));
U_INTERNAL_DUMP("UPosting::word = %.*S", U_STRING_TO_TRACE(*UPosting::word))
View
2  examples/IR/posting.cpp
@@ -1420,7 +1420,7 @@ U_NO_EXPORT void UPosting::printDocName(UStringRep* doc_id, UStringRep* doc_name
char _buffer[20];
- os->write(_buffer, u_snprintf(_buffer, sizeof(_buffer), "%llX ", *((uint64_t*)(doc_id->data()))));
+ os->write(_buffer, u_sn_printf(_buffer, sizeof(_buffer), "%llX ", *((uint64_t*)(doc_id->data()))));
doc_name->write(*os);
View
2  examples/IR/web_cgi.cpp
@@ -155,7 +155,7 @@ class DataSession {
char buffer[20];
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", TIME));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", TIME));
*UObjectIO::os << '\n'
<< "FOR_PAGE " << FOR_PAGE << '\n'
View
8 examples/PEC_log/PEC_check_namefile.cpp
@@ -13,8 +13,8 @@ un nome di link simbolico (PEC1-2007-03-22#2007-03-23.lnk) che specifica la corr
#include "PEC_report.h"
-static UDate* inizio;
-static UDate* fine;
+static UTimeDate* inizio;
+static UTimeDate* fine;
class Application : public PEC_report {
public:
@@ -75,8 +75,8 @@ class Application : public PEC_report {
{
U_TRACE(5, "Application::start()")
- inizio = new UDate;
- fine = new UDate;
+ inizio = new UTimeDate;
+ fine = new UTimeDate;
resetDate();
View
2  examples/PEC_log/PEC_date_generator.cpp
@@ -37,7 +37,7 @@ class Application : public UApplication {
if (cfg_from.empty() ||
cfg_to.empty()) U_ERROR("parameters <from> and <to> are mandatory...");
- UDate from(cfg_from.c_str()),
+ UTimeDate from(cfg_from.c_str()),
to(cfg_to.c_str());
if (from.isValid() == false) U_ERROR("starting date <%s> not valid...", cfg_from.data());
View
28 examples/PEC_log/PEC_report.cpp
@@ -12,11 +12,11 @@ UApplication* PEC_report::pthis;
time_t PEC_report::nseconds;
uint64_t PEC_report::bytes;
-UDate* PEC_report::to;
-UDate* PEC_report::fix;
-UDate* PEC_report::from;
-UDate* PEC_report::date;
-UDate* PEC_report::date1;
+UTimeDate* PEC_report::to;
+UTimeDate* PEC_report::fix;
+UTimeDate* PEC_report::from;
+UTimeDate* PEC_report::date;
+UTimeDate* PEC_report::date1;
UFile* PEC_report::file;
UString* PEC_report::title;
UString* PEC_report::domain;
@@ -542,7 +542,7 @@ void PEC_report::setLineIdentifier()
if (identifier->size() == 9 &&
ptr2[3] == ' ' &&
ptr2[6] == ' ' &&
- UDate::getMonth(ptr2))
+ UTimeDate::getMonth(ptr2))
{
/*
Feb 24 19:42:21 PEC_Milter root [1542]: Feb 24 19:42:35 PEC_Milter root [1546]: E452BE9C.0004057A.F50FB719.D305B319.posta-certificata@postecert.it: tipo=posta-certificata (BustaTrasporto): mittente=ifinanziarie@pec.gdf.it: destinatari=attivitariunite@actaliscertymail.it (certificato): oggetto=Richiesta n.<jdz9yb_1wrjlt>: message-id=E452BE9C.0004057A.F50FB719.D305B319.posta-certificata@postecert.it: gestore=Postecom S.p.A.: tipo_ricevuta=sintetica
@@ -827,7 +827,7 @@ bool PEC_report::setLine()
else
{
ptr = line->data();
- mese1 = UDate::getMonth(ptr);
+ mese1 = UTimeDate::getMonth(ptr);
U_INTERNAL_DUMP("mese1 = %d", mese1)
@@ -855,7 +855,7 @@ bool PEC_report::setLine()
while ((*end == '\n') && (++end < enddoc)) {}
- mese2 = UDate::getMonth(end);
+ mese2 = UTimeDate::getMonth(end);
U_INTERNAL_DUMP("mese2 = %d", mese2)
@@ -952,7 +952,7 @@ bool PEC_report::readContent()
U_INTERNAL_DUMP("scan line date: %d/%s/%d - %s", day, month, year, time)
- U_INTERNAL_ASSERT_EQUALS(mese1, UDate::getMonth(month))
+ U_INTERNAL_ASSERT_EQUALS(mese1, UTimeDate::getMonth(month))
date->set(day, mese1, year);
@@ -1317,14 +1317,14 @@ void PEC_report::manageOptions()
if (cfg_from.empty() == false)
{
- from = new UDate(cfg_from.c_str());
+ from = new UTimeDate(cfg_from.c_str());
if (from->isValid() == false) U_ERROR("starting date <%s> not valid...", cfg_from.data());
}
if (cfg_to.empty() == false)
{
- to = new UDate(cfg_to.c_str());
+ to = new UTimeDate(cfg_to.c_str());
if (to->isValid() == false) U_ERROR("ending date <%s> not valid...", cfg_to.data());
}
@@ -1340,8 +1340,8 @@ void PEC_report::manageOptions()
t = new UTokenizer;
file = new UFile;
- date = new UDate;
- date1 = new UDate;
+ date = new UTimeDate;
+ date1 = new UTimeDate;
line = new UString;
content = new UString;
last_dominio = new UString;
@@ -1364,7 +1364,7 @@ void PEC_report::manageOptions()
}
else
{
- fix = new UDate("01/04/2007");
+ fix = new UTimeDate("01/04/2007");
vfields = new UString(U_CONSTANT_TO_PARAM(U_TIPO " " // 0
U_MITTENTE " " // 1
View
12 examples/PEC_log/PEC_report.h
@@ -123,11 +123,11 @@ class PEC_report : public UApplication {
static int last_field;
static UString* last_value_field;
- static UDate* to;
- static UDate* fix;
- static UDate* from;
- static UDate* date;
- static UDate* date1;
+ static UTimeDate* to;
+ static UTimeDate* fix;
+ static UTimeDate* from;
+ static UTimeDate* date;
+ static UTimeDate* date1;
static UFile* file;
static UTokenizer* t;
static UString* title;
@@ -199,7 +199,7 @@ class PEC_report : public UApplication {
{
U_TRACE(5, "PEC_report::getTime()")
- time_t _t = UDate::getSecondFromTime(line->c_pointer(U_LINEDATA+1));
+ time_t _t = UTimeDate::getSecondFromTime(line->c_pointer(U_LINEDATA+1));
U_RETURN(_t);
}
View
16 examples/PEC_log/PEC_report_anomalie.cpp
@@ -889,42 +889,42 @@ const char* Messaggio::dump(bool reset) const
char buffer[2048];
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", flag));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", flag));
*UObjectIO::os << '\n'
<< "vdestinatari_domini ";
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", vdestinatari_domini));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", vdestinatari_domini));
*UObjectIO::os << '\n'
<< "vdestinatari_certificati ";
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", vdestinatari_certificati));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", vdestinatari_certificati));
*UObjectIO::os << '\n'
<< "vdestinatari_presa_in_carico ";
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", vdestinatari_presa_in_carico));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", vdestinatari_presa_in_carico));
*UObjectIO::os << '\n'
<< "vdestinatari_mancata_consegna ";
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", vdestinatari_mancata_consegna));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", vdestinatari_mancata_consegna));
*UObjectIO::os << '\n'
<< "vdestinatari_avvenuta_consegna ";
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", vdestinatari_avvenuta_consegna));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", vdestinatari_avvenuta_consegna));
*UObjectIO::os << '\n'
<< "vdestinatari_rilevazione_virus ";
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", vdestinatari_rilevazione_virus));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", vdestinatari_rilevazione_virus));
*UObjectIO::os << '\n'
<< "vdestinatari_mancata_consegna_virus ";
- UObjectIO::os->write(buffer, u_snprintf(buffer, sizeof(buffer), "%S", vdestinatari_mancata_consegna_virus));
+ UObjectIO::os->write(buffer, u_sn_printf(buffer, sizeof(buffer), "%S", vdestinatari_mancata_consegna_virus));
*UObjectIO::os << '\n'
<< "id (UString " << (void*)&id << ")\n"
View
10 examples/XAdES/context.cpp
@@ -105,7 +105,7 @@ UBaseTransform* UTransformCtx::findByHref(const char* href)
/* check with enabled transforms list */
- uint32_t i = enabledTransforms->find(href, u_strlen(href));
+ uint32_t i = enabledTransforms->find(href, u_str_len(href));
if (i == U_NOT_FOUND) U_RETURN_POINTER(0, UBaseTransform);
@@ -566,7 +566,7 @@ bool UTransformCtx::verifyNodeContent(xmlNodePtr node, UString& signature_value)
const char* content = (const char*) UXML2Node::getContent(node);
- uint32_t size = u_strlen(content);
+ uint32_t size = u_str_len(content);
(void) signature_value.reserve(size);
@@ -909,7 +909,7 @@ bool UTransformCtx::setURI(const char* _uri, xmlNodePtr node)
int uriType = 0;
if ( _uri == 0 ||
- u_strlen(_uri) == 0)
+ u_str_len(_uri) == 0)
{
uriType = EMPTY;
}
@@ -970,7 +970,7 @@ bool UTransformCtx::setURI(const char* _uri, xmlNodePtr node)
static char buf[128];
- (void) u_snprintf(buf, sizeof(buf), "xpointer(id(\'%s\'))", xptr + 1);
+ (void) u_sn_printf(buf, sizeof(buf), "xpointer(id(\'%s\'))", xptr + 1);
xptr = buf;
@@ -987,7 +987,7 @@ bool UTransformCtx::setURI(const char* _uri, xmlNodePtr node)
{
// check for XADES
- if (u_find(xptr, u_strlen(xptr), U_CONSTANT_TO_PARAM("idPackageSignature-SignedProperties")))
+ if (u_find(xptr, u_str_len(xptr), U_CONSTANT_TO_PARAM("idPackageSignature-SignedProperties")))
{
transform->tag = U_STRING_FROM_CONSTANT("xades:SignedProperties");
View
4 examples/XAdES/sign.cpp
@@ -366,7 +366,7 @@ class Application : public UApplication {
if (signing_time)
{
- UString dateTime = UDate::strftime("%Y-%m-%dT%H:%M:%SZ", 0);
+ UString dateTime = UTimeDate::strftime("%Y-%m-%dT%H:%M:%SZ", 0);
signingTime.snprintf(U_XADES_SIGNING_TIME_TEMPLATE, U_STRING_TO_TRACE(dateTime));
}
@@ -493,7 +493,7 @@ class Application : public UApplication {
CRL = crl.getEncoded("DER");
CRLNumber = crl.getNumber();
CRLIssuerName = crl.getIssuerForLDAP();
- CRLIssueTime = UDate::strftime("%Y-%m-%dT%H:%M:%SZ", crl.getIssueTime());
+ CRLIssueTime = UTimeDate::strftime("%Y-%m-%dT%H:%M:%SZ", crl.getIssueTime());
DigestValue.setEmpty();
View
2  examples/doc_classifier/main.cpp
@@ -31,7 +31,7 @@ class Application : public UApplication {
if (str_time.empty() == false)
{
- DocumentClassifier::certsVerificationTime = UDate::getSecondFromTime(str_time.data(), false, "%4d-%02d-%02d+%02d:%02d:%02d");
+ DocumentClassifier::certsVerificationTime = UTimeDate::getSecondFromTime(str_time.data(), false, "%4d-%02d-%02d+%02d:%02d:%02d");
U_INTERNAL_DUMP("certsVerificationTime = %ld", DocumentClassifier::certsVerificationTime)
}
View
12 examples/doc_parse/parse.cpp
@@ -213,7 +213,7 @@ class Application : public UApplication {
{
U_TRACE(5, "Application::printHTMLElement()")
- uint32_t len = u_snprintf(buffer, sizeof(buffer), U_HTML_ELEMENT_TEMPLATE, icon, filename, old_prefix, old_buffer_len, old_buffer);
+ uint32_t len = u_sn_printf(buffer, sizeof(buffer), U_HTML_ELEMENT_TEMPLATE, icon, filename, old_prefix, old_buffer_len, old_buffer);
cout.write(buffer, len);
@@ -246,10 +246,10 @@ class Application : public UApplication {
char branch[10], folder[10];
- (void) u_snprintf(branch, sizeof(branch), "branch%02u", num_tag),
- (void) u_snprintf(folder, sizeof(folder), "folder%02u", num_tag++);
+ (void) u_sn_printf(branch, sizeof(branch), "branch%02u", num_tag),
+ (void) u_sn_printf(folder, sizeof(folder), "folder%02u", num_tag++);
- uint32_t len = u_snprintf(buffer, sizeof(buffer), U_HTML_FOLDER_TEMPLATE, branch, folder, folder, folder, old_buffer_len, old_buffer, branch);
+ uint32_t len = u_sn_printf(buffer, sizeof(buffer), U_HTML_FOLDER_TEMPLATE, branch, folder, folder, folder, old_buffer_len, old_buffer, branch);
cout.write(buffer, len);
}
@@ -273,7 +273,7 @@ class Application : public UApplication {
if (treeview ||
extract_tag)
{
- nt = u_snprintf(tag, sizeof(tag), " tag%03u \"", num_tag++);
+ nt = u_sn_printf(tag, sizeof(tag), " tag%03u \"", num_tag++);
if (extract_tag &&
strncmp(extract_tag, tag + sizeof("tag"), 3) == 0)
@@ -369,7 +369,7 @@ class Application : public UApplication {
if (treeview)
{
char depth[10];
- uint32_t nd = u_snprintf(depth, sizeof(depth), "\" on %u", num_tab);
+ uint32_t nd = u_sn_printf(depth, sizeof(depth), "\" on %u", num_tab);
(void) output->append(tag, nt);
(void) output->append(u_buffer_ptr, u_buffer_len);
View
12 examples/download_accelerator/main.cpp
@@ -107,7 +107,7 @@ class ProgressBar : public UEventTime {
total_length = initial + to_download;
initial_length = initial;
- size_legible_len = u_snprintf(size_legible, sizeof(size_legible), "%'lu", total_length);
+ size_legible_len = u_sn_printf(size_legible, sizeof(size_legible), "%'lu", total_length);
screen_width = u_getScreenWidth();
@@ -132,7 +132,7 @@ class ProgressBar : public UEventTime {
U_INTERNAL_ASSERT(size <= total_length)
- size_legible_len = u_snprintf(size_legible, sizeof(size_legible), "%'lu", size);
+ size_legible_len = u_sn_printf(size_legible, sizeof(size_legible), "%'lu", size);
unsigned dlbytes_size = 1 + U_max(size_legible_len, 13),
progress_size = screen_width - (4 + 2 + dlbytes_size + 11 + 13);
@@ -189,7 +189,7 @@ class ProgressBar : public UEventTime {
(void) sprintf(p, " %-13s", size_legible);
- p += u_strlen(p);
+ p += u_str_len(p);
// U_INTERNAL_DUMP("p - buffer = %u", p - buffer)
@@ -203,7 +203,7 @@ class ProgressBar : public UEventTime {
(void) sprintf(p, " %7.2f%s/s", dlspeed, u_short_units[units]);
- p += u_strlen(p);
+ p += u_str_len(p);
// U_INTERNAL_DUMP("p - buffer = %u", p - buffer)
@@ -242,7 +242,7 @@ class ProgressBar : public UEventTime {
(void) sprintf(p, " ETA %d:%02d:%02d", eta_hrs, eta_min, eta_sec);
}
- p += u_strlen(p);
+ p += u_str_len(p);
}
else
{
@@ -958,7 +958,7 @@ class Application : public UApplication {
if (argv[optind] == NULL) U_ERROR("arg <url> not specified...");
- Url url(argv[optind], u_strlen(argv[optind]));
+ Url url(argv[optind], u_str_len(argv[optind]));
// create file dest
View
2  examples/http_header/OtpAuthToken.cpp
@@ -198,7 +198,7 @@ void OtpAuthToken::stringify(UString& field)
(void) U_SYSCALL(strftime, "%S,%d,%S,%p", (char*)ts.data(), 32, (char*)"%Y%m%d%H%M%S", localtime(&timestamp));
- len = u_strlen(ts.data());
+ len = u_str_len(ts.data());
U_STR_SIZE_ADJUST_FORCE(ts, len);
}
View
2  examples/lrp_session/session.cpp
@@ -180,7 +180,7 @@ class Application : public UApplication {
"<REQUEST sid=\"sid1\" version=\"1\"><IMPORT-POLICYLABEL name=\"%s\">%s</IMPORT-POLICYLABEL></REQUEST>"
"<REQUEST sid=\"sid2\" version=\"1\"><EXECUTE-POLICYLABEL name=\"%s\" command=\"%s\"/></REQUEST>";
- request_size = u_snprintf(request_buffer, sizeof(request_buffer), request_tmpl, policy, ptr, policy, operation);
+ request_size = u_sn_printf(request_buffer, sizeof(request_buffer), request_tmpl, policy, ptr, policy, operation);
request = UString(request_buffer, request_size);
View
4 examples/simple_client_server/client.cpp
@@ -148,11 +148,11 @@ class Application : public UApplication {
{
flag_log = true;
- u_init_hostname();
+ u_init_ulib_hostname();
U_INTERNAL_DUMP("u_hostname(%u) = %.*S", u_hostname_len, u_hostname_len, u_hostname)
- u_init_username();
+ u_init_ulib_username();
ulog->setClient();
}
View
8 examples/test_manager/test_manager.cpp
@@ -90,7 +90,7 @@ class Application : public UApplication {
id = template_file[id_key];
result = template_file[result_key];
- buffer_len = u_snprintf(buffer, sizeof(buffer),
+ buffer_len = u_sn_printf(buffer, sizeof(buffer),
"\nStart TestID <%W%s%W>\n"
"----------------------------------"
"----------------------------------\n",
@@ -140,7 +140,7 @@ class Application : public UApplication {
if (flag_log ||
n == -1)
{
- buffer_len = u_snprintf(buffer, sizeof(buffer), "command '%s' didn't start %R\n", argv_exec[(n == -1 ? 1 : 0)], 0); // NB: the last argument (0) is necessary...
+ buffer_len = u_sn_printf(buffer, sizeof(buffer), "command '%s' didn't start %R\n", argv_exec[(n == -1 ? 1 : 0)], 0); // NB: the last argument (0) is necessary...
print(0);
}
@@ -182,7 +182,7 @@ class Application : public UApplication {
if (pass)
{
- buffer_len = u_snprintf(buffer, sizeof(buffer),
+ buffer_len = u_sn_printf(buffer, sizeof(buffer),
"----------------------------------"
"----------------------------------\n"
"End TestID <%W%s%W> - %WPASS%W\n\n",
@@ -190,7 +190,7 @@ class Application : public UApplication {
}
else
{
- buffer_len = u_snprintf(buffer, sizeof(buffer),
+ buffer_len = u_sn_printf(buffer, sizeof(buffer),
"----------------------------------"
"----------------------------------\n"
"End TestID <%W%s%W> - %WFAIL%W\n"
View
2  examples/workflow/action.cpp
@@ -85,7 +85,7 @@ bool Action::sendHttpPostRequest(const UString& url, const UString& body, const
response.setBuffer(100U);
response.snprintf("HTTP response %d", client_http.responseCode());
}
- else if (ok && strncmp(response.data(), expected, u_strlen(expected)))
+ else if (ok && strncmp(response.data(), expected, u_str_len(expected)))
{
ok = false;
View
2  examples/workflow/production.cpp
@@ -36,7 +36,7 @@ class Application : public Action {
UString arch_tmpl = UFile::contentOf(cfg[U_STRING_FROM_CONSTANT("ARCHIVE_TEMPLATE")], O_RDONLY, false, false),
url = cfg[U_STRING_FROM_CONSTANT("ELECTRONIC_ARCHIVATION_SERVICE_URL")];
- UString body(arch_tmpl.size() + request_decoded.size() + (u_strlen(uid) * 3) + 100U);
+ UString body(arch_tmpl.size() + request_decoded.size() + (u_str_len(uid) * 3) + 100U);
body.snprintf(arch_tmpl.data(), uid, uid, uid, U_STRING_TO_TRACE(request_decoded));
View
2  examples/workflow/validation.cpp
@@ -57,7 +57,7 @@ class Application : public Action {
// query to Search Engine
- UString body(10U + u_strlen(uid));
+ UString body(10U + u_str_len(uid));
body.snprintf("query=%s", uid);
View
8 include/ulib/base/base.h
@@ -67,7 +67,7 @@ extern U_EXPORT char* restrict u_pid_str;
extern U_EXPORT const char* restrict u_progpath;
extern U_EXPORT const char* restrict u_progname;
-extern U_EXPORT void u_init(char** restrict argv);
+extern U_EXPORT void u_init_ulib(char** restrict argv);
/* AT EXIT */
extern U_EXPORT vPF u_fns[32];
@@ -123,8 +123,8 @@ extern U_EXPORT const unsigned char u_hex_lower[]; /* "0123456789abcdef" */
extern U_EXPORT const char* restrict u_tmpdir;
extern U_EXPORT void u_setPid(void);
-extern U_EXPORT void u_init_username(void);
-extern U_EXPORT void u_init_hostname(void);
+extern U_EXPORT void u_init_ulib_username(void);
+extern U_EXPORT void u_init_ulib_hostname(void);
extern U_EXPORT const char* u_basename(const char* restrict path) __pure;
extern U_EXPORT const char* u_getsuffix(const char* restrict path, uint32_t len) __pure;
extern U_EXPORT uint32_t u_strftime(char* restrict buffer, uint32_t buffer_size, const char* restrict fmt, time_t now);
@@ -165,7 +165,7 @@ extern U_EXPORT int u_printf_fileno;
extern U_EXPORT int32_t u_printf_string_max_length;
extern U_EXPORT void u_printf( const char* restrict format, ...);
-extern U_EXPORT uint32_t u_snprintf(char* restrict buffer, uint32_t buffer_size, const char* restrict format, ...);
+extern U_EXPORT uint32_t u_sn_printf(char* restrict buffer, uint32_t buffer_size, const char* restrict format, ...);
extern U_EXPORT uint32_t u_vsnprintf(char* restrict buffer, uint32_t buffer_size, const char* restrict format, va_list argp);
#ifdef __cplusplus
View
4 include/ulib/base/utility.h
@@ -65,12 +65,12 @@ extern U_EXPORT void* memmem(const void* restrict haystack, size_t haystacklen,
#endif
#ifdef DEBUG
-extern U_EXPORT size_t u_strlen(const char* restrict s);
+extern U_EXPORT size_t u_str_len(const char* restrict s);
extern U_EXPORT char* u_strcpy( char* restrict dest, const char* restrict src);
extern U_EXPORT void* u_memcpy( void* restrict dest, const void* restrict src, size_t n);
extern U_EXPORT char* u_strncpy(char* restrict dest, const char* restrict src, size_t n);
#else
-# define u_strlen(s) strlen((s))
+# define u_str_len(s) strlen((s))
# define u_strcpy(dest,src) strcpy( (dest),(src))
# define u_memcpy(dest,src,n) memcpy( (dest),(src),(n))
# define u_strncpy(dest,src,n) strncpy((dest),(src),(n))
View
2  include/ulib/base/win32/system.h
@@ -314,7 +314,7 @@ extern __declspec(dllexport) int rename_w32(const char* oldpath, cons
extern __declspec(dllexport) int select_w32(int nfds, fd_set* rd, fd_set* wr, fd_set* ex, struct timeval* timeout);
extern __declspec(dllexport) HANDLE is_pipe(int fd);
-extern __declspec(dllexport) void u_init_mingw(void);
+extern __declspec(dllexport) void u_init_ulib_mingw(void);
extern __declspec(dllexport) uint64_t u_get_inode(int fd); /* INODE FOR WINDOWS - It is not stable for files on network drives (NFS) */
extern __declspec(dllexport) const char* getSysError_w32(unsigned* len);
extern __declspec(dllexport) int w32_open_osfhandle(long osfhandle, int flags);
View
4 include/ulib/curl/curl.h
@@ -77,7 +77,7 @@ class U_EXPORT UCURL {
{
U_TRACE(0, "UCURL::setURL(%S)", url)
- U_INTERNAL_ASSERT(u_isURL(url, u_strlen(url)))
+ U_INTERNAL_ASSERT(u_isURL(url, u_str_len(url)))
setOption(CURLOPT_URL, (long)url);
}
@@ -204,7 +204,7 @@ class U_EXPORT UCURL {
&formPost, &formLast,
CURLFORM_COPYNAME, key,
CURLFORM_COPYCONTENTS, value,
- CURLFORM_CONTENTSLENGTH, u_strlen(value),
+ CURLFORM_CONTENTSLENGTH, u_str_len(value),
CURLFORM_END);
U_INTERNAL_ASSERT_EQUALS(res,CURL_FORMADD_OK)
View
116 include/ulib/date.h
@@ -23,14 +23,14 @@
#include <time.h>
/**
- * The UDate class uses a julian date representation of the current year, month, and day.
+ * The UTimeDate class uses a julian date representation of the current year, month, and day.
* This is then manipulated in several forms and may be exported as needed
*/
#define FIRST_DAY 2361222 // Julian day for 1752/09/14
#define FIRST_YEAR 1752 // wrong for many countries
-class U_EXPORT UDate {
+class U_EXPORT UTimeDate {
public:
// Check for memory error
@@ -42,29 +42,29 @@ class U_EXPORT UDate {
// COSTRUTTORI
- UDate()
+ UTimeDate()
{
- U_TRACE_REGISTER_OBJECT(0, UDate, "")
+ U_TRACE_REGISTER_OBJECT(0, UTimeDate, "")
julian = _day = _month = _year = 0;
}
void fromTime(time_t tm);
- UDate(time_t tm)
+ UTimeDate(time_t tm)
{
- U_TRACE_REGISTER_OBJECT(0, UDate, "%#4D", tm)
+ U_TRACE_REGISTER_OBJECT(0, UTimeDate, "%#4D", tm)
fromTime(tm);
}
- UDate(const char* str, bool UTC = false); // UTC is flag for date and time in Coordinated Universal Time: format YYMMDDMMSSZ
+ UTimeDate(const char* str, bool UTC = false); // UTC is flag for date and time in Coordinated Universal Time: format YYMMDDMMSSZ
void setYear(int year);
void set(int day, int month, int year)
{
- U_TRACE(0, "UDate::set(%d,%d,%d)", day, month, year)
+ U_TRACE(0, "UTimeDate::set(%d,%d,%d)", day, month, year)
U_INTERNAL_ASSERT_RANGE(1, day, 31)
U_INTERNAL_ASSERT_RANGE(1, month, 12)
@@ -76,21 +76,21 @@ class U_EXPORT UDate {
setYear(year);
}
- // Construct a UDate with a given day of the year and a given year.
+ // Construct a UTimeDate with a given day of the year and a given year.
// The base date for this computation is 31 Dec. of the previous year.
- // i.e., UDate(-1,1901) = 31 Dec. 1900 and UDate(1,1901) = 2 Jan. 1901
+ // i.e., UTimeDate(-1,1901) = 31 Dec. 1900 and UTimeDate(1,1901) = 2 Jan. 1901
- UDate(int day, int year);
- UDate(int day, int month, int year);
+ UTimeDate(int day, int year);
+ UTimeDate(int day, int month, int year);
- ~UDate()
+ ~UTimeDate()
{
- U_TRACE_UNREGISTER_OBJECT(0, UDate)
+ U_TRACE_UNREGISTER_OBJECT(0, UTimeDate)
}
// ASSEGNAZIONI
- void set(const UDate& d)
+ void set(const UTimeDate& d)
{
_day = d._day;
_month = d._month;
@@ -98,18 +98,18 @@ class U_EXPORT UDate {
julian = d.julian;
}
- UDate(const UDate& d)
+ UTimeDate(const UTimeDate& d)
{
- U_TRACE_REGISTER_OBJECT(0, UDate, "%O", U_OBJECT_TO_TRACE(d))
+ U_TRACE_REGISTER_OBJECT(0, UTimeDate, "%O", U_OBJECT_TO_TRACE(d))
U_MEMORY_TEST_COPY(d)
set(d);
}
- UDate& operator=(const UDate& d)
+ UTimeDate& operator=(const UTimeDate& d)
{
- U_TRACE(0, "UDate::operator=(%O)", U_OBJECT_TO_TRACE(d))
+ U_TRACE(0, "UTimeDate::operator=(%O)", U_OBJECT_TO_TRACE(d))
U_MEMORY_TEST_COPY(d)
@@ -130,16 +130,16 @@ class U_EXPORT UDate {
// The daysTo() function returns the number of days between two date
- int daysTo(UDate& date)
+ int daysTo(UTimeDate& date)
{
- U_TRACE(0, "UDate::daysTo(%p)", &date)
+ U_TRACE(0, "UTimeDate::daysTo(%p)", &date)
U_RETURN(date.getJulian() - getJulian());
}
void addDays(int days)
{
- U_TRACE(0, "UDate::addDays(%d)", days)
+ U_TRACE(0, "UTimeDate::addDays(%d)", days)
julian = getJulian() + days;
@@ -152,7 +152,7 @@ class U_EXPORT UDate {
void addYears(int years)
{
- U_TRACE(0, "UDate::addYears(%d)", years)
+ U_TRACE(0, "UTimeDate::addYears(%d)", years)
_year += years;
@@ -161,7 +161,7 @@ class U_EXPORT UDate {
int getDayOfWeek()
{
- U_TRACE(0, "UDate::getDayOfWeek()")
+ U_TRACE(0, "UTimeDate::getDayOfWeek()")
// (julian + 1) % 7 gives the value 0 for Sunday ... 6 for Saturday
@@ -187,7 +187,7 @@ class U_EXPORT UDate {
static time_t getSecondFromJulian(int _julian)
{
- U_TRACE(0, "UDate::getSecondFromJulian(%d)", _julian)
+ U_TRACE(0, "UTimeDate::getSecondFromJulian(%d)", _julian)
U_INTERNAL_ASSERT(_julian >= 2440588) // 2440588 -> 01/01/1970
@@ -198,7 +198,7 @@ class U_EXPORT UDate {
time_t getSecond()
{
- U_TRACE(0, "UDate::getSecond()")
+ U_TRACE(0, "UTimeDate::getSecond()")
time_t t = getSecondFromJulian(getJulian());
@@ -207,7 +207,7 @@ class U_EXPORT UDate {
static time_t getSecondFromTime(const char* str) // seconds from string in HH:MM:SS format
{
- U_TRACE(0, "UDate::getSecondFromTime(%.*S)", 8, str)
+ U_TRACE(0, "UTimeDate::getSecondFromTime(%.*S)", 8, str)
U_INTERNAL_ASSERT_EQUALS(str[2], ':')
U_INTERNAL_ASSERT_EQUALS(str[5], ':')
@@ -223,7 +223,7 @@ class U_EXPORT UDate {
void setCurrentDate()
{
- U_TRACE(0, "UDate::setCurrentDate()")
+ U_TRACE(0, "UTimeDate::setCurrentDate()")
// UNIX system time - SecsSince1Jan1970UTC
@@ -232,25 +232,25 @@ class U_EXPORT UDate {
fromTime(u_now->tv_sec);
}
- static void setCurrentDate(UDate& date)
+ static void setCurrentDate(UTimeDate& date)
{
- U_TRACE(0, "UDate::setCurrentDate(%p)", &date)
+ U_TRACE(0, "UTimeDate::setCurrentDate(%p)", &date)
date.setCurrentDate();
}
// OPERATOR
- bool operator==(UDate& date);
- bool operator!=(UDate& date);
- bool operator< (UDate& date);
- bool operator<=(UDate& date);
- bool operator> (UDate& date);
- bool operator>=(UDate& date);
+ bool operator==(UTimeDate& date);
+ bool operator!=(UTimeDate& date);
+ bool operator< (UTimeDate& date);
+ bool operator<=(UTimeDate& date);
+ bool operator> (UTimeDate& date);
+ bool operator>=(UTimeDate& date);
- UDate& operator+=(UDate& d)
+ UTimeDate& operator+=(UTimeDate& d)
{
- U_TRACE(0, "UDate::operator+=(%p)", &d)
+ U_TRACE(0, "UTimeDate::operator+=(%p)", &d)
julian = getJulian() + d.getJulian();
@@ -259,9 +259,9 @@ class U_EXPORT UDate {
return *this;
}
- UDate& operator-=(UDate& d)
+ UTimeDate& operator-=(UTimeDate& d)
{
- U_TRACE(0, "UDate::operator-=(%p)", &d)
+ U_TRACE(0, "UTimeDate::operator-=(%p)", &d)
julian = getJulian() - d.getJulian();
@@ -270,56 +270,56 @@ class U_EXPORT UDate {
return *this;
}
- friend UDate operator+(const UDate& d1, UDate& d2)
+ friend UTimeDate operator+(const UTimeDate& d1, UTimeDate& d2)
{
- U_TRACE(0, "UDate::operator+(%p,%p)", &d1, &d2)
+ U_TRACE(0, "UTimeDate::operator+(%p,%p)", &d1, &d2)
- return UDate(d1) += d2;
+ return UTimeDate(d1) += d2;
}
- friend UDate operator-(const UDate& d1, UDate& d2)
+ friend UTimeDate operator-(const UTimeDate& d1, UTimeDate& d2)
{
- U_TRACE(0, "UDate::operator+(%p,%p)", &d1, &d2)
+ U_TRACE(0, "UTimeDate::operator+(%p,%p)", &d1, &d2)
- return UDate(d1) -= d2;
+ return UTimeDate(d1) -= d2;
}
- UDate& operator+=(int days)
+ UTimeDate& operator+=(int days)
{
- U_TRACE(0, "UDate::operator+=(%d)", days)
+ U_TRACE(0, "UTimeDate::operator+=(%d)", days)
addDays(days);
return *this;
}
- UDate& operator-=(int days)
+ UTimeDate& operator-=(int days)
{
- U_TRACE(0, "UDate::operator-=(%d)", days)
+ U_TRACE(0, "UTimeDate::operator-=(%d)", days)
addDays(-days);
return *this;
}
- friend UDate operator+(UDate& d, int days)
+ friend UTimeDate operator+(UTimeDate& d, int days)
{
- U_TRACE(0, "UDate::operator+(%p,%d)", &d, days)
+ U_TRACE(0, "UTimeDate::operator+(%p,%d)", &d, days)
- return UDate(d) += days;
+ return UTimeDate(d) += days;
}
- friend UDate operator-(UDate& d, int days)
+ friend UTimeDate operator-(UTimeDate& d, int days)
{
- U_TRACE(0, "UDate::operator-(%p,%d)", &d, days)
+ U_TRACE(0, "UTimeDate::operator-(%p,%d)", &d, days)
- return UDate(d) -= days;
+ return UTimeDate(d) -= days;
}
// STREAM
- friend U_EXPORT istream& operator>>(istream& is, UDate& d); // dd/mm/yyyy
- friend U_EXPORT ostream& operator<<(ostream& os, const UDate& d); // dd/mm/yyyy
+ friend U_EXPORT istream& operator>>(istream& is, UTimeDate& d); // dd/mm/yyyy
+ friend U_EXPORT ostream& operator<<(ostream& os, const UTimeDate& d); // dd/mm/yyyy
#ifdef DEBUG
bool invariant() { return (julian >= FIRST_DAY); } // 14/09/1752
View
2  include/ulib/dbi/dbi.h
@@ -147,7 +147,7 @@ class U_EXPORT UDBI {
escape();
}
- UDBI& operator<<(const char* q) { query(q, u_strlen(q)); return *this; } // Syntactic sugar for query(q)
+ UDBI& operator<<(const char* q) { query(q, u_str_len(q)); return *this; } // Syntactic sugar for query(q)
UDBI& operator<<(const UString& q) { query(U_STRING_TO_PARAM(q)); return *this; } // Syntactic sugar for query(q)
// BIND
View
4 include/ulib/internal/common.h
@@ -25,9 +25,9 @@
# include <ulib/debug/objectDB.h>
# include <ulib/debug/error_memory.h>
-# define U_ULIB_INIT(argv) U_SET_LOCATION_INFO, u_init(argv), u_debug_init(), ULib_init()
+# define U_ULIB_INIT(argv) U_SET_LOCATION_INFO, u_init_ulib(argv), u_debug_init(), ULib_init()
#else
-# define U_ULIB_INIT(argv) U_SET_LOCATION_INFO, u_init(argv), ULib_init()
+# define U_ULIB_INIT(argv) U_SET_LOCATION_INFO, u_init_ulib(argv), ULib_init()
#endif
// Manage memory pool
View
2  include/ulib/internal/memory_pool.h
@@ -33,7 +33,7 @@
U_STACK_TYPE_0
12 sizeof(UProcess)
- 16 sizeof(UDate)
+ 16 sizeof(UTimeDate)
16 sizeof(ULock)
16 sizeof(UTimer)
16 sizeof(UPKCS7)
View
2  include/ulib/net/socket.h
@@ -459,7 +459,7 @@ class U_EXPORT USocket {
U_TRACE(0, "USocket::setTcpCongestion(%S)", value)
# ifdef TCP_CONGESTION
- (void) setSockOpt(IPPROTO_TCP, TCP_CONGESTION, (const void*)&value, u_strlen(value) + 1);
+ (void) setSockOpt(IPPROTO_TCP, TCP_CONGESTION, (const void*)&value, u_str_len(value) + 1);
# endif
}
View
4 include/ulib/ssl/certificate.h
@@ -394,8 +394,8 @@ class U_EXPORT UCertificate {
Not After : Jan 25 11:54:00 2006 GMT
*/
- bool result = (time >= UDate::getSecondFromTime(getNotBefore(), true, "%s %2d %2d:%2d:%2d %4d GMT") &&
- time <= UDate::getSecondFromTime(getNotAfter(), true, "%s %2d %2d:%2d:%2d %4d GMT"));
+ bool result = (time >= UTimeDate::getSecondFromTime(getNotBefore(), true, "%s %2d %2d:%2d:%2d %4d GMT") &&
+ time <= UTimeDate::getSecondFromTime(getNotAfter(), true, "%s %2d %2d:%2d:%2d %4d GMT"));
U_RETURN(result);
}
View
40 include/ulib/string.h
@@ -397,7 +397,7 @@ class U_EXPORT UStringRep {
{
U_TRACE(0, "UStringRep::size_adjust_force(%u)", value)
- _length = (value == U_NOT_FOUND ? u_strlen(str) : value);
+ _length = (value == U_NOT_FOUND ? u_str_len(str) : value);
U_INTERNAL_ASSERT(invariant())
}
@@ -648,7 +648,7 @@ class U_EXPORT UString {
U_INTERNAL_ASSERT_POINTER(t)
- uint32_t tlen = u_strlen((char*)t);
+ uint32_t tlen = u_str_len((char*)t);
rep = UStringRep::create(tlen, tlen, (const char*)t);
}
@@ -718,10 +718,10 @@ class U_EXPORT UString {
}
UString& replace(char c) { return replace(0, size(), 1, c); }
- UString& replace(const char* s) { return replace(0, size(), s, u_strlen(s)); }
+ UString& replace(const char* s) { return replace(0, size(), s, u_str_len(s)); }
UString& replace(const UString& str) { return replace(0, size(), str.data(), str.size()); }
UString& replace(const char* s, uint32_t n) { return replace(0, size(), s, n); }
- UString& replace(uint32_t pos, uint32_t n, const char* s) { return replace(pos, n, s, u_strlen(s)); }
+ UString& replace(uint32_t pos, uint32_t n, const char* s) { return replace(pos, n, s, u_str_len(s)); }
UString& replace(uint32_t pos, uint32_t n, const UString& str) { return replace(pos, n, str.data(), str.size()); }
// Assignement
@@ -839,7 +839,7 @@ class U_EXPORT UString {
UString& append(const UString& str);
UString& operator+=(char c) { return append(1U, c); }
- UString& operator+=(const char* s) { return append(s, u_strlen(s)); }
+ UString& operator+=(const char* s) { return append(s, u_str_len(s)); }
UString& operator+=(const UString& str);
// OPTMIZE APPEND (BUFFERED)
@@ -895,7 +895,7 @@ class U_EXPORT UString {
return replace(pos1, 0, str.data() + pos2, str.rep->fold(pos2, n));
}
- UString& insert(uint32_t pos, const char* s) { return replace(pos, 0, s, u_strlen(s)); }
+ UString& insert(uint32_t pos, const char* s) { return replace(pos, 0, s, u_str_len(s)); }
UString& insert(uint32_t pos, const char* s, uint32_t n) { return replace(pos, 0, s, n); }
UString& insert(uint32_t pos, uint32_t n, char c) { return replace(pos, 0, n, c); }
@@ -933,7 +933,7 @@ class U_EXPORT UString {
uint32_t find(const UString& str, uint32_t pos = 0, uint32_t how_much = U_NOT_FOUND) const __pure;
uint32_t find(char c, uint32_t pos = 0) const __pure;
- uint32_t find(const char* s, uint32_t pos = 0) const { return find(s, pos, u_strlen(s), U_NOT_FOUND); }
+ uint32_t find(const char* s, uint32_t pos = 0) const { return find(s, pos, u_str_len(s), U_NOT_FOUND); }
// The `rfind' function searches from end to beginning string for a specified string (possibly a single
// character) and returns its starting position. You can supply the parameter pos to specify the position
@@ -941,7 +941,7 @@ class U_EXPORT UString {
uint32_t rfind(const char* s, uint32_t pos, uint32_t n) const __pure;
uint32_t rfind(char c, uint32_t pos = U_NOT_FOUND) const __pure;
- uint32_t rfind(const char* s, uint32_t pos = U_NOT_FOUND) const { return rfind(s, pos, u_strlen(s)); }
+ uint32_t rfind(const char* s, uint32_t pos = U_NOT_FOUND) const { return rfind(s, pos, u_str_len(s)); }
uint32_t rfind(const UString& str, uint32_t pos = U_NOT_FOUND) const { return rfind(str.data(), pos, str.size()); }
// The `find_first_of' function searches string for the first match of any character stored in s and returns its position
@@ -949,12 +949,12 @@ class U_EXPORT UString {
uint32_t find_first_of(const char* s, uint32_t pos, uint32_t n) const __pure;
uint32_t find_first_of(char c, uint32_t pos = 0) const { return find(c, pos); }
- uint32_t find_first_of(const char* s, uint32_t pos = 0) const { return find_first_of(s, pos, u_strlen(s)); }
+ uint32_t find_first_of(const char* s, uint32_t pos = 0) const { return find_first_of(s, pos, u_str_len(s)); }
uint32_t find_first_of(const UString& str, uint32_t pos = 0) const { return find_first_of(str.data(), pos, str.size()); }
uint32_t find_last_of(const char* s, uint32_t pos, uint32_t n) const __pure;
uint32_t find_last_of(char c, uint32_t pos = U_NOT_FOUND) const { return rfind(c, pos); }
- uint32_t find_last_of(const char* s, uint32_t pos = U_NOT_FOUND) const { return find_last_of(s, pos, u_strlen(s)); }
+ uint32_t find_last_of(const char* s, uint32_t pos = U_NOT_FOUND) const { return find_last_of(s, pos, u_str_len(s)); }
uint32_t find_last_of(const UString& str, uint32_t pos = U_NOT_FOUND) const { return find_last_of(str.data(), pos, str.size()); }
// The `find_first_not_of' function searches the first element of string that doesn't match any character stored in s
@@ -964,12 +964,12 @@ class U_EXPORT UString {
uint32_t find_first_not_of(const char* s, uint32_t pos, uint32_t n) const __pure;
uint32_t find_first_not_of(char c, uint32_t pos = 0) const __pure;
- uint32_t find_first_not_of(const char* s, uint32_t pos = 0) const { return find_first_not_of(s, pos, u_strlen(s)); }
+ uint32_t find_first_not_of(const char* s, uint32_t pos = 0) const { return find_first_not_of(s, pos, u_str_len(s)); }
uint32_t find_first_not_of(const UString& str, uint32_t pos = 0) const { return find_first_not_of(str.data(), pos, str.size()); }
uint32_t find_last_not_of(const char* s, uint32_t pos, uint32_t n) const __pure;
uint32_t find_last_not_of(char c, uint32_t pos = U_NOT_FOUND) const __pure;
- uint32_t find_last_not_of(const char* s, uint32_t pos = U_NOT_FOUND) const { return find_last_not_of(s, pos, u_strlen(s)); }
+ uint32_t find_last_not_of(const char* s, uint32_t pos = U_NOT_FOUND) const { return find_last_not_of(s, pos, u_str_len(s)); }
uint32_t find_last_not_of(const UString& str, uint32_t pos = U_NOT_FOUND) const { return find_last_not_of(str.data(), pos, str.size()); }
// Find with ignore case
@@ -977,7 +977,7 @@ class U_EXPORT UString {
uint32_t findnocase(const char* s, uint32_t pos, uint32_t s_len, uint32_t how_much = U_NOT_FOUND) const __pure;
uint32_t findnocase(const UString& str, uint32_t pos = 0, uint32_t how_much = U_NOT_FOUND) const __pure;
- uint32_t findnocase(const char* s, uint32_t pos = 0) const { return findnocase(s, pos, u_strlen(s), U_NOT_FOUND); }
+ uint32_t findnocase(const char* s, uint32_t pos = 0) const { return findnocase(s, pos, u_str_len(s), U_NOT_FOUND); }
// Compare
@@ -986,12 +986,12 @@ class U_EXPORT UString {
int compare(const UString& str) const { return rep->compare(str.rep); }
int compare(uint32_t pos, uint32_t n1, const char* s, uint32_t n2) const
- { return rep->compare(pos, U_min(size() - pos, n1), s, U_min(u_strlen(s), n2)); }
+ { return rep->compare(pos, U_min(size() - pos, n1), s, U_min(u_str_len(s), n2)); }
- int compare(const char* s) const { return rep->compare(s, u_strlen(s)); }
+ int compare(const char* s) const { return rep->compare(s, u_str_len(s)); }
int compare(uint32_t pos, uint32_t n, const char* s) const
- { return rep->compare(pos, U_min(size() - pos, n), s, u_strlen(s)); }
+ { return rep->compare(pos, U_min(size() - pos, n), s, u_str_len(s)); }
__pure int compare(uint32_t pos, uint32_t n, const UString& str) const
{ return rep->compare(pos, U_min(size() - pos, n), str.data(), str.size()); }
@@ -1003,7 +1003,7 @@ class U_EXPORT UString {
// Compare with ignore case
int comparenocase(const char* s, uint32_t n) const { return rep->comparenocase(s, n); }
- int comparenocase(const char* s) const { return rep->comparenocase(s, u_strlen(s)); }
+ int comparenocase(const char* s) const { return rep->comparenocase(s, u_str_len(s)); }
int comparenocase(UStringRep* _rep) const { return rep->comparenocase(_rep); }
int comparenocase(const UString& str) const { return rep->comparenocase(str.rep); }
@@ -1024,7 +1024,7 @@ class U_EXPORT UString {
// Equal with ignore case
bool equalnocase(const char* s, uint32_t n) const { return rep->equalnocase(s, n); }
- bool equalnocase(const char* s) const { return rep->equalnocase(s, u_strlen(s)); }
+ bool equalnocase(const char* s) const { return rep->equalnocase(s, u_str_len(s)); }
bool equalnocase(UStringRep* _rep) const { return same(_rep) || rep->equalnocase(_rep); }
bool equalnocase(const UString& str) const __pure;
@@ -1184,7 +1184,7 @@ class U_EXPORT UString {
U_ASSERT(writeable())
U_INTERNAL_ASSERT(isNull() == false)
U_INTERNAL_ASSERT(rep->references == 0)
- U_INTERNAL_ASSERT_MAJOR(rep->_capacity,u_strlen(format))
+ U_INTERNAL_ASSERT_MAJOR(rep->_capacity,u_str_len(format))
// NB: +1 because there is space for null-terminator...
@@ -1202,7 +1202,7 @@ class U_EXPORT UString {
U_ASSERT(writeable())
U_INTERNAL_ASSERT(isNull() == false)
U_INTERNAL_ASSERT(rep->references == 0)
- U_ASSERT_MAJOR(rep->space(),u_strlen(format))
+ U_ASSERT_MAJOR(rep->space(),u_str_len(format))
// NB: +1 because there is space for null-terminator...
View
2  include/ulib/utility/string_ext.h
@@ -36,7 +36,7 @@ class U_EXPORT UStringExt {
{
U_TRACE(0, "UStringExt::isDelimited(%.*S,%S)", U_STRING_TO_TRACE(s), delimiter)
- U_INTERNAL_ASSERT_EQUALS(u_strlen(delimiter), 2)
+ U_INTERNAL_ASSERT_EQUALS(u_str_len(delimiter), 2)
if (s.first_char() != delimiter[0] ||
s.last_char() != delimiter[1] ||
View
10 m4/ac_compilation_environment.m4
@@ -32,9 +32,12 @@ dnl Is glibc ?
else
libc_version="unknown"
fi
-else
+fi
+
+if test -z "$libc_version"; then
libc_version="unknown"
fi
+
AC_DEFINE_UNQUOTED(LIBC_VERSION, "${libc_version}", [Standard C lib version])
if test "$cross_compiling" != "yes"; then
@@ -54,8 +57,11 @@ if test "$cross_compiling" != "yes"; then
else
stdgpp_version="unknown"
fi
-else
+fi
+
+if test -z "$stdgpp_version"; then
stdgpp_version="unknown"
fi
+
AC_DEFINE_UNQUOTED(STDGPP_VERSION, "${stdgpp_version}", [Stardard GNU C++ Library version])
])
View
36 src/ulib/base/base.c
@@ -182,23 +182,23 @@ void u_setPid(void)
u_pid_str_len = buffer + sizeof(buffer) - u_pid_str;
}
-void u_init_username(void)
+void u_init_ulib_username(void)
{
struct passwd* restrict pw;
- U_INTERNAL_TRACE("u_init_username()")
+ U_INTERNAL_TRACE("u_init_ulib_username()")
pw = getpwuid(getuid());
- if (pw) u_user_name_len = u_strlen(pw->pw_name);
+ if (pw) u_user_name_len = u_str_len(pw->pw_name);
if (u_user_name_len) (void) u_memcpy(u_user_name, pw->pw_name, u_user_name_len);
else (void) u_memcpy(u_user_name, "root", (u_user_name_len = 4));
}
-void u_init_hostname(void)
+void u_init_ulib_hostname(void)
{
- U_INTERNAL_TRACE("u_init_hostname()")
+ U_INTERNAL_TRACE("u_init_ulib_hostname()")
if (gethostname(u_hostname, sizeof(u_hostname)))
{
@@ -226,7 +226,7 @@ void u_init_hostname(void)
}
}
- u_hostname_len = u_strlen(u_hostname);
+ u_hostname_len = u_str_len(u_hostname);
if (u_hostname_len == 0) (void) strncpy(u_hostname, "localhost", (u_hostname_len = 9));
}
@@ -241,7 +241,7 @@ void u_getcwd(void) /* get current working directory */
(void) u_strcpy(u_cwd, u_slashify(u_cwd, PATH_SEPARATOR, '/'));
#endif
- u_cwd_len = u_strlen(u_cwd);
+ u_cwd_len = u_str_len(u_cwd);
U_INTERNAL_ASSERT_MAJOR(u_cwd_len,0)
U_INTERNAL_ASSERT_MINOR(u_cwd_len,U_PATH_MAX)
@@ -304,13 +304,13 @@ void u_gettimeofday(void)
}
}
-void u_init(char** restrict argv)
+void u_init_ulib(char** restrict argv)
{
#ifndef __MINGW32__
const char* restrict pwd;
#endif
- U_INTERNAL_TRACE("u_init()")
+ U_INTERNAL_TRACE("u_init_ulib()")
u_setPid();
@@ -319,10 +319,10 @@ void u_init(char** restrict argv)
U_INTERNAL_ASSERT_POINTER(u_progname)
- u_progname_len = u_strlen(u_progname);
+ u_progname_len = u_str_len(u_progname);
#ifdef __MINGW32__
- u_init_mingw();
+ u_init_ulib_mingw();
#endif
u_getcwd(); /* get current working directory */
@@ -344,11 +344,11 @@ void u_init(char** restrict argv)
(void) atexit(u_exit);
}
-uint32_t u_snprintf(char* restrict buffer, uint32_t buffer_size, const char* restrict format, ...)
+uint32_t u_sn_printf(char* restrict buffer, uint32_t buffer_size, const char* restrict format, ...)
{
uint32_t bytes_written;
-// U_INTERNAL_TRACE("u_snprintf(%s)", format)
+// U_INTERNAL_TRACE("u_sn_printf(%s)", format)
va_list argp;
va_start(argp, format);
@@ -722,7 +722,7 @@ uint32_t u_strftime(char* restrict s, uint32_t maxsize, const char* restrict for
case 'Z': /* %Z Defined by ANSI C as eliciting the time zone if available */
{
i = (daylight != 0);
- n = u_strlen(tzname[i]);
+ n = u_str_len(tzname[i]);
U_INTERNAL_ASSERT_MINOR(count,maxsize-n)
@@ -1102,7 +1102,7 @@ uint32_t u_vsnprintf(char* restrict buffer, uint32_t buffer_size, const char* re
U_INTERNAL_ASSERT_POINTER_MSG(cp, "CHECK THE PARAMETERS OF printf()...")
sign = '\0';
- size = (prec >= 0 ? prec : (int) u_strlen(cp));
+ size = (prec >= 0 ? prec : (int) u_str_len(cp));
/* if a width from format is specified, the 0 flag for padding will be ignored... */
@@ -1313,7 +1313,7 @@ number: if ((dprec = prec) >= 0) flags &= ~ZEROPAD;
(void) sprintf(bp, (const char* restrict)fmt_float, width, prec, dbl);
}
- len = u_strlen(bp);
+ len = u_str_len(bp);
bp += len;
ret += len;
@@ -1428,7 +1428,7 @@ number: if ((dprec = prec) >= 0) flags &= ~ZEROPAD;
if (ccp)
{
- len = u_strlen(ccp);
+ len = u_str_len(ccp);
(void) u_memcpy(bp, ccp, len);
@@ -1587,7 +1587,7 @@ number: if ((dprec = prec) >= 0) flags &= ~ZEROPAD;
(void) sprintf(tmp, "_%03lu", u_now->tv_usec / 1000L);
- len = u_strlen(tmp);
+ len = u_str_len(tmp);
(void) u_memcpy(bp, tmp, len);
View
2  src/ulib/base/base_error.c
@@ -864,7 +864,7 @@ void u_execOnExit(void)
char command[U_PATH_MAX];
- (void) u_snprintf(command, sizeof(command), "%s %s %P %N", cmd_on_exit, u_progpath);
+ (void) u_sn_printf(command, sizeof(command), "%s %s %P %N", cmd_on_exit, u_progpath);
U_INTERNAL_PRINT("command = %s", command)
View
4 src/ulib/base/base_trace.c
@@ -242,7 +242,7 @@ void u_trace_init(bool force, bool info, bool offset)
{
char name[128];
- (void) u_snprintf(name, 128, "trace.%N.%P", 0);
+ (void) u_sn_printf(name, 128, "trace.%N.%P", 0);
/* NB: O_RDWR e' necessario per mmap(MAP_SHARED)... */
@@ -385,7 +385,7 @@ void u_trace_check_init(void)
{
char name[128];
- (void) u_snprintf(name, 128, "trace.%N.%P", 0);
+ (void) u_sn_printf(name, 128, "trace.%N.%P", 0);
(void) rename("trace..", name);
}
View
4 src/ulib/base/ssl/des3.c
@@ -141,7 +141,7 @@ long u_des3_encode(const unsigned char* restrict inp, long len, unsigned char* r
U_INTERNAL_PRINT("cipher = %p, md = %p", cipher, md)
- (void) EVP_BytesToKey(cipher, md, salt, (unsigned char*)password, u_strlen(password), 1, xkey, iv);
+ (void) EVP_BytesToKey(cipher, md, salt, (unsigned char*)password, u_str_len(password), 1, xkey, iv);
wbio = BIO_new(BIO_s_mem());
benc = BIO_new(BIO_f_cipher());
@@ -204,7 +204,7 @@ long u_des3_decode(const unsigned char* restrict inp, long len, unsigned char* r
BIO_read(rbio, (unsigned char*)salt, sizeof(salt));
- (void) EVP_BytesToKey(cipher, md, salt, (unsigned char*)password, u_strlen(password), 1, xkey, iv);
+ (void) EVP_BytesToKey(cipher, md, salt, (unsigned char*)password, u_str_len(password), 1, xkey, iv);
BIO_set_cipher(benc, cipher, xkey, iv, U_DECRYPT);
View
26 src/ulib/base/utility.c
@@ -32,7 +32,7 @@
# ifdef _DIRENT_HAVE_D_NAMLEN
# define NAMLEN(dirent) (dirent)->d_namlen
# else
-# define NAMLEN(dirent) u_strlen((dirent)->d_name)
+# define NAMLEN(dirent) u_str_len((dirent)->d_name)
# endif
#else
# define dirent direct
@@ -87,9 +87,9 @@ struct uhttpinfo u_http_info;
const char* u_short_units[] = { "B", "KB", "MB", "GB", "TB", 0 };
#ifdef DEBUG
-size_t u_strlen(const char* restrict s)
+size_t u_str_len(const char* restrict s)
{
- U_INTERNAL_TRACE("u_strlen(%s)", s)
+ U_INTERNAL_TRACE("u_str_len(%s)", s)
U_INTERNAL_ASSERT_POINTER(s)
@@ -98,7 +98,7 @@ size_t u_strlen(const char* restrict s)
char* u_strcpy(char* restrict dest, const char* restrict src)
{
- size_t n = u_strlen(src);
+ size_t n = u_str_len(src);
U_INTERNAL_TRACE("u_strcpy(%p,%p,%ld)", dest, src, n)
@@ -324,7 +324,7 @@ bool u_runAsUser(const char* restrict user, bool change_dir)
(void) putenv(buffer);
}
- (void) u_strncpy(u_user_name, user, (u_user_name_len = u_strlen(user))); /* change user name */
+ (void) u_strncpy(u_user_name, user, (u_user_name_len = u_str_len(user))); /* change user name */
if (change_dir &&
pw->pw_dir &&
@@ -1456,7 +1456,7 @@ static inline void make_absolute(char* restrict result, const char* restrict dot
{
u_strcpy(result, dot_path);
- result_len = u_strlen(result);
+ result_len = u_str_len(result);
if (result[result_len - 1] != PATH_SEPARATOR)
{
@@ -1490,7 +1490,7 @@ static const char* u_check_for_suffix_exe(const char* restrict program)
{
static char program_w32[MAX_FILENAME_LEN + 1];
- int len = u_strlen(program);
+ int len = u_str_len(program);
U_INTERNAL_TRACE("u_check_for_suffix_exe(%s)", program)
@@ -1522,7 +1522,7 @@ bool u_pathfind(char* restrict result, const char* restrict path, uint32_t path_
{
path = getenv("PATH");
- if (path) path_len = u_strlen(path);
+ if (path) path_len = u_str_len(path);
else
{
path = U_PATH_DEFAULT;
@@ -1634,7 +1634,7 @@ bool u_canonicalize_pathname(char* restrict path)
/* Remove trailing slashes */
- p = lpath + u_strlen(lpath) - 1;
+ p = lpath + u_str_len(lpath) - 1;
if ( p > lpath &&
*p == '/')
@@ -1665,7 +1665,7 @@ bool u_canonicalize_pathname(char* restrict path)
/* Remove trailing "/" or "/." */
- len = u_strlen(lpath);
+ len = u_str_len(lpath);
if (len < 2) goto end;
@@ -1820,7 +1820,7 @@ int u_splitCommand(char* restrict s, uint32_t n, char** restrict argv, char* res
if (u_pathfind(pathbuf, 0, 0, argv[1], R_OK | X_OK) == false) return -1;
- U_INTERNAL_ASSERT_MINOR(u_strlen(pathbuf), pathbuf_size)
+ U_INTERNAL_ASSERT_MINOR(u_str_len(pathbuf), pathbuf_size)
}
return result;
@@ -2045,7 +2045,7 @@ void u_ftw(void)
U_INTERNAL_TRACE("u_ftw()")
- U_INTERNAL_ASSERT_EQUALS(u_strlen(u_buffer), u_buffer_len)
+ U_INTERNAL_ASSERT_EQUALS(u_str_len(u_buffer), u_buffer_len)
/*
* NB: if is present the char 'filetype' this item isn't a directory and we don't need to try opendir()...
@@ -2095,7 +2095,7 @@ int u_passwd_cb(char* restrict buf, int size, int rwflag, void* restrict passwor
buf[size-1] = '\0';
- size = u_strlen(buf);
+ size = u_str_len(buf);
U_INTERNAL_PRINT("buf(%d) = %.*s", size, U_min(size,128), buf)
View
10 src/ulib/base/win32/mingw32.c
@@ -83,9 +83,9 @@ struct passwd* getpwnam(const char* name)
#define isWindowNT() (version.dwPlatformId == VER_PLATFORM_WIN32_NT)
#define granularity() (system_info.dwAllocationGranularity)
-void u_init_mingw(void)
+void u_init_ulib_mingw(void)
{
- U_INTERNAL_TRACE("u_init_mingw()", 0)
+ U_INTERNAL_TRACE("u_init_ulib_mingw()", 0)
/* Figure out on which OS we're running */
@@ -277,7 +277,7 @@ int unlink_w32(const char* path)
int mkstemp(char* tmplate)
{
char* pChr;
- int ret, iLen = u_strlen(tmplate);
+ int ret, iLen = u_str_len(tmplate);
U_INTERNAL_TRACE("mkstemp(%s)", tmplate)
@@ -1883,7 +1883,7 @@ const char* getSysError_w32(unsigned* len)
if (ret == 0) lenMsg = 0;
else
{
- lenMsg = u_strlen(pBuffer);
+ lenMsg = u_str_len(pBuffer);
U_INTERNAL_ASSERT_MINOR(lenMsg, sizeof(buffer))
@@ -1904,7 +1904,7 @@ const char* getSysError_w32(unsigned* len)
LocalFree(pBuffer);
- *len = u_strlen(buffer);
+ *len = u_str_len(buffer);
U_INTERNAL_PRINT("ret = %s", buffer)
View
20 src/ulib/base/zip/ziptool.c
@@ -15,7 +15,7 @@
# ifdef DIRENT_HAVE_D_NAMLEN
# define NAMLEN(dirent) (dirent)->d_namlen
# else
-# define NAMLEN(dirent) u_strlen((dirent)->d_name)
+# define NAMLEN(dirent) u_str_len((dirent)->d_name)
# endif
#else
# define dirent direct
@@ -181,7 +181,7 @@ static int create_central_header(int fd)
for (ze = ziptail; ze != 0; ze = ze->next_entry)
{
total_in += ze->usize;
- total_out += ze->csize + 76 + u_strlen(ze->filename) * 2;
+ total_out += ze->csize + 76 + u_str_len(ze->filename) * 2;
if (ze->compressed)
{
@@ -197,11 +197,11 @@ static int create_central_header(int fd)
PACK_UB4(header, CEN_CRC, ze->crc);
PACK_UB4(header, CEN_CSIZE, ze->csize);
PACK_UB4(header, CEN_USIZE, ze->usize);
- PACK_UB2(header, CEN_FNLEN, u_strlen(ze->filename));
+ PACK_UB2(header, CEN_FNLEN, u_str_len(ze->filename));
PACK_UB4(header, CEN_OFFSET, ze->offset);
(void) write(fd, header, 46);
- (void) write(fd, ze->filename, u_strlen(ze->filename));
+ (void) write(fd, ze->filename, u_str_len(ze->filename));
}
dir_size = lseek(fd, 0, SEEK_CUR) - start_offset;
@@ -267,7 +267,7 @@ static int add_file_to_zip(int jfd, int ffd, const char* fname, struct stat* sta
U_INTERNAL_TRACE("add_file_to_zip(%d,%d,%s,%p)", jfd, ffd, fname, statbuf)
mod_time = unix2dostime(&(statbuf->st_mtime));
- file_name_length = u_strlen(fname);
+ file_name_length = u_str_len(fname);
ze = (zipentry*) calloc(1, sizeof(zipentry)); /* clear all the fields */
@@ -345,7 +345,7 @@ static int add_file_to_zip(int jfd, int ffd, const char* fname, struct stat* sta
PACK_UB4(data_descriptor, 12, ze->usize);
/* we need to seek back and fill the header */
- offset = (ze->csize + u_strlen(ze->filename) + 16);
+ offset = (ze->csize + u_str_len(ze->filename) + 16);
if (lseek(jfd, -offset, SEEK_CUR) == (off_t)-1)
{
@@ -414,13 +414,13 @@ static int add_to_zip(int fd, const char* file)
return 1;
}
- nlen = u_strlen(file) + 256;
+ nlen = u_str_len(file) + 256;
fullname = (char*) calloc(1, nlen);
(void) u_strcpy(fullname, file);
- nlen = u_strlen(file);
+ nlen = u_str_len(file);
if (fullname[nlen - 1] != '/')
{
@@ -931,11 +931,11 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
/* only a directory */
- U_INTERNAL_TRACE("Leftovers are \"%s\" (%d)", start, u_strlen((const char*)start))
+ U_INTERNAL_TRACE("Leftovers are \"%s\" (%d)", start, u_str_len((const char*)start))
/* If the entry was just a directory, don't write to file, etc */
- if (u_strlen((const char *)start) == 0) f_fd = -1;
+ if (u_str_len((const char *)start) == 0) f_fd = -1;
free(tmp_buff);
}
View
8 src/ulib/command.cpp
@@ -405,19 +405,19 @@ void UCommand::setMsgError(const char* cmd)
if (isStarted() == false)
{
- u_buffer_len = u_snprintf(u_buffer, sizeof(u_buffer), "command %S didn't start %R", cmd, 0); // NB: the last argument (0) is necessary...
+ u_buffer_len = u_sn_printf(u_buffer, sizeof(u_buffer), "command %S didn't start %R", cmd, 0); // NB: the last argument (0) is necessary...
}
else if (isTimeout())
{
- u_buffer_len = u_snprintf(u_buffer, sizeof(u_buffer), "command %S excedeed time (%d secs) for execution", cmd, timeoutMS / 1000);
+ u_buffer_len = u_sn_printf(u_buffer, sizeof(u_buffer), "command %S excedeed time (%d secs) for execution", cmd, timeoutMS / 1000);
}
else if (exit_value)
{
- u_buffer_len = u_snprintf(u_buffer, sizeof(u_buffer), "command %S exit with value %d", cmd, exit_value);
+ u_buffer_len = u_sn_printf(u_buffer, sizeof(u_buffer), "command %S exit with value %d", cmd, exit_value);
}
else
{
- u_buffer_len = u_snprintf(u_buffer, sizeof(u_buffer), "command %S started", cmd);
+ u_buffer_len = u_sn_printf(u_buffer, sizeof(u_buffer), "command %S started", cmd);
}
}
View
94 src/ulib/date.cpp
@@ -17,34 +17,34 @@ static const short monthDays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30
static const char* months[] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };
static const char* months_it[] = { "gen", "feb", "mar", "apr", "mag", "giu", "lug", "ago", "set", "ott", "nov", "dic" };
-UDate::UDate(int day, int year)
+UTimeDate::UTimeDate(int day, int year)