Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 87 of file wsprintf.c.
Referenced by wvnsprintfA().
{ LPCSTR p = format; res->flags = 0; res->width = 0; res->precision = 0; if (*p == '-') { res->flags |= WPRINTF_LEFTALIGN; p++; } if (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; } if (*p == '0') { res->flags |= WPRINTF_ZEROPAD; p++; } while ((*p >= '0') && (*p <= '9')) /* width field */ { res->width = res->width * 10 + *p - '0'; p++; } if (*p == '.') /* precision field */ { p++; while ((*p >= '0') && (*p <= '9')) { res->precision = res->precision * 10 + *p - '0'; p++; } } if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; } else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; } else if (*p == 'w') { res->flags |= WPRINTF_WIDE; p++; } switch(*p) { case 'c': res->type = (res->flags & WPRINTF_LONG) ? WPR_WCHAR : WPR_CHAR; break; case 'C': res->type = (res->flags & WPRINTF_SHORT) ? WPR_CHAR : WPR_WCHAR; break; case 'd': case 'i': res->type = WPR_SIGNED; break; case 's': res->type = (res->flags & (WPRINTF_LONG |WPRINTF_WIDE)) ? WPR_WSTRING : WPR_STRING; break; case 'S': res->type = (res->flags & (WPRINTF_SHORT|WPRINTF_WIDE)) ? WPR_STRING : WPR_WSTRING; break; case 'u': res->type = WPR_UNSIGNED; break; case 'X': res->flags |= WPRINTF_UPPER_HEX; /* fall through */ case 'x': res->type = WPR_HEXA; break; default: /* unknown format char */ res->type = WPR_UNKNOWN; p--; /* print format as normal char */ break; } return (INT)(p - format) + 1; }