Changeset: 84f883d254d9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=84f883d254d9
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures_nocfitsio.stable.out
        clients/Tests/MAL-signatures_nogeom.stable.out
        clients/Tests/exports.stable.out
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/atoms/mtime.h
        monetdb5/modules/atoms/mtime.mal
Branch: default
Log Message:

Cleanup: remove oldduration and olddate.


diffs (196 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -40781,14 +40781,6 @@ command mtime.month(d:date):int
 address MTIMEdate_extract_month;
 comment extracts month from date
 
-command mtime.oldduration(format:str):int 
-address MTIMEoldduration;
-comment parse the old duration format and      return an (estimated) number of 
days.
-
-command mtime.olddate(format:str):date 
-address MTIMEolddate;
-comment create a date from the old instant     format.
-
 command mtime.prelude():void 
 address MTIMEprelude;
 command mtime.rule(mo:int,d:int,wkday:int,mi:int):zrule 
diff --git a/clients/Tests/MAL-signatures_nocfitsio.stable.out 
b/clients/Tests/MAL-signatures_nocfitsio.stable.out
--- a/clients/Tests/MAL-signatures_nocfitsio.stable.out
+++ b/clients/Tests/MAL-signatures_nocfitsio.stable.out
@@ -40757,14 +40757,6 @@ command mtime.month(d:date):int
 address MTIMEdate_extract_month;
 comment extracts month from date
 
-command mtime.oldduration(format:str):int 
-address MTIMEoldduration;
-comment parse the old duration format and      return an (estimated) number of 
days.
-
-command mtime.olddate(format:str):date 
-address MTIMEolddate;
-comment create a date from the old instant     format.
-
 command mtime.prelude():void 
 address MTIMEprelude;
 command mtime.rule(mo:int,d:int,wkday:int,mi:int):zrule 
diff --git a/clients/Tests/MAL-signatures_nogeom.stable.out 
b/clients/Tests/MAL-signatures_nogeom.stable.out
--- a/clients/Tests/MAL-signatures_nogeom.stable.out
+++ b/clients/Tests/MAL-signatures_nogeom.stable.out
@@ -40595,14 +40595,6 @@ command mtime.month(d:date):int
 address MTIMEdate_extract_month;
 comment extracts month from date
 
-command mtime.oldduration(format:str):int 
-address MTIMEoldduration;
-comment parse the old duration format and      return an (estimated) number of 
days.
-
-command mtime.olddate(format:str):date 
-address MTIMEolddate;
-comment create a date from the old instant     format.
-
 command mtime.prelude():void 
 address MTIMEprelude;
 command mtime.rule(mo:int,d:int,wkday:int,mi:int):zrule 
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1683,8 +1683,6 @@ str MTIMEmonth_to_str(str *ret, const in
 str MTIMEmsec(lng *r);
 str MTIMEmsecs(lng *ret, const int *d, const int *h, const int *m, const int 
*s, const int *ms);
 str MTIMEnil2date(date *ret, const int *src);
-str MTIMEolddate(date *d, const char *const *buf);
-str MTIMEoldduration(int *ndays, const char *const *s);
 str MTIMEprelude(void);
 str MTIMEruleDef0(rule *ret, const int *m, const int *d, const int *w, const 
int *h, const int *mint);
 str MTIMEruleDef1(rule *ret, const int *m, const char *const *dnme, const int 
*w, const int *h, const int *mint);
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -1352,95 +1352,6 @@ MTIMEsynonyms(const bit *allow)
 }
 
 str
-MTIMEoldduration(int *ndays, const char * const *s)
-{
-       int year = 0, month = 0, day = 0;
-       int hour = 0 /*, min=0 */ ;
-       const char *snew = *s;
-       int v = 0;
-
-       while (*snew != '\0') {
-               if (GDKisdigit(*snew)) {
-                       v = 0;
-                       while (GDKisdigit(*snew)) {
-                               v = v * 10 + (*snew) - '0';
-                               snew++;
-                       }
-               } else if (isupper((int) (*snew)) || islower((int) (*snew))) {
-                       switch (*snew++) {
-                       case 'y':
-                       case 'Y':
-                               year = v;
-                               v = 0;
-                               break;
-                       case 'm':
-                       case 'M':
-                               if (month || day || hour)       /*min = v */
-                                       ;
-                               else
-                                       month = v;
-                               v = 0;
-                               break;
-                       case 'd':
-                       case 'D':
-                               day = v;
-                               v = 0;
-                               break;
-                       case 'h':
-                       case 'H':
-                               hour = v;
-                               v = 0;
-                               break;
-                       case 's':
-                       case 'S':
-                               v = 0;
-                               break;
-                       default:
-                               /* GDKerror("duration_fromstr: wrong duration 
'%s'!\n",*s); */
-                               *ndays = int_nil;
-                               return MAL_SUCCEED;
-                       }
-               } else {
-                       snew++;
-               }
-       }
-       *ndays = year * 365 + month * 30 + day;
-       return MAL_SUCCEED;
-}
-
-str
-MTIMEolddate(date *d, const char * const *buf)
-{
-       int day = 0, month, year, yearneg = ((*buf)[0] == '-'), pos = yearneg;
-
-       *d = date_nil;
-       if (!GDKisdigit((*buf)[pos])) {
-               throw(MAL, "mtime.olddate", "syntax error");
-       }
-       for (year = 0; GDKisdigit((*buf)[pos]); pos++) {
-               year = ((*buf)[pos] - '0') + year * 10;
-               if (year > YEAR_MAX)
-                       break;
-       }
-       pos += parse_substr(&month, (*buf) + pos, 3, MONTHS, 12);
-       if (month == int_nil) {
-               throw(MAL, "mtime.olddate", "syntax error");
-       }
-       if (!GDKisdigit((*buf)[pos])) {
-               throw(MAL, "mtime.olddate", "syntax error");
-       }
-       while (GDKisdigit((*buf)[pos])) {
-               day = ((*buf)[pos] - '0') + day * 10;
-               pos++;
-               if (day > 31)
-                       break;
-       }
-       /* handle semantic error here (returns nil in that case) */
-       *d = todate(day, month, yearneg ? -year : year);
-       return MAL_SUCCEED;
-}
-
-str
 MTIMEtimezone(tzone *ret, const char * const *name)
 {
        BUN p;
diff --git a/monetdb5/modules/atoms/mtime.h b/monetdb5/modules/atoms/mtime.h
--- a/monetdb5/modules/atoms/mtime.h
+++ b/monetdb5/modules/atoms/mtime.h
@@ -132,8 +132,6 @@ mtime_export str MTIMEtimestamp2timestam
 mtime_export str MTIMEprelude(void);
 mtime_export str MTIMEepilogue(void);
 mtime_export str MTIMEsynonyms(const bit *allow);
-mtime_export str MTIMEoldduration(int *ndays, const char * const *s);
-mtime_export str MTIMEolddate(date *d, const char * const *buf);
 mtime_export str MTIMEtimezone(tzone *z, const char * const *name);
 mtime_export str MTIMElocal_timezone(lng *res);
 mtime_export str MTIMEtzone_set_local(int res, const tzone *z);
diff --git a/monetdb5/modules/atoms/mtime.mal b/monetdb5/modules/atoms/mtime.mal
--- a/monetdb5/modules/atoms/mtime.mal
+++ b/monetdb5/modules/atoms/mtime.mal
@@ -676,15 +676,6 @@ address MTIMEsynonyms
 comment "Allow synonyms for the parse format of
        date/timestamp.";
 
-command olddate (format:str) :date
-address MTIMEolddate
-comment "create a date from the old instant
-       format.";
-command oldduration(format:str) :int
-address MTIMEoldduration
-comment "parse the old duration format and
-       return an (estimated) number of days.";
-
 command str_to_date(s:str, format:str) :date
 address MTIMEstrptime
 comment "create a date from the string, using the specified format (see man 
strptime)";
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to