本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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
示例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;
}
示例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 );
}
示例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;
}
示例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);
}
示例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));
}
示例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");
}
}
示例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");
}
示例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 );
}
示例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);
}
示例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);
}
示例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);
}