Refactoring ASCCI-Art image printing

pull/1/head
Andreas Eversberg 1 year ago
parent 6fa74a1296
commit 922b4af362
  1. 1
      .gitignore
  2. 1
      configure.ac
  3. 3
      src/Makefile.am
  4. 1
      src/amps/Makefile.am
  5. 65
      src/amps/image.c
  6. 1
      src/anetz/Makefile.am
  7. 63
      src/anetz/image.c
  8. 1
      src/bnetz/Makefile.am
  9. 57
      src/bnetz/image.c
  10. 1
      src/cnetz/Makefile.am
  11. 95
      src/cnetz/image.c
  12. 1
      src/eurosignal/Makefile.am
  13. 70
      src/eurosignal/image.c
  14. 2
      src/fuvst/Makefile.am
  15. 82
      src/fuvst/image.c
  16. 2
      src/fuvst/sniffer.c
  17. 1
      src/imts/Makefile.am
  18. 70
      src/imts/image.c
  19. 1
      src/jolly/Makefile.am
  20. 2
      src/jolly/main.c
  21. 1
      src/jtacs/Makefile.am
  22. 8
      src/jtacs/image.c
  23. 7
      src/libaaimage/Makefile.am
  24. 74
      src/libaaimage/aaimage.c
  25. 3
      src/libaaimage/aaimage.h
  26. 3
      src/libmobile/image.h
  27. 4
      src/libmobile/main_mobile.c
  28. 1
      src/mpt1327/Makefile.am
  29. 2
      src/mpt1327/main.c
  30. 1
      src/nmt/Makefile.am
  31. 82
      src/nmt/image.c
  32. 1
      src/r2000/Makefile.am
  33. 59
      src/r2000/image.c
  34. 1
      src/sim/Makefile.am
  35. 70
      src/sim/image.c
  36. 4
      src/sim/main.c
  37. 1
      src/tacs/Makefile.am
  38. 42
      src/tacs/image.c
  39. 2
      src/test/Makefile.am
  40. 2
      src/test/test_dms.c
  41. 2
      src/test/test_sms.c
  42. 1
      src/zeitansage/Makefile.am
  43. 70
      src/zeitansage/image.c

1
.gitignore vendored

@ -50,6 +50,7 @@ src/libv27/libv27.a
src/libmtp/libmtp.a
src/libosmocc/libosmocc.a
src/libg711/libg711.a
src/libaaimage/libaaimage.a
src/anetz/libgermanton.a
src/anetz/anetz
src/bnetz/bnetz

@ -92,6 +92,7 @@ AC_OUTPUT(
src/libmtp/Makefile
src/libosmocc/Makefile
src/libg711/Makefile
src/libaaimage/Makefile
src/anetz/Makefile
src/bnetz/Makefile
src/cnetz/Makefile

@ -29,7 +29,8 @@ SUBDIRS = \
libv27 \
libmtp \
libosmocc \
libg711
libg711 \
libaaimage
if HAVE_ALSA
SUBDIRS += \

@ -45,6 +45,7 @@ amps_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,28 +1,26 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
const char *aaimage[] = {
"",
" @R| |",
" @Y| @R/|===|\\",
" @Y-=@wO@Y=- @R/ |\\ /| \\ @w~",
" @Y| @wAMPS @R/ | X | \\ @w~",
" @Y-=@WO@Y=- @R/ |\\ /| \\ @W~",
" @Y| @WAMPS @R/ | X | \\ @W~",
" @R/ |===| \\",
" @R/ | |\\ \\",
" @R/ /| | \\ \\ @w~",
" @R/ /| | \\ \\ @W~",
" @R|--| / / |===| \\ \\",
" @R/|\\/|\\ / / | | \\ \\",
" @R/ |--| \\ / / | | \\ \\",
" @R/ | |\\ \\ / / |===| \\ \\",
"@g__ @R/ /|--| \\ \\ / / | | \\ \\",
"@g \\_ @R/ / | | \\ \\ / / | | \\ \\",
"@g \\ @R/ / | | \\ \\______/ / | | \\| \\|",
"@g \\@R=========================================================================",
"@g \\_______@R|/\\|@g______ _@G***@g_@G*@g__@G**@g_@G***@g___@G**@g_@G*@g_@R| X | @R|MMMM|",
"@g \\__ @R|\\/|@g \\______/@G* ** * * * ** * @R|/ \\|@g______@y________@R|MMMM|",
"@y _____@g \\_@R|/\\|@G * * * * ** * * * * * * @R|\\ /|@G*@y____/ ~ ~ ~ ~",
"@y/ ~ ~\\@b_______@RI@b__@RI@b_________@G*@b______@G*@b_@G*@b___@G*@b__@G*@b___@G*@b__@G*@b_@G*@b_@R| X |@y/ ~ ~ _________",
"@w__ @R/ /|--| \\ \\ / / | | \\ \\",
"@w \\_ @R/ / | | \\ \\ / / | | \\ \\",
"@w \\ @R/ / | | \\ \\______/ / | | \\| \\|",
"@w \\@R=========================================================================",
"@w \\_______@R|/\\|@w______ _@g***@w_@g*@w__@g**@w_@g***@w___@g**@w_@g*@w_@R| X | @R|MMMM|",
"@w \\__ @R|\\/|@w \\______/@g* ** * * * ** * @R|/ \\|@w______@y________@R|MMMM|",
"@y _____@w \\_@R|/\\|@g * * * * ** * * * * * * @R|\\ /|@g*@y____/ ~ ~ ~ ~",
"@y/ ~ ~\\@b_______@RI@b__@RI@b_________@g*@b______@g*@b_@g*@b___@g*@b__@g*@b___@g*@b__@g*@b_@g*@b_@R| X |@y/ ~ ~ _________",
"@y_______\\@b _ _ _ _ _ _ _ _ _ _ @R|/@y_@R\\@y/ ~ ______/",
"@b _ _ _ _ _ _ _ @y_/~ ~ ____/ ~ ~ ~",
"@b_ @y_@b _ _ _ _ _ @y/_____/ ~ ____________",
@ -32,42 +30,3 @@ const char *image[] = {
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'R': /* bright red */
printf("\033[1;31m");
break;
case 'g': /* gray */
printf("\033[0;37m");
break;
case 'G': /* green */
printf("\033[0;32m");
break;
case 'w': /* white */
printf("\033[1;37m");
break;
case 'b': /* blue */
printf("\033[0;34m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'Y': /* bright yellow */
printf("\033[1;33m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -34,6 +34,7 @@ anetz_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,59 +1,24 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
"@w",
const char *aaimage[] = {
"@W",
"",
" A-NETZ",
"@g /",
" @w~@g /",
" @w~@g / @G/|\\@g",
" @w~@g ___________/_______ @G//|\\\\@g",
" @G/|\\@g /| | |\\\\ @w~@g @G//|\\\\@g",
"@B___@G/|\\@B___________________@g/ | | | \\\\@B_____________@G//|\\\\@B__",
" @G//|\\\\@g _/_____________/_(|_______|________|__\\\\________ @G///|\\\\\\@g",
" @G//|\\\\@g ( - - \\ @G///|\\\\\\@g",
" @G_|_@g | _____ _____ ) @G/ | \\@g",
" =____/@b/ \\@g\\_________________________/@b/ \\@g\\______= @G_|_",
"@w_____________@b( (@w*@b) )@w_________________________@b( (@w*@b) )@w________________",
" @b\\___/@w @b\\___/@w",
"@w /",
" @W~@w /",
" @W~@w / @g/|\\@w",
" @W~@w ___________/_______ @g//|\\\\@w",
" @g/|\\@w /| | |\\\\ @W~@w @g//|\\\\@w",
"@b___@g/|\\@B___________________@w/ | | | \\\\@b_____________@g//|\\\\@b__",
" @g//|\\\\@w _/_____________/_(|_______|________|__\\\\________ @g///|\\\\\\@w",
" @g//|\\\\@w ( - - \\ @g///|\\\\\\@w",
" @g_|_@w | _____ _____ ) @g/ | \\@w",
" =____/@y/ \\@w\\_________________________/@y/ \\@w\\______= @g_|_",
"@W_____________@y( (@W*@y) )@W_________________________@y( (@W*@y) )@W________________",
" @y\\___/@W @y\\___/@W",
" ===== ====== ====== ====== ====== ======",
"",
"____________________________________________________________________",
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'g': /* gray */
printf("\033[0;37m");
break;
case 'G': /* green */
printf("\033[0;32m");
break;
case 'w': /* white */
printf("\033[1;37m");
break;
case 'b': /* brown (yellow) */
printf("\033[0;33m");
break;
case 'B': /* blue */
printf("\033[0;34m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -31,6 +31,7 @@ bnetz_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
bnetz_dialer_SOURCES = \

@ -1,65 +1,36 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
"@g",
const char *aaimage[] = {
"@w",
"",
"",
" \\",
" \\",
" \\",
" \\_ @wB-NETZ@g",
" \\_ @WB-NETZ@w",
" \\ \\",
" \\_\\___",
" / __ )",
" (__\\ _\\________",
" / @G _______@g )",
" / @G/ \\@g/",
" / @G/ @g______@G\\@g___",
" / @G/ @g/ )",
" (__@G\\ @g/ / @w~@g",
" @G\\@g/ ___ /",
" / / \\/ @w~@g",
" / @g _______@w )",
" / @g/ \\@w/",
" / @g/ @w______@g\\@w___",
" / @g/ @w/ )",
" (__@g\\ @w/ / @W~@w",
" @g\\@w/ ___ /",
" / / \\/ @W~@w",
" (______\\ \\",
" \\ \\",
" \\ \\",
" \\ \\",
" @w~@g \\ \\",
" @W~@w \\ \\",
" \\ \\",
" \\ \\@G (###)@g",
" \\ @G(##))########)",
" \\ \\@g (###)@w",
" \\ @g(##))########)",
" (#)))################(#))",
" (#)#(#######)))#################)",
" ((#########)#######################)",
"@w=========================================================",
"@W=========================================================",
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'g':
printf("\033[0;37m");
break;
case 'w':
printf("\033[1;37m");
break;
case 'G':
printf("\033[0;32m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -39,6 +39,7 @@ cnetz_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,80 +1,39 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
"@g _\n"
" @y______________@g ( )\n"
" @y/ \\@g / /\n"
" @y(@w Die Mauer ist@y )@g / /\n"
" @y\\@w gefallen!@y /@g / /\n"
" @y\\_______ __/@g / /\n"
" @y\\ |@g / /\n"
" @wC-NETZ@g @y\\|@g / /\n"
const char *aaimage[] = {
"@w _\n"
" @y______________@w ( )\n"
" @y/ \\@w / /\n"
" @y(@W Die Mauer ist@y )@w / /\n"
" @y\\@W gefallen!@y /@w / /\n"
" @y\\_______ __/@w / /\n"
" @y\\ |@w / /\n"
" @WC-NETZ@w @y\\|@w / /\n"
" __________________/_/_\n"
" / oo /|\n"
" / o o o / |\n"
" / oo / |\n"
" / ________________ / |\n"
" / / @G021250993@g / / /\n"
" / / @g021250993@w / / /\n"
" / /_______________/ / /\n"
" / @b______ ______@g / / @c___@g\n"
" / @b/_@G(@b_@G)@b_/ /_@r(@b_@r)@b_/@g / / @c\\ \\__ @r___/@g\n"
" / @b____ ____ ____@g / / @c_ ) / @r__/ )@g\n"
" / @b/_@w1@b_/ /_@w2@b_/ /_@w3@b_/@g / / @c( \\/ \\@r/ |@g\n"
" / @b____ ____ ____@g / / @c| @r| \\@g\n"
" / @b/_@w4@b_/ /_@w5@b_/ /_@w6@b_/@g / / @c/ @r\\ |@g\n"
" / @b____ ____ ____@g / / @c| BRD @r/ DDR )@g\n"
" / @b/_@w7@b_/ /_@w8@b_/ /_@w9@b_/@g / / @c_| @r/ |@g\n"
" / @b____ ____ ____@g / / @c\\ @r| |@g\n"
" / @b/_@w*@b_/ /_@w0@b_/ /_@w#@b_/@g / / @c/ @r/ ___/@g\n"
" / / / @c| @r\\________/@g\n"
" / o o / / @c\\ \\@g\n"
" /_____________________/ / @c| \\@g\n"
" | | / @c\\___ \\_@g\n"
" | = = | / @c/ /@g\n"
" | = = | / @c/ __ (@g\n"
" |______________________|/ @c|___________/ \\)@g\n"
" / @B______ ______@w / / @c___@w\n"
" / @B/_@g(@B_@g)@B_/ /_@r(@B_@r)@B_/@w / / @c\\ \\__ @r___/@w\n"
" / @B____ ____ ____@w / / @c_ ) / @r__/ )@w\n"
" / @B/_@W1@B_/ /_@W2@B_/ /_@W3@B_/@w / / @c( \\/ \\@r/ |@w\n"
" / @B____ ____ ____@w / / @c| @r| \\@w\n"
" / @B/_@W4@B_/ /_@W5@B_/ /_@W6@B_/@w / / @c/ @r\\ |@w\n"
" / @B____ ____ ____@w / / @c| BRD @r/ DDR )@w\n"
" / @B/_@W7@B_/ /_@W8@B_/ /_@W9@B_/@w / / @c_| @r/ |@w\n"
" / @B____ ____ ____@w / / @c\\ @r| |@w\n"
" / @B/_@W*@B_/ /_@W0@B_/ /_@W#@B_/@w / / @c/ @r/ ___/@w\n"
" / / / @c| @r\\________/@w\n"
" / o o / / @c\\ \\@w\n"
" /_____________________/ / @c| \\@w\n"
" | | / @c\\___ \\_@w\n"
" | = = | / @c/ /@w\n"
" | = = | / @c/ __ (@w\n"
" |______________________|/ @c|___________/ \\)@w\n"
"@w",
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'g': /* gray */
printf("\033[0;37m");
break;
case 'G': /* green */
printf("\033[0;32m");
break;
case 'c': /* cyan */
printf("\033[0;36m");
break;
case 'w': /* white */
printf("\033[1;37m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'r': /* red */
printf("\033[0;31m");
break;
case 'b': /* blue */
printf("\033[1;34m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -30,6 +30,7 @@ eurosignal_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,8 +1,6 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
const char *aaimage[] = {
"@W",
" @B()",
" @B\\",
@ -31,69 +29,3 @@ const char *image[] = {
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'k': /* black */
printf("\033[0;30m");
break;
case 'r': /* red */
printf("\033[0;31m");
break;
case 'g': /* green */
printf("\033[0;32m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'b': /* blue */
printf("\033[0;34m");
break;
case 'm': /* magenta */
printf("\033[0;35m");
break;
case 'c': /* cyan */
printf("\033[0;36m");
break;
case 'w': /* white */
printf("\033[0;37m");
break;
case 'K': /* bright black */
printf("\033[1;30m");
break;
case 'R': /* bright red */
printf("\033[1;31m");
break;
case 'G': /* bright green */
printf("\033[1;32m");
break;
case 'Y': /* bright yellow */
printf("\033[1;33m");
break;
case 'B': /* bright blue */
printf("\033[1;34m");
break;
case 'M': /* bright magenta */
printf("\033[1;35m");
break;
case 'C': /* bright cyan */
printf("\033[1;36m");
break;
case 'W': /* bright white */
printf("\033[1;37m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -33,6 +33,7 @@ fuvst_LDADD = \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libsound/libsound.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
$(ALSA_LIBS) \
-lm
@ -59,6 +60,7 @@ fuvst_sniffer_LDADD = \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libsound/libsound.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
$(ALSA_LIBS) \
-lm

@ -1,82 +1,14 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
const char *aaimage[] = {
"",
"@K ___. @M._____.@K _.",
"@K / \\| @M|/ | \\|@K \\|",
"@K | @M | @K __ | @W * FuVSt *",
"@K [] | []@M | @K /__\\ | [] @K A CNetz @MMSC@K for",
"@K | @M | @K| | @K a real Base Station",
"@K \\___/ @M _|_ @K \\__/ _|_",
"@w ___. @M._____.@w _.",
"@w / \\| @M|/ | \\|@w \\|",
"@w | @M | @w __ | @W * FuVSt *",
"@w [] | []@M | @w /__\\ | [] @w A CNetz @MMSC@w for",
"@w | @M | @w| | @w a real Base Station",
"@w \\___/ @M _|_ @w \\__/ _|_",
"",
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'k': /* black */
printf("\033[0;30m");
break;
case 'r': /* red */
printf("\033[0;31m");
break;
case 'g': /* green */
printf("\033[0;32m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'b': /* blue */
printf("\033[0;34m");
break;
case 'm': /* magenta */
printf("\033[0;35m");
break;
case 'c': /* cyan */
printf("\033[0;36m");
break;
case 'w': /* white */
printf("\033[0;37m");
break;
case 'K': /* bright black */
printf("\033[1;30m");
break;
case 'R': /* bright red */
printf("\033[1;31m");
break;
case 'G': /* bright green */
printf("\033[1;32m");
break;
case 'Y': /* bright yellow */
printf("\033[1;33m");
break;
case 'B': /* bright blue */
printf("\033[1;34m");
break;
case 'M': /* bright magenta */
printf("\033[1;35m");
break;
case 'C': /* bright cyan */
printf("\033[1;36m");
break;
case 'W': /* bright white */
printf("\033[1;37m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -266,7 +266,7 @@ void call_down_disconnect(int __attribute__((unused)) callref, int __attribute__
void call_down_release(int __attribute__((unused)) callref, int __attribute__((unused)) cause) { }
void print_image(void) {}
const char *aaimage[] = { NULL };
void dump_info(void) {}

@ -27,6 +27,7 @@ imts_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
imts_dialer_SOURCES = \

@ -1,77 +1,9 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
const char *aaimage[] = {
"@W",
"IMTS / MTS is back!",
"",
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'k': /* black */
printf("\033[0;30m");
break;
case 'r': /* red */
printf("\033[0;31m");
break;
case 'g': /* green */
printf("\033[0;32m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'b': /* blue */
printf("\033[0;34m");
break;
case 'm': /* magenta */
printf("\033[0;35m");
break;
case 'c': /* cyan */
printf("\033[0;36m");
break;
case 'w': /* white */
printf("\033[0;37m");
break;
case 'K': /* bright black */
printf("\033[1;30m");
break;
case 'R': /* bright red */
printf("\033[1;31m");
break;
case 'G': /* bright green */
printf("\033[1;32m");
break;
case 'Y': /* bright yellow */
printf("\033[1;33m");
break;
case 'B': /* bright blue */
printf("\033[1;34m");
break;
case 'M': /* bright magenta */
printf("\033[1;35m");
break;
case 'C': /* bright cyan */
printf("\033[1;36m");
break;
case 'W': /* bright white */
printf("\033[1;37m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -27,6 +27,7 @@ jollycom_LDADD = \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libfm/libfm.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -47,7 +47,7 @@ static double squelch_db = -INFINITY;
int nbfm = 0;
int repeater = 0;
void print_image(void) {}
const char *aaimage[] = { NULL };
void print_help(const char *arg0)
{

@ -28,6 +28,7 @@ jtacs_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,8 +1,6 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
void print_image(void)
{
}
const char *aaimage[] = {
NULL
};

@ -0,0 +1,7 @@
AM_CPPFLAGS = -Wall -Wextra -g $(all_includes)
noinst_LIBRARIES = libaaimage.a
libaaimage_a_SOURCES = \
aaimage.c

@ -0,0 +1,74 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "aaimage.h"
extern const char *aaimage[];
void print_aaimage(void)
{
int i, j;
for (i = 0; aaimage[i]; i++) {
for (j = 0; j < (int)strlen(aaimage[i]); j++) {
if (aaimage[i][j] == '@') {
j++;
switch(aaimage[i][j]) {
case 'k': /* black */
printf("\033[0;30m");
break;
case 'r': /* red */
printf("\033[0;31m");
break;
case 'g': /* green */
printf("\033[0;32m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'b': /* blue */
printf("\033[0;34m");
break;
case 'm': /* magenta */
printf("\033[0;35m");
break;
case 'c': /* cyan */
printf("\033[0;36m");
break;
case 'w': /* white */
printf("\033[0;37m");
break;
case 'K': /* bright black */
printf("This will not work on some terminals, please use 'w'\n");
abort();
case 'R': /* bright red */
printf("\033[1;31m");
break;
case 'G': /* bright green */
printf("\033[1;32m");
break;
case 'Y': /* bright yellow */
printf("\033[1;33m");
break;
case 'B': /* bright blue */
printf("\033[1;34m");
break;
case 'M': /* bright magenta */
printf("\033[1;35m");
break;
case 'C': /* bright cyan */
printf("\033[1;36m");
break;
case 'W': /* bright white */
printf("\033[1;37m");
break;
}
} else
printf("%c", aaimage[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -0,0 +1,3 @@
void print_aaimage(void);

@ -1,3 +0,0 @@
void print_image(void);

@ -41,7 +41,7 @@
#endif
#include "../liboptions/options.h"
#include "../libfm/fm.h"
#include "image.h"
#include "../libaaimage/aaimage.h"
#define DEFAULT_LO_OFFSET -1000000.0
@ -519,7 +519,7 @@ void main_mobile(const char *name, int *quit, void (*myhandler)(void), const cha
return;
if (!loopback)
print_image();
print_aaimage();
/* real time priority */
if (rt_prio > 0) {

@ -28,6 +28,7 @@ mpt1327_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -50,7 +50,7 @@ static int per = 5;
static int pon = 1;
static int timeout = 30;
void print_image(void) {}
const char *aaimage[] = { NULL };
void print_help(const char *arg0)
{

@ -41,6 +41,7 @@ nmt_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,68 +1,30 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
const char *aaimage[] = {
"",
"@g ______ @r####@w##@r########",
" @g/ \\___ @r__ @r####@w##@r########",
" @g/ Hej! __\\ @r/ ) @r####@w##@r########",
" @g\\ / @r/ / @wNMT @w##############",
" @g\\______/ @r/ / @r####@w##@r########",
" @y_@G_@r/@G__@r/@y_ @b####@y##@b##@r####@w##@r########",
" @y/@G/ \\ @y\\ @b####@y##@b##@r####@w##@r########",
" @y/.@G\\____/@y// @b####@y##@b########",
" @y/@G_@r/@G__@r/@y..// @y##############",
" @y/@G/ \\@y.// @b####@y##@b########",
" @y/.@G\\____/@y// @r####@w|@b#@w|@r#@b####@y##@b########",
" @y/@G_@r/@G__@r/@y..// @r####@w|@b#@w|@r#@b####@y##@b########",
" @y/@G/ \\@y.// @r####@w|@b#@w|@r#######",
" @y\\@G\\____/@y// @b##############",
" @r/ /@y__/ @r####@w|@b#@w|@r#######",
" @r/ / @w####@b##@w##@r####@w|@b#@w|@r#######",
" @r/ / @w####@b##@w##@r####@w|@b#@w|@r#######",
" @r(__/ @w####@b##@w########",
"@w ______ @r####@W##@r########",
" @w/ \\___ @r__ @r####@W##@r########",
" @w/ Hej! __\\ @r/ ) @r####@W##@r########",
" @w\\ / @r/ / @WNMT @W##############",
" @w\\______/ @r/ / @r####@W##@r########",
" @y_@g_@r/@g__@r/@y_ @b####@y##@b##@r####@W##@r########",
" @y/@g/ \\ @y\\ @b####@y##@b##@r####@W##@r########",
" @y/.@g\\____/@y// @b####@y##@b########",
" @y/@g_@r/@g__@r/@y..// @y##############",
" @y/@g/ \\@y.// @b####@y##@b########",
" @y/.@g\\____/@y// @r####@W|@b#@W|@r#@b####@y##@b########",
" @y/@g_@r/@g__@r/@y..// @r####@W|@b#@W|@r#@b####@y##@b########",
" @y/@g/ \\@y.// @r####@W|@b#@W|@r#######",
" @y\\@g\\____/@y// @b##############",
" @r/ /@y__/ @r####@W|@b#@W|@r#######",
" @r/ / @W####@b##@W##@r####@W|@b#@W|@r#######",
" @r/ / @W####@b##@W##@r####@W|@b#@W|@r#######",
" @r(__/ @W####@b##@W########",
" @b##############",
" @w####@b##@w########",
" @w####@b##@w########",
" @w####@b##@w########",
" @W####@b##@W########",
" @W####@b##@W########",
" @W####@b##@W########",
"",
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'r': /* red */
printf("\033[0;31m");
break;
case 'g': /* gray */
printf("\033[0;37m");
break;
case 'G': /* green */
printf("\033[0;32m");
break;
case 'w': /* white */
printf("\033[1;37m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'b': /* blue */
printf("\033[0;34m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -29,6 +29,7 @@ radiocom2000_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,8 +1,6 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
const char *aaimage[] = {
"",
" @B/ \\",
" / @W/ \\@B \\",
@ -31,54 +29,13 @@ const char *image[] = {
" @y/XX/ \\XX\\ @W~",
" @y_/XX/ \\XX\\_",
" @y|/|X/|~|~|~|~|\\X|\\| @W~ ~",
" @G(###) @y###################",
" @G(####)(#####()) @y/XX/X\\_X_X_X_X_X/\\XX\\ @G(#)",
" (#################) @y/XX/\\/ \\/\\XX\\ @G((####)#######)",
" (#######)(#########) @y/XX// \\\\XX\\ @G(#####))############)",
"(############)(######) @y./XX/ @wo @t~@y \\XX\\.@G(####)###############)",
"(######)))(############) @y/####\\ @w'O'@y /####\\@G(()(######)(##########)@W",
" @g(###) @y###################",
" @g(####)(#####()) @y/XX/X\\_X_X_X_X_X/\\XX\\ @g(#)",
" (#################) @y/XX/\\/ \\/\\XX\\ @g((####)#######)",
" (#######)(#########) @y/XX// \\\\XX\\ @g(#####))############)",
"(############)(######) @y./XX/ @wo @c~@y \\XX\\.@g(####)###############)",
"(######)))(############) @y/####\\ @w'O'@y /####\\@g(()(######)(##########)@W",
"===============================================================================",
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'r': /* red */
printf("\033[0;31m");
break;
case 'R': /* red */
printf("\033[1;31m");
break;
case 'B': /* blue */
printf("\033[1;34m");
break;
case 'w': /* white */
printf("\033[0;37m");
break;
case 't': /* turquoise */
printf("\033[0;36m");
break;
case 'G': /* green */
printf("\033[0;32m");
break;
case 'W': /* white */
printf("\033[1;37m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}

@ -14,5 +14,6 @@ cnetz_sim_LDADD = \
$(top_builddir)/src/libdebug/libdebug.a \
$(top_builddir)/src/liboptions/liboptions.a \
$(top_builddir)/src/libserial/libserial.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm

@ -1,10 +1,8 @@
#ifndef ARDUINO
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"
const char *image[] = {
const char *aaimage[] = {
"@w",
" ()",
" // _______________________________________________",
@ -28,70 +26,4 @@ const char *image[] = {
NULL
};
void print_image(void)
{
int i, j;
for (i = 0; image[i]; i++) {
for (j = 0; j < (int)strlen(image[i]); j++) {
if (image[i][j] == '@') {
j++;
switch(image[i][j]) {
case 'k': /* black */
printf("\033[0;30m");
break;
case 'r': /* red */
printf("\033[0;31m");
break;
case 'g': /* green */
printf("\033[0;32m");
break;
case 'y': /* yellow */
printf("\033[0;33m");
break;
case 'b': /* blue */
printf("\033[0;34m");
break;
case 'm': /* magenta */
printf("\033[0;35m");
break;
case 'c': /* cyan */
printf("\033[0;36m");
break;
case 'w': /* white */
printf("\033[0;37m");
break;
case 'K': /* bright black */
printf("\033[1;30m");
break;
case 'R': /* bright red */
printf("\033[1;31m");
break;
case 'G': /* bright green */
printf("\033[1;32m");
break;
case 'Y': /* bright yellow */
printf("\033[1;33m");
break;
case 'B': /* bright blue */
printf("\033[1;34m");
break;
case 'M': /* bright magenta */
printf("\033[1;35m");
break;
case 'C': /* bright cyan */
printf("\033[1;36m");
break;
case 'W': /* bright white */
printf("\033[1;37m");
break;
}
} else
printf("%c", image[i][j]);
}
printf("\n");
}
printf("\033[0;39m");
}
#endif /* ARDUINO */

@ -33,7 +33,7 @@
#include "../libdebug/debug.h"
#include "../liboptions/options.h"
#include "../libserial/serial.h"
#include "../libmobile/image.h"
#include "../libaaimage/aaimage.h"
#include "sim.h"
#include "sniffer.h"
#include "eeprom.h"
@ -445,7 +445,7 @@ int main(int argc, char *argv[])
printf("SIM analyzer ready, please start the phone!\n");
else {
char temp[5][16];
print_image();
print_aaimage();
decode_ebdt(ebdt_data, temp[0], temp[1], temp[2], temp[3], temp[4]);
printf("FUTLN=%s, Sicherungscode=%s, Kartekennung=%s, Sonderheitenschluessel=%s, Wartungsschluessel=%s\n", temp[0], temp[1], temp[2], temp[3], temp[4]);
for (i = 0; i < 8; i++)

@ -29,6 +29,7 @@ tacs_LDADD = \
$(top_builddir)/src/libwave/libwave.a \
$(top_builddir)/src/libsample/libsample.a \
$(top_builddir)/src/libg711/libg711.a \
$(top_builddir)/src/libaaimage/libaaimage.a \
-lm
if HAVE_ALSA

@ -1,15 +1,13 @@
#include <stdio.h>
#include <string.h>
#include "../libmobile/image.h"