関数 | |
char * | strlwc (const char *s) |
Convert a string to lowercase. | |
char * | strupc (char *s) |
Convert a string to uppercase. | |
char * | strskp (char *s) |
Skip blanks until the first non-blank character. | |
char * | strcrop (char *s) |
Remove blanks at the end of a string. | |
char * | strstrip (char *s) |
Remove blanks at the beginning and the end of a string. |
strlib.h で定義されています。
char* strlwc | ( | const char * | s | ) |
Convert a string to lowercase.
s | String to convert. |
参照元 iniparser_getstring()・iniparser_load()・iniparser_setstr()・iniparser_unset()・main().
00055 { 00056 static char l[ASCIILINESZ+1]; 00057 int i ; 00058 00059 if (s==NULL) return NULL ; 00060 memset(l, 0, ASCIILINESZ+1); 00061 i=0 ; 00062 while (s[i] && i<ASCIILINESZ) { 00063 l[i] = (char)tolower((int)s[i]); 00064 i++ ; 00065 } 00066 l[ASCIILINESZ]=(char)0; 00067 return l ; 00068 }
char* strupc | ( | char * | s | ) |
Convert a string to uppercase.
s | String to convert. |
参照元 main().
00086 { 00087 static char l[ASCIILINESZ+1]; 00088 int i ; 00089 00090 if (s==NULL) return NULL ; 00091 memset(l, 0, ASCIILINESZ+1); 00092 i=0 ; 00093 while (s[i] && i<ASCIILINESZ) { 00094 l[i] = (char)toupper((int)s[i]); 00095 i++ ; 00096 } 00097 l[ASCIILINESZ]=(char)0; 00098 return l ; 00099 }
char* strskp | ( | char * | s | ) |
Skip blanks until the first non-blank character.
s | String to parse. |
参照元 iniparser_load()・main().
00115 { 00116 char * skip = s; 00117 if (s==NULL) return NULL ; 00118 while (isspace((int)*skip) && *skip) skip++; 00119 return skip ; 00120 }
char* strcrop | ( | char * | s | ) |
Remove blanks at the end of a string.
s | String to parse. |
参照元 iniparser_load()・main().
00140 { 00141 static char l[ASCIILINESZ+1]; 00142 char * last ; 00143 00144 if (s==NULL) return NULL ; 00145 memset(l, 0, ASCIILINESZ+1); 00146 strcpy(l, s); 00147 last = l + strlen(l); 00148 while (last > l) { 00149 if (!isspace((int)*(last-1))) 00150 break ; 00151 last -- ; 00152 } 00153 *last = (char)0; 00154 return l ; 00155 }
char* strstrip | ( | char * | s | ) |
Remove blanks at the beginning and the end of a string.
s | String to parse. |
参照元 main().
00174 { 00175 static char l[ASCIILINESZ+1]; 00176 char * last ; 00177 00178 if (s==NULL) return NULL ; 00179 00180 while (isspace((int)*s) && *s) s++; 00181 00182 memset(l, 0, ASCIILINESZ+1); 00183 strcpy(l, s); 00184 last = l + strlen(l); 00185 while (last > l) { 00186 if (!isspace((int)*(last-1))) 00187 break ; 00188 last -- ; 00189 } 00190 *last = (char)0; 00191 00192 return (char*)l ; 00193 }