DER_AsciiToTime(int64 *dst, char *string)
DER_AsciiToTime(int64 *dst, const char *string)
DER_AsciiToTime(int64 *dst, char *string){    long year, month, mday, hour, minute, second, hourOff, minOff, days;    int64 result, tmp1, tmp2;    if (string == NULL) {	goto loser;    }        /* Verify time is formatted properly and capture information */    second = 0;    hourOff = 0;    minOff = 0;    CAPTURE(year,string+0,loser);    if (year < 50) {	/* ASSUME that year # is in the 2000's, not the 1900's */	year += 100;    }    CAPTURE(month,string+2,loser);    if ((month == 0) || (month > 12)) goto loser;    CAPTURE(mday,string+4,loser);    if ((mday == 0) || (mday > 31)) goto loser;    CAPTURE(hour,string+6,loser);    if (hour > 23) goto loser;    CAPTURE(minute,string+8,loser);    if (minute > 59) goto loser;    if (ISDIGIT(string[10])) {	CAPTURE(second,string+10,loser);	if (second > 59) goto loser;	string += 2;    }    if (string[10] == '+') {	CAPTURE(hourOff,string+11,loser);	if (hourOff > 23) goto loser;	CAPTURE(minOff,string+13,loser);	if (minOff > 59) goto loser;    } else if (string[10] == '-') {	CAPTURE(hourOff,string+11,loser);	if (hourOff > 23) goto loser;	hourOff = -hourOff;	CAPTURE(minOff,string+13,loser);	if (minOff > 59) goto loser;	minOff = -minOff;    } else if (string[10] != 'Z') {	goto loser;    }            /* Convert pieces back into a single value year  */    LL_I2L(tmp1, (year-70L));    LL_I2L(tmp2, SECYEAR);    LL_MUL(result, tmp1, tmp2);        LL_I2L(tmp1, ( (mday-1L)*SECDAY + hour*SECHOUR + minute*SECMIN -		  hourOff*SECHOUR - minOff*SECMIN + second ) );    LL_ADD(result, result, tmp1);    /*    ** Have to specially handle the day in the month and the year, to    ** take into account leap days. The return time value is in    ** seconds since January 1st, 12:00am 1970, so start examining    ** the time after that. We can't represent a time before that.    */    /* Using two digit years, we can only represent dates from 1970       to 2069. As a result, we cannot run into the leap year rule       that states that 1700, 2100, etc. are not leap years (but 2000       is). In other words, there are no years in the span of time       that we can represent that are == 0 mod 4 but are not leap       years. Whew.       */    days = monthToDayInYear[month-1];    days += (year - 68)/4;    if (((year % 4) == 0) && (month < 3)) {	days--;    }       LL_I2L(tmp1, (days * SECDAY) );    LL_ADD(result, result, tmp1 );    /* convert to micro seconds */    LL_I2L(tmp1, PR_USEC_PER_SEC);    LL_MUL(result, result, tmp1);    *dst = result;    return SECSuccess;  loser:    PORT_SetError(SEC_ERROR_INVALID_TIME);    return SECFailure;	}