]> andersk Git - moira.git/commitdiff
moved some stuff to util.c
authormar <mar>
Mon, 20 Jun 1988 12:52:46 +0000 (12:52 +0000)
committermar <mar>
Mon, 20 Jun 1988 12:52:46 +0000 (12:52 +0000)
gen/hesiod.qc

index 5e667218fdfc697eb6d2e150184cf0f24e9a79fc..b8856467ca7c96397156065181ef75d30eaf8300 100644 (file)
@@ -621,84 +621,3 @@ do_services()
     }
     return(1);
 ##}
-
-
-trim(s)
-register char *s;
-{
-    register char *p;
-
-    for (p = s; *s; s++)
-      if (*s != ' ')
-       p = s;
-    if (p != s) {
-       if (*p == ' ')
-         *p = 0;
-       else
-         p[1] = 0;
-    }
-}
-
-
-
-static char *month_name[] = {
-    "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct",
-    "nov", "dec"
-  };
-
-
-char *ingres_date_and_time(l)
-long l;
-{
-       char *ans = NULL, *date, *time;
-      
-       if ((date = ingres_date(l)) && (time = ingres_time(l))) {
-               char buf[BUFSIZ];
-               sprintf(buf, "%s %s", date, time);
-               ans = strsave(buf);
-       }
-       if (date)
-               free(date);
-       if (time)
-               free(time);
-       return ans;
-}
-
-char *ingres_time(t)
-       long t;
-{
-       struct tm *tm;
-
-       if (t == (long) 0)
-               (void) time(&t);
-
-       if ((tm = localtime(&t)) == (struct tm *) NULL) {
-               return NULL;
-       } else {
-               char buf[BUFSIZ];
-
-               sprintf(buf, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min,
-                       tm->tm_sec);
-               return strsave(buf);
-       }
-}
-
-char *ingres_date(t)
-       long t;
-{
-       struct tm *tm;
-
-       if (t == (long) 0)
-               (void) time(&t);
-
-       if ((tm = localtime(&t)) == (struct tm *) NULL) {
-               return NULL;
-       } else {
-               char buf[BUFSIZ];
-
-               sprintf(buf, "%02d-%3.3s-%04d", tm->tm_mday,
-                       month_name[tm->tm_mon], 1900 + tm->tm_year);
-               return strsave(buf);
-       }
-}
-
This page took 0.057782 seconds and 5 git commands to generate.