const char *small_strptime(const char *p, const char *fmt,

                           struct tm *dt)

{

    int c, val;



    for(;;) {

        c = *fmt++;

        if (c == '\0') {

            return p;

        } else if (c == '%') {

            c = *fmt++;

            switch(c) {

            case 'H':

                val = date_get_num(&p, 0, 23, 2);

                if (val == -1)

                    return NULL;

                dt->tm_hour = val;

                break;

            case 'M':

                val = date_get_num(&p, 0, 59, 2);

                if (val == -1)

                    return NULL;

                dt->tm_min = val;

                break;

            case 'S':

                val = date_get_num(&p, 0, 59, 2);

                if (val == -1)

                    return NULL;

                dt->tm_sec = val;

                break;

            case 'Y':

                val = date_get_num(&p, 0, 9999, 4);

                if (val == -1)

                    return NULL;

                dt->tm_year = val - 1900;

                break;

            case 'm':

                val = date_get_num(&p, 1, 12, 2);

                if (val == -1)

                    return NULL;

                dt->tm_mon = val - 1;

                break;

            case 'd':

                val = date_get_num(&p, 1, 31, 2);

                if (val == -1)

                    return NULL;

                dt->tm_mday = val;

                break;

            case '%':

                goto match;

            default:

                return NULL;

            }

        } else {

        match:

            if (c != *p)

                return NULL;

            p++;

        }

    }

    return p;

}

const char *small_strptime(const char *p, const char *fmt,

                           struct tm *dt)

{

    int c, val;



    for(;;) {

        c = *fmt++;

        if (c == '\0') {

            return p;

        } else if (c == '%') {

            c = *fmt++;

            switch(c) {

            case 'H':

                val = date_get_num(&p, 0, 23, 2);

                if (val == -1)

                    return NULL;

                dt->tm_hour = val;

                break;

            case 'M':

                val = date_get_num(&p, 0, 59, 2);

                if (val == -1)

                    return NULL;

                dt->tm_min = val;

                break;

            case 'S':

                val = date_get_num(&p, 0, 59, 2);

                if (val == -1)

                    return NULL;

                dt->tm_sec = val;

                break;

            case 'Y':

                val = date_get_num(&p, 0, 9999, 4);

                if (val == -1)

                    return NULL;

                dt->tm_year = val - 1900;

                break;

            case 'm':

                val = date_get_num(&p, 1, 12, 2);

                if (val == -1)

                    return NULL;

                dt->tm_mon = val - 1;

                break;

            case 'd':

                val = date_get_num(&p, 1, 31, 2);

                if (val == -1)

                    return NULL;

                dt->tm_mday = val;

                break;

            case '%':

                goto match;

            default:

                return NULL;

            }

        } else {

        match:

            if (c != *p)

                return NULL;

            p++;

        }

    }

    return p;

}

const char *FUNC_0(const char *VAR_0, const char *VAR_1,

                           struct tm *VAR_2)

{

    int VAR_3, VAR_4;



    for(;;) {

        VAR_3 = *VAR_1++;

        if (VAR_3 == '\0') {

            return VAR_0;

        } else if (VAR_3 == '%') {

            VAR_3 = *VAR_1++;

            switch(VAR_3) {

            case 'H':

                VAR_4 = date_get_num(&VAR_0, 0, 23, 2);

                if (VAR_4 == -1)

                    return NULL;

                VAR_2->tm_hour = VAR_4;

                break;

            case 'M':

                VAR_4 = date_get_num(&VAR_0, 0, 59, 2);

                if (VAR_4 == -1)

                    return NULL;

                VAR_2->tm_min = VAR_4;

                break;

            case 'S':

                VAR_4 = date_get_num(&VAR_0, 0, 59, 2);

                if (VAR_4 == -1)

                    return NULL;

                VAR_2->tm_sec = VAR_4;

                break;

            case 'Y':

                VAR_4 = date_get_num(&VAR_0, 0, 9999, 4);

                if (VAR_4 == -1)

                    return NULL;

                VAR_2->tm_year = VAR_4 - 1900;

                break;

            case 'm':

                VAR_4 = date_get_num(&VAR_0, 1, 12, 2);

                if (VAR_4 == -1)

                    return NULL;

                VAR_2->tm_mon = VAR_4 - 1;

                break;

            case 'd':

                VAR_4 = date_get_num(&VAR_0, 1, 31, 2);

                if (VAR_4 == -1)

                    return NULL;

                VAR_2->tm_mday = VAR_4;

                break;

            case '%':

                goto match;

            default:

                return NULL;

            }

        } else {

        match:

            if (VAR_3 != *VAR_0)

                return NULL;

            VAR_0++;

        }

    }

    return VAR_0;

}

const char *FUNC_0(const char *VAR_0, const char *VAR_1,
struct tm *VAR_2)
{ int VAR_3, VAR_4; for(;;) { VAR_3 = *VAR_1++; if (VAR_3 == '\0') { return VAR_0; } else if (VAR_3 == '%') { VAR_3 = *VAR_1++; switch(VAR_3) { case 'H':
VAR_4 = date_get_num(&VAR_0, 0, 23, 2); if (VAR_4 == -1)
return NULL; VAR_2->tm_hour = VAR_4; break; case 'M':
VAR_4 = date_get_num(&VAR_0, 0, 59, 2); if (VAR_4 == -1)
return NULL; VAR_2->tm_min = VAR_4; break; case 'S':
VAR_4 = date_get_num(&VAR_0, 0, 59, 2); if (VAR_4 == -1)
return NULL; VAR_2->tm_sec = VAR_4; break; case 'Y':
VAR_4 = date_get_num(&VAR_0, 0, 9999, 4); if (VAR_4 == -1)
return NULL; VAR_2->tm_year = VAR_4 - 1900; break; case 'm':
VAR_4 = date_get_num(&VAR_0, 1, 12, 2); if (VAR_4 == -1)
return NULL; VAR_2->tm_mon = VAR_4 - 1; break; case 'd':
VAR_4 = date_get_num(&VAR_0, 1, 31, 2); if (VAR_4 == -1)
return NULL; VAR_2->tm_mday = VAR_4; break; case '%':
goto match; default:
return NULL; } } else { match:
if (VAR_3 != *VAR_0)
return NULL; VAR_0++; } } return VAR_0; }