home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Ascii-Ansi / vec3.231.lha / vec3231 / source / unix / unix.h < prev   
Encoding:
C/C++ Source or Header  |  1993-12-08  |  1.1 KB  |  37 lines

  1. /*
  2.  * GENER.H (VEC)
  3.  *
  4.  * Copyright (c) 1993 Ville Saari
  5.  * All rights reserved
  6.  *
  7.  * Created: 16-Jul-93
  8.  * Updated: 08-Oct-93
  9.  */
  10.  
  11. #include <fcntl.h>
  12.  
  13. #define SYSTEM    "u"
  14. #define DEFMETHOD '3'
  15. #define BUFSIZE   262144
  16.  
  17. typedef int filehandle;
  18.  
  19. #define init()
  20. #define cleanup()
  21. #define interrupt()             0
  22. #define getstdin(bin)           0
  23. #define getstdout(bin)          1
  24. #define openread(name, bin)     open(name, O_RDONLY)
  25. #define openwrite(name, bin)    open(name, O_WRONLY|O_CREAT)
  26. #define openappend(name, bin)   open(name, O_WRONLY|O_APPEND)
  27. #define failedopen(fh)          ((fh)<0)
  28. #define closefile(fh)           close(fh)
  29. #define readfile(fh, buf, sz)   read(fh, buf, sz)
  30. #define writefile(fh, buf, sz)  write(fh, buf, sz)
  31. #define modifyname(name, count) (sprintf((name)+strlen(name), "_%d", (count)))
  32. #define basename(name)          (strrchr((name), '/')?strrchr((name), '/')+1:name)
  33. #define firstmatch(pattern)     pattern
  34. #define nextmatch()             0
  35. #define changedir(path)         !chdir(path)
  36. #define printerr(string)        write(2, string, strlen(string))
  37.