Chapter 13. Examples of I18N
112
static const char * i_strstr(const char *str, const char *ptn)
{
const char *s2, *p2;
for( ; *str; str++) {
for(s2=str,p2=ptn; ; s2++,p2++) {
if (!*p2) return str;
if (toupper(*s2) != toupper(*p2)) break;
}
}
return NULL;
}
static const char * Font_GetElement(const char *pattern, char *buf, int bufsiz, ...)
{
const char *p, *v;
char *p2;
va_list va;
va_start(va, bufsiz);
buf[bufsiz 1] = 0;
buf[bufsiz 2] = '*';
while((v = va_arg(va, char *)) != NULL) {
p = i_strstr(pattern, v);
if (p) {
strncpy(buf, p+1, bufsiz 2);
p2 = strchr(buf, ' ');
if (p2) *p2=0;
va_end(va);
return p;
}
}
va_end(va);
strncpy(buf, "*", bufsiz);
return NULL;
}
static const char * Font_GetSize(const char *pattern, int *size)
{
const char *p;
const char *p2=NULL;
int n=0;
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved