00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 #ifndef ACE_OS_NS_STRING_H
00018 #define ACE_OS_NS_STRING_H
00019 
00020 # include  "ace/pre.h"
00021 
00022 # include "ace/config-lite.h"
00023 
00024 # if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 #  pragma once
00026 # endif 
00027 
00028 #include "ace/Basic_Types.h" 
00029                             
00030 #include  "ace/ACE_export.h"
00031 
00032 #if defined (ACE_EXPORT_MACRO)
00033 #  undef ACE_EXPORT_MACRO
00034 #endif
00035 #define ACE_EXPORT_MACRO ACE_Export
00036 
00037 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00038 
00039 namespace ACE_OS {
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 
00051   ACE_NAMESPACE_INLINE_FUNCTION
00052   const void *memchr (const void *s, int c, size_t len);
00053 
00054 
00055   ACE_NAMESPACE_INLINE_FUNCTION
00056   void *memchr (void *s, int c, size_t len);
00057 
00058 #if defined (ACE_LACKS_MEMCHR)
00059 
00060   extern ACE_Export
00061   const void *memchr_emulation (const void *s, int c, size_t len);
00062 #endif 
00063 
00064 
00065   ACE_NAMESPACE_INLINE_FUNCTION
00066   int memcmp (const void *t, const void *s, size_t len);
00067 
00068 
00069   ACE_NAMESPACE_INLINE_FUNCTION
00070   void *memcpy (void *t, const void *s, size_t len);
00071 
00072 #if defined (ACE_HAS_MEMCPY_LOOP_UNROLL)
00073 
00074 
00075 
00076 
00077 
00078   extern ACE_Export
00079   void *fast_memcpy (void *t, const void *s, size_t len);
00080 #endif
00081 
00082 
00083   ACE_NAMESPACE_INLINE_FUNCTION
00084   void *memmove (void *t, const void *s, size_t len);
00085 
00086 
00087   ACE_NAMESPACE_INLINE_FUNCTION
00088   void *memset (void *s, int c, size_t len);
00089 
00090 
00091   ACE_NAMESPACE_INLINE_FUNCTION
00092   char *strcat (char *s, const char *t);
00093 
00094 #if defined (ACE_HAS_WCHAR)
00095 
00096   ACE_NAMESPACE_INLINE_FUNCTION
00097   wchar_t *strcat (wchar_t *s, const wchar_t *t);
00098 #endif 
00099 
00100 
00101 
00102   ACE_NAMESPACE_INLINE_FUNCTION
00103   const char *strchr (const char *s, int c);
00104 
00105 #if defined (ACE_HAS_WCHAR)
00106 
00107 
00108   ACE_NAMESPACE_INLINE_FUNCTION
00109   const wchar_t *strchr (const wchar_t *s, wchar_t c);
00110 #endif 
00111 
00112 
00113   ACE_NAMESPACE_INLINE_FUNCTION
00114   char *strchr (char *s, int c);
00115 
00116 #if defined (ACE_HAS_WCHAR)
00117 
00118   ACE_NAMESPACE_INLINE_FUNCTION
00119   wchar_t *strchr (wchar_t *s, wchar_t c);
00120 #endif 
00121 
00122 
00123   ACE_NAMESPACE_INLINE_FUNCTION
00124   int strcmp (const char *s, const char *t);
00125 
00126 
00127   ACE_NAMESPACE_INLINE_FUNCTION
00128   int strcmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t);
00129 
00130 
00131   ACE_NAMESPACE_INLINE_FUNCTION
00132   char *strcpy (char *s, const char *t);
00133 
00134 #if defined (ACE_HAS_WCHAR)
00135 
00136   ACE_NAMESPACE_INLINE_FUNCTION
00137   wchar_t *strcpy (wchar_t *s, const wchar_t *t);
00138 #endif 
00139 
00140 
00141 
00142   ACE_NAMESPACE_INLINE_FUNCTION
00143   size_t strcspn (const char *s, const char *reject);
00144 
00145 #if defined (ACE_HAS_WCHAR)
00146 
00147 
00148   ACE_NAMESPACE_INLINE_FUNCTION
00149   size_t strcspn (const wchar_t *s, const wchar_t *reject);
00150 #endif 
00151 
00152 
00153   ACE_NAMESPACE_INLINE_FUNCTION
00154   char *strdup (const char *s);
00155 
00156 #if (defined (ACE_LACKS_STRDUP) && !defined(ACE_STRDUP_EQUIVALENT)) \
00157   || defined (ACE_HAS_STRDUP_EMULATION)
00158   extern ACE_Export
00159   char *strdup_emulation (const char *s);
00160 #endif
00161 
00162 #if defined (ACE_HAS_WCHAR)
00163 
00164   ACE_NAMESPACE_INLINE_FUNCTION
00165   wchar_t *strdup (const wchar_t *s);
00166 
00167 #if (defined (ACE_LACKS_WCSDUP) && !defined(ACE_WCSDUP_EQUIVALENT)) \
00168   || defined (ACE_HAS_WCSDUP_EMULATION)
00169   extern ACE_Export
00170   wchar_t *strdup_emulation (const wchar_t *s);
00171 #endif
00172 #endif 
00173 
00174 
00175 
00176   extern ACE_Export
00177   char *strecpy (char *des, const char *src);
00178 
00179 #if defined (ACE_HAS_WCHAR)
00180 
00181 
00182   extern ACE_Export
00183   wchar_t *strecpy (wchar_t *s, const wchar_t *t);
00184 #endif 
00185 
00186   
00187 
00188 
00189 
00190 
00191   extern ACE_Export
00192   char *strerror (int errnum);
00193 
00194 #if defined (ACE_LACKS_STRERROR)
00195 
00196   extern ACE_Export
00197   char *strerror_emulation (int errnum);
00198 #endif 
00199 
00200 
00201   ACE_NAMESPACE_INLINE_FUNCTION
00202   size_t strlen (const char *s);
00203 
00204 
00205   ACE_NAMESPACE_INLINE_FUNCTION
00206   size_t strlen (const ACE_WCHAR_T *s);
00207 
00208 
00209   ACE_NAMESPACE_INLINE_FUNCTION
00210   char *strncat (char *s, const char *t, size_t len);
00211 
00212 
00213   ACE_NAMESPACE_INLINE_FUNCTION
00214   ACE_WCHAR_T *strncat (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len);
00215 
00216 
00217 
00218   extern ACE_Export
00219   const char *strnchr (const char *s, int c, size_t len);
00220 
00221 
00222 
00223   extern ACE_Export
00224   const ACE_WCHAR_T *strnchr (const ACE_WCHAR_T *s, ACE_WCHAR_T c, size_t len);
00225 
00226 
00227   ACE_NAMESPACE_INLINE_FUNCTION
00228   char *strnchr (char *s, int c, size_t len);
00229 
00230 
00231   ACE_NAMESPACE_INLINE_FUNCTION
00232   ACE_WCHAR_T *strnchr (ACE_WCHAR_T *s, ACE_WCHAR_T c, size_t len);
00233 
00234 
00235   ACE_NAMESPACE_INLINE_FUNCTION
00236   int strncmp (const char *s, const char *t, size_t len);
00237 
00238 
00239   ACE_NAMESPACE_INLINE_FUNCTION
00240   int strncmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len);
00241 
00242 
00243   ACE_NAMESPACE_INLINE_FUNCTION
00244   char *strncpy (char *s, const char *t, size_t len);
00245 
00246 
00247   ACE_NAMESPACE_INLINE_FUNCTION
00248   ACE_WCHAR_T *strncpy (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len);
00249 
00250 
00251 
00252 
00253 
00254 
00255 
00256 
00257 
00258 
00259   ACE_NAMESPACE_INLINE_FUNCTION
00260   size_t strnlen (const char *s, size_t maxlen);
00261 
00262 
00263 
00264 
00265 
00266 
00267 
00268 
00269 
00270 
00271   ACE_NAMESPACE_INLINE_FUNCTION
00272   size_t strnlen (const ACE_WCHAR_T *s, size_t maxlen);
00273 
00274 
00275 
00276   extern ACE_Export
00277   const char *strnstr (const char *s, const char *t, size_t len);
00278 
00279 
00280 
00281   extern ACE_Export
00282   const ACE_WCHAR_T *strnstr (const ACE_WCHAR_T *s,
00283                               const ACE_WCHAR_T *t,
00284                               size_t len);
00285 
00286 
00287   ACE_NAMESPACE_INLINE_FUNCTION
00288   char *strnstr (char *s, const char *t, size_t len);
00289 
00290 
00291   ACE_NAMESPACE_INLINE_FUNCTION
00292   ACE_WCHAR_T *strnstr (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len);
00293 
00294 
00295   ACE_NAMESPACE_INLINE_FUNCTION
00296   const char *strpbrk (const char *s1, const char *s2);
00297 
00298 #if defined (ACE_HAS_WCHAR)
00299 
00300   ACE_NAMESPACE_INLINE_FUNCTION
00301   const wchar_t *strpbrk (const wchar_t *s1, const wchar_t *s2);
00302 #endif 
00303 
00304 
00305   ACE_NAMESPACE_INLINE_FUNCTION
00306   char *strpbrk (char *s1, const char *s2);
00307 
00308 #if defined (ACE_HAS_WCHAR)
00309 
00310   ACE_NAMESPACE_INLINE_FUNCTION
00311   wchar_t *strpbrk (wchar_t *s1, const wchar_t *s2);
00312 #endif 
00313 
00314 
00315 
00316   ACE_NAMESPACE_INLINE_FUNCTION
00317   const char *strrchr (const char *s, int c);
00318 
00319 #if defined (ACE_HAS_WCHAR)
00320 
00321 
00322   ACE_NAMESPACE_INLINE_FUNCTION
00323   const wchar_t *strrchr (const wchar_t *s, wchar_t c);
00324 #endif 
00325 
00326 
00327   ACE_NAMESPACE_INLINE_FUNCTION
00328   char *strrchr (char *s, int c);
00329 
00330 #if defined (ACE_HAS_WCHAR)
00331 
00332   ACE_NAMESPACE_INLINE_FUNCTION
00333   wchar_t *strrchr (wchar_t *s, wchar_t c);
00334 #endif 
00335 
00336 #if defined (ACE_LACKS_STRRCHR)
00337 
00338 
00339   extern ACE_Export
00340   char *strrchr_emulation (char *s, int c);
00341 
00342 
00343 
00344   extern ACE_Export
00345   const char *strrchr_emulation (const char *s, int c);
00346 #endif 
00347 
00348 
00349 
00350 
00351 
00352 
00353 
00354 
00355 
00356 
00357 
00358 
00359 
00360 
00361 
00362 
00363 
00364   extern ACE_Export
00365   char *strsncpy (char *dst,
00366                   const char *src,
00367                   size_t maxlen);
00368 
00369 
00370 
00371 
00372 
00373 
00374 
00375 
00376 
00377 
00378 
00379 
00380 
00381 
00382 
00383 
00384 
00385   extern ACE_Export
00386   ACE_WCHAR_T *strsncpy (ACE_WCHAR_T *dst,
00387                          const ACE_WCHAR_T *src,
00388                          size_t maxlen);
00389 
00390 
00391 
00392   ACE_NAMESPACE_INLINE_FUNCTION
00393   size_t strspn (const char *s1, const char *s2);
00394 
00395 #if defined (ACE_HAS_WCHAR)
00396 
00397 
00398   ACE_NAMESPACE_INLINE_FUNCTION
00399   size_t strspn (const wchar_t *s1, const wchar_t *s2);
00400 #endif 
00401 
00402 
00403 
00404   ACE_NAMESPACE_INLINE_FUNCTION
00405   const char *strstr (const char *s, const char *t);
00406 
00407 #if defined (ACE_HAS_WCHAR)
00408 
00409 
00410   ACE_NAMESPACE_INLINE_FUNCTION
00411   const wchar_t *strstr (const wchar_t *s, const wchar_t *t);
00412 #endif 
00413 
00414 
00415   ACE_NAMESPACE_INLINE_FUNCTION
00416   char *strstr (char *s, const char *t);
00417 
00418 #if defined (ACE_HAS_WCHAR)
00419 
00420   ACE_NAMESPACE_INLINE_FUNCTION
00421   wchar_t *strstr (wchar_t *s, const wchar_t *t);
00422 #endif 
00423 
00424 
00425   ACE_NAMESPACE_INLINE_FUNCTION
00426   char *strtok (char *s, const char *tokens);
00427 
00428 #if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOK)
00429 
00430   ACE_NAMESPACE_INLINE_FUNCTION
00431   wchar_t *strtok (wchar_t *s, const wchar_t *tokens);
00432 #endif 
00433 
00434 
00435 
00436 
00437   ACE_NAMESPACE_INLINE_FUNCTION
00438   char *strtok_r (char *s, const char *tokens, char **lasts);
00439 
00440 #if defined (ACE_HAS_WCHAR)
00441 
00442   ACE_NAMESPACE_INLINE_FUNCTION
00443   wchar_t *strtok_r (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts);
00444 #endif  // ACE_HAS_WCHAR
00445 
00446 #if !defined (ACE_HAS_REENTRANT_FUNCTIONS) || defined (ACE_LACKS_STRTOK_R)
00447 
00448   extern ACE_Export
00449   char *strtok_r_emulation (char *s, const char *tokens, char **lasts);
00450 #endif 
00451 
00452 # if defined (ACE_HAS_WCHAR) && defined(ACE_LACKS_WCSTOK)
00453 
00454   extern ACE_Export
00455   wchar_t *strtok_r_emulation (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts);
00456 # endif  // ACE_HAS_WCHAR && ACE_LACKS_WCSTOK
00457 
00458 } 
00459 
00460 ACE_END_VERSIONED_NAMESPACE_DECL
00461 
00462 # if defined (ACE_HAS_INLINED_OSCALLS)
00463 #   if defined (ACE_INLINE)
00464 #     undef ACE_INLINE
00465 #   endif 
00466 #   define ACE_INLINE inline
00467 #   include "ace/OS_NS_string.inl"
00468 # endif 
00469 
00470 # include  "ace/post.h"
00471 #endif