home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 1 / GoldFishApril1994_CD2.img / d4xx / d473 / cnewssrc / cnews_src.lzh / relay / amiga.c < prev    next >
C/C++ Source or Header  |  1990-05-30  |  2KB  |  106 lines

  1. /* :ts=4
  2.  *    Compatibility routines needed by relaynews.
  3.  *
  4.  *    $Id: amiga.c,v 1.3 90/05/28 15:51:09 crash Exp Locker: crash $
  5.  *
  6.  *    $Log:    amiga.c,v $
  7.  * Revision 1.3  90/05/28  15:51:09  crash
  8.  * RCS header cleanup and other misc cleanup
  9.  * 
  10.  * Revision 1.2  90/05/27  14:33:32  crash
  11.  * changed $Header: Work:UUPC/Source/relay/RCS/amiga.c,v 1.3 90/05/28 15:51:09 crash Exp Locker: crash $ to $Id: amiga.c,v 1.3 90/05/28 15:51:09 crash Exp Locker: crash $ in "static char RCSid[]" statement
  12.  * 
  13.  * Revision 1.1  90/05/22  23:45:57  crash
  14.  * Initial revision
  15.  * 
  16.  */
  17.  
  18. #ifndef lint
  19. static char RCSid[] =
  20.     "$Id: amiga.c,v 1.3 90/05/28 15:51:09 crash Exp Locker: crash $";
  21. #endif
  22.  
  23. #ifdef VOID
  24. # undef VOID                    /* Was (probably) set on command line */
  25. #endif
  26.  
  27. #include <stdio.h>
  28. #include <libraries/dos.h>
  29. #include "news.h"
  30.  
  31. #if defined(ckctpa) || defined(LATTICE)
  32. # include <proto/exec.h>
  33. #else
  34. # include <functions.h>
  35. #endif
  36.  
  37. int fork()
  38. {
  39.     return( -1 );
  40. }
  41.  
  42. #ifndef LATTICE
  43. int system(s)
  44. char *s;
  45. {
  46.     warning("attempting system() call: '%s'", s);
  47.     return( -1 );
  48. }
  49. #endif
  50.  
  51. #if 0
  52. /*
  53.  *    Somewhere I saw some code which was supposed to emulate the Un*x
  54.  *    popen/pclose library calls...  Now where was that??  (Some device
  55.  *    driver code, perhaps?)
  56.  */
  57. FILE *popen(name, mode)
  58. char *name, *mode;
  59. {
  60.     if (index(mode, '+'))
  61.         return( fopen(name, mode) );
  62.     else {
  63.         char buf[16];
  64.  
  65.         strcpy(buf, mode);
  66.         strcat(buf, "+");
  67.         return( fopen(name, buf) );
  68.     }
  69. }
  70.  
  71. int pclose(fp)
  72. FILE *fp;
  73. {
  74.     return( fclose(fp) );
  75. }
  76. #endif
  77.  
  78. #ifdef LATTICE        /* Does Lattice have these yet?? */
  79. int    chdir(path)
  80. char *path;
  81. {
  82.     register struct FileLock *lock, *oldLock;
  83.  
  84.     lock = Lock(path, ACCESS_READ);
  85.     if (!lock)
  86.         return (int) IoErr();
  87.     oldLock = CurrentDir(lock);
  88.     if (oldLock)
  89.         UnLock(oldLock);
  90.     return 0;
  91. }
  92.  
  93. int mkdir( name )
  94. char *name;
  95. {
  96.     extern int errno;
  97.     register struct FileLock *lock;
  98.  
  99.     lock = CreateDir( name );
  100.     if ( !lock )
  101.        return errno;
  102.     UnLock( lock );
  103.     return 0;
  104. }
  105. #endif /* LATTICE */
  106.