You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2015/07/07 21:22:13 UTC
[1/3] celix git commit: Reversed memstream/fmemopen source to orignal
source not explicitlty stating License
Repository: celix
Updated Branches:
refs/heads/feature/CELIX-237_rsa-ffi c97d16746 -> eb31d9d97
Reversed memstream/fmemopen source to orignal source not explicitlty stating License
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/0153dd2c
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/0153dd2c
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/0153dd2c
Branch: refs/heads/feature/CELIX-237_rsa-ffi
Commit: 0153dd2cd705d99f3a38e4bdf17dfb8e3fc4ea7c
Parents: c97d167
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jul 7 21:11:15 2015 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jul 7 21:11:15 2015 +0200
----------------------------------------------------------------------
.../memstream/README.md | 49 ++++++++++++++++++++
.../memstream/fmemopen.c | 4 +-
.../memstream/open_memstream.c | 8 +---
.../memstream/open_memstream.h | 4 --
4 files changed, 52 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/0153dd2c/remote_services/dynamic_function_interface/memstream/README.md
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/memstream/README.md b/remote_services/dynamic_function_interface/memstream/README.md
new file mode 100644
index 0000000..476810e
--- /dev/null
+++ b/remote_services/dynamic_function_interface/memstream/README.md
@@ -0,0 +1,49 @@
+fmemopen for Mac OS and iOS
+===========================
+
+Originally ported from [ingenuitas python-tesseract](https://github.com/ingenuitas/python-tesseract/blob/master/fmemopen.c). Ported by Jeff Verkoeyen under the Apache 2.0 License.
+
+From the fmemopen man page:
+
+> FILE *fmemopen(void *buf, size_t size, const char *mode);
+>
+> The fmemopen() function opens a stream that permits the access specified by mode. The stream
+> allows I/O to be performed on the string or memory buffer pointed to by buf. This buffer must be
+> at least size bytes long.
+
+Alas, this method does not exist on BSD operating systems (specifically Mac OS X and iOS). It is
+possible to recreate this functionality using a BSD-specific method called `funopen`.
+
+From the funopen man page:
+
+> FILE * funopen(const void *cookie, int (*readfn)(void *, char *, int),
+> int (*writefn)(void *, const char *, int), fpos_t (*seekfn)(void *, fpos_t, int),
+> int (*closefn)(void *));
+>
+> The funopen() function associates a stream with up to four ``I/O functions''. Either readfn or
+> writefn must be specified; the others can be given as an appropriately-typed NULL pointer. These
+> I/O functions will be used to read, write, seek and close the new stream.
+
+fmemopen.c provides a simple implementation of fmemopen using funopen so that you can create FILE
+pointers to blocks of memory.
+
+Adding it to your Project
+=========================
+
+Drag fmemopen.h and fmemopen.c to your project and add them to your target. `#include "fmemopen.h"`
+wherever you need to use `fmemopen`.
+
+Examples
+========
+
+```obj-c
+#import "fmemopen.h"
+
+NSString* string = @"fmemopen in Objective-C";
+const char* cstr = [string UTF8String];
+FILE* file = fmemopen((void *)cstr, sizeof(char) * (string.length + 1), "r");
+
+// fread on file will now read the contents of the NSString
+
+fclose(file);
+```
http://git-wip-us.apache.org/repos/asf/celix/blob/0153dd2c/remote_services/dynamic_function_interface/memstream/fmemopen.c
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/memstream/fmemopen.c b/remote_services/dynamic_function_interface/memstream/fmemopen.c
index 40c377d..926ce36 100644
--- a/remote_services/dynamic_function_interface/memstream/fmemopen.c
+++ b/remote_services/dynamic_function_interface/memstream/fmemopen.c
@@ -1,6 +1,4 @@
/*
- * Licensed under Apache License v2. See LICENSE for more information.
- *
* fmem.c : fmemopen() on top of BSD's funopen()
* 20081017 AF
*/
@@ -77,4 +75,4 @@ FILE *fmemopen(void *buf, size_t size, const char *mode)
mem->size = size, mem->buffer = buf;
return funopen(mem, readfn, writefn, seekfn, closefn);
}
-#endif
+#endif
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/celix/blob/0153dd2c/remote_services/dynamic_function_interface/memstream/open_memstream.c
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/memstream/open_memstream.c b/remote_services/dynamic_function_interface/memstream/open_memstream.c
index 20bb93f..6bc4f01 100644
--- a/remote_services/dynamic_function_interface/memstream/open_memstream.c
+++ b/remote_services/dynamic_function_interface/memstream/open_memstream.c
@@ -1,8 +1,4 @@
-/*
- * Licensed under Apache License v2. See LICENSE for more information.
- *
- * Use funopen(3) to provide open_memstream(3) like functionality.
- */
+/* Use funopen(3) to provide open_memstream(3) like functionality. */
#include <stdio.h>
#include <stdlib.h>
@@ -131,4 +127,4 @@ open_memstream(char **cp, size_t *lenp)
errno = save_errno;
}
return (fp);
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/celix/blob/0153dd2c/remote_services/dynamic_function_interface/memstream/open_memstream.h
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/memstream/open_memstream.h b/remote_services/dynamic_function_interface/memstream/open_memstream.h
index 2a38e12..e87bb0a 100644
--- a/remote_services/dynamic_function_interface/memstream/open_memstream.h
+++ b/remote_services/dynamic_function_interface/memstream/open_memstream.h
@@ -1,7 +1,3 @@
-/*
- * Licensed under Apache License v2. See LICENSE for more information.
- *
- */
#ifndef OPEN_MEMSTREAM_H_
#define OPEN_MEMSTREAM_H_
[2/3] celix git commit: CELIX-237: updated CI config and remove printf
Posted by pn...@apache.org.
CELIX-237: updated CI config and remove printf
- Updated travis, moved from test -> coverage. Test seem to use cmake test framework which does not work incombination with cpputest and verbose output
- Removed printf from dyn_type.c
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/ed3fbb4c
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/ed3fbb4c
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/ed3fbb4c
Branch: refs/heads/feature/CELIX-237_rsa-ffi
Commit: ed3fbb4c7de1d031b337a1ef2e38b495b0f23a81
Parents: 0153dd2
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jul 7 21:19:24 2015 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jul 7 21:25:41 2015 +0200
----------------------------------------------------------------------
.travis.yml | 2 +-
remote_services/dynamic_function_interface/dyn_type.c | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/ed3fbb4c/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 2c8d7cd..0fea634 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,4 +25,4 @@ before_script:
- cmake -DCMAKE_SKIP_BUILD_RPATH=FALSE -DBUILD_DEPLOYMENT_ADMIN=ON -DBUILD_EXAMPLES=ON -DBUILD_LOG_SERVICE=ON -DBUILD_LOG_WRITER=ON -DBUILD_REMOTE_SERVICE_ADMIN=ON -DBUILD_RSA_DISCOVERY_CONFIGURED=ON -DBUILD_RSA_DISCOVERY_ETCD=ON -DBUILD_RSA_DISCOVERY_SHM=ON -DBUILD_RSA_EXAMPLES=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_SHM=ON -DBUILD_RSA_REMOTE_SERVICE_ADMIN_HTTP=ON -DBUILD_REMOTE_SHELL=ON -DBUILD_SHELL=ON -DBUILD_SHELL_TUI=ON -DCMAKE_INSTALL_PREFIX=../install ..
script:
- - make all && make deploy && make test && make install-all
+ - make all && make deploy && make coverage
http://git-wip-us.apache.org/repos/asf/celix/blob/ed3fbb4c/remote_services/dynamic_function_interface/dyn_type.c
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/dyn_type.c b/remote_services/dynamic_function_interface/dyn_type.c
index 6df517b..0c85f43 100644
--- a/remote_services/dynamic_function_interface/dyn_type.c
+++ b/remote_services/dynamic_function_interface/dyn_type.c
@@ -459,7 +459,6 @@ int dynType_alloc(dyn_type *type, void **bufLoc) {
int dynType_complex_indexForName(dyn_type *type, const char *name) {
- printf("descriptor is %c\n", type->descriptor);
assert(type->type == DYN_TYPE_COMPLEX);
int i = 0;
int index = -1;
[3/3] celix git commit: CELIX-237: commented out some printf
statements
Posted by pn...@apache.org.
CELIX-237: commented out some printf statements
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/eb31d9d9
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/eb31d9d9
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/eb31d9d9
Branch: refs/heads/feature/CELIX-237_rsa-ffi
Commit: eb31d9d97b455094babd7027e1d1fc4f27c060c7
Parents: ed3fbb4
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Jul 7 21:27:31 2015 +0200
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Jul 7 21:27:31 2015 +0200
----------------------------------------------------------------------
.../dynamic_function_interface/tst/dyn_type_tests.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/eb31d9d9/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp b/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp
index 7ea9ea7..706e9af 100644
--- a/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp
+++ b/remote_services/dynamic_function_interface/tst/dyn_type_tests.cpp
@@ -23,14 +23,14 @@ extern "C" {
dyn_type *type;
int i;
type = NULL;
- printf("\n-- example %s with descriptor string '%s' --\n", exName, descriptorStr);
+ //printf("\n-- example %s with descriptor string '%s' --\n", exName, descriptorStr);
int status = dynType_create(descriptorStr, &type);
CHECK_EQUAL(0, status);
if (status == 0) {
- dynType_print(type);
+ //dynType_print(type);
dynType_destroy(type);
}
- printf("--\n\n");
+ //printf("--\n\n");
}
}