Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BDIO.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alberto Ramos
BDIO.jl
Commits
9df37cbb
Commit
9df37cbb
authored
Oct 22, 2019
by
Alberto Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor change in recording read position
parent
81b11657
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
src/BDIOmethods.jl
src/BDIOmethods.jl
+8
-7
src/BDIOtypes.jl
src/BDIOtypes.jl
+0
-1
No files found.
src/BDIOmethods.jl
View file @
9df37cbb
...
@@ -149,7 +149,7 @@ function BDIO_start_record!(fb::BDIOstream, ifmt, iuinfo, long::Bool = false)
...
@@ -149,7 +149,7 @@ function BDIO_start_record!(fb::BDIOstream, ifmt, iuinfo, long::Bool = false)
ist
::
Int64
=
position
(
fb
.
io
)
ist
::
Int64
=
position
(
fb
.
io
)
hsh
=
Nettle
.
Hasher
(
"md5"
)
hsh
=
Nettle
.
Hasher
(
"md5"
)
new
=
Record
(
false
,
long
,
Int64
(
0
),
ist
,
ist
,
0
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
new
=
Record
(
false
,
long
,
Int64
(
0
),
ist
,
ist
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
push!
(
fb
.
records
,
new
)
push!
(
fb
.
records
,
new
)
fb
.
ipt
+=
1
fb
.
ipt
+=
1
flush
(
fb
.
io
)
flush
(
fb
.
io
)
...
@@ -251,6 +251,7 @@ function BDIO_seek!(fb::BDIOstream, icnt::Int = 1)
...
@@ -251,6 +251,7 @@ function BDIO_seek!(fb::BDIOstream, icnt::Int = 1)
end
end
if
(
ipt
<
length
(
fb
.
records
))
&&
(
ipt
>
0
)
if
(
ipt
<
length
(
fb
.
records
))
&&
(
ipt
>
0
)
fb
.
ipt
=
ipt
fb
.
ipt
=
ipt
fb
.
rwpos
=
0
return
true
return
true
else
else
return
false
return
false
...
@@ -286,12 +287,12 @@ function BDIO_read(fb, vdata::Vector, n::Int64 = 0)
...
@@ -286,12 +287,12 @@ function BDIO_read(fb, vdata::Vector, n::Int64 = 0)
error
(
"Data in record not available"
)
error
(
"Data in record not available"
)
end
end
rpos
::
Int64
=
max
(
fb
.
records
[
fb
.
ipt
]
.
rpos
,
fb
.
r
ecords
[
fb
.
ipt
]
.
rsav
)
rpos
::
Int64
=
max
(
fb
.
records
[
fb
.
ipt
]
.
rpos
,
fb
.
r
wpos
)
seek
(
fb
.
io
,
rpos
)
seek
(
fb
.
io
,
rpos
)
for
i
=
1
:
nmax
for
i
=
1
:
nmax
vdata
[
i
]
=
read
(
fb
.
io
,
typeof
(
vdata
[
1
]))
vdata
[
i
]
=
read
(
fb
.
io
,
typeof
(
vdata
[
1
]))
end
end
fb
.
r
ecords
[
fb
.
ipt
]
.
rsav
=
position
(
fb
.
io
)
fb
.
r
wpos
=
position
(
fb
.
io
)
end
end
...
@@ -413,7 +414,7 @@ function BDIO_parse!(fb::BDIOstream)
...
@@ -413,7 +414,7 @@ function BDIO_parse!(fb::BDIOstream)
if
(
ihdr!
=
BDIO_MAGIC
)
if
(
ihdr!
=
BDIO_MAGIC
)
error
(
"Not a BDIO file"
)
error
(
"Not a BDIO file"
)
end
end
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
0
,
hsh
)
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
hsh
)
push!
(
fb
.
records
,
new
)
push!
(
fb
.
records
,
new
)
seek
(
fb
.
io
,
rpos
+
rlen
)
seek
(
fb
.
io
,
rpos
+
rlen
)
...
@@ -429,7 +430,7 @@ function BDIO_parse!(fb::BDIOstream)
...
@@ -429,7 +430,7 @@ function BDIO_parse!(fb::BDIOstream)
i32
::
Int32
=
read
(
fb
.
io
,
Int32
)
i32
::
Int32
=
read
(
fb
.
io
,
Int32
)
rlen
=
Int64
(
i32
&
0b111111111111
)
rlen
=
Int64
(
i32
&
0b111111111111
)
rpos
=
position
(
fb
.
io
)
rpos
=
position
(
fb
.
io
)
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
0
,
hsh
)
new
=
Record
(
true
,
false
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
0
,
hsh
)
else
else
islong
=
(
mask
=
1
<<
3
;
ihdr
&
mask
==
mask
)
islong
=
(
mask
=
1
<<
3
;
ihdr
&
mask
==
mask
)
ifmt
::
Int32
=
(
ihdr
&
0b11110000
)
>>>
4
ifmt
::
Int32
=
(
ihdr
&
0b11110000
)
>>>
4
...
@@ -442,7 +443,7 @@ function BDIO_parse!(fb::BDIOstream)
...
@@ -442,7 +443,7 @@ function BDIO_parse!(fb::BDIOstream)
rpos
=
position
(
fb
.
io
)
rpos
=
position
(
fb
.
io
)
rlen
=
ihdr
>>>
12
rlen
=
ihdr
>>>
12
end
end
new
=
Record
(
false
,
islong
,
rlen
,
rpos
,
rpos
+
rlen
,
0
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
new
=
Record
(
false
,
islong
,
rlen
,
rpos
,
rpos
+
rlen
,
Int32
(
ifmt
),
Int8
(
iuinfo
),
hsh
)
end
end
push!
(
fb
.
records
,
new
)
push!
(
fb
.
records
,
new
)
...
@@ -493,7 +494,7 @@ function BDIO_write_header!(fb::BDIOstream)
...
@@ -493,7 +494,7 @@ function BDIO_write_header!(fb::BDIOstream)
flush
(
fb
.
io
)
flush
(
fb
.
io
)
hsh
=
Nettle
.
Hasher
(
"md5"
)
hsh
=
Nettle
.
Hasher
(
"md5"
)
new
=
Record
(
true
,
false
,
Int64
(
ill
),
ist
,
ind
,
0
,
0
,
0
,
hsh
)
new
=
Record
(
true
,
false
,
Int64
(
ill
),
ist
,
ind
,
0
,
0
,
hsh
)
push!
(
fb
.
records
,
new
)
push!
(
fb
.
records
,
new
)
fb
.
ipt
+=
1
fb
.
ipt
+=
1
...
...
src/BDIOtypes.jl
View file @
9df37cbb
...
@@ -6,7 +6,6 @@ mutable struct Record
...
@@ -6,7 +6,6 @@ mutable struct Record
rlen
::
Int64
rlen
::
Int64
rpos
::
Int64
rpos
::
Int64
rend
::
Int64
rend
::
Int64
rsav
::
Int64
rfmt
::
Int32
rfmt
::
Int32
ruinfo
::
Int8
ruinfo
::
Int8
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment