• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/libxml2-26/libxml2/

Lines Matching refs:dt

1130 #define VALID_MDAY(dt)						\
1131 (IS_LEAP(dt->year) ? \
1132 (dt->day <= daysInMonthLeap[dt->mon - 1]) : \
1133 (dt->day <= daysInMonth[dt->mon - 1]))
1135 #define VALID_DATE(dt) \
1136 (VALID_YEAR(dt->year) && VALID_MONTH(dt->mon) && VALID_MDAY(dt))
1138 #define VALID_TIME(dt) \
1139 (VALID_HOUR(dt->hour) && VALID_MIN(dt->min) && \
1140 VALID_SEC(dt->sec) && VALID_TZO(dt->tzo))
1142 #define VALID_DATETIME(dt) \
1143 (VALID_DATE(dt) && VALID_TIME(dt))
1160 #define DEBUG_DATE(dt) \
1163 dt->type,dt->value.date.year,dt->value.date.mon, \
1164 dt->value.date.day,dt->value.date.hour,dt->value.date.min, \
1165 dt->value.date.sec); \
1166 if (dt->value.date.tz_flag) \
1167 if (dt->value.date.tzo != 0) \
1169 "%+05d\n",dt->value.date.tzo); \
1175 #define DEBUG_DATE(dt)
1180 * @dt: pointer to a date structure
1184 * field of the @dt structure. @str is updated to point just after the
1185 * xs:gYear. It is supposed that @dt->year is big enough to contain
1191 _xmlSchemaParseGYear (xmlSchemaValDatePtr dt, const xmlChar **str) {
1207 dt->year = dt->year * 10 + (*cur - '0');
1218 dt->year = - dt->year;
1220 if (!VALID_YEAR(dt->year))
1274 * @dt: pointer to a date structure
1278 * field of the @dt structure. @str is updated to point just after the
1284 _xmlSchemaParseGMonth (xmlSchemaValDatePtr dt, const xmlChar **str) {
1296 dt->mon = value;
1304 * @dt: pointer to a date structure
1308 * field of the @dt structure. @str is updated to point just after the
1314 _xmlSchemaParseGDay (xmlSchemaValDatePtr dt, const xmlChar **str) {
1326 dt->day = value;
1333 * @dt: pointer to a date structure
1337 * fields of the @dt structure. @str is updated to point just after the
1339 * In case of error, values of @dt fields are undefined.
1344 _xmlSchemaParseTime (xmlSchemaValDatePtr dt, const xmlChar **str) {
1359 dt->hour = value;
1366 dt->min = value;
1372 PARSE_FLOAT(dt->sec, cur, ret);
1376 if ((!VALID_SEC(dt->sec)) || (!VALID_TZO(dt->tzo)))
1385 * @dt: pointer to a date structure
1389 * field of the @dt structure. @str is updated to point just after the
1395 _xmlSchemaParseTimeZone (xmlSchemaValDatePtr dt, const xmlChar **str) {
1405 dt->tz_flag = 0;
1406 dt->tzo = 0;
1410 dt->tz_flag = 1;
1411 dt->tzo = 0;
1432 dt->tzo = tmp * 60;
1440 dt->tzo += tmp;
1442 dt->tzo = - dt->tzo;
1444 if (!VALID_TZO(dt->tzo))
1447 dt->tz_flag = 1;
1549 xmlSchemaValPtr dt;
1555 ret = _xmlSchemaParseTimeZone(&(dt->value.date), &cur); \
1559 dt->type = t; \
1573 dt = xmlSchemaNewValue(XML_SCHEMAS_UNKNOWN);
1574 if (dt == NULL)
1589 ret = _xmlSchemaParseGDay(&(dt->value.date), &cur);
1601 ret = _xmlSchemaParseGMonth(&(dt->value.date), &cur);
1617 ret = _xmlSchemaParseGDay(&(dt->value.date), &cur);
1627 if (VALID_MDAY((&(dt->value.date)))) {
1652 ret = _xmlSchemaParseTime(&(dt->value.date), &cur);
1662 ret = _xmlSchemaParseGYear(&(dt->value.date), &cur);
1673 ret = _xmlSchemaParseGMonth(&(dt->value.date), &cur);
1684 ret = _xmlSchemaParseGDay(&(dt->value.date), &cur);
1685 if ((ret != 0) || !VALID_DATE((&(dt->value.date))))
1696 ret = _xmlSchemaParseTime(&(dt->value.date), &cur);
1700 ret = _xmlSchemaParseTimeZone(&(dt->value.date), &cur);
1703 if ((ret != 0) || (*cur != 0) || (!(VALID_DATETIME((&(dt->value.date))))))
1707 dt->type = XML_SCHEMAS_DATETIME;
1711 if ((type != XML_SCHEMAS_UNKNOWN) && (type != dt->type))
1718 if ((type != XML_SCHEMAS_UNKNOWN) && (type != dt->type)) {
1721 if ((type == XML_SCHEMAS_TIME) && (dt->type == XML_SCHEMAS_TIME))
1725 ((dt->type != XML_SCHEMAS_DATE) ||
1726 (dt->type != XML_SCHEMAS_GYEARMONTH) ||
1727 (dt->type != XML_SCHEMAS_GYEAR)))
1731 ((dt->type != XML_SCHEMAS_GYEAR) ||
1732 (dt->type != XML_SCHEMAS_GYEARMONTH)))
1735 if ((type == XML_SCHEMAS_GYEARMONTH) && (dt->type != XML_SCHEMAS_GYEAR))
1738 if ((type == XML_SCHEMAS_GMONTHDAY) && (dt->type != XML_SCHEMAS_GMONTH))
1744 *val = dt;
1746 xmlSchemaFreeValue(dt);
1751 if (dt != NULL)
1752 xmlSchemaFreeValue(dt);
3739 * @dt: an #xmlSchemaValPtr
3742 * Compute a new date/time from @dt and @dur. This function assumes @dt
3745 * @dt. The calling program is responsible for freeing the returned value.
3750 _xmlSchemaDateAdd (xmlSchemaValPtr dt, xmlSchemaValPtr dur)
3757 if ((dt == NULL) || (dur == NULL))
3760 ret = xmlSchemaNewValue(dt->type);
3765 tmp = xmlSchemaDupVal(dt);
3893 * @dt: an #xmlSchemaValPtr of a date/time type value.
3894 * @offset: number of seconds to adjust @dt by.
3896 * Normalize @dt to GMT time. The @offset parameter is subtracted from
3897 * the return value is a time-zone offset is present on @dt.
3899 * Returns a normalized copy of @dt or NULL if error.
3902 xmlSchemaDateNormalize (xmlSchemaValPtr dt, double offset)
3906 if (dt == NULL)
3909 if (((dt->type != XML_SCHEMAS_TIME) &&
3910 (dt->type != XML_SCHEMAS_DATETIME) &&
3911 (dt->type != XML_SCHEMAS_DATE)) || (dt->value.date.tzo == 0))
3912 return xmlSchemaDupVal(dt);
3920 ret = _xmlSchemaDateAdd(dt, dur);
3932 * @dt: an #xmlSchemaValPtr
3934 * Convert mon and year of @dt to total number of days. Take the
3942 _xmlSchemaDateCastYMToDays (const xmlSchemaValPtr dt)
3947 mon = dt->value.date.mon;
3950 if (dt->value.date.year <= 0)
3951 ret = (dt->value.date.year * 365) +
3952 (((dt->value.date.year+1)/4)-((dt->value.date.year+1)/100)+
3953 ((dt->value.date.year+1)/400)) +
3954 DAY_IN_YEAR(0, mon, dt->value.date.year);
3956 ret = ((dt->value.date.year-1) * 365) +
3957 (((dt->value.date.year-1)/4)-((dt->value.date.year-1)/100)+
3958 ((dt->value.date.year-1)/400)) +
3959 DAY_IN_YEAR(0, mon, dt->value.date.year);
3966 * @dt: an #xmlSchemaValPtr
3968 * Calculates the number of seconds in the time portion of @dt.
3972 #define TIME_TO_NUMBER(dt) \
3973 ((double)((dt->value.date.hour * SECS_PER_HOUR) + \
3974 (dt->value.date.min * SECS_PER_MIN) + \
3975 (dt->value.date.tzo * SECS_PER_MIN)) + \
3976 dt->value.date.sec)