Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
96df1d43
Commit
96df1d43
authored
5 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
c wrapper: update callback return types
parent
432f3874
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
c/opendht_c.h
+2
-2
2 additions, 2 deletions
c/opendht_c.h
tools/dhtcnode.c
+4
-2
4 additions, 2 deletions
tools/dhtcnode.c
with
6 additions
and
4 deletions
c/opendht_c.h
+
2
−
2
View file @
96df1d43
...
...
@@ -88,8 +88,8 @@ OPENDHT_C_PUBLIC void dht_identity_delete(dht_identity*);
// callbacks
typedef
bool
(
*
dht_get_cb
)(
const
dht_value
*
value
,
void
*
user_data
);
typedef
bool
(
*
dht_value_cb
)(
const
dht_value
*
value
,
bool
expired
,
void
*
user_data
);
typedef
bool
(
*
dht_done_cb
)(
bool
ok
,
void
*
user_data
);
typedef
bool
(
*
dht_shutdown_cb
)(
void
*
user_data
);
typedef
void
(
*
dht_done_cb
)(
bool
ok
,
void
*
user_data
);
typedef
void
(
*
dht_shutdown_cb
)(
void
*
user_data
);
struct
OPENDHT_C_PUBLIC
dht_op_token
;
typedef
struct
dht_op_token
dht_op_token
;
...
...
This diff is collapsed.
Click to expand it.
tools/dhtcnode.c
+
4
−
2
View file @
96df1d43
...
...
@@ -15,6 +15,7 @@ bool dht_value_callback(const dht_value* value, bool expired, void* user_data)
{
dht_data_view
data
=
dht_value_get_data
(
value
);
printf
(
"Value callback %s: %.*s.
\n
"
,
expired
?
"expired"
:
"new"
,
(
int
)
data
.
size
,
data
.
data
);
return
true
;
}
bool
dht_get_callback
(
const
dht_value
*
value
,
void
*
user_data
)
...
...
@@ -22,15 +23,16 @@ bool dht_get_callback(const dht_value* value, void* user_data)
dht_runner
*
runner
=
(
dht_runner
*
)
user_data
;
dht_data_view
data
=
dht_value_get_data
(
value
);
printf
(
"Get callback: %.*s.
\n
"
,
(
int
)
data
.
size
,
data
.
data
);
return
true
;
}
bool
dht_done_callback
(
bool
ok
,
void
*
user_data
)
void
dht_done_callback
(
bool
ok
,
void
*
user_data
)
{
dht_runner
*
runner
=
(
dht_runner
*
)
user_data
;
printf
(
"Done callback. %s
\n
"
,
ok
?
"Success !"
:
"Failure :-("
);
}
bool
op_context_free
(
void
*
user_data
)
void
op_context_free
(
void
*
user_data
)
{
struct
op_context
*
ctx
=
(
struct
op_context
*
)
user_data
;
printf
(
"op_context_free %d.
\n
"
,
ctx
->
d
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment