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 2017/11/14 12:18:35 UTC
celix git commit: CELIX-416: Fixes a building issues with Android for
libcelix_dfi
Repository: celix
Updated Branches:
refs/heads/develop 988ecf417 -> 4da794712
CELIX-416: Fixes a building issues with Android for libcelix_dfi
Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/4da79471
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/4da79471
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/4da79471
Branch: refs/heads/develop
Commit: 4da794712c630cac04856dbb333b2e0d95dc29ed
Parents: 988ecf4
Author: Pepijn Noltes <pe...@gmail.com>
Authored: Tue Nov 14 13:07:31 2017 +0100
Committer: Pepijn Noltes <pe...@gmail.com>
Committed: Tue Nov 14 13:07:31 2017 +0100
----------------------------------------------------------------------
dfi/public/include/dyn_type.h | 2 +-
shell/private/src/lb_command.c | 21 ++++++++++++++-------
utils/private/src/memstream/fmemopen.c | 2 --
3 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/celix/blob/4da79471/dfi/public/include/dyn_type.h
----------------------------------------------------------------------
diff --git a/dfi/public/include/dyn_type.h b/dfi/public/include/dyn_type.h
index f80175f..554966a 100644
--- a/dfi/public/include/dyn_type.h
+++ b/dfi/public/include/dyn_type.h
@@ -28,7 +28,7 @@
#include "dfi_log_util.h"
-#if defined(BSD) || defined(__APPLE__)
+#if defined(BSD) || defined(__APPLE__) || defined(__ANDROID__)
#include "memstream/open_memstream.h"
#include "memstream/fmemopen.h"
#endif
http://git-wip-us.apache.org/repos/asf/celix/blob/4da79471/shell/private/src/lb_command.c
----------------------------------------------------------------------
diff --git a/shell/private/src/lb_command.c b/shell/private/src/lb_command.c
index 5a97bf8..d0504f6 100644
--- a/shell/private/src/lb_command.c
+++ b/shell/private/src/lb_command.c
@@ -31,6 +31,7 @@
#include "std_commands.h"
#include "shell_constants.h"
+static const char * const HEAD_COLOR = "\033[4m"; //underline
static const char * const EVEN_COLOR = "\033[1m"; //bold
static const char * const ODD_COLOR = "\033[3m"; //italic
static const char * const END_COLOR = "\033[0m";
@@ -81,7 +82,13 @@ celix_status_t psCommand_execute(void *_ptr, char *command_line_str, FILE *out_p
sub_str = strtok_r(NULL, OSGI_SHELL_COMMAND_SEPARATOR, &save_ptr);
}
- fprintf(out_ptr, " %-5s %-12s %s\n", "ID", "State", message_str);
+ const char* startColor = "";
+ const char* endColor = "";
+ if (useColors) {
+ startColor = HEAD_COLOR;
+ endColor = END_COLOR;
+ }
+ fprintf(out_ptr, "%s %-5s %-12s %s%s\n", startColor, "ID", "State", message_str, endColor);
unsigned int size = arrayList_size(bundles_ptr);
@@ -158,13 +165,13 @@ celix_status_t psCommand_execute(void *_ptr, char *command_line_str, FILE *out_p
}
if (sub_status == CELIX_SUCCESS) {
+ startColor = "";
+ endColor = "";
if (useColors) {
- const char* start = i % 2 == 0 ? EVEN_COLOR : ODD_COLOR;
- const char* end = END_COLOR;
- fprintf(out_ptr, "%s %-5ld %-12s %s%s\n", start, id, state_str, name_str, end);
- } else { //no colors
- fprintf(out_ptr, " %-5ld %-12s %s\n", id, state_str, name_str);
- }
+ startColor = i % 2 == 0 ? EVEN_COLOR : ODD_COLOR;
+ endColor = END_COLOR;
+ }
+ fprintf(out_ptr, "%s %-5ld %-12s %s%s\n", startColor, id, state_str, name_str, endColor);
}
http://git-wip-us.apache.org/repos/asf/celix/blob/4da79471/utils/private/src/memstream/fmemopen.c
----------------------------------------------------------------------
diff --git a/utils/private/src/memstream/fmemopen.c b/utils/private/src/memstream/fmemopen.c
index 66fc9c5..cb1b0c0 100644
--- a/utils/private/src/memstream/fmemopen.c
+++ b/utils/private/src/memstream/fmemopen.c
@@ -8,7 +8,6 @@
#include <stdlib.h>
#include <string.h>
-#ifndef linux
struct fmem {
size_t pos;
size_t size;
@@ -75,4 +74,3 @@ FILE *fmemopen(void *buf, size_t size, const char *mode)
mem->size = size, mem->buffer = buf;
return funopen(mem, readfn, writefn, seekfn, closefn);
}
-#endif