Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
d1c36492
Commit
d1c36492
authored
Oct 29, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b6246fd3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
wcfs/internal/wcfs_misc.cpp
wcfs/internal/wcfs_misc.cpp
+4
-0
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+1
-0
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+21
-1
No files found.
wcfs/internal/wcfs_misc.cpp
View file @
d1c36492
...
...
@@ -203,6 +203,10 @@ bool has_prefix(const string &s, const string &prefix) {
return
s
.
compare
(
0
,
prefix
.
size
(),
prefix
);
}
bool
has_prefix
(
const
string
&
s
,
char
prefix
)
{
return
(
s
.
size
()
>=
1
&&
s
[
0
]
==
prefix
);
}
vector
<
string
>
split
(
const
string
&
s
,
char
sep
)
{
vector
<
string
>
r
;
int
psep_prev
=-
1
;
...
...
wcfs/internal/wcfs_misc.h
View file @
d1c36492
...
...
@@ -144,6 +144,7 @@ error errorf (const char *format, ...)
namespace
strings
{
bool
has_prefix
(
const
string
&
s
,
const
string
&
prefix
);
bool
has_prefix
(
const
string
&
s
,
char
prefix
);
vector
<
string
>
split
(
const
string
&
s
,
char
sep
);
}
// strings::
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
d1c36492
...
...
@@ -700,7 +700,27 @@ static error _parsePinReq(PinReq *pin, const rxPkt *pkt) {
if
(
argv
.
size
()
!=
3
)
return
fmt
::
errorf
(
"expected 3 arguments, got %zd"
,
argv
.
size
());
// XXX
error
err
;
tie
(
pin
->
foid
,
err
)
=
_parseHex64
(
argv
[
0
]);
if
(
err
!=
nil
)
return
fmt
::
errorf
(
"invalid foid"
);
if
(
!
strings
::
has_prefix
(
argv
[
1
],
'#'
))
return
fmt
::
errorf
(
"invalid blk"
);
tie
(
pin
->
blk
,
err
)
=
_parseInt
(
argv
[
1
].
substr
(
1
));
if
(
err
!=
nil
)
return
fmt
::
errorf
(
"invalid blk"
);
if
(
!
strings
::
has_prefix
(
argv
[
2
],
'@'
))
return
fmt
::
errorf
(
"invalid at"
);
auto
at
=
argv
[
2
].
substr
(
1
);
if
(
at
==
"head"
)
{
pin
->
at
=
TidHead
;
}
else
{
tie
(
pin
->
at
,
err
)
=
_parseHex64
(
at
);
if
(
err
!=
nil
)
return
fmt
::
errorf
(
"invalid at"
);
}
return
nil
;
}
...
...
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