int buffer_to_lower(buffer *b) {
char *c;
if (b->used == 0) return 0;
for (c = b->ptr; *c; c++) {
if (*c >= 'A' && *c <= 'Z') {
*c |= 32;
}
}
return 0;
}
int buffer_to_upper(buffer *b) {
char *c;
if (b->used == 0) return 0;
for (c = b->ptr; *c; c++) {
if (*c >= 'a' && *c <= 'z') {
*c &= ~32;
}
}
return 0;
}
阅读(826) | 评论(0) | 转发(0) |