diff options
author | Anonymized <anonymous@example.com> | 2018-01-09 00:07:45 +0100 |
---|---|---|
committer | Anonymized <anonymous@example.com> | 2018-01-09 00:07:45 +0100 |
commit | 8e3019f5365aa6e2c2162bb4323331c61a3b4f54 (patch) | |
tree | 1c798c403aa8daf126d6d477f4db8fc7dff6c774 | |
parent | 5ab67f02089e3a785f060e2e866068dd6c470d0f (diff) | |
download | gnunet-guile2-8e3019f5365aa6e2c2162bb4323331c61a3b4f54.tar.gz gnunet-guile2-8e3019f5365aa6e2c2162bb4323331c61a3b4f54.zip |
remove example.{c, scm} because those were temporary
I commited that file only to make it easy for guile-bytestructures'
maintainer to reproduce the issue. With guile-bytestructures 1.0.1 the
problem is gone, see
https://github.com/TaylanUB/scheme-bytestructures/commit/38a7861dfc305fc621f344e6f16757736e21a6b6
I could rewrite git history, but I don't want to `git push -f`.
download.scm works as expected, in the sens that it outputs correct
progress status values.
A patch for guix was sent to update guile-bytestructures. It's a
dependency a guix itself. So it might take some time. Otherwise said,
you need a guix with that patch to make gnunet-guile work. See
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30034
If the patch goes to core-updates, I will try to fix guix.scm of
gnunet-guile to include guile-bytestructures 1.0.1.
-rw-r--r-- | example.c | 13 | ||||
-rw-r--r-- | example.scm | 27 |
2 files changed, 0 insertions, 40 deletions
diff --git a/example.c b/example.c deleted file mode 100644 index ddff0e3..0000000 --- a/example.c +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | #include "platform.h" | ||
2 | #include "gnunet_fs_service.h" | ||
3 | |||
4 | |||
5 | struct GNUNET_FS_ProgressInfo * test() { | ||
6 | struct GNUNET_FS_ProgressInfo * info = malloc(sizeof(struct GNUNET_FS_ProgressInfo)); | ||
7 | info->status = 42; | ||
8 | return info; | ||
9 | } | ||
10 | |||
11 | |||
12 | // compile with | ||
13 | // c99 -I/gnu/store/nfaljkxhj0hgxkzxbd4pgmm70h9niq7q-gnunet-git-0.10.1-2.477e0de/include/gnunet/ -c example.c -o libexample.o && gcc -shared libexample.o -o libexample.so | ||
diff --git a/example.scm b/example.scm deleted file mode 100644 index 06da020..0000000 --- a/example.scm +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | (use-modules ((bytestructures guile))) | ||
2 | (use-modules ((gnunet config))) | ||
3 | (use-modules ((gnunet))) | ||
4 | (use-modules ((system foreign) #:prefix ffi:)) | ||
5 | |||
6 | (define* (dynamic-link* #:optional library-name) | ||
7 | (let ((shared-object (if library-name (dynamic-link library-name) (dynamic-link)))) | ||
8 | (lambda (return-value function-name . arguments) | ||
9 | (let ((function (dynamic-func function-name shared-object))) | ||
10 | (ffi:pointer->procedure return-value function arguments))))) | ||
11 | |||
12 | ;; bytestructures helper | ||
13 | |||
14 | (define (pointer->bytestructure desc pointer) | ||
15 | (let ((size (bytestructure-descriptor-size desc))) | ||
16 | (let ((bv (ffi:pointer->bytevector pointer size))) | ||
17 | (make-bytestructure bv 0 desc)))) | ||
18 | |||
19 | ;;; gnunet-util bindings, gnunet_util_lib.h | ||
20 | |||
21 | (define fs (dynamic-link* %libgnunet-fs)) | ||
22 | (define libexample (dynamic-link* "./libexample.so")) | ||
23 | |||
24 | (define test (libexample '* "test")) | ||
25 | |||
26 | (define info (pointer->bytestructure %fs-progress-info (test))) | ||
27 | (pk (fs-progress-info-status info)) | ||