home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / pine4.10.tar.gz / pine4.10.tar / pine4.10 / imap / src / osdep / amiga / os_ami.c < prev    next >
C/C++ Source or Header  |  1998-09-16  |  3KB  |  88 lines

  1. /*
  2.  * Program:    Operating-system dependent routines -- Amiga version
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    11 May 1989
  13.  * Last Edited: 19 September 1995
  14.  *
  15.  * Copyright 1995 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.    This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36. #define PINE               /* to get full DIR description in <dirent.h> */
  37. #include "tcp_ami.h"           /* must be before osdep includes tcp.h */
  38. #include "mail.h"
  39. #include "osdep.h"
  40. #include <stdio.h>
  41. #include <sys/stat.h>
  42. #include <sys/time.h>
  43. #include <sys/socket.h>
  44. #include <netinet/in.h>
  45. #include <arpa/inet.h>
  46. #include <netdb.h>
  47. #include <ctype.h>
  48. #include <errno.h>
  49. extern int errno;        /* just in case */
  50. #include <pwd.h>
  51. #include "misc.h"
  52.  
  53. extern int sys_nerr;
  54. extern char *sys_errlist[];
  55.  
  56. #define DIR_SIZE(d) d->d_reclen /* for scandir.c */
  57.  
  58. #include "fs_ami.c"
  59. #include "ftl_ami.c"
  60. #include "nl_ami.c"
  61. #include "env_ami.c"
  62. #include "tcp_ami.c"
  63. #include "log_std.c"
  64. #include "gr_waitp.c"
  65. #include "tz_bsd.c"
  66. #include "scandir.c"
  67. #include "gethstid.c"
  68.  
  69. #undef utime
  70.  
  71. /* Amiga has its own wierd utime() with an incompatible struct utimbuf that
  72.  * does not match with the traditional time_t [2].
  73.  */
  74.  
  75. /* Portable utime() that takes it args like real Unix systems
  76.  * Accepts: file path
  77.  *        traditional utime() argument
  78.  * Returns: utime() results
  79.  */
  80.  
  81. int portable_utime (char *file,time_t timep[2])
  82. {
  83.   struct utimbuf times;
  84.   times.actime = timep[0];    /* copy the portable values */
  85.   times.modtime = timep[1];
  86.   return utime (file,×);    /* now call Amiga's routine */
  87. }
  88.