bunxmacr.inc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Marco van de Voort
  4. The "linux" posixy macro's that are used both in the Baseunx 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 it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. This program is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License along
  16. with this program; if not, write to the Free Software Foundation, Inc.,
  17. 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************
  19. }
  20. function FpS_ISDIR(m : TMode): boolean;
  21. begin
  22. FpS_ISDIR:=((m and S_IFMT) = S_IFDIR);
  23. end;
  24. function FpS_ISCHR(m : TMode): boolean;
  25. begin
  26. FpS_ISCHR:=((m and S_IFMT) = S_IFCHR);
  27. end;
  28. function FpS_ISBLK(m : TMode): boolean;
  29. begin
  30. FpS_ISBLK:=((m and S_IFMT) = S_IFBLK);
  31. end;
  32. function FpS_ISREG(m : TMode): boolean;
  33. begin
  34. FpS_ISREG:=((m and S_IFMT) = S_IFREG);
  35. end;
  36. function FpS_ISFIFO(m : TMode): boolean;
  37. begin
  38. FpS_ISFIFO:=((m and S_IFMT) = S_IFIFO);
  39. end;
  40. Function FPS_ISLNK(m:TMode):boolean;
  41. begin
  42. FPS_ISLNK:=((m and S_IFMT) = S_IFLNK);
  43. end;
  44. Function FPS_ISSOCK(m:TMode):boolean;
  45. begin
  46. FPS_ISSOCK:=((m and S_IFMT) = S_IFSOCK);
  47. end;
  48. function wifexited(status : cint): boolean;
  49. begin
  50. wifexited:=(status AND $7f) =0;
  51. end;
  52. function wexitstatus(status : cint): cint;
  53. begin
  54. wexitstatus:=(status and $FF00) shr 8;
  55. end;
  56. function wstopsig(status : cint): cint;
  57. begin
  58. wstopsig:=(status and $FF00) shr 8;
  59. end;
  60. const wstopped=127;
  61. function wifsignaled(status : cint): boolean;
  62. begin
  63. wifsignaled:=((status and $FF)<>wstopped) and ((status and 127)<>0);
  64. end;
  65. function wtermsig(status : cint):cint;
  66. begin
  67. wtermsig:=cint(status and 127);
  68. end;
  69. {
  70. $Log$
  71. Revision 1.2 2005-02-13 21:47:56 peter
  72. * include file cleanup part 2
  73. Revision 1.4 2005/02/13 20:01:38 peter
  74. * include file cleanup
  75. Revision 1.3 2003/09/27 12:51:33 peter
  76. * fpISxxx macros renamed to C compliant fpS_ISxxx
  77. Revision 1.2 2003/09/17 11:24:46 marco
  78. * fixes for new macro's
  79. Revision 1.1 2002/12/18 16:43:26 marco
  80. * new unix rtl, linux part.....
  81. Revision 1.2 2002/11/12 15:31:33 marco
  82. * Killed octal codes for 1.0.x compilability.
  83. Revision 1.1 2002/11/12 14:37:59 marco
  84. * Parts of new unix rtl
  85. }