mirror of
https://github.com/PacktPublishing/Practical-System-Programming-for-Rust-Developers.git
synced 2024-11-12 13:10:45 +00:00
code for chapter12 pd added
This commit is contained in:
parent
c12faec2b5
commit
62e9b4b475
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
{"config":{"output_file":null,"full_docs":false,"pub_only":false,"reachable_only":false,"distro_crate":false,"signatures":false,"borrow_data":false},"version":"0.19.0","compilation":{"directory":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp","program":"/Users/prabhueshwarla/.rustup/toolchains/stable-x86_64-apple-darwin/bin/rls","arguments":[],"output":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/target/rls/debug/deps/libtcpudp-97cca98b69045fb9.rmeta"},"prelude":{"crate_id":{"name":"tcpudp","disambiguator":[14252695875775721232,9879066391318841997]},"crate_root":"src","external_crates":[{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":1,"id":{"name":"std","disambiguator":[9054049529852543209,5756799355281213394]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":2,"id":{"name":"core","disambiguator":[649336883146201894,3308516238322163950]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":3,"id":{"name":"compiler_builtins","disambiguator":[1154582834482060450,16344204990542480537]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":4,"id":{"name":"rustc_std_workspace_core","disambiguator":[9212379515936652129,17808485286264063370]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":5,"id":{"name":"alloc","disambiguator":[13327579764654116281,14306064291630426625]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":6,"id":{"name":"libc","disambiguator":[17773251733480933597,18239998491734583498]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":7,"id":{"name":"unwind","disambiguator":[8567743581675804787,15655200220621371766]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":8,"id":{"name":"cfg_if","disambiguator":[15115520782807859583,9813785573872252500]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":9,"id":{"name":"backtrace","disambiguator":[1572943810868196833,3902827232285166711]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":10,"id":{"name":"rustc_demangle","disambiguator":[6290371580101917419,15395902185345451181]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":11,"id":{"name":"backtrace_sys","disambiguator":[2934540361684350378,924291485644145262]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":12,"id":{"name":"hashbrown","disambiguator":[9277678418438935259,15657907931940784437]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":13,"id":{"name":"rustc_std_workspace_alloc","disambiguator":[5423566938548125357,18340948646597872466]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpudp/src/main.rs","num":14,"id":{"name":"panic_unwind","disambiguator":[489208416821938960,3305070343783546974]}}],"span":{"file_name":"src/main.rs","byte_start":2,"byte_end":16,"line_start":3,"line_end":5,"column_start":1,"column_end":2}},"imports":[],"defs":[{"kind":"Mod","id":{"krate":0,"index":0},"span":{"file_name":"src/main.rs","byte_start":2,"byte_end":16,"line_start":3,"line_end":5,"column_start":1,"column_end":2},"name":"","qualname":"::","value":"src/main.rs","parent":null,"children":[{"krate":0,"index":1},{"krate":0,"index":2},{"krate":0,"index":3}],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Function","id":{"krate":0,"index":3},"span":{"file_name":"src/main.rs","byte_start":5,"byte_end":9,"line_start":3,"line_end":3,"column_start":4,"column_end":8},"name":"main","qualname":"::main","value":"fn () -> ()","parent":null,"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[]}],"impls":[],"refs":[],"macro_refs":[],"relations":[]}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
chapter12/ffi/Cargo.lock
generated
Normal file
5
chapter12/ffi/Cargo.lock
generated
Normal file
@ -0,0 +1,5 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "ffi"
|
||||
version = "0.1.0"
|
12
chapter12/ffi/Cargo.toml
Normal file
12
chapter12/ffi/Cargo.toml
Normal file
@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "ffi"
|
||||
version = "0.1.0"
|
||||
authors = ["peshwar9"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
[lib]
|
||||
name = "ffitest"
|
||||
crate-type = ["dylib"]
|
||||
|
||||
[dependencies]
|
5
chapter12/ffi/rustffi.c
Normal file
5
chapter12/ffi/rustffi.c
Normal file
@ -0,0 +1,5 @@
|
||||
#include "rustffi.h"
|
||||
int main(void)
|
||||
{
|
||||
see_ffi_in_action();
|
||||
}
|
1
chapter12/ffi/rustffi.h
Normal file
1
chapter12/ffi/rustffi.h
Normal file
@ -0,0 +1 @@
|
||||
void see_ffi_in_action();
|
4
chapter12/ffi/src/lib.rs
Normal file
4
chapter12/ffi/src/lib.rs
Normal file
@ -0,0 +1,4 @@
|
||||
#[no_mangle]
|
||||
pub extern "C" fn see_ffi_in_action() {
|
||||
println!("Congrats! You have successfully invoked Rust shared library from a C program");
|
||||
}
|
1
chapter12/ffi/target/rls/.rustc_info.json
Normal file
1
chapter12/ffi/target/rls/.rustc_info.json
Normal file
@ -0,0 +1 @@
|
||||
{"rustc_fingerprint":4503571881771466578,"outputs":{"1164083562126845933":["rustc 1.43.0 (4fb7144ed 2020-04-20)\nbinary: rustc\ncommit-hash: 4fb7144ed159f94491249e86d5bbd033b5d60550\ncommit-date: 2020-04-20\nhost: x86_64-apple-darwin\nrelease: 1.43.0\nLLVM version: 9.0\n",""],"4476964694761187371":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/prabhueshwarla/.rustup/toolchains/stable-x86_64-apple-darwin\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"ssse3\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n",""]},"successes":{}}
|
0
chapter12/ffi/target/rls/debug/.cargo-lock
Normal file
0
chapter12/ffi/target/rls/debug/.cargo-lock
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
||||
eed6e970737b65ea
|
@ -0,0 +1 @@
|
||||
{"rustc":12217307662193597186,"features":"[]","target":229042405531770237,"profile":1647870076477133176,"path":10872709659218687626,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ffi-19d6d678a2f77aa3/dep-test-lib-ffitest-19d6d678a2f77aa3"}}],"rustflags":[],"metadata":13779719443416291531}
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
@ -0,0 +1 @@
|
||||
6a5b87701bbe103b
|
@ -0,0 +1 @@
|
||||
{"rustc":12217307662193597186,"features":"[]","target":229042405531770237,"profile":14891217944882224483,"path":10872709659218687626,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/ffi-273a3790abc26d1b/dep-lib-ffitest-273a3790abc26d1b"}}],"rustflags":[],"metadata":13779719443416291531}
|
@ -0,0 +1,5 @@
|
||||
/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/target/rls/debug/deps/ffitest-19d6d678a2f77aa3.rmeta: src/lib.rs
|
||||
|
||||
/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/target/rls/debug/deps/ffitest-19d6d678a2f77aa3.d: src/lib.rs
|
||||
|
||||
src/lib.rs:
|
@ -0,0 +1,5 @@
|
||||
/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/target/rls/debug/deps/ffitest-273a3790abc26d1b.rmeta: src/lib.rs
|
||||
|
||||
/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/target/rls/debug/deps/ffitest-273a3790abc26d1b.d: src/lib.rs
|
||||
|
||||
src/lib.rs:
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
{"config":{"output_file":null,"full_docs":false,"pub_only":false,"reachable_only":false,"distro_crate":false,"signatures":false,"borrow_data":false},"version":"0.19.0","compilation":{"directory":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi","program":"/Users/prabhueshwarla/.rustup/toolchains/stable-x86_64-apple-darwin/bin/rls","arguments":[],"output":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/target/rls/debug/deps/libffitest-273a3790abc26d1b.rmeta"},"prelude":{"crate_id":{"name":"ffitest","disambiguator":[6784396376749770646,6914394608390877879]},"crate_root":"src","external_crates":[{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":1,"id":{"name":"std","disambiguator":[9054049529852543209,5756799355281213394]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":2,"id":{"name":"core","disambiguator":[649336883146201894,3308516238322163950]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":3,"id":{"name":"compiler_builtins","disambiguator":[1154582834482060450,16344204990542480537]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":4,"id":{"name":"rustc_std_workspace_core","disambiguator":[9212379515936652129,17808485286264063370]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":5,"id":{"name":"alloc","disambiguator":[13327579764654116281,14306064291630426625]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":6,"id":{"name":"libc","disambiguator":[17773251733480933597,18239998491734583498]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":7,"id":{"name":"unwind","disambiguator":[8567743581675804787,15655200220621371766]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":8,"id":{"name":"cfg_if","disambiguator":[15115520782807859583,9813785573872252500]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":9,"id":{"name":"backtrace","disambiguator":[1572943810868196833,3902827232285166711]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":10,"id":{"name":"rustc_demangle","disambiguator":[6290371580101917419,15395902185345451181]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":11,"id":{"name":"backtrace_sys","disambiguator":[2934540361684350378,924291485644145262]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":12,"id":{"name":"hashbrown","disambiguator":[9277678418438935259,15657907931940784437]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":13,"id":{"name":"rustc_std_workspace_alloc","disambiguator":[5423566938548125357,18340948646597872466]}},{"file_name":"/Users/prabhueshwarla/rust/author/packt/prod/chapter12/ffi/src/lib.rs","num":14,"id":{"name":"panic_unwind","disambiguator":[489208416821938960,3305070343783546974]}}],"span":{"file_name":"src/lib.rs","byte_start":0,"byte_end":148,"line_start":1,"line_end":4,"column_start":1,"column_end":2}},"imports":[],"defs":[{"kind":"Mod","id":{"krate":0,"index":0},"span":{"file_name":"src/lib.rs","byte_start":0,"byte_end":148,"line_start":1,"line_end":4,"column_start":1,"column_end":2},"name":"","qualname":"::","value":"src/lib.rs","parent":null,"children":[{"krate":0,"index":1},{"krate":0,"index":2},{"krate":0,"index":3}],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Function","id":{"krate":0,"index":3},"span":{"file_name":"src/lib.rs","byte_start":31,"byte_end":48,"line_start":2,"line_end":2,"column_start":19,"column_end":36},"name":"see_ffi_in_action","qualname":"::see_ffi_in_action","value":"fn () -> ()","parent":null,"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[{"value":"no_mangle","span":{"file_name":"src/lib.rs","byte_start":0,"byte_end":12,"line_start":1,"line_end":1,"column_start":1,"column_end":13}}]}],"impls":[],"refs":[],"macro_refs":[],"relations":[]}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user