Skip to content

Instantly share code, notes, and snippets.

View sonOfRa's full-sized avatar

Simon Levermann sonOfRa

View GitHub Profile
@sonOfRa
sonOfRa / gist:6178469
Last active December 20, 2015 18:49
Tox Config dir Gist
/* xdg.c
*
* Miscellaneous functions and data structures for doing random things.
*
* Copyright (C) 2013 Tox project All Rights Reserved.
*
* This file is part of Tox.
*
* Tox is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libsodium.a(libsodium_la-randombytes_sysrandom.o): warning: relocation against `randombytes_sysrandom_buf' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../lib64/libsodium.a(libsodium_la-randombytes_sysrandom.o): relocation R_X86_64_PC32 against symbol `randombytes_sysrandom_stir' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [core/libtoxcore.so] Error 1
make[1]: *** [core/CMakeFiles/toxcore.dir/all] Error 2
make: *** [all] Error 2
@sonOfRa
sonOfRa / data
Last active December 21, 2015 09:29
Suggestion for Tox Data file format.
{
"key" : "plain:BASE64key|enc:BASE64encryptedkey",
"dht" : {
"autoconnect" : true,
"server" : "1.1.1.1|toxdht.example.com",
"port" : 33445
},
"name" : "foo",
"friends" : [{
@sonOfRa
sonOfRa / jtox.c
Created August 28, 2013 23:49
Bugged jni wrapper
/* im_tox_jtoxcore_JTox.c
*
* Copyright (C) 2013 Tox project All Rights Reserved.
*
* This file is part of jToxcore
*
* jToxcore is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
typedef union {
uint8_t c[4];
uint16_t s[2];
uint32_t i;
} tox_IP;
typedef struct {
tox_IP ip;
uint16_t port;
/* not used for anything right now */
typedef struct {
JNIEnv *env;
jobject jobj;
} tox_jni_callback;
static void friendrequest_callback(Tox *tox, uint8_t *publickey,
uint8_t *message, uint16_t *length, tox_jni_callback *data) {
printf("%s", "meh\n");
fflush(stdout);
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fd4b563d53d, pid=19678, tid=140551870703360
#
# JRE version: 7.0_25-b15
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libjtox.so+0x153d] friendrequest_callback+0x53
#
/*
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
/* im_tox_jtoxcore_JTox.c
*
* Copyright (C) 2013 Tox project All Rights Reserved.
*
* This file is part of jToxcore
*
* jToxcore is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* JTox.h
#ifndef JTOX_H_
#define JTOX_H_
typedef struct {
JNIEnv *env;
jobject jobj;
} tox_jni_callback;