posix.scm 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ;;; installed-scm-file
  2. ;;;; Copyright (C) 1999 Free Software Foundation, Inc.
  3. ;;;;
  4. ;;;; This program is free software; you can redistribute it and/or modify
  5. ;;;; it under the terms of the GNU General Public License as published by
  6. ;;;; the Free Software Foundation; either version 2, or (at your option)
  7. ;;;; any later version.
  8. ;;;;
  9. ;;;; This program is distributed in the hope that it will be useful,
  10. ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;;;; GNU General Public License for more details.
  13. ;;;;
  14. ;;;; You should have received a copy of the GNU General Public License
  15. ;;;; along with this software; see the file COPYING. If not, write to
  16. ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  17. ;;;; Boston, MA 02111-1307 USA
  18. ;;;;
  19. (define (stat:dev f) (vector-ref f 0))
  20. (define (stat:ino f) (vector-ref f 1))
  21. (define (stat:mode f) (vector-ref f 2))
  22. (define (stat:nlink f) (vector-ref f 3))
  23. (define (stat:uid f) (vector-ref f 4))
  24. (define (stat:gid f) (vector-ref f 5))
  25. (define (stat:rdev f) (vector-ref f 6))
  26. (define (stat:size f) (vector-ref f 7))
  27. (define (stat:atime f) (vector-ref f 8))
  28. (define (stat:mtime f) (vector-ref f 9))
  29. (define (stat:ctime f) (vector-ref f 10))
  30. (define (stat:blksize f) (vector-ref f 11))
  31. (define (stat:blocks f) (vector-ref f 12))
  32. ;; derived from stat mode.
  33. (define (stat:type f) (vector-ref f 13))
  34. (define (stat:perms f) (vector-ref f 14))
  35. (define (passwd:name obj) (vector-ref obj 0))
  36. (define (passwd:passwd obj) (vector-ref obj 1))
  37. (define (passwd:uid obj) (vector-ref obj 2))
  38. (define (passwd:gid obj) (vector-ref obj 3))
  39. (define (passwd:gecos obj) (vector-ref obj 4))
  40. (define (passwd:dir obj) (vector-ref obj 5))
  41. (define (passwd:shell obj) (vector-ref obj 6))
  42. (define (group:name obj) (vector-ref obj 0))
  43. (define (group:passwd obj) (vector-ref obj 1))
  44. (define (group:gid obj) (vector-ref obj 2))
  45. (define (group:mem obj) (vector-ref obj 3))
  46. (define (utsname:sysname obj) (vector-ref obj 0))
  47. (define (utsname:nodename obj) (vector-ref obj 1))
  48. (define (utsname:release obj) (vector-ref obj 2))
  49. (define (utsname:version obj) (vector-ref obj 3))
  50. (define (utsname:machine obj) (vector-ref obj 4))
  51. (define (getpwent) (getpw))
  52. (define (setpwent) (setpw #t))
  53. (define (endpwent) (setpw))
  54. (define (getpwnam name) (getpw name))
  55. (define (getpwuid uid) (getpw uid))
  56. (define (getgrent) (getgr))
  57. (define (setgrent) (setgr #f))
  58. (define (endgrent) (setgr))
  59. (define (getgrnam name) (getgr name))
  60. (define (getgrgid id) (getgr id))