1 | | |
2 | | |
3 | | |
4 | | |
5 | | |
6 | | |
7 | | |
8 | | |
9 | | |
10 | | |
11 | | |
12 | | |
13 | | |
14 | | |
15 | | |
16 | | |
17 | | |
18 | | |
19 | | |
20 | | |
21 | | |
22 | | |
23 | | |
24 | | |
25 | | |
26 | | |
27 | | |
28 | | |
29 | | |
30 | | |
31 | | |
32 | | |
33 | | |
34 | | |
35 | | |
36 | | |
37 | | |
38 | | |
39 | | |
40 | | |
41 | | |
42 | | |
43 | | |
44 | | |
45 | | |
46 | | |
47 | | |
48 | | |
49 | | |
50 | | |
51 | | |
52 | | |
53 | | |
54 | | |
55 | | |
56 | | |
57 | | |
58 | | |
59 | | |
60 | | |
61 | | |
62 | | |
63 | | |
64 | | |
65 | | |
66 | | |
67 | | |
68 | | |
69 | | |
70 | | |
71 | | |
72 | | |
73 | | |
74 | | |
75 | | |
76 | | |
77 | | |
78 | | |
79 | | |
80 | | |
81 | | |
82 | | |
83 | | |
84 | | |
85 | | |
86 | | |
87 | | |
88 | | |
89 | | |
90 | | |
91 | | |
92 | | |
93 | | |
94 | | |
95 | | |
96 | | |
97 | | |
98 | | |
99 | | |
100 | | |
101 | | |
102 | | |
103 | | |
104 | | |
105 | | |
106 | | |
107 | | |
108 | | |
109 | | |
110 | | |
111 | | |
112 | | |
113 | | |
114 | | |
115 | | |
116 | | |
117 | | |
118 | | |
119 | | |
120 | | |
121 | | |
122 | | |
123 | | |
124 | | |
125 | | |
126 | | |
127 | | |
128 | | |
129 | | |
130 | | |
131 | | |
132 | | |
133 | | |
134 | | |
135 | | |
136 | | |
137 | | |
138 | | |
139 | | |
140 | | |
141 | | |
142 | | |
143 | | |
144 | | |
145 | | |
146 | | |
147 | | |
148 | | |
149 | | |
150 | | |
151 | | |
152 | | |
153 | | |
154 | | |
155 | | |
156 | | |
157 | | |
158 | | |
159 | | |
| #include <module.h> | inherit "module"; | | | constant cvs_version = "$Id: location.pike,v 1.2 2000/08/28 05:31:54 per Exp $"; | constant module_type = MODULE_LOCATION; | constant module_name = "RefDoc for MODULE_LOCATION"; | constant module_doc = "This module does nothing, but its inlined " | "documentation gets imported into the roxen " | "programmer manual. You really don't want to " | "add this module to your virtual server, promise!"; | | | | void create() | { | defvar("mountpoint", | Variable.Location("/dev/urandom/sort/of/", 0, | "Mount point", | "This is where the module will be inserted " | "in the namespace of your server.")); | } | | mapping|Stdio.File|void find_file( string path, RequestID id ) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | { | return Roxen.http_string_answer(make_random_string( 17, 17 )); | } | | string make_random_string(int min_len, int|void max_len) | { | int length = min_len + (max_len ? random(max_len - min_len) | : random(17)); | return (string)allocate(length, lambda(){ return random(256); })(); | } | | string query_location() | | | | | { | return query( "mountpoint" ); | } | | array(int)|Stat stat_file( string path, RequestID id ) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | { | return ({ 0775, | ({ 17, -2 })[random(2)], | 963331858, | 963331858, | 963331858, | 0, | 0 }); | } | | string|void real_file( string path, RequestID id ) | | | | | | | | | | {} | | array(string)|void find_dir( string path, RequestID id ) | | | | | | | | | | | | | | | | { | return allocate(random(47)+11, make_random_string)(4, 71); | } | | |
|