Git Product home page Git Product logo

rstox's People

Contributors

jfreegman avatar kpp avatar quininer avatar suhr avatar zetok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rstox's Issues

all get_<string> functions are broken

e.g.

let mut name: Vec<u8> = Vec::with_capacity(size);

tox_try!(err, ll::tox_conference_peer_get_name(
    self.raw,
    conference_number,
    peer_number,
    name.as_mut_ptr(),
    err.as_mut_ptr()
));
Ok(String::from_utf8_unchecked(name))

The resulting string is always empty. I've confirmed that the toxcore functions succeed, but for whatever reason the result never gets copied to the vector.

My proposed fix would be to change all such instances to:

let mut name = MaybeUninit::<[u8; MAX_NAME_LENGTH]>::uninit();

tox_try!(err, ll::tox_conference_peer_get_name(
    self.raw,
    conference_number,
    peer_number,
    name.as_mut_ptr() as *mut u8,
    err.as_mut_ptr()
));

Ok(String::from_utf8_lossy(&mut name.assume_init()[..size].to_string()))

However, this looks ugly to me. I'm not sure if it's safe or the proper solution.

Profile loading broken with new DHT branch

When using the irungentoo/new branch, profile saving/loading doesn't work. When printing out Tox_Options values at the start of tox_new() I get some strange output. Data length is always zero, the data pointer is always non-null, and the data type is some very large number like 751087616. Everything looks normal before going through rstox. I don't have the time to investigate this further at the moment.

Panic in tox_new()

thread 'main' panicked at 'attempted to leave type core::errors::InitError uninitialized, which is invalid', /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libcore/mem/mod.rs:664:9

Unable to use this on Mac OSX

I create a new cargo project
cargo new project --bin
Then I add the line to my Cargo.toml
[dependencies.rstox] git = "https://github.com/suhr/rstox.git"

I also confirmed that libtoxcore and libtoxav are in my /user/local/lib

Get the following error when trying to build

error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "/Users/cvu/Github/demo/RustChat/target/debug/RustChat.0.o" "-o" "/Users/cvu/Github/demo/RustChat/target/debug/RustChat" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/cvu/Github/demo/RustChat/target/debug" "-L" "/Users/cvu/Github/demo/RustChat/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-L" "/Users/cvu/Github/demo/RustChat/.rust/lib/x86_64-apple-darwin" "-L" "/Users/cvu/Github/demo/RustChat/lib/x86_64-apple-darwin" "/Users/cvu/Github/demo/RustChat/target/debug/deps/librstox-ab1806e399b3d68b.rlib" "/Users/cvu/Github/demo/RustChat/target/debug/deps/liblibc-f654c8036439f8ef.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-71b07a99.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcollections-71b07a99.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-71b07a99.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librand-71b07a99.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc-71b07a99.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-71b07a99.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-71b07a99.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcore-71b07a99.rlib" "-l" "toxcore" "-l" "toxav" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
note: ld: warning: directory not found for option '-L/Users/cvu/Github/demo/RustChat/.rust/lib/x86_64-apple-darwin'
ld: warning: directory not found for option '-L/Users/cvu/Github/demo/RustChat/lib/x86_64-apple-darwin'
ld: library not found for -ltoxcore
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.