Move from local to external osmo* libraries

src/libdebug -> libosmocore
src/libselect -> libosmocore
src/libtimer -> libosmocore
src/libosmocc -> libosmo-cc
src/libg711 -> libosmo-cc
This commit is contained in:
Andreas Eversberg
2024-01-05 14:20:36 +01:00
parent 6cd2c3e323
commit 3158c48365
198 changed files with 4202 additions and 12564 deletions

View File

@@ -24,7 +24,7 @@
#include <pthread.h>
#include <stdlib.h>
#include "../libsample/sample.h"
#include "../libdebug/debug.h"
#include "../liblogging/logging.h"
#include "../libdisplay/display.h"
/* must be odd value! */
@@ -60,14 +60,16 @@ void display_iq_on(int on)
if (iq_on) {
memset(&screen, ' ', sizeof(screen));
memset(&screen_history, 0, sizeof(screen_history));
lock_debug();
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H");
for (j = 0; j < SIZE; j++) {
screen[j][w] = '\0';
puts(screen[j]);
}
printf("\0338"); fflush(stdout);
unlock_debug();
enable_limit_scroll(true);
unlock_logging();
}
if (on < 0) {
@@ -77,9 +79,9 @@ void display_iq_on(int on)
iq_on = on;
if (iq_on)
debug_limit_scroll = SIZE;
logging_limit_scroll_top(SIZE);
else
debug_limit_scroll = 0;
logging_limit_scroll_top(0);
}
/*
@@ -116,8 +118,6 @@ void display_iq(float *samples, int length)
if (!iq_on)
return;
lock_debug();
get_win_size(&width, &h);
if (width > MAX_DISPLAY_WIDTH - 1)
width = MAX_DISPLAY_WIDTH - 1;
@@ -235,6 +235,8 @@ cont:
else
sprintf(screen[0], "(IQ log %.0f dB", db);
*strchr(screen[0], '\0') = ')';
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H");
for (j = 0; j < SIZE; j++) {
for (k = 0; k < width; k++) {
@@ -271,12 +273,12 @@ cont:
}
/* reset color and position */
printf("\033[0;39m\0338"); fflush(stdout);
enable_limit_scroll(true);
unlock_logging();
}
}
disp.interval_pos = pos;
unlock_debug();
}

View File

@@ -26,7 +26,7 @@
#include <math.h>
#include <sys/param.h>
#include "../libsample/sample.h"
#include "../libdebug/debug.h"
#include "../liblogging/logging.h"
#include "../libdisplay/display.h"
#define MAX_NAME_LEN 16
@@ -111,10 +111,10 @@ static void print_measurements(int on)
if (bar_width < 1)
return;
lock_debug();
lines_total = 0;
color = -1;
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H");
for (disp = meas_head; disp; disp = disp->next) {
memset(line, ' ', width);
@@ -253,10 +253,10 @@ static void print_measurements(int on)
}
/* reset color and position */
printf("\033[0;39m\0338"); fflush(stdout);
debug_limit_scroll = lines_total;
unlock_debug();
enable_limit_scroll(true);
unlock_logging();
/* Set new limit. */
logging_limit_scroll_top(lines_total);
}
void display_measurements_on(int on)
@@ -269,7 +269,7 @@ void display_measurements_on(int on)
else
measurements_on = on;
debug_limit_scroll = 0;
logging_limit_scroll_top(0);
}
/* add new parameter on startup to the list of measurements */

View File

@@ -24,7 +24,7 @@
#include <math.h>
#include "../libsample/sample.h"
#include "../libfft/fft.h"
#include "../libdebug/debug.h"
#include "../liblogging/logging.h"
#include "../libdisplay/display.h"
#define HEIGHT 20
@@ -101,14 +101,16 @@ void display_spectrum_on(int on)
if (spectrum_on) {
memset(&screen, ' ', sizeof(screen));
memset(&buffer_hold, 0, sizeof(buffer_hold));
lock_debug();
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H");
for (j = 0; j < HEIGHT; j++) {
screen[j][w] = '\0';
puts(screen[j]);
}
printf("\0338"); fflush(stdout);
unlock_debug();
enable_limit_scroll(true);
unlock_logging();
}
if (on < 0) {
@@ -118,9 +120,9 @@ void display_spectrum_on(int on)
spectrum_on = on;
if (spectrum_on)
debug_limit_scroll = HEIGHT;
logging_limit_scroll_top(HEIGHT);
else
debug_limit_scroll = 0;
logging_limit_scroll_top(0);
}
/*
@@ -142,8 +144,6 @@ void display_spectrum(float *samples, int length)
if (!spectrum_on)
return;
lock_debug();
get_win_size(&width, &h);
if (width > MAX_DISPLAY_WIDTH - 1)
width = MAX_DISPLAY_WIDTH - 1;
@@ -390,6 +390,8 @@ void display_spectrum(float *samples, int length)
screen_color[0][j-1] = 7;
screen_color[0][j+1] = 7;
/* display buffer */
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H");
for (j = 0; j < HEIGHT; j++) {
for (k = 0; k < width; k++) {
@@ -403,12 +405,11 @@ void display_spectrum(float *samples, int length)
}
/* reset color and position */
printf("\033[0;39m\0338"); fflush(stdout);
enable_limit_scroll(true);
unlock_logging();
}
}
disp.interval_pos = pos;
unlock_debug();
}

View File

@@ -23,7 +23,7 @@
#include <pthread.h>
#include <sys/ioctl.h>
#include "../libsample/sample.h"
#include "../libdebug/debug.h"
#include "../liblogging/logging.h"
#include "../libdisplay/display.h"
static int status_on = 0;
@@ -46,7 +46,8 @@ static void print_status(int on)
if (h > lines_total)
h = lines_total;
lock_debug();
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H\033[1;37m");
for (i = 0; i < h; i++) {
j = 0;
@@ -60,7 +61,8 @@ static void print_status(int on)
putchar('\n');
}
printf("\0338"); fflush(stdout);
unlock_debug();
enable_limit_scroll(true);
unlock_logging();
}
void display_status_on(int on)
@@ -77,9 +79,9 @@ void display_status_on(int on)
print_status(1);
if (status_on)
debug_limit_scroll = lines_total;
logging_limit_scroll_top(lines_total);
else
debug_limit_scroll = 0;
logging_limit_scroll_top(0);
}
/* start status display */
@@ -139,7 +141,7 @@ void display_status_end(void)
/* set new total lines */
lines_total = line_count;
if (status_on)
debug_limit_scroll = lines_total;
logging_limit_scroll_top(lines_total);
}

View File

@@ -24,7 +24,7 @@
#include <math.h>
#include <sys/ioctl.h>
#include "../libsample/sample.h"
#include "../libdebug/debug.h"
#include "../liblogging/logging.h"
#include "../libdisplay/display.h"
#define HEIGHT 11
@@ -52,7 +52,8 @@ void display_wave_on(int on)
if (wave_on) {
memset(&screen, ' ', sizeof(screen));
lock_debug();
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H");
for (i = 0; i < num_sender; i++) {
for (j = 0; j < HEIGHT; j++) {
@@ -61,7 +62,8 @@ void display_wave_on(int on)
}
}
printf("\0338"); fflush(stdout);
unlock_debug();
enable_limit_scroll(true);
unlock_logging();
}
if (on < 0)
@@ -70,9 +72,9 @@ void display_wave_on(int on)
wave_on = on;
if (wave_on)
debug_limit_scroll = HEIGHT * num_sender;
logging_limit_scroll_top(HEIGHT * num_sender);
else
debug_limit_scroll = 0;
logging_limit_scroll_top(0);
}
/*
@@ -104,8 +106,6 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
if (!wave_on)
return;
lock_debug();
get_win_size(&width, &h);
if (width > MAX_DISPLAY_WIDTH - 1)
width = MAX_DISPLAY_WIDTH - 1;
@@ -208,6 +208,8 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
}
sprintf(screen[0], "(chan %s", disp->kanal);
*strchr(screen[0], '\0') = ')';
lock_logging();
enable_limit_scroll(false);
printf("\0337\033[H");
for (j = 0; j < disp->offset; j++)
puts("");
@@ -241,12 +243,12 @@ void display_wave(dispwav_t *disp, sample_t *samples, int length, double range)
}
/* reset color and position */
printf("\033[0;39m\0338"); fflush(stdout);
enable_limit_scroll(true);
unlock_logging();
}
}
disp->interval_pos = pos;
unlock_debug();
}