]> gitweb.factorcode.org Git - factor.git/blob - basis/environment/environment-docs.factor
Remove Windows CE from core/ basis/ and build-support/
[factor.git] / basis / environment / environment-docs.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs help.markup help.syntax io.streams.string sequences strings ;
4 IN: environment
5
6 HELP: (os-envs)
7 { $values
8
9      { "seq" sequence } }
10 { $description "Returns a sequence of key/value pairs from the operating system." }
11 { $notes "In most cases, use " { $link os-envs } " instead." } ;
12
13 HELP: (set-os-envs)
14 { $values
15      { "seq" sequence } }
16 { $description "Low-level word for replacing the current set of environment variables." }
17 { $notes "In most cases, use " { $link set-os-envs } " instead." } ;
18
19
20 HELP: os-env
21 { $values { "key" string } { "value" string } }
22 { $description "Looks up the value of a shell environment variable." }
23 { $examples
24     "This is an operating system-specific feature. On Unix, you can do:"
25     { $unchecked-example
26         "USING: environment io ;"
27         "\"USER\" os-env print"
28         "jane"
29     }
30 } ;
31
32 HELP: os-envs
33 { $values { "assoc" "an association mapping strings to strings" } }
34 { $description "Outputs the current set of environment variables." }
35 { $notes
36     "Names and values of environment variables are operating system-specific."
37 } ;
38
39 HELP: set-os-envs
40 { $values { "assoc" "an association mapping strings to strings" } }
41 { $description "Replaces the current set of environment variables." }
42 { $notes
43     "Names and values of environment variables are operating system-specific. Windows NT allows values up to 32766 characters in length."
44 } ;
45
46 HELP: set-os-env
47 { $values { "value" string } { "key" string } }
48 { $description "Set an environment variable." }
49 { $notes
50     "Names and values of environment variables are operating system-specific."
51 } ;
52
53 HELP: unset-os-env
54 { $values { "key" string } }
55 { $description "Unset an environment variable." }
56 { $notes
57     "Names and values of environment variables are operating system-specific."
58 } ;
59
60 { os-env os-envs set-os-env unset-os-env set-os-envs } related-words
61
62
63 ARTICLE: "environment" "Environment variables"
64 "The " { $vocab-link "environment" } " vocabulary interfaces to the platform-dependent mechanism for setting environment variables." $nl
65 "Reading environment variables:"
66 { $subsections
67     os-env
68     os-envs
69 }
70 "Writing environment variables:"
71 { $subsections
72     set-os-env
73     unset-os-env
74     set-os-envs
75 } ;
76
77 ABOUT: "environment"