(lambda*): Make sure that BODY is always put into a
[bpt/guile.git] / ice-9 / posix.scm
1 ;;; installed-scm-file
2
3 ;;;; Copyright (C) 1999 Free Software Foundation, Inc.
4 ;;;;
5 ;;;; This program is free software; you can redistribute it and/or modify
6 ;;;; it under the terms of the GNU General Public License as published by
7 ;;;; the Free Software Foundation; either version 2, or (at your option)
8 ;;;; any later version.
9 ;;;;
10 ;;;; This program is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;;;; GNU General Public License for more details.
14 ;;;;
15 ;;;; You should have received a copy of the GNU General Public License
16 ;;;; along with this software; see the file COPYING. If not, write to
17 ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 ;;;; Boston, MA 02111-1307 USA
19 ;;;;
20 ;;;; As a special exception, the Free Software Foundation gives permission
21 ;;;; for additional uses of the text contained in its release of GUILE.
22 ;;;;
23 ;;;; The exception is that, if you link the GUILE library with other files
24 ;;;; to produce an executable, this does not by itself cause the
25 ;;;; resulting executable to be covered by the GNU General Public License.
26 ;;;; Your use of that executable is in no way restricted on account of
27 ;;;; linking the GUILE library code into it.
28 ;;;;
29 ;;;; This exception does not however invalidate any other reasons why
30 ;;;; the executable file might be covered by the GNU General Public License.
31 ;;;;
32 ;;;; This exception applies only to the code released by the
33 ;;;; Free Software Foundation under the name GUILE. If you copy
34 ;;;; code from other Free Software Foundation releases into a copy of
35 ;;;; GUILE, as the General Public License permits, the exception does
36 ;;;; not apply to the code that you add in this way. To avoid misleading
37 ;;;; anyone as to the status of such modified files, you must delete
38 ;;;; this exception notice from them.
39 ;;;;
40 ;;;; If you write modifications of your own for GUILE, it is your choice
41 ;;;; whether to permit this exception to apply to your modifications.
42 ;;;; If you do not wish that, delete this exception notice.
43 ;;;;
44
45 (define (stat:dev f) (vector-ref f 0))
46 (define (stat:ino f) (vector-ref f 1))
47 (define (stat:mode f) (vector-ref f 2))
48 (define (stat:nlink f) (vector-ref f 3))
49 (define (stat:uid f) (vector-ref f 4))
50 (define (stat:gid f) (vector-ref f 5))
51 (define (stat:rdev f) (vector-ref f 6))
52 (define (stat:size f) (vector-ref f 7))
53 (define (stat:atime f) (vector-ref f 8))
54 (define (stat:mtime f) (vector-ref f 9))
55 (define (stat:ctime f) (vector-ref f 10))
56 (define (stat:blksize f) (vector-ref f 11))
57 (define (stat:blocks f) (vector-ref f 12))
58
59 ;; derived from stat mode.
60 (define (stat:type f) (vector-ref f 13))
61 (define (stat:perms f) (vector-ref f 14))
62
63 (define (passwd:name obj) (vector-ref obj 0))
64 (define (passwd:passwd obj) (vector-ref obj 1))
65 (define (passwd:uid obj) (vector-ref obj 2))
66 (define (passwd:gid obj) (vector-ref obj 3))
67 (define (passwd:gecos obj) (vector-ref obj 4))
68 (define (passwd:dir obj) (vector-ref obj 5))
69 (define (passwd:shell obj) (vector-ref obj 6))
70
71 (define (group:name obj) (vector-ref obj 0))
72 (define (group:passwd obj) (vector-ref obj 1))
73 (define (group:gid obj) (vector-ref obj 2))
74 (define (group:mem obj) (vector-ref obj 3))
75
76 (define (utsname:sysname obj) (vector-ref obj 0))
77 (define (utsname:nodename obj) (vector-ref obj 1))
78 (define (utsname:release obj) (vector-ref obj 2))
79 (define (utsname:version obj) (vector-ref obj 3))
80 (define (utsname:machine obj) (vector-ref obj 4))
81
82 (define (getpwent) (getpw))
83 (define (setpwent) (setpw #t))
84 (define (endpwent) (setpw))
85
86 (define (getpwnam name) (getpw name))
87 (define (getpwuid uid) (getpw uid))
88
89 (define (getgrent) (getgr))
90 (define (setgrent) (setgr #t))
91 (define (endgrent) (setgr))
92
93 (define (getgrnam name) (getgr name))
94 (define (getgrgid id) (getgr id))