当前位置: 首页>>代码示例>>C++>>正文


C++ TOUPPER函数代码示例

本文整理汇总了C++中TOUPPER函数的典型用法代码示例。如果您正苦于以下问题:C++ TOUPPER函数的具体用法?C++ TOUPPER怎么用?C++ TOUPPER使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TOUPPER函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: P1C

string
uppercasify P1C(const_string, s)
{
  string target;
  string ret = xstrdup (s);
  
  for (target = ret; *target; target++)
    {
      *target = TOUPPER (*target);
    }
  
  return ret;
}
开发者ID:unusual-thoughts,项目名称:freebsd-1.x-ports,代码行数:13,代码来源:uppercasify.c

示例2: uppercase

char *
uppercase(char *s, size_t len){
  unsigned char *c, *e;

  c = (unsigned char*)s;
  e = c+len;

  while(c < e){
    *c = TOUPPER((unsigned char)(*c));
    c++;
  }
  return s;
}
开发者ID:kindy,项目名称:siege,代码行数:13,代码来源:util.c

示例3: get_unique_type_string

static void
get_unique_type_string (char *string, gfc_symbol *derived)
{
  char dt_name[GFC_MAX_SYMBOL_LEN+1];
  sprintf (dt_name, "%s", derived->name);
  dt_name[0] = TOUPPER (dt_name[0]);
  if (derived->module)
    sprintf (string, "%s_%s", derived->module, dt_name);
  else if (derived->ns->proc_name)
    sprintf (string, "%s_%s", derived->ns->proc_name->name, dt_name);
  else
    sprintf (string, "_%s", dt_name);
}
开发者ID:AsherBond,项目名称:MondocosmOS-Dependencies,代码行数:13,代码来源:class.c

示例4: TOUPPER

// P R I V A T E   M E T H O D S
int ACLStr::_FindCh
(
	IN const TCHAR	charToFind,
	IN BOOL			caseSensitive	/*=TRUE*/,
	IN BOOL			reverseFind		/*=FALSE*/
)
{
	LPTSTR	string	= NULL;
	TCHAR	ib[MAX_STRING];
	
	//	Initialize this to the
	//	internal buffer.
	LPTSTR	ibPtr		= _string;
	TCHAR	chToFind	= charToFind;

	//	If the internal string is NULL or the lenght is
	//	zero then we will just bail and say we couldn't
	//	find the string we were searching for.
	if (ibPtr != NULL || 0 != _length)
	{
		if (caseSensitive == TRUE)
		{
			chToFind = TOUPPER(charToFind);

			//	Now copy the internal ACLStr buffer to the new
			//	tempory Upper case version.
			if (_string)
			{
				// NOTE: STRCPY_S(target, length, source) - The length parameter is for
				// the length of the target string, not the source string. 
				STRCPY_S(ib, MAX_STRING, _string); 
				AnsiUpper(ib);
				ibPtr = ib;
			}
		}	//	case sensitive search?

		//	Go look for the starting point of the string.
		//	if we do NOT find it return STR_NOTFOUND
		if (reverseFind == TRUE)
		{
			string = STRRCHR(ibPtr, chToFind);
		}
		else
		{
			string = STRCHR(ibPtr, chToFind);
		}
	}	//	 search string NULL?

	return (string == NULL) ? STR_NOTFOUND : (int)(string - ibPtr);
	}	//	::_FindCh
开发者ID:Fahrni,项目名称:ACLLib,代码行数:51,代码来源:ACLStr.cpp

示例5: TOUPPER

char *tokcasecmp(char *tok, char *target)
{
    char c1, c2;
    char *t = (char *)target;

    do {
	c1 = TOUPPER(*tok);
	c2 = TOUPPER(pgm_read_byte(t));
	if (c2 <= ' ') {
	    /* Match */
	    if (c1 != 0) {
		return t;  // oops; both strings didn't end.
	    }
	    return 0; //match!
	}
	tok++; t++;
    } while (c1 == c2);
    /* Non-match.  Advance target ptr */
    while (pgm_read_byte(t) > ' ') {
	t++;
    }
    return t;
}
开发者ID:WestfW,项目名称:parser,代码行数:23,代码来源:parser.cpp

示例6: ldap_pvt_str2upper

char *
ldap_pvt_str2upper( char *str )
{
	char    *s;

	/* to upper */
	if ( str ) {
		for ( s = str; *s; s++ ) {
			*s = TOUPPER( (unsigned char) *s );
		}
	}

	return( str );
}
开发者ID:osstech-jp,项目名称:openldap,代码行数:14,代码来源:string.c

示例7: is_html

PRIVATE BOOL is_html (char * buf)
{
    char * p = strchr(buf,'<');

    if (p && (!strncasecomp(p, "<HTML>", 6) ||
	      !strncasecomp(p, "<!DOCTYPE HTML", 13) ||
	      !strncasecomp(p, "<HEAD", 5) ||
	      !strncasecomp(p, "<TITLE>", 7) ||
	      !strncasecomp(p, "<BODY>", 6) ||
	      !strncasecomp(p, "<PLAINTEXT>", 11) ||
	      (p[0]=='<' && TOUPPER(p[1]) == 'H' && p[3]=='>')))
	return YES;
    else
	return NO;
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:15,代码来源:HTGuess.c

示例8: capword

/* ARGSUSED */
int
capword(int f, int n)
{
	int	c, s;
	RSIZE	size;

	if ((s = checkdirty(curbp)) != TRUE)
		return (s);
	if (curbp->b_flag & BFREADONLY) {
		dobeep();
		ewprintf("Buffer is read-only");
		return (FALSE);
	}

	if (n < 0)
		return (FALSE);
	while (n--) {
		while (inword() == FALSE) {
			if (forwchar(FFRAND, 1) == FALSE)
				return (TRUE);
		}
		size = countfword();
		undo_add_change(curwp->w_dotp, curwp->w_doto, size);

		if (inword() != FALSE) {
			c = lgetc(curwp->w_dotp, curwp->w_doto);
			if (ISLOWER(c) != FALSE) {
				c = TOUPPER(c);
				lputc(curwp->w_dotp, curwp->w_doto, c);
				lchange(WFFULL);
			}
			if (forwchar(FFRAND, 1) == FALSE)
				return (TRUE);
			while (inword() != FALSE) {
				c = lgetc(curwp->w_dotp, curwp->w_doto);
				if (ISUPPER(c) != FALSE) {
					c = TOLOWER(c);
					lputc(curwp->w_dotp, curwp->w_doto, c);
					lchange(WFFULL);
				}
				if (forwchar(FFRAND, 1) == FALSE)
					return (TRUE);
			}
		}
	}
	return (TRUE);
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:48,代码来源:word.c

示例9: vstring_alloc

const char *fullname(void)
{
    static VSTRING *result;
    char   *cp;
    int     ch;
    uid_t   uid;
    struct passwd *pwd;

    if (result == 0)
	result = vstring_alloc(10);

    /*
     * Try the environment.
     */
    if ((cp = safe_getenv("NAME")) != 0)
	return (vstring_str(vstring_strcpy(result, cp)));

    /*
     * Try the password file database.
     */
    uid = getuid();
    if ((pwd = getpwuid(uid)) == 0)
	return (0);

    /*
     * Replace all `&' characters by the login name of this user, first
     * letter capitalized. Although the full name comes from the protected
     * password file, the actual data is specified by the user so we should
     * not trust its sanity.
     */
    VSTRING_RESET(result);
    for (cp = pwd->pw_gecos; (ch = *(unsigned char *) cp) != 0; cp++) {
	if (ch == ',' || ch == ';' || ch == '%')
	    break;
	if (ch == '&') {
	    if (pwd->pw_name[0]) {
		VSTRING_ADDCH(result, TOUPPER(pwd->pw_name[0]));
		vstring_strcat(result, pwd->pw_name + 1);
	    }
	} else {
	    VSTRING_ADDCH(result, ch);
	}
    }
    VSTRING_TERMINATE(result);
    return (vstring_str(result));
}
开发者ID:TonyChengTW,项目名称:Rmail,代码行数:46,代码来源:fullname.c

示例10: writeHeader

static void
writeHeader(FILE * const headerFileP,
            const char * const prefix,
            unsigned int const width,
            unsigned int const height,
            unsigned int const nfiles,
            const char ** const names,
            const Coord * const coords,
            const struct pam * imgs) {

    unsigned int i;

    fprintf(headerFileP, "#define %sOVERALLX %u\n", prefix, width);

    fprintf(headerFileP, "#define %sOVERALLY %u\n", prefix, height);

    fprintf(headerFileP, "\n");

    for (i = 0; i < nfiles; ++i) {
        char * const buffer = strdup(names[i]);
        Coord const coord = coords[i];
        struct pam const img = imgs[i];

        unsigned int j;
        
        *strchr(buffer, '.') = 0;
        for (j = 0; buffer[j]; ++j) {
            if (ISLOWER(buffer[j]))
                buffer[j] = TOUPPER(buffer[j]);
        }
        fprintf(headerFileP, "#define %s%sX %u\n", 
                prefix, buffer, coord.x);

        fprintf(headerFileP, "#define %s%sY %u\n",
                prefix, buffer, coord.y);

        fprintf(headerFileP, "#define %s%sSZX %u\n",
                prefix, buffer, img.width);

        fprintf(headerFileP, "#define %s%sSZY %u\n",
                prefix, buffer, img.height);

        fprintf(headerFileP, "\n");
    }
}
开发者ID:chneukirchen,项目名称:netpbm-mirror,代码行数:45,代码来源:pnmmontage.c

示例11: gen_attr

static void
gen_attr (rtx attr)
{
  const char *p, *tag;
  int is_const = GET_CODE (XEXP (attr, 2)) == CONST;

  printf ("#define HAVE_ATTR_%s\n", XSTR (attr, 0));

  /* If numeric attribute, don't need to write an enum.  */
  p = XSTR (attr, 1);
  if (*p == '\0')
    printf ("extern int get_attr_%s (%s);\n", XSTR (attr, 0),
            (is_const ? "void" : "rtx"));
  else
    {
      printf ("enum attr_%s {", XSTR (attr, 0));

      while ((tag = scan_comma_elt (&p)) != 0)
        {
          write_upcase (XSTR (attr, 0));
          putchar ('_');
          while (tag != p)
            putchar (TOUPPER (*tag++));
          if (*p == ',')
            fputs (", ", stdout);
        }

      fputs ("};\n", stdout);
      printf ("extern enum attr_%s get_attr_%s (%s);\n\n",
              XSTR (attr, 0), XSTR (attr, 0), (is_const ? "void" : "rtx"));
    }

  /* If `length' attribute, write additional function definitions and define
     variables used by `insn_current_length'.  */
  if (! strcmp (XSTR (attr, 0), "length"))
    {
      puts ("\
extern void shorten_branches (rtx);\n\
extern int insn_default_length (rtx);\n\
extern int insn_min_length (rtx);\n\
extern int insn_variable_length_p (rtx);\n\
extern int insn_current_length (rtx);\n\n\
#include \"insn-addr.h\"\n");
    }
开发者ID:epu,项目名称:gccxml,代码行数:44,代码来源:genattr.c

示例12: ldap_pvt_str2upperbv

struct berval *
ldap_pvt_str2upperbv( char *str, struct berval *bv )
{
	char    *s = NULL;

	assert( bv != NULL );

	/* to upper */
	if ( str ) {
		for ( s = str; *s; s++ ) {
			*s = TOUPPER( (unsigned char) *s );
		}
	}

	bv->bv_val = str;
	bv->bv_len = (ber_len_t)(s - str);
	
	return( bv );
}
开发者ID:osstech-jp,项目名称:openldap,代码行数:19,代码来源:string.c

示例13: mu_interactive

boolean_t mu_interactive(caddr_t message)
{
	boolean_t	done = FALSE, mur_error_allowed;
	unsigned short	len;
	int		index;
	char		res[8];
	char 		*fgets_res;
	util_out_print(PROCEED_PROMPT, TRUE);

	while (FALSE == done)
	{
		fgets_res = util_input(res, SIZEOF(res), stdin, FALSE);
		if (NULL != fgets_res)
		{
			len = strlen(res);
			if (0 < len)
			{
				for (index = 0; index < len; index++)
					res[index] = TOUPPER(res[index]);
				if (0 == memcmp(res, YES_STRING, len))
				{
					done = TRUE;
					mur_error_allowed = TRUE;
					break;
				} else if (0 == memcmp(res, NO_STRING, len))
				{
					done = TRUE;
					mur_error_allowed = FALSE;
					break;
				}
			}
			util_out_print(CORRECT_PROMPT, TRUE);
		} else
		{
			mur_error_allowed = FALSE;
			break;
		}
	}
	if (FALSE == mur_error_allowed)
		util_out_print(message, TRUE);
	return (mur_error_allowed);
}
开发者ID:mihawk,项目名称:fis-gtm,代码行数:42,代码来源:mu_interactive.c

示例14: acpi_ut_strupr

NATIVE_CHAR *
acpi_ut_strupr (
	NATIVE_CHAR             *src_string)
{
	NATIVE_CHAR             *string;


	FUNCTION_ENTRY ();


	/* Walk entire string, uppercasing the letters */

	for (string = src_string; *string; ) {
		*string = (char) TOUPPER (*string);
		string++;
	}


	return (src_string);
}
开发者ID:TKr,项目名称:Wive-ng-rt8186,代码行数:20,代码来源:utmisc.c

示例15: AcpiUtStrupr

NATIVE_CHAR *
AcpiUtStrupr (
    NATIVE_CHAR             *SrcString)
{
    NATIVE_CHAR             *String;


    FUNCTION_ENTRY ();


    /* Walk entire string, uppercasing the letters */

    for (String = SrcString; *String; )
    {
        *String = (char) TOUPPER (*String);
        String++;
    }


    return (SrcString);
}
开发者ID:MarginC,项目名称:kame,代码行数:21,代码来源:utmisc.c


注:本文中的TOUPPER函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。