home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip21.zip / atari / atari.c next >
C/C++ Source or Header  |  1996-04-01  |  18KB  |  663 lines

  1. /*
  2.  
  3.  Copyright (C) 1990-1996 Mark Adler, Richard B. Wales, Jean-loup Gailly,
  4.  Kai Uwe Rommel, Onno van der Linden and Igor Mandrichenko.
  5.  Permission is granted to any individual or institution to use, copy, or
  6.  redistribute this software so long as all of the original files are included,
  7.  that it is not sold for profit, and that this copyright notice is retained.
  8.  
  9. */
  10.  
  11. #include "zip.h"
  12.  
  13. #include <time.h>
  14. #include <errno.h>
  15. #include <dirent.h>
  16. #include <mintbind.h>
  17. #include <osbind.h>
  18. #include <ostruct.h>
  19.  
  20.  
  21. #define MATCH shmatch
  22. #define PAD 0
  23. #define PATH_END '/'
  24.  
  25. #ifndef UTIL    /* the companion #endif is a bit of ways down ... */
  26.  
  27. extern char *label;     /* defined in fileio.c */
  28.  
  29. local ulg label_time = 0;
  30. local ulg label_mode = 0;
  31. local time_t label_utim = 0;
  32.  
  33.  
  34. local char *readd(d)
  35. DIR *d;                 /* directory stream to read from */
  36. /* Return a pointer to the next name in the directory stream d, or NULL if
  37.    no more entries or an error occurs. */
  38. {
  39.   struct dirent *e;
  40.  
  41.   e = readdir(d);
  42.   return e == NULL ? (char *) NULL : e->d_name;
  43. }
  44.  
  45. local char *getVolumeLabel(drive, vtime, vmode, utim)
  46.   int drive;  /* drive name: 'A' .. 'Z' or '\0' for current drive */
  47.   ulg *vtime; /* volume label creation time (DOS format) */
  48.   ulg *vmode; /* volume label file mode */
  49.   time_t utim;/* volume label creation time (UNIX format) */
  50.  
  51. /* If a volume label exists for the given drive, return its name and
  52.    set its time and mode. The returned name must be static data. */
  53. {
  54.   static char vol[14];
  55.   _DTA *dtaptr;
  56.  
  57.   if (drive) {
  58.     vol[0] = (char)drive;
  59.     strcpy(vol+1, ":/");
  60.   } else {
  61.     strcpy(vol, "/");
  62.   }
  63.   strcat(vol, "*.*");
  64.   if (Fsfirst(vol, FA_LABEL) == 0) {
  65.     dtaptr = Fgetdta();
  66.     strncpy(vol, dtaptr->dta_name, sizeof(vol)-1);
  67.     *vtime = ((ulg)dtaptr->dta_date << 16) |
  68.              ((ulg)dtaptr->dta_time & 0xffff);
  69.     *vmode = (ulg)dtaptr->dta_attribute;
  70.     return vol;
  71.   }
  72.   return NULL;
  73. }
  74.  
  75. char GetFileMode(char *name)
  76. {
  77.    struct stat sb;
  78.  
  79.    sb.st_attr = 0;
  80.    Fxattr(linkput ? 1 : 0, name, &sb);
  81.    if (errno == EINVAL) {
  82.       _DTA *dtaptr, *old;
  83.       old = Fgetdta();
  84.       Fsfirst(name, FA_RDONLY+FA_HIDDEN+FA_SYSTEM+FA_DIR);
  85.       dtaptr = Fgetdta();
  86.       sb.st_attr = dtaptr->dta_attribute;
  87.       Fsetdta(old);
  88.    }
  89.    return sb.st_attr & 0x3f;
  90. }
  91.  
  92.  
  93. int wild2(w)
  94. char *w;                /* path/pattern to match */
  95. /* If not in exclude mode, expand the pattern based on the contents of the
  96.    file system.  Return an error code in the ZE_ class. */
  97. {
  98.   DIR *d;               /* stream for reading directory */
  99.   char *e;              /* name found in directory */
  100.   int r;                /* temporary variable */
  101.   char *n;              /* constructed name from directory */
  102.   int f;                /* true if there was a match */
  103.   char *a;              /* alloc'ed space for name */
  104.   char *p;              /* path */
  105.   char *q;              /* name */
  106.   char v[5];            /* space for device current directory */
  107.  
  108.   if (volume_label == 1) {
  109.     volume_label = 2;
  110.     label = getVolumeLabel(w[1] == ':' ? to_up(w[0]) : '\0',
  111.                            &label_time, &label_mode, &label_utim);
  112.     if (label != NULL) {
  113.        newname(label, 0);
  114.     }
  115.     if (w[1] == ':' && w[2] == '\0') return ZE_OK;
  116.     /* "zip -$ foo a:" can be used to force drive name */
  117.   }
  118.  
  119.   /* special handling of stdin request */
  120.   if (strcmp(w, "-") == 0)   /* if compressing stdin */
  121.     return newname(w, 0);
  122.  
  123.   /* Allocate and copy pattern */
  124.   if ((p = a = malloc(strlen(w) + 1)) == NULL)
  125.     return ZE_MEM;
  126.   strcpy(p, w);
  127.  
  128.   /* Normalize path delimiter as '/'. */
  129.   for (q = p; *q; q++)                  /* use / consistently */
  130.     if (*q == '\\')
  131.       *q = '/';
  132.  
  133.   /* Only name can have special matching characters */
  134.   if ((q = isshexp(p)) != NULL &&
  135.       (strrchr(q, '/') != NULL || strrchr(q, ':') != NULL))
  136.   {
  137.     free((zvoid *)a);
  138.     return ZE_PARMS;
  139.   }
  140.  
  141.   /* Separate path and name into p and q */
  142.   if ((q = strrchr(p, '/')) != NULL && (q == p || q[-1] != ':'))
  143.   {
  144.     *q++ = '\0';                        /* path/name -> path, name */
  145.     if (*p == '\0')                     /* path is just / */
  146.       p = strcpy(v, "/.");
  147.   }
  148.   else if ((q = strrchr(p, ':')) != NULL)
  149.   {                                     /* has device and no or root path */
  150.     *q++ = '\0';
  151.     p = strcat(strcpy(v, p), ":");      /* copy device as path */
  152.     if (*q == '/')                      /* -> device:/., name */
  153.     {
  154.       strcat(p, "/");
  155.       q++;
  156.     }
  157.     strcat(p, ".");
  158.   }
  159.   else if (recurse && (strcmp(p, ".") == 0 ||  strcmp(p, "..") == 0))
  160.   {                                    /* current or parent directory */
  161.     /* I can't understand Mark's code so I am adding a hack here to get
  162.      * "zip -r foo ." to work. Allow the dubious "zip -r foo .." but
  163.      * reject "zip -rm foo ..".
  164.      */
  165.     if (dispose && strcmp(p, "..") == 0)
  166.        ziperr(ZE_PARMS, "cannot remove parent directory");
  167.     q = "*.*";
  168.   }
  169.   else                                  /* no path or device */
  170.   {
  171.     q = p;
  172.     p = strcpy(v, ".");
  173.   }
  174.   if (recurse && *q == '\0') {
  175.     q = "*.*";
  176.   }
  177.   /* Search that level for matching names */
  178.   if ((d = opendir(p)) == NULL)
  179.   {
  180.     free((zvoid *)a);
  181.     return ZE_MISS;
  182.   }
  183.   if ((r = strlen(p)) > 1 &&
  184.       (strcmp(p + r - 2, ":.") == 0 || strcmp(p + r - 2, "/.") == 0))
  185.     *(p + r - 1) = '\0';
  186.   f = 0;
  187.   while ((e = readd(d)) != NULL) {
  188.     if (strcmp(e, ".") && strcmp(e, "..") && MATCH(q, e))
  189.     {
  190.       f = 1;
  191.       if (strcmp(p, ".") == 0) {                /* path is . */
  192.         r = procname(e);                        /* name is name */
  193.         if (r) {
  194.            f = 0;
  195.            break;
  196.         }
  197.       } else
  198.       {
  199.         if ((n = malloc(strlen(p) + strlen(e) + 2)) == NULL)
  200.         {
  201.           free((zvoid *)a);
  202.           closedir(d);
  203.           return ZE_MEM;
  204.         }
  205.         n = strcpy(n, p);
  206.         if (n[r = strlen(n) - 1] != '/' && n[r] != ':')
  207.           strcat(n, "/");
  208.         r = procname(strcat(n, e));             /* name is path/name */
  209.         free((zvoid *)n);
  210.         if (r) {
  211.           f = 0;
  212.           break;
  213.         }
  214.       }
  215.     }
  216.   }
  217.   closedir(d);
  218.  
  219.   /* Done */
  220.   free((zvoid *)a);
  221.   return f ? ZE_OK : ZE_MISS;
  222. }
  223.  
  224.  
  225. #include <regexp.h>
  226. #include <osbind.h>
  227.  
  228. void regerror( char const *msg ) {
  229.    perror( msg );
  230. }
  231.  
  232. static int    ret;
  233. static regexp *regptr;
  234. static short  is_w, ind_w;
  235. static char   fullpath[FILENAME_MAX], file_arg[FILENAME_MAX];
  236.  
  237. #define FTW_F   0
  238. #define FTW_D   1
  239. #define FTW_DNR 2
  240. #define FTW_NS  3
  241.  
  242. static int ftwfunc( struct stat *stats, int ftw_status )
  243. {
  244.    char *path = &fullpath[0];
  245.  
  246.    if (strncmp(path, "./", 2) == 0) path += 2;
  247.    switch (ftw_status) {
  248.    case FTW_NS:
  249.       zipwarn("can't stat file: ", path);
  250.       ret = ZE_MISS;
  251.       return 0;
  252.    case FTW_F:
  253.       if (!is_w || regexec(regptr, path, 1)) {
  254. #if 0
  255.          char fn[FILENAME_MAX];
  256.          int  k;
  257.          if (S_ISLNK(stats->st_mode) &&
  258.              (k = readlink(path, fn, FILENAME_MAX)) > 0) {
  259.             int l = strlen(path);
  260.             fn[k] = '\0';
  261.             strcat(strcat(path, " -> "), fn);
  262.             ret = newname(path, 0); /* procname(path); */
  263.             path[l] = '\0';
  264.          } else
  265. #endif
  266.             ret = newname(path, 0); /* procname(path); */
  267.       }
  268.       return 0;
  269.    case FTW_DNR:
  270.       zipwarn("can't open directory: ", path);
  271.       ret = ZE_MISS;
  272.       return 0;
  273.    case FTW_D:
  274.       if (strcmp(path, ".") == 0) return 0;
  275.       if (is_w && ind_w > 0 && strncmp(path, file_arg, ind_w) != 0)
  276.          return 4;
  277.    }
  278.    return 0;
  279. }
  280.  
  281. static int myftw( int depth )
  282. {
  283.    register DIR   *dirp;
  284.    struct dirent  *entp;
  285.    struct stat    stats;
  286.    register char  *p,*q;
  287.    register long  i;
  288.  
  289.    if (LSSTAT(fullpath, &stats) < 0)
  290.       return ftwfunc(&stats, FTW_NS);
  291.  
  292.    if (!S_ISDIR(stats.st_mode))
  293.       return ftwfunc(&stats, FTW_F);
  294.  
  295.    if ((dirp = opendir(fullpath)) == NULL)
  296.       return ftwfunc(&stats, FTW_DNR);
  297.  
  298.    if (i = ftwfunc(&stats, FTW_D)) {
  299.       closedir(dirp);
  300.       return (i == 4 ? 0 : (int)i);
  301.    }
  302.    i = strlen(fullpath);
  303.    p = &fullpath[i];
  304.    *p++ = '/'; *p = '\0';
  305.    if (dirnames && i > 1) {
  306.       q = (strncmp(fullpath, "./", 2) == 0 ? &fullpath[2] : &fullpath[0]);
  307.       ret = newname(q, 1);
  308.    }
  309.    i = 0;
  310.    while (depth > 0 && (entp = readdir(dirp)) != 0)
  311.       if (strcmp(entp->d_name,".") != 0 && strcmp(entp->d_name,"..") != 0) {
  312.          strcpy(p, entp->d_name);
  313.          if (i = myftw(depth-1))
  314.             depth = 0;       /* force User's finish */
  315.       }
  316.    closedir(dirp);
  317.    return (int)i;
  318. }
  319.  
  320. int wild( char *p )
  321. {
  322.    char *d;
  323.  
  324.    ret = ZE_OK;
  325.    if (p == NULL) p = "*";
  326.  
  327.    if (strcmp(p, "-") == 0)     /* if compressing stdin */
  328.       ret = newname(p, 0);
  329.  
  330.    strcpy(fullpath, p);
  331.    /* now turning UNIX-Wildcards into basic regular expressions */
  332.    for (is_w = ind_w = 0, d = &file_arg[0]; *p; d++, p++)
  333.       switch (*p) {
  334.       case '*': *d++ = '.'; *d = *p; is_w = 1;  break;
  335.       case '?': *d = '.';            is_w = 1;  break;
  336.       case '[': *d = *p;
  337.                 if (*(p+1) == '!') {
  338.                    *++d = '^'; p++;
  339.                 }                    is_w = 1;  break;
  340.       case '.': *d++ = '\\'; *d = *p;           break;
  341.       default : *d = *p;
  342.                 if (!is_w) ind_w++;
  343.       }
  344.    *++d = '\0';
  345.    if (is_w) {
  346.       strcat( file_arg, "$" );           /* to get things like *.[ch] work */
  347.       if ((regptr = regcomp( file_arg )) == NULL)
  348.          return ZE_MEM;
  349.       strcpy( fullpath, "." );
  350.       myftw( recurse ? 99 : 1 );
  351.       free(regptr);
  352.    } else if (recurse) {
  353.       myftw( 99 );
  354.    } else
  355.       myftw( 1 ); /* ret = procname( fullpath ); */
  356.    return ret;
  357. }
  358.  
  359. int procname(n)
  360. char *n;                /* name to process */
  361. /* Process a name or sh expression to operate on (or exclude).  Return
  362.    an error code in the ZE_ class. */
  363. {
  364.   char *a;              /* path and name for recursion */
  365.   DIR *d;               /* directory stream from opendir() */
  366.   char *e;              /* pointer to name from readd() */
  367.   int m;                /* matched flag */
  368.   char *p;              /* path for recursion */
  369.   struct stat s;        /* result of stat() */
  370.   struct zlist far *z;  /* steps through zfiles list */
  371.  
  372.   if (strcmp(n, "-") == 0)   /* if compressing stdin */
  373.     return newname(n, 0);
  374.   else if (LSSTAT(n, &s))
  375.   {
  376.     /* Not a file or directory--search for shell expression in zip file */
  377.     p = ex2in(n, 0, (int *)NULL);       /* shouldn't affect matching chars */
  378.     m = 1;
  379.     for (z = zfiles; z != NULL; z = z->nxt) {
  380.       if (MATCH(p, z->zname))
  381.       {
  382.         z->mark = pcount ? filter(z->zname) : 1;
  383.         if (verbose)
  384.             fprintf(mesg, "zip diagnostic: %scluding %s\n",
  385.                z->mark ? "in" : "ex", z->name);
  386.         m = 0;
  387.       }
  388.     }
  389.     free((zvoid *)p);
  390.     return m ? ZE_MISS : ZE_OK;
  391.   }
  392.  
  393.   /* Live name--use if file, recurse if directory */
  394.   for (p = n; *p; p++)          /* use / consistently */
  395.     if (*p == '\\')
  396.       *p = '/';
  397.   if (!S_ISDIR(s.st_mode))
  398.   {
  399.     /* add or remove name of file */
  400.     if ((m = newname(n, 0)) != ZE_OK)
  401.       return m;
  402.   } else {
  403.     /* Add trailing / to the directory name */
  404.     if ((p = malloc(strlen(n)+2)) == NULL)
  405.       return ZE_MEM;
  406.     if (strcmp(n, ".") == 0) {
  407.       *p = '\0';  /* avoid "./" prefix and do not create zip entry */
  408.     } else {
  409.       strcpy(p, n);
  410.       a = p + strlen(p);
  411.       if (a[-1] != '/')
  412.         strcpy(a, "/");
  413.       if (dirnames && (m = newname(p, 1)) != ZE_OK) {
  414.         free((zvoid *)p);
  415.         return m;
  416.       }
  417.     }
  418.     /* recurse into directory */
  419.     if (recurse && (d = opendir(n)) != NULL)
  420.     {
  421.       while ((e = readd(d)) != NULL) {
  422.         if (strcmp(e, ".") && strcmp(e, ".."))
  423.         {
  424.           if ((a = malloc(strlen(p) + strlen(e) + 1)) == NULL)
  425.           {
  426.             closedir(d);
  427.             free((zvoid *)p);
  428.             return ZE_MEM;
  429.           }
  430.           strcat(strcpy(a, p), e);
  431.           if ((m = procname(a)) != ZE_OK)   /* recurse on name */
  432.           {
  433.             if (m == ZE_MISS)
  434.               zipwarn("name not matched: ", a);
  435.             else
  436.               ziperr(m, a);
  437.           }
  438.           free((zvoid *)a);
  439.         }
  440.       }
  441.       closedir(d);
  442.     }
  443.     free((zvoid *)p);
  444.   } /* (s.st_mode & S_IFDIR) == 0) */
  445.   return ZE_OK;
  446. }
  447.  
  448. char *ex2in(x, isdir, pdosflag)
  449. char *x;                /* external file name */
  450. int isdir;              /* input: x is a directory */
  451. int *pdosflag;          /* output: force MSDOS file attributes? */
  452. /* Convert the external file name to a zip file name, returning the malloc'ed
  453.    string or NULL if not enough memory. */
  454. {
  455.   char *n;              /* internal file name (malloc'ed) */
  456.   char *t, *p;          /* shortened name */
  457.   int dosflag;
  458.  
  459.   dosflag = 0;
  460.  
  461.   /* Find starting point in name before doing malloc */
  462.   t = *x && *(x + 1) == ':' ? x + 2 : x;
  463.   while (*t == '/' || *t == '\\')
  464.     t++;
  465.  
  466.   /* Make changes, if any, to the copied name (leave original intact) */
  467.   for (n = t; *n; n++)
  468.     if (*n == '\\')
  469.       *n = '/';
  470.  
  471.   if (!pathput)
  472.     t = last(t, PATH_END);
  473.  
  474.   /* Malloc space for internal name and copy it */
  475.   if ((n = malloc(strlen(t) + 1)) == NULL)
  476.     return NULL;
  477.   strcpy(n, t);
  478. #if 0
  479.   if (p = strstr(t, " -> "))       /* shorten "link -> data" to "link" */
  480.     *p = '\0';
  481. #endif
  482.   if (dosify)
  483.     msname(n);
  484.  
  485.   /* Returned malloc'ed name */
  486.   if (pdosflag)
  487.     *pdosflag = dosflag;
  488.   return n;
  489. }
  490.  
  491.  
  492. char *in2ex(n)
  493. char *n;                /* internal file name */
  494. /* Convert the zip file name to an external file name, returning the malloc'ed
  495.    string or NULL if not enough memory. */
  496. {
  497.   char *x;              /* external file name */
  498.  
  499.   if ((x = malloc(strlen(n) + 1 + PAD)) == NULL)
  500.       return NULL;
  501.   strcpy(x, n);
  502.   return x;
  503. }
  504.  
  505. void stamp(f, d)
  506. char *f;                /* name of file to change */
  507. ulg d;                  /* dos-style time to change it to */
  508. /* Set last updated and accessed time of file f to the DOS time d. */
  509. {
  510.   struct utimbuf u;     /* argument for utime()  const ?? */
  511.  
  512.   /* Convert DOS time to time_t format in u[0] and u[1] */
  513.   u.actime = u.modtime = dos2unixtime(d);
  514.  
  515.   /* Set updated and accessed times of f */
  516.   utime(f, &u);
  517. }
  518.  
  519. ulg filetime(f, a, n, t)
  520. char *f;                /* name of file to get info on */
  521. ulg *a;                 /* return value: file attributes */
  522. long *n;                /* return value: file size */
  523. ztimbuf *t;             /* return value: access and modification time */
  524. /* If file *f does not exist, return 0.  Else, return the file's last
  525.    modified date and time as an MSDOS date and time.  The date and
  526.    time is returned in a long with the date most significant to allow
  527.    unsigned integer comparison of absolute times.  Also, if a is not
  528.    a NULL pointer, store the file attributes there, with the high two
  529.    bytes being the Unix attributes, and the low byte being a mapping
  530.    of that to DOS attributes.  If n is not NULL, store the file size
  531.    there.  If t is not NULL, the file's access and modification time
  532.    are stored there as UNIX time_t values.
  533.    If f is "-", use standard input as the file. If f is a device, return
  534.    a file size of -1 */
  535. {
  536.   struct stat s;        /* results of stat() */
  537.   char name[FNMAX];
  538.   int len = strlen(f);
  539.  
  540.   if (f == label) {
  541.     if (a != NULL)
  542.       *a = label_mode;
  543.     if (n != NULL)
  544.       *n = -2L; /* convention for a label name */
  545.     if (t != NULL)
  546.       t->actime = t->modtime = label_utim;
  547.     return label_time;
  548.   }
  549.   strcpy(name, f);
  550.   if (name[len - 1] == '/')
  551.     name[len - 1] = '\0';
  552.   /* not all systems allow stat'ing a file with / appended */
  553.  
  554.   if (strcmp(f, "-") == 0) {
  555.     if (fstat(fileno(stdin), &s) != 0)
  556.       error("fstat(stdin)");
  557.   } else if (LSSTAT(name, &s) != 0)
  558.              /* Accept about any file kind including directories
  559.               * (stored with trailing / with -r option)
  560.               */
  561.       return 0;
  562.  
  563.   if (a != NULL) {
  564. /*  *a = ((ulg)s.st_mode << 16) | (ulg)GetFileMode(name); */
  565.     *a = ((ulg)s.st_mode << 16) | (ulg)s.st_attr;
  566.   }
  567.   if (n != NULL)
  568.     *n = S_ISREG(s.st_mode) ? s.st_size : -1L;
  569.   if (t != NULL) {
  570.     t->actime = s.st_atime;
  571.     t->modtime = s.st_mtime;
  572.   }
  573.  
  574.   return unix2dostime(&s.st_mtime);
  575. }
  576.  
  577. int set_extra_field(z, z_utim)
  578.   struct zlist far *z;
  579.   ztimbuf *z_utim;
  580.   /* create extra field and change z->att if desired */
  581. {
  582. #ifdef USE_EF_UX_TIME
  583.   if ((z->extra = (char *)malloc(EB_HEADSIZE+EB_UX_MINLEN)) == NULL)
  584.     return ZE_MEM;
  585.  
  586.   z->extra[0]  = 'U';
  587.   z->extra[1]  = 'X';
  588.   z->extra[2]  = EB_UX_MINLEN;          /* length of data part of e.f. */
  589.   z->extra[3]  = 0;
  590.   z->extra[4]  = (char)(z_utim->actime);
  591.   z->extra[5]  = (char)(z_utim->actime >> 8);
  592.   z->extra[6]  = (char)(z_utim->actime >> 16);
  593.   z->extra[7]  = (char)(z_utim->actime >> 24);
  594.   z->extra[8]  = (char)(z_utim->modtime);
  595.   z->extra[9]  = (char)(z_utim->modtime >> 8);
  596.   z->extra[10] = (char)(z_utim->modtime >> 16);
  597.   z->extra[11] = (char)(z_utim->modtime >> 24);
  598.  
  599.   z->cext = z->ext = (EB_HEADSIZE+EB_UX_MINLEN);
  600.   z->cextra = z->extra;
  601.  
  602.   return ZE_OK;
  603. #else /* !USE_EF_UX_TIME */
  604.   return (int)(z-z);
  605. #endif /* ?USE_EF_UX_TIME */
  606. }
  607.  
  608. int deletedir(d)
  609. char *d;                /* directory to delete */
  610. /* Delete the directory *d if it is empty, do nothing otherwise.
  611.    Return the result of rmdir(), delete(), or system().
  612.    For VMS, d must be in format [x.y]z.dir;1  (not [x.y.z]).
  613.  */
  614. {
  615.     return rmdir(d);
  616. }
  617.  
  618. /******************************/
  619. /*  Function version_local()  */
  620. /******************************/
  621.  
  622. void version_local()
  623. {
  624.     static const char CompiledWith[] = "Compiled with %s%s for %s%s%s%s.\n\n";
  625. #ifdef __TURBOC__
  626.     char buf[40];
  627. #endif
  628.  
  629.     printf(CompiledWith,
  630.  
  631. #ifdef __GNUC__
  632.       "gcc ", __VERSION__,
  633. #else
  634. #  if 0
  635.       "cc ", (sprintf(buf, " version %d", _RELEASE), buf),
  636. #  else
  637. #  ifdef __TURBOC__
  638.       "Turbo C", (sprintf(buf, " (0x%04x = %d)", __TURBOC__, __TURBOC__), buf),
  639. #  else
  640.       "unknown compiler", "",
  641. #  endif
  642. #  endif
  643. #endif
  644.  
  645. #ifdef __MINT__
  646.       "Atari TOS/MiNT",
  647. #else
  648.       "Atari TOS",
  649. #endif
  650.  
  651.       " (Atari ST/TT/Falcon030)",
  652.  
  653. #ifdef __DATE__
  654.       " on ", __DATE__
  655. #else
  656.       "", ""
  657. #endif
  658.       );
  659.  
  660. } /* end function version_local() */
  661.  
  662. #endif /* !UTIL */
  663.