repo.or.cz
/
nbdkit
/
ericb.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
server/public.c: Rearrange functions.
[nbdkit/ericb.git]
/
tests
/
test.rb
blob
063d51e39014a5e443bfac05817e5650d1377b65
1
$disk = "\0" * (1024*1024);
2
3
def config_complete()
4
end
5
6
def open(readonly)
7
return {}
8
end
9
10
def get_size(h)
11
return $disk.bytesize
12
end
13
14
def can_write(h)
15
return true
16
end
17
18
def can_flush(h)
19
return true
20
end
21
22
def is_rotational(h)
23
return false
24
end
25
26
def can_trim(h)
27
return true
28
end
29
30
def pread(h, count, offset)
31
return $disk.byteslice(offset, count)
32
end
33
34
def pwrite(h, buf, offset)
35
# Is this using bytes or chars? XXX
36
$disk[offset, buf.length] = buf
37
end
38
39
def flush(h)
40
end
41
42
def trim(h, count, offset)
43
end