// This software is highly Linux-specific, but I would be glad to get
// patches to make it work on other OS
// This software is highly Linux-specific, but I would be glad to get
// patches to make it work on other OS
int nb_lines_max = 10000;
char pattern_separator = ';';
int output_to_vt_buffer = 0;
int with_colors = 1;
int nb_lines_max = 10000;
char pattern_separator = ';';
int output_to_vt_buffer = 0;
int with_colors = 1;
int color_fg_modeline, color_bg_modeline;
int color_fg_highlight, color_bg_highlight;
int color_fg_modeline, color_bg_modeline;
int color_fg_highlight, color_bg_highlight;
color_fg_highlight = COLOR_BLACK;
color_bg_highlight = COLOR_YELLOW;
setlocale(LC_ALL, "");
char input_filename[buffer_size], output_filename[buffer_size];
color_fg_highlight = COLOR_BLACK;
color_bg_highlight = COLOR_YELLOW;
setlocale(LC_ALL, "");
char input_filename[buffer_size], output_filename[buffer_size];
if(strcmp(argv[i], "-o") == 0) {
check_opt(argc, argv, i, 1, "<output filename>");
strncpy(output_filename, argv[i+1], buffer_size);
if(strcmp(argv[i], "-o") == 0) {
check_opt(argc, argv, i, 1, "<output filename>");
strncpy(output_filename, argv[i+1], buffer_size);
else if(strcmp(argv[i], "-l") == 0) {
check_opt(argc, argv, i, 1, "<maximum number of lines>");
nb_lines_max = atoi(argv[i+1]);
else if(strcmp(argv[i], "-l") == 0) {
check_opt(argc, argv, i, 1, "<maximum number of lines>");
nb_lines_max = atoi(argv[i+1]);
while(nb_lines < nb_lines_max && !file.eof()) {
file.getline(buffer, buffer_size);
if(strcmp(buffer, "") != 0) {
while(nb_lines < nb_lines_max && !file.eof()) {
file.getline(buffer, buffer_size);
if(strcmp(buffer, "") != 0) {
lines[nb_lines] = new char[strlen(s) + 1];
strcpy(lines[nb_lines], s);
nb_lines++;
lines[nb_lines] = new char[strlen(s) + 1];
strcpy(lines[nb_lines], s);
nb_lines++;
if(temporary_line >= 0 && temporary_line < nb_lines) {
inject_into_tty_buffer(lines[temporary_line]);
}
if(temporary_line >= 0 && temporary_line < nb_lines) {
inject_into_tty_buffer(lines[temporary_line]);
}
ofstream out(output_filename);
if(out.fail()) {
cerr << "Can not open " << output_filename << " for writing." << endl;
ofstream out(output_filename);
if(out.fail()) {
cerr << "Can not open " << output_filename << " for writing." << endl;