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
3923ce63
Commit
3923ce63
authored
Oct 21, 2019
by
Alberto Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing private functions
parent
0a420bb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
src/BDIOmethods.jl
src/BDIOmethods.jl
+88
-0
No files found.
src/BDIOmethods.jl
View file @
3923ce63
...
@@ -423,3 +423,91 @@ function BDIO_parse!(fb::BDIOstream)
...
@@ -423,3 +423,91 @@ function BDIO_parse!(fb::BDIOstream)
end
end
function
BDIO_write_header
!
(
fb
::
BDIOstream
)
if
(
fb
.
imode
==
BDIO_R_MODE
)
error
(
"Attemp to write in READ mode"
)
end
ihdr
::
Int32
=
BDIO_MAGIC
write
(
fb
.
io
,
ihdr
)
mark
(
fb
.
io
)
ill
::
Int16
=
0
write
(
fb
.
io
,
ill
)
iv
::
Int16
=
1
write
(
fb
.
io
,
iv
)
ist
::
Int64
=
position
(
fb
.
io
)
i4
::
Int32
=
0
write
(
fb
.
io
,
i4
)
hcr
::
Int64
=
position
(
fb
.
io
)
write
(
fb
.
io
,
fb
.
created
)
fb
.
rdate
=
position
(
fb
.
io
)
write
(
fb
.
io
,
fb
.
modified
)
write
(
fb
.
io
,
user
*
"
\0
"
)
hlu
::
Int64
=
position
(
fb
.
io
)
write
(
fb
.
io
,
user
*
"
\0
"
)
write
(
fb
.
io
,
host
*
"
\0
"
)
hlh
::
Int64
=
position
(
fb
.
io
)
write
(
fb
.
io
,
host
*
"
\0
"
)
write
(
fb
.
io
,
fb
.
info
*
"
\0
"
)
ind
::
Int64
=
position
(
fb
.
io
)
ill
=
Int16
(
ind
-
ist
)
reset
(
fb
.
io
)
write
(
fb
.
io
,
ill
)
flush
(
fb
.
io
)
hsh
=
Nettle
.
Hasher
(
"md5"
)
new
=
Record
(
true
,
false
,
Int64
(
ill
),
ist
,
ind
,
0
,
0
,
hsh
)
push!
(
fb
.
records
,
new
)
fb
.
ipt
+=
1
return
true
end
function
BDIOstream
(
fname
::
String
,
mode
::
String
,
protocol_info
::
String
=
"
\0
"
)
md
::
Int32
=
0
if
(
mode
==
"w"
)
if
(
isfile
(
fname
))
error
(
"File "
*
strip
(
fname
)
*
" already exists"
)
end
io
=
open
(
fname
,
"w+"
)
md
=
BDIO_W_MODE
elseif
(
mode
==
"r"
)
io
=
open
(
fname
,
"r"
)
md
=
BDIO_R_MODE
elseif
(
mode
==
"a"
)
io
=
open
(
fname
,
"a+"
)
md
=
BDIO_A_MODE
elseif
(
mode
==
"d"
)
rm
(
fnme
,
force
=
true
)
io
=
open
(
fname
,
"w+"
)
md
=
BDIO_D_MODE
else
error
(
"Incorrect mode"
)
end
rcs
=
similar
(
Array
{
Record
,
1
},
0
)
lend
::
Bool
=
true
if
(
Base
.
ENDIAN_BOM
==
0x04030201
)
lend
=
true
elseif
(
Base
.
ENDIAN_BOM
==
0x01020304
)
lend
=
false
else
error
(
"Wrong endianness"
)
end
if
(
!
lend
)
error
(
"Current version only support Little Endian Machines"
)
end
return
BDIOstream
(
io
,
1
,
md
,
0
,
0
,
lend
,
user
,
host
,
floor
(
Int32
,
time
()),
floor
(
Int32
,
time
()),
protocol_info
,
0
,
rcs
)
end
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