Skip to content

Commit

Permalink
[eclipse-iceoryx#210] Let discovery C example print services
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jun 1, 2024
1 parent 442a5e9 commit 4452dd3
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions iceoryx2-lang/c/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
use iceoryx2::prelude::*;

#[no_mangle]
pub extern "C" fn zero_copy_service_list() {
println!("hello world");
pub extern "C" fn zero_copy_service_list() -> i32 {
let services = zero_copy::Service::list();

if services.is_err() {
return -1;
}

let services = services.unwrap();

for service in services {
println!("\n{:#?}", &service);
}

return 0;
}

0 comments on commit 4452dd3

Please sign in to comment.