bunxmacr.inc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Marco van de Voort
  4. The *BSD POSIX macro's that are used both in the Baseunix unit as the
  5. system unit. Not aliased via public names because I want these to be
  6. inlined as much as possible in the future.
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************}
  19. function FPS_ISDIR(m : TMode): boolean;
  20. begin
  21. FPS_ISDIR:=((m and S_IFMT) = S_IFDIR);
  22. end;
  23. function FPS_ISCHR(m : TMode): boolean;
  24. begin
  25. FPS_ISCHR:=((m and S_IFMT) = S_IFCHR);
  26. end;
  27. function FPS_ISBLK(m : TMode): boolean;
  28. begin
  29. FPS_ISBLK:=((m and S_IFMT) = S_IFBLK);
  30. end;
  31. function FPS_ISREG(m : TMode): boolean;
  32. begin
  33. FPS_ISREG:=((m and S_IFMT) = S_IFREG);
  34. end;
  35. function FPS_ISFIFO(m : TMode): boolean;
  36. begin
  37. FPS_ISFIFO:=((m and S_IFMT) = S_IFIFO);
  38. end;
  39. Function FPS_ISLNK(m:TMode):boolean;
  40. begin
  41. FPS_ISLNK:=((m and S_IFMT) = S_IFLNK);
  42. end;
  43. Function FPS_ISSOCK(m:TMode):boolean;
  44. begin
  45. FPS_ISSOCK:=((m and S_IFMT) = S_IFSOCK);
  46. end;
  47. function wifexited(status : cint): cint;
  48. begin
  49. wifexited:=cint((status AND 127) =0);
  50. end;
  51. function wexitstatus(status : cint): cint;
  52. begin
  53. wexitstatus:=(status and 127) shr 8;
  54. end;
  55. function wstopsig(status : cint): cint;
  56. begin
  57. wstopsig:=(status and 127) shr 8;
  58. end;
  59. const wstopped=127;
  60. function wifsignaled(status : cint): cint;
  61. begin
  62. wifsignaled:=cint(((status and 127)<>wstopped) and ((status and 127)<>0));
  63. end;
  64. function wtermsig(status : cint):cint;
  65. begin
  66. wtermsig:=cint(status and 127);
  67. end;
  68. {
  69. $Log$
  70. Revision 1.5 2003-09-27 13:04:58 peter
  71. * fpISxxx renamed
  72. Revision 1.4 2003/09/17 11:52:05 marco
  73. * stat macro fixes voor BSD
  74. Revision 1.3 2003/09/14 20:15:01 marco
  75. * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
  76. Revision 1.2 2003/01/21 15:34:59 marco
  77. * fix octal that broke 1.0.x
  78. Revision 1.1 2003/01/05 19:01:28 marco
  79. * FreeBSD compiles now with baseunix mods.
  80. Revision 1.4 2002/11/12 14:19:46 marco
  81. * fixes to macro
  82. Revision 1.3 2002/10/26 18:27:51 marco
  83. * First series POSIX calls commits. Including getcwd.
  84. Revision 1.2 2002/09/07 16:01:17 peter
  85. * old logs removed and tabs fixed
  86. Revision 1.1 2002/08/19 12:29:11 marco
  87. * First working POSIX *BSD system unit.
  88. }