Logo Search packages:      
Sourcecode: likewise-open version File versions

void strupper_m ( char *  s  ) 

Convert a string to upper case.

Definition at line 1682 of file util_str.c.

Referenced by get_user_tokens(), push_ascii(), rpc_trustdom_add_internals(), rpc_trustdom_del_internals(), rpc_trustdom_establish(), rpc_trustdom_revoke(), and strnorm().

      size_t len;
      int errno_save;

      /* this is quite a common operation, so we want it to be
         fast. We optimise for the ascii case, knowing that all our
         supported multi-byte character sets are ascii-compatible
         (ie. they match for the first 128 chars) */

      while (*s && !(((unsigned char)s[0]) & 0x80)) {
            *s = toupper_ascii_fast((unsigned char)*s);

      if (!*s)

      /* I assume that lowercased string takes the same number of bytes
       * as source string even in multibyte encoding. (VIV) */
      len = strlen(s) + 1;
      errno_save = errno;
      errno = 0;
      /* Catch mb conversion errors that may not terminate. */
      if (errno)
            s[len-1] = '\0';
      errno = errno_save;

Generated by  Doxygen 1.6.0   Back to index